@scalar/api-client 2.39.3 → 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 (338) hide show
  1. package/CHANGELOG.md +28 -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/hooks/useResponseBody.js +2 -2
  12. package/dist/hooks/useResponseBody.js.map +1 -1
  13. package/dist/libs/index.d.ts +0 -1
  14. package/dist/libs/index.d.ts.map +1 -1
  15. package/dist/libs/index.js +1 -2
  16. package/dist/libs/send-request/decode-buffer.js +2 -2
  17. package/dist/libs/send-request/decode-buffer.js.map +1 -1
  18. package/dist/style.css +222 -263
  19. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +14 -10
  20. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  22. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +57 -35
  23. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +2 -2
  25. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js.map +1 -1
  26. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -5
  27. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  28. package/dist/v2/blocks/operation-block/helpers/send-request.js +18 -33
  29. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  30. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -1
  31. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +1 -1
  32. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
  33. package/dist/v2/blocks/operation-block/index.d.ts +0 -3
  34. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  35. package/dist/v2/blocks/operation-block/index.js +1 -4
  36. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +1 -1
  37. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  39. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
  40. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +3 -1
  41. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
  42. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +4 -2
  43. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  44. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +3 -2
  45. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js.map +1 -1
  46. package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +1 -1
  47. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +1 -1
  48. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -1
  49. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.js.map +1 -1
  50. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +7 -2
  51. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  52. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +4 -3
  53. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js.map +1 -1
  54. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  55. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +2 -3
  56. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js.map +1 -1
  57. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts +3 -1
  58. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  59. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +5 -8
  60. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js.map +1 -1
  61. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +1 -1
  62. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
  63. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.js.map +1 -1
  64. package/dist/v2/blocks/operation-code-sample/index.d.ts +0 -1
  65. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  66. package/dist/v2/blocks/operation-code-sample/index.js +2 -3
  67. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +7 -9
  68. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  69. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  70. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  71. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +49 -42
  72. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  73. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  74. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  75. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  76. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +2 -3
  77. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  78. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  80. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +1 -0
  81. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  82. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  83. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  84. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +11 -9
  85. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  86. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +1 -1
  87. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts +1 -1
  88. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts.map +1 -1
  89. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +2 -1
  90. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js.map +1 -1
  91. package/dist/v2/blocks/response-block/helpers/get-content-length.d.ts.map +1 -1
  92. package/dist/v2/blocks/response-block/helpers/get-content-length.js +2 -2
  93. package/dist/v2/blocks/response-block/helpers/get-content-length.js.map +1 -1
  94. package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
  95. package/dist/v2/blocks/response-block/helpers/process-response-body.js.map +1 -1
  96. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  97. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  98. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  99. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +76 -25
  100. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  101. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  102. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  103. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  104. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +2 -2
  105. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  106. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -1
  107. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  108. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  109. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +1 -1
  110. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  111. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  112. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  113. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  114. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +8 -4
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  116. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -1
  117. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  118. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  119. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  120. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +1 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  122. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  123. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  124. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  126. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +1 -1
  127. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
  128. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  129. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +6 -2
  130. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  131. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +0 -3
  132. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  133. package/dist/v2/blocks/scalar-auth-selector-block/index.js +1 -3
  134. package/dist/v2/components/code-input/CodeInput.vue.d.ts +16 -8
  135. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  136. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  137. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  138. package/dist/v2/components/code-input/CodeInput.vue.script.js +15 -10
  139. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  140. package/dist/v2/constants.js +1 -1
  141. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  142. package/dist/v2/features/app/App.vue.js.map +1 -1
  143. package/dist/v2/features/app/App.vue.script.js +1 -5
  144. package/dist/v2/features/app/App.vue.script.js.map +1 -1
  145. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  146. package/dist/v2/features/app/app-events.js +1 -1
  147. package/dist/v2/features/app/app-events.js.map +1 -1
  148. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  149. package/dist/v2/features/app/app-state.js +2 -2
  150. package/dist/v2/features/app/app-state.js.map +1 -1
  151. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  152. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  153. package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
  154. package/dist/v2/features/app/components/AppSidebar.vue.script.js +1 -1
  155. package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
  156. package/dist/v2/features/app/helpers/routes.d.ts +0 -3
  157. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  158. package/dist/v2/features/app/helpers/routes.js +1 -1
  159. package/dist/v2/features/app/helpers/routes.js.map +1 -1
  160. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  161. package/dist/v2/features/collection/DocumentCollection.vue.js.map +1 -1
  162. package/dist/v2/features/collection/DocumentCollection.vue.script.js +30 -52
  163. package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
  164. package/dist/v2/features/collection/OperationCollection.vue.script.js +0 -1
  165. package/dist/v2/features/collection/OperationCollection.vue.script.js.map +1 -1
  166. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +0 -1
  167. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +1 -1
  168. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  169. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  170. package/dist/v2/features/collection/components/Authentication.vue.js.map +1 -1
  171. package/dist/v2/features/collection/components/Authentication.vue.script.js +6 -8
  172. package/dist/v2/features/collection/components/Authentication.vue.script.js.map +1 -1
  173. package/dist/v2/features/collection/components/Cookies.vue.script.js +0 -1
  174. package/dist/v2/features/collection/components/Cookies.vue.script.js.map +1 -1
  175. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js +0 -1
  176. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js.map +1 -1
  177. package/dist/v2/features/collection/components/Environment.vue.script.js +0 -1
  178. package/dist/v2/features/collection/components/Environment.vue.script.js.map +1 -1
  179. package/dist/v2/features/collection/components/Overview.vue.script.js +0 -1
  180. package/dist/v2/features/collection/components/Overview.vue.script.js.map +1 -1
  181. package/dist/v2/features/collection/components/Servers.vue.script.js +0 -1
  182. package/dist/v2/features/collection/components/Servers.vue.script.js.map +1 -1
  183. package/dist/v2/features/collection/components/Settings.vue.js.map +1 -1
  184. package/dist/v2/features/collection/components/Settings.vue.script.js +2 -3
  185. package/dist/v2/features/collection/components/Settings.vue.script.js.map +1 -1
  186. package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +1 -1
  187. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  188. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  189. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +1 -1
  190. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  191. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  192. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  193. package/dist/v2/features/modal/Modal.vue.script.js +3 -4
  194. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  195. package/dist/v2/features/modal/helpers/map-hidden-clients-config.js +1 -1
  196. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  197. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  198. package/dist/v2/features/operation/Operation.vue.script.js +50 -84
  199. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  200. package/dist/v2/features/operation/index.d.ts +0 -4
  201. package/dist/v2/features/operation/index.d.ts.map +1 -1
  202. package/dist/v2/features/operation/index.js +1 -5
  203. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  204. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js.map +1 -1
  205. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js +11 -1
  206. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js.map +1 -1
  207. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  208. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  209. package/dist/views/Request/RequestSection/RequestTable.vue.js.map +1 -1
  210. package/dist/views/Request/RequestSection/RequestTable.vue.script.js +1 -1
  211. package/dist/views/Request/RequestSection/RequestTable.vue.script.js.map +1 -1
  212. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.script.js +1 -1
  213. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  214. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js.map +1 -1
  215. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js +2 -2
  216. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js.map +1 -1
  217. package/dist/views/Request/libs/oauth2.js +1 -1
  218. package/dist/views/Request/libs/oauth2.js.map +1 -1
  219. package/package.json +25 -31
  220. package/dist/libs/formatters.d.ts +0 -12
  221. package/dist/libs/formatters.d.ts.map +0 -1
  222. package/dist/libs/formatters.js +0 -36
  223. package/dist/libs/formatters.js.map +0 -1
  224. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts +0 -6
  225. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts.map +0 -1
  226. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js +0 -58
  227. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js.map +0 -1
  228. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +0 -12
  229. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +0 -1
  230. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +0 -65
  231. package/dist/v2/blocks/operation-block/helpers/build-request-body.js.map +0 -1
  232. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +0 -31
  233. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +0 -1
  234. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +0 -55
  235. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js.map +0 -1
  236. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +0 -27
  237. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +0 -1
  238. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +0 -159
  239. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js.map +0 -1
  240. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +0 -25
  241. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +0 -1
  242. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +0 -53
  243. package/dist/v2/blocks/operation-block/helpers/build-request-security.js.map +0 -1
  244. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +0 -46
  245. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +0 -1
  246. package/dist/v2/blocks/operation-block/helpers/build-request.js +0 -102
  247. package/dist/v2/blocks/operation-block/helpers/build-request.js.map +0 -1
  248. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +0 -4
  249. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +0 -1
  250. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +0 -41
  251. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js.map +0 -1
  252. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts +0 -14
  253. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts.map +0 -1
  254. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +0 -20
  255. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js.map +0 -1
  256. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts +0 -8
  257. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts.map +0 -1
  258. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts +0 -9
  259. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts.map +0 -1
  260. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +0 -17
  261. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js.map +0 -1
  262. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +0 -10
  263. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +0 -1
  264. package/dist/v2/blocks/operation-block/helpers/get-example.js +0 -41
  265. package/dist/v2/blocks/operation-block/helpers/get-example.js.map +0 -1
  266. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +0 -26
  267. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +0 -1
  268. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +0 -32
  269. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js.map +0 -1
  270. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +0 -10
  271. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +0 -1
  272. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +0 -15
  273. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js.map +0 -1
  274. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts +0 -3
  275. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts.map +0 -1
  276. package/dist/v2/blocks/operation-block/helpers/get-server-url.js +0 -18
  277. package/dist/v2/blocks/operation-block/helpers/get-server-url.js.map +0 -1
  278. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts +0 -96
  279. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts.map +0 -1
  280. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js +0 -160
  281. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js.map +0 -1
  282. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +0 -40
  283. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +0 -1
  284. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +0 -437
  285. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js.map +0 -1
  286. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +0 -6
  287. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +0 -1
  288. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +0 -25
  289. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js.map +0 -1
  290. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +0 -141
  291. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js.map +0 -1
  292. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +0 -4
  293. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +0 -1
  294. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +0 -10
  295. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js.map +0 -1
  296. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +0 -9
  297. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +0 -1
  298. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +0 -27
  299. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js.map +0 -1
  300. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +0 -25
  301. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +0 -1
  302. package/dist/v2/components/callout/Callout.vue.js +0 -9
  303. package/dist/v2/components/callout/Callout.vue.js.map +0 -1
  304. package/dist/v2/components/callout/Callout.vue.script.js +0 -35
  305. package/dist/v2/components/callout/Callout.vue.script.js.map +0 -1
  306. package/dist/v2/features/operation/helpers/combine-params.d.ts +0 -4
  307. package/dist/v2/features/operation/helpers/combine-params.d.ts.map +0 -1
  308. package/dist/v2/features/operation/helpers/combine-params.js +0 -20
  309. package/dist/v2/features/operation/helpers/combine-params.js.map +0 -1
  310. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +0 -17
  311. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +0 -1
  312. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +0 -12
  313. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +0 -1
  314. package/dist/v2/features/operation/helpers/get-security-requirements.js +0 -17
  315. package/dist/v2/features/operation/helpers/get-security-requirements.js.map +0 -1
  316. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +0 -15
  317. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +0 -1
  318. package/dist/v2/features/operation/helpers/get-selected-security.js +0 -41
  319. package/dist/v2/features/operation/helpers/get-selected-security.js.map +0 -1
  320. package/dist/v2/features/operation/helpers/get-selected-server.d.ts +0 -13
  321. package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +0 -1
  322. package/dist/v2/features/operation/helpers/get-selected-server.js +0 -21
  323. package/dist/v2/features/operation/helpers/get-selected-server.js.map +0 -1
  324. package/dist/v2/helpers/get-active-environment.d.ts +0 -5
  325. package/dist/v2/helpers/get-active-environment.d.ts.map +0 -1
  326. package/dist/v2/helpers/get-active-environment.js +0 -19
  327. package/dist/v2/helpers/get-active-environment.js.map +0 -1
  328. package/dist/v2/helpers/get-active-proxy-url.d.ts +0 -18
  329. package/dist/v2/helpers/get-active-proxy-url.d.ts.map +0 -1
  330. package/dist/v2/helpers/get-active-proxy-url.js +0 -26
  331. package/dist/v2/helpers/get-active-proxy-url.js.map +0 -1
  332. package/dist/v2/helpers/get-servers.d.ts +0 -23
  333. package/dist/v2/helpers/get-servers.d.ts.map +0 -1
  334. package/dist/v2/helpers/get-servers.js +0 -106
  335. package/dist/v2/helpers/get-servers.js.map +0 -1
  336. package/dist/v2/helpers/index.d.ts +0 -3
  337. package/dist/v2/helpers/index.d.ts.map +0 -1
  338. package/dist/v2/helpers/index.js +0 -3
@@ -1,141 +0,0 @@
1
- import { isObject } from "@scalar/helpers/object/is-object";
2
- import { objectEntries } from "@scalar/helpers/object/object-entries";
3
- //#region src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts
4
- /**
5
- * Maps x-scalar-secret fields to their corresponding input field names.
6
- * This allows us to fall back to config values when auth store secrets are not available.
7
- */
8
- var SECRET_TO_INPUT_FIELD_MAP = {
9
- "x-scalar-secret-client-id": "x-scalar-client-id",
10
- "x-scalar-secret-client-secret": "clientSecret",
11
- "x-scalar-secret-password": "password",
12
- "x-scalar-secret-redirect-uri": "x-scalar-redirect-uri",
13
- "x-scalar-secret-token": "token",
14
- "x-scalar-secret-username": "username",
15
- "x-scalar-secret-auth-url": "authorizationUrl",
16
- "x-scalar-secret-token-url": "tokenUrl"
17
- };
18
- var mergeFlowSecrets = (properties, configSecrets, authStoreSecrets = {}) => Object.fromEntries(properties.map((property) => {
19
- return [property, authStoreSecrets[property] || configSecrets[property] || configSecrets[SECRET_TO_INPUT_FIELD_MAP[property]] || ""];
20
- }));
21
- var extractRefreshTokenSecret = (authStoreSecrets = {}) => {
22
- const refreshToken = authStoreSecrets["x-scalar-secret-refresh-token"];
23
- if (typeof refreshToken === "string") return { "x-scalar-secret-refresh-token": refreshToken };
24
- return {};
25
- };
26
- var extractCredentialsLocation = (configSecrets, authStoreSecrets = {}) => {
27
- const credentialsLocation = authStoreSecrets["x-scalar-credentials-location"] ?? configSecrets["x-scalar-credentials-location"];
28
- return credentialsLocation ? { "x-scalar-credentials-location": credentialsLocation } : {};
29
- };
30
- /**
31
- * Extract flow secrets and selected scopes for OAuth-like flows.
32
- * Reused by both oauth2 and openIdConnect security schemes.
33
- */
34
- var extractOAuthFlowSecrets = (flows, storeSecrets) => {
35
- const selectedScopes = /* @__PURE__ */ new Set();
36
- return {
37
- flows: objectEntries(flows ?? {}).reduce((acc, [key, flow]) => {
38
- if (!isObject(flow)) return acc;
39
- const flowSelectedScopes = flow["selectedScopes"];
40
- if (Array.isArray(flowSelectedScopes)) flowSelectedScopes.forEach((scope) => typeof scope === "string" && selectedScopes.add(scope));
41
- if (key === "implicit") acc.implicit = {
42
- ...flow,
43
- ...mergeFlowSecrets([
44
- "x-scalar-secret-client-id",
45
- "x-scalar-secret-redirect-uri",
46
- "x-scalar-secret-token",
47
- "x-scalar-secret-auth-url"
48
- ], flow, storeSecrets?.implicit),
49
- ...extractRefreshTokenSecret(storeSecrets?.implicit)
50
- };
51
- if (key === "password") acc[key] = {
52
- ...flow,
53
- ...mergeFlowSecrets([
54
- "x-scalar-secret-client-id",
55
- "x-scalar-secret-client-secret",
56
- "x-scalar-secret-username",
57
- "x-scalar-secret-password",
58
- "x-scalar-secret-token",
59
- "x-scalar-secret-token-url"
60
- ], flow, storeSecrets?.password),
61
- ...extractCredentialsLocation(flow, storeSecrets?.password),
62
- ...extractRefreshTokenSecret(storeSecrets?.password)
63
- };
64
- if (key === "clientCredentials") acc[key] = {
65
- ...flow,
66
- ...mergeFlowSecrets([
67
- "x-scalar-secret-client-id",
68
- "x-scalar-secret-client-secret",
69
- "x-scalar-secret-token",
70
- "x-scalar-secret-token-url"
71
- ], flow, storeSecrets?.clientCredentials),
72
- ...extractCredentialsLocation(flow, storeSecrets?.clientCredentials),
73
- ...extractRefreshTokenSecret(storeSecrets?.clientCredentials)
74
- };
75
- if (key === "authorizationCode") acc[key] = {
76
- ...flow,
77
- ...mergeFlowSecrets([
78
- "x-scalar-secret-client-id",
79
- "x-scalar-secret-client-secret",
80
- "x-scalar-secret-redirect-uri",
81
- "x-scalar-secret-token",
82
- "x-scalar-secret-auth-url",
83
- "x-scalar-secret-token-url"
84
- ], flow, storeSecrets?.authorizationCode),
85
- ...extractCredentialsLocation(flow, storeSecrets?.authorizationCode),
86
- ...extractRefreshTokenSecret(storeSecrets?.authorizationCode)
87
- };
88
- return acc;
89
- }, {}),
90
- selectedScopes: Array.from(selectedScopes)
91
- };
92
- };
93
- /** Extract the secrets from the config and the auth store */
94
- var extractSecuritySchemeSecrets = (scheme, authStore, name, documentSlug) => {
95
- const secrets = authStore.getAuthSecrets(documentSlug, name);
96
- if (scheme.type === "apiKey") {
97
- const storeSecrets = secrets?.type === "apiKey" ? secrets : void 0;
98
- return {
99
- ...scheme,
100
- "x-scalar-secret-token": storeSecrets?.["x-scalar-secret-token"] || scheme.value || ""
101
- };
102
- }
103
- if (scheme.type === "http") {
104
- const storeSecrets = secrets?.type === "http" ? secrets : void 0;
105
- return {
106
- ...scheme,
107
- "x-scalar-secret-token": storeSecrets?.["x-scalar-secret-token"] || scheme.token || "",
108
- "x-scalar-secret-username": storeSecrets?.["x-scalar-secret-username"] || scheme.username || "",
109
- "x-scalar-secret-password": storeSecrets?.["x-scalar-secret-password"] || scheme.password || ""
110
- };
111
- }
112
- if (scheme.type === "oauth2") {
113
- const storeSecrets = secrets?.type === "oauth2" ? secrets : void 0;
114
- const extracted = extractOAuthFlowSecrets(scheme.flows, storeSecrets);
115
- const configuredDefaultScopes = Array.isArray(scheme["x-default-scopes"]) ? scheme["x-default-scopes"].filter((scope) => typeof scope === "string") : [];
116
- const mergedDefaultScopes = Array.from(new Set([...configuredDefaultScopes, ...extracted.selectedScopes]));
117
- return {
118
- ...scheme,
119
- flows: extracted.flows,
120
- "x-default-scopes": mergedDefaultScopes
121
- };
122
- }
123
- if (scheme.type === "openIdConnect") {
124
- const storeSecrets = secrets?.type === "openIdConnect" ? secrets : void 0;
125
- const extracted = extractOAuthFlowSecrets({
126
- implicit: storeSecrets?.implicit,
127
- password: storeSecrets?.password,
128
- clientCredentials: storeSecrets?.clientCredentials,
129
- authorizationCode: storeSecrets?.authorizationCode
130
- }, storeSecrets);
131
- return {
132
- ...scheme,
133
- ...objectEntries(extracted.flows).length ? { flows: extracted.flows } : {}
134
- };
135
- }
136
- return scheme;
137
- };
138
- //#endregion
139
- export { extractSecuritySchemeSecrets };
140
-
141
- //# sourceMappingURL=extract-security-scheme-secrets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract-security-scheme-secrets.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts"],"sourcesContent":["import { isObject } from '@scalar/helpers/object/is-object'\nimport { objectEntries } from '@scalar/helpers/object/object-entries'\nimport type { SecurityScheme } from '@scalar/types/entities'\nimport type { AuthStore, SecretsOAuthFlows, SecretsOpenIdConnect } from '@scalar/workspace-store/entities/auth'\nimport type { DeepPartial } from '@scalar/workspace-store/helpers/overrides-proxy'\nimport type { XScalarCredentialsLocation } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-credentials-location'\nimport type {\n OAuthFlowAuthorizationCode,\n OAuthFlowClientCredentials,\n OAuthFlowImplicit,\n OAuthFlowPassword,\n} from '@scalar/workspace-store/schemas/v3.1/strict/oauth-flow'\nimport type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport type {\n ApiKeyObjectSecret,\n HttpObjectSecret,\n OAuth2ObjectSecret,\n OAuthFlowAuthorizationCodeSecret,\n OAuthFlowClientCredentialsSecret,\n OAuthFlowImplicitSecret,\n OAuthFlowPasswordSecret,\n OAuthFlowsObjectSecret,\n OpenIdConnectObjectSecret,\n SecuritySchemeObjectSecret,\n} from './secret-types'\n\n/** A combined scheme that includes both the auth store secrets and a deep partial of the config auth */\nexport type ConfigAuthScheme = SecuritySchemeObject & DeepPartial<SecurityScheme>\n\n/**\n * Maps x-scalar-secret fields to their corresponding input field names.\n * This allows us to fall back to config values when auth store secrets are not available.\n */\nconst SECRET_TO_INPUT_FIELD_MAP = {\n 'x-scalar-secret-client-id': 'x-scalar-client-id',\n 'x-scalar-secret-client-secret': 'clientSecret',\n 'x-scalar-secret-password': 'password',\n 'x-scalar-secret-redirect-uri': 'x-scalar-redirect-uri',\n 'x-scalar-secret-token': 'token',\n 'x-scalar-secret-username': 'username',\n 'x-scalar-secret-auth-url': 'authorizationUrl',\n 'x-scalar-secret-token-url': 'tokenUrl',\n} as const\n\nconst mergeFlowSecrets = <const T extends readonly (keyof typeof SECRET_TO_INPUT_FIELD_MAP)[]>(\n properties: T,\n configSecrets: Record<string, unknown>,\n authStoreSecrets: Record<string, unknown> = {},\n): Record<T[number], string> =>\n Object.fromEntries(\n properties.map((property) => {\n // Super merge in order of priority: auth store > config > config input field > empty string\n const value =\n authStoreSecrets[property] ||\n configSecrets[property] ||\n configSecrets[SECRET_TO_INPUT_FIELD_MAP[property]] ||\n ''\n\n return [property, value]\n }),\n ) as Record<T[number], string>\n\nconst extractRefreshTokenSecret = (\n authStoreSecrets: { 'x-scalar-secret-refresh-token'?: string } = {},\n): { 'x-scalar-secret-refresh-token'?: string } => {\n const refreshToken = authStoreSecrets['x-scalar-secret-refresh-token']\n\n if (typeof refreshToken === 'string') {\n return { 'x-scalar-secret-refresh-token': refreshToken }\n }\n\n return {}\n}\n\nconst extractCredentialsLocation = (\n configSecrets: Record<string, unknown>,\n authStoreSecrets: {\n 'x-scalar-credentials-location'?: XScalarCredentialsLocation['x-scalar-credentials-location']\n } = {},\n): XScalarCredentialsLocation => {\n const credentialsLocation =\n authStoreSecrets['x-scalar-credentials-location'] ??\n (configSecrets['x-scalar-credentials-location'] as XScalarCredentialsLocation['x-scalar-credentials-location'])\n\n return credentialsLocation ? { 'x-scalar-credentials-location': credentialsLocation } : {}\n}\n\n/**\n * Extract flow secrets and selected scopes for OAuth-like flows.\n * Reused by both oauth2 and openIdConnect security schemes.\n */\nconst extractOAuthFlowSecrets = (\n flows: Record<string, unknown> | undefined,\n storeSecrets?: Partial<SecretsOAuthFlows> | Partial<SecretsOpenIdConnect>,\n): {\n flows: OAuthFlowsObjectSecret\n selectedScopes: string[]\n} => {\n const selectedScopes = new Set<string>()\n\n const extractedFlows = objectEntries(flows ?? {}).reduce((acc, [key, flow]) => {\n if (!isObject(flow)) {\n return acc\n }\n\n // Store any selected scopes from the config\n const flowSelectedScopes = flow['selectedScopes']\n if (Array.isArray(flowSelectedScopes)) {\n flowSelectedScopes.forEach((scope) => typeof scope === 'string' && selectedScopes.add(scope))\n }\n\n // Implicit flow\n if (key === 'implicit') {\n acc.implicit = {\n ...(flow as OAuthFlowImplicit),\n ...mergeFlowSecrets(\n [\n 'x-scalar-secret-client-id',\n 'x-scalar-secret-redirect-uri',\n 'x-scalar-secret-token',\n 'x-scalar-secret-auth-url',\n ],\n flow,\n storeSecrets?.implicit,\n ),\n ...extractRefreshTokenSecret(storeSecrets?.implicit),\n } satisfies OAuthFlowImplicitSecret\n }\n\n // Password flow\n if (key === 'password') {\n acc[key] = {\n ...(flow as OAuthFlowPassword),\n ...mergeFlowSecrets(\n [\n 'x-scalar-secret-client-id',\n 'x-scalar-secret-client-secret',\n 'x-scalar-secret-username',\n 'x-scalar-secret-password',\n 'x-scalar-secret-token',\n 'x-scalar-secret-token-url',\n ],\n flow,\n storeSecrets?.password,\n ),\n ...extractCredentialsLocation(flow, storeSecrets?.password),\n ...extractRefreshTokenSecret(storeSecrets?.password),\n } satisfies OAuthFlowPasswordSecret\n }\n\n // Client credentials flow\n if (key === 'clientCredentials') {\n acc[key] = {\n ...(flow as OAuthFlowClientCredentials),\n ...mergeFlowSecrets(\n [\n 'x-scalar-secret-client-id',\n 'x-scalar-secret-client-secret',\n 'x-scalar-secret-token',\n 'x-scalar-secret-token-url',\n ],\n flow,\n storeSecrets?.clientCredentials,\n ),\n ...extractCredentialsLocation(flow, storeSecrets?.clientCredentials),\n ...extractRefreshTokenSecret(storeSecrets?.clientCredentials),\n } satisfies OAuthFlowClientCredentialsSecret\n }\n\n // Authorization code flow\n if (key === 'authorizationCode') {\n acc[key] = {\n ...(flow as OAuthFlowAuthorizationCode),\n ...mergeFlowSecrets(\n [\n 'x-scalar-secret-client-id',\n 'x-scalar-secret-client-secret',\n 'x-scalar-secret-redirect-uri',\n 'x-scalar-secret-token',\n 'x-scalar-secret-auth-url',\n 'x-scalar-secret-token-url',\n ],\n flow,\n storeSecrets?.authorizationCode,\n ),\n ...extractCredentialsLocation(flow, storeSecrets?.authorizationCode),\n ...extractRefreshTokenSecret(storeSecrets?.authorizationCode),\n } satisfies OAuthFlowAuthorizationCodeSecret\n }\n\n return acc\n }, {} as OAuthFlowsObjectSecret)\n\n return { flows: extractedFlows, selectedScopes: Array.from(selectedScopes) }\n}\n\n/** Extract the secrets from the config and the auth store */\nexport const extractSecuritySchemeSecrets = (\n // Include the config fields\n scheme: SecuritySchemeObject & DeepPartial<SecurityScheme>,\n authStore: AuthStore,\n name: string,\n documentSlug: string,\n): SecuritySchemeObjectSecret => {\n const secrets = authStore.getAuthSecrets(documentSlug, name)\n\n // Handle API Key security schemes\n if (scheme.type === 'apiKey') {\n const storeSecrets = secrets?.type === 'apiKey' ? secrets : undefined\n return {\n ...scheme,\n 'x-scalar-secret-token': storeSecrets?.['x-scalar-secret-token'] || scheme.value || '',\n } satisfies ApiKeyObjectSecret\n }\n\n // Handle HTTP Auth security schemes (e.g., Basic, Bearer)\n if (scheme.type === 'http') {\n const storeSecrets = secrets?.type === 'http' ? secrets : undefined\n return {\n ...scheme,\n 'x-scalar-secret-token': storeSecrets?.['x-scalar-secret-token'] || scheme.token || '',\n 'x-scalar-secret-username': storeSecrets?.['x-scalar-secret-username'] || scheme.username || '',\n 'x-scalar-secret-password': storeSecrets?.['x-scalar-secret-password'] || scheme.password || '',\n } satisfies HttpObjectSecret\n }\n\n // Handle OAuth2 security schemes and all supported flows\n if (scheme.type === 'oauth2') {\n const storeSecrets = secrets?.type === 'oauth2' ? secrets : undefined\n const extracted = extractOAuthFlowSecrets(scheme.flows, storeSecrets)\n const configuredDefaultScopes = Array.isArray(scheme['x-default-scopes'])\n ? scheme['x-default-scopes'].filter((scope): scope is string => typeof scope === 'string')\n : []\n const mergedDefaultScopes = Array.from(new Set([...configuredDefaultScopes, ...extracted.selectedScopes]))\n\n return {\n ...scheme,\n flows: extracted.flows,\n 'x-default-scopes': mergedDefaultScopes,\n } satisfies OAuth2ObjectSecret\n }\n\n // OpenID Connect uses auth-store-only discovered flows, but we expose them in OAuth-like flow format.\n if (scheme.type === 'openIdConnect') {\n const storeSecrets = secrets?.type === 'openIdConnect' ? secrets : undefined\n const extracted = extractOAuthFlowSecrets(\n {\n implicit: storeSecrets?.implicit,\n password: storeSecrets?.password,\n clientCredentials: storeSecrets?.clientCredentials,\n authorizationCode: storeSecrets?.authorizationCode,\n },\n storeSecrets,\n )\n\n return {\n ...scheme,\n ...(objectEntries(extracted.flows).length ? { flows: extracted.flows } : {}),\n } as OpenIdConnectObjectSecret\n }\n\n return scheme as SecuritySchemeObjectSecret\n}\n"],"mappings":";;;;;;;AAkCA,IAAM,4BAA4B;CAChC,6BAA6B;CAC7B,iCAAiC;CACjC,4BAA4B;CAC5B,gCAAgC;CAChC,yBAAyB;CACzB,4BAA4B;CAC5B,4BAA4B;CAC5B,6BAA6B;CAC9B;AAED,IAAM,oBACJ,YACA,eACA,mBAA4C,EAAE,KAE9C,OAAO,YACL,WAAW,KAAK,aAAa;AAQ3B,QAAO,CAAC,UALN,iBAAiB,aACjB,cAAc,aACd,cAAc,0BAA0B,cACxC,GAEsB;EACxB,CACH;AAEH,IAAM,6BACJ,mBAAiE,EAAE,KAClB;CACjD,MAAM,eAAe,iBAAiB;AAEtC,KAAI,OAAO,iBAAiB,SAC1B,QAAO,EAAE,iCAAiC,cAAc;AAG1D,QAAO,EAAE;;AAGX,IAAM,8BACJ,eACA,mBAEI,EAAE,KACyB;CAC/B,MAAM,sBACJ,iBAAiB,oCAChB,cAAc;AAEjB,QAAO,sBAAsB,EAAE,iCAAiC,qBAAqB,GAAG,EAAE;;;;;;AAO5F,IAAM,2BACJ,OACA,iBAIG;CACH,MAAM,iCAAiB,IAAI,KAAa;AA+FxC,QAAO;EAAE,OA7Fc,cAAc,SAAS,EAAE,CAAC,CAAC,QAAQ,KAAK,CAAC,KAAK,UAAU;AAC7E,OAAI,CAAC,SAAS,KAAK,CACjB,QAAO;GAIT,MAAM,qBAAqB,KAAK;AAChC,OAAI,MAAM,QAAQ,mBAAmB,CACnC,oBAAmB,SAAS,UAAU,OAAO,UAAU,YAAY,eAAe,IAAI,MAAM,CAAC;AAI/F,OAAI,QAAQ,WACV,KAAI,WAAW;IACb,GAAI;IACJ,GAAG,iBACD;KACE;KACA;KACA;KACA;KACD,EACD,MACA,cAAc,SACf;IACD,GAAG,0BAA0B,cAAc,SAAS;IACrD;AAIH,OAAI,QAAQ,WACV,KAAI,OAAO;IACT,GAAI;IACJ,GAAG,iBACD;KACE;KACA;KACA;KACA;KACA;KACA;KACD,EACD,MACA,cAAc,SACf;IACD,GAAG,2BAA2B,MAAM,cAAc,SAAS;IAC3D,GAAG,0BAA0B,cAAc,SAAS;IACrD;AAIH,OAAI,QAAQ,oBACV,KAAI,OAAO;IACT,GAAI;IACJ,GAAG,iBACD;KACE;KACA;KACA;KACA;KACD,EACD,MACA,cAAc,kBACf;IACD,GAAG,2BAA2B,MAAM,cAAc,kBAAkB;IACpE,GAAG,0BAA0B,cAAc,kBAAkB;IAC9D;AAIH,OAAI,QAAQ,oBACV,KAAI,OAAO;IACT,GAAI;IACJ,GAAG,iBACD;KACE;KACA;KACA;KACA;KACA;KACA;KACD,EACD,MACA,cAAc,kBACf;IACD,GAAG,2BAA2B,MAAM,cAAc,kBAAkB;IACpE,GAAG,0BAA0B,cAAc,kBAAkB;IAC9D;AAGH,UAAO;KACN,EAAE,CAA2B;EAEA,gBAAgB,MAAM,KAAK,eAAe;EAAE;;;AAI9E,IAAa,gCAEX,QACA,WACA,MACA,iBAC+B;CAC/B,MAAM,UAAU,UAAU,eAAe,cAAc,KAAK;AAG5D,KAAI,OAAO,SAAS,UAAU;EAC5B,MAAM,eAAe,SAAS,SAAS,WAAW,UAAU,KAAA;AAC5D,SAAO;GACL,GAAG;GACH,yBAAyB,eAAe,4BAA4B,OAAO,SAAS;GACrF;;AAIH,KAAI,OAAO,SAAS,QAAQ;EAC1B,MAAM,eAAe,SAAS,SAAS,SAAS,UAAU,KAAA;AAC1D,SAAO;GACL,GAAG;GACH,yBAAyB,eAAe,4BAA4B,OAAO,SAAS;GACpF,4BAA4B,eAAe,+BAA+B,OAAO,YAAY;GAC7F,4BAA4B,eAAe,+BAA+B,OAAO,YAAY;GAC9F;;AAIH,KAAI,OAAO,SAAS,UAAU;EAC5B,MAAM,eAAe,SAAS,SAAS,WAAW,UAAU,KAAA;EAC5D,MAAM,YAAY,wBAAwB,OAAO,OAAO,aAAa;EACrE,MAAM,0BAA0B,MAAM,QAAQ,OAAO,oBAAoB,GACrE,OAAO,oBAAoB,QAAQ,UAA2B,OAAO,UAAU,SAAS,GACxF,EAAE;EACN,MAAM,sBAAsB,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,yBAAyB,GAAG,UAAU,eAAe,CAAC,CAAC;AAE1G,SAAO;GACL,GAAG;GACH,OAAO,UAAU;GACjB,oBAAoB;GACrB;;AAIH,KAAI,OAAO,SAAS,iBAAiB;EACnC,MAAM,eAAe,SAAS,SAAS,kBAAkB,UAAU,KAAA;EACnE,MAAM,YAAY,wBAChB;GACE,UAAU,cAAc;GACxB,UAAU,cAAc;GACxB,mBAAmB,cAAc;GACjC,mBAAmB,cAAc;GAClC,EACD,aACD;AAED,SAAO;GACL,GAAG;GACH,GAAI,cAAc,UAAU,MAAM,CAAC,SAAS,EAAE,OAAO,UAAU,OAAO,GAAG,EAAE;GAC5E;;AAGH,QAAO"}
@@ -1,4 +0,0 @@
1
- import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
- /** Determines if the authentication is optional */
3
- export declare const isAuthOptional: (securityRequirements: NonNullable<OpenApiDocument["security"]>) => boolean;
4
- //# sourceMappingURL=is-auth-optional.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-auth-optional.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAEnG,mDAAmD;AACnD,eAAO,MAAM,cAAc,GAAI,sBAAsB,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,KAAG,OAK/F,CAAA"}
@@ -1,10 +0,0 @@
1
- //#region src/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.ts
2
- /** Determines if the authentication is optional */
3
- var isAuthOptional = (securityRequirements) => {
4
- const hasComplexRequirement = securityRequirements.some((requirement) => Object.keys(requirement).length > 1);
5
- return securityRequirements.some((requirement) => Object.keys(requirement).length === 0) && !hasComplexRequirement;
6
- };
7
- //#endregion
8
- export { isAuthOptional };
9
-
10
- //# sourceMappingURL=is-auth-optional.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-auth-optional.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.ts"],"sourcesContent":["import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/** Determines if the authentication is optional */\nexport const isAuthOptional = (securityRequirements: NonNullable<OpenApiDocument['security']>): boolean => {\n const hasComplexRequirement = securityRequirements.some((requirement) => Object.keys(requirement).length > 1)\n const hasEmptyRequirement = securityRequirements.some((requirement) => Object.keys(requirement).length === 0)\n\n return hasEmptyRequirement && !hasComplexRequirement\n}\n"],"mappings":";;AAGA,IAAa,kBAAkB,yBAA4E;CACzG,MAAM,wBAAwB,qBAAqB,MAAM,gBAAgB,OAAO,KAAK,YAAY,CAAC,SAAS,EAAE;AAG7G,QAF4B,qBAAqB,MAAM,gBAAgB,OAAO,KAAK,YAAY,CAAC,WAAW,EAAE,IAE/E,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { AuthenticationConfiguration } from '@scalar/types/api-reference';
2
- import type { AuthStore } from '@scalar/workspace-store/entities/auth';
3
- import { type ComponentsObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
- import type { SecuritySchemeObjectSecret } from './secret-types';
5
- /** Document security merged with the config security schemes */
6
- export type MergedSecuritySchemes = Record<string, SecuritySchemeObjectSecret>;
7
- /** Merge the authentication config with the document security schemes + the auth store secrets */
8
- export declare const mergeSecurity: (documentSecuritySchemes: ComponentsObject["securitySchemes"], configSecuritySchemes: AuthenticationConfiguration["securitySchemes"], authStore: AuthStore, documentSlug: string) => MergedSecuritySchemes;
9
- //# sourceMappingURL=merge-security.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merge-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/merge-security.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AAKtE,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAEhE,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAA;AAE9E,kGAAkG;AAClG,eAAO,MAAM,aAAa,GACxB,yBAAyB,gBAAgB,CAAC,iBAAiB,CAAM,EACjE,uBAAuB,2BAA2B,CAAC,iBAAiB,CAAM,EAC1E,WAAW,SAAS,EACpB,cAAc,MAAM,KACnB,qBA2BF,CAAA"}
@@ -1,27 +0,0 @@
1
- import { extractSecuritySchemeSecrets } from "./extract-security-scheme-secrets.js";
2
- import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
4
- import { objectEntries } from "@scalar/helpers/object/object-entries";
5
- import { SecuritySchemeObjectSchema } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
6
- import { deepClone } from "@scalar/workspace-store/helpers/deep-clone";
7
- import { mergeObjects } from "@scalar/workspace-store/helpers/merge-object";
8
- //#region src/v2/blocks/scalar-auth-selector-block/helpers/merge-security.ts
9
- /** Merge the authentication config with the document security schemes + the auth store secrets */
10
- var mergeSecurity = (documentSecuritySchemes = {}, configSecuritySchemes = {}, authStore, documentSlug) => {
11
- /** Convert the config secrets to the new secret extensions */
12
- return objectEntries(mergeObjects(objectEntries(documentSecuritySchemes).reduce((acc, [key, value]) => {
13
- const resolved = deepClone(getResolvedRef(value));
14
- if (resolved) acc[key] = resolved;
15
- return acc;
16
- }, {}), configSecuritySchemes) ?? {}).reduce((acc, [name, value]) => {
17
- acc[name] = extractSecuritySchemeSecrets({
18
- ...coerceValue(SecuritySchemeObjectSchema, value),
19
- ...value
20
- }, authStore, name, documentSlug);
21
- return acc;
22
- }, {});
23
- };
24
- //#endregion
25
- export { mergeSecurity };
26
-
27
- //# sourceMappingURL=merge-security.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merge-security.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/merge-security.ts"],"sourcesContent":["import { objectEntries } from '@scalar/helpers/object/object-entries'\nimport type { AuthenticationConfiguration } from '@scalar/types/api-reference'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport { deepClone } from '@scalar/workspace-store/helpers/deep-clone'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { mergeObjects } from '@scalar/workspace-store/helpers/merge-object'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\nimport {\n type ComponentsObject,\n type SecuritySchemeObject,\n SecuritySchemeObjectSchema,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { extractSecuritySchemeSecrets } from './extract-security-scheme-secrets'\nimport type { SecuritySchemeObjectSecret } from './secret-types'\n\n/** Document security merged with the config security schemes */\nexport type MergedSecuritySchemes = Record<string, SecuritySchemeObjectSecret>\n\n/** Merge the authentication config with the document security schemes + the auth store secrets */\nexport const mergeSecurity = (\n documentSecuritySchemes: ComponentsObject['securitySchemes'] = {},\n configSecuritySchemes: AuthenticationConfiguration['securitySchemes'] = {},\n authStore: AuthStore,\n documentSlug: string,\n): MergedSecuritySchemes => {\n /** Resolve any refs in the document security schemes */\n const resolvedDocumentSecuritySchemes = objectEntries(documentSecuritySchemes).reduce(\n (acc, [key, value]) => {\n const resolved = deepClone(getResolvedRef(value))\n if (resolved) {\n acc[key] = resolved\n }\n return acc\n },\n {} as Record<string, SecuritySchemeObject>,\n )\n\n /** Merge the config security schemes into the document security schemes */\n const mergedSchemes =\n mergeObjects<Record<string, SecuritySchemeObject>>(resolvedDocumentSecuritySchemes, configSecuritySchemes) ?? {}\n\n /** Convert the config secrets to the new secret extensions */\n return objectEntries(mergedSchemes).reduce((acc, [name, value]) => {\n // We coerce in case the scheme is missing any key fields like type\n const coerced = coerceValue(SecuritySchemeObjectSchema, value)\n // We then overwrite it back with the original value to keep any other fields like description, etc.\n const merged = { ...coerced, ...value }\n\n acc[name] = extractSecuritySchemeSecrets(merged, authStore, name, documentSlug)\n return acc\n }, {} as MergedSecuritySchemes)\n}\n"],"mappings":";;;;;;;;;AAoBA,IAAa,iBACX,0BAA+D,EAAE,EACjE,wBAAwE,EAAE,EAC1E,WACA,iBAC0B;;AAkB1B,QAAO,cAHL,aAbsC,cAAc,wBAAwB,CAAC,QAC5E,KAAK,CAAC,KAAK,WAAW;EACrB,MAAM,WAAW,UAAU,eAAe,MAAM,CAAC;AACjD,MAAI,SACF,KAAI,OAAO;AAEb,SAAO;IAET,EAAE,CACH,EAIqF,sBAAsB,IAAI,EAAE,CAG/E,CAAC,QAAQ,KAAK,CAAC,MAAM,WAAW;AAMjE,MAAI,QAAQ,6BAFG;GAAE,GAFD,YAAY,4BAA4B,MAAM;GAEjC,GAAG;GAAO,EAEU,WAAW,MAAM,aAAa;AAC/E,SAAO;IACN,EAAE,CAA0B"}
@@ -1,25 +0,0 @@
1
- import type { XScalarAuthUrl, XScalarCredentialsLocation, XScalarSecretClientId, XScalarSecretClientSecret, XScalarSecretHTTP, XScalarSecretRedirectUri, XScalarSecretRefreshToken, XScalarSecretToken, XScalarTokenUrl } from '@scalar/workspace-store/schemas/extensions/security';
2
- import type { OAuthFlowAuthorizationCode, OAuthFlowClientCredentials, OAuthFlowImplicit, OAuthFlowPassword } from '@scalar/workspace-store/schemas/v3.1/strict/oauth-flow';
3
- import type { ApiKeyObject, HttpObject, OAuth2Object, OpenIdConnectObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
- type OAuthFlowCommonSecret = XScalarSecretClientId & XScalarSecretToken & XScalarSecretRefreshToken & XScalarAuthUrl & XScalarTokenUrl;
5
- export type OAuthFlowImplicitSecret = OAuthFlowImplicit & OAuthFlowCommonSecret & XScalarSecretRedirectUri;
6
- export type OAuthFlowPasswordSecret = OAuthFlowPassword & OAuthFlowCommonSecret & XScalarSecretHTTP & XScalarSecretClientSecret & XScalarCredentialsLocation;
7
- export type OAuthFlowClientCredentialsSecret = OAuthFlowClientCredentials & OAuthFlowCommonSecret & XScalarSecretClientSecret & XScalarCredentialsLocation;
8
- export type OAuthFlowAuthorizationCodeSecret = OAuthFlowAuthorizationCode & OAuthFlowCommonSecret & XScalarSecretClientSecret & XScalarSecretRedirectUri & XScalarCredentialsLocation;
9
- export type OAuthFlowsObjectSecret = {
10
- implicit?: OAuthFlowImplicitSecret;
11
- password?: OAuthFlowPasswordSecret;
12
- clientCredentials?: OAuthFlowClientCredentialsSecret;
13
- authorizationCode?: OAuthFlowAuthorizationCodeSecret;
14
- };
15
- export type ApiKeyObjectSecret = ApiKeyObject & XScalarSecretToken;
16
- export type HttpObjectSecret = HttpObject & XScalarSecretHTTP & XScalarSecretToken;
17
- export type OAuth2ObjectSecret = Omit<OAuth2Object, 'flows'> & {
18
- flows: OAuthFlowsObjectSecret;
19
- };
20
- export type OpenIdConnectObjectSecret = OpenIdConnectObject & {
21
- flows?: OAuthFlowsObjectSecret;
22
- };
23
- export type SecuritySchemeObjectSecret = ApiKeyObjectSecret | HttpObjectSecret | OAuth2ObjectSecret | OpenIdConnectObjectSecret;
24
- export {};
25
- //# sourceMappingURL=secret-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secret-types.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/secret-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EAChB,MAAM,qDAAqD,CAAA;AAC5D,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,wDAAwD,CAAA;AAC/D,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,mBAAmB,EACpB,MAAM,8DAA8D,CAAA;AAErE,KAAK,qBAAqB,GAAG,qBAAqB,GAChD,kBAAkB,GAClB,yBAAyB,GACzB,cAAc,GACd,eAAe,CAAA;AAEjB,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,wBAAwB,CAAA;AAE1G,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GACrD,qBAAqB,GACrB,iBAAiB,GACjB,yBAAyB,GACzB,0BAA0B,CAAA;AAE5B,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,GACvE,qBAAqB,GACrB,yBAAyB,GACzB,0BAA0B,CAAA;AAE5B,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,GACvE,qBAAqB,GACrB,yBAAyB,GACzB,wBAAwB,GACxB,0BAA0B,CAAA;AAE5B,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,uBAAuB,CAAA;IAClC,QAAQ,CAAC,EAAE,uBAAuB,CAAA;IAClC,iBAAiB,CAAC,EAAE,gCAAgC,CAAA;IACpD,iBAAiB,CAAC,EAAE,gCAAgC,CAAA;CACrD,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,kBAAkB,CAAA;AAClE,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,iBAAiB,GAAG,kBAAkB,CAAA;AAClF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG;IAAE,KAAK,EAAE,sBAAsB,CAAA;CAAE,CAAA;AAChG,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,GAAG;IAAE,KAAK,CAAC,EAAE,sBAAsB,CAAA;CAAE,CAAA;AAEhG,MAAM,MAAM,0BAA0B,GAClC,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,yBAAyB,CAAA"}
@@ -1,9 +0,0 @@
1
- import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.js";
2
- import Callout_vue_vue_type_script_setup_true_lang_default from "./Callout.vue.script.js";
3
- /* empty css */
4
- //#region src/v2/components/callout/Callout.vue
5
- var Callout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Callout_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-fa58cbab"]]);
6
- //#endregion
7
- export { Callout_default as default };
8
-
9
- //# sourceMappingURL=Callout.vue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Callout.vue.js","names":[],"sources":["../../../../src/v2/components/callout/Callout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarIconCheckCircle,\n ScalarIconInfo,\n ScalarIconWarning,\n ScalarIconWarningCircle,\n} from '@scalar/icons'\n\ntype CalloutType = 'info' | 'success' | 'warning' | 'danger' | 'neutral'\n\nconst { type } = defineProps<{\n type: CalloutType\n}>()\n\nconst slots = defineSlots<{\n default: () => string\n actions?: () => string\n}>()\n\nconst iconsMapping = {\n info: ScalarIconInfo,\n success: ScalarIconCheckCircle,\n warning: ScalarIconWarning,\n danger: ScalarIconWarningCircle,\n neutral: ScalarIconInfo,\n} satisfies Record<CalloutType, unknown>\n</script>\n\n<template>\n <div :class=\"`callout t-editor__callout callout__${type}`\">\n <div class=\"flex w-full flex-col gap-2\">\n <div class=\"flex items-start gap-2\">\n <div\n class=\"callout-content__icon\"\n data-scalar-name=\"callout-icon\">\n <component\n :is=\"iconsMapping[type]\"\n class=\"size-5 shrink-0\" />\n </div>\n <div class=\"callout-content__text\">\n <slots.default />\n </div>\n </div>\n <div\n v-if=\"slots.actions\"\n class=\"flex justify-end gap-2\">\n <slots.actions />\n </div>\n </div>\n </div>\n</template>\n<style scoped>\n/* ----------------------------------------------------- */\n/* Custom Callout Styles */\n\n.dark-mode .t-editor__callout,\n.light-mode .t-editor__callout {\n --callout-font-size: var(--scalar-small);\n\n --callout-neutral-primary: var(--scalar-color-3);\n --callout-neutral-secondary: color-mix(\n in srgb,\n var(--scalar-background-2),\n transparent 50%\n );\n --callout-neutral-font-color: var(--scalar-color-1);\n\n --callout-success-primary: var(--scalar-color-green);\n --callout-success-secondary: color-mix(\n in srgb,\n var(--scalar-color-green),\n transparent 97%\n );\n --callout-success-font-color: var(--scalar-color-1);\n\n --callout-danger-primary: var(--scalar-color-red);\n --callout-danger-secondary: color-mix(\n in srgb,\n var(--scalar-color-red),\n transparent 97%\n );\n --callout-danger-font-color: var(--scalar-color-1);\n\n --callout-warning-primary: var(--scalar-color-yellow);\n --callout-warning-secondary: color-mix(\n in srgb,\n var(--scalar-color-yellow),\n transparent 97%\n );\n --callout-warning-font-color: var(--scalar-color-1);\n\n --callout-info-primary: var(--scalar-color-blue);\n --callout-info-secondary: color-mix(\n in srgb,\n var(--scalar-color-blue),\n transparent 97%\n );\n --callout-info-font-color: var(--scalar-color-1);\n\n --callout-line-height: 22px;\n}\n\n.t-editor__callout {\n border-radius: var(--scalar-radius);\n margin-top: var(--scalar-block-spacing);\n padding: 10px 14px;\n\n --callout-primary: var(--scalar-border-color);\n --callout-secondary: var(--scalar-background-2);\n --callout-svg: var(--callout-primary);\n\n background: var(--callout-secondary);\n border: var(--scalar-border-width) solid\n color-mix(in srgb, var(--callout-primary), transparent 50%);\n}\n\n.t-editor__callout .callout-content__text {\n font-size: var(--callout-font-size);\n flex: 1 1 0%;\n line-height: var(--callout-line-height);\n}\n\n.t-editor__callout .callout-content__icon {\n position: relative;\n border-radius: var(--scalar-radius);\n width: 18px;\n height: fit-content;\n color: var(--callout-svg);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.t-editor__callout .callout-content__icon svg,\n.t-editor__callout .callout-content__icon img {\n width: 18px;\n height: 18px;\n}\n\n/* vertical align icon to text, don't remove this */\n.t-editor__callout .callout-content__icon:before {\n content: '\\200b';\n line-height: var(--callout-line-height);\n}\n\n/* Apply callout colors */\n.t-editor__callout.callout__neutral {\n --callout-primary: var(--callout-neutral-primary);\n --callout-secondary: var(--callout-neutral-secondary);\n --callout-font-color: var(--callout-neutral-font-color);\n --callout-svg: var(--callout-neutral-font-color);\n}\n\n.t-editor__callout.callout__info {\n --callout-primary: var(--callout-info-primary);\n --callout-secondary: var(--callout-info-secondary);\n --callout-font-color: var(--callout-info-font-color);\n --callout-svg: var(--callout-info-primary);\n}\n\n.t-editor__callout.callout__warning {\n --callout-primary: var(--callout-warning-primary);\n --callout-secondary: var(--callout-warning-secondary);\n --callout-font-color: var(--callout-warning-font-color);\n --callout-svg: var(--callout-warning-primary);\n}\n\n.t-editor__callout.callout__success {\n --callout-primary: var(--callout-success-primary);\n --callout-secondary: var(--callout-success-secondary);\n --callout-font-color: var(--callout-success-font-color);\n --callout-svg: var(--callout-success-primary);\n}\n\n.t-editor__callout.callout__danger {\n --callout-primary: var(--callout-danger-primary);\n --callout-secondary: var(--callout-danger-secondary);\n --callout-font-color: var(--callout-danger-font-color);\n --callout-svg: var(--callout-danger-primary);\n}\n</style>\n"],"mappings":""}
@@ -1,35 +0,0 @@
1
- import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, resolveDynamicComponent, useSlots } from "vue";
2
- import { ScalarIconCheckCircle, ScalarIconInfo, ScalarIconWarning, ScalarIconWarningCircle } from "@scalar/icons";
3
- //#region src/v2/components/callout/Callout.vue?vue&type=script&setup=true&lang.ts
4
- var _hoisted_1 = { class: "flex w-full flex-col gap-2" };
5
- var _hoisted_2 = { class: "flex items-start gap-2" };
6
- var _hoisted_3 = {
7
- class: "callout-content__icon",
8
- "data-scalar-name": "callout-icon"
9
- };
10
- var _hoisted_4 = { class: "callout-content__text" };
11
- var _hoisted_5 = {
12
- key: 0,
13
- class: "flex justify-end gap-2"
14
- };
15
- var Callout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
16
- __name: "Callout",
17
- props: { type: {} },
18
- setup(__props) {
19
- const slots = useSlots();
20
- const iconsMapping = {
21
- info: ScalarIconInfo,
22
- success: ScalarIconCheckCircle,
23
- warning: ScalarIconWarning,
24
- danger: ScalarIconWarningCircle,
25
- neutral: ScalarIconInfo
26
- };
27
- return (_ctx, _cache) => {
28
- return openBlock(), createElementBlock("div", { class: normalizeClass(`callout t-editor__callout callout__${__props.type}`) }, [createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [(openBlock(), createBlock(resolveDynamicComponent(iconsMapping[__props.type]), { class: "size-5 shrink-0" }))]), createElementVNode("div", _hoisted_4, [createVNode(slots.default)])]), slots.actions ? (openBlock(), createElementBlock("div", _hoisted_5, [createVNode(slots.actions)])) : createCommentVNode("", true)])], 2);
29
- };
30
- }
31
- });
32
- //#endregion
33
- export { Callout_vue_vue_type_script_setup_true_lang_default as default };
34
-
35
- //# sourceMappingURL=Callout.vue.script.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Callout.vue.script.js","names":[],"sources":["../../../../src/v2/components/callout/Callout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarIconCheckCircle,\n ScalarIconInfo,\n ScalarIconWarning,\n ScalarIconWarningCircle,\n} from '@scalar/icons'\n\ntype CalloutType = 'info' | 'success' | 'warning' | 'danger' | 'neutral'\n\nconst { type } = defineProps<{\n type: CalloutType\n}>()\n\nconst slots = defineSlots<{\n default: () => string\n actions?: () => string\n}>()\n\nconst iconsMapping = {\n info: ScalarIconInfo,\n success: ScalarIconCheckCircle,\n warning: ScalarIconWarning,\n danger: ScalarIconWarningCircle,\n neutral: ScalarIconInfo,\n} satisfies Record<CalloutType, unknown>\n</script>\n\n<template>\n <div :class=\"`callout t-editor__callout callout__${type}`\">\n <div class=\"flex w-full flex-col gap-2\">\n <div class=\"flex items-start gap-2\">\n <div\n class=\"callout-content__icon\"\n data-scalar-name=\"callout-icon\">\n <component\n :is=\"iconsMapping[type]\"\n class=\"size-5 shrink-0\" />\n </div>\n <div class=\"callout-content__text\">\n <slots.default />\n </div>\n </div>\n <div\n v-if=\"slots.actions\"\n class=\"flex justify-end gap-2\">\n <slots.actions />\n </div>\n </div>\n </div>\n</template>\n<style scoped>\n/* ----------------------------------------------------- */\n/* Custom Callout Styles */\n\n.dark-mode .t-editor__callout,\n.light-mode .t-editor__callout {\n --callout-font-size: var(--scalar-small);\n\n --callout-neutral-primary: var(--scalar-color-3);\n --callout-neutral-secondary: color-mix(\n in srgb,\n var(--scalar-background-2),\n transparent 50%\n );\n --callout-neutral-font-color: var(--scalar-color-1);\n\n --callout-success-primary: var(--scalar-color-green);\n --callout-success-secondary: color-mix(\n in srgb,\n var(--scalar-color-green),\n transparent 97%\n );\n --callout-success-font-color: var(--scalar-color-1);\n\n --callout-danger-primary: var(--scalar-color-red);\n --callout-danger-secondary: color-mix(\n in srgb,\n var(--scalar-color-red),\n transparent 97%\n );\n --callout-danger-font-color: var(--scalar-color-1);\n\n --callout-warning-primary: var(--scalar-color-yellow);\n --callout-warning-secondary: color-mix(\n in srgb,\n var(--scalar-color-yellow),\n transparent 97%\n );\n --callout-warning-font-color: var(--scalar-color-1);\n\n --callout-info-primary: var(--scalar-color-blue);\n --callout-info-secondary: color-mix(\n in srgb,\n var(--scalar-color-blue),\n transparent 97%\n );\n --callout-info-font-color: var(--scalar-color-1);\n\n --callout-line-height: 22px;\n}\n\n.t-editor__callout {\n border-radius: var(--scalar-radius);\n margin-top: var(--scalar-block-spacing);\n padding: 10px 14px;\n\n --callout-primary: var(--scalar-border-color);\n --callout-secondary: var(--scalar-background-2);\n --callout-svg: var(--callout-primary);\n\n background: var(--callout-secondary);\n border: var(--scalar-border-width) solid\n color-mix(in srgb, var(--callout-primary), transparent 50%);\n}\n\n.t-editor__callout .callout-content__text {\n font-size: var(--callout-font-size);\n flex: 1 1 0%;\n line-height: var(--callout-line-height);\n}\n\n.t-editor__callout .callout-content__icon {\n position: relative;\n border-radius: var(--scalar-radius);\n width: 18px;\n height: fit-content;\n color: var(--callout-svg);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.t-editor__callout .callout-content__icon svg,\n.t-editor__callout .callout-content__icon img {\n width: 18px;\n height: 18px;\n}\n\n/* vertical align icon to text, don't remove this */\n.t-editor__callout .callout-content__icon:before {\n content: '\\200b';\n line-height: var(--callout-line-height);\n}\n\n/* Apply callout colors */\n.t-editor__callout.callout__neutral {\n --callout-primary: var(--callout-neutral-primary);\n --callout-secondary: var(--callout-neutral-secondary);\n --callout-font-color: var(--callout-neutral-font-color);\n --callout-svg: var(--callout-neutral-font-color);\n}\n\n.t-editor__callout.callout__info {\n --callout-primary: var(--callout-info-primary);\n --callout-secondary: var(--callout-info-secondary);\n --callout-font-color: var(--callout-info-font-color);\n --callout-svg: var(--callout-info-primary);\n}\n\n.t-editor__callout.callout__warning {\n --callout-primary: var(--callout-warning-primary);\n --callout-secondary: var(--callout-warning-secondary);\n --callout-font-color: var(--callout-warning-font-color);\n --callout-svg: var(--callout-warning-primary);\n}\n\n.t-editor__callout.callout__success {\n --callout-primary: var(--callout-success-primary);\n --callout-secondary: var(--callout-success-secondary);\n --callout-font-color: var(--callout-success-font-color);\n --callout-svg: var(--callout-success-primary);\n}\n\n.t-editor__callout.callout__danger {\n --callout-primary: var(--callout-danger-primary);\n --callout-secondary: var(--callout-danger-secondary);\n --callout-font-color: var(--callout-danger-font-color);\n --callout-svg: var(--callout-danger-primary);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAcA,MAAM,QAAQ,UAAA;EAKd,MAAM,eAAe;GACnB,MAAM;GACN,SAAS;GACT,SAAS;GACT,QAAQ;GACR,SAAS;GACV;;uBAIC,mBAoBM,OAAA,EApBA,OAAK,eAAA,sCAAwC,QAAA,OAAI,EAAA,EAAA,CACrD,mBAkBM,OAlBN,YAkBM,CAjBJ,mBAWM,OAXN,YAWM,CAVJ,mBAMM,OANN,YAMM,EAAA,WAAA,EAHJ,YAE4B,wBADrB,aAAa,QAAA,MAAI,EAAA,EACtB,OAAM,mBAAiB,CAAA,EAAA,CAAA,EAE3B,mBAEM,OAFN,YAEM,CADJ,YAAiB,MAAA,QAAA,CAAA,CAAA,CAAA,CAAA,EAIb,MAAM,WAAA,WAAA,EADd,mBAIM,OAJN,YAIM,CADJ,YAAiB,MAAA,QAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,CAAA,EAAA,EAAA"}
@@ -1,4 +0,0 @@
1
- import type { OperationObject, PathItemObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
- /** Combine pathItem and operation parameters into a single, dereferenced parameter array */
3
- export declare const combineParams: (pathParams?: PathItemObject["parameters"], operationParams?: OperationObject["parameters"]) => OperationObject["parameters"];
4
- //# sourceMappingURL=combine-params.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"combine-params.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/combine-params.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAEnH,4FAA4F;AAC5F,eAAO,MAAM,aAAa,GACxB,aAAY,cAAc,CAAC,YAAY,CAAM,EAC7C,kBAAiB,eAAe,CAAC,YAAY,CAAM,KAClD,eAAe,CAAC,YAAY,CAqB9B,CAAA"}
@@ -1,20 +0,0 @@
1
- import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
- //#region src/v2/features/operation/helpers/combine-params.ts
3
- /** Combine pathItem and operation parameters into a single, dereferenced parameter array */
4
- var combineParams = (pathParams = [], operationParams = []) => {
5
- const operationKeys = operationParams.flatMap((unresolvedParam) => {
6
- const param = getResolvedRef(unresolvedParam);
7
- if (!param) return [];
8
- return `${param.in}:${param.name}`;
9
- });
10
- const operationSet = new Set(operationKeys);
11
- return [...pathParams.filter((unresolvedParam) => {
12
- const param = getResolvedRef(unresolvedParam);
13
- if (!param) return false;
14
- return !operationSet.has(`${param.in}:${param.name}`);
15
- }), ...operationParams];
16
- };
17
- //#endregion
18
- export { combineParams };
19
-
20
- //# sourceMappingURL=combine-params.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"combine-params.js","names":[],"sources":["../../../../../src/v2/features/operation/helpers/combine-params.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { OperationObject, PathItemObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/** Combine pathItem and operation parameters into a single, dereferenced parameter array */\nexport const combineParams = (\n pathParams: PathItemObject['parameters'] = [],\n operationParams: OperationObject['parameters'] = [],\n): OperationObject['parameters'] => {\n const operationKeys = operationParams.flatMap((unresolvedParam) => {\n const param = getResolvedRef(unresolvedParam)\n if (!param) {\n return []\n }\n\n return `${param.in}:${param.name}`\n })\n const operationSet = new Set<string>(operationKeys)\n\n /** We must ensure we do not include any path params which exist in the operation */\n const filteredPathParams = pathParams.filter((unresolvedParam) => {\n const param = getResolvedRef(unresolvedParam)\n if (!param) {\n return false\n }\n return !operationSet.has(`${param.in}:${param.name}`)\n })\n\n return [...filteredPathParams, ...operationParams]\n}\n"],"mappings":";;;AAIA,IAAa,iBACX,aAA2C,EAAE,EAC7C,kBAAiD,EAAE,KACjB;CAClC,MAAM,gBAAgB,gBAAgB,SAAS,oBAAoB;EACjE,MAAM,QAAQ,eAAe,gBAAgB;AAC7C,MAAI,CAAC,MACH,QAAO,EAAE;AAGX,SAAO,GAAG,MAAM,GAAG,GAAG,MAAM;GAC5B;CACF,MAAM,eAAe,IAAI,IAAY,cAAc;AAWnD,QAAO,CAAC,GARmB,WAAW,QAAQ,oBAAoB;EAChE,MAAM,QAAQ,eAAe,gBAAgB;AAC7C,MAAI,CAAC,MACH,QAAO;AAET,SAAO,CAAC,aAAa,IAAI,GAAG,MAAM,GAAG,GAAG,MAAM,OAAO;GACrD,EAE6B,GAAG,gBAAgB"}
@@ -1,17 +0,0 @@
1
- import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
2
- import type { ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/parameter';
3
- /**
4
- * Retrieves a parameter from an operation's parameters by name and type ('in').
5
- * This is typically used to find a particular header, query, path, or cookie parameter.
6
- *
7
- * @param operation - The operation object containing the parameters array.
8
- * @param name - The name of the parameter to search for (case-insensitive).
9
- * @param type - The parameter location (e.g., 'header', 'query', 'path', 'cookie').
10
- * @returns The found parameter object, or null if not found.
11
- */
12
- export declare const getOperationHeader: ({ operation, name, type, }: {
13
- operation: OperationObject;
14
- name: string;
15
- type: ParameterObject["in"];
16
- }) => import("@scalar/workspace-store/schemas/v3.1/strict/reference").ReferenceType<ParameterObject> | null;
17
- //# sourceMappingURL=get-operation-header.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-operation-header.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-operation-header.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,4BAIhC;IACD,SAAS,EAAE,eAAe,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;CAC5B,0GAOA,CAAA"}
@@ -1,12 +0,0 @@
1
- import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
- import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
3
- /**
4
- * Compute what the security requirements should be for a request
5
- *
6
- * If an operation has only one optional security requirement,
7
- * use the document security and ensure it includes an optional object.
8
- *
9
- * Otherwise we generally go operation -> document security.
10
- */
11
- export declare const getSecurityRequirements: (documentSecurity: OpenApiDocument["security"], operationSecurity?: OperationObject["security"]) => Partial<Record<string, string[]>>[];
12
- //# sourceMappingURL=get-security-requirements.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-security-requirements.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,kBAAkB,eAAe,CAAC,UAAU,CAAC,EAC7C,oBAAoB,eAAe,CAAC,UAAU,CAAC,wCAShD,CAAA"}
@@ -1,17 +0,0 @@
1
- //#region src/v2/features/operation/helpers/get-security-requirements.ts
2
- /**
3
- * Compute what the security requirements should be for a request
4
- *
5
- * If an operation has only one optional security requirement,
6
- * use the document security and ensure it includes an optional object.
7
- *
8
- * Otherwise we generally go operation -> document security.
9
- */
10
- var getSecurityRequirements = (documentSecurity, operationSecurity) => {
11
- if (JSON.stringify(operationSecurity) === "[{}]" && documentSecurity?.length) return Boolean(documentSecurity.find((s) => JSON.stringify(s) === "{}")) ? documentSecurity : [...documentSecurity, {}];
12
- return operationSecurity ?? documentSecurity ?? [];
13
- };
14
- //#endregion
15
- export { getSecurityRequirements };
16
-
17
- //# sourceMappingURL=get-security-requirements.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-security-requirements.js","names":[],"sources":["../../../../../src/v2/features/operation/helpers/get-security-requirements.ts"],"sourcesContent":["import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation'\n\n/**\n * Compute what the security requirements should be for a request\n *\n * If an operation has only one optional security requirement,\n * use the document security and ensure it includes an optional object.\n *\n * Otherwise we generally go operation -> document security.\n */\nexport const getSecurityRequirements = (\n documentSecurity: OpenApiDocument['security'],\n operationSecurity?: OperationObject['security'],\n) => {\n // If the operation security is optional, use the document security and ensure it includes an optional object\n if (JSON.stringify(operationSecurity) === '[{}]' && documentSecurity?.length) {\n const documentHasOptional = Boolean(documentSecurity.find((s) => JSON.stringify(s) === '{}'))\n return documentHasOptional ? documentSecurity : [...documentSecurity, {}]\n }\n\n return operationSecurity ?? documentSecurity ?? []\n}\n"],"mappings":";;;;;;;;;AAWA,IAAa,2BACX,kBACA,sBACG;AAEH,KAAI,KAAK,UAAU,kBAAkB,KAAK,UAAU,kBAAkB,OAEpE,QAD4B,QAAQ,iBAAiB,MAAM,MAAM,KAAK,UAAU,EAAE,KAAK,KAAK,CAAC,GAChE,mBAAmB,CAAC,GAAG,kBAAkB,EAAE,CAAC;AAG3E,QAAO,qBAAqB,oBAAoB,EAAE"}
@@ -1,15 +0,0 @@
1
- import type { SelectedSecurity } from '@scalar/workspace-store/entities/auth';
2
- import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
- type DefaultScopeScheme = {
4
- type?: string;
5
- 'x-default-scopes'?: string[];
6
- };
7
- /**
8
- * Resolves which security selection to use for an operation.
9
- * Priority: operation-level selection, then document-level selection, then a default.
10
- * When neither level has a selection, returns the first security requirement unless
11
- * authentication is optional or there are no requirements, in which case returns no selection.
12
- */
13
- export declare const getSelectedSecurity: (documentSelectedSecurity: SelectedSecurity | undefined, operationSelectedSecurity: SelectedSecurity | undefined, securityRequirements?: NonNullable<OpenApiDocument["security"]>, securitySchemes?: Record<string, DefaultScopeScheme | undefined>) => SelectedSecurity;
14
- export {};
15
- //# sourceMappingURL=get-selected-security.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAE7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAInG,KAAK,kBAAkB,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AA4BD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,0BAA0B,gBAAgB,GAAG,SAAS,EACtD,2BAA2B,gBAAgB,GAAG,SAAS,EACvD,uBAAsB,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAM,EACnE,kBAAiB,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAM,KACnE,gBA4BF,CAAA"}
@@ -1,41 +0,0 @@
1
- import { isAuthOptional } from "../../../blocks/scalar-auth-selector-block/helpers/is-auth-optional.js";
2
- import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- //#region src/v2/features/operation/helpers/get-selected-security.ts
4
- var applyDefaultScopes = (requirement, securitySchemes) => {
5
- let didApplyDefaultScopes = false;
6
- const hydratedRequirement = Object.fromEntries(Object.entries(requirement).map(([name, scopes]) => {
7
- if (Array.isArray(scopes) && scopes.length > 0) return [name, scopes];
8
- const scheme = getResolvedRef(securitySchemes[name]);
9
- const defaultScopes = scheme?.type === "oauth2" ? scheme["x-default-scopes"] : void 0;
10
- if (Array.isArray(defaultScopes) && defaultScopes.length > 0) {
11
- didApplyDefaultScopes = true;
12
- return [name, [...defaultScopes]];
13
- }
14
- return [name, scopes];
15
- }));
16
- return didApplyDefaultScopes ? hydratedRequirement : requirement;
17
- };
18
- /**
19
- * Resolves which security selection to use for an operation.
20
- * Priority: operation-level selection, then document-level selection, then a default.
21
- * When neither level has a selection, returns the first security requirement unless
22
- * authentication is optional or there are no requirements, in which case returns no selection.
23
- */
24
- var getSelectedSecurity = (documentSelectedSecurity, operationSelectedSecurity, securityRequirements = [], securitySchemes = {}) => {
25
- if (operationSelectedSecurity) return operationSelectedSecurity;
26
- if (documentSelectedSecurity) return documentSelectedSecurity;
27
- const isOptional = isAuthOptional(securityRequirements);
28
- const firstRequirement = securityRequirements[0];
29
- if (isOptional || !firstRequirement) return {
30
- selectedIndex: -1,
31
- selectedSchemes: []
32
- };
33
- return {
34
- selectedIndex: 0,
35
- selectedSchemes: [applyDefaultScopes(firstRequirement, securitySchemes)]
36
- };
37
- };
38
- //#endregion
39
- export { getSelectedSecurity };
40
-
41
- //# sourceMappingURL=get-selected-security.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-selected-security.js","names":[],"sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"sourcesContent":["import type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { isAuthOptional } from '@/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional'\n\ntype DefaultScopeScheme = {\n type?: string\n 'x-default-scopes'?: string[]\n}\n\nconst applyDefaultScopes = (\n requirement: NonNullable<OpenApiDocument['security']>[number],\n securitySchemes: Record<string, DefaultScopeScheme | undefined>,\n): NonNullable<OpenApiDocument['security']>[number] => {\n let didApplyDefaultScopes = false\n\n const hydratedRequirement = Object.fromEntries(\n Object.entries(requirement).map(([name, scopes]) => {\n if (Array.isArray(scopes) && scopes.length > 0) {\n return [name, scopes]\n }\n\n const scheme = getResolvedRef(securitySchemes[name])\n const defaultScopes = scheme?.type === 'oauth2' ? scheme['x-default-scopes'] : undefined\n if (Array.isArray(defaultScopes) && defaultScopes.length > 0) {\n didApplyDefaultScopes = true\n return [name, [...defaultScopes]]\n }\n\n return [name, scopes]\n }),\n )\n\n return didApplyDefaultScopes ? hydratedRequirement : requirement\n}\n\n/**\n * Resolves which security selection to use for an operation.\n * Priority: operation-level selection, then document-level selection, then a default.\n * When neither level has a selection, returns the first security requirement unless\n * authentication is optional or there are no requirements, in which case returns no selection.\n */\nexport const getSelectedSecurity = (\n documentSelectedSecurity: SelectedSecurity | undefined,\n operationSelectedSecurity: SelectedSecurity | undefined,\n securityRequirements: NonNullable<OpenApiDocument['security']> = [],\n securitySchemes: Record<string, DefaultScopeScheme | undefined> = {},\n): SelectedSecurity => {\n // Operation level security\n if (operationSelectedSecurity) {\n return operationSelectedSecurity\n }\n // Document level security\n if (documentSelectedSecurity) {\n return documentSelectedSecurity\n }\n\n const isOptional = isAuthOptional(securityRequirements)\n const firstRequirement = securityRequirements[0]\n\n // No need to default if auth is optional\n if (isOptional || !firstRequirement) {\n return {\n selectedIndex: -1,\n selectedSchemes: [],\n }\n }\n\n // Default to the first requirement\n const hydratedRequirement = applyDefaultScopes(firstRequirement, securitySchemes)\n\n return {\n selectedIndex: 0,\n selectedSchemes: [hydratedRequirement],\n }\n}\n"],"mappings":";;;AAWA,IAAM,sBACJ,aACA,oBACqD;CACrD,IAAI,wBAAwB;CAE5B,MAAM,sBAAsB,OAAO,YACjC,OAAO,QAAQ,YAAY,CAAC,KAAK,CAAC,MAAM,YAAY;AAClD,MAAI,MAAM,QAAQ,OAAO,IAAI,OAAO,SAAS,EAC3C,QAAO,CAAC,MAAM,OAAO;EAGvB,MAAM,SAAS,eAAe,gBAAgB,MAAM;EACpD,MAAM,gBAAgB,QAAQ,SAAS,WAAW,OAAO,sBAAsB,KAAA;AAC/E,MAAI,MAAM,QAAQ,cAAc,IAAI,cAAc,SAAS,GAAG;AAC5D,2BAAwB;AACxB,UAAO,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC;;AAGnC,SAAO,CAAC,MAAM,OAAO;GACrB,CACH;AAED,QAAO,wBAAwB,sBAAsB;;;;;;;;AASvD,IAAa,uBACX,0BACA,2BACA,uBAAiE,EAAE,EACnE,kBAAkE,EAAE,KAC/C;AAErB,KAAI,0BACF,QAAO;AAGT,KAAI,yBACF,QAAO;CAGT,MAAM,aAAa,eAAe,qBAAqB;CACvD,MAAM,mBAAmB,qBAAqB;AAG9C,KAAI,cAAc,CAAC,iBACjB,QAAO;EACL,eAAe;EACf,iBAAiB,EAAE;EACpB;AAMH,QAAO;EACL,eAAe;EACf,iBAAiB,CAJS,mBAAmB,kBAAkB,gBAAgB,CAIzC;EACvC"}
@@ -1,13 +0,0 @@
1
- import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
- /**
3
- * Get the selected server from a list of servers and an optional selected-server URL.
4
- * Works for both document-level and operation-level servers: the caller passes the
5
- * appropriate selected URL (from document or operation).
6
- *
7
- * - If selectedServerUrl is undefined and servers has items, returns the first server
8
- * (user has not selected yet).
9
- * - If selectedServerUrl is '' (user un-selected), returns null.
10
- * - Otherwise returns the server whose url matches selectedServerUrl, or null.
11
- */
12
- export declare const getSelectedServer: (servers: ServerObject[] | null, selectedServerUrl: string | undefined) => ServerObject | null;
13
- //# sourceMappingURL=get-selected-server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-selected-server.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAEhG;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,YAAY,EAAE,GAAG,IAAI,EAC9B,mBAAmB,MAAM,GAAG,SAAS,KACpC,YAAY,GAAG,IAcjB,CAAA"}
@@ -1,21 +0,0 @@
1
- //#region src/v2/features/operation/helpers/get-selected-server.ts
2
- /**
3
- * Get the selected server from a list of servers and an optional selected-server URL.
4
- * Works for both document-level and operation-level servers: the caller passes the
5
- * appropriate selected URL (from document or operation).
6
- *
7
- * - If selectedServerUrl is undefined and servers has items, returns the first server
8
- * (user has not selected yet).
9
- * - If selectedServerUrl is '' (user un-selected), returns null.
10
- * - Otherwise returns the server whose url matches selectedServerUrl, or null.
11
- */
12
- var getSelectedServer = (servers, selectedServerUrl) => {
13
- if (!servers?.length) return null;
14
- if (selectedServerUrl === void 0) return servers[0];
15
- if (selectedServerUrl === "") return null;
16
- return servers.find(({ url }) => url === selectedServerUrl) ?? null;
17
- };
18
- //#endregion
19
- export { getSelectedServer };
20
-
21
- //# sourceMappingURL=get-selected-server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-selected-server.js","names":[],"sources":["../../../../../src/v2/features/operation/helpers/get-selected-server.ts"],"sourcesContent":["import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/**\n * Get the selected server from a list of servers and an optional selected-server URL.\n * Works for both document-level and operation-level servers: the caller passes the\n * appropriate selected URL (from document or operation).\n *\n * - If selectedServerUrl is undefined and servers has items, returns the first server\n * (user has not selected yet).\n * - If selectedServerUrl is '' (user un-selected), returns null.\n * - Otherwise returns the server whose url matches selectedServerUrl, or null.\n */\nexport const getSelectedServer = (\n servers: ServerObject[] | null,\n selectedServerUrl: string | undefined,\n): ServerObject | null => {\n if (!servers?.length) {\n return null\n }\n\n if (selectedServerUrl === undefined) {\n return servers[0]!\n }\n\n if (selectedServerUrl === '') {\n return null\n }\n\n return servers.find(({ url }) => url === selectedServerUrl) ?? null\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAa,qBACX,SACA,sBACwB;AACxB,KAAI,CAAC,SAAS,OACZ,QAAO;AAGT,KAAI,sBAAsB,KAAA,EACxB,QAAO,QAAQ;AAGjB,KAAI,sBAAsB,GACxB,QAAO;AAGT,QAAO,QAAQ,MAAM,EAAE,UAAU,QAAQ,kBAAkB,IAAI"}
@@ -1,5 +0,0 @@
1
- import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
- import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
3
- import { type XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
4
- export declare const getActiveEnvironment: (workspace: WorkspaceStore | null, document: WorkspaceDocument | null) => XScalarEnvironment;
5
- //# sourceMappingURL=get-active-environment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-active-environment.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-active-environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,2EAA2E,CAAA;AAGlF,eAAO,MAAM,oBAAoB,GAC/B,WAAW,cAAc,GAAG,IAAI,EAChC,UAAU,iBAAiB,GAAG,IAAI,KACjC,kBAsBF,CAAA"}