@scalar/api-client 2.26.1 → 2.27.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 (158) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/dist/components/Server/ServerSelector.vue.js +6 -6
  3. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +6 -6
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +48 -43
  8. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  9. package/dist/v2/blocks/operation-block/components/Header.vue2.js +10 -10
  10. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +29 -25
  12. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  13. package/dist/v2/blocks/operation-block/helpers/get-example.js +15 -15
  14. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +10 -0
  15. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +1 -0
  16. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +4 -0
  17. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -1
  18. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  19. package/dist/v2/blocks/operation-block/helpers/send-request.js +1 -1
  20. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +1 -1
  21. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  22. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  23. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +101 -100
  24. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  26. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +62 -69
  27. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +6 -6
  28. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +36 -2
  29. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  31. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +38 -3
  32. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  33. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  34. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +1 -1
  35. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  37. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +68 -69
  38. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  40. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -40
  41. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  42. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +35 -41
  43. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +37 -41
  45. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +3 -2
  46. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  47. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +107 -87
  48. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +21 -0
  49. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -0
  50. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +91 -0
  51. package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +4 -0
  52. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  53. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -93
  54. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  55. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +87 -65
  56. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +36 -0
  57. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -0
  58. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +35 -0
  59. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +1 -1
  60. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -1
  61. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +18 -10
  62. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +5 -0
  63. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -0
  64. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +27 -0
  65. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +3 -1
  66. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
  67. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +1 -2
  68. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  69. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +29 -37
  70. package/dist/v2/components/layout/CollapsibleSection.vue.js +1 -1
  71. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts +2 -2
  72. package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
  73. package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
  74. package/dist/v2/components/modals/ModalClientContainer.vue2.js +45 -42
  75. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
  76. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  77. package/dist/v2/components/sidebar/Sidebar.vue.js +25 -24
  78. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -0
  79. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  80. package/dist/v2/components/sidebar/SidebarMenu.vue.js +30 -30
  81. package/dist/v2/features/app/App.vue.d.ts +6 -1
  82. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  83. package/dist/v2/features/app/App.vue.js +48 -46
  84. package/dist/v2/features/app/app-events.d.ts +1 -1
  85. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  86. package/dist/v2/features/app/app-events.js +95 -56
  87. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  88. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  89. package/dist/v2/features/app/components/AppSidebar.vue2.js +111 -105
  90. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +12 -2
  91. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  92. package/dist/v2/features/app/helpers/create-api-client-app.js +12 -10
  93. package/dist/v2/features/app/helpers/routes.d.ts +3 -1
  94. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  95. package/dist/v2/features/app/hooks/use-theme.d.ts +42 -0
  96. package/dist/v2/features/app/hooks/use-theme.d.ts.map +1 -0
  97. package/dist/v2/features/app/hooks/use-theme.js +34 -0
  98. package/dist/v2/features/app/index.d.ts +0 -1
  99. package/dist/v2/features/app/index.d.ts.map +1 -1
  100. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  101. package/dist/v2/features/collection/DocumentCollection.vue.js +27 -26
  102. package/dist/v2/features/collection/WorkspaceCollection.vue.js +13 -12
  103. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  104. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  105. package/dist/v2/features/collection/components/Authentication.vue2.js +49 -40
  106. package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
  107. package/dist/v2/features/collection/components/Cookies.vue.js +26 -13
  108. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  109. package/dist/v2/features/collection/components/Environment.vue.js +27 -15
  110. package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
  111. package/dist/v2/features/collection/components/Overview.vue.js +2 -2
  112. package/dist/v2/features/collection/components/Overview.vue2.js +68 -61
  113. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  114. package/dist/v2/features/collection/components/Servers.vue.js +93 -88
  115. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  116. package/dist/v2/features/collection/components/Settings.vue.js +19 -17
  117. package/dist/v2/features/environments/EnvironmentsList.vue.js +1 -1
  118. package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
  119. package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +2 -2
  120. package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +8 -8
  121. package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
  122. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  123. package/dist/v2/features/modal/Modal.vue.js +15 -15
  124. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +1 -1
  125. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  126. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  127. package/dist/v2/features/operation/Operation.vue.js +31 -34
  128. package/dist/v2/features/settings/CollectionSettings.vue.d.ts +10 -7
  129. package/dist/v2/features/settings/CollectionSettings.vue.d.ts.map +1 -1
  130. package/dist/v2/features/settings/CollectionSettings.vue.js +183 -149
  131. package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
  132. package/dist/v2/features/settings/DocumentSettings.vue.js +88 -79
  133. package/dist/v2/features/settings/components/Section.vue.d.ts +2 -1
  134. package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
  135. package/dist/v2/features/settings/components/Section.vue.js +26 -15
  136. package/dist/v2/features/settings/helpers/get-theme-colors.d.ts +4 -3
  137. package/dist/v2/features/settings/helpers/get-theme-colors.d.ts.map +1 -1
  138. package/dist/v2/features/settings/helpers/get-theme-colors.js +6 -7
  139. package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
  140. package/dist/v2/helpers/handle-hotkeys.js +2 -2
  141. package/dist/v2/helpers/index.d.ts +0 -1
  142. package/dist/v2/helpers/index.d.ts.map +1 -1
  143. package/dist/v2/hooks/use-global-hot-keys.d.ts +3 -1
  144. package/dist/v2/hooks/use-global-hot-keys.d.ts.map +1 -1
  145. package/dist/v2/hooks/use-global-hot-keys.js +8 -6
  146. package/dist/v2/workspace-events.d.ts.map +1 -1
  147. package/dist/v2/workspace-events.js +10 -0
  148. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  149. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  150. package/dist/views/Request/RequestSidebar.vue2.js +139 -155
  151. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  152. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  153. package/dist/views/Request/RequestSidebarItem.vue2.js +104 -101
  154. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  155. package/package.json +20 -18
  156. package/dist/v2/helpers/plugins.d.ts +0 -65
  157. package/dist/v2/helpers/plugins.d.ts.map +0 -1
  158. package/dist/v2/helpers/plugins.js +0 -11
@@ -1,11 +1,15 @@
1
- import { defineComponent as P, computed as T, ref as Q, createElementBlock as u, openBlock as n, Fragment as c, renderList as k, createBlock as f, createCommentVNode as v, unref as d, withCtx as r, createVNode as i, createElementVNode as w, toDisplayString as j, createTextVNode as y, normalizeClass as K, capitalize as q } from "vue";
2
- import { ScalarMarkdownSummary as D } from "@scalar/components";
3
- import { getResolvedRef as E } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
- import H from "./OAuth2.vue.js";
5
- import b from "./RequestAuthDataTableInput.vue.js";
1
+ import { defineComponent as Q, computed as $, ref as q, createElementBlock as i, openBlock as o, Fragment as d, renderList as C, createBlock as y, createCommentVNode as v, unref as c, withCtx as r, createVNode as u, createElementVNode as b, toDisplayString as j, createTextVNode as f, normalizeClass as D, capitalize as E } from "vue";
2
+ import { ScalarMarkdownSummary as H } from "@scalar/components";
3
+ import { getResolvedRef as L } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
+ import G from "./OAuth2.vue.js";
5
+ import J from "./OpenIDConnect.vue.js";
6
+ import x from "./RequestAuthDataTableInput.vue.js";
6
7
  import m from "../../../components/data-table/DataTableRow.vue.js";
7
- import N from "../../../components/data-table/DataTableCell.vue.js";
8
- const L = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow-hidden px-3 py-1.25 text-ellipsis group-hover/auth:absolute group-hover/auth:h-auto group-hover/auth:border-b *:first:line-clamp-1 *:first:text-ellipsis group-hover/auth:*:first:line-clamp-none" }, G = { class: "flex min-h-8 border-t text-base" }, J = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" }, W = ["onClick"], X = { class: "relative z-10" }, oe = /* @__PURE__ */ P({
8
+ import K from "../../../components/data-table/DataTableCell.vue.js";
9
+ const W = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow-hidden px-3 py-1.25 text-ellipsis group-hover/auth:absolute group-hover/auth:h-auto group-hover/auth:border-b *:first:line-clamp-1 *:first:text-ellipsis group-hover/auth:*:first:line-clamp-none" }, X = { class: "flex min-h-8 border-t text-base" }, Y = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" }, Z = ["onClick"], _ = { class: "relative z-10" }, ee = {
10
+ key: 5,
11
+ class: "text-c-3 flex items-center justify-center border-t p-4 px-4 text-center text-xs text-balance"
12
+ }, ie = /* @__PURE__ */ Q({
9
13
  __name: "RequestAuthTab",
10
14
  props: {
11
15
  environment: {},
@@ -17,69 +21,72 @@ const L = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow
17
21
  eventBus: {}
18
22
  },
19
23
  emits: ["update:selectedScopes"],
20
- setup(a, { emit: R }) {
21
- const z = R, g = T(
22
- () => Object.entries(a.selectedSecuritySchemas).map(([l, e = []]) => ({
23
- scheme: E(a.securitySchemes[l]),
24
- name: l,
24
+ setup(n, { emit: A }) {
25
+ const O = A, w = $(
26
+ () => Object.entries(n.selectedSecuritySchemas).map(([a, e = []]) => ({
27
+ scheme: L(n.securitySchemes[a]),
28
+ name: a,
25
29
  scopes: e
26
30
  }))
27
- ), x = Q(""), U = T(() => g.value.length > 1), $ = (l, e) => {
28
- const t = q(l), o = e.description ? `: ${e.description}` : "";
31
+ ), h = q(""), k = $(() => w.value.flatMap(({ scheme: e }) => e?.type !== "oauth2" && e?.type !== "openIdConnect" ? [] : Object.keys(e.flows ?? {})).includes(h.value) ? h.value : ""), N = (a) => {
32
+ h.value = a;
33
+ }, B = $(() => w.value.length > 1), F = (a, e) => {
34
+ const t = E(a), l = e.description ? `: ${e.description}` : "";
29
35
  switch (e.type) {
30
36
  case "apiKey":
31
- return `${t}${o || `: ${e.in}`}`;
37
+ return `${t}${l || `: ${e.in}`}`;
38
+ case "openIdConnect":
32
39
  case "oauth2": {
33
- const V = Object.keys(e.flows ?? {})[0], s = x.value || V;
34
- return `${t}: ${s}${o}`;
40
+ const U = Object.keys(e.flows ?? {})[0], s = k.value || U;
41
+ return s ? `${t}: ${s}${l}` : `${t}${l}`;
35
42
  }
36
43
  case "http":
37
- return `${t}: ${e.scheme}${o}`;
44
+ return `${t}: ${e.scheme}${l}`;
38
45
  default:
39
- return `${t}${o || `: ${e.type}`}`;
46
+ return `${t}${l}`;
40
47
  }
41
- }, C = (l, e) => x.value === l || e === 0 && !x.value, B = () => a.isStatic && "border-t", S = (l, e) => a.eventBus.emit("auth:update:security-scheme-secrets", {
42
- payload: { type: "http", ...l },
48
+ }, T = (a, e) => k.value === a || e === 0 && !k.value, V = () => n.isStatic && "border-t", S = (a, e) => n.eventBus.emit("auth:update:security-scheme-secrets", {
49
+ payload: { type: "http", ...a },
43
50
  name: e
44
- }), I = (l, e) => a.eventBus.emit("auth:update:security-scheme-secrets", {
45
- payload: { type: "apiKey", ...l },
51
+ }), R = (a, e) => n.eventBus.emit("auth:update:security-scheme-secrets", {
52
+ payload: { type: "apiKey", ...a },
46
53
  name: e
47
- }), A = (l, e) => a.eventBus.emit("auth:update:security-scheme", {
48
- payload: { type: "apiKey", ...l },
54
+ }), z = (a, e) => n.eventBus.emit("auth:update:security-scheme", {
55
+ payload: { type: "apiKey", ...a },
49
56
  name: e
50
- }), M = (l, e) => {
51
- z("update:selectedScopes", {
52
- id: Object.keys(a.selectedSecuritySchemas),
53
- name: l,
57
+ }), M = (a, e) => {
58
+ O("update:selectedScopes", {
59
+ id: Object.keys(n.selectedSecuritySchemas),
60
+ name: a,
54
61
  ...e
55
62
  });
56
- }, O = (l, e) => {
63
+ }, P = (a, e) => {
57
64
  const t = "floating-bg text-c-3 relative cursor-pointer border-b border-transparent py-1 text-base font-medium";
58
- return C(l, e) ? `${t} !text-c-1 !rounded-none border-b !border-current ${a.isStatic ? "opacity-100" : ""}` : t;
65
+ return T(a, e) ? `${t} !text-c-1 !rounded-none border-b !border-current ${n.isStatic ? "opacity-100" : ""}` : t;
59
66
  };
60
- return (l, e) => (n(!0), u(c, null, k(g.value, ({ scheme: t, name: o, scopes: V }) => (n(), u(c, { key: o }, [
61
- U.value && t ? (n(), f(d(m), { key: 0 }, {
67
+ return (a, e) => (o(!0), i(d, null, C(w.value, ({ scheme: t, name: l, scopes: U }) => (o(), i(d, { key: l }, [
68
+ B.value && t ? (o(), y(c(m), { key: 0 }, {
62
69
  default: r(() => [
63
- i(d(N), {
64
- "aria-label": $(o, t),
70
+ u(c(K), {
71
+ "aria-label": F(l, t),
65
72
  class: "text-c-2 group/auth flex items-center leading-[22px] whitespace-nowrap outline-none hover:whitespace-normal"
66
73
  }, {
67
74
  default: r(() => [
68
- w("p", L, j($(o, t)), 1)
75
+ b("p", W, j(F(l, t)), 1)
69
76
  ]),
70
77
  _: 2
71
78
  }, 1032, ["aria-label"])
72
79
  ]),
73
80
  _: 2
74
81
  }, 1024)) : v("", !0),
75
- t?.description && !U.value ? (n(), f(d(m), { key: 1 }, {
82
+ t?.description && !B.value ? (o(), y(c(m), { key: 1 }, {
76
83
  default: r(() => [
77
- i(d(N), {
84
+ u(c(K), {
78
85
  "aria-label": t.description,
79
86
  class: "max-h-[auto]"
80
87
  }, {
81
88
  default: r(() => [
82
- i(d(D), {
89
+ u(c(H), {
83
90
  class: "auth-description bg-b-1 text-c-2 min-w-0 flex-1 px-3 py-1.25",
84
91
  value: t.description
85
92
  }, null, 8, ["value"])
@@ -89,54 +96,54 @@ const L = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow
89
96
  ]),
90
97
  _: 2
91
98
  }, 1024)) : v("", !0),
92
- t?.type === "http" ? (n(), u(c, { key: 2 }, [
93
- t.scheme === "bearer" ? (n(), f(d(m), { key: 0 }, {
99
+ t?.type === "http" ? (o(), i(d, { key: 2 }, [
100
+ t.scheme === "bearer" ? (o(), y(c(m), { key: 0 }, {
94
101
  default: r(() => [
95
- i(b, {
96
- containerClass: B(),
97
- environment: a.environment,
102
+ u(x, {
103
+ containerClass: V(),
104
+ environment: n.environment,
98
105
  modelValue: t["x-scalar-secret-token"],
99
106
  placeholder: "Token",
100
107
  type: "password",
101
- "onUpdate:modelValue": (s) => S({ "x-scalar-secret-token": s }, o)
108
+ "onUpdate:modelValue": (s) => S({ "x-scalar-secret-token": s }, l)
102
109
  }, {
103
110
  default: r(() => [...e[0] || (e[0] = [
104
- y(" Bearer Token ", -1)
111
+ f(" Bearer Token ", -1)
105
112
  ])]),
106
113
  _: 1
107
114
  }, 8, ["containerClass", "environment", "modelValue", "onUpdate:modelValue"])
108
115
  ]),
109
116
  _: 2
110
- }, 1024)) : t?.scheme === "basic" ? (n(), u(c, { key: 1 }, [
111
- i(d(m), null, {
117
+ }, 1024)) : t?.scheme === "basic" ? (o(), i(d, { key: 1 }, [
118
+ u(c(m), null, {
112
119
  default: r(() => [
113
- i(b, {
120
+ u(x, {
114
121
  class: "text-c-2",
115
- environment: a.environment,
122
+ environment: n.environment,
116
123
  modelValue: t["x-scalar-secret-username"],
117
124
  placeholder: "janedoe",
118
125
  required: "",
119
- "onUpdate:modelValue": (s) => S({ "x-scalar-secret-username": s }, o)
126
+ "onUpdate:modelValue": (s) => S({ "x-scalar-secret-username": s }, l)
120
127
  }, {
121
128
  default: r(() => [...e[1] || (e[1] = [
122
- y(" Username ", -1)
129
+ f(" Username ", -1)
123
130
  ])]),
124
131
  _: 1
125
132
  }, 8, ["environment", "modelValue", "onUpdate:modelValue"])
126
133
  ]),
127
134
  _: 2
128
135
  }, 1024),
129
- i(d(m), null, {
136
+ u(c(m), null, {
130
137
  default: r(() => [
131
- i(b, {
132
- environment: a.environment,
138
+ u(x, {
139
+ environment: n.environment,
133
140
  modelValue: t["x-scalar-secret-password"],
134
141
  placeholder: "********",
135
142
  type: "password",
136
- "onUpdate:modelValue": (s) => S({ "x-scalar-secret-password": s }, o)
143
+ "onUpdate:modelValue": (s) => S({ "x-scalar-secret-password": s }, l)
137
144
  }, {
138
145
  default: r(() => [...e[2] || (e[2] = [
139
- y(" Password ", -1)
146
+ f(" Password ", -1)
140
147
  ])]),
141
148
  _: 1
142
149
  }, 8, ["environment", "modelValue", "onUpdate:modelValue"])
@@ -144,80 +151,87 @@ const L = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow
144
151
  _: 2
145
152
  }, 1024)
146
153
  ], 64)) : v("", !0)
147
- ], 64)) : t?.type === "apiKey" ? (n(), u(c, { key: 3 }, [
148
- i(d(m), null, {
154
+ ], 64)) : t?.type === "apiKey" ? (o(), i(d, { key: 3 }, [
155
+ u(c(m), null, {
149
156
  default: r(() => [
150
- i(b, {
151
- containerClass: B(),
152
- environment: a.environment,
157
+ u(x, {
158
+ containerClass: V(),
159
+ environment: n.environment,
153
160
  modelValue: t.name,
154
161
  placeholder: "api-key",
155
- "onUpdate:modelValue": (s) => A({ name: s }, o)
162
+ "onUpdate:modelValue": (s) => z({ name: s }, l)
156
163
  }, {
157
164
  default: r(() => [...e[3] || (e[3] = [
158
- y(" Name ", -1)
165
+ f(" Name ", -1)
159
166
  ])]),
160
167
  _: 1
161
168
  }, 8, ["containerClass", "environment", "modelValue", "onUpdate:modelValue"])
162
169
  ]),
163
170
  _: 2
164
171
  }, 1024),
165
- i(d(m), null, {
172
+ u(c(m), null, {
166
173
  default: r(() => [
167
- i(b, {
168
- environment: a.environment,
174
+ u(x, {
175
+ environment: n.environment,
169
176
  modelValue: t["x-scalar-secret-token"],
170
177
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
171
178
  type: "password",
172
- "onUpdate:modelValue": (s) => I({ "x-scalar-secret-token": s }, o)
179
+ "onUpdate:modelValue": (s) => R({ "x-scalar-secret-token": s }, l)
173
180
  }, {
174
181
  default: r(() => [...e[4] || (e[4] = [
175
- y(" Value ", -1)
182
+ f(" Value ", -1)
176
183
  ])]),
177
184
  _: 1
178
185
  }, 8, ["environment", "modelValue", "onUpdate:modelValue"])
179
186
  ]),
180
187
  _: 2
181
188
  }, 1024)
182
- ], 64)) : t?.type === "oauth2" ? (n(), u(c, { key: 4 }, [
183
- Object.keys(t.flows).length > 1 ? (n(), f(d(m), { key: 0 }, {
189
+ ], 64)) : t?.type === "oauth2" || t?.type === "openIdConnect" ? (o(), i(d, { key: 4 }, [
190
+ t?.type === "openIdConnect" && !Object.keys(t.flows ?? {}).length ? (o(), y(J, {
191
+ key: 0,
192
+ environment: n.environment,
193
+ eventBus: n.eventBus,
194
+ getStaticBorderClass: V,
195
+ name: l,
196
+ proxyUrl: n.proxyUrl,
197
+ scheme: t
198
+ }, null, 8, ["environment", "eventBus", "name", "proxyUrl", "scheme"])) : v("", !0),
199
+ Object.keys(t.flows ?? {}).length > 1 ? (o(), y(c(m), { key: 1 }, {
184
200
  default: r(() => [
185
- w("div", G, [
186
- w("div", J, [
187
- (n(!0), u(c, null, k(t.flows, (s, p, h) => (n(), u("button", {
201
+ b("div", X, [
202
+ b("div", Y, [
203
+ (o(!0), i(d, null, C(t.flows, (s, p, g) => (o(), i("button", {
188
204
  key: p,
189
- class: K(O(p, h)),
205
+ class: D(P(p, g)),
190
206
  type: "button",
191
- onClick: (F) => x.value = p
207
+ onClick: (I) => N(p)
192
208
  }, [
193
- w("span", X, j(p), 1)
194
- ], 10, W))), 128))
209
+ b("span", _, j(p), 1)
210
+ ], 10, Z))), 128))
195
211
  ])
196
212
  ])
197
213
  ]),
198
214
  _: 2
199
215
  }, 1024)) : v("", !0),
200
- (n(!0), u(c, null, k(t.flows, (s, p, h) => (n(), u(c, { key: p }, [
201
- C(p, h) ? (n(), f(H, {
216
+ (o(!0), i(d, null, C(t.flows, (s, p, g) => (o(), i(d, { key: p }, [
217
+ t.flows && T(p, g) ? (o(), y(G, {
202
218
  key: 0,
203
- environment: a.environment,
204
- eventBus: a.eventBus,
219
+ environment: n.environment,
220
+ eventBus: n.eventBus,
205
221
  flows: t.flows,
206
- name: o,
207
- proxyUrl: a.proxyUrl,
208
- selectedScopes: V,
209
- server: a.server,
222
+ name: l,
223
+ proxyUrl: n.proxyUrl,
224
+ scheme: t,
225
+ selectedScopes: U,
226
+ server: n.server,
210
227
  type: p,
211
- "onUpdate:selectedScopes": (F) => M(o, F)
212
- }, null, 8, ["environment", "eventBus", "flows", "name", "proxyUrl", "selectedScopes", "server", "type", "onUpdate:selectedScopes"])) : v("", !0)
228
+ "onUpdate:selectedScopes": (I) => M(l, I)
229
+ }, null, 8, ["environment", "eventBus", "flows", "name", "proxyUrl", "scheme", "selectedScopes", "server", "type", "onUpdate:selectedScopes"])) : v("", !0)
213
230
  ], 64))), 128))
214
- ], 64)) : t?.type === "openIdConnect" ? (n(), u("div", {
215
- key: 5,
216
- class: K(["text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-t border-b-0 px-4 text-base", { "rounded-b-lg": a.isStatic }])
217
- }, " Coming soon ", 2)) : v("", !0)
231
+ ], 64)) : (o(), i("div", ee, " The security scheme is missing a type, please double check your OpenAPI document or Authentication Configuration "))
218
232
  ], 64))), 128));
219
233
  }
220
234
  });
221
235
  export {
222
- oe as default
236
+ ie as default
223
237
  };
@@ -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":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAOlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,OAAO,KAAK,EAUV,0BAA0B,EAC3B,MAAM,gBAAgB,CAAA;AAEvB,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAoCjF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,EAC1D,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB,0BAgHF,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;AAOlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,OAAO,KAAK,EAUV,0BAA0B,EAC3B,MAAM,gBAAgB,CAAA;AAEvB,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AA0HjF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,EAC1D,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB,0BAuDF,CAAA"}
@@ -1,4 +1,5 @@
1
- import { objectEntries as p } from "@scalar/helpers/object/object-entries";
1
+ import { isObject as p } from "@scalar/helpers/object/is-object";
2
+ import { objectEntries as x } from "@scalar/helpers/object/object-entries";
2
3
  const u = {
3
4
  "x-scalar-secret-client-id": "x-scalar-client-id",
4
5
  "x-scalar-secret-client-secret": "clientSecret",
@@ -6,80 +7,101 @@ const u = {
6
7
  "x-scalar-secret-redirect-uri": "x-scalar-redirect-uri",
7
8
  "x-scalar-secret-token": "token",
8
9
  "x-scalar-secret-username": "username"
9
- }, o = (e, l, d = {}) => {
10
- const i = {};
11
- for (const s of e) {
12
- const r = d[s], n = l[u[s]];
13
- i[s] = r || n || "";
10
+ }, n = (t, c, i = {}) => Object.fromEntries(
11
+ t.map((a) => {
12
+ const r = i[a] || c[a] || c[u[a]] || "";
13
+ return [a, r];
14
+ })
15
+ ), d = (t, c) => {
16
+ const i = /* @__PURE__ */ new Set();
17
+ return { flows: x(t ?? {}).reduce((r, [e, s]) => {
18
+ if (!p(s))
19
+ return r;
20
+ const o = s.selectedScopes;
21
+ return Array.isArray(o) && o.forEach((l) => typeof l == "string" && i.add(l)), e === "implicit" && (r.implicit = {
22
+ ...s,
23
+ ...n(
24
+ ["x-scalar-secret-client-id", "x-scalar-secret-redirect-uri", "x-scalar-secret-token"],
25
+ s,
26
+ c?.implicit
27
+ )
28
+ }), e === "password" && (r[e] = {
29
+ ...s,
30
+ ...n(
31
+ [
32
+ "x-scalar-secret-client-id",
33
+ "x-scalar-secret-client-secret",
34
+ "x-scalar-secret-username",
35
+ "x-scalar-secret-password",
36
+ "x-scalar-secret-token"
37
+ ],
38
+ s,
39
+ c?.password
40
+ )
41
+ }), e === "clientCredentials" && (r[e] = {
42
+ ...s,
43
+ ...n(
44
+ ["x-scalar-secret-client-id", "x-scalar-secret-client-secret", "x-scalar-secret-token"],
45
+ s,
46
+ c?.clientCredentials
47
+ )
48
+ }), e === "authorizationCode" && (r[e] = {
49
+ ...s,
50
+ ...n(
51
+ [
52
+ "x-scalar-secret-client-id",
53
+ "x-scalar-secret-client-secret",
54
+ "x-scalar-secret-redirect-uri",
55
+ "x-scalar-secret-token"
56
+ ],
57
+ s,
58
+ c?.authorizationCode
59
+ )
60
+ }), r;
61
+ }, {}), selectedScopes: Array.from(i) };
62
+ }, w = (t, c, i, a) => {
63
+ const r = c.getAuthSecrets(a, i);
64
+ if (t.type === "apiKey") {
65
+ const e = r?.type === "apiKey" ? r : void 0;
66
+ return {
67
+ ...t,
68
+ "x-scalar-secret-token": e?.["x-scalar-secret-token"] || t.value || ""
69
+ };
14
70
  }
15
- return i;
16
- }, f = (e, l, d, i) => {
17
- const s = l.getAuthSecrets(i, d);
18
- if (e.type === "apiKey") {
19
- const r = s?.type === "apiKey" ? s : void 0;
71
+ if (t.type === "http") {
72
+ const e = r?.type === "http" ? r : void 0;
20
73
  return {
21
- ...e,
22
- "x-scalar-secret-token": r?.["x-scalar-secret-token"] || e.value || ""
74
+ ...t,
75
+ "x-scalar-secret-token": e?.["x-scalar-secret-token"] || t.token || "",
76
+ "x-scalar-secret-username": e?.["x-scalar-secret-username"] || t.username || "",
77
+ "x-scalar-secret-password": e?.["x-scalar-secret-password"] || t.password || ""
23
78
  };
24
79
  }
25
- if (e.type === "http") {
26
- const r = s?.type === "http" ? s : void 0;
80
+ if (t.type === "oauth2") {
81
+ const e = r?.type === "oauth2" ? r : void 0, s = d(t.flows, e);
27
82
  return {
28
- ...e,
29
- "x-scalar-secret-token": r?.["x-scalar-secret-token"] || e.token || "",
30
- "x-scalar-secret-username": r?.["x-scalar-secret-username"] || e.username || "",
31
- "x-scalar-secret-password": r?.["x-scalar-secret-password"] || e.password || ""
83
+ ...t,
84
+ flows: s.flows,
85
+ "x-default-scopes": s.selectedScopes
32
86
  };
33
87
  }
34
- if (e.type === "oauth2") {
35
- const r = s?.type === "oauth2" ? s : void 0, n = /* @__PURE__ */ new Set();
88
+ if (t.type === "openIdConnect") {
89
+ const e = r?.type === "openIdConnect" ? r : void 0, s = d(
90
+ {
91
+ implicit: e?.implicit,
92
+ password: e?.password,
93
+ clientCredentials: e?.clientCredentials,
94
+ authorizationCode: e?.authorizationCode
95
+ },
96
+ e
97
+ );
36
98
  return {
37
- ...e,
38
- flows: p(e?.flows ?? {}).reduce((a, [c, t]) => (t && ("selectedScopes" in t && Array.isArray(t.selectedScopes) && t.selectedScopes?.forEach((x) => x && n.add(x)), c === "implicit" && (a.implicit = {
39
- ...t,
40
- ...o(
41
- ["x-scalar-secret-client-id", "x-scalar-secret-redirect-uri", "x-scalar-secret-token"],
42
- t,
43
- r?.implicit
44
- )
45
- }), c === "password" && (a[c] = {
46
- ...t,
47
- ...o(
48
- [
49
- "x-scalar-secret-client-id",
50
- "x-scalar-secret-client-secret",
51
- "x-scalar-secret-username",
52
- "x-scalar-secret-password",
53
- "x-scalar-secret-token"
54
- ],
55
- t,
56
- r?.password
57
- )
58
- }), c === "clientCredentials" && (a[c] = {
59
- ...t,
60
- ...o(
61
- ["x-scalar-secret-client-id", "x-scalar-secret-client-secret", "x-scalar-secret-token"],
62
- t,
63
- r?.clientCredentials
64
- )
65
- }), c === "authorizationCode" && (a[c] = {
66
- ...t,
67
- ...o(
68
- [
69
- "x-scalar-secret-client-id",
70
- "x-scalar-secret-client-secret",
71
- "x-scalar-secret-redirect-uri",
72
- "x-scalar-secret-token"
73
- ],
74
- t,
75
- r?.authorizationCode
76
- )
77
- })), a), {}),
78
- "x-default-scopes": Array.from(n)
99
+ ...t,
100
+ ...x(s.flows).length ? { flows: s.flows } : {}
79
101
  };
80
102
  }
81
- return e.type === "openIdConnect", e;
103
+ return t;
82
104
  };
83
105
  export {
84
- f as extractSecuritySchemeSecrets
106
+ w as extractSecuritySchemeSecrets
85
107
  };
@@ -0,0 +1,36 @@
1
+ import { type Static } from '@scalar/typebox';
2
+ import type { ErrorResponse } from '../../../../libs/errors.js';
3
+ /**
4
+ * OpenID Connect Discovery Document (subset)
5
+ * Represents the metadata fields consumed by the auth selector flow conversion.
6
+ *
7
+ * @see https://openid.net/specs/openid-connect-discovery-1_0.html
8
+ */
9
+ declare const OpenIDConnectDiscoverySchema: import("@scalar/typebox").TObject<{
10
+ /** URL of the OAuth 2.0 Authorization Endpoint */
11
+ authorization_endpoint: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
12
+ /** URL of the OAuth 2.0 Token Endpoint */
13
+ token_endpoint: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
14
+ /** List of OAuth 2.0 scope values that this server supports */
15
+ scopes_supported: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TString>>;
16
+ /** List of OAuth 2.0 grant type values that this server supports */
17
+ grant_types_supported: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TString>>;
18
+ /** Supported PKCE code challenge methods (RFC 7636) */
19
+ code_challenge_methods_supported: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TString>>;
20
+ }>;
21
+ export type OpenIDConnectDiscovery = Static<typeof OpenIDConnectDiscoverySchema>;
22
+ /**
23
+ * The required scope for OpenID Connect requests.
24
+ * If this scope is present, the request is an OIDC request; otherwise, it is a standard OAuth 2.0 request.
25
+ */
26
+ export declare const OPENID_SCOPE = "openid";
27
+ /**
28
+ * Fetches the OpenID Connect discovery document from the specified URL.
29
+ * Supports both full discovery URLs and issuer URLs.
30
+ *
31
+ * @param url - The OpenID Connect discovery URL or issuer URL
32
+ * @returns The discovery document or an error
33
+ */
34
+ export declare const fetchOpenIDConnectDiscovery: (url: string, proxyUrl: string) => Promise<ErrorResponse<OpenIDConnectDiscovery>>;
35
+ export {};
36
+ //# sourceMappingURL=fetch-openid-connect-discovery.d.ts.map
@@ -0,0 +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":"AACA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,iBAAiB,CAAA;AAGnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD;;;;;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;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GACtC,KAAK,MAAM,EACX,UAAU,MAAM,KACf,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,CA2C/C,CAAA"}
@@ -0,0 +1,35 @@
1
+ import { redirectToProxy as a } from "@scalar/helpers/url/redirect-to-proxy";
2
+ import { Type as n } from "@scalar/typebox";
3
+ import { coerceValue as p } from "@scalar/workspace-store/schemas/typebox-coerce";
4
+ const s = n.Object({
5
+ /** URL of the OAuth 2.0 Authorization Endpoint */
6
+ authorization_endpoint: n.Optional(n.String()),
7
+ /** URL of the OAuth 2.0 Token Endpoint */
8
+ token_endpoint: n.Optional(n.String()),
9
+ /** List of OAuth 2.0 scope values that this server supports */
10
+ scopes_supported: n.Optional(n.Array(n.String())),
11
+ /** List of OAuth 2.0 grant type values that this server supports */
12
+ grant_types_supported: n.Optional(n.Array(n.String())),
13
+ /** Supported PKCE code challenge methods (RFC 7636) */
14
+ code_challenge_methods_supported: n.Optional(n.Array(n.String()))
15
+ }), f = async (o, i) => {
16
+ try {
17
+ let e = o.trim();
18
+ if (!e)
19
+ return [new Error("URL cannot be empty"), null];
20
+ e.endsWith("/") && (e = e.slice(0, -1)), e.includes("/.well-known/openid-configuration") || (e = `${e}/.well-known/openid-configuration`);
21
+ const c = a(i, e), t = await fetch(c);
22
+ if (!t.ok)
23
+ return [
24
+ new Error(`Failed to fetch OpenID Connect discovery document: ${t.status} ${t.statusText}`),
25
+ null
26
+ ];
27
+ const r = p(s, await t.json());
28
+ return !r.authorization_endpoint && !r.token_endpoint ? [new Error("Invalid OpenID Connect discovery document: missing required endpoints"), null] : [null, r];
29
+ } catch (e) {
30
+ return e instanceof Error ? [e, null] : [new Error("Failed to fetch OpenID Connect discovery document"), null];
31
+ }
32
+ };
33
+ export {
34
+ f as fetchOpenIDConnectDiscovery
35
+ };
@@ -1,6 +1,6 @@
1
1
  import type { AuthenticationConfiguration } from '@scalar/types/api-reference';
2
2
  import type { AuthStore } from '@scalar/workspace-store/entities/auth';
3
- import type { ComponentsObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
+ import { type ComponentsObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
4
  import type { SecuritySchemeObjectSecret } from './secret-types';
5
5
  /** Document security merged with the config security schemes */
6
6
  export type MergedSecuritySchemes = Record<string, SecuritySchemeObjectSecret>;
@@ -1 +1 @@
1
- {"version":3,"file":"merge-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/merge-security.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AAItE,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAEhE,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAA;AAE9E,kGAAkG;AAClG,eAAO,MAAM,aAAa,GACxB,yBAAyB,gBAAgB,CAAC,iBAAiB,CAAM,EACjE,uBAAuB,2BAA2B,CAAC,iBAAiB,CAAM,EAC1E,WAAW,SAAS,EACpB,cAAc,MAAM,KACnB,qBAoBF,CAAA"}
1
+ {"version":3,"file":"merge-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/merge-security.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AAKtE,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAEhE,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAA;AAE9E,kGAAkG;AAClG,eAAO,MAAM,aAAa,GACxB,yBAAyB,gBAAgB,CAAC,iBAAiB,CAAM,EACjE,uBAAuB,2BAA2B,CAAC,iBAAiB,CAAM,EAC1E,WAAW,SAAS,EACpB,cAAc,MAAM,KACnB,qBA2BF,CAAA"}
@@ -1,15 +1,23 @@
1
- import { objectEntries as o } from "@scalar/helpers/object/object-entries";
1
+ import { objectEntries as c } from "@scalar/helpers/object/object-entries";
2
+ import { deepClone as f } from "@scalar/workspace-store/helpers/deep-clone";
2
3
  import { getResolvedRef as p } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- import { mergeObjects as S } from "@scalar/workspace-store/helpers/merge-object";
4
- import { unpackProxyObject as d } from "@scalar/workspace-store/helpers/unpack-proxy";
5
- import { extractSecuritySchemeSecrets as f } from "./extract-security-scheme-secrets.js";
6
- const l = (m = {}, c = {}, u, s) => {
7
- const i = o(m).reduce(
8
- (e, [r, t]) => (e[r] = structuredClone(d(p(t))), e),
4
+ import { mergeObjects as g } from "@scalar/workspace-store/helpers/merge-object";
5
+ import { coerceValue as h } from "@scalar/workspace-store/schemas/typebox-coerce";
6
+ import { SecuritySchemeObjectSchema as l } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
7
+ import { extractSecuritySchemeSecrets as y } from "./extract-security-scheme-secrets.js";
8
+ const D = (m = {}, s = {}, i, n) => {
9
+ const d = c(m).reduce(
10
+ (e, [r, o]) => {
11
+ const t = f(p(o));
12
+ return t && (e[r] = t), e;
13
+ },
9
14
  {}
10
- ), n = S(i, c) ?? {};
11
- return o(n).reduce((e, [r, t]) => (e[r] = f(t, u, r, s), e), {});
15
+ ), u = g(d, s) ?? {};
16
+ return c(u).reduce((e, [r, o]) => {
17
+ const S = { ...h(l, o), ...o };
18
+ return e[r] = y(S, i, r, n), e;
19
+ }, {});
12
20
  };
13
21
  export {
14
- l as mergeSecurity
22
+ D as mergeSecurity
15
23
  };