@scalar/api-client 3.18.0 → 3.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  3. package/dist/components/SectionFilter.vue.d.ts +2 -1
  4. package/dist/components/SectionFilter.vue.d.ts.map +1 -1
  5. package/dist/components/SectionFilter.vue.js +1 -1
  6. package/dist/components/SectionFilter.vue.js.map +1 -1
  7. package/dist/components/SectionFilter.vue.script.js.map +1 -1
  8. package/dist/hooks/use-file-dialog.d.ts.map +1 -1
  9. package/dist/hooks/use-file-dialog.js +1 -0
  10. package/dist/hooks/use-file-dialog.js.map +1 -1
  11. package/dist/style.css +136 -90
  12. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +2 -2
  13. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  15. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +15 -10
  16. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  17. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -1
  18. package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
  19. package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
  20. package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
  21. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +3 -1
  22. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  23. package/dist/v2/blocks/operation-block/helpers/send-request.js +9 -5
  24. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  25. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +1 -1
  26. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +1 -1
  27. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
  28. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +3 -1
  29. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  31. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  32. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +58 -3
  33. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  34. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +11 -3
  35. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  37. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  38. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +59 -23
  39. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  40. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts +5 -3
  41. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
  42. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js.map +1 -1
  43. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js +6 -3
  44. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js.map +1 -1
  45. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts +1 -1
  46. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -1
  47. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js.map +1 -1
  48. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +1 -0
  49. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -1
  50. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  51. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  52. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +4 -3
  53. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  54. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
  55. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  56. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  57. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  58. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +7 -3
  59. package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
  60. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +7 -1
  61. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  62. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  63. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +17 -5
  64. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  65. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -1
  66. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
  67. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.script.js.map +1 -1
  68. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts +1 -1
  69. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts.map +1 -1
  70. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +17 -8
  71. package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
  72. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.d.ts +1 -1
  73. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js.map +1 -1
  74. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +3 -1
  75. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
  76. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +34 -17
  77. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
  78. package/dist/v2/blocks/request-block/helpers/get-parameter-content.d.ts +1 -1
  79. package/dist/v2/blocks/request-block/helpers/get-parameter-content.js.map +1 -1
  80. package/dist/v2/blocks/request-block/helpers/get-parameter-schema.d.ts +1 -1
  81. package/dist/v2/blocks/request-block/helpers/get-parameter-schema.js.map +1 -1
  82. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.d.ts +1 -1
  83. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js +1 -1
  84. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js.map +1 -1
  85. package/dist/v2/blocks/request-block/helpers/group-by.d.ts +3 -4
  86. package/dist/v2/blocks/request-block/helpers/group-by.d.ts.map +1 -1
  87. package/dist/v2/blocks/request-block/helpers/group-by.js +12 -10
  88. package/dist/v2/blocks/request-block/helpers/group-by.js.map +1 -1
  89. package/dist/v2/blocks/request-block/helpers/validate-parameter.d.ts +1 -1
  90. package/dist/v2/blocks/request-block/helpers/validate-parameter.js.map +1 -1
  91. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  92. package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
  93. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +6 -1
  94. package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
  95. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.d.ts.map +1 -1
  96. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +1 -1
  97. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js.map +1 -1
  98. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js +42 -16
  99. package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js.map +1 -1
  100. package/dist/v2/blocks/response-block/helpers/media-types.d.ts.map +1 -1
  101. package/dist/v2/blocks/response-block/helpers/media-types.js +5 -0
  102. package/dist/v2/blocks/response-block/helpers/media-types.js.map +1 -1
  103. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -2
  104. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  105. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  106. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  107. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +2 -2
  108. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  109. package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js.map +1 -1
  110. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -1
  111. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  112. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  113. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +5 -5
  114. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  116. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +10 -7
  117. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  118. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.d.ts +16 -0
  119. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.d.ts.map +1 -0
  120. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.js +7 -0
  121. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.js.map +1 -0
  122. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.script.js +86 -0
  123. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2Metadata.vue.script.js.map +1 -0
  124. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
  126. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
  127. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +1 -1
  128. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
  129. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
  130. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -1
  131. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  132. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  133. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +5 -5
  134. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  135. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  136. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +39 -156
  137. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  138. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts +1 -1
  139. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js.map +1 -1
  140. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +1 -1
  141. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  142. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.d.ts +6 -0
  143. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.d.ts.map +1 -0
  144. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +25 -0
  145. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -0
  146. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +1 -2
  147. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
  148. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +2 -2
  149. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
  150. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
  151. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  152. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +13 -9
  153. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  154. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts +9 -0
  155. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.d.ts.map +1 -0
  156. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js +36 -0
  157. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth2-metadata-to-flows.js.map +1 -0
  158. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
  159. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.d.ts +1 -1
  160. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js.map +1 -1
  161. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +1 -1
  162. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  163. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
  164. package/dist/v2/components/code-input/CodeInput.vue.d.ts +2 -2
  165. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  166. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  167. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  168. package/dist/v2/components/code-input/CodeInput.vue.script.js +41 -10
  169. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  170. package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
  171. package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
  172. package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
  173. package/dist/v2/components/code-input/CodeInputLite.vue.script.js +7 -6
  174. package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
  175. package/dist/v2/components/code-input/helpers/build-pill-context.d.ts.map +1 -1
  176. package/dist/v2/components/code-input/helpers/build-pill-context.js.map +1 -1
  177. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +1 -1
  178. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  179. package/dist/v2/components/layout/CollapsibleSection.vue.js.map +1 -1
  180. package/dist/v2/components/layout/CollapsibleSection.vue.script.js.map +1 -1
  181. package/dist/v2/components/server/ServerDropdown.vue.d.ts +1 -1
  182. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  183. package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
  184. package/dist/v2/components/server/ServerDropdown.vue.script.js +1 -1
  185. package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
  186. package/dist/v2/components/server/ServerDropdownItem.vue.d.ts +1 -1
  187. package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
  188. package/dist/v2/components/server/ServerDropdownItem.vue.js.map +1 -1
  189. package/dist/v2/components/server/ServerDropdownItem.vue.script.js.map +1 -1
  190. package/dist/v2/constants.js +1 -1
  191. package/dist/v2/features/command-palette/components/CommandActionInput.vue.js.map +1 -1
  192. package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js +1 -1
  193. package/dist/v2/features/command-palette/components/CommandActionInput.vue.script.js.map +1 -1
  194. package/dist/v2/features/environments/components/EnvironmentColors.vue.js.map +1 -1
  195. package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js +1 -1
  196. package/dist/v2/features/environments/components/EnvironmentColors.vue.script.js.map +1 -1
  197. package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
  198. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  199. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  200. package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
  201. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +9 -3
  202. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -1
  203. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +1 -1
  204. package/dist/v2/features/modal/helpers/resolve-route-parameters.js.map +1 -1
  205. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +1 -1
  206. package/dist/v2/features/modal/modal-events.d.ts.map +1 -1
  207. package/dist/v2/features/modal/modal-events.js +10 -1
  208. package/dist/v2/features/modal/modal-events.js.map +1 -1
  209. package/dist/v2/features/operation/Operation.vue.d.ts +1 -1
  210. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  211. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  212. package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts +1 -1
  213. package/dist/v2/features/search/components/DocumentSearchModal.vue.js +1 -1
  214. package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -1
  215. package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -1
  216. package/dist/v2/features/search/helpers/create-search-index.d.ts +1 -1
  217. package/dist/v2/features/search/helpers/create-search-index.js.map +1 -1
  218. package/dist/v2/features/search/hooks/use-document-search.d.ts +1 -1
  219. package/dist/v2/features/search/hooks/use-document-search.js.map +1 -1
  220. package/dist/v2/features/search/hooks/use-search-index.d.ts +1 -1
  221. package/dist/v2/features/search/hooks/use-search-index.js.map +1 -1
  222. package/dist/vue-styles.css +97 -87
  223. package/package.json +16 -16
@@ -7,13 +7,14 @@ import { getVisibleOrderedFlowKeys } from "../helpers/oauth-flows.js";
7
7
  import { runOAuth2Authorize, storeOAuth2Tokens } from "../helpers/run-oauth2-authorize.js";
8
8
  import RequestAuthDataTableInput_default from "./RequestAuthDataTableInput.vue.js";
9
9
  import OAuth2_default from "./OAuth2.vue.js";
10
+ import OAuth2Metadata_default from "./OAuth2Metadata.vue.js";
10
11
  import OpenIDConnect_default from "./OpenIDConnect.vue.js";
11
12
  import { Fragment, capitalize, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, withCtx } from "vue";
12
13
  import { ScalarButton } from "@scalar/components/button";
13
14
  import { ScalarIconGear } from "@scalar/icons";
14
15
  import { ScalarModal, useModal } from "@scalar/components/modal";
15
16
  import { ScalarIconButton } from "@scalar/components/icon-button";
16
- import { getEnvironmentVariables, isEncryptionSchemeType, isSaslSchemeType } from "@scalar/workspace-store/request-example";
17
+ import { getEnvironmentVariables } from "@scalar/workspace-store/request-example";
17
18
  import { useToasts } from "@scalar/use-toasts";
18
19
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
19
20
  import { ScalarMarkdownSummary } from "@scalar/components/markdown";
@@ -28,14 +29,22 @@ var _hoisted_5 = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" };
28
29
  var _hoisted_6 = ["onClick"];
29
30
  var _hoisted_7 = { class: "relative z-10" };
30
31
  var _hoisted_8 = {
31
- key: 9,
32
+ key: 5,
32
33
  class: "text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance"
33
34
  };
34
35
  var _hoisted_9 = {
35
- key: 10,
36
+ key: 6,
36
37
  class: "text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance"
37
38
  };
38
- var _hoisted_10 = { class: "flex h-8 items-center justify-end gap-2 border-t" };
39
+ var _hoisted_10 = {
40
+ key: 7,
41
+ class: "text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance"
42
+ };
43
+ var _hoisted_11 = {
44
+ key: 8,
45
+ class: "text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance"
46
+ };
47
+ var _hoisted_12 = { class: "flex h-8 items-center justify-end gap-2 border-t" };
39
48
  var RequestAuthTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
40
49
  __name: "RequestAuthTab",
41
50
  props: {
@@ -120,17 +129,6 @@ var RequestAuthTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
120
129
  */
121
130
  const apiKeyHasName = (scheme) => scheme.in !== "user" && scheme.in !== "password";
122
131
  /**
123
- * SASL-style AsyncAPI broker schemes (`userPassword`, `plain`, `scramSha256`, `scramSha512`):
124
- * they all authenticate with a username + password pair, so they share one form.
125
- */
126
- const isSaslScheme = (scheme) => isSaslSchemeType(scheme?.type);
127
- /** AsyncAPI encryption broker schemes: a single key value. */
128
- const isEncryptionScheme = (scheme) => isEncryptionSchemeType(scheme?.type);
129
- /** AsyncAPI X509 broker scheme: a client certificate + private key pair (PEM). */
130
- const isX509Scheme = (scheme) => scheme?.type === "X509";
131
- /** AsyncAPI GSSAPI (Kerberos) broker scheme: the service name the client authenticates against. */
132
- const isGssapiScheme = (scheme) => scheme?.type === "gssapi";
133
- /**
134
132
  * The scheme's type when it is one we do not render inputs for (a type outside both the OpenAPI
135
133
  * and AsyncAPI security scheme unions). Read through a helper so the fallback template branch,
136
134
  * where the scheme type is narrowed to `never` after the supported cases, can still surface the type.
@@ -157,15 +155,6 @@ var RequestAuthTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
157
155
  },
158
156
  name
159
157
  });
160
- /**
161
- * AsyncAPI broker credentials (SASL, X509, encryption, GSSAPI) all persist through the same
162
- * event; only the secret key and scheme type differ, so they share one handler. The caller passes
163
- * a payload that already carries the narrowed scheme `type`.
164
- */
165
- const handleBrokerSecretsUpdate = (payload, name) => __props.eventBus.emit("auth:update:security-scheme-secrets", {
166
- payload,
167
- name
168
- });
169
158
  const handleApiKeySecuritySchemeUpdate = (payload, name) => __props.eventBus.emit("auth:update:security-scheme", {
170
159
  payload: {
171
160
  type: "apiKey",
@@ -389,7 +378,7 @@ var RequestAuthTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
389
378
  default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
390
379
  containerClass: getStaticBorderClass(),
391
380
  environment: __props.environment,
392
- modelValue: scheme.name,
381
+ modelValue: scheme.name ?? "",
393
382
  placeholder: "api-key",
394
383
  "onUpdate:modelValue": (v) => handleApiKeySecuritySchemeUpdate({ name: v }, name)
395
384
  }, {
@@ -421,11 +410,27 @@ var RequestAuthTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
421
410
  ])]),
422
411
  _: 2
423
412
  }, 1024)], 64)) : scheme?.type === "oauth2" || scheme?.type === "openIdConnect" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
424
- scheme?.type === "openIdConnect" && !visibleFlowKeys.length ? (openBlock(), createBlock(OpenIDConnect_default, {
413
+ scheme.type === "oauth2" && (!__props.isStatic || scheme.oauth2MetadataUrl) ? (openBlock(), createBlock(OAuth2Metadata_default, {
425
414
  key: 0,
426
415
  customFetch: __props.options?.customFetch,
427
416
  environment: __props.environment,
428
417
  eventBus: __props.eventBus,
418
+ name,
419
+ proxyUrl: __props.proxyUrl,
420
+ scheme
421
+ }, null, 8, [
422
+ "customFetch",
423
+ "environment",
424
+ "eventBus",
425
+ "name",
426
+ "proxyUrl",
427
+ "scheme"
428
+ ])) : createCommentVNode("", true),
429
+ scheme?.type === "openIdConnect" && !visibleFlowKeys.length ? (openBlock(), createBlock(OpenIDConnect_default, {
430
+ key: 1,
431
+ customFetch: __props.options?.customFetch,
432
+ environment: __props.environment,
433
+ eventBus: __props.eventBus,
429
434
  getStaticBorderClass,
430
435
  name,
431
436
  proxyUrl: __props.proxyUrl,
@@ -438,7 +443,7 @@ var RequestAuthTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
438
443
  "proxyUrl",
439
444
  "scheme"
440
445
  ])) : createCommentVNode("", true),
441
- visibleFlowKeys.length > 1 ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 1 }, {
446
+ visibleFlowKeys.length > 1 ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 2 }, {
442
447
  default: withCtx(() => [createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleFlowKeys, (key, ind) => {
443
448
  return openBlock(), createElementBlock("button", {
444
449
  key,
@@ -481,133 +486,11 @@ var RequestAuthTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
481
486
  "onUpsert:scope"
482
487
  ])) : createCommentVNode("", true)], 64);
483
488
  }), 128))
484
- ], 64)) : isSaslScheme(scheme) ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [createVNode(unref(DataTableRow_default), null, {
485
- default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
486
- class: "text-c-2",
487
- containerClass: getStaticBorderClass(),
488
- environment: __props.environment,
489
- modelValue: scheme["x-scalar-secret-username"],
490
- placeholder: "janedoe",
491
- required: "",
492
- "onUpdate:modelValue": (v) => handleBrokerSecretsUpdate({
493
- "type": scheme.type,
494
- "x-scalar-secret-username": v
495
- }, name)
496
- }, {
497
- default: withCtx(() => [..._cache[11] || (_cache[11] = [createTextVNode(" Username ", -1)])]),
498
- _: 1
499
- }, 8, [
500
- "containerClass",
501
- "environment",
502
- "modelValue",
503
- "onUpdate:modelValue"
504
- ])]),
505
- _: 2
506
- }, 1024), createVNode(unref(DataTableRow_default), null, {
507
- default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
508
- environment: __props.environment,
509
- modelValue: scheme["x-scalar-secret-password"],
510
- placeholder: "********",
511
- type: "password",
512
- "onUpdate:modelValue": (v) => handleBrokerSecretsUpdate({
513
- "type": scheme.type,
514
- "x-scalar-secret-password": v
515
- }, name)
516
- }, {
517
- default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode(" Password ", -1)])]),
518
- _: 1
519
- }, 8, [
520
- "environment",
521
- "modelValue",
522
- "onUpdate:modelValue"
523
- ])]),
524
- _: 2
525
- }, 1024)], 64)) : isX509Scheme(scheme) ? (openBlock(), createElementBlock(Fragment, { key: 6 }, [createVNode(unref(DataTableRow_default), null, {
526
- default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
527
- containerClass: getStaticBorderClass(),
528
- environment: __props.environment,
529
- modelValue: scheme["x-scalar-secret-client-certificate"],
530
- placeholder: "-----BEGIN CERTIFICATE-----",
531
- type: "password",
532
- "onUpdate:modelValue": (v) => handleBrokerSecretsUpdate({
533
- "type": scheme.type,
534
- "x-scalar-secret-client-certificate": v
535
- }, name)
536
- }, {
537
- default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode(" Client Certificate ", -1)])]),
538
- _: 1
539
- }, 8, [
540
- "containerClass",
541
- "environment",
542
- "modelValue",
543
- "onUpdate:modelValue"
544
- ])]),
545
- _: 2
546
- }, 1024), createVNode(unref(DataTableRow_default), null, {
547
- default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
548
- environment: __props.environment,
549
- modelValue: scheme["x-scalar-secret-private-key"],
550
- placeholder: "-----BEGIN PRIVATE KEY-----",
551
- type: "password",
552
- "onUpdate:modelValue": (v) => handleBrokerSecretsUpdate({
553
- "type": scheme.type,
554
- "x-scalar-secret-private-key": v
555
- }, name)
556
- }, {
557
- default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" Private Key ", -1)])]),
558
- _: 1
559
- }, 8, [
560
- "environment",
561
- "modelValue",
562
- "onUpdate:modelValue"
563
- ])]),
564
- _: 2
565
- }, 1024)], 64)) : isEncryptionScheme(scheme) ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 7 }, {
566
- default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
567
- containerClass: getStaticBorderClass(),
568
- environment: __props.environment,
569
- modelValue: scheme["x-scalar-secret-token"],
570
- placeholder: "********",
571
- type: "password",
572
- "onUpdate:modelValue": (v) => handleBrokerSecretsUpdate({
573
- "type": scheme.type,
574
- "x-scalar-secret-token": v
575
- }, name)
576
- }, {
577
- default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" Key ", -1)])]),
578
- _: 1
579
- }, 8, [
580
- "containerClass",
581
- "environment",
582
- "modelValue",
583
- "onUpdate:modelValue"
584
- ])]),
585
- _: 2
586
- }, 1024)) : isGssapiScheme(scheme) ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 8 }, {
587
- default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
588
- containerClass: getStaticBorderClass(),
589
- environment: __props.environment,
590
- modelValue: scheme["x-scalar-secret-service-name"],
591
- placeholder: "kafka",
592
- "onUpdate:modelValue": (v) => handleBrokerSecretsUpdate({
593
- "type": scheme.type,
594
- "x-scalar-secret-service-name": v
595
- }, name)
596
- }, {
597
- default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" Service Name ", -1)])]),
598
- _: 1
599
- }, 8, [
600
- "containerClass",
601
- "environment",
602
- "modelValue",
603
- "onUpdate:modelValue"
604
- ])]),
605
- _: 2
606
- }, 1024)) : getUnsupportedSchemeType(scheme) ? (openBlock(), createElementBlock("div", _hoisted_8, [
607
- _cache[17] || (_cache[17] = createTextVNode(" The ", -1)),
489
+ ], 64)) : scheme?.type === "userPassword" || scheme?.type === "plain" || scheme?.type === "scramSha256" || scheme?.type === "scramSha512" || scheme?.type === "X509" || scheme?.type === "symmetricEncryption" || scheme?.type === "asymmetricEncryption" || scheme?.type === "gssapi" ? (openBlock(), createElementBlock("div", _hoisted_8, " Credentials for this AsyncAPI security scheme are not sent by the browser client. ")) : scheme?.type === "mutualTLS" ? (openBlock(), createElementBlock("div", _hoisted_9, " Mutual TLS authenticates with a client certificate presented during the TLS handshake, so there is nothing to enter here. ")) : getUnsupportedSchemeType(scheme) ? (openBlock(), createElementBlock("div", _hoisted_10, [
490
+ _cache[11] || (_cache[11] = createTextVNode(" The ", -1)),
608
491
  createElementVNode("code", null, toDisplayString(getUnsupportedSchemeType(scheme)), 1),
609
- _cache[18] || (_cache[18] = createTextVNode(" security scheme type is not supported yet. ", -1))
610
- ])) : (openBlock(), createElementBlock("div", _hoisted_9, " The security scheme is missing a type, please double check your " + toDisplayString(documentTypeLabel.value) + " document or Authentication Configuration ", 1))
492
+ _cache[12] || (_cache[12] = createTextVNode(" security scheme type is not supported yet. ", -1))
493
+ ])) : (openBlock(), createElementBlock("div", _hoisted_11, " The security scheme is missing a type, please double check your " + toDisplayString(documentTypeLabel.value) + " document or Authentication Configuration ", 1))
611
494
  ], 64);
612
495
  }), 128)), oauth2Target.value && oauth2Scheme.value ? (openBlock(), createBlock(unref(ScalarModal), {
613
496
  key: 0,
@@ -647,13 +530,13 @@ var RequestAuthTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
647
530
  "type"
648
531
  ])]),
649
532
  _: 1
650
- }), createElementVNode("div", _hoisted_10, [createVNode(unref(ScalarButton), {
533
+ }), createElementVNode("div", _hoisted_12, [createVNode(unref(ScalarButton), {
651
534
  class: "p-0 px-2 py-0.5",
652
535
  size: "sm",
653
536
  variant: "outlined",
654
537
  onClick: _cache[3] || (_cache[3] = ($event) => unref(configModal).hide())
655
538
  }, {
656
- default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" Cancel ", -1)])]),
539
+ default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode(" Cancel ", -1)])]),
657
540
  _: 1
658
541
  }), createVNode(unref(ScalarButton), {
659
542
  class: "p-0 px-2 py-0.5",
@@ -661,7 +544,7 @@ var RequestAuthTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
661
544
  size: "sm",
662
545
  onClick: handleConfigAuthorize
663
546
  }, {
664
- default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode(" Authorize ", -1)])]),
547
+ default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" Authorize ", -1)])]),
665
548
  _: 1
666
549
  }, 8, ["loader"])])]),
667
550
  _: 1
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthTab.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useLoadingState } from '@scalar/components/loading'\nimport { ScalarMarkdownSummary } from '@scalar/components/markdown'\nimport { ScalarModal, useModal } from '@scalar/components/modal'\nimport { ScalarIconGear } from '@scalar/icons'\nimport { useToasts } from '@scalar/use-toasts'\nimport type {\n SecretsApiKey,\n SecretsHttp,\n} from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n getEnvironmentVariables,\n isEncryptionSchemeType,\n isSaslSchemeType,\n type EncryptionObjectSecret,\n type GssapiObjectSecret,\n type MergedSecuritySchemes,\n type OAuthFlowsObjectSecret,\n type SaslObjectSecret,\n type SecuritySchemeObjectSecret,\n type X509ObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { getDocumentTypeLabel } from '@scalar/workspace-store/schemas/type-guards'\nimport type {\n ApiKeyObject,\n SecurityRequirementObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { capitalize, computed, ref } from 'vue'\n\nimport { refreshOauth2Token } from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth'\nimport { getVisibleOrderedFlowKeys } from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows'\nimport {\n runOAuth2Authorize,\n storeOAuth2Tokens,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize'\nimport { getOauth2AcquisitionTarget } from '@/v2/blocks/scalar-auth-selector-block/helpers/security-scheme'\nimport {\n DataTable,\n DataTableCell,\n DataTableRow,\n} from '@/v2/components/data-table'\n\nimport OAuth2, { type OAuth2Options } from './OAuth2.vue'\nimport OpenIDConnect from './OpenIDConnect.vue'\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\ntype SecurityItem = {\n scheme: SecuritySchemeObjectSecret | undefined\n name: string\n scopes: string[]\n /** Ordered, non-hidden oauth2/openIdConnect flow keys for this scheme (empty for other types). */\n visibleFlowKeys: (keyof OAuthFlowsObjectSecret)[]\n}\n\nconst {\n environment,\n isStatic,\n proxyUrl,\n selectedSecuritySchemas,\n securitySchemes,\n server,\n eventBus,\n options,\n documentType = 'openapi',\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** Controls the display of certain borders which are used when we are non-collapsible */\n isStatic: boolean\n /** Proxy URL */\n proxyUrl: string\n /** Selected security schemes*/\n selectedSecuritySchemas: SecurityRequirementObject\n /** Merged security schemes from the document and the config together with the auth store secrets */\n securitySchemes: MergedSecuritySchemes\n /** Current server configuration */\n server: ServerObject | null\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n /** Type of the document the schemes belong to, used to label the missing-type warning */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\n/**\n * Human-readable name of the document type.\n * Used in the missing-type warning so it points at the correct document\n * (e.g. \"AsyncAPI\") instead of always naming OpenAPI.\n */\nconst documentTypeLabel = computed<string>(() =>\n getDocumentTypeLabel(documentType),\n)\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: Omit<ApiReferenceEvents['auth:update:selected-scopes'], 'meta'>,\n ): void\n (e: 'upsert:scope', payload: ApiReferenceEvents['auth:upsert:scopes']): void\n (e: 'delete:scope', payload: ApiReferenceEvents['auth:delete:scopes']): void\n}>()\n\n/**\n * Resolves security schemes from the OpenAPI document and combines them with their selected scopes.\n * Each item includes the scheme definition, name, and associated scopes.\n */\nconst security = computed<SecurityItem[]>(() =>\n Object.entries(selectedSecuritySchemas).map(([name, scopes = []]) => {\n const scheme = getResolvedRef(securitySchemes[name])\n return {\n scheme,\n name,\n scopes,\n // Compute the visible, ordered flow keys once per scheme so the tabs, the label, and the\n // active-flow tracking all agree on the same set (and we do not filter + sort on every access).\n visibleFlowKeys:\n scheme?.type === 'oauth2' || scheme?.type === 'openIdConnect'\n ? getVisibleOrderedFlowKeys(scheme.flows)\n : [],\n }\n }),\n)\n\n/** Tracks which OAuth2 flow is currently active when multiple flows are available. */\nconst activeFlow = ref<string>('')\n\n/**\n * Keeps the selected flow in sync with the currently visible flow keys. Validating against the\n * visible set (not every declared flow) means a selection that becomes hidden — e.g. the document\n * is updated to mark the active flow with `x-scalar-ignore` — resets, so the default (first visible)\n * flow activates instead of leaving no tab selected.\n */\nconst selectedFlow = computed<string>(() => {\n const visibleFlowKeys = security.value.flatMap((item) => item.visibleFlowKeys)\n\n return visibleFlowKeys.some((key) => key === activeFlow.value)\n ? activeFlow.value\n : ''\n})\n\nconst setActiveFlow = (flow: string): void => {\n activeFlow.value = flow\n}\n\n/** Determines if multiple auth schemes are configured, which affects the UI layout. */\nconst hasMultipleSchemes = computed<boolean>(() => security.value.length > 1)\n\n/**\n * Generates a human-readable label for the security scheme.\n * Intentionally omits the description here — it is rendered separately as\n * rich text via ScalarMarkdownSummary so markdown formatting is preserved.\n */\nconst generateLabel = (\n name: string,\n scheme: SecuritySchemeObjectSecret,\n): string => {\n const capitalizedName = capitalize(name)\n\n switch (scheme.type) {\n case 'apiKey':\n return `${capitalizedName}: ${scheme.in}`\n\n case 'openIdConnect':\n case 'oauth2': {\n const firstFlow = getVisibleOrderedFlowKeys(scheme.flows)[0]\n const currentFlow = selectedFlow.value || firstFlow\n if (!currentFlow) {\n return capitalizedName\n }\n return `${capitalizedName}: ${currentFlow}`\n }\n\n case 'http':\n return `${capitalizedName}: ${scheme.scheme}`\n\n default:\n return capitalizedName\n }\n}\n\n/**\n * Whether an API key scheme exposes an editable parameter name.\n *\n * OpenAPI `apiKey` and AsyncAPI `httpApiKey` (normalized to `apiKey`) name a query/header/cookie\n * parameter, so the Name input is shown. AsyncAPI `apiKey` places the key in the broker `user` or\n * `password` slot and has no parameter name, so the Name input is hidden and only the value is asked for.\n */\nconst apiKeyHasName = (scheme: { in?: string }): boolean =>\n scheme.in !== 'user' && scheme.in !== 'password'\n\n/**\n * SASL-style AsyncAPI broker schemes (`userPassword`, `plain`, `scramSha256`, `scramSha512`):\n * they all authenticate with a username + password pair, so they share one form.\n */\nconst isSaslScheme = (\n scheme: SecurityItem['scheme'],\n): scheme is SaslObjectSecret => isSaslSchemeType(scheme?.type)\n\n/** AsyncAPI encryption broker schemes: a single key value. */\nconst isEncryptionScheme = (\n scheme: SecurityItem['scheme'],\n): scheme is EncryptionObjectSecret => isEncryptionSchemeType(scheme?.type)\n\n/** AsyncAPI X509 broker scheme: a client certificate + private key pair (PEM). */\nconst isX509Scheme = (\n scheme: SecurityItem['scheme'],\n): scheme is X509ObjectSecret => scheme?.type === 'X509'\n\n/** AsyncAPI GSSAPI (Kerberos) broker scheme: the service name the client authenticates against. */\nconst isGssapiScheme = (\n scheme: SecurityItem['scheme'],\n): scheme is GssapiObjectSecret => scheme?.type === 'gssapi'\n\n/**\n * The scheme's type when it is one we do not render inputs for (a type outside both the OpenAPI\n * and AsyncAPI security scheme unions). Read through a helper so the fallback template branch,\n * where the scheme type is narrowed to `never` after the supported cases, can still surface the type.\n */\nconst getUnsupportedSchemeType = (\n scheme: SecurityItem['scheme'],\n): string | undefined => scheme?.type\n\n/**\n * Determines if an OAuth2 flow tab should be active.\n * The first flow is active by default if no flow is explicitly selected.\n */\nconst isFlowActive = (flowKey: string, index: number): boolean =>\n selectedFlow.value === flowKey || (index === 0 && !selectedFlow.value)\n\n/** Computes the container class for static display mode. */\nconst getStaticBorderClass = (): string | false => isStatic && 'border-t'\n\nconst handleHttpSecretsUpdate = (\n payload: Omit<Partial<SecretsHttp>, 'type'>,\n name: string,\n): void =>\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: { type: 'http', ...payload },\n name,\n })\n\nconst handleApiKeySecretsUpdate = (\n payload: Omit<Partial<SecretsApiKey>, 'type'>,\n name: string,\n): void =>\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: { type: 'apiKey', ...payload },\n name,\n })\n\n/**\n * AsyncAPI broker credentials (SASL, X509, encryption, GSSAPI) all persist through the same\n * event; only the secret key and scheme type differ, so they share one handler. The caller passes\n * a payload that already carries the narrowed scheme `type`.\n */\nconst handleBrokerSecretsUpdate = (\n payload: ApiReferenceEvents['auth:update:security-scheme-secrets']['payload'],\n name: string,\n): void =>\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload,\n name,\n })\n\nconst handleApiKeySecuritySchemeUpdate = (\n payload: Omit<Partial<ApiKeyObject>, 'type'>,\n name: string,\n): void =>\n eventBus.emit('auth:update:security-scheme', {\n payload: { type: 'apiKey', ...payload },\n name,\n })\n\n/** Handles scope selection updates for OAuth2 */\nconst handleScopesUpdate = (\n name: string,\n event: { scopes?: string[]; scope?: string; selected?: boolean },\n): void => {\n emits('update:selectedScopes', {\n id: Object.keys(selectedSecuritySchemas),\n name,\n ...event,\n })\n}\n\n/** Handles scope-definition upserts (add / rename / description change) */\nconst handleScopeUpsert = (\n name: string,\n event: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n): void => {\n emits('upsert:scope', { ...event, name })\n}\n\n/** Handles scope-definition deletes */\nconst handleScopeDelete = (\n name: string,\n event: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n): void => {\n emits('delete:scope', { ...event, name })\n}\n\n/**\n * Computes dynamic classes for OAuth2 flow tabs based on active state.\n */\nconst getFlowTabClasses = (flowKey: string, index: number): string => {\n const baseClasses =\n 'floating-bg text-c-3 relative cursor-pointer border-b border-transparent py-1 text-base font-medium'\n const activeClasses = '!text-c-1 !rounded-none border-b !border-current'\n\n return isFlowActive(flowKey, index)\n ? `${baseClasses} ${activeClasses} ${isStatic ? 'opacity-100' : ''}`\n : baseClasses\n}\n\n/**\n * OAuth2 token-acquisition target (an oauth2 scheme with an interactive grant) sourced from\n * the merged schemes. When the active scheme is HTTP bearer, this powers the inline\n * \"Authorize via OAuth2\" shortcut: the flow's bearer token is written onto the bearer scheme,\n * so the panel never switches to oauth2.\n *\n * The shortcut is purely a convenience, so it is offered for any interactive oauth2 scheme —\n * including one that is also independently selectable in the dropdown (e.g. Scalar Galaxy's\n * `oAuth2`). Whether that oauth2 scheme is *hidden* from the dropdown is a separate decision made\n * in the selector; here we only surface the shortcut.\n */\nconst oauth2Target = computed(() => getOauth2AcquisitionTarget(securitySchemes))\n\n/** Resolved oauth2 scheme object, for embedding its config form behind the gear. */\nconst oauth2Scheme = computed(() =>\n oauth2Target.value\n ? getResolvedRef(securitySchemes[oauth2Target.value.name])\n : undefined,\n)\n\nconst acquisitionLoader = useLoadingState()\nconst { toast } = useToasts()\nconst configModal = useModal()\n/** Bearer scheme that opened the config modal, so its Authorize callback targets it. */\nconst configBearerName = ref<string | undefined>()\n\n/** Runs the OAuth2 flow and writes the resulting bearer token onto the bearer scheme. */\nconst handleAcquisitionAuthorize = async (\n bearerName: string,\n): Promise<void> => {\n const target = oauth2Target.value\n if (!target || acquisitionLoader.isLoading) {\n return\n }\n acquisitionLoader.start()\n const [error] = await runOAuth2Authorize({\n eventBus,\n bearerSchemeName: bearerName,\n oauth2Name: target.name,\n flows: target.flows,\n flowType: target.flowType,\n scopes: target.scopes,\n server,\n proxyUrl,\n environment,\n options,\n })\n await acquisitionLoader.clear()\n if (error) {\n toast(error?.message ?? 'Failed to authorize', 'error')\n }\n}\n\n/** Refreshes the OAuth2 token and rewrites it onto the bearer scheme. */\nconst handleAcquisitionRefresh = async (bearerName: string): Promise<void> => {\n const target = oauth2Target.value\n // Only the authorization-code flow carries a refresh token; implicit can't be refreshed.\n if (\n !target ||\n target.flowType !== 'authorizationCode' ||\n acquisitionLoader.isLoading\n ) {\n return\n }\n acquisitionLoader.start()\n const [error, tokens] = await refreshOauth2Token(\n target.flows,\n target.flowType,\n proxyUrl,\n server,\n getEnvironmentVariables(environment),\n options?.customFetch,\n )\n await acquisitionLoader.clear()\n if (tokens?.accessToken) {\n storeOAuth2Tokens(eventBus, {\n bearerSchemeName: bearerName,\n oauth2Name: target.name,\n flowType: target.flowType,\n tokens,\n })\n } else if (error) {\n toast(error?.message ?? 'Failed to refresh', 'error')\n }\n}\n\nconst openAcquisitionConfig = (bearerName: string): void => {\n configBearerName.value = bearerName\n configModal.show()\n}\n\n/** Closes the config modal and runs Authorize against the bearer scheme that opened it. */\nconst handleConfigAuthorize = (): void => {\n const bearerName = configBearerName.value\n configModal.hide()\n if (bearerName) {\n void handleAcquisitionAuthorize(bearerName)\n }\n}\n</script>\n<template>\n <template\n v-for=\"{ scheme, name, scopes, visibleFlowKeys } in security\"\n :key=\"name\">\n <!--\n Header row for AND'ed schemes: label (bold) and description (rich text) are\n combined.\n -->\n <DataTableRow v-if=\"hasMultipleSchemes && scheme\">\n <DataTableCell\n :aria-label=\"generateLabel(name, scheme)\"\n class=\"max-h-[auto]\">\n <div class=\"bg-b-1 min-w-0 flex-1 px-3 py-1.25\">\n <p class=\"text-c-1 leading-5.5 font-medium\">\n {{ generateLabel(name, scheme) }}\n </p>\n <ScalarMarkdownSummary\n v-if=\"scheme.description\"\n class=\"auth-description text-c-2 w-full\"\n :value=\"scheme.description\" />\n </div>\n </DataTableCell>\n </DataTableRow>\n\n <!-- Description: shown for single auth schemes with descriptions -->\n <DataTableRow v-if=\"scheme?.description && !hasMultipleSchemes\">\n <DataTableCell\n :aria-label=\"scheme.description\"\n class=\"max-h-[auto]\">\n <ScalarMarkdownSummary\n class=\"auth-description bg-b-1 text-c-2 min-w-0 flex-1 px-3 py-1.25\"\n :value=\"scheme.description\" />\n </DataTableCell>\n </DataTableRow>\n\n <!-- HTTP Authentication -->\n <template v-if=\"scheme?.type === 'http'\">\n <!-- Bearer Token -->\n <DataTableRow v-if=\"scheme.scheme === 'bearer'\">\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme['x-scalar-secret-token']\"\n placeholder=\"Token\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleHttpSecretsUpdate({ 'x-scalar-secret-token': v }, name)\n \">\n Bearer Token\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- OAuth2 token-acquisition shortcut (shown when an interactive oauth2 flow exists) -->\n <DataTableRow v-if=\"scheme.scheme === 'bearer' && oauth2Target\">\n <div class=\"flex h-8 items-center gap-2 border-t px-3\">\n <span class=\"text-c-3 mr-auto text-xs\">Get a token</span>\n <ScalarButton\n class=\"p-0 px-2 py-0.5\"\n :loader=\"acquisitionLoader\"\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"handleAcquisitionAuthorize(name)\">\n Authorize via {{ oauth2Target.name }}\n </ScalarButton>\n <ScalarButton\n v-if=\"\n scheme['x-scalar-secret-token'] &&\n oauth2Target.flowType === 'authorizationCode'\n \"\n class=\"p-0 px-2 py-0.5\"\n :disabled=\"acquisitionLoader.isLoading\"\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"handleAcquisitionRefresh(name)\">\n Refresh\n </ScalarButton>\n <ScalarIconButton\n :icon=\"ScalarIconGear\"\n :label=\"`Configure ${oauth2Target.name}`\"\n size=\"xs\"\n @click=\"openAcquisitionConfig(name)\" />\n </div>\n </DataTableRow>\n\n <!-- HTTP Basic Authentication -->\n <template v-else-if=\"scheme?.scheme === 'basic'\">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"text-c-2\"\n :environment\n :modelValue=\"scheme['x-scalar-secret-username']\"\n placeholder=\"janedoe\"\n required\n @update:modelValue=\"\n (v) =>\n handleHttpSecretsUpdate({ 'x-scalar-secret-username': v }, name)\n \">\n Username\n </RequestAuthDataTableInput>\n </DataTableRow>\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"scheme['x-scalar-secret-password']\"\n placeholder=\"********\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleHttpSecretsUpdate({ 'x-scalar-secret-password': v }, name)\n \">\n Password\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n </template>\n\n <!-- API Key Authentication -->\n <template v-else-if=\"scheme?.type === 'apiKey'\">\n <DataTableRow v-if=\"apiKeyHasName(scheme)\">\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme.name\"\n placeholder=\"api-key\"\n @update:modelValue=\"\n (v) => handleApiKeySecuritySchemeUpdate({ name: v }, name)\n \">\n Name\n </RequestAuthDataTableInput>\n </DataTableRow>\n <DataTableRow>\n <RequestAuthDataTableInput\n :containerClass=\"\n apiKeyHasName(scheme) ? undefined : getStaticBorderClass()\n \"\n :environment\n :modelValue=\"scheme['x-scalar-secret-token']\"\n placeholder=\"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleApiKeySecretsUpdate({ 'x-scalar-secret-token': v }, name)\n \">\n Value\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <!-- OAuth 2.0 / OpenID Connect Authentication -->\n <template\n v-else-if=\"scheme?.type === 'oauth2' || scheme?.type === 'openIdConnect'\">\n <!-- OpenID Connect -->\n <OpenIDConnect\n v-if=\"scheme?.type === 'openIdConnect' && !visibleFlowKeys.length\"\n :customFetch=\"options?.customFetch\"\n :environment\n :eventBus\n :getStaticBorderClass\n :name\n :proxyUrl\n :scheme />\n\n <!-- Flow selector tabs: shown when multiple visible flows are available -->\n <DataTableRow v-if=\"visibleFlowKeys.length > 1\">\n <div class=\"flex min-h-8 border-t text-base\">\n <div class=\"flex h-8 max-w-full gap-2.5 overflow-x-auto px-3\">\n <button\n v-for=\"(key, ind) in visibleFlowKeys\"\n :key=\"key\"\n :class=\"getFlowTabClasses(key, ind)\"\n type=\"button\"\n @click=\"setActiveFlow(key)\">\n <span class=\"relative z-10\">{{ key }}</span>\n </button>\n </div>\n </div>\n </DataTableRow>\n\n <!-- OAuth2 flow configuration -->\n <template\n v-for=\"(key, ind) in visibleFlowKeys\"\n :key=\"key\">\n <OAuth2\n v-if=\"scheme.flows && isFlowActive(key, ind)\"\n :environment\n :eventBus\n :flows=\"scheme.flows\"\n :name\n :options\n :proxyUrl\n :scheme\n :selectedScopes=\"scopes\"\n :server\n :type=\"key\"\n @delete:scope=\"(event) => handleScopeDelete(name, event)\"\n @update:selectedScopes=\"(event) => handleScopesUpdate(name, event)\"\n @upsert:scope=\"(event) => handleScopeUpsert(name, event)\" />\n </template>\n </template>\n\n <!-- SASL broker authentication (userPassword, plain, scramSha256, scramSha512) -->\n <template v-else-if=\"isSaslScheme(scheme)\">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"text-c-2\"\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme['x-scalar-secret-username']\"\n placeholder=\"janedoe\"\n required\n @update:modelValue=\"\n (v) =>\n handleBrokerSecretsUpdate(\n { 'type': scheme.type, 'x-scalar-secret-username': v },\n name,\n )\n \">\n Username\n </RequestAuthDataTableInput>\n </DataTableRow>\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"scheme['x-scalar-secret-password']\"\n placeholder=\"********\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleBrokerSecretsUpdate(\n { 'type': scheme.type, 'x-scalar-secret-password': v },\n name,\n )\n \">\n Password\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <!-- X509 client certificate authentication -->\n <template v-else-if=\"isX509Scheme(scheme)\">\n <DataTableRow>\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme['x-scalar-secret-client-certificate']\"\n placeholder=\"-----BEGIN CERTIFICATE-----\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleBrokerSecretsUpdate(\n {\n 'type': scheme.type,\n 'x-scalar-secret-client-certificate': v,\n },\n name,\n )\n \">\n Client Certificate\n </RequestAuthDataTableInput>\n </DataTableRow>\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"scheme['x-scalar-secret-private-key']\"\n placeholder=\"-----BEGIN PRIVATE KEY-----\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleBrokerSecretsUpdate(\n { 'type': scheme.type, 'x-scalar-secret-private-key': v },\n name,\n )\n \">\n Private Key\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <!-- Symmetric / asymmetric encryption key -->\n <template v-else-if=\"isEncryptionScheme(scheme)\">\n <DataTableRow>\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme['x-scalar-secret-token']\"\n placeholder=\"********\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleBrokerSecretsUpdate(\n { 'type': scheme.type, 'x-scalar-secret-token': v },\n name,\n )\n \">\n Key\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <!-- GSSAPI (Kerberos) authentication -->\n <template v-else-if=\"isGssapiScheme(scheme)\">\n <DataTableRow>\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme['x-scalar-secret-service-name']\"\n placeholder=\"kafka\"\n @update:modelValue=\"\n (v) =>\n handleBrokerSecretsUpdate(\n { 'type': scheme.type, 'x-scalar-secret-service-name': v },\n name,\n )\n \">\n Service Name\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <!-- Scheme has a type we do not render inputs for -->\n <div\n v-else-if=\"getUnsupportedSchemeType(scheme)\"\n class=\"text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance\">\n The <code>{{ getUnsupportedSchemeType(scheme) }}</code> security scheme\n type is not supported yet.\n </div>\n\n <!-- Scheme is missing type -->\n <div\n v-else\n class=\"text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance\">\n The security scheme is missing a type, please double check your\n {{ documentTypeLabel }} document or Authentication Configuration\n </div>\n </template>\n\n <!-- OAuth2 configuration modal (opened from the bearer scheme's gear) -->\n <ScalarModal\n v-if=\"oauth2Target && oauth2Scheme\"\n :state=\"configModal\"\n size=\"sm\"\n :title=\"`Configure ${oauth2Target.name}`\">\n <DataTable\n :columns=\"['']\"\n presentational>\n <OAuth2\n hideActions\n :environment\n :eventBus\n :flows=\"oauth2Target.flows\"\n :name=\"oauth2Target.name\"\n :options\n :proxyUrl\n :scheme=\"oauth2Scheme\"\n :selectedScopes=\"oauth2Target.scopes\"\n :server\n :type=\"oauth2Target.flowType\"\n @delete:scope=\"(event) => handleScopeDelete(oauth2Target!.name, event)\"\n @update:selectedScopes=\"\n (event) => handleScopesUpdate(oauth2Target!.name, event)\n \"\n @upsert:scope=\"\n (event) => handleScopeUpsert(oauth2Target!.name, event)\n \" />\n </DataTable>\n <div class=\"flex h-8 items-center justify-end gap-2 border-t\">\n <ScalarButton\n class=\"p-0 px-2 py-0.5\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"configModal.hide()\">\n Cancel\n </ScalarButton>\n <ScalarButton\n class=\"p-0 px-2 py-0.5\"\n :loader=\"acquisitionLoader\"\n size=\"sm\"\n @click=\"handleConfigAuthorize\">\n Authorize\n </ScalarButton>\n </div>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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OAAA,OAAA,MAAG,UAAU,kBAAkB,aAAA,MAAc,MAAM,KAAK;MACpE,2BAAqB,OAAA,OAAA,OAAA,MAAc,UAAU,mBAAmB,aAAA,MAAc,MAAM,KAAK;MAGzF,kBAAY,OAAA,OAAA,OAAA,MAAc,UAAU,kBAAkB,aAAA,MAAc,MAAM,KAAK;;;;;;;;;;;;;;QAIpF,mBAeM,OAfN,aAeM,CAdJ,YAMe,MAAA,YAAA,GAAA;KALb,OAAM;KACN,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,WAAA,CAAW,CAAC,KAAI;;4BAE1B,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF8B,YAE9B,EAAA,CAAA,EAAA,CAAA;;QACA,YAMe,MAAA,YAAA,GAAA;KALb,OAAM;KACL,QAAQ,MAAA,iBAAA;KACT,MAAK;KACJ,SAAO;;4BAEV,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAFiC,eAEjC,EAAA,CAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"RequestAuthTab.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useLoadingState } from '@scalar/components/loading'\nimport { ScalarMarkdownSummary } from '@scalar/components/markdown'\nimport { ScalarModal, useModal } from '@scalar/components/modal'\nimport { ScalarIconGear } from '@scalar/icons'\nimport { useToasts } from '@scalar/use-toasts'\nimport type {\n SecretsApiKey,\n SecretsHttp,\n} from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n getEnvironmentVariables,\n type MergedSecuritySchemes,\n type OAuthFlowsObjectSecret,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { getDocumentTypeLabel } from '@scalar/workspace-store/schemas/type-guards'\nimport type {\n ApiKeyObject,\n SecurityRequirementObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { capitalize, computed, ref } from 'vue'\n\nimport { refreshOauth2Token } from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth'\nimport { getVisibleOrderedFlowKeys } from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth-flows'\nimport {\n runOAuth2Authorize,\n storeOAuth2Tokens,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize'\nimport { getOauth2AcquisitionTarget } from '@/v2/blocks/scalar-auth-selector-block/helpers/security-scheme'\nimport {\n DataTable,\n DataTableCell,\n DataTableRow,\n} from '@/v2/components/data-table'\n\nimport OAuth2, { type OAuth2Options } from './OAuth2.vue'\nimport OAuth2Metadata from './OAuth2Metadata.vue'\nimport OpenIDConnect from './OpenIDConnect.vue'\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\ntype SecurityItem = {\n scheme: SecuritySchemeObjectSecret | undefined\n name: string\n scopes: string[]\n /** Ordered, non-hidden oauth2/openIdConnect flow keys for this scheme (empty for other types). */\n visibleFlowKeys: (keyof OAuthFlowsObjectSecret)[]\n}\n\nconst {\n environment,\n isStatic,\n proxyUrl,\n selectedSecuritySchemas,\n securitySchemes,\n server,\n eventBus,\n options,\n documentType = 'openapi',\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** Controls the display of certain borders which are used when we are non-collapsible */\n isStatic: boolean\n /** Proxy URL */\n proxyUrl: string\n /** Selected security schemes*/\n selectedSecuritySchemas: SecurityRequirementObject\n /** Merged security schemes from the document and the config together with the auth store secrets */\n securitySchemes: MergedSecuritySchemes\n /** Current server configuration */\n server: ServerObject | null\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n /** Type of the document the schemes belong to, used to label the missing-type warning */\n documentType?: 'openapi' | 'asyncapi'\n}>()\n\n/**\n * Human-readable name of the document type.\n * Used in the missing-type warning so it points at the correct document\n * (e.g. \"AsyncAPI\") instead of always naming OpenAPI.\n */\nconst documentTypeLabel = computed<string>(() =>\n getDocumentTypeLabel(documentType),\n)\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: Omit<ApiReferenceEvents['auth:update:selected-scopes'], 'meta'>,\n ): void\n (e: 'upsert:scope', payload: ApiReferenceEvents['auth:upsert:scopes']): void\n (e: 'delete:scope', payload: ApiReferenceEvents['auth:delete:scopes']): void\n}>()\n\n/**\n * Resolves security schemes from the OpenAPI document and combines them with their selected scopes.\n * Each item includes the scheme definition, name, and associated scopes.\n */\nconst security = computed<SecurityItem[]>(() =>\n Object.entries(selectedSecuritySchemas).map(([name, scopes = []]) => {\n const scheme = getResolvedRef(securitySchemes[name])\n return {\n scheme,\n name,\n scopes,\n // Compute the visible, ordered flow keys once per scheme so the tabs, the label, and the\n // active-flow tracking all agree on the same set (and we do not filter + sort on every access).\n visibleFlowKeys:\n scheme?.type === 'oauth2' || scheme?.type === 'openIdConnect'\n ? getVisibleOrderedFlowKeys(scheme.flows)\n : [],\n }\n }),\n)\n\n/** Tracks which OAuth2 flow is currently active when multiple flows are available. */\nconst activeFlow = ref<string>('')\n\n/**\n * Keeps the selected flow in sync with the currently visible flow keys. Validating against the\n * visible set (not every declared flow) means a selection that becomes hidden — e.g. the document\n * is updated to mark the active flow with `x-scalar-ignore` — resets, so the default (first visible)\n * flow activates instead of leaving no tab selected.\n */\nconst selectedFlow = computed<string>(() => {\n const visibleFlowKeys = security.value.flatMap((item) => item.visibleFlowKeys)\n\n return visibleFlowKeys.some((key) => key === activeFlow.value)\n ? activeFlow.value\n : ''\n})\n\nconst setActiveFlow = (flow: string): void => {\n activeFlow.value = flow\n}\n\n/** Determines if multiple auth schemes are configured, which affects the UI layout. */\nconst hasMultipleSchemes = computed<boolean>(() => security.value.length > 1)\n\n/**\n * Generates a human-readable label for the security scheme.\n * Intentionally omits the description here — it is rendered separately as\n * rich text via ScalarMarkdownSummary so markdown formatting is preserved.\n */\nconst generateLabel = (\n name: string,\n scheme: SecuritySchemeObjectSecret,\n): string => {\n const capitalizedName = capitalize(name)\n\n switch (scheme.type) {\n case 'apiKey':\n return `${capitalizedName}: ${scheme.in}`\n\n case 'openIdConnect':\n case 'oauth2': {\n const firstFlow = getVisibleOrderedFlowKeys(scheme.flows)[0]\n const currentFlow = selectedFlow.value || firstFlow\n if (!currentFlow) {\n return capitalizedName\n }\n return `${capitalizedName}: ${currentFlow}`\n }\n\n case 'http':\n return `${capitalizedName}: ${scheme.scheme}`\n\n default:\n return capitalizedName\n }\n}\n\n/**\n * Whether an API key scheme exposes an editable parameter name.\n *\n * OpenAPI `apiKey` and AsyncAPI `httpApiKey` (normalized to `apiKey`) name a query/header/cookie\n * parameter, so the Name input is shown. AsyncAPI `apiKey` places the key in the broker `user` or\n * `password` slot and has no parameter name, so the Name input is hidden and only the value is asked for.\n */\nconst apiKeyHasName = (scheme: { in?: string }): boolean =>\n scheme.in !== 'user' && scheme.in !== 'password'\n\n/**\n * The scheme's type when it is one we do not render inputs for (a type outside both the OpenAPI\n * and AsyncAPI security scheme unions). Read through a helper so the fallback template branch,\n * where the scheme type is narrowed to `never` after the supported cases, can still surface the type.\n */\nconst getUnsupportedSchemeType = (\n scheme: SecurityItem['scheme'],\n): string | undefined => scheme?.type\n\n/**\n * Determines if an OAuth2 flow tab should be active.\n * The first flow is active by default if no flow is explicitly selected.\n */\nconst isFlowActive = (flowKey: string, index: number): boolean =>\n selectedFlow.value === flowKey || (index === 0 && !selectedFlow.value)\n\n/** Computes the container class for static display mode. */\nconst getStaticBorderClass = (): string | false => isStatic && 'border-t'\n\nconst handleHttpSecretsUpdate = (\n payload: Omit<Partial<SecretsHttp>, 'type'>,\n name: string,\n): void =>\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: { type: 'http', ...payload },\n name,\n })\n\nconst handleApiKeySecretsUpdate = (\n payload: Omit<Partial<SecretsApiKey>, 'type'>,\n name: string,\n): void =>\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: { type: 'apiKey', ...payload },\n name,\n })\n\nconst handleApiKeySecuritySchemeUpdate = (\n payload: Omit<Partial<ApiKeyObject>, 'type'>,\n name: string,\n): void =>\n eventBus.emit('auth:update:security-scheme', {\n payload: { type: 'apiKey', ...payload },\n name,\n })\n\n/** Handles scope selection updates for OAuth2 */\nconst handleScopesUpdate = (\n name: string,\n event: { scopes?: string[]; scope?: string; selected?: boolean },\n): void => {\n emits('update:selectedScopes', {\n id: Object.keys(selectedSecuritySchemas),\n name,\n ...event,\n })\n}\n\n/** Handles scope-definition upserts (add / rename / description change) */\nconst handleScopeUpsert = (\n name: string,\n event: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n): void => {\n emits('upsert:scope', { ...event, name })\n}\n\n/** Handles scope-definition deletes */\nconst handleScopeDelete = (\n name: string,\n event: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n): void => {\n emits('delete:scope', { ...event, name })\n}\n\n/**\n * Computes dynamic classes for OAuth2 flow tabs based on active state.\n */\nconst getFlowTabClasses = (flowKey: string, index: number): string => {\n const baseClasses =\n 'floating-bg text-c-3 relative cursor-pointer border-b border-transparent py-1 text-base font-medium'\n const activeClasses = '!text-c-1 !rounded-none border-b !border-current'\n\n return isFlowActive(flowKey, index)\n ? `${baseClasses} ${activeClasses} ${isStatic ? 'opacity-100' : ''}`\n : baseClasses\n}\n\n/**\n * OAuth2 token-acquisition target (an oauth2 scheme with an interactive grant) sourced from\n * the merged schemes. When the active scheme is HTTP bearer, this powers the inline\n * \"Authorize via OAuth2\" shortcut: the flow's bearer token is written onto the bearer scheme,\n * so the panel never switches to oauth2.\n *\n * The shortcut is purely a convenience, so it is offered for any interactive oauth2 scheme —\n * including one that is also independently selectable in the dropdown (e.g. Scalar Galaxy's\n * `oAuth2`). Whether that oauth2 scheme is *hidden* from the dropdown is a separate decision made\n * in the selector; here we only surface the shortcut.\n */\nconst oauth2Target = computed(() => getOauth2AcquisitionTarget(securitySchemes))\n\n/** Resolved oauth2 scheme object, for embedding its config form behind the gear. */\nconst oauth2Scheme = computed(() =>\n oauth2Target.value\n ? getResolvedRef(securitySchemes[oauth2Target.value.name])\n : undefined,\n)\n\nconst acquisitionLoader = useLoadingState()\nconst { toast } = useToasts()\nconst configModal = useModal()\n/** Bearer scheme that opened the config modal, so its Authorize callback targets it. */\nconst configBearerName = ref<string | undefined>()\n\n/** Runs the OAuth2 flow and writes the resulting bearer token onto the bearer scheme. */\nconst handleAcquisitionAuthorize = async (\n bearerName: string,\n): Promise<void> => {\n const target = oauth2Target.value\n if (!target || acquisitionLoader.isLoading) {\n return\n }\n acquisitionLoader.start()\n const [error] = await runOAuth2Authorize({\n eventBus,\n bearerSchemeName: bearerName,\n oauth2Name: target.name,\n flows: target.flows,\n flowType: target.flowType,\n scopes: target.scopes,\n server,\n proxyUrl,\n environment,\n options,\n })\n await acquisitionLoader.clear()\n if (error) {\n toast(error?.message ?? 'Failed to authorize', 'error')\n }\n}\n\n/** Refreshes the OAuth2 token and rewrites it onto the bearer scheme. */\nconst handleAcquisitionRefresh = async (bearerName: string): Promise<void> => {\n const target = oauth2Target.value\n // Only the authorization-code flow carries a refresh token; implicit can't be refreshed.\n if (\n !target ||\n target.flowType !== 'authorizationCode' ||\n acquisitionLoader.isLoading\n ) {\n return\n }\n acquisitionLoader.start()\n const [error, tokens] = await refreshOauth2Token(\n target.flows,\n target.flowType,\n proxyUrl,\n server,\n getEnvironmentVariables(environment),\n options?.customFetch,\n )\n await acquisitionLoader.clear()\n if (tokens?.accessToken) {\n storeOAuth2Tokens(eventBus, {\n bearerSchemeName: bearerName,\n oauth2Name: target.name,\n flowType: target.flowType,\n tokens,\n })\n } else if (error) {\n toast(error?.message ?? 'Failed to refresh', 'error')\n }\n}\n\nconst openAcquisitionConfig = (bearerName: string): void => {\n configBearerName.value = bearerName\n configModal.show()\n}\n\n/** Closes the config modal and runs Authorize against the bearer scheme that opened it. */\nconst handleConfigAuthorize = (): void => {\n const bearerName = configBearerName.value\n configModal.hide()\n if (bearerName) {\n void handleAcquisitionAuthorize(bearerName)\n }\n}\n</script>\n<template>\n <template\n v-for=\"{ scheme, name, scopes, visibleFlowKeys } in security\"\n :key=\"name\">\n <!--\n Header row for AND'ed schemes: label (bold) and description (rich text) are\n combined.\n -->\n <DataTableRow v-if=\"hasMultipleSchemes && scheme\">\n <DataTableCell\n :aria-label=\"generateLabel(name, scheme)\"\n class=\"max-h-[auto]\">\n <div class=\"bg-b-1 min-w-0 flex-1 px-3 py-1.25\">\n <p class=\"text-c-1 leading-5.5 font-medium\">\n {{ generateLabel(name, scheme) }}\n </p>\n <ScalarMarkdownSummary\n v-if=\"scheme.description\"\n class=\"auth-description text-c-2 w-full\"\n :value=\"scheme.description\" />\n </div>\n </DataTableCell>\n </DataTableRow>\n\n <!-- Description: shown for single auth schemes with descriptions -->\n <DataTableRow v-if=\"scheme?.description && !hasMultipleSchemes\">\n <DataTableCell\n :aria-label=\"scheme.description\"\n class=\"max-h-[auto]\">\n <ScalarMarkdownSummary\n class=\"auth-description bg-b-1 text-c-2 min-w-0 flex-1 px-3 py-1.25\"\n :value=\"scheme.description\" />\n </DataTableCell>\n </DataTableRow>\n\n <!-- HTTP Authentication -->\n <template v-if=\"scheme?.type === 'http'\">\n <!-- Bearer Token -->\n <DataTableRow v-if=\"scheme.scheme === 'bearer'\">\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme['x-scalar-secret-token']\"\n placeholder=\"Token\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleHttpSecretsUpdate({ 'x-scalar-secret-token': v }, name)\n \">\n Bearer Token\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- OAuth2 token-acquisition shortcut (shown when an interactive oauth2 flow exists) -->\n <DataTableRow v-if=\"scheme.scheme === 'bearer' && oauth2Target\">\n <div class=\"flex h-8 items-center gap-2 border-t px-3\">\n <span class=\"text-c-3 mr-auto text-xs\">Get a token</span>\n <ScalarButton\n class=\"p-0 px-2 py-0.5\"\n :loader=\"acquisitionLoader\"\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"handleAcquisitionAuthorize(name)\">\n Authorize via {{ oauth2Target.name }}\n </ScalarButton>\n <ScalarButton\n v-if=\"\n scheme['x-scalar-secret-token'] &&\n oauth2Target.flowType === 'authorizationCode'\n \"\n class=\"p-0 px-2 py-0.5\"\n :disabled=\"acquisitionLoader.isLoading\"\n size=\"sm\"\n type=\"button\"\n variant=\"outlined\"\n @click=\"handleAcquisitionRefresh(name)\">\n Refresh\n </ScalarButton>\n <ScalarIconButton\n :icon=\"ScalarIconGear\"\n :label=\"`Configure ${oauth2Target.name}`\"\n size=\"xs\"\n @click=\"openAcquisitionConfig(name)\" />\n </div>\n </DataTableRow>\n\n <!-- HTTP Basic Authentication -->\n <template v-else-if=\"scheme?.scheme === 'basic'\">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"text-c-2\"\n :environment\n :modelValue=\"scheme['x-scalar-secret-username']\"\n placeholder=\"janedoe\"\n required\n @update:modelValue=\"\n (v) =>\n handleHttpSecretsUpdate({ 'x-scalar-secret-username': v }, name)\n \">\n Username\n </RequestAuthDataTableInput>\n </DataTableRow>\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"scheme['x-scalar-secret-password']\"\n placeholder=\"********\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleHttpSecretsUpdate({ 'x-scalar-secret-password': v }, name)\n \">\n Password\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n </template>\n\n <!-- API Key Authentication -->\n <template v-else-if=\"scheme?.type === 'apiKey'\">\n <DataTableRow v-if=\"apiKeyHasName(scheme)\">\n <RequestAuthDataTableInput\n :containerClass=\"getStaticBorderClass()\"\n :environment\n :modelValue=\"scheme.name ?? ''\"\n placeholder=\"api-key\"\n @update:modelValue=\"\n (v) => handleApiKeySecuritySchemeUpdate({ name: v }, name)\n \">\n Name\n </RequestAuthDataTableInput>\n </DataTableRow>\n <DataTableRow>\n <RequestAuthDataTableInput\n :containerClass=\"\n apiKeyHasName(scheme) ? undefined : getStaticBorderClass()\n \"\n :environment\n :modelValue=\"scheme['x-scalar-secret-token']\"\n placeholder=\"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleApiKeySecretsUpdate({ 'x-scalar-secret-token': v }, name)\n \">\n Value\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <!-- OAuth 2.0 / OpenID Connect Authentication -->\n <template\n v-else-if=\"scheme?.type === 'oauth2' || scheme?.type === 'openIdConnect'\">\n <OAuth2Metadata\n v-if=\"\n scheme.type === 'oauth2' && (!isStatic || scheme.oauth2MetadataUrl)\n \"\n :customFetch=\"options?.customFetch\"\n :environment\n :eventBus\n :name\n :proxyUrl\n :scheme />\n\n <!-- OpenID Connect -->\n <OpenIDConnect\n v-if=\"scheme?.type === 'openIdConnect' && !visibleFlowKeys.length\"\n :customFetch=\"options?.customFetch\"\n :environment\n :eventBus\n :getStaticBorderClass\n :name\n :proxyUrl\n :scheme />\n\n <!-- Flow selector tabs: shown when multiple visible flows are available -->\n <DataTableRow v-if=\"visibleFlowKeys.length > 1\">\n <div class=\"flex min-h-8 border-t text-base\">\n <div class=\"flex h-8 max-w-full gap-2.5 overflow-x-auto px-3\">\n <button\n v-for=\"(key, ind) in visibleFlowKeys\"\n :key=\"key\"\n :class=\"getFlowTabClasses(key, ind)\"\n type=\"button\"\n @click=\"setActiveFlow(key)\">\n <span class=\"relative z-10\">{{ key }}</span>\n </button>\n </div>\n </div>\n </DataTableRow>\n\n <!-- OAuth2 flow configuration -->\n <template\n v-for=\"(key, ind) in visibleFlowKeys\"\n :key=\"key\">\n <OAuth2\n v-if=\"scheme.flows && isFlowActive(key, ind)\"\n :environment\n :eventBus\n :flows=\"scheme.flows\"\n :name\n :options\n :proxyUrl\n :scheme\n :selectedScopes=\"scopes\"\n :server\n :type=\"key\"\n @delete:scope=\"(event) => handleScopeDelete(name, event)\"\n @update:selectedScopes=\"(event) => handleScopesUpdate(name, event)\"\n @upsert:scope=\"(event) => handleScopeUpsert(name, event)\" />\n </template>\n </template>\n\n <!-- Browser WebSocket connections cannot apply these broker credentials. -->\n <div\n v-else-if=\"\n scheme?.type === 'userPassword' ||\n scheme?.type === 'plain' ||\n scheme?.type === 'scramSha256' ||\n scheme?.type === 'scramSha512' ||\n scheme?.type === 'X509' ||\n scheme?.type === 'symmetricEncryption' ||\n scheme?.type === 'asymmetricEncryption' ||\n scheme?.type === 'gssapi'\n \"\n class=\"text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance\">\n Credentials for this AsyncAPI security scheme are not sent by the browser\n client.\n </div>\n\n <!-- Mutual TLS credentials are chosen during the browser-managed TLS handshake. -->\n <div\n v-else-if=\"scheme?.type === 'mutualTLS'\"\n class=\"text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance\">\n Mutual TLS authenticates with a client certificate presented during the\n TLS handshake, so there is nothing to enter here.\n </div>\n\n <!-- Scheme has a type we do not render inputs for -->\n <div\n v-else-if=\"getUnsupportedSchemeType(scheme)\"\n class=\"text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance\">\n The <code>{{ getUnsupportedSchemeType(scheme) }}</code> security scheme\n type is not supported yet.\n </div>\n\n <!-- Scheme is missing type -->\n <div\n v-else\n class=\"text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance\">\n The security scheme is missing a type, please double check your\n {{ documentTypeLabel }} document or Authentication Configuration\n </div>\n </template>\n\n <!-- OAuth2 configuration modal (opened from the bearer scheme's gear) -->\n <ScalarModal\n v-if=\"oauth2Target && oauth2Scheme\"\n :state=\"configModal\"\n size=\"sm\"\n :title=\"`Configure ${oauth2Target.name}`\">\n <DataTable\n :columns=\"['']\"\n presentational>\n <OAuth2\n hideActions\n :environment\n :eventBus\n :flows=\"oauth2Target.flows\"\n :name=\"oauth2Target.name\"\n :options\n :proxyUrl\n :scheme=\"oauth2Scheme\"\n :selectedScopes=\"oauth2Target.scopes\"\n :server\n :type=\"oauth2Target.flowType\"\n @delete:scope=\"(event) => handleScopeDelete(oauth2Target!.name, event)\"\n @update:selectedScopes=\"\n (event) => handleScopesUpdate(oauth2Target!.name, event)\n \"\n @upsert:scope=\"\n (event) => handleScopeUpsert(oauth2Target!.name, event)\n \" />\n </DataTable>\n <div class=\"flex h-8 items-center justify-end gap-2 border-t\">\n <ScalarButton\n class=\"p-0 px-2 py-0.5\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"configModal.hide()\">\n Cancel\n </ScalarButton>\n <ScalarButton\n class=\"p-0 px-2 py-0.5\"\n :loader=\"acquisitionLoader\"\n size=\"sm\"\n @click=\"handleConfigAuthorize\">\n Authorize\n </ScalarButton>\n </div>\n </ScalarModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FA,MAAM,oBAAoB,eACxB,qBAAqB,QAAA,YAAY,CACnC;EAEA,MAAM,QAAQ;;;;;EAad,MAAM,WAAW,eACf,OAAO,QAAQ,QAAA,uBAAuB,CAAC,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,OAAO;GACnE,MAAM,SAAS,eAAe,QAAA,gBAAgB,KAAK;GACnD,OAAO;IACL;IACA;IACA;IAGA,iBACE,QAAQ,SAAS,YAAY,QAAQ,SAAS,kBAC1C,0BAA0B,OAAO,KAAK,IACtC,CAAC;GACT;EACF,CAAC,CACH;;EAGA,MAAM,aAAa,I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A,UAAA,QAAA;MACA,QAAQ,aAAA;MACR,gBAAgB,aAAA,MAAa;MAC7B,QAAA,QAAA;MACA,MAAM,aAAA,MAAa;MACnB,kBAAY,OAAA,OAAA,OAAA,MAAG,UAAU,kBAAkB,aAAA,MAAc,MAAM,KAAK;MACpE,2BAAqB,OAAA,OAAA,OAAA,MAAc,UAAU,mBAAmB,aAAA,MAAc,MAAM,KAAK;MAGzF,kBAAY,OAAA,OAAA,OAAA,MAAc,UAAU,kBAAkB,aAAA,MAAc,MAAM,KAAK;;;;;;;;;;;;;;QAIpF,mBAeM,OAfN,aAeM,CAdJ,YAMe,MAAA,YAAA,GAAA;KALb,OAAM;KACN,MAAK;KACL,SAAQ;KACP,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,WAAA,CAAW,CAAC,KAAI;;4BAE1B,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAF8B,YAE9B,EAAA,CAAA,EAAA,CAAA;;QACA,YAMe,MAAA,YAAA,GAAA;KALb,OAAM;KACL,QAAQ,MAAA,iBAAA;KACT,MAAK;KACJ,SAAO;;4BAEV,CAAA,GAAA,OAAA,QAAA,OAAA,MAAA,CAAA,gBAFiC,eAEjC,EAAA,CAAA,EAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
2
  type AuthOption = {
3
3
  label: string;
4
4
  payload: SecuritySchemeObject;
@@ -1 +1 @@
1
- {"version":3,"file":"auth-options.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/auth-options.ts"],"sourcesContent":["import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\ntype AuthOption = { label: string; payload: SecuritySchemeObject }\n\n/** Predefined authentication options */\nexport const authOptions: Record<string, AuthOption> = {\n apiKeyCookie: {\n label: 'API Key in Cookies',\n payload: {\n type: 'apiKey',\n in: 'cookie',\n name: 'apiKeyCookie',\n },\n },\n apiKeyHeader: {\n label: 'API Key in Headers',\n payload: {\n type: 'apiKey',\n in: 'header',\n name: 'apiKeyHeader',\n },\n },\n apiKeyQuery: {\n label: 'API Key in Query Params',\n payload: {\n type: 'apiKey',\n in: 'query',\n name: 'apiKeyQuery',\n },\n },\n httpBasic: {\n label: 'HTTP Basic',\n payload: {\n type: 'http',\n scheme: 'basic',\n },\n },\n httpBearer: {\n label: 'HTTP Bearer',\n payload: {\n type: 'http',\n scheme: 'bearer',\n },\n },\n oauth2Implicit: {\n label: 'Oauth2 Implicit Flow',\n payload: {\n type: 'oauth2',\n flows: {\n implicit: {\n authorizationUrl: '',\n refreshUrl: '',\n scopes: {},\n },\n },\n },\n },\n oauth2Password: {\n label: 'Oauth2 Password Flow',\n payload: {\n type: 'oauth2',\n flows: {\n password: {\n tokenUrl: '',\n refreshUrl: '',\n scopes: {},\n },\n },\n },\n },\n oauth2ClientCredentials: {\n label: 'Oauth2 Client Credentials',\n payload: {\n type: 'oauth2',\n flows: {\n clientCredentials: {\n tokenUrl: '',\n refreshUrl: '',\n scopes: {},\n },\n },\n },\n },\n oauth2AuthorizationFlow: {\n label: 'Oauth2 Authorization Code',\n payload: {\n type: 'oauth2',\n flows: {\n authorizationCode: {\n authorizationUrl: '',\n tokenUrl: '',\n refreshUrl: '',\n 'x-usePkce': 'no',\n scopes: {},\n },\n },\n },\n },\n}\n"],"mappings":";;AAKA,IAAa,cAA0C;CACrD,cAAc;EACZ,OAAO;EACP,SAAS;GACP,MAAM;GACN,IAAI;GACJ,MAAM;EACR;CACF;CACA,cAAc;EACZ,OAAO;EACP,SAAS;GACP,MAAM;GACN,IAAI;GACJ,MAAM;EACR;CACF;CACA,aAAa;EACX,OAAO;EACP,SAAS;GACP,MAAM;GACN,IAAI;GACJ,MAAM;EACR;CACF;CACA,WAAW;EACT,OAAO;EACP,SAAS;GACP,MAAM;GACN,QAAQ;EACV;CACF;CACA,YAAY;EACV,OAAO;EACP,SAAS;GACP,MAAM;GACN,QAAQ;EACV;CACF;CACA,gBAAgB;EACd,OAAO;EACP,SAAS;GACP,MAAM;GACN,OAAO,EACL,UAAU;IACR,kBAAkB;IAClB,YAAY;IACZ,QAAQ,CAAC;GACX,EACF;EACF;CACF;CACA,gBAAgB;EACd,OAAO;EACP,SAAS;GACP,MAAM;GACN,OAAO,EACL,UAAU;IACR,UAAU;IACV,YAAY;IACZ,QAAQ,CAAC;GACX,EACF;EACF;CACF;CACA,yBAAyB;EACvB,OAAO;EACP,SAAS;GACP,MAAM;GACN,OAAO,EACL,mBAAmB;IACjB,UAAU;IACV,YAAY;IACZ,QAAQ,CAAC;GACX,EACF;EACF;CACF;CACA,yBAAyB;EACvB,OAAO;EACP,SAAS;GACP,MAAM;GACN,OAAO,EACL,mBAAmB;IACjB,kBAAkB;IAClB,UAAU;IACV,YAAY;IACZ,aAAa;IACb,QAAQ,CAAC;GACX,EACF;EACF;CACF;AACF"}
1
+ {"version":3,"file":"auth-options.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/auth-options.ts"],"sourcesContent":["import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\ntype AuthOption = { label: string; payload: SecuritySchemeObject }\n\n/** Predefined authentication options */\nexport const authOptions: Record<string, AuthOption> = {\n apiKeyCookie: {\n label: 'API Key in Cookies',\n payload: {\n type: 'apiKey',\n in: 'cookie',\n name: 'apiKeyCookie',\n },\n },\n apiKeyHeader: {\n label: 'API Key in Headers',\n payload: {\n type: 'apiKey',\n in: 'header',\n name: 'apiKeyHeader',\n },\n },\n apiKeyQuery: {\n label: 'API Key in Query Params',\n payload: {\n type: 'apiKey',\n in: 'query',\n name: 'apiKeyQuery',\n },\n },\n httpBasic: {\n label: 'HTTP Basic',\n payload: {\n type: 'http',\n scheme: 'basic',\n },\n },\n httpBearer: {\n label: 'HTTP Bearer',\n payload: {\n type: 'http',\n scheme: 'bearer',\n },\n },\n oauth2Implicit: {\n label: 'Oauth2 Implicit Flow',\n payload: {\n type: 'oauth2',\n flows: {\n implicit: {\n authorizationUrl: '',\n refreshUrl: '',\n scopes: {},\n },\n },\n },\n },\n oauth2Password: {\n label: 'Oauth2 Password Flow',\n payload: {\n type: 'oauth2',\n flows: {\n password: {\n tokenUrl: '',\n refreshUrl: '',\n scopes: {},\n },\n },\n },\n },\n oauth2ClientCredentials: {\n label: 'Oauth2 Client Credentials',\n payload: {\n type: 'oauth2',\n flows: {\n clientCredentials: {\n tokenUrl: '',\n refreshUrl: '',\n scopes: {},\n },\n },\n },\n },\n oauth2AuthorizationFlow: {\n label: 'Oauth2 Authorization Code',\n payload: {\n type: 'oauth2',\n flows: {\n authorizationCode: {\n authorizationUrl: '',\n tokenUrl: '',\n refreshUrl: '',\n 'x-usePkce': 'no',\n scopes: {},\n },\n },\n },\n },\n}\n"],"mappings":";;AAKA,IAAa,cAA0C;CACrD,cAAc;EACZ,OAAO;EACP,SAAS;GACP,MAAM;GACN,IAAI;GACJ,MAAM;EACR;CACF;CACA,cAAc;EACZ,OAAO;EACP,SAAS;GACP,MAAM;GACN,IAAI;GACJ,MAAM;EACR;CACF;CACA,aAAa;EACX,OAAO;EACP,SAAS;GACP,MAAM;GACN,IAAI;GACJ,MAAM;EACR;CACF;CACA,WAAW;EACT,OAAO;EACP,SAAS;GACP,MAAM;GACN,QAAQ;EACV;CACF;CACA,YAAY;EACV,OAAO;EACP,SAAS;GACP,MAAM;GACN,QAAQ;EACV;CACF;CACA,gBAAgB;EACd,OAAO;EACP,SAAS;GACP,MAAM;GACN,OAAO,EACL,UAAU;IACR,kBAAkB;IAClB,YAAY;IACZ,QAAQ,CAAC;GACX,EACF;EACF;CACF;CACA,gBAAgB;EACd,OAAO;EACP,SAAS;GACP,MAAM;GACN,OAAO,EACL,UAAU;IACR,UAAU;IACV,YAAY;IACZ,QAAQ,CAAC;GACX,EACF;EACF;CACF;CACA,yBAAyB;EACvB,OAAO;EACP,SAAS;GACP,MAAM;GACN,OAAO,EACL,mBAAmB;IACjB,UAAU;IACV,YAAY;IACZ,QAAQ,CAAC;GACX,EACF;EACF;CACF;CACA,yBAAyB;EACvB,OAAO;EACP,SAAS;GACP,MAAM;GACN,OAAO,EACL,mBAAmB;IACjB,kBAAkB;IAClB,UAAU;IACV,YAAY;IACZ,aAAa;IACb,QAAQ,CAAC;GACX,EACF;EACF;CACF;AACF"}
@@ -2,7 +2,7 @@ import type { SecurityScheme } from '@scalar/types/entities';
2
2
  import type { AuthStore } from '@scalar/workspace-store/entities/auth';
3
3
  import type { DeepPartial } from '@scalar/workspace-store/helpers/overrides-proxy';
4
4
  import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example';
5
- import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
5
+ import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
6
6
  /** A combined scheme that includes both the auth store secrets and a deep partial of the config auth */
7
7
  export type ConfigAuthScheme = SecuritySchemeObject & DeepPartial<SecurityScheme>;
8
8
  /** Extract the secrets from the config and the auth store */
@@ -1 +1 @@
1
- {"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAA2C,MAAM,uCAAuC,CAAA;AAC/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAClF,OAAO,KAAK,EAUV,0BAA0B,EAC3B,MAAM,yCAAyC,CAAA;AAQhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAkLjF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,EAC1D,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB,0BA2DF,CAAA"}
1
+ {"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAA2C,MAAM,uCAAuC,CAAA;AAC/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAClF,OAAO,KAAK,EASV,0BAA0B,EAC3B,MAAM,yCAAyC,CAAA;AAQhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAkLjF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,EAC1D,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB,0BA2DF,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { ErrorResponse } from '@scalar/helpers/errors/normalize-error';
2
+ import type { CustomFetch } from '../../../../v2/blocks/operation-block/helpers/send-request.js';
3
+ import { type OpenIDConnectDiscovery as AuthorizationServerMetadata } from './fetch-openid-connect-discovery.js';
4
+ /** Fetches the exact RFC8414 metadata URL, without applying OIDC issuer URL conventions. */
5
+ export declare const fetchOAuth2Metadata: (url: string, proxyUrl: string, customFetch?: CustomFetch) => Promise<ErrorResponse<AuthorizationServerMetadata>>;
6
+ //# sourceMappingURL=fetch-oauth2-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-oauth2-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAK3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AAGnF,OAAO,EACL,KAAK,sBAAsB,IAAI,2BAA2B,EAE3D,MAAM,kCAAkC,CAAA;AAKzC,4FAA4F;AAC5F,eAAO,MAAM,mBAAmB,GAC9B,KAAK,MAAM,EACX,UAAU,MAAM,EAChB,cAAa,WAAmB,KAC/B,OAAO,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAuBpD,CAAA"}
@@ -0,0 +1,25 @@
1
+ import { OpenIDConnectDiscoverySchema } from "./fetch-openid-connect-discovery.js";
2
+ import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
3
+ import { isLocalUrl } from "@scalar/helpers/url/is-local-url";
4
+ import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
5
+ //#region src/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.ts
6
+ var isAllowedMetadataUrl = (url) => url.protocol === "https:" || url.protocol === "http:" && isLocalUrl(url.href);
7
+ /** Fetches the exact RFC8414 metadata URL, without applying OIDC issuer URL conventions. */
8
+ var fetchOAuth2Metadata = async (url, proxyUrl, customFetch = fetch) => {
9
+ try {
10
+ const metadataUrl = new URL(url.trim());
11
+ if (!isAllowedMetadataUrl(metadataUrl)) return [/* @__PURE__ */ new Error("OAuth2 metadata URL must use HTTPS or HTTP for local development URLs"), null];
12
+ const response = await customFetch(redirectToProxy(proxyUrl, metadataUrl.href));
13
+ if (!response.ok) return [/* @__PURE__ */ new Error(`Failed to fetch OAuth2 metadata: ${response.status} ${response.statusText}`), null];
14
+ const data = coerceValue(OpenIDConnectDiscoverySchema, await response.json());
15
+ if (!data.authorization_endpoint && !data.token_endpoint) return [/* @__PURE__ */ new Error("Invalid OAuth2 metadata: missing or invalid endpoints"), null];
16
+ for (const endpoint of [data.authorization_endpoint, data.token_endpoint]) if (endpoint && !isAllowedMetadataUrl(new URL(endpoint))) return [/* @__PURE__ */ new Error("OAuth2 metadata endpoints must use HTTPS or HTTP for local development URLs"), null];
17
+ return [null, data];
18
+ } catch (error) {
19
+ return [error instanceof Error ? error : /* @__PURE__ */ new Error("Failed to fetch OAuth2 metadata"), null];
20
+ }
21
+ };
22
+ //#endregion
23
+ export { fetchOAuth2Metadata };
24
+
25
+ //# sourceMappingURL=fetch-oauth2-metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-oauth2-metadata.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.ts"],"sourcesContent":["import type { ErrorResponse } from '@scalar/helpers/errors/normalize-error'\nimport { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\n\nimport type { CustomFetch } from '@/v2/blocks/operation-block/helpers/send-request'\n\n// RFC 8414 and OIDC share these consumed fields; this alias does not imply OIDC issuer semantics.\nimport {\n type OpenIDConnectDiscovery as AuthorizationServerMetadata,\n OpenIDConnectDiscoverySchema as AuthorizationServerMetadataSchema,\n} from './fetch-openid-connect-discovery'\n\nconst isAllowedMetadataUrl = (url: URL): boolean =>\n url.protocol === 'https:' || (url.protocol === 'http:' && isLocalUrl(url.href))\n\n/** Fetches the exact RFC8414 metadata URL, without applying OIDC issuer URL conventions. */\nexport const fetchOAuth2Metadata = async (\n url: string,\n proxyUrl: string,\n customFetch: CustomFetch = fetch,\n): Promise<ErrorResponse<AuthorizationServerMetadata>> => {\n try {\n const metadataUrl = new URL(url.trim())\n if (!isAllowedMetadataUrl(metadataUrl)) {\n return [new Error('OAuth2 metadata URL must use HTTPS or HTTP for local development URLs'), null]\n }\n const response = await customFetch(redirectToProxy(proxyUrl, metadataUrl.href))\n if (!response.ok) {\n return [new Error(`Failed to fetch OAuth2 metadata: ${response.status} ${response.statusText}`), null]\n }\n const data = coerceValue(AuthorizationServerMetadataSchema, await response.json())\n if (!data.authorization_endpoint && !data.token_endpoint) {\n return [new Error('Invalid OAuth2 metadata: missing or invalid endpoints'), null]\n }\n for (const endpoint of [data.authorization_endpoint, data.token_endpoint]) {\n if (endpoint && !isAllowedMetadataUrl(new URL(endpoint))) {\n return [new Error('OAuth2 metadata endpoints must use HTTPS or HTTP for local development URLs'), null]\n }\n }\n return [null, data]\n } catch (error) {\n return [error instanceof Error ? error : new Error('Failed to fetch OAuth2 metadata'), null]\n }\n}\n"],"mappings":";;;;;AAaA,IAAM,wBAAwB,QAC5B,IAAI,aAAa,YAAa,IAAI,aAAa,WAAW,WAAW,IAAI,IAAI;;AAG/E,IAAa,sBAAsB,OACjC,KACA,UACA,cAA2B,UAC6B;CACxD,IAAI;EACF,MAAM,cAAc,IAAI,IAAI,IAAI,KAAK,CAAC;EACtC,IAAI,CAAC,qBAAqB,WAAW,GACnC,OAAO,iBAAC,IAAI,MAAM,uEAAuE,GAAG,IAAI;EAElG,MAAM,WAAW,MAAM,YAAY,gBAAgB,UAAU,YAAY,IAAI,CAAC;EAC9E,IAAI,CAAC,SAAS,IACZ,OAAO,iBAAC,IAAI,MAAM,oCAAoC,SAAS,OAAO,GAAG,SAAS,YAAY,GAAG,IAAI;EAEvG,MAAM,OAAO,YAAY,8BAAmC,MAAM,SAAS,KAAK,CAAC;EACjF,IAAI,CAAC,KAAK,0BAA0B,CAAC,KAAK,gBACxC,OAAO,iBAAC,IAAI,MAAM,uDAAuD,GAAG,IAAI;EAElF,KAAK,MAAM,YAAY,CAAC,KAAK,wBAAwB,KAAK,cAAc,GACtE,IAAI,YAAY,CAAC,qBAAqB,IAAI,IAAI,QAAQ,CAAC,GACrD,OAAO,iBAAC,IAAI,MAAM,6EAA6E,GAAG,IAAI;EAG1G,OAAO,CAAC,MAAM,IAAI;CACpB,SAAS,OAAO;EACd,OAAO,CAAC,iBAAiB,QAAQ,wBAAQ,IAAI,MAAM,iCAAiC,GAAG,IAAI;CAC7F;AACF"}
@@ -7,7 +7,7 @@ import type { CustomFetch } from '../../../../v2/blocks/operation-block/helpers/
7
7
  *
8
8
  * @see https://openid.net/specs/openid-connect-discovery-1_0.html
9
9
  */
10
- declare const OpenIDConnectDiscoverySchema: import("@scalar/typebox").TObject<{
10
+ export declare const OpenIDConnectDiscoverySchema: import("@scalar/typebox").TObject<{
11
11
  /** URL of the OAuth 2.0 Authorization Endpoint */
12
12
  authorization_endpoint: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
13
13
  /** URL of the OAuth 2.0 Token Endpoint */
@@ -35,5 +35,4 @@ export declare const OPENID_SCOPE = "openid";
35
35
  * @returns The discovery document or an error
36
36
  */
37
37
  export declare const fetchOpenIDConnectDiscovery: (url: string, proxyUrl: string, customFetch?: CustomFetch) => Promise<ErrorResponse<OpenIDConnectDiscovery>>;
38
- export {};
39
38
  //# sourceMappingURL=fetch-openid-connect-discovery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-openid-connect-discovery.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAE3E,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,iBAAiB,CAAA;AAGnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AAEnF;;;;;GAKG;AACH,QAAA,MAAM,4BAA4B;IAChC,kDAAkD;;IAElD,0CAA0C;;IAE1C,+DAA+D;;IAE/D,oEAAoE;;IAEpE,uDAAuD;;EAEvD,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEhF;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAW,CAAA;AAEpC;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GACtC,KAAK,MAAM,EACX,UAAU,MAAM,EAChB,cAAa,WAAmB,KAC/B,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,CA2C/C,CAAA"}
1
+ {"version":3,"file":"fetch-openid-connect-discovery.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAE3E,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,iBAAiB,CAAA;AAGnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;IACvC,kDAAkD;;IAElD,0CAA0C;;IAE1C,+DAA+D;;IAE/D,oEAAoE;;IAEpE,uDAAuD;;EAEvD,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEhF;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAW,CAAA;AAEpC;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GACtC,KAAK,MAAM,EACX,UAAU,MAAM,EAChB,cAAa,WAAmB,KAC/B,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,CA2C/C,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
2
- import { Type } from "@scalar/typebox";
3
2
  import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
3
+ import { Type } from "@scalar/typebox";
4
4
  //#region src/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.ts
5
5
  /**
6
6
  * OpenID Connect Discovery Document (subset)
@@ -46,6 +46,6 @@ var fetchOpenIDConnectDiscovery = async (url, proxyUrl, customFetch = fetch) =>
46
46
  }
47
47
  };
48
48
  //#endregion
49
- export { fetchOpenIDConnectDiscovery };
49
+ export { OpenIDConnectDiscoverySchema, fetchOpenIDConnectDiscovery };
50
50
 
51
51
  //# sourceMappingURL=fetch-openid-connect-discovery.js.map