@scalar/api-client 2.39.4 → 2.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
  4. package/dist/components/AddressBar/AddressBarHistory.vue.js.map +1 -1
  5. package/dist/components/AddressBar/AddressBarHistory.vue.script.js +2 -2
  6. package/dist/components/AddressBar/AddressBarHistory.vue.script.js.map +1 -1
  7. package/dist/hooks/useClientConfig.d.ts +12 -0
  8. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  9. package/dist/hooks/useClientConfig.js +14 -1
  10. package/dist/hooks/useClientConfig.js.map +1 -1
  11. package/dist/libs/index.d.ts +0 -1
  12. package/dist/libs/index.d.ts.map +1 -1
  13. package/dist/libs/index.js +1 -2
  14. package/dist/style.css +207 -248
  15. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +14 -10
  16. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  18. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +57 -35
  19. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  20. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -5
  21. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  22. package/dist/v2/blocks/operation-block/helpers/send-request.js +18 -33
  23. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -1
  25. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +1 -1
  26. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
  27. package/dist/v2/blocks/operation-block/index.d.ts +0 -3
  28. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  29. package/dist/v2/blocks/operation-block/index.js +1 -4
  30. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +1 -1
  31. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  32. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  33. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
  34. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +3 -1
  35. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
  36. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +4 -2
  37. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +3 -2
  39. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js.map +1 -1
  40. package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +1 -1
  41. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +1 -1
  42. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -1
  43. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.js.map +1 -1
  44. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +7 -2
  45. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  46. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +4 -3
  47. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js.map +1 -1
  48. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  49. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +2 -3
  50. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js.map +1 -1
  51. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts +3 -1
  52. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  53. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +5 -8
  54. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js.map +1 -1
  55. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +1 -1
  56. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
  57. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.js.map +1 -1
  58. package/dist/v2/blocks/operation-code-sample/index.d.ts +0 -1
  59. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  60. package/dist/v2/blocks/operation-code-sample/index.js +2 -3
  61. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +7 -9
  62. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  63. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  64. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  65. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +49 -42
  66. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  67. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  68. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  69. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  70. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +2 -3
  71. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  72. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  73. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  74. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +1 -0
  75. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  76. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  77. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  78. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  80. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +1 -1
  81. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts +1 -1
  82. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts.map +1 -1
  83. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +2 -1
  84. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js.map +1 -1
  85. package/dist/v2/blocks/response-block/helpers/get-content-length.d.ts.map +1 -1
  86. package/dist/v2/blocks/response-block/helpers/get-content-length.js +2 -2
  87. package/dist/v2/blocks/response-block/helpers/get-content-length.js.map +1 -1
  88. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  89. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  90. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  91. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +76 -25
  92. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  93. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  94. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  95. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  96. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +2 -2
  97. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  98. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -1
  99. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  100. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  101. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +1 -1
  102. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  103. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  104. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  105. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  106. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +8 -4
  107. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  108. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -1
  109. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  111. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  112. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +1 -1
  113. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  114. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  116. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +1 -1
  117. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  118. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +1 -1
  119. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
  120. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +6 -2
  122. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  123. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +0 -3
  124. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/index.js +1 -3
  126. package/dist/v2/components/code-input/CodeInput.vue.d.ts +8 -6
  127. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  128. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  129. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  130. package/dist/v2/components/code-input/CodeInput.vue.script.js +11 -9
  131. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  132. package/dist/v2/constants.js +1 -1
  133. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  134. package/dist/v2/features/app/App.vue.js.map +1 -1
  135. package/dist/v2/features/app/App.vue.script.js +1 -5
  136. package/dist/v2/features/app/App.vue.script.js.map +1 -1
  137. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  138. package/dist/v2/features/app/app-events.js +1 -1
  139. package/dist/v2/features/app/app-events.js.map +1 -1
  140. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  141. package/dist/v2/features/app/app-state.js +2 -2
  142. package/dist/v2/features/app/app-state.js.map +1 -1
  143. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  144. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  145. package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
  146. package/dist/v2/features/app/components/AppSidebar.vue.script.js +1 -1
  147. package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
  148. package/dist/v2/features/app/helpers/routes.d.ts +0 -3
  149. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  150. package/dist/v2/features/app/helpers/routes.js +1 -1
  151. package/dist/v2/features/app/helpers/routes.js.map +1 -1
  152. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  153. package/dist/v2/features/collection/DocumentCollection.vue.js.map +1 -1
  154. package/dist/v2/features/collection/DocumentCollection.vue.script.js +30 -52
  155. package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
  156. package/dist/v2/features/collection/OperationCollection.vue.script.js +0 -1
  157. package/dist/v2/features/collection/OperationCollection.vue.script.js.map +1 -1
  158. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +0 -1
  159. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +1 -1
  160. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  161. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  162. package/dist/v2/features/collection/components/Authentication.vue.js.map +1 -1
  163. package/dist/v2/features/collection/components/Authentication.vue.script.js +6 -8
  164. package/dist/v2/features/collection/components/Authentication.vue.script.js.map +1 -1
  165. package/dist/v2/features/collection/components/Cookies.vue.script.js +0 -1
  166. package/dist/v2/features/collection/components/Cookies.vue.script.js.map +1 -1
  167. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js +0 -1
  168. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js.map +1 -1
  169. package/dist/v2/features/collection/components/Environment.vue.script.js +0 -1
  170. package/dist/v2/features/collection/components/Environment.vue.script.js.map +1 -1
  171. package/dist/v2/features/collection/components/Overview.vue.script.js +0 -1
  172. package/dist/v2/features/collection/components/Overview.vue.script.js.map +1 -1
  173. package/dist/v2/features/collection/components/Servers.vue.script.js +0 -1
  174. package/dist/v2/features/collection/components/Servers.vue.script.js.map +1 -1
  175. package/dist/v2/features/collection/components/Settings.vue.js.map +1 -1
  176. package/dist/v2/features/collection/components/Settings.vue.script.js +2 -3
  177. package/dist/v2/features/collection/components/Settings.vue.script.js.map +1 -1
  178. package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +1 -1
  179. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  180. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  181. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +1 -1
  182. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  183. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  184. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  185. package/dist/v2/features/modal/Modal.vue.script.js +4 -9
  186. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  187. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  188. package/dist/v2/features/modal/helpers/create-api-client-modal.js +1 -17
  189. package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
  190. package/dist/v2/features/modal/helpers/map-hidden-clients-config.js +1 -1
  191. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  192. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  193. package/dist/v2/features/operation/Operation.vue.script.js +51 -84
  194. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  195. package/dist/v2/features/operation/index.d.ts +0 -4
  196. package/dist/v2/features/operation/index.d.ts.map +1 -1
  197. package/dist/v2/features/operation/index.js +1 -5
  198. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  199. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js.map +1 -1
  200. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js +11 -1
  201. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js.map +1 -1
  202. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  203. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  204. package/dist/views/Request/RequestSection/RequestTable.vue.js.map +1 -1
  205. package/dist/views/Request/RequestSection/RequestTable.vue.script.js +1 -1
  206. package/dist/views/Request/RequestSection/RequestTable.vue.script.js.map +1 -1
  207. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.script.js +1 -1
  208. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  209. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js.map +1 -1
  210. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js +2 -2
  211. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js.map +1 -1
  212. package/dist/views/Request/libs/oauth2.js +1 -1
  213. package/dist/views/Request/libs/oauth2.js.map +1 -1
  214. package/package.json +24 -30
  215. package/dist/libs/formatters.d.ts +0 -12
  216. package/dist/libs/formatters.d.ts.map +0 -1
  217. package/dist/libs/formatters.js +0 -36
  218. package/dist/libs/formatters.js.map +0 -1
  219. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts +0 -6
  220. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts.map +0 -1
  221. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js +0 -58
  222. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js.map +0 -1
  223. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +0 -12
  224. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +0 -1
  225. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +0 -65
  226. package/dist/v2/blocks/operation-block/helpers/build-request-body.js.map +0 -1
  227. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +0 -31
  228. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +0 -1
  229. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +0 -55
  230. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js.map +0 -1
  231. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +0 -27
  232. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +0 -1
  233. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +0 -159
  234. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js.map +0 -1
  235. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +0 -25
  236. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +0 -1
  237. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +0 -53
  238. package/dist/v2/blocks/operation-block/helpers/build-request-security.js.map +0 -1
  239. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +0 -46
  240. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +0 -1
  241. package/dist/v2/blocks/operation-block/helpers/build-request.js +0 -102
  242. package/dist/v2/blocks/operation-block/helpers/build-request.js.map +0 -1
  243. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +0 -4
  244. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +0 -1
  245. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +0 -41
  246. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js.map +0 -1
  247. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts +0 -14
  248. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts.map +0 -1
  249. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +0 -20
  250. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js.map +0 -1
  251. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts +0 -8
  252. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts.map +0 -1
  253. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts +0 -9
  254. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts.map +0 -1
  255. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +0 -17
  256. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js.map +0 -1
  257. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +0 -10
  258. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +0 -1
  259. package/dist/v2/blocks/operation-block/helpers/get-example.js +0 -41
  260. package/dist/v2/blocks/operation-block/helpers/get-example.js.map +0 -1
  261. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +0 -26
  262. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +0 -1
  263. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +0 -32
  264. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js.map +0 -1
  265. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +0 -10
  266. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +0 -1
  267. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +0 -15
  268. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js.map +0 -1
  269. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts +0 -3
  270. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts.map +0 -1
  271. package/dist/v2/blocks/operation-block/helpers/get-server-url.js +0 -18
  272. package/dist/v2/blocks/operation-block/helpers/get-server-url.js.map +0 -1
  273. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts +0 -96
  274. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts.map +0 -1
  275. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js +0 -160
  276. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js.map +0 -1
  277. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +0 -40
  278. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +0 -1
  279. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +0 -437
  280. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js.map +0 -1
  281. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +0 -6
  282. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +0 -1
  283. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +0 -25
  284. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js.map +0 -1
  285. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +0 -141
  286. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js.map +0 -1
  287. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +0 -4
  288. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +0 -1
  289. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +0 -10
  290. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js.map +0 -1
  291. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +0 -9
  292. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +0 -1
  293. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +0 -27
  294. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js.map +0 -1
  295. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +0 -25
  296. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +0 -1
  297. package/dist/v2/components/callout/Callout.vue.js +0 -9
  298. package/dist/v2/components/callout/Callout.vue.js.map +0 -1
  299. package/dist/v2/components/callout/Callout.vue.script.js +0 -35
  300. package/dist/v2/components/callout/Callout.vue.script.js.map +0 -1
  301. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts +0 -18
  302. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts.map +0 -1
  303. package/dist/v2/features/modal/helpers/restore-workspace-state.js +0 -51
  304. package/dist/v2/features/modal/helpers/restore-workspace-state.js.map +0 -1
  305. package/dist/v2/features/operation/helpers/combine-params.d.ts +0 -4
  306. package/dist/v2/features/operation/helpers/combine-params.d.ts.map +0 -1
  307. package/dist/v2/features/operation/helpers/combine-params.js +0 -20
  308. package/dist/v2/features/operation/helpers/combine-params.js.map +0 -1
  309. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +0 -17
  310. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +0 -1
  311. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +0 -12
  312. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +0 -1
  313. package/dist/v2/features/operation/helpers/get-security-requirements.js +0 -17
  314. package/dist/v2/features/operation/helpers/get-security-requirements.js.map +0 -1
  315. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +0 -15
  316. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +0 -1
  317. package/dist/v2/features/operation/helpers/get-selected-security.js +0 -41
  318. package/dist/v2/features/operation/helpers/get-selected-security.js.map +0 -1
  319. package/dist/v2/features/operation/helpers/get-selected-server.d.ts +0 -13
  320. package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +0 -1
  321. package/dist/v2/features/operation/helpers/get-selected-server.js +0 -21
  322. package/dist/v2/features/operation/helpers/get-selected-server.js.map +0 -1
  323. package/dist/v2/helpers/get-active-environment.d.ts +0 -5
  324. package/dist/v2/helpers/get-active-environment.d.ts.map +0 -1
  325. package/dist/v2/helpers/get-active-environment.js +0 -19
  326. package/dist/v2/helpers/get-active-environment.js.map +0 -1
  327. package/dist/v2/helpers/get-active-proxy-url.d.ts +0 -18
  328. package/dist/v2/helpers/get-active-proxy-url.d.ts.map +0 -1
  329. package/dist/v2/helpers/get-active-proxy-url.js +0 -26
  330. package/dist/v2/helpers/get-active-proxy-url.js.map +0 -1
  331. package/dist/v2/helpers/get-servers.d.ts +0 -23
  332. package/dist/v2/helpers/get-servers.d.ts.map +0 -1
  333. package/dist/v2/helpers/get-servers.js +0 -106
  334. package/dist/v2/helpers/get-servers.js.map +0 -1
  335. package/dist/v2/helpers/index.d.ts +0 -3
  336. package/dist/v2/helpers/index.d.ts.map +0 -1
  337. package/dist/v2/helpers/index.js +0 -3
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-environment-variables.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/get-environment-variables.ts"],"sourcesContent":["import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\n\n/**\n * Flattens the environment variables array into a key-value object.\n * If a variable value is a string, use it directly; otherwise, use its default value.\n *\n * @returns An object mapping variable names to their resolved values.\n */\nexport const getEnvironmentVariables = (environment: XScalarEnvironment) => {\n return environment.variables.reduce(\n (acc, curr) => {\n acc[curr.name] = typeof curr.value === 'string' ? curr.value : curr.value.default\n return acc\n },\n {} as Record<string, string>,\n )\n}\n"],"mappings":";;;;;;;AAQA,IAAa,2BAA2B,gBAAoC;AAC1E,QAAO,YAAY,UAAU,QAC1B,KAAK,SAAS;AACb,MAAI,KAAK,QAAQ,OAAO,KAAK,UAAU,WAAW,KAAK,QAAQ,KAAK,MAAM;AAC1E,SAAO;IAET,EAAE,CACH"}
@@ -1,10 +0,0 @@
1
- import type { ExampleObject, MediaTypeObject, ParameterObject, RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
- /**
3
- * Resolve an example value for a parameter or requestBody from either `examples` or `content.*.examples`.
4
- * Or the [deprecated] `example` field.
5
- * If no exampleKey is provided it will fallback to the first example in the examples object then the [deprecated]
6
- * `example` field.
7
- * Used both for send-request and generating code snippets.
8
- */
9
- export declare const getExample: (param: ParameterObject | RequestBodyObject | MediaTypeObject, exampleKey: string | undefined, contentType: string | undefined) => ExampleObject | undefined;
10
- //# sourceMappingURL=get-example.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-example.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/get-example.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,EAClB,MAAM,8DAA8D,CAAA;AAgCrE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,eAAe,GAAG,iBAAiB,GAAG,eAAe,EAC5D,YAAY,MAAM,GAAG,SAAS,EAC9B,aAAa,MAAM,GAAG,SAAS,KAC9B,aAAa,GAAG,SA6ClB,CAAA"}
@@ -1,41 +0,0 @@
1
- import { getResolvedRefDeep } from "../../operation-code-sample/helpers/get-resolved-ref-deep.js";
2
- //#region src/v2/blocks/operation-block/helpers/get-example.ts
3
- /** Helper to get example from examples object with fallback to example field */
4
- var getExampleFromExamples = (examples, exampleField, exampleKey) => {
5
- if (!examples && !exampleField) return;
6
- const hasExamples = !!examples && Object.keys(examples).length > 0;
7
- const key = exampleKey || Object.keys(examples ?? {})[0] || "";
8
- const example = getResolvedRefDeep(examples?.[key]);
9
- if (example !== void 0) return example;
10
- if ((!hasExamples || !exampleKey) && exampleField !== void 0) return { value: getResolvedRefDeep(exampleField) };
11
- };
12
- /**
13
- * Resolve an example value for a parameter or requestBody from either `examples` or `content.*.examples`.
14
- * Or the [deprecated] `example` field.
15
- * If no exampleKey is provided it will fallback to the first example in the examples object then the [deprecated]
16
- * `example` field.
17
- * Used both for send-request and generating code snippets.
18
- */
19
- var getExample = (param, exampleKey, contentType) => {
20
- if ("content" in param) {
21
- const content = param.content?.[contentType ?? Object.keys(param.content)[0] ?? ""];
22
- const result = getExampleFromExamples(content?.examples, content?.example, exampleKey);
23
- if (result !== void 0) return result;
24
- }
25
- if ("examples" in param || "example" in param) {
26
- const result = getExampleFromExamples(param.examples, param.example, exampleKey);
27
- if (result !== void 0) return result;
28
- }
29
- const resolvedParam = getResolvedRefDeep(param);
30
- if ("schema" in resolvedParam && resolvedParam.schema) {
31
- const schema = resolvedParam.schema;
32
- if ("default" in schema && schema.default !== void 0) return { value: schema.default };
33
- if ("enum" in schema && schema.enum?.[0] !== void 0) return { value: schema.enum[0] };
34
- if ("examples" in schema && schema.examples?.[0] !== void 0) return { value: schema.examples[0] };
35
- if ("example" in schema && schema.example !== void 0) return { value: schema.example };
36
- }
37
- };
38
- //#endregion
39
- export { getExample };
40
-
41
- //# sourceMappingURL=get-example.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-example.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/get-example.ts"],"sourcesContent":["import type {\n ExampleObject,\n MediaTypeObject,\n ParameterObject,\n RequestBodyObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { getResolvedRefDeep } from '@/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep'\n\n/** Helper to get example from examples object with fallback to example field */\nconst getExampleFromExamples = (\n examples: MediaTypeObject['examples'],\n exampleField: MediaTypeObject['example'],\n exampleKey: string | undefined,\n): ExampleObject | undefined => {\n if (!examples && !exampleField) {\n return undefined\n }\n\n const hasExamples = !!examples && Object.keys(examples).length > 0\n\n // Grab the example key\n const key = exampleKey || Object.keys(examples ?? {})[0] || ''\n const example = getResolvedRefDeep(examples?.[key])\n if (example !== undefined) {\n return example\n }\n\n // Fallback to example field when no examples map exists,\n // or when no specific example key was requested.\n if ((!hasExamples || !exampleKey) && exampleField !== undefined) {\n return { value: getResolvedRefDeep(exampleField) }\n }\n\n return undefined\n}\n\n/**\n * Resolve an example value for a parameter or requestBody from either `examples` or `content.*.examples`.\n * Or the [deprecated] `example` field.\n * If no exampleKey is provided it will fallback to the first example in the examples object then the [deprecated]\n * `example` field.\n * Used both for send-request and generating code snippets.\n */\nexport const getExample = (\n param: ParameterObject | RequestBodyObject | MediaTypeObject,\n exampleKey: string | undefined,\n contentType: string | undefined,\n): ExampleObject | undefined => {\n // Content based parameters\n if ('content' in param) {\n const content = param.content?.[contentType ?? Object.keys(param.content)[0] ?? '']\n const result = getExampleFromExamples(content?.examples, content?.example, exampleKey)\n if (result !== undefined) {\n return result\n }\n }\n\n // Schema based parameters\n if ('examples' in param || 'example' in param) {\n const result = getExampleFromExamples(param.examples, param.example, exampleKey)\n if (result !== undefined) {\n return result\n }\n }\n\n // Derive value from the schema\n const resolvedParam = getResolvedRefDeep(param)\n if ('schema' in resolvedParam && resolvedParam.schema) {\n const schema = resolvedParam.schema\n\n // Default value\n if ('default' in schema && schema.default !== undefined) {\n return { value: schema.default }\n }\n\n // Enum value\n if ('enum' in schema && schema.enum?.[0] !== undefined) {\n return { value: schema.enum[0] }\n }\n\n // Examples value\n if ('examples' in schema && schema.examples?.[0] !== undefined) {\n return { value: schema.examples[0] }\n }\n\n // Example value\n if ('example' in schema && schema.example !== undefined) {\n return { value: schema.example }\n }\n }\n\n return undefined\n}\n"],"mappings":";;;AAUA,IAAM,0BACJ,UACA,cACA,eAC8B;AAC9B,KAAI,CAAC,YAAY,CAAC,aAChB;CAGF,MAAM,cAAc,CAAC,CAAC,YAAY,OAAO,KAAK,SAAS,CAAC,SAAS;CAGjE,MAAM,MAAM,cAAc,OAAO,KAAK,YAAY,EAAE,CAAC,CAAC,MAAM;CAC5D,MAAM,UAAU,mBAAmB,WAAW,KAAK;AACnD,KAAI,YAAY,KAAA,EACd,QAAO;AAKT,MAAK,CAAC,eAAe,CAAC,eAAe,iBAAiB,KAAA,EACpD,QAAO,EAAE,OAAO,mBAAmB,aAAa,EAAE;;;;;;;;;AAatD,IAAa,cACX,OACA,YACA,gBAC8B;AAE9B,KAAI,aAAa,OAAO;EACtB,MAAM,UAAU,MAAM,UAAU,eAAe,OAAO,KAAK,MAAM,QAAQ,CAAC,MAAM;EAChF,MAAM,SAAS,uBAAuB,SAAS,UAAU,SAAS,SAAS,WAAW;AACtF,MAAI,WAAW,KAAA,EACb,QAAO;;AAKX,KAAI,cAAc,SAAS,aAAa,OAAO;EAC7C,MAAM,SAAS,uBAAuB,MAAM,UAAU,MAAM,SAAS,WAAW;AAChF,MAAI,WAAW,KAAA,EACb,QAAO;;CAKX,MAAM,gBAAgB,mBAAmB,MAAM;AAC/C,KAAI,YAAY,iBAAiB,cAAc,QAAQ;EACrD,MAAM,SAAS,cAAc;AAG7B,MAAI,aAAa,UAAU,OAAO,YAAY,KAAA,EAC5C,QAAO,EAAE,OAAO,OAAO,SAAS;AAIlC,MAAI,UAAU,UAAU,OAAO,OAAO,OAAO,KAAA,EAC3C,QAAO,EAAE,OAAO,OAAO,KAAK,IAAI;AAIlC,MAAI,cAAc,UAAU,OAAO,WAAW,OAAO,KAAA,EACnD,QAAO,EAAE,OAAO,OAAO,SAAS,IAAI;AAItC,MAAI,aAAa,UAAU,OAAO,YAAY,KAAA,EAC5C,QAAO,EAAE,OAAO,OAAO,SAAS"}
@@ -1,26 +0,0 @@
1
- import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
2
- import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server';
3
- /**
4
- * Resolves and constructs the final request URL using the provided environment, server, path,
5
- * path variables, and optional query parameters.
6
- *
7
- * - Environment variables and path variables are used to replace placeholders in the path string.
8
- * - The server URL is dynamically resolved (may apply env variables).
9
- * - urlParams are optionally appended as the query string.
10
- *
11
- * @param environment The current environment containing variable values.
12
- * @param server The selected server object; can be null.
13
- * @param path The raw path string from the OpenAPI document (may contain variables).
14
- * @param pathVariables Map of path variable values (e.g., { petId: '5' }).
15
- * @param urlParams Optional query parameters as URLSearchParams.
16
- * @returns Fully resolved URL as a string.
17
- */
18
- export declare const getResolvedUrl: ({ environment, server, path, pathVariables, allowReservedQueryParameters, urlParams, }: {
19
- environment: XScalarEnvironment;
20
- server: ServerObject | null;
21
- path: string;
22
- pathVariables: Record<string, string>;
23
- allowReservedQueryParameters?: Set<string>;
24
- urlParams?: URLSearchParams;
25
- }) => string;
26
- //# sourceMappingURL=get-resolved-url.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-resolved-url.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/get-resolved-url.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AAMtF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,GAAI,wFAO5B;IACD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,4BAA4B,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1C,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B,WAMA,CAAA"}
@@ -1,32 +0,0 @@
1
- import { applyAllowReservedToUrl } from "./apply-allow-reserved-to-url.js";
2
- import { getEnvironmentVariables } from "./get-environment-variables.js";
3
- import { getServerUrl } from "./get-server-url.js";
4
- import { mergeUrls } from "@scalar/helpers/url/merge-urls";
5
- import { replaceVariables } from "@scalar/helpers/regex/replace-variables";
6
- //#region src/v2/blocks/operation-block/helpers/get-resolved-url.ts
7
- /**
8
- * Resolves and constructs the final request URL using the provided environment, server, path,
9
- * path variables, and optional query parameters.
10
- *
11
- * - Environment variables and path variables are used to replace placeholders in the path string.
12
- * - The server URL is dynamically resolved (may apply env variables).
13
- * - urlParams are optionally appended as the query string.
14
- *
15
- * @param environment The current environment containing variable values.
16
- * @param server The selected server object; can be null.
17
- * @param path The raw path string from the OpenAPI document (may contain variables).
18
- * @param pathVariables Map of path variable values (e.g., { petId: '5' }).
19
- * @param urlParams Optional query parameters as URLSearchParams.
20
- * @returns Fully resolved URL as a string.
21
- */
22
- var getResolvedUrl = ({ environment, server, path, pathVariables, allowReservedQueryParameters, urlParams }) => {
23
- const environmentVariables = getEnvironmentVariables(environment);
24
- return applyAllowReservedToUrl(mergeUrls(getServerUrl(server, environmentVariables), replaceVariables(path, {
25
- ...environmentVariables,
26
- ...pathVariables
27
- }), urlParams), allowReservedQueryParameters ?? /* @__PURE__ */ new Set());
28
- };
29
- //#endregion
30
- export { getResolvedUrl };
31
-
32
- //# sourceMappingURL=get-resolved-url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-resolved-url.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/get-resolved-url.ts"],"sourcesContent":["import { replaceVariables } from '@scalar/helpers/regex/replace-variables'\nimport { mergeUrls } from '@scalar/helpers/url/merge-urls'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server'\n\nimport { applyAllowReservedToUrl } from '@/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url'\nimport { getEnvironmentVariables } from '@/v2/blocks/operation-block/helpers/get-environment-variables'\nimport { getServerUrl } from '@/v2/blocks/operation-block/helpers/get-server-url'\n\n/**\n * Resolves and constructs the final request URL using the provided environment, server, path,\n * path variables, and optional query parameters.\n *\n * - Environment variables and path variables are used to replace placeholders in the path string.\n * - The server URL is dynamically resolved (may apply env variables).\n * - urlParams are optionally appended as the query string.\n *\n * @param environment The current environment containing variable values.\n * @param server The selected server object; can be null.\n * @param path The raw path string from the OpenAPI document (may contain variables).\n * @param pathVariables Map of path variable values (e.g., { petId: '5' }).\n * @param urlParams Optional query parameters as URLSearchParams.\n * @returns Fully resolved URL as a string.\n */\nexport const getResolvedUrl = ({\n environment,\n server,\n path,\n pathVariables,\n allowReservedQueryParameters,\n urlParams,\n}: {\n environment: XScalarEnvironment\n server: ServerObject | null\n path: string\n pathVariables: Record<string, string>\n allowReservedQueryParameters?: Set<string>\n urlParams?: URLSearchParams\n}) => {\n const environmentVariables = getEnvironmentVariables(environment)\n const serverUrl = getServerUrl(server, environmentVariables)\n const pathWithVariables = replaceVariables(path, { ...environmentVariables, ...pathVariables })\n const mergedUrl = mergeUrls(serverUrl, pathWithVariables, urlParams)\n return applyAllowReservedToUrl(mergedUrl, allowReservedQueryParameters ?? new Set())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,kBAAkB,EAC7B,aACA,QACA,MACA,eACA,8BACA,gBAQI;CACJ,MAAM,uBAAuB,wBAAwB,YAAY;AAIjE,QAAO,wBADW,UAFA,aAAa,QAAQ,qBAAqB,EAClC,iBAAiB,MAAM;EAAE,GAAG;EAAsB,GAAG;EAAe,CAAC,EACrC,UAAU,EAC1B,gDAAgC,IAAI,KAAK,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/request-body';
2
- /**
3
- * Returns the selected body content type for the given request body and exampleKey.
4
- * Priority:
5
- * 1. requestBody?.['x-scalar-selected-content-type']?.[exampleKey] (if set)
6
- * 2. First key in requestBody?.content (if available)
7
- * 3. null (if none available)
8
- */
9
- export declare const getSelectedBodyContentType: (requestBody: RequestBodyObject | undefined, exampleKey?: string) => string | null;
10
- //# sourceMappingURL=get-selected-body-content-type.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-selected-body-content-type.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/get-selected-body-content-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAEjG;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACrC,aAAa,iBAAiB,GAAG,SAAS,EAC1C,aAAY,MAAkB,KAC7B,MAAM,GAAG,IAIX,CAAA"}
@@ -1,15 +0,0 @@
1
- //#region src/v2/blocks/operation-block/helpers/get-selected-body-content-type.ts
2
- /**
3
- * Returns the selected body content type for the given request body and exampleKey.
4
- * Priority:
5
- * 1. requestBody?.['x-scalar-selected-content-type']?.[exampleKey] (if set)
6
- * 2. First key in requestBody?.content (if available)
7
- * 3. null (if none available)
8
- */
9
- var getSelectedBodyContentType = (requestBody, exampleKey = "default") => {
10
- return requestBody?.["x-scalar-selected-content-type"]?.[exampleKey] ?? Object.keys(requestBody?.content ?? {})[0] ?? null;
11
- };
12
- //#endregion
13
- export { getSelectedBodyContentType };
14
-
15
- //# sourceMappingURL=get-selected-body-content-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-selected-body-content-type.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/get-selected-body-content-type.ts"],"sourcesContent":["import type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/request-body'\n\n/**\n * Returns the selected body content type for the given request body and exampleKey.\n * Priority:\n * 1. requestBody?.['x-scalar-selected-content-type']?.[exampleKey] (if set)\n * 2. First key in requestBody?.content (if available)\n * 3. null (if none available)\n */\nexport const getSelectedBodyContentType = (\n requestBody: RequestBodyObject | undefined,\n exampleKey: string = 'default',\n): string | null => {\n return (\n requestBody?.['x-scalar-selected-content-type']?.[exampleKey] ?? Object.keys(requestBody?.content ?? {})[0] ?? null\n )\n}\n"],"mappings":";;;;;;;;AASA,IAAa,8BACX,aACA,aAAqB,cACH;AAClB,QACE,cAAc,oCAAoC,eAAe,OAAO,KAAK,aAAa,WAAW,EAAE,CAAC,CAAC,MAAM"}
@@ -1,3 +0,0 @@
1
- import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server';
2
- export declare const getServerUrl: (server: ServerObject | null, environmentVariables: Record<string, string>) => string;
3
- //# sourceMappingURL=get-server-url.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-server-url.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/get-server-url.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AAGtF,eAAO,MAAM,YAAY,GAAI,QAAQ,YAAY,GAAG,IAAI,EAAE,sBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAarG,CAAA"}
@@ -1,18 +0,0 @@
1
- import { objectEntries } from "@vueuse/core";
2
- import { replaceVariables } from "@scalar/helpers/regex/replace-variables";
3
- //#region src/v2/blocks/operation-block/helpers/get-server-url.ts
4
- var getServerUrl = (server, environmentVariables) => {
5
- /** Extract the server variables default values*/
6
- const serverVariables = objectEntries(server?.variables ?? {}).reduce((acc, [name, variable]) => {
7
- if (variable.default) acc[name] = variable.default;
8
- return acc;
9
- }, {});
10
- return replaceVariables(server?.url ?? "", {
11
- ...environmentVariables,
12
- ...serverVariables
13
- });
14
- };
15
- //#endregion
16
- export { getServerUrl };
17
-
18
- //# sourceMappingURL=get-server-url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-server-url.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/get-server-url.ts"],"sourcesContent":["import { replaceVariables } from '@scalar/helpers/regex/replace-variables'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server'\nimport { objectEntries } from '@vueuse/core'\n\nexport const getServerUrl = (server: ServerObject | null, environmentVariables: Record<string, string>) => {\n /** Extract the server variables default values*/\n const serverVariables = objectEntries(server?.variables ?? {}).reduce(\n (acc, [name, variable]) => {\n if (variable.default) {\n acc[name] = variable.default\n }\n return acc\n },\n {} as Record<string, string>,\n )\n\n return replaceVariables(server?.url ?? '', { ...environmentVariables, ...serverVariables })\n}\n"],"mappings":";;;AAIA,IAAa,gBAAgB,QAA6B,yBAAiD;;CAEzG,MAAM,kBAAkB,cAAc,QAAQ,aAAa,EAAE,CAAC,CAAC,QAC5D,KAAK,CAAC,MAAM,cAAc;AACzB,MAAI,SAAS,QACX,KAAI,QAAQ,SAAS;AAEvB,SAAO;IAET,EAAE,CACH;AAED,QAAO,iBAAiB,QAAQ,OAAO,IAAI;EAAE,GAAG;EAAsB,GAAG;EAAiB,CAAC"}
@@ -1,96 +0,0 @@
1
- /**
2
- * Shared parameter serialization utilities for OpenAPI style values.
3
- * Used by both build-request-parameters and process-parameters.
4
- *
5
- * @see https://spec.openapis.org/oas/v3.1.1.html#style-values
6
- */
7
- /**
8
- * Serializes a value based on the content type for content-based query parameters.
9
- * Content-based query parameters do not use style serialization and instead follow
10
- * their content type specification (e.g., application/json should be JSON.stringified).
11
- *
12
- * @param value - The value to serialize
13
- * @param contentType - The content type to use for serialization
14
- * @returns The serialized value as a string
15
- */
16
- export declare const serializeContentValue: (value: unknown, contentType: string) => string;
17
- /**
18
- * Serializes a value according to OpenAPI simple style.
19
- * Used for path and header parameters.
20
- *
21
- * Simple style with explode: false
22
- * - Primitive: blue
23
- * - Array: blue,black,brown
24
- * - Object: R,100,G,200,B,150
25
- *
26
- * Simple style with explode: true
27
- * - Primitive: blue
28
- * - Array: blue,black,brown
29
- * - Object: R=100,G=200,B=150
30
- */
31
- export declare const serializeSimpleStyle: (value: unknown, explode: boolean) => unknown;
32
- /**
33
- * Serializes a value according to OpenAPI form style.
34
- * Used for query and cookie parameters.
35
- *
36
- * Form style with explode: true (default for query)
37
- * - Primitive: color=blue
38
- * - Array: color=blue&color=black&color=brown (multiple entries)
39
- * - Object: R=100&G=200&B=150 (multiple entries)
40
- *
41
- * Form style with explode: false
42
- * - Primitive: color=blue
43
- * - Array: color=blue,black,brown
44
- * - Object: color=R,100,G,200,B,150
45
- */
46
- export declare const serializeFormStyle: (value: unknown, explode: boolean) => unknown | Array<{
47
- key: string;
48
- value: unknown;
49
- }>;
50
- /**
51
- * Serializes a value according to OpenAPI form style for cookies.
52
- * This is similar to serializeFormStyle but handles nested objects recursively
53
- * and treats null values specially for cookie serialization.
54
- *
55
- * Form style with explode: true (default for cookies)
56
- * - Primitive: color=blue
57
- * - Array: color=blue&color=black&color=brown (multiple entries)
58
- * - Object: R=100&G=200&B=150 (multiple entries)
59
- *
60
- * Form style with explode: false
61
- * - Primitive: color=blue
62
- * - Array: color=blue,black,brown (null becomes "null")
63
- * - Object: color=R,100,G,200,B,150 (recursively flattened)
64
- */
65
- export declare const serializeFormStyleForCookies: (value: unknown, explode: boolean) => unknown | Array<{
66
- key: string;
67
- value: unknown;
68
- }>;
69
- /**
70
- * Serializes a value according to OpenAPI spaceDelimited style.
71
- * Only valid for query parameters with array or object values.
72
- *
73
- * SpaceDelimited array: blue black brown
74
- * SpaceDelimited object: R 100 G 200 B 150
75
- */
76
- export declare const serializeSpaceDelimitedStyle: (value: unknown) => string;
77
- /**
78
- * Serializes a value according to OpenAPI pipeDelimited style.
79
- * Only valid for query parameters with array or object values.
80
- *
81
- * PipeDelimited array: blue|black|brown
82
- * PipeDelimited object: R|100|G|200|B|150
83
- */
84
- export declare const serializePipeDelimitedStyle: (value: unknown) => string;
85
- /**
86
- * Serializes a value according to OpenAPI deepObject style.
87
- * Only valid for query parameters with explode: true.
88
- *
89
- * DeepObject: color[R]=100&color[G]=200&color[B]=150
90
- * Nested: user[name][first]=Alex&user[name][last]=Smith&user[role]=admin
91
- */
92
- export declare const serializeDeepObjectStyle: (paramName: string, value: unknown) => Array<{
93
- key: string;
94
- value: string;
95
- }>;
96
- //# sourceMappingURL=serialize-parameter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialize-parameter.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/serialize-parameter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,EAAE,aAAa,MAAM,KAAG,MAa3E,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,EAAE,SAAS,OAAO,KAAG,OAqBvE,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,OAAO,EACd,SAAS,OAAO,KACf,OAAO,GAAG,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CA4BjD,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B,GACvC,OAAO,OAAO,EACd,SAAS,OAAO,KACf,OAAO,GAAG,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CA2CjD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GAAI,OAAO,OAAO,KAAG,MAe7D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GAAI,OAAO,OAAO,KAAG,MAe5D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,WAAW,MAAM,EAAE,OAAO,OAAO,KAAG,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAyBhH,CAAA"}
@@ -1,160 +0,0 @@
1
- //#region src/v2/blocks/operation-block/helpers/serialize-parameter.ts
2
- /**
3
- * Shared parameter serialization utilities for OpenAPI style values.
4
- * Used by both build-request-parameters and process-parameters.
5
- *
6
- * @see https://spec.openapis.org/oas/v3.1.1.html#style-values
7
- */
8
- /**
9
- * Serializes a value based on the content type for content-based query parameters.
10
- * Content-based query parameters do not use style serialization and instead follow
11
- * their content type specification (e.g., application/json should be JSON.stringified).
12
- *
13
- * @param value - The value to serialize
14
- * @param contentType - The content type to use for serialization
15
- * @returns The serialized value as a string
16
- */
17
- var serializeContentValue = (value, contentType) => {
18
- if (typeof value === "string") return value;
19
- if (contentType.includes("json") || typeof value === "object" && value !== null && !Array.isArray(value)) return JSON.stringify(value);
20
- return String(value);
21
- };
22
- /**
23
- * Serializes a value according to OpenAPI simple style.
24
- * Used for path and header parameters.
25
- *
26
- * Simple style with explode: false
27
- * - Primitive: blue
28
- * - Array: blue,black,brown
29
- * - Object: R,100,G,200,B,150
30
- *
31
- * Simple style with explode: true
32
- * - Primitive: blue
33
- * - Array: blue,black,brown
34
- * - Object: R=100,G=200,B=150
35
- */
36
- var serializeSimpleStyle = (value, explode) => {
37
- if (Array.isArray(value)) return value.join(",");
38
- if (typeof value === "object" && value !== null) {
39
- const entries = Object.entries(value);
40
- if (explode) return entries.map(([k, v]) => `${k}=${v}`).join(",");
41
- return entries.map(([k, v]) => `${k},${v}`).join(",");
42
- }
43
- return value;
44
- };
45
- /**
46
- * Serializes a value according to OpenAPI form style.
47
- * Used for query and cookie parameters.
48
- *
49
- * Form style with explode: true (default for query)
50
- * - Primitive: color=blue
51
- * - Array: color=blue&color=black&color=brown (multiple entries)
52
- * - Object: R=100&G=200&B=150 (multiple entries)
53
- *
54
- * Form style with explode: false
55
- * - Primitive: color=blue
56
- * - Array: color=blue,black,brown
57
- * - Object: color=R,100,G,200,B,150
58
- */
59
- var serializeFormStyle = (value, explode) => {
60
- if (Array.isArray(value) && explode) return value.map((v) => ({
61
- key: "",
62
- value: v
63
- }));
64
- if (Array.isArray(value)) return value.join(",");
65
- if (typeof value === "object" && value !== null && explode) return Object.entries(value).map(([k, v]) => ({
66
- key: k,
67
- value: v
68
- }));
69
- if (typeof value === "object" && value !== null) return Object.entries(value).map(([k, v]) => `${k},${v}`).join(",");
70
- return value;
71
- };
72
- /**
73
- * Serializes a value according to OpenAPI form style for cookies.
74
- * This is similar to serializeFormStyle but handles nested objects recursively
75
- * and treats null values specially for cookie serialization.
76
- *
77
- * Form style with explode: true (default for cookies)
78
- * - Primitive: color=blue
79
- * - Array: color=blue&color=black&color=brown (multiple entries)
80
- * - Object: R=100&G=200&B=150 (multiple entries)
81
- *
82
- * Form style with explode: false
83
- * - Primitive: color=blue
84
- * - Array: color=blue,black,brown (null becomes "null")
85
- * - Object: color=R,100,G,200,B,150 (recursively flattened)
86
- */
87
- var serializeFormStyleForCookies = (value, explode) => {
88
- if (Array.isArray(value) && explode) return value.map((v) => ({
89
- key: "",
90
- value: v
91
- }));
92
- if (Array.isArray(value)) return value.map((v) => v === null ? "null" : String(v)).join(",");
93
- if (typeof value === "object" && value !== null && explode) return Object.entries(value).map(([k, v]) => ({
94
- key: k,
95
- value: v
96
- }));
97
- if (typeof value === "object" && value !== null) {
98
- const flattenObject = (obj) => {
99
- const result = [];
100
- for (const [key, val] of Object.entries(obj)) if (typeof val === "object" && val !== null && !Array.isArray(val)) result.push(key, ...flattenObject(val));
101
- else result.push(key, val === null ? "null" : String(val));
102
- return result;
103
- };
104
- return flattenObject(value).join(",");
105
- }
106
- return value;
107
- };
108
- /**
109
- * Serializes a value according to OpenAPI spaceDelimited style.
110
- * Only valid for query parameters with array or object values.
111
- *
112
- * SpaceDelimited array: blue black brown
113
- * SpaceDelimited object: R 100 G 200 B 150
114
- */
115
- var serializeSpaceDelimitedStyle = (value) => {
116
- if (Array.isArray(value)) return value.join(" ");
117
- if (typeof value === "object" && value !== null) return Object.entries(value).map(([k, v]) => `${k} ${v}`).join(" ");
118
- return String(value);
119
- };
120
- /**
121
- * Serializes a value according to OpenAPI pipeDelimited style.
122
- * Only valid for query parameters with array or object values.
123
- *
124
- * PipeDelimited array: blue|black|brown
125
- * PipeDelimited object: R|100|G|200|B|150
126
- */
127
- var serializePipeDelimitedStyle = (value) => {
128
- if (Array.isArray(value)) return value.join("|");
129
- if (typeof value === "object" && value !== null) return Object.entries(value).flat().join("|");
130
- return String(value);
131
- };
132
- /**
133
- * Serializes a value according to OpenAPI deepObject style.
134
- * Only valid for query parameters with explode: true.
135
- *
136
- * DeepObject: color[R]=100&color[G]=200&color[B]=150
137
- * Nested: user[name][first]=Alex&user[name][last]=Smith&user[role]=admin
138
- */
139
- var serializeDeepObjectStyle = (paramName, value) => {
140
- const result = [];
141
- /**
142
- * Recursively flattens nested objects into deepObject notation.
143
- */
144
- const flatten = (obj, prefix) => {
145
- for (const [key, val] of Object.entries(obj)) {
146
- const fullKey = `${prefix}[${key}]`;
147
- if (typeof val === "object" && val !== null && !Array.isArray(val)) flatten(val, fullKey);
148
- else result.push({
149
- key: fullKey,
150
- value: String(val)
151
- });
152
- }
153
- };
154
- if (typeof value === "object" && value !== null && !Array.isArray(value)) flatten(value, paramName);
155
- return result;
156
- };
157
- //#endregion
158
- export { serializeContentValue, serializeDeepObjectStyle, serializeFormStyle, serializeFormStyleForCookies, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle };
159
-
160
- //# sourceMappingURL=serialize-parameter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialize-parameter.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/serialize-parameter.ts"],"sourcesContent":["/**\n * Shared parameter serialization utilities for OpenAPI style values.\n * Used by both build-request-parameters and process-parameters.\n *\n * @see https://spec.openapis.org/oas/v3.1.1.html#style-values\n */\n\n/**\n * Serializes a value based on the content type for content-based query parameters.\n * Content-based query parameters do not use style serialization and instead follow\n * their content type specification (e.g., application/json should be JSON.stringified).\n *\n * @param value - The value to serialize\n * @param contentType - The content type to use for serialization\n * @returns The serialized value as a string\n */\nexport const serializeContentValue = (value: unknown, contentType: string): string => {\n // If already a string, return as is\n if (typeof value === 'string') {\n return value\n }\n\n // Handle JSON content types\n if (contentType.includes('json') || (typeof value === 'object' && value !== null && !Array.isArray(value))) {\n return JSON.stringify(value)\n }\n\n // Default: convert to string\n return String(value)\n}\n\n/**\n * Serializes a value according to OpenAPI simple style.\n * Used for path and header parameters.\n *\n * Simple style with explode: false\n * - Primitive: blue\n * - Array: blue,black,brown\n * - Object: R,100,G,200,B,150\n *\n * Simple style with explode: true\n * - Primitive: blue\n * - Array: blue,black,brown\n * - Object: R=100,G=200,B=150\n */\nexport const serializeSimpleStyle = (value: unknown, explode: boolean): unknown => {\n // Handle arrays\n if (Array.isArray(value)) {\n return value.join(',')\n }\n\n // Handle objects\n if (typeof value === 'object' && value !== null) {\n const entries = Object.entries(value as Record<string, unknown>)\n\n if (explode) {\n // Simple explode object: R=100,G=200,B=150\n return entries.map(([k, v]) => `${k}=${v}`).join(',')\n }\n\n // Simple no explode object: R,100,G,200,B,150\n return entries.map(([k, v]) => `${k},${v}`).join(',')\n }\n\n // Handle primitives - return as-is to preserve type\n return value\n}\n\n/**\n * Serializes a value according to OpenAPI form style.\n * Used for query and cookie parameters.\n *\n * Form style with explode: true (default for query)\n * - Primitive: color=blue\n * - Array: color=blue&color=black&color=brown (multiple entries)\n * - Object: R=100&G=200&B=150 (multiple entries)\n *\n * Form style with explode: false\n * - Primitive: color=blue\n * - Array: color=blue,black,brown\n * - Object: color=R,100,G,200,B,150\n */\nexport const serializeFormStyle = (\n value: unknown,\n explode: boolean,\n): unknown | Array<{ key: string; value: unknown }> => {\n // Handle arrays with explode\n if (Array.isArray(value) && explode) {\n return value.map((v) => ({ key: '', value: v }))\n }\n\n // Handle arrays without explode\n if (Array.isArray(value)) {\n return value.join(',')\n }\n\n // Handle objects with explode\n if (typeof value === 'object' && value !== null && explode) {\n return Object.entries(value as Record<string, unknown>).map(([k, v]) => ({\n key: k,\n value: v,\n }))\n }\n\n // Handle objects without explode\n if (typeof value === 'object' && value !== null) {\n return Object.entries(value as Record<string, unknown>)\n .map(([k, v]) => `${k},${v}`)\n .join(',')\n }\n\n // Handle primitives - return as-is to preserve type\n return value\n}\n\n/**\n * Serializes a value according to OpenAPI form style for cookies.\n * This is similar to serializeFormStyle but handles nested objects recursively\n * and treats null values specially for cookie serialization.\n *\n * Form style with explode: true (default for cookies)\n * - Primitive: color=blue\n * - Array: color=blue&color=black&color=brown (multiple entries)\n * - Object: R=100&G=200&B=150 (multiple entries)\n *\n * Form style with explode: false\n * - Primitive: color=blue\n * - Array: color=blue,black,brown (null becomes \"null\")\n * - Object: color=R,100,G,200,B,150 (recursively flattened)\n */\nexport const serializeFormStyleForCookies = (\n value: unknown,\n explode: boolean,\n): unknown | Array<{ key: string; value: unknown }> => {\n // Handle arrays with explode\n if (Array.isArray(value) && explode) {\n return value.map((v) => ({ key: '', value: v }))\n }\n\n // Handle arrays without explode - convert null to \"null\" string\n if (Array.isArray(value)) {\n return value.map((v) => (v === null ? 'null' : String(v))).join(',')\n }\n\n // Handle objects with explode\n if (typeof value === 'object' && value !== null && explode) {\n return Object.entries(value as Record<string, unknown>).map(([k, v]) => ({\n key: k,\n value: v,\n }))\n }\n\n // Handle objects without explode - recursively flatten nested objects\n if (typeof value === 'object' && value !== null) {\n const flattenObject = (obj: Record<string, unknown>): string[] => {\n const result: string[] = []\n\n for (const [key, val] of Object.entries(obj)) {\n // Recursively flatten nested objects\n if (typeof val === 'object' && val !== null && !Array.isArray(val)) {\n result.push(key, ...flattenObject(val as Record<string, unknown>))\n }\n // Handle primitive values\n else {\n result.push(key, val === null ? 'null' : String(val))\n }\n }\n\n return result\n }\n\n return flattenObject(value as Record<string, unknown>).join(',')\n }\n\n // Handle primitives - return as-is to preserve type\n return value\n}\n\n/**\n * Serializes a value according to OpenAPI spaceDelimited style.\n * Only valid for query parameters with array or object values.\n *\n * SpaceDelimited array: blue black brown\n * SpaceDelimited object: R 100 G 200 B 150\n */\nexport const serializeSpaceDelimitedStyle = (value: unknown): string => {\n // Handle arrays\n if (Array.isArray(value)) {\n return value.join(' ')\n }\n\n // Handle objects\n if (typeof value === 'object' && value !== null) {\n return Object.entries(value as Record<string, unknown>)\n .map(([k, v]) => `${k} ${v}`)\n .join(' ')\n }\n\n // Handle primitives (shouldn't happen for spaceDelimited)\n return String(value)\n}\n\n/**\n * Serializes a value according to OpenAPI pipeDelimited style.\n * Only valid for query parameters with array or object values.\n *\n * PipeDelimited array: blue|black|brown\n * PipeDelimited object: R|100|G|200|B|150\n */\nexport const serializePipeDelimitedStyle = (value: unknown): string => {\n // Handle arrays\n if (Array.isArray(value)) {\n return value.join('|')\n }\n\n // Handle objects\n if (typeof value === 'object' && value !== null) {\n return Object.entries(value as Record<string, unknown>)\n .flat()\n .join('|')\n }\n\n // Handle primitives (shouldn't happen for pipeDelimited)\n return String(value)\n}\n\n/**\n * Serializes a value according to OpenAPI deepObject style.\n * Only valid for query parameters with explode: true.\n *\n * DeepObject: color[R]=100&color[G]=200&color[B]=150\n * Nested: user[name][first]=Alex&user[name][last]=Smith&user[role]=admin\n */\nexport const serializeDeepObjectStyle = (paramName: string, value: unknown): Array<{ key: string; value: string }> => {\n const result: Array<{ key: string; value: string }> = []\n\n /**\n * Recursively flattens nested objects into deepObject notation.\n */\n const flatten = (obj: Record<string, unknown>, prefix: string): void => {\n for (const [key, val] of Object.entries(obj)) {\n const fullKey = `${prefix}[${key}]`\n\n if (typeof val === 'object' && val !== null && !Array.isArray(val)) {\n // Recursively flatten nested objects\n flatten(val as Record<string, unknown>, fullKey)\n } else {\n // Add primitive values\n result.push({ key: fullKey, value: String(val) })\n }\n }\n }\n\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n flatten(value as Record<string, unknown>, paramName)\n }\n\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAa,yBAAyB,OAAgB,gBAAgC;AAEpF,KAAI,OAAO,UAAU,SACnB,QAAO;AAIT,KAAI,YAAY,SAAS,OAAO,IAAK,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM,CACvG,QAAO,KAAK,UAAU,MAAM;AAI9B,QAAO,OAAO,MAAM;;;;;;;;;;;;;;;;AAiBtB,IAAa,wBAAwB,OAAgB,YAA8B;AAEjF,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,IAAI;AAIxB,KAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EAC/C,MAAM,UAAU,OAAO,QAAQ,MAAiC;AAEhE,MAAI,QAEF,QAAO,QAAQ,KAAK,CAAC,GAAG,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI;AAIvD,SAAO,QAAQ,KAAK,CAAC,GAAG,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI;;AAIvD,QAAO;;;;;;;;;;;;;;;;AAiBT,IAAa,sBACX,OACA,YACqD;AAErD,KAAI,MAAM,QAAQ,MAAM,IAAI,QAC1B,QAAO,MAAM,KAAK,OAAO;EAAE,KAAK;EAAI,OAAO;EAAG,EAAE;AAIlD,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,IAAI;AAIxB,KAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,QACjD,QAAO,OAAO,QAAQ,MAAiC,CAAC,KAAK,CAAC,GAAG,QAAQ;EACvE,KAAK;EACL,OAAO;EACR,EAAE;AAIL,KAAI,OAAO,UAAU,YAAY,UAAU,KACzC,QAAO,OAAO,QAAQ,MAAiC,CACpD,KAAK,CAAC,GAAG,OAAO,GAAG,EAAE,GAAG,IAAI,CAC5B,KAAK,IAAI;AAId,QAAO;;;;;;;;;;;;;;;;;AAkBT,IAAa,gCACX,OACA,YACqD;AAErD,KAAI,MAAM,QAAQ,MAAM,IAAI,QAC1B,QAAO,MAAM,KAAK,OAAO;EAAE,KAAK;EAAI,OAAO;EAAG,EAAE;AAIlD,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,MAAO,MAAM,OAAO,SAAS,OAAO,EAAE,CAAE,CAAC,KAAK,IAAI;AAItE,KAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,QACjD,QAAO,OAAO,QAAQ,MAAiC,CAAC,KAAK,CAAC,GAAG,QAAQ;EACvE,KAAK;EACL,OAAO;EACR,EAAE;AAIL,KAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EAC/C,MAAM,iBAAiB,QAA2C;GAChE,MAAM,SAAmB,EAAE;AAE3B,QAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,IAAI,CAE1C,KAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,CAAC,MAAM,QAAQ,IAAI,CAChE,QAAO,KAAK,KAAK,GAAG,cAAc,IAA+B,CAAC;OAIlE,QAAO,KAAK,KAAK,QAAQ,OAAO,SAAS,OAAO,IAAI,CAAC;AAIzD,UAAO;;AAGT,SAAO,cAAc,MAAiC,CAAC,KAAK,IAAI;;AAIlE,QAAO;;;;;;;;;AAUT,IAAa,gCAAgC,UAA2B;AAEtE,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,IAAI;AAIxB,KAAI,OAAO,UAAU,YAAY,UAAU,KACzC,QAAO,OAAO,QAAQ,MAAiC,CACpD,KAAK,CAAC,GAAG,OAAO,GAAG,EAAE,GAAG,IAAI,CAC5B,KAAK,IAAI;AAId,QAAO,OAAO,MAAM;;;;;;;;;AAUtB,IAAa,+BAA+B,UAA2B;AAErE,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,IAAI;AAIxB,KAAI,OAAO,UAAU,YAAY,UAAU,KACzC,QAAO,OAAO,QAAQ,MAAiC,CACpD,MAAM,CACN,KAAK,IAAI;AAId,QAAO,OAAO,MAAM;;;;;;;;;AAUtB,IAAa,4BAA4B,WAAmB,UAA0D;CACpH,MAAM,SAAgD,EAAE;;;;CAKxD,MAAM,WAAW,KAA8B,WAAyB;AACtE,OAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,IAAI,EAAE;GAC5C,MAAM,UAAU,GAAG,OAAO,GAAG,IAAI;AAEjC,OAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,CAAC,MAAM,QAAQ,IAAI,CAEhE,SAAQ,KAAgC,QAAQ;OAGhD,QAAO,KAAK;IAAE,KAAK;IAAS,OAAO,OAAO,IAAI;IAAE,CAAC;;;AAKvD,KAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM,CACtE,SAAQ,OAAkC,UAAU;AAGtD,QAAO"}
@@ -1,40 +0,0 @@
1
- import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
- type GetExampleFromSchemaOptions = {
3
- /** Fallback string for empty string values. */
4
- emptyString?: string;
5
- /** Whether to use XML tag names as keys. */
6
- xml?: boolean;
7
- /** Whether to show read-only/write-only properties. */
8
- mode?: 'read' | 'write';
9
- /** Dynamic variables which can replace values via x-variable. */
10
- variables?: Record<string, unknown>;
11
- /** Whether to omit empty and optional properties. */
12
- omitEmptyAndOptionalProperties?: boolean;
13
- /** Selected oneOf/anyOf variants keyed by schema path. */
14
- compositionSelection?: Record<string, number>;
15
- };
16
- /**
17
- * Generate an example value from a given OpenAPI SchemaObject.
18
- *
19
- * This function recursively processes OpenAPI schemas to create realistic example data.
20
- * It handles all OpenAPI schema types including primitives, objects, arrays, and
21
- * composition schemas (allOf, oneOf, anyOf).
22
- * Uses a tonne of caching for maximum performance.
23
- *
24
- * @param schema - The OpenAPI SchemaObject to generate an example from.
25
- * @param options - Options to customize example generation.
26
- * @param level - The current recursion depth.
27
- * @param parentSchema - The parent schema, if any.
28
- * @param name - The name of the property being processed.
29
- * @returns An example value for the given schema.
30
- */
31
- export declare const getExampleFromSchema: (schema: SchemaObject, options?: GetExampleFromSchemaOptions, { level, parentSchema, name, seen, schemaPath, }?: Partial<{
32
- level: number;
33
- parentSchema: SchemaObject;
34
- name: string;
35
- seen: WeakSet<object>;
36
- /** Internal traversal path used to resolve nested composition selections. */
37
- schemaPath: string[];
38
- }>) => unknown;
39
- export {};
40
- //# sourceMappingURL=get-example-from-schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-example-from-schema.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-example-from-schema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAwfhG,KAAK,2BAA2B,GAAG;IACjC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,qDAAqD;IACrD,8BAA8B,CAAC,EAAE,OAAO,CAAA;IACxC,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC9C,CAAA;AAeD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,YAAY,EACpB,UAAU,2BAA2B,EACrC,mDAMG,OAAO,CAAC;IACT,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IACrB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAM,KACN,OAiKF,CAAA"}