@scalar/api-client 2.39.4 → 2.40.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 (330) hide show
  1. package/CHANGELOG.md +22 -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 +3 -4
  186. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  187. package/dist/v2/features/modal/helpers/map-hidden-clients-config.js +1 -1
  188. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  189. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  190. package/dist/v2/features/operation/Operation.vue.script.js +50 -84
  191. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  192. package/dist/v2/features/operation/index.d.ts +0 -4
  193. package/dist/v2/features/operation/index.d.ts.map +1 -1
  194. package/dist/v2/features/operation/index.js +1 -5
  195. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  196. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js.map +1 -1
  197. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js +11 -1
  198. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js.map +1 -1
  199. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  200. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  201. package/dist/views/Request/RequestSection/RequestTable.vue.js.map +1 -1
  202. package/dist/views/Request/RequestSection/RequestTable.vue.script.js +1 -1
  203. package/dist/views/Request/RequestSection/RequestTable.vue.script.js.map +1 -1
  204. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.script.js +1 -1
  205. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  206. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js.map +1 -1
  207. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js +2 -2
  208. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js.map +1 -1
  209. package/dist/views/Request/libs/oauth2.js +1 -1
  210. package/dist/views/Request/libs/oauth2.js.map +1 -1
  211. package/package.json +24 -30
  212. package/dist/libs/formatters.d.ts +0 -12
  213. package/dist/libs/formatters.d.ts.map +0 -1
  214. package/dist/libs/formatters.js +0 -36
  215. package/dist/libs/formatters.js.map +0 -1
  216. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts +0 -6
  217. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts.map +0 -1
  218. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js +0 -58
  219. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js.map +0 -1
  220. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +0 -12
  221. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +0 -1
  222. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +0 -65
  223. package/dist/v2/blocks/operation-block/helpers/build-request-body.js.map +0 -1
  224. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +0 -31
  225. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +0 -1
  226. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +0 -55
  227. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js.map +0 -1
  228. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +0 -27
  229. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +0 -1
  230. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +0 -159
  231. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js.map +0 -1
  232. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +0 -25
  233. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +0 -1
  234. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +0 -53
  235. package/dist/v2/blocks/operation-block/helpers/build-request-security.js.map +0 -1
  236. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +0 -46
  237. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +0 -1
  238. package/dist/v2/blocks/operation-block/helpers/build-request.js +0 -102
  239. package/dist/v2/blocks/operation-block/helpers/build-request.js.map +0 -1
  240. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +0 -4
  241. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +0 -1
  242. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +0 -41
  243. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js.map +0 -1
  244. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts +0 -14
  245. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts.map +0 -1
  246. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +0 -20
  247. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js.map +0 -1
  248. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts +0 -8
  249. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts.map +0 -1
  250. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts +0 -9
  251. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts.map +0 -1
  252. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +0 -17
  253. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js.map +0 -1
  254. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +0 -10
  255. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +0 -1
  256. package/dist/v2/blocks/operation-block/helpers/get-example.js +0 -41
  257. package/dist/v2/blocks/operation-block/helpers/get-example.js.map +0 -1
  258. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +0 -26
  259. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +0 -1
  260. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +0 -32
  261. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js.map +0 -1
  262. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +0 -10
  263. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +0 -1
  264. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +0 -15
  265. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js.map +0 -1
  266. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts +0 -3
  267. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts.map +0 -1
  268. package/dist/v2/blocks/operation-block/helpers/get-server-url.js +0 -18
  269. package/dist/v2/blocks/operation-block/helpers/get-server-url.js.map +0 -1
  270. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts +0 -96
  271. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts.map +0 -1
  272. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js +0 -160
  273. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js.map +0 -1
  274. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +0 -40
  275. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +0 -1
  276. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +0 -437
  277. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js.map +0 -1
  278. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +0 -6
  279. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +0 -1
  280. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +0 -25
  281. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js.map +0 -1
  282. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +0 -141
  283. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js.map +0 -1
  284. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +0 -4
  285. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +0 -1
  286. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +0 -10
  287. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js.map +0 -1
  288. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +0 -9
  289. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +0 -1
  290. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +0 -27
  291. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js.map +0 -1
  292. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +0 -25
  293. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +0 -1
  294. package/dist/v2/components/callout/Callout.vue.js +0 -9
  295. package/dist/v2/components/callout/Callout.vue.js.map +0 -1
  296. package/dist/v2/components/callout/Callout.vue.script.js +0 -35
  297. package/dist/v2/components/callout/Callout.vue.script.js.map +0 -1
  298. package/dist/v2/features/operation/helpers/combine-params.d.ts +0 -4
  299. package/dist/v2/features/operation/helpers/combine-params.d.ts.map +0 -1
  300. package/dist/v2/features/operation/helpers/combine-params.js +0 -20
  301. package/dist/v2/features/operation/helpers/combine-params.js.map +0 -1
  302. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +0 -17
  303. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +0 -1
  304. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +0 -12
  305. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +0 -1
  306. package/dist/v2/features/operation/helpers/get-security-requirements.js +0 -17
  307. package/dist/v2/features/operation/helpers/get-security-requirements.js.map +0 -1
  308. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +0 -15
  309. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +0 -1
  310. package/dist/v2/features/operation/helpers/get-selected-security.js +0 -41
  311. package/dist/v2/features/operation/helpers/get-selected-security.js.map +0 -1
  312. package/dist/v2/features/operation/helpers/get-selected-server.d.ts +0 -13
  313. package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +0 -1
  314. package/dist/v2/features/operation/helpers/get-selected-server.js +0 -21
  315. package/dist/v2/features/operation/helpers/get-selected-server.js.map +0 -1
  316. package/dist/v2/helpers/get-active-environment.d.ts +0 -5
  317. package/dist/v2/helpers/get-active-environment.d.ts.map +0 -1
  318. package/dist/v2/helpers/get-active-environment.js +0 -19
  319. package/dist/v2/helpers/get-active-environment.js.map +0 -1
  320. package/dist/v2/helpers/get-active-proxy-url.d.ts +0 -18
  321. package/dist/v2/helpers/get-active-proxy-url.d.ts.map +0 -1
  322. package/dist/v2/helpers/get-active-proxy-url.js +0 -26
  323. package/dist/v2/helpers/get-active-proxy-url.js.map +0 -1
  324. package/dist/v2/helpers/get-servers.d.ts +0 -23
  325. package/dist/v2/helpers/get-servers.d.ts.map +0 -1
  326. package/dist/v2/helpers/get-servers.js +0 -106
  327. package/dist/v2/helpers/get-servers.js.map +0 -1
  328. package/dist/v2/helpers/index.d.ts +0 -3
  329. package/dist/v2/helpers/index.d.ts.map +0 -1
  330. package/dist/v2/helpers/index.js +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"send-request.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/send-request.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { httpStatusCodes } from '@scalar/helpers/http/http-status-codes'\nimport { type ClientPlugin, executeHook } from '@scalar/oas-utils/helpers'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { ERRORS, type ErrorResponse, normalizeError } from '@/libs/errors'\nimport { normalizeHeaders } from '@/libs/normalize-headers'\n\nimport { decodeBuffer } from './decode-buffer'\nimport { getCookieHeaderKeys } from './get-cookie-header-keys'\n\n/** A single set of populated values for a sent request */\nexport type ResponseInstance = Omit<Response, 'headers'> & {\n /** Store headers as an object to match what we had with axios */\n headers: Record<string, string>\n /** Keys of headers which set cookies */\n cookieHeaderKeys: string[]\n /** Time in ms the request took */\n duration: number\n /** The response status */\n status: number\n /** The response status text */\n statusText: string\n /** The response method */\n method: HttpMethod\n /** The request path */\n path: string\n} & (\n | {\n /** The response data */\n data: string | Blob\n /** The response size in bytes */\n size: number\n }\n | {\n /** A stream reader for a streamable response body */\n reader: ReadableStreamDefaultReader<Uint8Array>\n }\n )\n\n/** HTTP status codes that should not include a response body */\nconst NO_BODY_STATUS_CODES = [204, 205, 304]\n\n/**\n * Execute the built fetch request and return a structured response.\n *\n * This function handles the complete request lifecycle including plugin hooks,\n * response processing, streaming detection, and error handling. It supports both\n * standard responses and server-sent event streams.\n *\n * @param request - The request built by the buildRequest helper\n * @param operation - The OpenAPI operation being executed\n * @param plugins - Array of client plugins to execute hooks\n * @param isUsingProxy - Whether the request is being proxied for header handling\n * @returns A tuple with either an error or the response data\n */\nexport const sendRequest = async ({\n isUsingProxy,\n operation,\n request,\n plugins,\n}: {\n isUsingProxy: boolean\n operation: OperationObject\n plugins: ClientPlugin[]\n request: Request\n}): Promise<\n ErrorResponse<{\n response: ResponseInstance\n request: Request\n timestamp: number\n originalResponse: Response\n }>\n> => {\n try {\n // Apply any beforeRequest hooks from the plugins\n const { request: modifiedRequest } = await executeHook({ request }, 'beforeRequest', plugins)\n\n // Execute the request and measure duration\n const startTime = Date.now()\n const response = await fetch(modifiedRequest.clone())\n const endTime = Date.now()\n const duration = endTime - startTime\n\n // Extract response metadata early for reuse\n const contentType = response.headers.get('content-type')\n const responseHeaders = normalizeHeaders(response.headers, isUsingProxy)\n const responseUrl = new URL(response.url)\n const fullPath = responseUrl.pathname + responseUrl.search\n const statusText = response.statusText || httpStatusCodes[response.status]?.name || ''\n const method = modifiedRequest.method as HttpMethod\n const shouldSkipBody = NO_BODY_STATUS_CODES.includes(response.status)\n\n /**\n * Handle server-sent event streams separately.\n * These responses need a reader instead of buffered data.\n * We check this early to avoid unnecessary body reading.\n */\n if (contentType?.startsWith('text/event-stream') && response.body) {\n return buildStreamingResponse({\n response,\n modifiedRequest,\n operation,\n plugins,\n endTime,\n duration,\n responseHeaders,\n statusText,\n method,\n fullPath,\n })\n }\n\n return buildStandardResponse({\n response,\n modifiedRequest,\n operation,\n plugins,\n endTime,\n duration,\n responseHeaders,\n statusText,\n method,\n fullPath,\n contentType,\n shouldSkipBody,\n })\n } catch (error) {\n return [normalizeError(error, ERRORS.REQUEST_FAILED), null]\n }\n}\n\n/**\n * Build a streaming response for server-sent events.\n * Streaming responses use a reader instead of buffering the entire body.\n */\nconst buildStreamingResponse = async ({\n response,\n modifiedRequest,\n operation,\n plugins,\n endTime,\n duration,\n responseHeaders,\n statusText,\n method,\n fullPath,\n}: {\n response: Response\n modifiedRequest: Request\n operation: OperationObject\n plugins: ClientPlugin[]\n endTime: number\n duration: number\n responseHeaders: Record<string, string>\n statusText: string\n method: HttpMethod\n fullPath: string\n}): Promise<\n ErrorResponse<{\n response: ResponseInstance\n request: Request\n timestamp: number\n originalResponse: Response\n }>\n> => {\n const normalizedResponse = new Response(null, {\n status: response.status,\n statusText,\n headers: response.headers,\n })\n\n await executeHook({ response: normalizedResponse, request: modifiedRequest, operation }, 'responseReceived', plugins)\n const cookieHeaderKeys = getCookieHeaderKeys(normalizedResponse.headers)\n\n return [\n null,\n {\n timestamp: endTime,\n request: modifiedRequest,\n response: {\n ...normalizedResponse,\n headers: responseHeaders,\n cookieHeaderKeys,\n reader: response.body!.getReader(),\n duration,\n method,\n path: fullPath,\n },\n originalResponse: normalizedResponse.clone(),\n },\n ]\n}\n\n/**\n * Build a standard response with buffered body data.\n * This handles all non-streaming responses including JSON, text, and binary data.\n */\nconst buildStandardResponse = async ({\n response,\n modifiedRequest,\n operation,\n plugins,\n endTime,\n duration,\n responseHeaders,\n statusText,\n method,\n fullPath,\n contentType,\n shouldSkipBody,\n}: {\n response: Response\n modifiedRequest: Request\n operation: OperationObject\n plugins: ClientPlugin[]\n endTime: number\n duration: number\n responseHeaders: Record<string, string>\n statusText: string\n method: HttpMethod\n fullPath: string\n contentType: string | null\n shouldSkipBody: boolean\n}): Promise<\n ErrorResponse<{\n response: ResponseInstance\n request: Request\n timestamp: number\n originalResponse: Response\n }>\n> => {\n /**\n * Clone the response to preserve the original for body reading.\n * Read the body once and reuse the buffer for both decoding and creating a new Response.\n */\n const clonedResponse = response.clone()\n const arrayBuffer = await clonedResponse.arrayBuffer()\n const responseType = contentType ?? 'text/plain;charset=UTF-8'\n const responseData = decodeBuffer(arrayBuffer, responseType)\n\n /**\n * Create a new Response using the arrayBuffer we already read.\n * ArrayBuffers can be reused to create new Response objects without additional memory.\n */\n const normalizedResponse = new Response(shouldSkipBody ? null : arrayBuffer, {\n status: response.status,\n statusText,\n headers: response.headers,\n })\n\n await executeHook({ response: normalizedResponse, request: modifiedRequest, operation }, 'responseReceived', plugins)\n const cookieHeaderKeys = getCookieHeaderKeys(normalizedResponse.headers)\n\n return [\n null,\n {\n timestamp: endTime,\n request: modifiedRequest,\n response: {\n ...normalizedResponse,\n headers: responseHeaders,\n cookieHeaderKeys,\n data: responseData,\n size: arrayBuffer.byteLength,\n duration,\n method,\n status: response.status,\n path: fullPath,\n },\n originalResponse: response.clone(),\n },\n ]\n}\n"],"mappings":";;;;;;;;AAyCA,IAAM,uBAAuB;CAAC;CAAK;CAAK;CAAI;;;;;;;;;;;;;;AAe5C,IAAa,cAAc,OAAO,EAChC,cACA,WACA,SACA,cAa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KAAM,WAAW;GAClC;GACA;GACA,MAAM;GACP;EACD,kBAAkB,mBAAmB,OAAO;EAC7C,CACF;;;;;;AAOH,IAAM,wBAAwB,OAAO,EACnC,UACA,iBACA,WACA,SACA,SACA,UACA,iBACA,YACA,QACA,UACA,aACA,qBAqBG;CAMH,MAAM,cAAc,MADG,SAAS,OAAO,CACE,aAAa;CAEtD,MAAM,eAAe,aAAa,aADb,eAAe,2BACwB;;;;;CAM5D,MAAM,qBAAqB,IAAI,SAAS,iBAAiB,OAAO,aAAa;EAC3E,QAAQ,SAAS;EACjB;EACA,SAAS,SAAS;EACnB,CAAC;AAEF,OAAM,YAAY;EAAE,UAAU;EAAoB,SAAS;EAAiB;EAAW,EAAE,oBAAoB,QAAQ;CACrH,MAAM,mBAAmB,oBAAoB,mBAAmB,QAAQ;AAExE,QAAO,CACL,MACA;EACE,WAAW;EACX,SAAS;EACT,UAAU;GACR,GAAG;GACH,SAAS;GACT;GACA,MAAM;GACN,MAAM,YAAY;GAClB;GACA;GACA,QAAQ,SAAS;GACjB,MAAM;GACP;EACD,kBAAkB,SAAS,OAAO;EACnC,CACF"}
1
+ {"version":3,"file":"send-request.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/send-request.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { httpStatusCodes } from '@scalar/helpers/http/http-status-codes'\n\nimport { ERRORS, type ErrorResponse, normalizeError } from '@/libs/errors'\nimport { normalizeHeaders } from '@/libs/normalize-headers'\n\nimport { decodeBuffer } from './decode-buffer'\nimport { getCookieHeaderKeys } from './get-cookie-header-keys'\n\n/** A single set of populated values for a sent request */\nexport type ResponseInstance = Omit<Response, 'headers'> & {\n /** Store headers as an object to match what we had with axios */\n headers: Record<string, string>\n /** Keys of headers which set cookies */\n cookieHeaderKeys: string[]\n /** Time in ms the request took */\n duration: number\n /** The response status */\n status: number\n /** The response status text */\n statusText: string\n /** The response method */\n method: HttpMethod\n /** The request path */\n path: string\n} & (\n | {\n /** The response data */\n data: string | Blob\n /** The response size in bytes */\n size: number\n }\n | {\n /** A stream reader for a streamable response body */\n reader: ReadableStreamDefaultReader<Uint8Array>\n }\n )\n\n/** HTTP status codes that should not include a response body */\nconst NO_BODY_STATUS_CODES = [204, 205, 304]\n\n/**\n * Execute the built fetch request and return a structured response.\n *\n * This function handles the complete request lifecycle including plugin hooks,\n * response processing, streaming detection, and error handling. It supports both\n * standard responses and server-sent event streams.\n *\n * @param request - The request built by the buildRequest helper\n * @param operation - The OpenAPI operation being executed\n * @param plugins - Array of client plugins to execute hooks\n * @param isUsingProxy - Whether the request is being proxied for header handling\n * @returns A tuple with either an error or the response data\n */\nexport const sendRequest = async ({\n isUsingProxy,\n request,\n}: {\n isUsingProxy: boolean\n request: Request\n}): Promise<\n ErrorResponse<{\n response: ResponseInstance\n request: Request\n timestamp: number\n originalResponse: Response\n }>\n> => {\n try {\n // Execute the request and measure duration\n const startTime = performance.now()\n const response = await fetch(request.clone())\n const endTime = performance.now()\n const timestamp = Date.now()\n const duration = endTime - startTime\n\n // Extract response metadata early for reuse\n const contentType = response.headers.get('content-type')\n const responseHeaders = normalizeHeaders(response.headers, isUsingProxy)\n const responseUrl = new URL(response.url)\n const fullPath = responseUrl.pathname + responseUrl.search\n const statusText = response.statusText || httpStatusCodes[response.status]?.name || ''\n const method = request.method as HttpMethod\n const shouldSkipBody = NO_BODY_STATUS_CODES.includes(response.status)\n\n /**\n * Handle server-sent event streams separately.\n * These responses need a reader instead of buffered data.\n * We check this early to avoid unnecessary body reading.\n */\n if (contentType?.startsWith('text/event-stream') && response.body) {\n return buildStreamingResponse({\n response,\n request,\n timestamp,\n duration,\n responseHeaders,\n statusText,\n method,\n fullPath,\n })\n }\n\n return buildStandardResponse({\n response,\n request,\n timestamp,\n duration,\n responseHeaders,\n statusText,\n method,\n fullPath,\n contentType,\n shouldSkipBody,\n })\n } catch (error) {\n return [normalizeError(error, ERRORS.REQUEST_FAILED), null]\n }\n}\n\n/**\n * Build a streaming response for server-sent events.\n * Streaming responses use a reader instead of buffering the entire body.\n */\nconst buildStreamingResponse = ({\n response,\n request,\n timestamp,\n duration,\n responseHeaders,\n statusText,\n method,\n fullPath,\n}: {\n response: Response\n request: Request\n timestamp: number\n duration: number\n responseHeaders: Record<string, string>\n statusText: string\n method: HttpMethod\n fullPath: string\n}): ErrorResponse<{\n response: ResponseInstance\n request: Request\n timestamp: number\n originalResponse: Response\n}> => {\n const normalizedResponse = new Response(null, {\n status: response.status,\n statusText,\n headers: response.headers,\n })\n\n const cookieHeaderKeys = getCookieHeaderKeys(normalizedResponse.headers)\n\n return [\n null,\n {\n timestamp,\n request: request,\n response: {\n ...normalizedResponse,\n headers: responseHeaders,\n cookieHeaderKeys,\n reader: response.body!.getReader(),\n duration,\n method,\n path: fullPath,\n },\n originalResponse: normalizedResponse.clone(),\n },\n ]\n}\n\n/**\n * Build a standard response with buffered body data.\n * This handles all non-streaming responses including JSON, text, and binary data.\n */\nconst buildStandardResponse = async ({\n response,\n request,\n timestamp,\n duration,\n responseHeaders,\n statusText,\n method,\n fullPath,\n contentType,\n shouldSkipBody,\n}: {\n response: Response\n request: Request\n timestamp: number\n duration: number\n responseHeaders: Record<string, string>\n statusText: string\n method: HttpMethod\n fullPath: string\n contentType: string | null\n shouldSkipBody: boolean\n}): Promise<\n ErrorResponse<{\n response: ResponseInstance\n request: Request\n timestamp: number\n originalResponse: Response\n }>\n> => {\n /**\n * Clone the response to preserve the original for body reading.\n * Read the body once and reuse the buffer for both decoding and creating a new Response.\n */\n const clonedResponse = response.clone()\n const arrayBuffer = await clonedResponse.arrayBuffer()\n const responseType = contentType ?? 'text/plain;charset=UTF-8'\n const responseData = decodeBuffer(arrayBuffer, responseType)\n\n /**\n * Create a new Response using the arrayBuffer we already read.\n * ArrayBuffers can be reused to create new Response objects without additional memory.\n */\n const normalizedResponse = new Response(shouldSkipBody ? null : arrayBuffer, {\n status: response.status,\n statusText,\n headers: response.headers,\n })\n\n const cookieHeaderKeys = getCookieHeaderKeys(normalizedResponse.headers)\n\n return [\n null,\n {\n timestamp,\n request: request,\n response: {\n ...normalizedResponse,\n headers: responseHeaders,\n cookieHeaderKeys,\n data: responseData,\n size: arrayBuffer.byteLength,\n duration,\n method,\n status: response.status,\n path: fullPath,\n },\n originalResponse: response.clone(),\n },\n ]\n}\n"],"mappings":";;;;;;;AAuCA,IAAM,uBAAuB;CAAC;CAAK;CAAK;CAAI;;;;;;;;;;;;;;AAe5C,IAAa,cAAc,OAAO,EAChC,cACA,cAWG;AACH,KAAI;EAEF,MAAM,YAAY,YAAY,KAAK;EACnC,MAAM,WAAW,MAAM,MAAM,QAAQ,OAAO,CAAC;EAC7C,MAAM,UAAU,YAAY,KAAK;EACjC,MAAM,YAAY,KAAK,KAAK;EAC5B,MAAM,WAAW,UAAU;EAG3B,MAAM,cAAc,SAAS,QAAQ,IAAI,eAAe;EACxD,MAAM,kBAAkB,iBAAiB,SAAS,SAAS,aAAa;EACxE,MAAM,cAAc,IAAI,IAAI,SAAS,IAAI;EACzC,MAAM,WAAW,YAAY,WAAW,YAAY;EACpD,MAAM,aAAa,SAAS,cAAc,gBAAgB,SAAS,SAAS,QAAQ;EACpF,MAAM,SAAS,QAAQ;EACvB,MAAM,iBAAiB,qBAAqB,SAAS,SAAS,OAAO;;;;;;AAOrE,MAAI,aAAa,WAAW,oBAAoB,IAAI,SAAS,KAC3D,QAAO,uBAAuB;GAC5B;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;AAGJ,SAAO,sBAAsB;GAC3B;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;UACK,OAAO;AACd,SAAO,CAAC,eAAe,OAAO,OAAO,eAAe,EAAE,KAAK;;;;;;;AAQ/D,IAAM,0BAA0B,EAC9B,UACA,SACA,WACA,UACA,iBACA,YACA,QACA,eAeI;CACJ,MAAM,qBAAqB,IAAI,SAAS,MAAM;EAC5C,QAAQ,SAAS;EACjB;EACA,SAAS,SAAS;EACnB,CAAC;CAEF,MAAM,mBAAmB,oBAAoB,mBAAmB,QAAQ;AAExE,QAAO,CACL,MACA;EACE;EACS;EACT,UAAU;GACR,GAAG;GACH,SAAS;GACT;GACA,QAAQ,SAAS,KAAM,WAAW;GAClC;GACA;GACA,MAAM;GACP;EACD,kBAAkB,mBAAmB,OAAO;EAC7C,CACF;;;;;;AAOH,IAAM,wBAAwB,OAAO,EACnC,UACA,SACA,WACA,UACA,iBACA,YACA,QACA,UACA,aACA,qBAmBG;CAMH,MAAM,cAAc,MADG,SAAS,OAAO,CACE,aAAa;CAEtD,MAAM,eAAe,aAAa,aADb,eAAe,2BACwB;;;;;CAM5D,MAAM,qBAAqB,IAAI,SAAS,iBAAiB,OAAO,aAAa;EAC3E,QAAQ,SAAS;EACjB;EACA,SAAS,SAAS;EACnB,CAAC;CAEF,MAAM,mBAAmB,oBAAoB,mBAAmB,QAAQ;AAExE,QAAO,CACL,MACA;EACE;EACS;EACT,UAAU;GACR,GAAG;GACH,SAAS;GACT;GACA,MAAM;GACN,MAAM,YAAY;GAClB;GACA;GACA,QAAQ,SAAS;GACjB,MAAM;GACP;EACD,kBAAkB,SAAS,OAAO;EACnC,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate-path-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/validate-path-parameters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAMlH,KAAK,4BAA4B,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAazF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAY,aAAa,CAAC,eAAe,CAAC,EAAO,EACjD,aAAY,MAAkB,KAC7B,4BAoBF,CAAA"}
1
+ {"version":3,"file":"validate-path-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/validate-path-parameters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAIlH,KAAK,4BAA4B,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAazF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAY,aAAa,CAAC,eAAe,CAAC,EAAO,EACjD,aAAY,MAAkB,KAC7B,4BAoBF,CAAA"}
@@ -1,5 +1,5 @@
1
- import { getExample } from "./get-example.js";
2
1
  import { isParamDisabled } from "../../request-block/helpers/is-param-disabled.js";
2
+ import { getExample } from "@scalar/workspace-store/request-example";
3
3
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
4
  //#region src/v2/blocks/operation-block/helpers/validate-path-parameters.ts
5
5
  /** Treats undefined, null, and blank/whitespace strings as empty. */
@@ -1 +1 @@
1
- {"version":3,"file":"validate-path-parameters.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/validate-path-parameters.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { ParameterObject, ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { isParamDisabled } from '@/v2/blocks/request-block/helpers/is-param-disabled'\n\nimport { getExample } from './get-example'\n\ntype ValidatePathParametersResult = { ok: true } | { ok: false; invalidParams: string[] }\n\n/** Treats undefined, null, and blank/whitespace strings as empty. */\nconst isEmptyParamValue = (value: unknown): boolean => {\n if (value === undefined || value === null) {\n return true\n }\n if (typeof value === 'string') {\n return value.trim() === ''\n }\n return false\n}\n\n/**\n * Validates that all required path parameters have non-empty values.\n *\n * Path parameters are always required per the OpenAPI specification.\n * Returns the names of any path parameters that are missing values.\n */\nexport const validatePathParameters = (\n parameters: ReferenceType<ParameterObject>[] = [],\n exampleKey: string = 'default',\n): ValidatePathParametersResult => {\n const invalidParams: string[] = []\n\n for (const referencedParam of parameters) {\n const param = getResolvedRef(referencedParam)\n if (param.in !== 'path') {\n continue\n }\n\n const example = getExample(param, exampleKey, undefined)\n if (isParamDisabled(param, example)) {\n continue\n }\n\n if (isEmptyParamValue(example?.value)) {\n invalidParams.push(param.name)\n }\n }\n\n return invalidParams.length > 0 ? { ok: false, invalidParams } : { ok: true }\n}\n"],"mappings":";;;;;AAUA,IAAM,qBAAqB,UAA4B;AACrD,KAAI,UAAU,KAAA,KAAa,UAAU,KACnC,QAAO;AAET,KAAI,OAAO,UAAU,SACnB,QAAO,MAAM,MAAM,KAAK;AAE1B,QAAO;;;;;;;;AAST,IAAa,0BACX,aAA+C,EAAE,EACjD,aAAqB,cACY;CACjC,MAAM,gBAA0B,EAAE;AAElC,MAAK,MAAM,mBAAmB,YAAY;EACxC,MAAM,QAAQ,eAAe,gBAAgB;AAC7C,MAAI,MAAM,OAAO,OACf;EAGF,MAAM,UAAU,WAAW,OAAO,YAAY,KAAA,EAAU;AACxD,MAAI,gBAAgB,OAAO,QAAQ,CACjC;AAGF,MAAI,kBAAkB,SAAS,MAAM,CACnC,eAAc,KAAK,MAAM,KAAK;;AAIlC,QAAO,cAAc,SAAS,IAAI;EAAE,IAAI;EAAO;EAAe,GAAG,EAAE,IAAI,MAAM"}
1
+ {"version":3,"file":"validate-path-parameters.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/validate-path-parameters.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { getExample } from '@scalar/workspace-store/request-example'\nimport type { ParameterObject, ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { isParamDisabled } from '@/v2/blocks/request-block/helpers/is-param-disabled'\n\ntype ValidatePathParametersResult = { ok: true } | { ok: false; invalidParams: string[] }\n\n/** Treats undefined, null, and blank/whitespace strings as empty. */\nconst isEmptyParamValue = (value: unknown): boolean => {\n if (value === undefined || value === null) {\n return true\n }\n if (typeof value === 'string') {\n return value.trim() === ''\n }\n return false\n}\n\n/**\n * Validates that all required path parameters have non-empty values.\n *\n * Path parameters are always required per the OpenAPI specification.\n * Returns the names of any path parameters that are missing values.\n */\nexport const validatePathParameters = (\n parameters: ReferenceType<ParameterObject>[] = [],\n exampleKey: string = 'default',\n): ValidatePathParametersResult => {\n const invalidParams: string[] = []\n\n for (const referencedParam of parameters) {\n const param = getResolvedRef(referencedParam)\n if (param.in !== 'path') {\n continue\n }\n\n const example = getExample(param, exampleKey, undefined)\n if (isParamDisabled(param, example)) {\n continue\n }\n\n if (isEmptyParamValue(example?.value)) {\n invalidParams.push(param.name)\n }\n }\n\n return invalidParams.length > 0 ? { ok: false, invalidParams } : { ok: true }\n}\n"],"mappings":";;;;;AASA,IAAM,qBAAqB,UAA4B;AACrD,KAAI,UAAU,KAAA,KAAa,UAAU,KACnC,QAAO;AAET,KAAI,OAAO,UAAU,SACnB,QAAO,MAAM,MAAM,KAAK;AAE1B,QAAO;;;;;;;;AAST,IAAa,0BACX,aAA+C,EAAE,EACjD,aAAqB,cACY;CACjC,MAAM,gBAA0B,EAAE;AAElC,MAAK,MAAM,mBAAmB,YAAY;EACxC,MAAM,QAAQ,eAAe,gBAAgB;AAC7C,MAAI,MAAM,OAAO,OACf;EAGF,MAAM,UAAU,WAAW,OAAO,YAAY,KAAA,EAAU;AACxD,MAAI,gBAAgB,OAAO,QAAQ,CACjC;AAGF,MAAI,kBAAkB,SAAS,MAAM,CACnC,eAAc,KAAK,MAAM,KAAK;;AAIlC,QAAO,cAAc,SAAS,IAAI;EAAE,IAAI;EAAO;EAAe,GAAG,EAAE,IAAI,MAAM"}
@@ -1,5 +1,2 @@
1
- export { buildRequestSecurity, getSecuritySchemes } from './helpers/build-request-security.js';
2
- export { getExample } from './helpers/get-example.js';
3
- export { getResolvedUrl } from './helpers/get-resolved-url.js';
4
1
  export { default as OperationBlock } from './OperationBlock.vue.js';
5
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
@@ -1,5 +1,2 @@
1
- import { buildRequestSecurity, getSecuritySchemes } from "./helpers/build-request-security.js";
2
- import { getExample } from "./helpers/get-example.js";
3
- import { getResolvedUrl } from "./helpers/get-resolved-url.js";
4
1
  import OperationBlock_default from "./OperationBlock.vue.js";
5
- export { OperationBlock_default as OperationBlock, buildRequestSecurity, getExample, getResolvedUrl, getSecuritySchemes };
2
+ export { OperationBlock_default as OperationBlock };
@@ -1,10 +1,10 @@
1
1
  import type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods';
2
2
  import { type AvailableClients } from '@scalar/snippetz';
3
3
  import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
4
+ import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example';
4
5
  import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
5
6
  import type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
6
7
  import type { ClientOptionGroup } from '../../../../v2/blocks/operation-code-sample/types';
7
- import type { SecuritySchemeObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
8
8
  export type OperationCodeSampleProps = {
9
9
  /**
10
10
  * Integration type: determines if the code sample is displayed in a client environment
@@ -1 +1 @@
1
- {"version":3,"file":"OperationCodeSample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"names":[],"mappings":"AAmeA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAErF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAiBrE,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAM7G,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;IACpC;;OAEG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IACpC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;OAEG;IACH,eAAe,EAAE,0BAA0B,EAAE,CAAA;IAC7C;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,eAAe,CAAA;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAA;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B;;;OAGG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzD,CAAA;AAED;;;;;;;;GAQG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IA8KlB,8DAA8D;sBAC1C,MAAM;;;;IAD1B,8DAA8D;sBAC1C,MAAM;;;;YA1JhB,MAAM,OAAO;YACb,CAAC,EAAE,WAAW,EAAE,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO;EA8gB3D,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"OperationCodeSample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"names":[],"mappings":"AAqeA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAErF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAA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W,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO;EAghB3D,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
2
2
  import OperationCodeSample_vue_vue_type_script_setup_true_lang_default from "./OperationCodeSample.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue
5
- var OperationCodeSample_default = /* @__PURE__ */ _plugin_vue_export_helper_default(OperationCodeSample_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-f52db2cc"]]);
5
+ var OperationCodeSample_default = /* @__PURE__ */ _plugin_vue_export_helper_default(OperationCodeSample_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-0e4ddc16"]]);
6
6
  //#endregion
7
7
  export { OperationCodeSample_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"OperationCodeSample.vue.js","names":[],"sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type OperationCodeSampleProps = {\n /**\n * Integration type: determines if the code sample is displayed in a client environment\n * or in an API reference environment.\n */\n integration?: 'client' | 'reference'\n /**\n * List of all http clients formatted into option groups for the client selector\n */\n clientOptions: ClientOptionGroup[]\n /**\n * Pre-selected client, this will determine which client is initially selected in the dropdown\n *\n * @defaults to shell/curl or a custom sample if one is available\n */\n selectedClient?: AvailableClients[number]\n /**\n * Which server from the spec to use for the code example\n */\n selectedServer?: ServerObject | null\n /**\n * The selected content type from the requestBody.content, this will determine which examples are available\n * as well as the content type of the code example\n *\n * @defaults to the first content type if not provided\n */\n selectedContentType?: string\n /**\n * Example name to use for resolving example values for parameters AND requestBody\n *\n * @example \"limited\"\n * ```ts\n * parameters: {\n * name: 'foobar',\n * in: 'query',\n * examples: {\n * limited: {\n * dataValue: 10,\n * }\n * }\n * },\n * body: {\n * content: {\n * 'application/json': {\n * examples: {\n * limited: {\n * dataValue: { foo: 'bar' },\n * }\n * }\n * }\n * }\n * }\n *\n * ```\n */\n selectedExample?: string\n /**\n * Event bus\n */\n eventBus: WorkspaceEventBus\n /**\n * The security schemes which are applicable to this operation\n */\n securitySchemes: SecuritySchemeObjectSecret[]\n /**\n * HTTP method of the operation\n */\n method: HttpMethodType\n /**\n * Path of the operation\n */\n path: string\n /**\n * De-referenced OpenAPI Operation object\n */\n operation: OperationObject\n /**\n * If true and there's no example, we will display a small card with the method and path only\n */\n fallback?: boolean\n /**\n * A method to generate the label of the block, should return an html string\n */\n generateLabel?: () => string\n /**\n * If true, render this as a webhook request example\n */\n isWebhook?: boolean\n /**\n * Workspace + document cookies\n */\n globalCookies?: XScalarCookie[]\n /**\n * When the request body schema uses oneOf/anyOf, use these selected variants\n * for the example snippet (e.g. from the schema dropdowns in the API reference).\n */\n requestBodyCompositionSelection?: Record<string, number>\n}\n\n/**\n * Request Example\n *\n * The core component for rendering a request example block,\n * this component does not have much of its own state but operates on props and custom events\n *\n * @event workspace:update:selected-client - Emitted when the selected client changes\n * @event scalar-update-selected-example - removed for now, we can bring it back when we need it\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarCard,\n ScalarCardFooter,\n ScalarCardHeader,\n ScalarCardSection,\n ScalarCodeBlock,\n ScalarCombobox,\n ScalarVirtualText,\n} from '@scalar/components'\nimport { freezeElement } from '@scalar/helpers/dom/freeze-element'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { type AvailableClients } from '@scalar/snippetz'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { operationToHar } from '@v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har'\nimport {\n computed,\n onBeforeMount,\n ref,\n useId,\n watch,\n type ComponentPublicInstance,\n} from 'vue'\n\nimport HttpMethod from '@/v2/blocks/operation-code-sample/components/HttpMethod.vue'\nimport { filterClientsByQuery } from '@/v2/blocks/operation-code-sample/helpers/filter-clients-by-query'\nimport { findClient } from '@/v2/blocks/operation-code-sample/helpers/find-client'\nimport { getClients } from '@/v2/blocks/operation-code-sample/helpers/get-clients'\nimport { getCustomCodeSamples } from '@/v2/blocks/operation-code-sample/helpers/get-custom-code-samples'\nimport { getSecrets } from '@/v2/blocks/operation-code-sample/helpers/get-secrets'\nimport type {\n ClientOption,\n ClientOptionGroup,\n CustomClientOption,\n} from '@/v2/blocks/operation-code-sample/types'\nimport type { SecuritySchemeObjectSecret } from '@/v2/blocks/scalar-auth-selector-block/helpers/secret-types'\n\nimport { generateCodeSnippet } from '../helpers/generate-code-snippet'\nimport ExamplePicker from './ExamplePicker.vue'\n\nconst {\n integration,\n clientOptions,\n selectedClient,\n selectedServer = null,\n selectedContentType,\n securitySchemes = [],\n method,\n eventBus,\n path,\n operation,\n isWebhook,\n generateLabel,\n globalCookies,\n requestBodyCompositionSelection,\n} = defineProps<OperationCodeSampleProps>()\n\ndefineSlots<{\n header: () => unknown\n footer: ({ exampleName }: { exampleName: string }) => unknown\n}>()\n\n/** Grab the examples for the given content type */\nconst requestBodyExamples = computed(() => {\n const content = getResolvedRef(operation.requestBody)?.content ?? {}\n const contentType = selectedContentType || Object.keys(content)[0]\n if (!contentType) return {}\n\n const examples = content[contentType]?.examples ?? {}\n\n return examples\n})\n\n/** The currently selected example key with v-model support */\nconst selectedExampleKey = defineModel<string>('selectedExample', {\n default: '',\n})\n\n// Set default value to the first example\nonBeforeMount(() => {\n selectedExampleKey.value ||= Object.keys(requestBodyExamples.value)[0] ?? ''\n})\n\n/** Grab any custom code samples from the operation */\nconst customCodeSamples = computed(() => getCustomCodeSamples(operation))\n\n/** Merge custom code samples with the client options */\nconst clients = computed(() =>\n getClients(customCodeSamples.value, clientOptions),\n)\n\n/** The locally selected client which would include code samples from this operation only */\nconst localSelectedClient = ref<ClientOption | CustomClientOption | undefined>(\n findClient(clients.value, selectedClient),\n)\n\n/** If the globally selected client changes we can update the local one */\nwatch(\n () => selectedClient,\n (newClient) => {\n const client = findClient(clients.value, newClient)\n if (client) {\n localSelectedClient.value = client\n }\n },\n)\n\n/** Generate HAR data for webhook requests */\nconst webhookHar = computed(() => {\n if (!isWebhook) return null\n\n try {\n return operationToHar({\n operation,\n method,\n path,\n example: selectedExampleKey.value,\n requestBodyCompositionSelection,\n })\n } catch (error) {\n console.error('[webhookHar]', error)\n return null\n }\n})\n\n/** Generate the code snippet for the selected example */\nconst generatedCode = computed<string>(() => {\n if (isWebhook) {\n return webhookHar.value?.postData?.text ?? ''\n }\n\n return generateCodeSnippet({\n includeDefaultHeaders: integration === 'client',\n clientId: localSelectedClient.value?.id,\n customCodeSamples: customCodeSamples.value,\n operation,\n method,\n path,\n contentType: selectedContentType,\n server: selectedServer,\n securitySchemes,\n example: selectedExampleKey.value,\n globalCookies,\n requestBodyCompositionSelection,\n })\n})\n\n/** The language for the code block, used for syntax highlighting */\nconst codeBlockLanguage = computed(() => {\n if (isWebhook) {\n return webhookLanguage.value\n }\n\n return localSelectedClient.value?.lang\n})\n\n/** Determine the language for webhook content based on MIME type */\nconst webhookLanguage = computed<string>(() => {\n if (!webhookHar.value?.postData) return 'json'\n\n const contentType = webhookHar.value.postData.mimeType\n if (contentType?.includes('json')) return 'json'\n if (contentType?.includes('xml')) return 'xml'\n if (contentType?.includes('yaml') || contentType?.includes('yml'))\n return 'yaml'\n if (contentType?.includes('text/plain')) return 'text'\n\n return 'json'\n})\n\n/** Block secrets from being shown in the code block */\nconst secretCredentials = computed(() => getSecrets(securitySchemes))\n\n/** Grab the ref to freeze the ui as the clients change so there's no jump as the size of the dom changes */\nconst elem = ref<ComponentPublicInstance | null>(null)\n\n/** Set custom example, or update the selected HTTP client globally */\nconst selectClient = (option: ClientOption) => {\n // We need to freeze the ui to prevent scrolling as the clients change\n if (elem.value) {\n const unfreeze = freezeElement(elem.value.$el)\n setTimeout(() => {\n unfreeze()\n }, 300)\n }\n // Update to the local example\n localSelectedClient.value = option\n\n // Emit the change if it's not a custom example\n if (option && !option.id.startsWith('custom')) {\n eventBus.emit('workspace:update:selected-client', option.id)\n }\n}\n\n// Virtualize the code block if it's too large\n// This prevents the entire app from freezing up if there's a massive example\n// We set a lower threshold here as code examples can get quite large\nconst VIRTUALIZATION_THRESHOLD = 20_000\n\nconst shouldVirtualize = computed(\n () => (generatedCode.value.length ?? 0) > VIRTUALIZATION_THRESHOLD,\n)\n\nconst id = useId()\n</script>\n<template>\n <ScalarCard\n v-if=\"generatedCode\"\n ref=\"elem\"\n class=\"request-card dark-mode\">\n <!-- Header -->\n <ScalarCardHeader class=\"pr-2.5\">\n <span class=\"sr-only\">Request Example for</span>\n <HttpMethod\n as=\"span\"\n class=\"request-method\"\n :method=\"method\" />\n <span\n v-if=\"generateLabel\"\n v-html=\"generateLabel()\" />\n <slot name=\"header\" />\n <!-- Client picker -->\n <template\n v-if=\"!isWebhook && clients.length\"\n #actions>\n <ScalarCombobox\n class=\"max-h-80\"\n :filterFn=\"filterClientsByQuery\"\n :modelValue=\"localSelectedClient\"\n :options=\"clients\"\n placement=\"bottom-end\"\n teleport\n @update:modelValue=\"selectClient($event as ClientOption)\">\n <ScalarButton\n class=\"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal\"\n data-testid=\"client-picker\"\n variant=\"ghost\">\n {{ localSelectedClient?.title }}\n <ScalarIconCaretDown\n class=\"ui-open:rotate-180 mt-px size-3 transition-transform duration-100\"\n weight=\"bold\" />\n </ScalarButton>\n </ScalarCombobox>\n </template>\n </ScalarCardHeader>\n\n <!-- Code snippet -->\n <ScalarCardSection class=\"request-editor-section custom-scroll p-0\">\n <div\n :id=\"`${id}-example`\"\n class=\"code-snippet\">\n <ScalarCodeBlock\n v-if=\"!shouldVirtualize\"\n class=\"bg-b-2 h-full\"\n :content=\"generatedCode\"\n :hideCredentials=\"secretCredentials\"\n :lang=\"codeBlockLanguage\"\n lineNumbers />\n <ScalarVirtualText\n v-else\n containerClass=\"custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen\"\n contentClass=\"language-plaintext whitespace-pre font-code text-base\"\n :lineHeight=\"20\"\n :text=\"generatedCode\" />\n </div>\n </ScalarCardSection>\n\n <!-- Footer -->\n <ScalarCardFooter\n v-if=\"Object.keys(requestBodyExamples).length > 1 || $slots.footer\"\n class=\"request-card-footer bg-b-3\">\n <!-- Example picker -->\n <div\n v-if=\"Object.keys(requestBodyExamples).length > 1\"\n class=\"request-card-footer-addon\">\n <template v-if=\"Object.keys(requestBodyExamples).length\">\n <ExamplePicker\n v-model=\"selectedExampleKey\"\n :examples=\"requestBodyExamples\" />\n </template>\n </div>\n\n <!-- Footer -->\n <slot\n :exampleName=\"selectedExampleKey\"\n name=\"footer\" />\n </ScalarCardFooter>\n </ScalarCard>\n\n <!-- Fallback card with just method and path in the case of no examples -->\n <ScalarCard\n v-else-if=\"fallback\"\n class=\"request-card dark-mode\">\n <ScalarCardSection class=\"request-card-simple\">\n <div class=\"request-header\">\n <HttpMethod\n as=\"span\"\n class=\"request-method\"\n :method=\"method\" />\n <slot name=\"header\" />\n </div>\n <slot\n :exampleName=\"selectedExampleKey\"\n name=\"footer\" />\n </ScalarCardSection>\n </ScalarCard>\n</template>\n<style scoped>\n.request-card {\n font-size: var(--scalar-font-size-3);\n}\n.request-method {\n font-family: var(--scalar-font-code);\n text-transform: uppercase;\n margin-right: 6px;\n}\n.request-card-footer {\n display: flex;\n justify-content: flex-end;\n padding: 6px;\n flex-shrink: 0;\n position: relative;\n}\n.request-card-footer-addon {\n display: flex;\n align-items: center;\n\n flex: 1;\n min-width: 0;\n}\n.request-editor-section {\n display: flex;\n flex: 1;\n}\n.request-card-simple {\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n padding: 8px 8px 8px 12px;\n\n font-size: var(--scalar-small);\n}\n.code-snippet {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"OperationCodeSample.vue.js","names":[],"sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type OperationCodeSampleProps = {\n /**\n * Integration type: determines if the code sample is displayed in a client environment\n * or in an API reference environment.\n */\n integration?: 'client' | 'reference'\n /**\n * List of all http clients formatted into option groups for the client selector\n */\n clientOptions: ClientOptionGroup[]\n /**\n * Pre-selected client, this will determine which client is initially selected in the dropdown\n *\n * @defaults to shell/curl or a custom sample if one is available\n */\n selectedClient?: AvailableClients[number]\n /**\n * Which server from the spec to use for the code example\n */\n selectedServer?: ServerObject | null\n /**\n * The selected content type from the requestBody.content, this will determine which examples are available\n * as well as the content type of the code example\n *\n * @defaults to the first content type if not provided\n */\n selectedContentType?: string\n /**\n * Example name to use for resolving example values for parameters AND requestBody\n *\n * @example \"limited\"\n * ```ts\n * parameters: {\n * name: 'foobar',\n * in: 'query',\n * examples: {\n * limited: {\n * dataValue: 10,\n * }\n * }\n * },\n * body: {\n * content: {\n * 'application/json': {\n * examples: {\n * limited: {\n * dataValue: { foo: 'bar' },\n * }\n * }\n * }\n * }\n * }\n *\n * ```\n */\n selectedExample?: string\n /**\n * Event bus\n */\n eventBus: WorkspaceEventBus\n /**\n * The security schemes which are applicable to this operation\n */\n securitySchemes: SecuritySchemeObjectSecret[]\n /**\n * HTTP method of the operation\n */\n method: HttpMethodType\n /**\n * Path of the operation\n */\n path: string\n /**\n * De-referenced OpenAPI Operation object\n */\n operation: OperationObject\n /**\n * If true and there's no example, we will display a small card with the method and path only\n */\n fallback?: boolean\n /**\n * A method to generate the label of the block, should return an html string\n */\n generateLabel?: () => string\n /**\n * If true, render this as a webhook request example\n */\n isWebhook?: boolean\n /**\n * Workspace + document cookies\n */\n globalCookies?: XScalarCookie[]\n /**\n * When the request body schema uses oneOf/anyOf, use these selected variants\n * for the example snippet (e.g. from the schema dropdowns in the API reference).\n */\n requestBodyCompositionSelection?: Record<string, number>\n}\n\n/**\n * Request Example\n *\n * The core component for rendering a request example block,\n * this component does not have much of its own state but operates on props and custom events\n *\n * @event workspace:update:selected-client - Emitted when the selected client changes\n * @event scalar-update-selected-example - removed for now, we can bring it back when we need it\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarCard,\n ScalarCardFooter,\n ScalarCardHeader,\n ScalarCardSection,\n ScalarCodeBlock,\n ScalarCombobox,\n ScalarVirtualText,\n} from '@scalar/components'\nimport { freezeElement } from '@scalar/helpers/dom/freeze-element'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { type AvailableClients } from '@scalar/snippetz'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { operationToHar } from '@v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har'\nimport {\n computed,\n onBeforeMount,\n ref,\n useId,\n watch,\n type ComponentPublicInstance,\n} from 'vue'\n\nimport HttpMethod from '@/v2/blocks/operation-code-sample/components/HttpMethod.vue'\nimport { filterClientsByQuery } from '@/v2/blocks/operation-code-sample/helpers/filter-clients-by-query'\nimport { findClient } from '@/v2/blocks/operation-code-sample/helpers/find-client'\nimport { getClients } from '@/v2/blocks/operation-code-sample/helpers/get-clients'\nimport { getCustomCodeSamples } from '@/v2/blocks/operation-code-sample/helpers/get-custom-code-samples'\nimport { getSecrets } from '@/v2/blocks/operation-code-sample/helpers/get-secrets'\nimport type {\n ClientOption,\n ClientOptionGroup,\n CustomClientOption,\n} from '@/v2/blocks/operation-code-sample/types'\n\nimport { generateCodeSnippet } from '../helpers/generate-code-snippet'\nimport ExamplePicker from './ExamplePicker.vue'\n\nconst {\n integration,\n clientOptions,\n selectedClient,\n selectedServer = null,\n selectedContentType,\n securitySchemes = [],\n method,\n eventBus,\n path,\n operation,\n isWebhook,\n generateLabel,\n globalCookies,\n requestBodyCompositionSelection,\n} = defineProps<OperationCodeSampleProps>()\n\ndefineSlots<{\n header: () => unknown\n footer: ({ exampleName }: { exampleName: string }) => unknown\n}>()\n\n/** Grab the examples for the given content type */\nconst requestBodyExamples = computed(() => {\n const content = getResolvedRef(operation.requestBody)?.content ?? {}\n const contentType = selectedContentType || Object.keys(content)[0]\n if (!contentType) return {}\n\n const examples = content[contentType]?.examples ?? {}\n\n return examples\n})\n\n/** The currently selected example key with v-model support */\nconst selectedExampleKey = defineModel<string>('selectedExample', {\n default: '',\n})\n\n// Set default value to the first example\nonBeforeMount(() => {\n selectedExampleKey.value ||= Object.keys(requestBodyExamples.value)[0] ?? ''\n})\n\n/** Grab any custom code samples from the operation */\nconst customCodeSamples = computed(() => getCustomCodeSamples(operation))\n\n/** Merge custom code samples with the client options */\nconst clients = computed(() =>\n getClients(customCodeSamples.value, clientOptions),\n)\n\n/** The locally selected client which would include code samples from this operation only */\nconst localSelectedClient = ref<ClientOption | CustomClientOption | undefined>(\n findClient(clients.value, selectedClient),\n)\n\n/** If the globally selected client changes we can update the local one */\nwatch(\n () => selectedClient,\n (newClient) => {\n const client = findClient(clients.value, newClient)\n if (client) {\n localSelectedClient.value = client\n }\n },\n)\n\n/** Generate HAR data for webhook requests */\nconst webhookHar = computed(() => {\n if (!isWebhook) return null\n\n try {\n return operationToHar({\n operation,\n method,\n path,\n example: selectedExampleKey.value,\n requestBodyCompositionSelection,\n defaultDisabledParameters: false,\n })\n } catch (error) {\n console.error('[webhookHar]', error)\n return null\n }\n})\n\n/** Generate the code snippet for the selected example */\nconst generatedCode = computed<string>(() => {\n if (isWebhook) {\n return webhookHar.value?.postData?.text ?? ''\n }\n\n return generateCodeSnippet({\n defaultDisabledParameters: false,\n includeDefaultHeaders: integration === 'client',\n clientId: localSelectedClient.value?.id,\n customCodeSamples: customCodeSamples.value,\n operation,\n method,\n path,\n contentType: selectedContentType,\n server: selectedServer,\n securitySchemes,\n example: selectedExampleKey.value,\n globalCookies,\n requestBodyCompositionSelection,\n })\n})\n\n/** The language for the code block, used for syntax highlighting */\nconst codeBlockLanguage = computed(() => {\n if (isWebhook) {\n return webhookLanguage.value\n }\n\n return localSelectedClient.value?.lang\n})\n\n/** Determine the language for webhook content based on MIME type */\nconst webhookLanguage = computed<string>(() => {\n if (!webhookHar.value?.postData) return 'json'\n\n const contentType = webhookHar.value.postData.mimeType\n if (contentType?.includes('json')) return 'json'\n if (contentType?.includes('xml')) return 'xml'\n if (contentType?.includes('yaml') || contentType?.includes('yml'))\n return 'yaml'\n if (contentType?.includes('text/plain')) return 'text'\n\n return 'json'\n})\n\n/** Block secrets from being shown in the code block */\nconst secretCredentials = computed(() => getSecrets(securitySchemes))\n\n/** Grab the ref to freeze the ui as the clients change so there's no jump as the size of the dom changes */\nconst elem = ref<ComponentPublicInstance | null>(null)\n\n/** Set custom example, or update the selected HTTP client globally */\nconst selectClient = (option: ClientOption) => {\n // We need to freeze the ui to prevent scrolling as the clients change\n if (elem.value) {\n const unfreeze = freezeElement(elem.value.$el)\n setTimeout(() => {\n unfreeze()\n }, 300)\n }\n // Update to the local example\n localSelectedClient.value = option\n\n // Emit the change if it's not a custom example\n if (option && !option.id.startsWith('custom')) {\n eventBus.emit('workspace:update:selected-client', option.id)\n }\n}\n\n// Virtualize the code block if it's too large\n// This prevents the entire app from freezing up if there's a massive example\n// We set a lower threshold here as code examples can get quite large\nconst VIRTUALIZATION_THRESHOLD = 20_000\n\nconst shouldVirtualize = computed(\n () => (generatedCode.value.length ?? 0) > VIRTUALIZATION_THRESHOLD,\n)\n\nconst id = useId()\n</script>\n<template>\n <ScalarCard\n v-if=\"generatedCode\"\n ref=\"elem\"\n class=\"request-card dark-mode\">\n <!-- Header -->\n <ScalarCardHeader class=\"pr-2.5\">\n <span class=\"sr-only\">Request Example for</span>\n <HttpMethod\n as=\"span\"\n class=\"request-method\"\n :method=\"method\" />\n <span\n v-if=\"generateLabel\"\n v-html=\"generateLabel()\" />\n <slot name=\"header\" />\n <!-- Client picker -->\n <template\n v-if=\"!isWebhook && clients.length\"\n #actions>\n <ScalarCombobox\n class=\"max-h-80\"\n :filterFn=\"filterClientsByQuery\"\n :modelValue=\"localSelectedClient\"\n :options=\"clients\"\n placement=\"bottom-end\"\n teleport\n @update:modelValue=\"selectClient($event as ClientOption)\">\n <ScalarButton\n class=\"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal\"\n data-testid=\"client-picker\"\n variant=\"ghost\">\n {{ localSelectedClient?.title }}\n <ScalarIconCaretDown\n class=\"ui-open:rotate-180 mt-px size-3 transition-transform duration-100\"\n weight=\"bold\" />\n </ScalarButton>\n </ScalarCombobox>\n </template>\n </ScalarCardHeader>\n\n <!-- Code snippet -->\n <ScalarCardSection class=\"request-editor-section custom-scroll p-0\">\n <div\n :id=\"`${id}-example`\"\n class=\"code-snippet\">\n <ScalarCodeBlock\n v-if=\"!shouldVirtualize\"\n class=\"bg-b-2 h-full\"\n :content=\"generatedCode\"\n :hideCredentials=\"secretCredentials\"\n :lang=\"codeBlockLanguage\"\n lineNumbers />\n <ScalarVirtualText\n v-else\n containerClass=\"custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen\"\n contentClass=\"language-plaintext whitespace-pre font-code text-base\"\n :lineHeight=\"20\"\n :text=\"generatedCode\" />\n </div>\n </ScalarCardSection>\n\n <!-- Footer -->\n <ScalarCardFooter\n v-if=\"Object.keys(requestBodyExamples).length > 1 || $slots.footer\"\n class=\"request-card-footer bg-b-3\">\n <!-- Example picker -->\n <div\n v-if=\"Object.keys(requestBodyExamples).length > 1\"\n class=\"request-card-footer-addon\">\n <template v-if=\"Object.keys(requestBodyExamples).length\">\n <ExamplePicker\n v-model=\"selectedExampleKey\"\n :examples=\"requestBodyExamples\" />\n </template>\n </div>\n\n <!-- Footer -->\n <slot\n :exampleName=\"selectedExampleKey\"\n name=\"footer\" />\n </ScalarCardFooter>\n </ScalarCard>\n\n <!-- Fallback card with just method and path in the case of no examples -->\n <ScalarCard\n v-else-if=\"fallback\"\n class=\"request-card dark-mode\">\n <ScalarCardSection class=\"request-card-simple\">\n <div class=\"request-header\">\n <HttpMethod\n as=\"span\"\n class=\"request-method\"\n :method=\"method\" />\n <slot name=\"header\" />\n </div>\n <slot\n :exampleName=\"selectedExampleKey\"\n name=\"footer\" />\n </ScalarCardSection>\n </ScalarCard>\n</template>\n<style scoped>\n.request-card {\n font-size: var(--scalar-font-size-3);\n}\n.request-method {\n font-family: var(--scalar-font-code);\n text-transform: uppercase;\n margin-right: 6px;\n}\n.request-card-footer {\n display: flex;\n justify-content: flex-end;\n padding: 6px;\n flex-shrink: 0;\n position: relative;\n}\n.request-card-footer-addon {\n display: flex;\n align-items: center;\n\n flex: 1;\n min-width: 0;\n}\n.request-editor-section {\n display: flex;\n flex: 1;\n}\n.request-card-simple {\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n padding: 8px 8px 8px 12px;\n\n font-size: var(--scalar-small);\n}\n.code-snippet {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n</style>\n"],"mappings":""}
@@ -77,7 +77,8 @@ var OperationCodeSample_vue_vue_type_script_setup_true_lang_default = /* @__PURE
77
77
  method: __props.method,
78
78
  path: __props.path,
79
79
  example: selectedExampleKey.value,
80
- requestBodyCompositionSelection: __props.requestBodyCompositionSelection
80
+ requestBodyCompositionSelection: __props.requestBodyCompositionSelection,
81
+ defaultDisabledParameters: false
81
82
  });
82
83
  } catch (error) {
83
84
  console.error("[webhookHar]", error);
@@ -88,6 +89,7 @@ var OperationCodeSample_vue_vue_type_script_setup_true_lang_default = /* @__PURE
88
89
  const generatedCode = computed(() => {
89
90
  if (__props.isWebhook) return webhookHar.value?.postData?.text ?? "";
90
91
  return generateCodeSnippet({
92
+ defaultDisabledParameters: false,
91
93
  includeDefaultHeaders: __props.integration === "client",
92
94
  clientId: localSelectedClient.value?.id,
93
95
  customCodeSamples: customCodeSamples.value,
@@ -1 +1 @@
1
- {"version":3,"file":"OperationCodeSample.vue.script.js","names":["$slots"],"sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type OperationCodeSampleProps = {\n /**\n * Integration type: determines if the code sample is displayed in a client environment\n * or in an API reference environment.\n */\n integration?: 'client' | 'reference'\n /**\n * List of all http clients formatted into option groups for the client selector\n */\n clientOptions: ClientOptionGroup[]\n /**\n * Pre-selected client, this will determine which client is initially selected in the dropdown\n *\n * @defaults to shell/curl or a custom sample if one is available\n */\n selectedClient?: AvailableClients[number]\n /**\n * Which server from the spec to use for the code example\n */\n selectedServer?: ServerObject | null\n /**\n * The selected content type from the requestBody.content, this will determine which examples are available\n * as well as the content type of the code example\n *\n * @defaults to the first content type if not provided\n */\n selectedContentType?: string\n /**\n * Example name to use for resolving example values for parameters AND requestBody\n *\n * @example \"limited\"\n * ```ts\n * parameters: {\n * name: 'foobar',\n * in: 'query',\n * examples: {\n * limited: {\n * dataValue: 10,\n * }\n * }\n * },\n * body: {\n * content: {\n * 'application/json': {\n * examples: {\n * limited: {\n * dataValue: { foo: 'bar' },\n * }\n * }\n * }\n * }\n * }\n *\n * ```\n */\n selectedExample?: string\n /**\n * Event bus\n */\n eventBus: WorkspaceEventBus\n /**\n * The security schemes which are applicable to this operation\n */\n securitySchemes: SecuritySchemeObjectSecret[]\n /**\n * HTTP method of the operation\n */\n method: HttpMethodType\n /**\n * Path of the operation\n */\n path: string\n /**\n * De-referenced OpenAPI Operation object\n */\n operation: OperationObject\n /**\n * If true and there's no example, we will display a small card with the method and path only\n */\n fallback?: boolean\n /**\n * A method to generate the label of the block, should return an html string\n */\n generateLabel?: () => string\n /**\n * If true, render this as a webhook request example\n */\n isWebhook?: boolean\n /**\n * Workspace + document cookies\n */\n globalCookies?: XScalarCookie[]\n /**\n * When the request body schema uses oneOf/anyOf, use these selected variants\n * for the example snippet (e.g. from the schema dropdowns in the API reference).\n */\n requestBodyCompositionSelection?: Record<string, number>\n}\n\n/**\n * Request Example\n *\n * The core component for rendering a request example block,\n * this component does not have much of its own state but operates on props and custom events\n *\n * @event workspace:update:selected-client - Emitted when the selected client changes\n * @event scalar-update-selected-example - removed for now, we can bring it back when we need it\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarCard,\n ScalarCardFooter,\n ScalarCardHeader,\n ScalarCardSection,\n ScalarCodeBlock,\n ScalarCombobox,\n ScalarVirtualText,\n} from '@scalar/components'\nimport { freezeElement } from '@scalar/helpers/dom/freeze-element'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { type AvailableClients } from '@scalar/snippetz'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { operationToHar } from '@v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har'\nimport {\n computed,\n onBeforeMount,\n ref,\n useId,\n watch,\n type ComponentPublicInstance,\n} from 'vue'\n\nimport HttpMethod from '@/v2/blocks/operation-code-sample/components/HttpMethod.vue'\nimport { filterClientsByQuery } from '@/v2/blocks/operation-code-sample/helpers/filter-clients-by-query'\nimport { findClient } from '@/v2/blocks/operation-code-sample/helpers/find-client'\nimport { getClients } from '@/v2/blocks/operation-code-sample/helpers/get-clients'\nimport { getCustomCodeSamples } from '@/v2/blocks/operation-code-sample/helpers/get-custom-code-samples'\nimport { getSecrets } from '@/v2/blocks/operation-code-sample/helpers/get-secrets'\nimport type {\n ClientOption,\n ClientOptionGroup,\n CustomClientOption,\n} from '@/v2/blocks/operation-code-sample/types'\nimport type { SecuritySchemeObjectSecret } from '@/v2/blocks/scalar-auth-selector-block/helpers/secret-types'\n\nimport { generateCodeSnippet } from '../helpers/generate-code-snippet'\nimport ExamplePicker from './ExamplePicker.vue'\n\nconst {\n integration,\n clientOptions,\n selectedClient,\n selectedServer = null,\n selectedContentType,\n securitySchemes = [],\n method,\n eventBus,\n path,\n operation,\n isWebhook,\n generateLabel,\n globalCookies,\n requestBodyCompositionSelection,\n} = defineProps<OperationCodeSampleProps>()\n\ndefineSlots<{\n header: () => unknown\n footer: ({ exampleName }: { exampleName: string }) => unknown\n}>()\n\n/** Grab the examples for the given content type */\nconst requestBodyExamples = computed(() => {\n const content = getResolvedRef(operation.requestBody)?.content ?? {}\n const contentType = selectedContentType || Object.keys(content)[0]\n if (!contentType) return {}\n\n const examples = content[contentType]?.examples ?? {}\n\n return examples\n})\n\n/** The currently selected example key with v-model support */\nconst selectedExampleKey = defineModel<string>('selectedExample', {\n default: '',\n})\n\n// Set default value to the first example\nonBeforeMount(() => {\n selectedExampleKey.value ||= Object.keys(requestBodyExamples.value)[0] ?? ''\n})\n\n/** Grab any custom code samples from the operation */\nconst customCodeSamples = computed(() => getCustomCodeSamples(operation))\n\n/** Merge custom code samples with the client options */\nconst clients = computed(() =>\n getClients(customCodeSamples.value, clientOptions),\n)\n\n/** The locally selected client which would include code samples from this operation only */\nconst localSelectedClient = ref<ClientOption | CustomClientOption | undefined>(\n findClient(clients.value, selectedClient),\n)\n\n/** If the globally selected client changes we can update the local one */\nwatch(\n () => selectedClient,\n (newClient) => {\n const client = findClient(clients.value, newClient)\n if (client) {\n localSelectedClient.value = client\n }\n },\n)\n\n/** Generate HAR data for webhook requests */\nconst webhookHar = computed(() => {\n if (!isWebhook) return null\n\n try {\n return operationToHar({\n operation,\n method,\n path,\n example: selectedExampleKey.value,\n requestBodyCompositionSelection,\n })\n } catch (error) {\n console.error('[webhookHar]', error)\n return null\n }\n})\n\n/** Generate the code snippet for the selected example */\nconst generatedCode = computed<string>(() => {\n if (isWebhook) {\n return webhookHar.value?.postData?.text ?? ''\n }\n\n return generateCodeSnippet({\n includeDefaultHeaders: integration === 'client',\n clientId: localSelectedClient.value?.id,\n customCodeSamples: customCodeSamples.value,\n operation,\n method,\n path,\n contentType: selectedContentType,\n server: selectedServer,\n securitySchemes,\n example: selectedExampleKey.value,\n globalCookies,\n requestBodyCompositionSelection,\n })\n})\n\n/** The language for the code block, used for syntax highlighting */\nconst codeBlockLanguage = computed(() => {\n if (isWebhook) {\n return webhookLanguage.value\n }\n\n return localSelectedClient.value?.lang\n})\n\n/** Determine the language for webhook content based on MIME type */\nconst webhookLanguage = computed<string>(() => {\n if (!webhookHar.value?.postData) return 'json'\n\n const contentType = webhookHar.value.postData.mimeType\n if (contentType?.includes('json')) return 'json'\n if (contentType?.includes('xml')) return 'xml'\n if (contentType?.includes('yaml') || contentType?.includes('yml'))\n return 'yaml'\n if (contentType?.includes('text/plain')) return 'text'\n\n return 'json'\n})\n\n/** Block secrets from being shown in the code block */\nconst secretCredentials = computed(() => getSecrets(securitySchemes))\n\n/** Grab the ref to freeze the ui as the clients change so there's no jump as the size of the dom changes */\nconst elem = ref<ComponentPublicInstance | null>(null)\n\n/** Set custom example, or update the selected HTTP client globally */\nconst selectClient = (option: ClientOption) => {\n // We need to freeze the ui to prevent scrolling as the clients change\n if (elem.value) {\n const unfreeze = freezeElement(elem.value.$el)\n setTimeout(() => {\n unfreeze()\n }, 300)\n }\n // Update to the local example\n localSelectedClient.value = option\n\n // Emit the change if it's not a custom example\n if (option && !option.id.startsWith('custom')) {\n eventBus.emit('workspace:update:selected-client', option.id)\n }\n}\n\n// Virtualize the code block if it's too large\n// This prevents the entire app from freezing up if there's a massive example\n// We set a lower threshold here as code examples can get quite large\nconst VIRTUALIZATION_THRESHOLD = 20_000\n\nconst shouldVirtualize = computed(\n () => (generatedCode.value.length ?? 0) > VIRTUALIZATION_THRESHOLD,\n)\n\nconst id = useId()\n</script>\n<template>\n <ScalarCard\n v-if=\"generatedCode\"\n ref=\"elem\"\n class=\"request-card dark-mode\">\n <!-- Header -->\n <ScalarCardHeader class=\"pr-2.5\">\n <span class=\"sr-only\">Request Example for</span>\n <HttpMethod\n as=\"span\"\n class=\"request-method\"\n :method=\"method\" />\n <span\n v-if=\"generateLabel\"\n v-html=\"generateLabel()\" />\n <slot name=\"header\" />\n <!-- Client picker -->\n <template\n v-if=\"!isWebhook && clients.length\"\n #actions>\n <ScalarCombobox\n class=\"max-h-80\"\n :filterFn=\"filterClientsByQuery\"\n :modelValue=\"localSelectedClient\"\n :options=\"clients\"\n placement=\"bottom-end\"\n teleport\n @update:modelValue=\"selectClient($event as ClientOption)\">\n <ScalarButton\n class=\"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal\"\n data-testid=\"client-picker\"\n variant=\"ghost\">\n {{ localSelectedClient?.title }}\n <ScalarIconCaretDown\n class=\"ui-open:rotate-180 mt-px size-3 transition-transform duration-100\"\n weight=\"bold\" />\n </ScalarButton>\n </ScalarCombobox>\n </template>\n </ScalarCardHeader>\n\n <!-- Code snippet -->\n <ScalarCardSection class=\"request-editor-section custom-scroll p-0\">\n <div\n :id=\"`${id}-example`\"\n class=\"code-snippet\">\n <ScalarCodeBlock\n v-if=\"!shouldVirtualize\"\n class=\"bg-b-2 h-full\"\n :content=\"generatedCode\"\n :hideCredentials=\"secretCredentials\"\n :lang=\"codeBlockLanguage\"\n lineNumbers />\n <ScalarVirtualText\n v-else\n containerClass=\"custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen\"\n contentClass=\"language-plaintext whitespace-pre font-code text-base\"\n :lineHeight=\"20\"\n :text=\"generatedCode\" />\n </div>\n </ScalarCardSection>\n\n <!-- Footer -->\n <ScalarCardFooter\n v-if=\"Object.keys(requestBodyExamples).length > 1 || $slots.footer\"\n class=\"request-card-footer bg-b-3\">\n <!-- Example picker -->\n <div\n v-if=\"Object.keys(requestBodyExamples).length > 1\"\n class=\"request-card-footer-addon\">\n <template v-if=\"Object.keys(requestBodyExamples).length\">\n <ExamplePicker\n v-model=\"selectedExampleKey\"\n :examples=\"requestBodyExamples\" />\n </template>\n </div>\n\n <!-- Footer -->\n <slot\n :exampleName=\"selectedExampleKey\"\n name=\"footer\" />\n </ScalarCardFooter>\n </ScalarCard>\n\n <!-- Fallback card with just method and path in the case of no examples -->\n <ScalarCard\n v-else-if=\"fallback\"\n class=\"request-card dark-mode\">\n <ScalarCardSection class=\"request-card-simple\">\n <div class=\"request-header\">\n <HttpMethod\n as=\"span\"\n class=\"request-method\"\n :method=\"method\" />\n <slot name=\"header\" />\n </div>\n <slot\n :exampleName=\"selectedExampleKey\"\n name=\"footer\" />\n </ScalarCardSection>\n </ScalarCard>\n</template>\n<style scoped>\n.request-card {\n font-size: var(--scalar-font-size-3);\n}\n.request-method {\n font-family: var(--scalar-font-code);\n text-transform: uppercase;\n margin-right: 6px;\n}\n.request-card-footer {\n display: flex;\n justify-content: flex-end;\n padding: 6px;\n flex-shrink: 0;\n position: relative;\n}\n.request-card-footer-addon {\n display: flex;\n align-items: center;\n\n flex: 1;\n min-width: 0;\n}\n.request-editor-section {\n display: flex;\n flex: 1;\n}\n.request-card-simple {\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n padding: 8px 8px 8px 12px;\n\n font-size: var(--scalar-small);\n}\n.code-snippet {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;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,CAAE,UAAA,WAAA,EAC/C,YAEoC,uBAAA;;mBADzB,mBAAA;uFAAkB,QAAA;OAC1B,UAAU,oBAAA;iHAKjB,WAEkB,KAAA,QAAA,UAAA,EADf,aAAa,mBAAA,OAAkB,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA;;;;;cAOzB,QAAA,YAAA,WAAA,EADb,YAea,MAAA,WAAA,EAAA;;IAbX,OAAM;;2BAYc,CAXpB,YAWoB,MAAA,kBAAA,EAAA,EAXD,OAAM,uBAAqB,EAAA;4BAOtC,CANN,mBAMM,OANN,YAMM,CALJ,YAGqB,oBAAA;MAFnB,IAAG;MACH,OAAM;MACL,QAAQ,QAAA;8BACX,WAAsB,KAAA,QAAA,UAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA,EAExB,WAEkB,KAAA,QAAA,UAAA,EADf,aAAa,mBAAA,OAAkB,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"OperationCodeSample.vue.script.js","names":["$slots"],"sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type OperationCodeSampleProps = {\n /**\n * Integration type: determines if the code sample is displayed in a client environment\n * or in an API reference environment.\n */\n integration?: 'client' | 'reference'\n /**\n * List of all http clients formatted into option groups for the client selector\n */\n clientOptions: ClientOptionGroup[]\n /**\n * Pre-selected client, this will determine which client is initially selected in the dropdown\n *\n * @defaults to shell/curl or a custom sample if one is available\n */\n selectedClient?: AvailableClients[number]\n /**\n * Which server from the spec to use for the code example\n */\n selectedServer?: ServerObject | null\n /**\n * The selected content type from the requestBody.content, this will determine which examples are available\n * as well as the content type of the code example\n *\n * @defaults to the first content type if not provided\n */\n selectedContentType?: string\n /**\n * Example name to use for resolving example values for parameters AND requestBody\n *\n * @example \"limited\"\n * ```ts\n * parameters: {\n * name: 'foobar',\n * in: 'query',\n * examples: {\n * limited: {\n * dataValue: 10,\n * }\n * }\n * },\n * body: {\n * content: {\n * 'application/json': {\n * examples: {\n * limited: {\n * dataValue: { foo: 'bar' },\n * }\n * }\n * }\n * }\n * }\n *\n * ```\n */\n selectedExample?: string\n /**\n * Event bus\n */\n eventBus: WorkspaceEventBus\n /**\n * The security schemes which are applicable to this operation\n */\n securitySchemes: SecuritySchemeObjectSecret[]\n /**\n * HTTP method of the operation\n */\n method: HttpMethodType\n /**\n * Path of the operation\n */\n path: string\n /**\n * De-referenced OpenAPI Operation object\n */\n operation: OperationObject\n /**\n * If true and there's no example, we will display a small card with the method and path only\n */\n fallback?: boolean\n /**\n * A method to generate the label of the block, should return an html string\n */\n generateLabel?: () => string\n /**\n * If true, render this as a webhook request example\n */\n isWebhook?: boolean\n /**\n * Workspace + document cookies\n */\n globalCookies?: XScalarCookie[]\n /**\n * When the request body schema uses oneOf/anyOf, use these selected variants\n * for the example snippet (e.g. from the schema dropdowns in the API reference).\n */\n requestBodyCompositionSelection?: Record<string, number>\n}\n\n/**\n * Request Example\n *\n * The core component for rendering a request example block,\n * this component does not have much of its own state but operates on props and custom events\n *\n * @event workspace:update:selected-client - Emitted when the selected client changes\n * @event scalar-update-selected-example - removed for now, we can bring it back when we need it\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarCard,\n ScalarCardFooter,\n ScalarCardHeader,\n ScalarCardSection,\n ScalarCodeBlock,\n ScalarCombobox,\n ScalarVirtualText,\n} from '@scalar/components'\nimport { freezeElement } from '@scalar/helpers/dom/freeze-element'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { type AvailableClients } from '@scalar/snippetz'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { operationToHar } from '@v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har'\nimport {\n computed,\n onBeforeMount,\n ref,\n useId,\n watch,\n type ComponentPublicInstance,\n} from 'vue'\n\nimport HttpMethod from '@/v2/blocks/operation-code-sample/components/HttpMethod.vue'\nimport { filterClientsByQuery } from '@/v2/blocks/operation-code-sample/helpers/filter-clients-by-query'\nimport { findClient } from '@/v2/blocks/operation-code-sample/helpers/find-client'\nimport { getClients } from '@/v2/blocks/operation-code-sample/helpers/get-clients'\nimport { getCustomCodeSamples } from '@/v2/blocks/operation-code-sample/helpers/get-custom-code-samples'\nimport { getSecrets } from '@/v2/blocks/operation-code-sample/helpers/get-secrets'\nimport type {\n ClientOption,\n ClientOptionGroup,\n CustomClientOption,\n} from '@/v2/blocks/operation-code-sample/types'\n\nimport { generateCodeSnippet } from '../helpers/generate-code-snippet'\nimport ExamplePicker from './ExamplePicker.vue'\n\nconst {\n integration,\n clientOptions,\n selectedClient,\n selectedServer = null,\n selectedContentType,\n securitySchemes = [],\n method,\n eventBus,\n path,\n operation,\n isWebhook,\n generateLabel,\n globalCookies,\n requestBodyCompositionSelection,\n} = defineProps<OperationCodeSampleProps>()\n\ndefineSlots<{\n header: () => unknown\n footer: ({ exampleName }: { exampleName: string }) => unknown\n}>()\n\n/** Grab the examples for the given content type */\nconst requestBodyExamples = computed(() => {\n const content = getResolvedRef(operation.requestBody)?.content ?? {}\n const contentType = selectedContentType || Object.keys(content)[0]\n if (!contentType) return {}\n\n const examples = content[contentType]?.examples ?? {}\n\n return examples\n})\n\n/** The currently selected example key with v-model support */\nconst selectedExampleKey = defineModel<string>('selectedExample', {\n default: '',\n})\n\n// Set default value to the first example\nonBeforeMount(() => {\n selectedExampleKey.value ||= Object.keys(requestBodyExamples.value)[0] ?? ''\n})\n\n/** Grab any custom code samples from the operation */\nconst customCodeSamples = computed(() => getCustomCodeSamples(operation))\n\n/** Merge custom code samples with the client options */\nconst clients = computed(() =>\n getClients(customCodeSamples.value, clientOptions),\n)\n\n/** The locally selected client which would include code samples from this operation only */\nconst localSelectedClient = ref<ClientOption | CustomClientOption | undefined>(\n findClient(clients.value, selectedClient),\n)\n\n/** If the globally selected client changes we can update the local one */\nwatch(\n () => selectedClient,\n (newClient) => {\n const client = findClient(clients.value, newClient)\n if (client) {\n localSelectedClient.value = client\n }\n },\n)\n\n/** Generate HAR data for webhook requests */\nconst webhookHar = computed(() => {\n if (!isWebhook) return null\n\n try {\n return operationToHar({\n operation,\n method,\n path,\n example: selectedExampleKey.value,\n requestBodyCompositionSelection,\n defaultDisabledParameters: false,\n })\n } catch (error) {\n console.error('[webhookHar]', error)\n return null\n }\n})\n\n/** Generate the code snippet for the selected example */\nconst generatedCode = computed<string>(() => {\n if (isWebhook) {\n return webhookHar.value?.postData?.text ?? ''\n }\n\n return generateCodeSnippet({\n defaultDisabledParameters: false,\n includeDefaultHeaders: integration === 'client',\n clientId: localSelectedClient.value?.id,\n customCodeSamples: customCodeSamples.value,\n operation,\n method,\n path,\n contentType: selectedContentType,\n server: selectedServer,\n securitySchemes,\n example: selectedExampleKey.value,\n globalCookies,\n requestBodyCompositionSelection,\n })\n})\n\n/** The language for the code block, used for syntax highlighting */\nconst codeBlockLanguage = computed(() => {\n if (isWebhook) {\n return webhookLanguage.value\n }\n\n return localSelectedClient.value?.lang\n})\n\n/** Determine the language for webhook content based on MIME type */\nconst webhookLanguage = computed<string>(() => {\n if (!webhookHar.value?.postData) return 'json'\n\n const contentType = webhookHar.value.postData.mimeType\n if (contentType?.includes('json')) return 'json'\n if (contentType?.includes('xml')) return 'xml'\n if (contentType?.includes('yaml') || contentType?.includes('yml'))\n return 'yaml'\n if (contentType?.includes('text/plain')) return 'text'\n\n return 'json'\n})\n\n/** Block secrets from being shown in the code block */\nconst secretCredentials = computed(() => getSecrets(securitySchemes))\n\n/** Grab the ref to freeze the ui as the clients change so there's no jump as the size of the dom changes */\nconst elem = ref<ComponentPublicInstance | null>(null)\n\n/** Set custom example, or update the selected HTTP client globally */\nconst selectClient = (option: ClientOption) => {\n // We need to freeze the ui to prevent scrolling as the clients change\n if (elem.value) {\n const unfreeze = freezeElement(elem.value.$el)\n setTimeout(() => {\n unfreeze()\n }, 300)\n }\n // Update to the local example\n localSelectedClient.value = option\n\n // Emit the change if it's not a custom example\n if (option && !option.id.startsWith('custom')) {\n eventBus.emit('workspace:update:selected-client', option.id)\n }\n}\n\n// Virtualize the code block if it's too large\n// This prevents the entire app from freezing up if there's a massive example\n// We set a lower threshold here as code examples can get quite large\nconst VIRTUALIZATION_THRESHOLD = 20_000\n\nconst shouldVirtualize = computed(\n () => (generatedCode.value.length ?? 0) > VIRTUALIZATION_THRESHOLD,\n)\n\nconst id = useId()\n</script>\n<template>\n <ScalarCard\n v-if=\"generatedCode\"\n ref=\"elem\"\n class=\"request-card dark-mode\">\n <!-- Header -->\n <ScalarCardHeader class=\"pr-2.5\">\n <span class=\"sr-only\">Request Example for</span>\n <HttpMethod\n as=\"span\"\n class=\"request-method\"\n :method=\"method\" />\n <span\n v-if=\"generateLabel\"\n v-html=\"generateLabel()\" />\n <slot name=\"header\" />\n <!-- Client picker -->\n <template\n v-if=\"!isWebhook && clients.length\"\n #actions>\n <ScalarCombobox\n class=\"max-h-80\"\n :filterFn=\"filterClientsByQuery\"\n :modelValue=\"localSelectedClient\"\n :options=\"clients\"\n placement=\"bottom-end\"\n teleport\n @update:modelValue=\"selectClient($event as ClientOption)\">\n <ScalarButton\n class=\"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal\"\n data-testid=\"client-picker\"\n variant=\"ghost\">\n {{ localSelectedClient?.title }}\n <ScalarIconCaretDown\n class=\"ui-open:rotate-180 mt-px size-3 transition-transform duration-100\"\n weight=\"bold\" />\n </ScalarButton>\n </ScalarCombobox>\n </template>\n </ScalarCardHeader>\n\n <!-- Code snippet -->\n <ScalarCardSection class=\"request-editor-section custom-scroll p-0\">\n <div\n :id=\"`${id}-example`\"\n class=\"code-snippet\">\n <ScalarCodeBlock\n v-if=\"!shouldVirtualize\"\n class=\"bg-b-2 h-full\"\n :content=\"generatedCode\"\n :hideCredentials=\"secretCredentials\"\n :lang=\"codeBlockLanguage\"\n lineNumbers />\n <ScalarVirtualText\n v-else\n containerClass=\"custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen\"\n contentClass=\"language-plaintext whitespace-pre font-code text-base\"\n :lineHeight=\"20\"\n :text=\"generatedCode\" />\n </div>\n </ScalarCardSection>\n\n <!-- Footer -->\n <ScalarCardFooter\n v-if=\"Object.keys(requestBodyExamples).length > 1 || $slots.footer\"\n class=\"request-card-footer bg-b-3\">\n <!-- Example picker -->\n <div\n v-if=\"Object.keys(requestBodyExamples).length > 1\"\n class=\"request-card-footer-addon\">\n <template v-if=\"Object.keys(requestBodyExamples).length\">\n <ExamplePicker\n v-model=\"selectedExampleKey\"\n :examples=\"requestBodyExamples\" />\n </template>\n </div>\n\n <!-- Footer -->\n <slot\n :exampleName=\"selectedExampleKey\"\n name=\"footer\" />\n </ScalarCardFooter>\n </ScalarCard>\n\n <!-- Fallback card with just method and path in the case of no examples -->\n <ScalarCard\n v-else-if=\"fallback\"\n class=\"request-card dark-mode\">\n <ScalarCardSection class=\"request-card-simple\">\n <div class=\"request-header\">\n <HttpMethod\n as=\"span\"\n class=\"request-method\"\n :method=\"method\" />\n <slot name=\"header\" />\n </div>\n <slot\n :exampleName=\"selectedExampleKey\"\n name=\"footer\" />\n </ScalarCardSection>\n </ScalarCard>\n</template>\n<style scoped>\n.request-card {\n font-size: var(--scalar-font-size-3);\n}\n.request-method {\n font-family: var(--scalar-font-code);\n text-transform: uppercase;\n margin-right: 6px;\n}\n.request-card-footer {\n display: flex;\n justify-content: flex-end;\n padding: 6px;\n flex-shrink: 0;\n position: relative;\n}\n.request-card-footer-addon {\n display: flex;\n align-items: center;\n\n flex: 1;\n min-width: 0;\n}\n.request-editor-section {\n display: flex;\n flex: 1;\n}\n.request-card-simple {\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n padding: 8px 8px 8px 12px;\n\n font-size: var(--scalar-small);\n}\n.code-snippet {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuLA,MAAM,sBAAsB,eAAe;GACzC,MAAM,UAAU,eAAe,QAAA,UAAU,YAAY,EAAE,WAAW,EAAC;GACnE,MAAM,cAAc,QAAA,uBAAuB,OAAO,KAAK,QAAQ,CAAC;AAChE,OAAI,CAAC,YAAa,QAAO,EAAC;AAI1B,UAFiB,QAAQ,cAAc,YAAY,EAAC;IAGrD;;EAGD,MAAM,qBAAqB,SAAmB,SAAC,kBAE9C;AAGD,sBAAoB;AAClB,sBAAmB,UAAU,OAAO,KAAK,oBAAoB,MAAM,CAAC,MAAM;IAC3E;;EAGD,MAAM,oBAAoB,eAAe,qBAAqB,QAAA,UAAU,CAAA;;EAGxE,MAAM,UAAU,eACd,WAAW,kBAAkB,OAAO,QAAA,cAAc,CACpD;;EAGA,MAAM,sBAAsB,IAC1B,WAAW,QAAQ,OAAO,QAAA,eAAe,CAC3C;;AAGA,cACQ,QAAA,iBACL,cAAc;GACb,MAAM,SAAS,WAAW,QAAQ,OAAO,UAAS;AAClD,OAAI,OACF,qBAAoB,QAAQ;IAGlC;;EAGA,MAAM,aAAa,eAAe;AAChC,OAAI,CAAC,QAAA,UAAW,QAAO;AAEvB,OAAI;AACF,WAAO,eAAe;KACpB,WAAQ,QAAA;KACR,QAAK,QAAA;KACL,MAAG,QAAA;KACH,SAAS,mBAAmB;KAC5B,iCAA8B,QAAA;KAC9B,2BAA2B;KAC5B,CAAA;YACM,OAAO;AACd,YAAQ,MAAM,gBAAgB,MAAK;AACnC,WAAO;;IAEV;;EAGD,MAAM,gBAAgB,eAAuB;AAC3C,OAAI,QAAA,U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;;;KAML,OAAO,KAAK,oBAAA,MAAmB,CAAE,SAAM,KAAQA,KAAAA,OAAO,UAAA,WAAA,EAD9D,YAkBmB,MAAA,iBAAA,EAAA;;MAhBjB,OAAM;;6BAUA,CAPE,OAAO,KAAK,oBAAA,MAAmB,CAAE,SAAM,KAAA,WAAA,EAD/C,mBAQM,OARN,YAQM,CALY,OAAO,KAAK,oBAAA,MAAmB,CAAE,UAAA,WAAA,EAC/C,YAEoC,uBAAA;;mBADzB,mBAAA;uFAAkB,QAAA;OAC1B,UAAU,oBAAA;iHAKjB,WAEkB,KAAA,QAAA,UAAA,EADf,aAAa,mBAAA,OAAkB,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA;;;;;cAOzB,QAAA,YAAA,WAAA,EADb,YAea,MAAA,WAAA,EAAA;;IAbX,OAAM;;2BAYc,CAXpB,YAWoB,MAAA,kBAAA,EAAA,EAXD,OAAM,uBAAqB,EAAA;4BAOtC,CANN,mBAMM,OANN,YAMM,CALJ,YAGqB,oBAAA;MAFnB,IAAG;MACH,OAAM;MACL,QAAQ,QAAA;8BACX,WAAsB,KAAA,QAAA,UAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA,EAExB,WAEkB,KAAA,QAAA,UAAA,EADf,aAAa,mBAAA,OAAkB,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
2
  import type { AvailableClient } from '@scalar/snippetz';
3
+ import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example';
3
4
  import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
4
5
  import type { XCodeSample } from '@scalar/workspace-store/schemas/extensions/operation';
5
6
  import type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
6
- import type { SecuritySchemeObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
7
7
  import { type CustomCodeSampleId } from './generate-client-options.js';
8
8
  type GenerateCodeSnippetProps = {
9
9
  /** The selected client/language for code generation (e.g., 'node/fetch') or a custom code sample ID. */
@@ -30,8 +30,10 @@ type GenerateCodeSnippetProps = {
30
30
  includeDefaultHeaders?: boolean;
31
31
  /** Selected oneOf/anyOf variants for nested request body example generation. */
32
32
  requestBodyCompositionSelection?: Record<string, number>;
33
+ /** Whether to disable parameters by default. */
34
+ defaultDisabledParameters?: boolean;
33
35
  };
34
36
  /** Generate the code snippet for the selected example OR operation */
35
- export declare const generateCodeSnippet: ({ clientId, customCodeSamples, includeDefaultHeaders, operation, method, path, example, contentType, server, securitySchemes, globalCookies, requestBodyCompositionSelection, }: GenerateCodeSnippetProps) => string;
37
+ export declare const generateCodeSnippet: ({ clientId, customCodeSamples, includeDefaultHeaders, operation, method, path, example, contentType, server, securitySchemes, globalCookies, requestBodyCompositionSelection, defaultDisabledParameters, }: GenerateCodeSnippetProps) => string;
36
38
  export {};
37
39
  //# sourceMappingURL=generate-code-snippet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate-code-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/generate-code-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGjH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAG7G,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,2BAA2B,CAAA;AAErF,KAAK,wBAAwB,GAAG;IAC9B,wGAAwG;IACxG,QAAQ,EAAE,eAAe,GAAG,kBAAkB,GAAG,SAAS,CAAA;IAC1D,qFAAqF;IACrF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,mFAAmF;IACnF,iBAAiB,EAAE,WAAW,EAAE,CAAA;IAChC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,gEAAgE;IAChE,MAAM,EAAE,UAAU,CAAA;IAClB,wEAAwE;IACxE,SAAS,EAAE,eAAe,CAAA;IAC1B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAA;IACZ,iFAAiF;IACjF,eAAe,EAAE,0BAA0B,EAAE,CAAA;IAC7C,mEAAmE;IACnE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mCAAmC;IACnC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B,qFAAqF;IACrF,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,gFAAgF;IAChF,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzD,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,GAAI,iLAajC,wBAAwB,KAAG,MAwC7B,CAAA"}
1
+ {"version":3,"file":"generate-code-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/generate-code-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAKjH,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,2BAA2B,CAAA;AAErF,KAAK,wBAAwB,GAAG;IAC9B,wGAAwG;IACxG,QAAQ,EAAE,eAAe,GAAG,kBAAkB,GAAG,SAAS,CAAA;IAC1D,qFAAqF;IACrF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,mFAAmF;IACnF,iBAAiB,EAAE,WAAW,EAAE,CAAA;IAChC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,gEAAgE;IAChE,MAAM,EAAE,UAAU,CAAA;IAClB,wEAAwE;IACxE,SAAS,EAAE,eAAe,CAAA;IAC1B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAA;IACZ,iFAAiF;IACjF,eAAe,EAAE,0BAA0B,EAAE,CAAA;IAC7C,mEAAmE;IACnE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mCAAmC;IACnC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B,qFAAqF;IACrF,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,gFAAgF;IAChF,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxD,gDAAgD;IAChD,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,GAAI,4MAcjC,wBAAwB,KAAG,MAyC7B,CAAA"}
@@ -3,7 +3,7 @@ import { generateCustomId } from "./generate-client-options.js";
3
3
  import { getSnippet } from "../../../../views/Components/CodeSnippet/helpers/get-snippet.js";
4
4
  //#region src/v2/blocks/operation-code-sample/helpers/generate-code-snippet.ts
5
5
  /** Generate the code snippet for the selected example OR operation */
6
- var generateCodeSnippet = ({ clientId, customCodeSamples, includeDefaultHeaders = false, operation, method, path, example, contentType, server, securitySchemes, globalCookies, requestBodyCompositionSelection }) => {
6
+ var generateCodeSnippet = ({ clientId, customCodeSamples, includeDefaultHeaders = false, operation, method, path, example, contentType, server, securitySchemes, globalCookies, requestBodyCompositionSelection, defaultDisabledParameters }) => {
7
7
  try {
8
8
  if (!clientId) return "";
9
9
  if (clientId.startsWith("custom")) return customCodeSamples.find((example) => generateCustomId(example) === clientId)?.source ?? "Custom example not found";
@@ -17,7 +17,8 @@ var generateCodeSnippet = ({ clientId, customCodeSamples, includeDefaultHeaders
17
17
  example,
18
18
  globalCookies,
19
19
  includeDefaultHeaders,
20
- requestBodyCompositionSelection
20
+ requestBodyCompositionSelection,
21
+ defaultDisabledParameters
21
22
  });
22
23
  const [targetKey, clientKey] = clientId.split("/");
23
24
  const [error, payload] = getSnippet(targetKey, clientKey, harRequest);
@@ -1 +1 @@
1
- {"version":3,"file":"generate-code-snippet.js","names":[],"sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/generate-code-snippet.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { AvailableClient, ClientId, TargetId } from '@scalar/snippetz'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type { XCodeSample } from '@scalar/workspace-store/schemas/extensions/operation'\nimport type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { operationToHar } from '@/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har'\nimport type { SecuritySchemeObjectSecret } from '@/v2/blocks/scalar-auth-selector-block/helpers/secret-types'\nimport { getSnippet } from '@/views/Components/CodeSnippet/helpers/get-snippet'\n\nimport { type CustomCodeSampleId, generateCustomId } from './generate-client-options'\n\ntype GenerateCodeSnippetProps = {\n /** The selected client/language for code generation (e.g., 'node/fetch') or a custom code sample ID. */\n clientId: AvailableClient | CustomCodeSampleId | undefined\n /** The Content-Type header value for the request body (e.g., 'application/json'). */\n contentType: string | undefined\n /** Array of custom code samples defined in the OpenAPI x-codeSamples extension. */\n customCodeSamples: XCodeSample[]\n /** The specific example value to use when generating the code snippet. */\n example: string | undefined\n /** The HTTP method for the operation (e.g., GET, POST, PUT). */\n method: HttpMethod\n /** The OpenAPI operation object containing request/response details. */\n operation: OperationObject\n /** The API endpoint path (e.g., '/users/{id}'). */\n path: string\n /** Array of security schemes to apply to the request (e.g., API keys, OAuth). */\n securitySchemes: SecuritySchemeObjectSecret[]\n /** The server object defining the base URL for the API request. */\n server: ServerObject | null\n /** Workspace + document cookies */\n globalCookies?: XScalarCookie[]\n /** Whether to include default headers (e.g., Accept, Content-Type) automatically. */\n includeDefaultHeaders?: boolean\n /** Selected oneOf/anyOf variants for nested request body example generation. */\n requestBodyCompositionSelection?: Record<string, number>\n}\n\n/** Generate the code snippet for the selected example OR operation */\nexport const generateCodeSnippet = ({\n clientId,\n customCodeSamples,\n includeDefaultHeaders = false,\n operation,\n method,\n path,\n example,\n contentType,\n server,\n securitySchemes,\n globalCookies,\n requestBodyCompositionSelection,\n}: GenerateCodeSnippetProps): string => {\n try {\n if (!clientId) {\n return ''\n }\n\n // Use the selected custom example\n if (clientId.startsWith('custom')) {\n return (\n customCodeSamples.find((example) => generateCustomId(example) === clientId)?.source ??\n 'Custom example not found'\n )\n }\n\n const harRequest = operationToHar({\n operation,\n contentType,\n method,\n path,\n server,\n securitySchemes,\n example,\n globalCookies,\n includeDefaultHeaders,\n requestBodyCompositionSelection,\n })\n\n const [targetKey, clientKey] = clientId.split('/') as [TargetId, ClientId<TargetId>]\n\n const [error, payload] = getSnippet(targetKey, clientKey, harRequest)\n if (error) {\n console.error('[generateCodeSnippet]', error)\n return error.message ?? 'Error generating code snippet'\n }\n\n return payload\n } catch (error) {\n console.error('[generateCodeSnippet]', error)\n return 'Error generating code snippet'\n }\n}\n"],"mappings":";;;;;AAwCA,IAAa,uBAAuB,EAClC,UACA,mBACA,wBAAwB,OACxB,WACA,QACA,MACA,SACA,aACA,QACA,iBACA,eACA,sCACsC;AACtC,KAAI;AACF,MAAI,CAAC,SACH,QAAO;AAIT,MAAI,SAAS,WAAW,SAAS,CAC/B,QACE,kBAAkB,MAAM,YAAY,iBAAiB,QAAQ,KAAK,SAAS,EAAE,UAC7E;EAIJ,MAAM,aAAa,eAAe;GAChC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EAEF,MAAM,CAAC,WAAW,aAAa,SAAS,MAAM,IAAI;EAElD,MAAM,CAAC,OAAO,WAAW,WAAW,WAAW,WAAW,WAAW;AACrE,MAAI,OAAO;AACT,WAAQ,MAAM,yBAAyB,MAAM;AAC7C,UAAO,MAAM,WAAW;;AAG1B,SAAO;UACA,OAAO;AACd,UAAQ,MAAM,yBAAyB,MAAM;AAC7C,SAAO"}
1
+ {"version":3,"file":"generate-code-snippet.js","names":[],"sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/generate-code-snippet.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { AvailableClient, ClientId, TargetId } from '@scalar/snippetz'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type { XCodeSample } from '@scalar/workspace-store/schemas/extensions/operation'\nimport type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { operationToHar } from '@/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har'\nimport { getSnippet } from '@/views/Components/CodeSnippet/helpers/get-snippet'\n\nimport { type CustomCodeSampleId, generateCustomId } from './generate-client-options'\n\ntype GenerateCodeSnippetProps = {\n /** The selected client/language for code generation (e.g., 'node/fetch') or a custom code sample ID. */\n clientId: AvailableClient | CustomCodeSampleId | undefined\n /** The Content-Type header value for the request body (e.g., 'application/json'). */\n contentType: string | undefined\n /** Array of custom code samples defined in the OpenAPI x-codeSamples extension. */\n customCodeSamples: XCodeSample[]\n /** The specific example value to use when generating the code snippet. */\n example: string | undefined\n /** The HTTP method for the operation (e.g., GET, POST, PUT). */\n method: HttpMethod\n /** The OpenAPI operation object containing request/response details. */\n operation: OperationObject\n /** The API endpoint path (e.g., '/users/{id}'). */\n path: string\n /** Array of security schemes to apply to the request (e.g., API keys, OAuth). */\n securitySchemes: SecuritySchemeObjectSecret[]\n /** The server object defining the base URL for the API request. */\n server: ServerObject | null\n /** Workspace + document cookies */\n globalCookies?: XScalarCookie[]\n /** Whether to include default headers (e.g., Accept, Content-Type) automatically. */\n includeDefaultHeaders?: boolean\n /** Selected oneOf/anyOf variants for nested request body example generation. */\n requestBodyCompositionSelection?: Record<string, number>\n /** Whether to disable parameters by default. */\n defaultDisabledParameters?: boolean\n}\n\n/** Generate the code snippet for the selected example OR operation */\nexport const generateCodeSnippet = ({\n clientId,\n customCodeSamples,\n includeDefaultHeaders = false,\n operation,\n method,\n path,\n example,\n contentType,\n server,\n securitySchemes,\n globalCookies,\n requestBodyCompositionSelection,\n defaultDisabledParameters,\n}: GenerateCodeSnippetProps): string => {\n try {\n if (!clientId) {\n return ''\n }\n\n // Use the selected custom example\n if (clientId.startsWith('custom')) {\n return (\n customCodeSamples.find((example) => generateCustomId(example) === clientId)?.source ??\n 'Custom example not found'\n )\n }\n\n const harRequest = operationToHar({\n operation,\n contentType,\n method,\n path,\n server,\n securitySchemes,\n example,\n globalCookies,\n includeDefaultHeaders,\n requestBodyCompositionSelection,\n defaultDisabledParameters,\n })\n\n const [targetKey, clientKey] = clientId.split('/') as [TargetId, ClientId<TargetId>]\n\n const [error, payload] = getSnippet(targetKey, clientKey, harRequest)\n if (error) {\n console.error('[generateCodeSnippet]', error)\n return error.message ?? 'Error generating code snippet'\n }\n\n return payload\n } catch (error) {\n console.error('[generateCodeSnippet]', error)\n return 'Error generating code snippet'\n }\n}\n"],"mappings":";;;;;AA0CA,IAAa,uBAAuB,EAClC,UACA,mBACA,wBAAwB,OACxB,WACA,QACA,MACA,SACA,aACA,QACA,iBACA,eACA,iCACA,gCACsC;AACtC,KAAI;AACF,MAAI,CAAC,SACH,QAAO;AAIT,MAAI,SAAS,WAAW,SAAS,CAC/B,QACE,kBAAkB,MAAM,YAAY,iBAAiB,QAAQ,KAAK,SAAS,EAAE,UAC7E;EAIJ,MAAM,aAAa,eAAe;GAChC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EAEF,MAAM,CAAC,WAAW,aAAa,SAAS,MAAM,IAAI;EAElD,MAAM,CAAC,OAAO,WAAW,WAAW,WAAW,WAAW,WAAW;AACrE,MAAI,OAAO;AACT,WAAQ,MAAM,yBAAyB,MAAM;AAC7C,UAAO,MAAM,WAAW;;AAG1B,SAAO;UACA,OAAO;AACd,UAAQ,MAAM,yBAAyB,MAAM;AAC7C,SAAO"}
@@ -1,6 +1,6 @@
1
1
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
- import { isObject } from "@scalar/helpers/object/is-object";
3
2
  import { unpackProxyObject } from "@scalar/workspace-store/helpers/unpack-proxy";
3
+ import { isObject } from "@scalar/helpers/object/is-object";
4
4
  //#region src/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.ts
5
5
  /**
6
6
  * Recursively resolves all $ref objects in a data structure to their actual values.
@@ -1,4 +1,4 @@
1
- import type { SecuritySchemeObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
1
+ import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example';
2
2
  /** Extract secrets from security schemes */
3
3
  export declare const getSecrets: (securitySchemes: SecuritySchemeObjectSecret[]) => string[];
4
4
  //# sourceMappingURL=get-secrets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAE7G,4CAA4C;AAC5C,eAAO,MAAM,UAAU,GAAI,iBAAiB,0BAA0B,EAAE,KAAG,MAAM,EAqB7D,CAAA"}
1
+ {"version":3,"file":"get-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-secrets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AAGzF,4CAA4C;AAC5C,eAAO,MAAM,UAAU,GAAI,iBAAiB,0BAA0B,EAAE,KAAG,MAAM,EAqB7D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-secrets.js","names":[],"sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-secrets.ts"],"sourcesContent":["import { encode } from 'js-base64'\n\nimport type { SecuritySchemeObjectSecret } from '@/v2/blocks/scalar-auth-selector-block/helpers/secret-types'\n\n/** Extract secrets from security schemes */\nexport const getSecrets = (securitySchemes: SecuritySchemeObjectSecret[]): string[] =>\n securitySchemes\n .flatMap((scheme) => {\n if (scheme.type === 'apiKey') {\n return scheme['x-scalar-secret-token']\n }\n if (scheme?.type === 'http') {\n return [\n scheme['x-scalar-secret-token'],\n scheme['x-scalar-secret-username'],\n scheme['x-scalar-secret-password'],\n encode(`${scheme['x-scalar-secret-username']}:${scheme['x-scalar-secret-password']}`),\n ]\n }\n if (scheme.type === 'oauth2') {\n const flows = Object.values(scheme.flows)\n return flows.map((flow) => flow['x-scalar-secret-token'])\n }\n\n return []\n })\n .filter(Boolean)\n"],"mappings":";;;AAKA,IAAa,cAAc,oBACzB,gBACG,SAAS,WAAW;AACnB,KAAI,OAAO,SAAS,SAClB,QAAO,OAAO;AAEhB,KAAI,QAAQ,SAAS,OACnB,QAAO;EACL,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO,GAAG,OAAO,4BAA4B,GAAG,OAAO,8BAA8B;EACtF;AAEH,KAAI,OAAO,SAAS,SAElB,QADc,OAAO,OAAO,OAAO,MAAM,CAC5B,KAAK,SAAS,KAAK,yBAAyB;AAG3D,QAAO,EAAE;EACT,CACD,OAAO,QAAQ"}
1
+ {"version":3,"file":"get-secrets.js","names":[],"sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-secrets.ts"],"sourcesContent":["import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport { encode } from 'js-base64'\n\n/** Extract secrets from security schemes */\nexport const getSecrets = (securitySchemes: SecuritySchemeObjectSecret[]): string[] =>\n securitySchemes\n .flatMap((scheme) => {\n if (scheme.type === 'apiKey') {\n return scheme['x-scalar-secret-token']\n }\n if (scheme?.type === 'http') {\n return [\n scheme['x-scalar-secret-token'],\n scheme['x-scalar-secret-username'],\n scheme['x-scalar-secret-password'],\n encode(`${scheme['x-scalar-secret-username']}:${scheme['x-scalar-secret-password']}`),\n ]\n }\n if (scheme.type === 'oauth2') {\n const flows = Object.values(scheme.flows)\n return flows.map((flow) => flow['x-scalar-secret-token'])\n }\n\n return []\n })\n .filter(Boolean)\n"],"mappings":";;;AAIA,IAAa,cAAc,oBACzB,gBACG,SAAS,WAAW;AACnB,KAAI,OAAO,SAAS,SAClB,QAAO,OAAO;AAEhB,KAAI,QAAQ,SAAS,OACnB,QAAO;EACL,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO,GAAG,OAAO,4BAA4B,GAAG,OAAO,8BAA8B;EACtF;AAEH,KAAI,OAAO,SAAS,SAElB,QADc,OAAO,OAAO,OAAO,MAAM,CAC5B,KAAK,SAAS,KAAK,yBAAyB;AAG3D,QAAO,EAAE;EACT,CACD,OAAO,QAAQ"}
@@ -1,8 +1,8 @@
1
1
  import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
+ import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example';
2
3
  import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
3
4
  import type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
5
  import type { Request as HarRequest } from 'har-format';
5
- import type { SecuritySchemeObjectSecret } from '../../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
6
6
  export type OperationToHarProps = {
7
7
  /** OpenAPI Operation object */
8
8
  operation: OperationObject;
@@ -40,6 +40,11 @@ export type OperationToHarProps = {
40
40
  * (e.g. from the schema dropdowns in the API reference).
41
41
  */
42
42
  requestBodyCompositionSelection?: Record<string, number>;
43
+ /**
44
+ * Whether to disable parameters by default.
45
+ * @default false
46
+ */
47
+ defaultDisabledParameters?: boolean;
43
48
  };
44
49
  /**
45
50
  * Converts an OpenAPI Operation to a HarRequest format for generating HTTP request snippets.
@@ -63,5 +68,5 @@ export type OperationToHarProps = {
63
68
  * @see https://w3c.github.io/web-performance/specs/HAR/Overview.html
64
69
  * @see https://spec.openapis.org/oas/v3.1.0#operation-object
65
70
  */
66
- export declare const operationToHar: ({ includeDefaultHeaders, operation, contentType, method, path, server, example, securitySchemes, globalCookies, requestBodyCompositionSelection, }: OperationToHarProps) => HarRequest;
71
+ export declare const operationToHar: ({ includeDefaultHeaders, operation, contentType, method, path, server, example, securitySchemes, globalCookies, requestBodyCompositionSelection, defaultDisabledParameters, }: OperationToHarProps) => HarRequest;
67
72
  //# sourceMappingURL=operation-to-har.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AACjH,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAIvD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAO7G,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC5B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,0BAA0B,EAAE,CAAA;IAC9C,mCAAmC;IACnC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzD,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,oJAW5B,mBAAmB,KAAG,UAoGxB,CAAA"}
1
+ {"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AAEzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AACjH,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AASvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC5B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,0BAA0B,EAAE,CAAA;IAC9C,mCAAmC;IACnC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxD;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,+KAY5B,mBAAmB,KAAG,UAqGxB,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { getDefaultHeaders } from "../../../request-block/helpers/get-default-headers.js";
2
- import { filterGlobalCookie } from "../../../operation-block/helpers/filter-global-cookies.js";
3
2
  import { processBody } from "./process-body.js";
4
3
  import { processParameters } from "./process-parameters.js";
5
4
  import { processSecuritySchemes } from "./process-security-schemes.js";
6
5
  import { processServerUrl } from "./process-server-url.js";
6
+ import { filterGlobalCookie } from "@scalar/workspace-store/request-example";
7
7
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
8
8
  //#region src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts
9
9
  /**
@@ -28,7 +28,7 @@ import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref
28
28
  * @see https://w3c.github.io/web-performance/specs/HAR/Overview.html
29
29
  * @see https://spec.openapis.org/oas/v3.1.0#operation-object
30
30
  */
31
- var operationToHar = ({ includeDefaultHeaders = false, operation, contentType, method, path, server = null, example, securitySchemes, globalCookies, requestBodyCompositionSelection }) => {
31
+ var operationToHar = ({ includeDefaultHeaders = false, operation, contentType, method, path, server = null, example, securitySchemes, globalCookies, requestBodyCompositionSelection, defaultDisabledParameters = false }) => {
32
32
  const defaultHeaders = includeDefaultHeaders ? getDefaultHeaders({
33
33
  method,
34
34
  operation,
@@ -54,7 +54,8 @@ var operationToHar = ({ includeDefaultHeaders = false, operation, contentType, m
54
54
  const { url, headers, queryString, cookies } = processParameters({
55
55
  harRequest,
56
56
  parameters: operation.parameters,
57
- example
57
+ example,
58
+ defaultDisabled: defaultDisabledParameters
58
59
  });
59
60
  const filteredGlobalCookies = globalCookies?.filter((cookie) => filterGlobalCookie({
60
61
  cookie,
@@ -1 +1 @@
1
- {"version":3,"file":"operation-to-har.js","names":[],"sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { Request as HarRequest } from 'har-format'\n\nimport { filterGlobalCookie } from '@/v2/blocks/operation-block/helpers/filter-global-cookies'\nimport { getDefaultHeaders } from '@/v2/blocks/request-block/helpers/get-default-headers'\nimport type { SecuritySchemeObjectSecret } from '@/v2/blocks/scalar-auth-selector-block/helpers/secret-types'\n\nimport { processBody } from './process-body'\nimport { processParameters } from './process-parameters'\nimport { processSecuritySchemes } from './process-security-schemes'\nimport { processServerUrl } from './process-server-url'\n\nexport type OperationToHarProps = {\n /** OpenAPI Operation object */\n operation: OperationObject\n /** HTTP method of the operation */\n method: HttpMethod\n /** Path of the operation */\n path: string\n /**\n * Name of the currently selected operation example\n *\n * Applies to both the body and the parameters\n */\n example?: string\n /**\n * Content type of the operation\n *\n * Applies to both the body and the parameters (if applicable)\n * @defaults to the first content type in the MediaTypeObject\n */\n contentType?: string\n /** OpenAPI Server object */\n server?: ServerObject | null\n /** OpenAPI SecurityScheme objects which are applicable to the operation */\n securitySchemes?: SecuritySchemeObjectSecret[]\n /** Workspace + document cookies */\n globalCookies?: XScalarCookie[]\n /**\n * Whether to include default headers (e.g., Accept, Content-Type) automatically.\n * If false, default headers will be omitted from the HAR request.\n * @default true\n */\n includeDefaultHeaders?: boolean\n /**\n * Selected oneOf/anyOf variants for nested request body example generation\n * (e.g. from the schema dropdowns in the API reference).\n */\n requestBodyCompositionSelection?: Record<string, number>\n}\n\n/**\n * Converts an OpenAPI Operation to a HarRequest format for generating HTTP request snippets.\n *\n * This function transforms OpenAPI 3.1 operation objects into HAR (HTTP Archive) format requests,\n * which can be used to generate code snippets for various programming languages and HTTP clients.\n *\n * The conversion handles:\n * - Server URL processing and path parameter substitution\n * - Query parameter formatting based on OpenAPI parameter styles\n * - Request body processing with content type handling\n * - Security scheme integration (API keys, etc.)\n *\n * The resulting HarRequest object follows the HAR specification and includes:\n * - HTTP method and URL\n * - Headers and query parameters\n * - Request body (if present)\n * - Cookie information\n * - Size calculations for headers and body\n *\n * @see https://w3c.github.io/web-performance/specs/HAR/Overview.html\n * @see https://spec.openapis.org/oas/v3.1.0#operation-object\n */\nexport const operationToHar = ({\n includeDefaultHeaders = false,\n operation,\n contentType,\n method,\n path,\n server = null,\n example,\n securitySchemes,\n globalCookies,\n requestBodyCompositionSelection,\n}: OperationToHarProps): HarRequest => {\n const defaultHeaders = includeDefaultHeaders\n ? getDefaultHeaders({\n method,\n operation,\n exampleKey: example ?? 'default',\n hideDisabledHeaders: true,\n }).filter((header) => !header.isOverridden)\n : []\n\n const disabledGlobalCookies =\n operation['x-scalar-disable-parameters']?.['global-cookies']?.[example ?? 'default'] ?? {}\n\n const serverUrl = processServerUrl(server, path)\n\n // Initialize the HAR request with basic properties\n const harRequest: HarRequest = {\n method,\n url: serverUrl,\n headers: defaultHeaders.map((header) => ({ name: header.name, value: header.defaultValue })),\n queryString: [],\n postData: undefined,\n httpVersion: 'HTTP/1.1',\n cookies: [],\n headersSize: -1,\n bodySize: -1,\n }\n\n // Handle parameters\n if (operation.parameters) {\n const { url, headers, queryString, cookies } = processParameters({\n harRequest,\n parameters: operation.parameters,\n example,\n })\n\n // Correctly filter the global cookies by the processed url\n const filteredGlobalCookies =\n globalCookies\n ?.filter((cookie) => filterGlobalCookie({ cookie, url, disabledGlobalCookies }))\n ?.map((cookie) => ({ name: cookie.name, value: cookie.value })) ?? []\n\n harRequest.url = url\n harRequest.headers = headers\n harRequest.queryString = queryString\n harRequest.cookies = [...filteredGlobalCookies, ...cookies]\n }\n\n const body = getResolvedRef(operation.requestBody)\n\n // Handle request body\n if (body?.content) {\n const postData = processBody({\n requestBody: body,\n contentType,\n example,\n requestBodyCompositionSelection,\n })\n\n if (postData) {\n harRequest.postData = postData\n harRequest.bodySize = postData.text?.length ?? -1\n\n // Add or update Content-Type header\n if (postData.mimeType) {\n const existingContentTypeHeader = harRequest.headers.find(\n (header) => header.name.toLowerCase() === 'content-type',\n )\n // Update existing header if it has an empty value\n if (existingContentTypeHeader && !existingContentTypeHeader.value) {\n existingContentTypeHeader.value = postData.mimeType\n }\n // Add new header if none exists\n else if (!existingContentTypeHeader) {\n harRequest.headers.push({\n name: 'Content-Type',\n value: postData.mimeType,\n })\n }\n }\n }\n }\n\n // Handle security schemes\n if (securitySchemes) {\n const { headers, queryString, cookies } = processSecuritySchemes(securitySchemes)\n harRequest.headers.push(...headers)\n harRequest.queryString.push(...queryString)\n harRequest.cookies.push(...cookies)\n }\n\n // Calculate headers size without allocating a large joined string\n let headersSize = 0\n for (const h of harRequest.headers) {\n // name + \": \" + value + \"\\r\\n\"\n headersSize += (h.name?.length ?? 0) + 2 + (h.value?.length ?? 0) + 2\n }\n harRequest.headersSize = headersSize\n\n return harRequest\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,IAAa,kBAAkB,EAC7B,wBAAwB,OACxB,WACA,aACA,QACA,MACA,S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YAAW,QAAQ,KAAK;KACtB,MAAM;KACN,OAAO,SAAS;KACjB,CAAC;;;;AAOV,KAAI,iBAAiB;EACnB,MAAM,EAAE,SAAS,aAAa,YAAY,uBAAuB,gBAAgB;AACjF,aAAW,QAAQ,KAAK,GAAG,QAAQ;AACnC,aAAW,YAAY,KAAK,GAAG,YAAY;AAC3C,aAAW,QAAQ,KAAK,GAAG,QAAQ;;CAIrC,IAAI,cAAc;AAClB,MAAK,MAAM,KAAK,WAAW,QAEzB,iBAAgB,EAAE,MAAM,UAAU,KAAK,KAAK,EAAE,OAAO,UAAU,KAAK;AAEtE,YAAW,cAAc;AAEzB,QAAO"}
1
+ {"version":3,"file":"operation-to-har.js","names":[],"sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"sourcesContent":["import type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport { filterGlobalCookie } from '@scalar/workspace-store/request-example'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { Request as HarRequest } from 'har-format'\n\nimport { getDefaultHeaders } from '@/v2/blocks/request-block/helpers/get-default-headers'\n\nimport { processBody } from './process-body'\nimport { processParameters } from './process-parameters'\nimport { processSecuritySchemes } from './process-security-schemes'\nimport { processServerUrl } from './process-server-url'\n\nexport type OperationToHarProps = {\n /** OpenAPI Operation object */\n operation: OperationObject\n /** HTTP method of the operation */\n method: HttpMethod\n /** Path of the operation */\n path: string\n /**\n * Name of the currently selected operation example\n *\n * Applies to both the body and the parameters\n */\n example?: string\n /**\n * Content type of the operation\n *\n * Applies to both the body and the parameters (if applicable)\n * @defaults to the first content type in the MediaTypeObject\n */\n contentType?: string\n /** OpenAPI Server object */\n server?: ServerObject | null\n /** OpenAPI SecurityScheme objects which are applicable to the operation */\n securitySchemes?: SecuritySchemeObjectSecret[]\n /** Workspace + document cookies */\n globalCookies?: XScalarCookie[]\n /**\n * Whether to include default headers (e.g., Accept, Content-Type) automatically.\n * If false, default headers will be omitted from the HAR request.\n * @default true\n */\n includeDefaultHeaders?: boolean\n /**\n * Selected oneOf/anyOf variants for nested request body example generation\n * (e.g. from the schema dropdowns in the API reference).\n */\n requestBodyCompositionSelection?: Record<string, number>\n /**\n * Whether to disable parameters by default.\n * @default false\n */\n defaultDisabledParameters?: boolean\n}\n\n/**\n * Converts an OpenAPI Operation to a HarRequest format for generating HTTP request snippets.\n *\n * This function transforms OpenAPI 3.1 operation objects into HAR (HTTP Archive) format requests,\n * which can be used to generate code snippets for various programming languages and HTTP clients.\n *\n * The conversion handles:\n * - Server URL processing and path parameter substitution\n * - Query parameter formatting based on OpenAPI parameter styles\n * - Request body processing with content type handling\n * - Security scheme integration (API keys, etc.)\n *\n * The resulting HarRequest object follows the HAR specification and includes:\n * - HTTP method and URL\n * - Headers and query parameters\n * - Request body (if present)\n * - Cookie information\n * - Size calculations for headers and body\n *\n * @see https://w3c.github.io/web-performance/specs/HAR/Overview.html\n * @see https://spec.openapis.org/oas/v3.1.0#operation-object\n */\nexport const operationToHar = ({\n includeDefaultHeaders = false,\n operation,\n contentType,\n method,\n path,\n server = null,\n example,\n securitySchemes,\n globalCookies,\n requestBodyCompositionSelection,\n defaultDisabledParameters = false,\n}: OperationToHarProps): HarRequest => {\n const defaultHeaders = includeDefaultHeaders\n ? getDefaultHeaders({\n method,\n operation,\n exampleKey: example ?? 'default',\n hideDisabledHeaders: true,\n }).filter((header) => !header.isOverridden)\n : []\n\n const disabledGlobalCookies =\n operation['x-scalar-disable-parameters']?.['global-cookies']?.[example ?? 'default'] ?? {}\n\n const serverUrl = processServerUrl(server, path)\n\n // Initialize the HAR request with basic properties\n const harRequest: HarRequest = {\n method,\n url: serverUrl,\n headers: defaultHeaders.map((header) => ({ name: header.name, value: header.defaultValue })),\n queryString: [],\n postData: undefined,\n httpVersion: 'HTTP/1.1',\n cookies: [],\n headersSize: -1,\n bodySize: -1,\n }\n\n // Handle parameters\n if (operation.parameters) {\n const { url, headers, queryString, cookies } = processParameters({\n harRequest,\n parameters: operation.parameters,\n example,\n defaultDisabled: defaultDisabledParameters,\n })\n\n // Correctly filter the global cookies by the processed url\n const filteredGlobalCookies =\n globalCookies\n ?.filter((cookie) => filterGlobalCookie({ cookie, url, disabledGlobalCookies }))\n ?.map((cookie) => ({ name: cookie.name, value: cookie.value })) ?? []\n\n harRequest.url = url\n harRequest.headers = headers\n harRequest.queryString = queryString\n harRequest.cookies = [...filteredGlobalCookies, ...cookies]\n }\n\n const body = getResolvedRef(operation.requestBody)\n\n // Handle request body\n if (body?.content) {\n const postData = processBody({\n requestBody: body,\n contentType,\n example,\n requestBodyCompositionSelection,\n })\n\n if (postData) {\n harRequest.postData = postData\n harRequest.bodySize = postData.text?.length ?? -1\n\n // Add or update Content-Type header\n if (postData.mimeType) {\n const existingContentTypeHeader = harRequest.headers.find(\n (header) => header.name.toLowerCase() === 'content-type',\n )\n // Update existing header if it has an empty value\n if (existingContentTypeHeader && !existingContentTypeHeader.value) {\n existingContentTypeHeader.value = postData.mimeType\n }\n // Add new header if none exists\n else if (!existingContentTypeHeader) {\n harRequest.headers.push({\n name: 'Content-Type',\n value: postData.mimeType,\n })\n }\n }\n }\n }\n\n // Handle security schemes\n if (securitySchemes) {\n const { headers, queryString, cookies } = processSecuritySchemes(securitySchemes)\n harRequest.headers.push(...headers)\n harRequest.queryString.push(...queryString)\n harRequest.cookies.push(...cookies)\n }\n\n // Calculate headers size without allocating a large joined string\n let headersSize = 0\n for (const h of harRequest.headers) {\n // name + \": \" + value + \"\\r\\n\"\n headersSize += (h.name?.length ?? 0) + 2 + (h.value?.length ?? 0) + 2\n }\n harRequest.headersSize = headersSize\n\n return harRequest\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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KAAK,eAC3C;AAED,QAAI,6BAA6B,CAAC,0BAA0B,MAC1D,2BAA0B,QAAQ,SAAS;aAGpC,CAAC,0BACR,YAAW,QAAQ,KAAK;KACtB,MAAM;KACN,OAAO,SAAS;KACjB,CAAC;;;;AAOV,KAAI,iBAAiB;EACnB,MAAM,EAAE,SAAS,aAAa,YAAY,uBAAuB,gBAAgB;AACjF,aAAW,QAAQ,KAAK,GAAG,QAAQ;AACnC,aAAW,YAAY,KAAK,GAAG,YAAY;AAC3C,aAAW,QAAQ,KAAK,GAAG,QAAQ;;CAIrC,IAAI,cAAc;AAClB,MAAK,MAAM,KAAK,WAAW,QAEzB,iBAAgB,EAAE,MAAM,UAAU,KAAK,KAAK,EAAE,OAAO,UAAU,KAAK;AAEtE,YAAW,cAAc;AAEzB,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,SAAS,GAAG,iCAAiC,CAAC,GAAG;IACjH,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAoED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,yEAKzB,gBAAgB,KAAG,QAAQ,GAAG,SAuFhC,CAAA"}
1
+ {"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,8DAA8D,CAAA;AAErE,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,SAAS,GAAG,iCAAiC,CAAC,GAAG;IACjH,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAoED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,yEAKzB,gBAAgB,KAAG,QAAQ,GAAG,SAuFhC,CAAA"}