@scalar/api-client 2.2.49 → 2.2.50

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 (216) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts +15 -3
  3. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  4. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  5. package/dist/components/AddressBar/AddressBar.vue2.js +102 -94
  6. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts +2 -0
  7. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  8. package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
  9. package/dist/components/AddressBar/AddressBarHistory.vue2.js +54 -58
  10. package/dist/components/CodeInput/CodeInput.vue.d.ts +9 -0
  11. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  12. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  13. package/dist/components/CodeInput/CodeInput.vue2.js +95 -93
  14. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  15. package/dist/components/CodeInput/codeVariableWidget.js +1 -3
  16. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  17. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -22
  18. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  19. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +13 -13
  20. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  21. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +12 -12
  22. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
  23. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +54 -49
  24. package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts.map +1 -1
  25. package/dist/components/CommandPalette/CommandPaletteTag.vue.js +9 -9
  26. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  27. package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
  28. package/dist/components/DataTable/DataTableCell.vue.js +11 -8
  29. package/dist/components/DataTable/DataTableInput.vue.d.ts +6 -0
  30. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  31. package/dist/components/DataTable/DataTableInput.vue.js +4 -4
  32. package/dist/components/DataTable/DataTableInput.vue2.js +36 -30
  33. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  34. package/dist/components/DataTable/DataTableInputSelect.vue.js +15 -15
  35. package/dist/components/Form/Form.vue.d.ts +3 -1
  36. package/dist/components/Form/Form.vue.d.ts.map +1 -1
  37. package/dist/components/Form/Form.vue.js +30 -25
  38. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  39. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +41 -41
  40. package/dist/components/ImportCollection/ImportNowButton.vue.js +24 -24
  41. package/dist/components/ScreenReader.vue.d.ts.map +1 -1
  42. package/dist/components/Server/ServerDropdown.vue.d.ts.map +1 -1
  43. package/dist/components/Server/ServerDropdown.vue.js +13 -13
  44. package/dist/components/Server/ServerDropdownItem.vue.d.ts +1 -1
  45. package/dist/components/Server/ServerDropdownItem.vue.d.ts.map +1 -1
  46. package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
  47. package/dist/components/Server/ServerDropdownItem.vue2.js +19 -19
  48. package/dist/layouts/App/create-api-client-app.d.ts +387 -477
  49. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  50. package/dist/layouts/Modal/create-api-client-modal.d.ts +774 -954
  51. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  52. package/dist/layouts/Web/create-api-client-web.d.ts +387 -477
  53. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  54. package/dist/libs/create-client.d.ts +390 -479
  55. package/dist/libs/create-client.d.ts.map +1 -1
  56. package/dist/libs/create-client.js +3 -15
  57. package/dist/libs/env-helpers.d.ts.map +1 -1
  58. package/dist/libs/find-request.d.ts +7 -7
  59. package/dist/libs/find-request.d.ts.map +1 -1
  60. package/dist/libs/hot-keys.d.ts +3 -1
  61. package/dist/libs/hot-keys.d.ts.map +1 -1
  62. package/dist/libs/hot-keys.js +11 -15
  63. package/dist/libs/hot-keys.test.d.ts +2 -0
  64. package/dist/libs/hot-keys.test.d.ts.map +1 -0
  65. package/dist/libs/index.js +27 -26
  66. package/dist/libs/send-request/build-request-security.d.ts +1 -1
  67. package/dist/libs/send-request/build-request-security.js +19 -16
  68. package/dist/libs/send-request/create-request-operation.test.d.ts +10 -10
  69. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  70. package/dist/libs/send-request/set-request-cookies.d.ts +1 -1
  71. package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -1
  72. package/dist/libs/send-request/set-request-cookies.js +37 -34
  73. package/dist/store/active-entities.d.ts +58 -67
  74. package/dist/store/active-entities.d.ts.map +1 -1
  75. package/dist/store/active-entities.js +61 -74
  76. package/dist/store/collections.d.ts +90 -90
  77. package/dist/store/collections.d.ts.map +1 -1
  78. package/dist/store/collections.js +4 -17
  79. package/dist/store/cookies.d.ts +14 -14
  80. package/dist/store/environment.d.ts +19 -18
  81. package/dist/store/environment.d.ts.map +1 -1
  82. package/dist/store/environment.js +2 -8
  83. package/dist/store/import-spec.d.ts +16 -106
  84. package/dist/store/import-spec.d.ts.map +1 -1
  85. package/dist/store/import-spec.js +9 -14
  86. package/dist/store/request-example.d.ts +25 -25
  87. package/dist/store/request-example.d.ts.map +1 -1
  88. package/dist/store/request-example.js +15 -20
  89. package/dist/store/requests.d.ts +84 -84
  90. package/dist/store/requests.d.ts.map +1 -1
  91. package/dist/store/requests.js +17 -40
  92. package/dist/store/router-params.d.ts +13 -11
  93. package/dist/store/router-params.d.ts.map +1 -1
  94. package/dist/store/router-params.js +5 -5
  95. package/dist/store/security-schemes.d.ts +58 -58
  96. package/dist/store/security-schemes.d.ts.map +1 -1
  97. package/dist/store/security-schemes.js +1 -3
  98. package/dist/store/servers.d.ts +17 -17
  99. package/dist/store/servers.d.ts.map +1 -1
  100. package/dist/store/servers.js +2 -9
  101. package/dist/store/store.d.ts +387 -477
  102. package/dist/store/store.d.ts.map +1 -1
  103. package/dist/store/store.js +2 -4
  104. package/dist/store/tags.d.ts +28 -28
  105. package/dist/store/tags.d.ts.map +1 -1
  106. package/dist/store/tags.js +19 -34
  107. package/dist/store/workspace.d.ts +36 -36
  108. package/dist/store/workspace.d.ts.map +1 -1
  109. package/dist/store/workspace.js +1 -5
  110. package/dist/style.css +1 -1
  111. package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
  112. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  113. package/dist/views/Cookies/CookieForm.vue.js +18 -18
  114. package/dist/views/Cookies/CookieRaw.vue.d.ts.map +1 -1
  115. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  116. package/dist/views/Cookies/Cookies.vue2.js +24 -24
  117. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  118. package/dist/views/Environment/Environment.vue2.js +140 -132
  119. package/dist/views/Environment/EnvironmentModal.vue.d.ts +2 -2
  120. package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
  121. package/dist/views/Environment/EnvironmentModal.vue.js +15 -15
  122. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  123. package/dist/views/Request/Request.vue.js +2 -2
  124. package/dist/views/Request/Request.vue2.js +160 -141
  125. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.d.ts +2 -1
  126. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.d.ts.map +1 -1
  127. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +7 -7
  128. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +6 -2
  129. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  130. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +99 -95
  131. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +4 -0
  132. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  133. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  134. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +70 -64
  135. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +4 -0
  136. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  137. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  138. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +40 -34
  139. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts +6 -0
  140. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  141. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +32 -26
  142. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +4 -0
  143. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
  144. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
  145. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +93 -85
  146. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts +9 -0
  147. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  148. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  149. package/dist/views/Request/RequestSection/RequestBody.vue2.js +214 -244
  150. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts +10 -1
  151. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  152. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  153. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +77 -80
  154. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +7 -0
  155. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  156. package/dist/views/Request/RequestSection/RequestParams.vue.js +89 -96
  157. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +10 -2
  158. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  159. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +59 -66
  160. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +11 -0
  161. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  162. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  163. package/dist/views/Request/RequestSection/RequestSection.vue2.js +176 -155
  164. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +6 -0
  165. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  166. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  167. package/dist/views/Request/RequestSection/RequestTable.vue2.js +97 -100
  168. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  169. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +2 -2
  170. package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +31 -22
  171. package/dist/views/Request/RequestSection/helpers/getting-started.d.ts +2 -2
  172. package/dist/views/Request/RequestSection/helpers/getting-started.d.ts.map +1 -1
  173. package/dist/views/Request/RequestSection/helpers/getting-started.js +11 -13
  174. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  175. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  176. package/dist/views/Request/RequestSidebar.vue2.js +50 -48
  177. package/dist/views/Request/RequestSidebarItem.vue.d.ts +1 -1
  178. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  179. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  180. package/dist/views/Request/RequestSidebarItem.vue2.js +38 -44
  181. package/dist/views/Request/RequestSubpageHeader.vue.d.ts +10 -0
  182. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  183. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  184. package/dist/views/Request/RequestSubpageHeader.vue2.js +77 -69
  185. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts +4 -1
  186. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  187. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  188. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +41 -39
  189. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +1 -0
  190. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  191. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  192. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +56 -52
  193. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  194. package/dist/views/Request/components/WorkspaceDropdown.vue.js +68 -68
  195. package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
  196. package/dist/views/Request/handle-drag.d.ts +1 -1
  197. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  198. package/dist/views/Request/handle-drag.js +38 -55
  199. package/dist/views/Request/libs/auth.d.ts +2 -2
  200. package/dist/views/Request/libs/auth.d.ts.map +1 -1
  201. package/dist/views/Request/libs/auth.js +28 -29
  202. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  203. package/dist/views/Request/libs/oauth2.js +42 -65
  204. package/dist/views/Request/libs/request.d.ts +5 -0
  205. package/dist/views/Request/libs/request.d.ts.map +1 -1
  206. package/dist/views/Request/libs/request.js +37 -2
  207. package/dist/views/Request/libs/watch-mode.d.ts.map +1 -1
  208. package/dist/views/Request/libs/watch-mode.js +10 -34
  209. package/dist/views/Servers/ServerForm.vue.d.ts +1 -8
  210. package/dist/views/Servers/ServerForm.vue.d.ts.map +1 -1
  211. package/dist/views/Servers/ServerForm.vue.js +21 -22
  212. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  213. package/dist/views/Servers/Servers.vue2.js +73 -81
  214. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  215. package/dist/views/Settings/SettingsGeneral.vue.js +118 -134
  216. package/package.json +15 -15
@@ -1,73 +1,73 @@
1
- import { defineComponent as L, computed as O, ref as D, openBlock as p, createElementBlock as z, createElementVNode as a, createVNode as s, unref as t, withCtx as o, Fragment as I, renderList as U, createBlock as g, withModifiers as c, toDisplayString as C } from "vue";
2
- import V from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
3
- import q from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
4
- import { useActiveEntities as F } from "../../../store/active-entities.js";
5
- import { useModal as S, ScalarDropdown as $, ScalarDropdownItem as u, ScalarListboxCheckbox as P, ScalarIcon as m, ScalarTooltip as Y, ScalarButton as E, ScalarDropdownDivider as G, ScalarModal as N } from "@scalar/components";
6
- import { useRouter as H } from "vue-router";
1
+ import { defineComponent as L, computed as O, ref as D, openBlock as c, createElementBlock as z, createElementVNode as a, createVNode as n, unref as t, withCtx as o, Fragment as I, renderList as U, createBlock as g, withModifiers as r, toDisplayString as C } from "vue";
2
+ import { useModal as S, ScalarDropdown as $, ScalarDropdownItem as u, ScalarListboxCheckbox as V, ScalarIcon as p, ScalarTooltip as q, ScalarButton as E, ScalarDropdownDivider as F, ScalarModal as N } from "@scalar/components";
3
+ import { useRouter as P } from "vue-router";
4
+ import Y from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
5
+ import G from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
6
+ import { useActiveEntities as H } from "../../../store/active-entities.js";
7
7
  import { useWorkspace as J } from "../../../store/store.js";
8
- const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font-bold m-0 flex gap-1.5 items-center" }, X = { class: "line-clamp-1 text-left" }, Z = { class: "text-ellipsis overflow-hidden" }, ee = { class: "flex items-center justify-center h-4 w-4" }, ce = /* @__PURE__ */ L({
8
+ const K = { class: "flex w-[inherit] items-center text-sm" }, Q = { class: "m-0 flex items-center gap-1.5 font-bold" }, X = { class: "line-clamp-1 text-left" }, Z = { class: "overflow-hidden text-ellipsis" }, ee = { class: "flex h-4 w-4 items-center justify-center" }, de = /* @__PURE__ */ L({
9
9
  __name: "WorkspaceDropdown",
10
10
  setup(te) {
11
- const { activeWorkspace: f } = F(), { workspaces: d, workspaceMutators: b, events: T } = J(), { push: _ } = H(), j = (n) => {
11
+ const { activeWorkspace: m } = H(), { workspaces: d, workspaceMutators: b, events: T } = J(), { push: _ } = P(), j = (s) => {
12
12
  var e;
13
- n !== ((e = f.value) == null ? void 0 : e.uid) && _({
13
+ s !== ((e = m.value) == null ? void 0 : e.uid) && _({
14
14
  name: "workspace",
15
15
  params: {
16
- workspace: n
16
+ workspace: s
17
17
  }
18
18
  });
19
- }, y = O(() => Object.keys(d).length === 1), B = () => T.commandPalette.emit({ commandName: "Create Workspace" }), v = D(""), i = D(""), w = S(), k = S(), M = (n) => {
20
- const e = d[n];
21
- e && (v.value = e.name, i.value = n, w.show());
22
- }, R = (n) => {
23
- n.trim() && (b.edit(i.value, "name", n.trim()), w.hide());
24
- }, W = (n) => {
25
- const e = d[n];
26
- e && (v.value = e.name, i.value = n, k.show());
19
+ }, y = O(() => Object.keys(d).length === 1), B = () => T.commandPalette.emit({ commandName: "Create Workspace" }), f = D(""), i = D(""), v = S(), w = S(), M = (s) => {
20
+ const e = d[s];
21
+ e && (f.value = e.name, i.value = s, v.show());
22
+ }, R = (s) => {
23
+ s.trim() && (b.edit(i.value, "name", s.trim()), v.hide());
24
+ }, W = (s) => {
25
+ const e = d[s];
26
+ e && (f.value = e.name, i.value = s, w.show());
27
27
  }, A = async () => {
28
- var n;
28
+ var s;
29
29
  if (!y.value) {
30
- const e = ((n = f.value) == null ? void 0 : n.uid) === i.value, l = { ...d };
30
+ const e = ((s = m.value) == null ? void 0 : s.uid) === i.value, l = { ...d };
31
31
  if (delete l[i.value], b.delete(i.value), e) {
32
- const r = Object.keys(l)[0];
32
+ const k = Object.keys(l)[0];
33
33
  await _({
34
34
  name: "workspace",
35
35
  params: {
36
- workspace: r
36
+ workspace: k
37
37
  }
38
38
  });
39
39
  }
40
40
  }
41
- k.hide();
41
+ w.hide();
42
42
  };
43
- return (n, e) => (p(), z("div", null, [
43
+ return (s, e) => (c(), z("div", null, [
44
44
  a("div", K, [
45
- s(t($), null, {
45
+ n(t($), null, {
46
46
  items: o(() => [
47
- (p(!0), z(I, null, U(t(d), (l, r) => (p(), g(t(u), {
48
- key: r,
49
- class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
50
- onClick: c((x) => j(r), ["stop"])
47
+ (c(!0), z(I, null, U(t(d), (l, k) => (c(), g(t(u), {
48
+ key: k,
49
+ class: "group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
50
+ onClick: r((x) => j(l.uid), ["stop"])
51
51
  }, {
52
52
  default: o(() => {
53
53
  var x;
54
54
  return [
55
- s(t(P), {
56
- selected: ((x = t(f)) == null ? void 0 : x.uid) === r
55
+ n(t(V), {
56
+ selected: ((x = t(m)) == null ? void 0 : x.uid) === k
57
57
  }, null, 8, ["selected"]),
58
58
  a("span", Z, C(l.name), 1),
59
- s(t($), {
59
+ n(t($), {
60
60
  placement: "right-start",
61
61
  teleport: ""
62
62
  }, {
63
63
  items: o(() => [
64
- s(t(u), {
64
+ n(t(u), {
65
65
  class: "flex gap-2",
66
- onMousedown: (h) => M(r),
67
- onTouchend: c((h) => M(r), ["prevent"])
66
+ onMousedown: (h) => M(l.uid),
67
+ onTouchend: r((h) => M(l.uid), ["prevent"])
68
68
  }, {
69
69
  default: o(() => [
70
- s(t(m), {
70
+ n(t(p), {
71
71
  class: "inline-flex",
72
72
  icon: "Edit",
73
73
  size: "md",
@@ -77,22 +77,22 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
77
77
  ]),
78
78
  _: 2
79
79
  }, 1032, ["onMousedown", "onTouchend"]),
80
- y.value ? (p(), g(t(Y), {
80
+ y.value ? (c(), g(t(q), {
81
81
  key: 0,
82
82
  class: "z-overlay",
83
83
  side: "bottom"
84
84
  }, {
85
85
  trigger: o(() => [
86
- s(t(u), {
87
- class: "flex gap-2 w-full",
86
+ n(t(u), {
87
+ class: "flex w-full gap-2",
88
88
  disabled: "",
89
- onMousedown: e[0] || (e[0] = c(() => {
89
+ onMousedown: e[0] || (e[0] = r(() => {
90
90
  }, ["prevent"])),
91
- onTouchend: e[1] || (e[1] = c(() => {
91
+ onTouchend: e[1] || (e[1] = r(() => {
92
92
  }, ["prevent"]))
93
93
  }, {
94
94
  default: o(() => [
95
- s(t(m), {
95
+ n(t(p), {
96
96
  class: "inline-flex",
97
97
  icon: "Delete",
98
98
  size: "md",
@@ -104,21 +104,21 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
104
104
  })
105
105
  ]),
106
106
  content: o(() => e[6] || (e[6] = [
107
- a("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-context p-2 text-xxs leading-5 z-10 text-c-1" }, [
108
- a("div", { class: "flex items-center text-c-2" }, [
107
+ a("div", { class: "w-content bg-b-1 text-xxs text-c-1 pointer-events-none z-10 grid min-w-48 gap-1.5 rounded p-2 leading-5 shadow-lg" }, [
108
+ a("div", { class: "text-c-2 flex items-center" }, [
109
109
  a("span", null, "Only workspace cannot be deleted.")
110
110
  ])
111
111
  ], -1)
112
112
  ])),
113
113
  _: 1
114
- })) : (p(), g(t(u), {
114
+ })) : (c(), g(t(u), {
115
115
  key: 1,
116
116
  class: "flex !gap-2",
117
- onMousedown: c((h) => W(r), ["prevent"]),
118
- onTouchend: c((h) => W(r), ["prevent"])
117
+ onMousedown: r((h) => W(l.uid), ["prevent"]),
118
+ onTouchend: r((h) => W(l.uid), ["prevent"])
119
119
  }, {
120
120
  default: o(() => [
121
- s(t(m), {
121
+ n(t(p), {
122
122
  class: "inline-flex",
123
123
  icon: "Delete",
124
124
  size: "sm",
@@ -130,14 +130,14 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
130
130
  }, 1032, ["onMousedown", "onTouchend"]))
131
131
  ]),
132
132
  default: o(() => [
133
- s(t(E), {
134
- class: "px-0.5 py-0 hover:bg-b-3 group-hover/item:flex aspect-square ml-auto -mr-1 h-fit",
133
+ n(t(E), {
134
+ class: "hover:bg-b-3 -mr-1 ml-auto aspect-square h-fit px-0.5 py-0 group-hover/item:flex",
135
135
  size: "sm",
136
136
  type: "button",
137
137
  variant: "ghost"
138
138
  }, {
139
139
  default: o(() => [
140
- s(t(m), {
140
+ n(t(p), {
141
141
  icon: "Ellipses",
142
142
  size: "sm"
143
143
  })
@@ -151,14 +151,14 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
151
151
  }),
152
152
  _: 2
153
153
  }, 1032, ["onClick"]))), 128)),
154
- s(t(G)),
155
- s(t(u), {
154
+ n(t(F)),
155
+ n(t(u), {
156
156
  class: "flex items-center gap-1.5",
157
157
  onClick: B
158
158
  }, {
159
159
  default: o(() => [
160
160
  a("div", ee, [
161
- s(t(m), {
161
+ n(t(p), {
162
162
  icon: "Add",
163
163
  size: "sm"
164
164
  })
@@ -169,8 +169,8 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
169
169
  })
170
170
  ]),
171
171
  default: o(() => [
172
- s(t(E), {
173
- class: "font-normal h-full justify-start line-clamp-1 py-1.5 px-1.5 text-c-1 hover:bg-b-2 w-fit",
172
+ n(t(E), {
173
+ class: "text-c-1 hover:bg-b-2 line-clamp-1 h-full w-fit justify-start px-1.5 py-1.5 font-normal",
174
174
  fullWidth: "",
175
175
  variant: "ghost"
176
176
  }, {
@@ -178,7 +178,7 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
178
178
  var l;
179
179
  return [
180
180
  a("div", Q, [
181
- a("h2", X, C((l = t(f)) == null ? void 0 : l.name), 1)
181
+ a("h2", X, C((l = t(m)) == null ? void 0 : l.name), 1)
182
182
  ])
183
183
  ];
184
184
  }),
@@ -188,30 +188,30 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
188
188
  _: 1
189
189
  })
190
190
  ]),
191
- s(t(N), {
191
+ n(t(N), {
192
192
  size: "xxs",
193
- state: t(k),
193
+ state: t(w),
194
194
  title: "Delete workspace"
195
195
  }, {
196
196
  default: o(() => [
197
- s(V, {
198
- variableName: v.value,
197
+ n(Y, {
198
+ variableName: f.value,
199
199
  warningMessage: "This cannot be undone. You’re about to delete the workspace and everything inside it.",
200
- onClose: e[2] || (e[2] = (l) => t(k).hide()),
200
+ onClose: e[2] || (e[2] = (l) => t(w).hide()),
201
201
  onDelete: A
202
202
  }, null, 8, ["variableName"])
203
203
  ]),
204
204
  _: 1
205
205
  }, 8, ["state"]),
206
- s(t(N), {
206
+ n(t(N), {
207
207
  size: "xxs",
208
- state: t(w),
208
+ state: t(v),
209
209
  title: "Rename Workspace"
210
210
  }, {
211
211
  default: o(() => [
212
- s(q, {
213
- name: v.value,
214
- onClose: e[3] || (e[3] = (l) => t(w).hide()),
212
+ n(G, {
213
+ name: f.value,
214
+ onClose: e[3] || (e[3] = (l) => t(v).hide()),
215
215
  onEdit: R
216
216
  }, null, 8, ["name"])
217
217
  ]),
@@ -221,5 +221,5 @@ const K = { class: "flex items-center text-sm w-[inherit]" }, Q = { class: "font
221
221
  }
222
222
  });
223
223
  export {
224
- ce as default
224
+ de as default
225
225
  };
@@ -1 +1 @@
1
- {"version":3,"file":"new-auth-options.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/consts/new-auth-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAG5E,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,oBAAoB,EAAE,CAAA;CAChC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFhB,CAAA;AAIV,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,EAAE,oBAAoB,EAOlD,CAAA"}
1
+ {"version":3,"file":"new-auth-options.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/consts/new-auth-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAG5F,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,oBAAoB,EAAE,CAAA;CAChC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFhB,CAAA;AAIV,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,EAAE,oBAAoB,EAOlD,CAAA"}
@@ -2,7 +2,7 @@ import type { WorkspaceStore } from '../../store';
2
2
  import type { ActiveEntitiesStore } from '../../store/active-entities';
3
3
  import type { DraggingItem, HoveredItem } from '@scalar/draggable';
4
4
  /** Create DnD handlers */
5
- export declare function dragHandlerFactory(activeWorkspace: ActiveEntitiesStore['activeWorkspace'], { collections, collectionMutators, tags, tagMutators, workspaceMutators, }: WorkspaceStore): {
5
+ export declare function dragHandlerFactory(activeWorkspace: ActiveEntitiesStore['activeWorkspace'], { collections, collectionMutators, tags, tagMutators, workspaceMutators }: WorkspaceStore): {
6
6
  handleDragEnd: (draggingItem: DraggingItem, hoveredItem: HoveredItem) => void;
7
7
  isDroppable: (draggingItem: DraggingItem, hoveredItem: HoveredItem) => boolean;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"handle-drag.d.ts","sourceRoot":"","sources":["../../../src/views/Request/handle-drag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAElE,0BAA0B;AAC1B,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,EACvD,EACE,WAAW,EACX,kBAAkB,EAClB,IAAI,EACJ,WAAW,EACX,iBAAiB,GAClB,EAAE,cAAc;kCAWoB,YAAY,eAAe,WAAW;gCAwE3D,YAAY,eACb,WAAW;EAoB3B"}
1
+ {"version":3,"file":"handle-drag.d.ts","sourceRoot":"","sources":["../../../src/views/Request/handle-drag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAGlE,0BAA0B;AAC1B,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,EACvD,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,EAAE,cAAc;kCAcpD,YAAY,eAAe,WAAW;gCA2DxC,YAAY,eAAe,WAAW;EAe1E"}
@@ -1,61 +1,44 @@
1
- import { useLayout as w } from "../../hooks/useLayout.js";
2
- function H(u, {
3
- collections: r,
4
- collectionMutators: a,
5
- tags: l,
6
- tagMutators: x,
7
- workspaceMutators: U
8
- }) {
9
- const { layout: b } = w();
10
- function p(i, f) {
11
- r[i] ? a.edit(i, "children", f) : l[i] && x.edit(i, "children", f);
12
- }
13
- function I(i, f) {
14
- var D, v, y, C;
15
- if (!i || !f) return;
16
- const { id: d, parentId: n } = i, { id: t, parentId: s, offset: h } = f;
17
- if (n ? r[n] ? a.edit(
18
- n,
19
- "children",
20
- r[n].children.filter(
21
- (e) => e !== d
22
- )
23
- ) : l[n] && x.edit(
24
- n,
25
- "children",
26
- l[n].children.filter((e) => e !== d)
27
- ) : U.edit(
28
- ((D = u.value) == null ? void 0 : D.uid) ?? "",
29
- "collections",
30
- ((v = u.value) == null ? void 0 : v.collections.filter(
31
- (e) => e !== d
32
- )) ?? []
33
- ), h === 2) {
34
- const e = r[t] || l[t];
35
- p(t, [
36
- ...(e == null ? void 0 : e.children) ?? [],
37
- d
38
- ]);
39
- } else if (s) {
40
- const e = r[s] || l[s], o = [...(e == null ? void 0 : e.children) ?? []], c = o.findIndex((P) => t === P) ?? 0;
41
- o.splice(c + h, 0, d), p(s, o);
42
- } else {
43
- const e = [...((y = u.value) == null ? void 0 : y.collections) ?? []], o = e.findIndex((c) => t === c) ?? 0;
44
- e.splice(o + h, 0, d), U.edit(
45
- ((C = u.value) == null ? void 0 : C.uid) ?? "",
46
- "collections",
47
- e
48
- );
49
- }
50
- }
1
+ import { useLayout as I } from "../../hooks/useLayout.js";
2
+ function F(f, { collections: l, collectionMutators: a, tags: o, tagMutators: p, workspaceMutators: x }) {
3
+ const { layout: b } = I(), y = (i, r) => {
4
+ i.type === "collection" ? a.edit(i.uid, "children", r) : i.type === "tag" && p.edit(i.uid, "children", r);
5
+ };
51
6
  return {
52
- handleDragEnd: I,
53
- isDroppable: (i, f) => {
54
- var d, n;
55
- return !(b === "modal" || !r[i.id] && f.offset !== 2 || r[i.id] && ((n = (d = r[f.id]) == null ? void 0 : d.info) == null ? void 0 : n.title) === "Drafts");
7
+ handleDragEnd: (i, r) => {
8
+ var D, U, v, C;
9
+ if (!i || !r) return;
10
+ const { id: n, parentId: d } = i, { id: u, parentId: s, offset: c } = r;
11
+ if (d ? l[d] ? a.edit(
12
+ d,
13
+ "children",
14
+ l[d].children.filter((e) => e !== n)
15
+ ) : o[d] && p.edit(
16
+ d,
17
+ "children",
18
+ o[d].children.filter((e) => e !== n)
19
+ ) : x.edit(
20
+ (D = f.value) == null ? void 0 : D.uid,
21
+ "collections",
22
+ ((U = f.value) == null ? void 0 : U.collections.filter((e) => e !== n)) ?? []
23
+ ), c === 2) {
24
+ const e = l[u] || o[u];
25
+ e && y(e, [...e.children ?? [], n]);
26
+ } else if (s) {
27
+ const e = l[s] || o[s];
28
+ if (!e) return;
29
+ const t = [...e.children ?? []], h = t.findIndex((E) => u === E) ?? 0;
30
+ t.splice(h + c, 0, n), y(e, t);
31
+ } else {
32
+ const e = [...((v = f.value) == null ? void 0 : v.collections) ?? []], t = e.findIndex((h) => u === h) ?? 0;
33
+ e.splice(t + c, 0, n), x.edit((C = f.value) == null ? void 0 : C.uid, "collections", e);
34
+ }
35
+ },
36
+ isDroppable: (i, r) => {
37
+ var n, d;
38
+ return !(b === "modal" || !l[i.id] && r.offset !== 2 || l[i.id] && ((d = (n = l[r.id]) == null ? void 0 : n.info) == null ? void 0 : d.title) === "Drafts");
56
39
  }
57
40
  };
58
41
  }
59
42
  export {
60
- H as dragHandlerFactory
43
+ F as dragHandlerFactory
61
44
  };
@@ -7,12 +7,12 @@ type DisplayScheme = {
7
7
  };
8
8
  /** Format a scheme object into a display object */
9
9
  export declare const formatScheme: (s: DisplayScheme) => {
10
- id: string;
10
+ id: string & import("zod").BRAND<"securityScheme">;
11
11
  label: string;
12
12
  };
13
13
  /** Formats complex security schemes */
14
14
  export declare const formatComplexScheme: (uids: string[], securitySchemes: Record<string, DisplayScheme>) => {
15
- id: string;
15
+ id: string & import("zod").BRAND<"securityScheme">;
16
16
  label: string;
17
17
  };
18
18
  /** Compute what the security requirements should be for a request */
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACf,MAAM,iCAAiC,CAAA;AAGxC,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACxC,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;IAClC,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,CAAA;CAC3B,CAAA;AAED,mDAAmD;AACnD,eAAO,MAAM,YAAY,MAAO,aAAa;;;CAG3C,CAAA;AAEF,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,SACxB,MAAM,EAAE,mBACG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;;;CAc7C,CAAA;AAEH,qEAAqE;AACrE,eAAO,MAAM,uBAAuB,eACtB,SAAS,eACR,UAAU,+BAiBxB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,yBACL,UAAU,CAAC,UAAU,CAAC,wBACtB,UAAU,CAAC,iBAAiB,CAAC,mBAClC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,eAClC,OAAO,KAClB,oBAAoB,EAAE,GAAG,mBAAmB,EAyD9C,CAAA"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC9G,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAG5F,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACxC,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;IAClC,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,CAAA;CAC3B,CAAA;AAED,mDAAmD;AACnD,eAAO,MAAM,YAAY,MAAO,aAAa;;;CAG3C,CAAA;AAEF,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,SAAU,MAAM,EAAE,mBAAmB,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;;;CAa/F,CAAA;AAEH,qEAAqE;AACrE,eAAO,MAAM,uBAAuB,eAAgB,SAAS,eAAe,UAAU,+BASrF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,yBACL,UAAU,CAAC,UAAU,CAAC,wBACtB,UAAU,CAAC,iBAAiB,CAAC,mBAClC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,eAClC,OAAO,KAClB,oBAAoB,EAAE,GAAG,mBAAmB,EAsD9C,CAAA"}
@@ -1,50 +1,49 @@
1
1
  import { isDefined as p } from "@scalar/oas-utils/helpers";
2
2
  import { ADD_AUTH_OPTIONS as O } from "../consts/new-auth-options.js";
3
- const y = (t) => ({
3
+ const d = (t) => ({
4
4
  id: t.uid,
5
5
  label: t.type === "openIdConnect" ? `${t.nameKey} (coming soon)` : t.nameKey
6
- }), b = (t, e) => y(
6
+ }), b = (t, e) => d(
7
7
  t.reduce(
8
- (s, a, i) => {
8
+ (r, a, i) => {
9
9
  const m = e[a];
10
- return m && (s.nameKey += `${i > 0 ? " & " : ""}${m.nameKey}`, s.uid += `${i > 0 ? "," : ""}${m.uid}`), s;
10
+ return m && (r.nameKey += `${i > 0 ? " & " : ""}${m.nameKey}`, r.uid = `${r.uid}${i > 0 ? "," : ""}${m.uid}`), r;
11
11
  },
12
12
  { type: "complex", nameKey: "", uid: "" }
13
13
  )
14
14
  ), A = (t, e) => {
15
- var s;
16
- return JSON.stringify(t == null ? void 0 : t.security) === "[{}]" && ((s = e == null ? void 0 : e.security) != null && s.length) ? !!(e != null && e.security.find((i) => JSON.stringify(i) === "{}")) ? e.security : [...e.security, {}] : (t == null ? void 0 : t.security) ?? (e == null ? void 0 : e.security) ?? [];
17
- }, D = (t, e, s, a = !1) => {
15
+ var r;
16
+ return JSON.stringify(t == null ? void 0 : t.security) === "[{}]" && ((r = e == null ? void 0 : e.security) != null && r.length) ? !!(e != null && e.security.find((i) => JSON.stringify(i) === "{}")) ? e.security : [...e.security, {}] : (t == null ? void 0 : t.security) ?? (e == null ? void 0 : e.security) ?? [];
17
+ }, D = (t, e, r, a = !1) => {
18
18
  {
19
19
  const i = e.reduce(
20
- (n, r) => {
21
- const u = s[r];
20
+ (n, s) => {
21
+ const u = r[s];
22
22
  return u && (n[u.nameKey] = u), n;
23
23
  },
24
24
  {}
25
- ), m = t.flatMap(
26
- (n) => {
27
- const r = Object.keys(n);
28
- if (r.length > 1) {
29
- const u = r.map((g) => {
30
- var h;
31
- return (h = i[g]) == null ? void 0 : h.uid;
32
- }).filter(p);
33
- return b(u, s);
34
- } else if (r[0]) {
35
- const u = i[r[0]];
36
- if (u) return y(u);
37
- }
38
- return [];
25
+ ), m = t.flatMap((n) => {
26
+ const s = Object.keys(n);
27
+ if (s.length > 1) {
28
+ const u = s.map((g) => {
29
+ var h;
30
+ return (h = i[g]) == null ? void 0 : h.uid;
31
+ }).filter(p);
32
+ return b(u, r);
39
33
  }
40
- ), d = e.filter((n) => !m.some((r) => r.id === n)).map((n) => {
41
- const r = s[n];
42
- return r ? y(r) : null;
34
+ if (s[0]) {
35
+ const u = i[s[0]];
36
+ if (u) return d(u);
37
+ }
38
+ return [];
39
+ }), y = e.filter((n) => !m.some((s) => s.id === n)).map((n) => {
40
+ const s = r[n];
41
+ return s ? d(s) : null;
43
42
  }).filter(p), f = [
44
43
  { label: "Required authentication", options: m },
45
- { label: "Available authentication", options: d }
44
+ { label: "Available authentication", options: y }
46
45
  ];
47
- return a ? m.length ? f : d : (f.push({
46
+ return a ? m.length ? f : y : (f.push({
48
47
  label: "Add new authentication",
49
48
  options: O
50
49
  }), f);
@@ -52,7 +51,7 @@ const y = (t) => ({
52
51
  };
53
52
  export {
54
53
  b as formatComplexScheme,
55
- y as formatScheme,
54
+ d as formatScheme,
56
55
  D as getSchemeOptions,
57
56
  A as getSecurityRequirements
58
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAGzE,qDAAqD;AACrD,KAAK,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAA;AAEhE,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAmBD;;GAEG;AACH,eAAO,MAAM,qBAAqB,aACtB,MAAM,YACN,SAAS,GAAG,OAAO,KAC5B,OAAO,CAAC,MAAM,CAahB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,SACpB,UAAU,gBAEF,MAAM,aAET,MAAM,KAChB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAuJ/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SACrB,eAAe,UACb,MAAM,8BAKX;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,KACA,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAoE/B,CAAA"}
1
+ {"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAGzE,qDAAqD;AACrD,KAAK,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAA;AAEhE,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAmBD;;GAEG;AACH,eAAO,MAAM,qBAAqB,aAAoB,MAAM,YAAY,SAAS,GAAG,OAAO,KAAG,OAAO,CAAC,MAAM,CAa3G,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,SACpB,UAAU,gBAEF,MAAM,aAET,MAAM,KAChB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAoI/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SACrB,eAAe,UACb,MAAM,8BAKX;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,KACA,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CA4D/B,CAAA"}
@@ -14,65 +14,47 @@ const y = () => {
14
14
  return _(e, a, {
15
15
  proxyUrl: o
16
16
  });
17
- {
18
- const s = (Math.random() + 1).toString(36).substring(2, 10), t = new URL(e.authorizationUrl);
19
- let l = null;
20
- if (e.type === "implicit")
21
- t.searchParams.set("response_type", "token");
22
- else if (e.type === "authorizationCode" && (t.searchParams.set("response_type", "code"), e["x-usePkce"] !== "no")) {
23
- const r = y(), c = await P(
24
- r,
25
- e["x-usePkce"]
26
- );
27
- l = {
28
- codeVerifier: r,
29
- codeChallenge: c,
30
- codeChallengeMethod: e["x-usePkce"] === "SHA-256" ? "S256" : "plain"
31
- }, t.searchParams.set("code_challenge", c), t.searchParams.set(
32
- "code_challenge_method",
33
- l.codeChallengeMethod
34
- );
35
- }
36
- if (e["x-scalar-redirect-uri"].startsWith("/")) {
37
- const r = i.url || window.location.origin + window.location.pathname, c = new URL(
38
- e["x-scalar-redirect-uri"],
39
- r
40
- ).toString();
41
- t.searchParams.set("redirect_uri", c);
42
- } else
43
- t.searchParams.set("redirect_uri", e["x-scalar-redirect-uri"]);
44
- t.searchParams.set("client_id", e["x-scalar-client-id"]), t.searchParams.set("state", s), a && t.searchParams.set("scope", a);
45
- const n = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
46
- return n ? new Promise((r) => {
47
- const c = setInterval(() => {
48
- var m;
49
- let u = null, h = null;
50
- try {
51
- const d = new URL(n.location.href).searchParams;
52
- u = d.get("access_token"), h = d.get("code");
53
- const g = new URLSearchParams(
54
- n.location.href.split("#")[1]
55
- );
56
- u || (u = g.get("access_token")), h || (h = g.get("code"));
57
- } catch {
58
- }
59
- if (n.closed || u || h)
60
- if (clearInterval(c), n.close(), u) {
61
- const d = (m = n.location.href.match(/state=([^&]*)/)) == null ? void 0 : m[1];
62
- r(d === s ? [null, u] : [new Error("State mismatch"), null]);
63
- } else h ? new URL(
64
- n.location.href
65
- ).searchParams.get("state") === s ? _(e, a, {
66
- code: h,
67
- pkce: l,
68
- proxyUrl: o
69
- }).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(c), r([
70
- new Error("Window was closed without granting authorization"),
71
- null
72
- ]));
73
- }, 200);
74
- }) : [new Error("Failed to open auth window"), null];
17
+ const s = (Math.random() + 1).toString(36).substring(2, 10), t = new URL(e.authorizationUrl);
18
+ let l = null;
19
+ if (e.type === "implicit")
20
+ t.searchParams.set("response_type", "token");
21
+ else if (e.type === "authorizationCode" && (t.searchParams.set("response_type", "code"), e["x-usePkce"] !== "no")) {
22
+ const r = y(), c = await P(r, e["x-usePkce"]);
23
+ l = {
24
+ codeVerifier: r,
25
+ codeChallenge: c,
26
+ codeChallengeMethod: e["x-usePkce"] === "SHA-256" ? "S256" : "plain"
27
+ }, t.searchParams.set("code_challenge", c), t.searchParams.set("code_challenge_method", l.codeChallengeMethod);
75
28
  }
29
+ if (e["x-scalar-redirect-uri"].startsWith("/")) {
30
+ const r = i.url || window.location.origin + window.location.pathname, c = new URL(e["x-scalar-redirect-uri"], r).toString();
31
+ t.searchParams.set("redirect_uri", c);
32
+ } else
33
+ t.searchParams.set("redirect_uri", e["x-scalar-redirect-uri"]);
34
+ t.searchParams.set("client_id", e["x-scalar-client-id"]), t.searchParams.set("state", s), a && t.searchParams.set("scope", a);
35
+ const n = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
36
+ return n ? new Promise((r) => {
37
+ const c = setInterval(() => {
38
+ var m;
39
+ let u = null, h = null;
40
+ try {
41
+ const d = new URL(n.location.href).searchParams;
42
+ u = d.get("access_token"), h = d.get("code");
43
+ const g = new URLSearchParams(n.location.href.split("#")[1]);
44
+ u || (u = g.get("access_token")), h || (h = g.get("code"));
45
+ } catch {
46
+ }
47
+ if (n.closed || u || h)
48
+ if (clearInterval(c), n.close(), u) {
49
+ const d = (m = n.location.href.match(/state=([^&]*)/)) == null ? void 0 : m[1];
50
+ r(d === s ? [null, u] : [new Error("State mismatch"), null]);
51
+ } else h ? new URL(n.location.href).searchParams.get("state") === s ? _(e, a, {
52
+ code: h,
53
+ pkce: l,
54
+ proxyUrl: o
55
+ }).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(c), r([new Error("Window was closed without granting authorization"), null]));
56
+ }, 200);
57
+ }) : [new Error("Failed to open auth window"), null];
76
58
  } catch {
77
59
  return [new Error("Failed to authorize oauth2 flow"), null];
78
60
  }
@@ -83,7 +65,7 @@ const y = () => {
83
65
  } = {}) => {
84
66
  if (!e) return [new Error("OAuth2 flow was not defined"), null];
85
67
  const t = new URLSearchParams();
86
- t.set("client_id", e["x-scalar-client-id"]), i && (e.type == "clientCredentials" || e.type === "password") && t.set("scope", i), e.clientSecret && t.set("client_secret", e.clientSecret), "x-scalar-redirect-uri" in e && e["x-scalar-redirect-uri"] && t.set("redirect_uri", e["x-scalar-redirect-uri"]), o ? (t.set("code", o), t.set("grant_type", "authorization_code"), a && t.set("code_verifier", a.codeVerifier)) : e.type === "password" ? (t.set("grant_type", "password"), t.set("username", e.username), t.set("password", e.password)) : t.set("grant_type", "client_credentials");
68
+ t.set("client_id", e["x-scalar-client-id"]), i && (e.type === "clientCredentials" || e.type === "password") && t.set("scope", i), e.clientSecret && t.set("client_secret", e.clientSecret), "x-scalar-redirect-uri" in e && e["x-scalar-redirect-uri"] && t.set("redirect_uri", e["x-scalar-redirect-uri"]), o ? (t.set("code", o), t.set("grant_type", "authorization_code"), a && t.set("code_verifier", a.codeVerifier)) : e.type === "password" ? (t.set("grant_type", "password"), t.set("username", e.username), t.set("password", e.password)) : t.set("grant_type", "client_credentials");
87
69
  try {
88
70
  const l = {
89
71
  "Content-Type": "application/x-www-form-urlencoded"
@@ -96,12 +78,7 @@ const y = () => {
96
78
  }), { access_token: r } = await n.json();
97
79
  return [null, r];
98
80
  } catch {
99
- return [
100
- new Error(
101
- "Failed to get an access token. Please check your credentials."
102
- ),
103
- null
104
- ];
81
+ return [new Error("Failed to get an access token. Please check your credentials."), null];
105
82
  }
106
83
  };
107
84
  export {