@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,22 +1,22 @@
1
- import { defineComponent as re, useCssVars as ue, computed as v, ref as de, resolveComponent as ce, createElementBlock as C, createCommentVNode as c, openBlock as u, normalizeClass as g, unref as l, createVNode as m, withCtx as p, createBlock as f, withModifiers as h, createElementVNode as o, toDisplayString as j, createTextVNode as B, renderSlot as L, Fragment as fe, renderList as me, nextTick as pe } from "vue";
2
- import { ScalarButton as k, ScalarIcon as b, ScalarSidebarGroupToggle as G, ScalarTooltip as K } from "@scalar/components";
1
+ import { defineComponent as re, useCssVars as ue, computed as v, ref as de, resolveComponent as ce, createElementBlock as I, createCommentVNode as c, openBlock as u, normalizeClass as g, unref as l, createVNode as m, withCtx as p, createBlock as f, withModifiers as y, createElementVNode as o, toDisplayString as B, createTextVNode as W, renderSlot as L, Fragment as fe, renderList as me, nextTick as pe } from "vue";
2
+ import { ScalarButton as k, ScalarIcon as b, ScalarTooltip as G, ScalarSidebarGroupToggle as K } from "@scalar/components";
3
3
  import { Draggable as ve } from "@scalar/draggable";
4
4
  import { shouldIgnoreEntity as J } from "@scalar/oas-utils/helpers";
5
5
  import { useRouter as ge, RouterLink as Q } from "vue-router";
6
- import { useLayout as be } from "../../hooks/useLayout.js";
7
- import { useSidebar as ye } from "../../hooks/useSidebar.js";
6
+ import { useLayout as ye } from "../../hooks/useLayout.js";
7
+ import { useSidebar as be } from "../../hooks/useSidebar.js";
8
8
  import { PathId as R } from "../../routes.js";
9
9
  import { useActiveEntities as he } from "../../store/active-entities.js";
10
10
  import { useWorkspace as xe } from "../../store/store.js";
11
11
  import ke from "../../components/HttpMethod/HttpMethod.vue.js";
12
12
  import { getModifiers as we } from "../../libs/hot-keys.js";
13
- const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex flex-row items-center gap-1" }, De = { class: "relative" }, Ie = { class: "flex items-start" }, Ce = { class: "flex flex-1 flex-row justify-between font-medium" }, Re = { class: "line-clamp-1 w-full text-left break-all" }, Te = { class: "relative flex h-fit justify-end" }, Me = {
13
+ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex flex-row items-center gap-1" }, Ce = { class: "relative" }, De = { class: "flex items-start" }, Ie = { class: "flex h-5 max-w-[14px] shrink-0 items-center justify-center" }, Re = { class: "flex flex-1 flex-row justify-between font-medium" }, Te = { class: "line-clamp-1 w-full text-left break-all" }, Me = { class: "relative flex h-fit items-center justify-end gap-0.5" }, $e = {
14
14
  class: "flex items-center justify-center",
15
15
  type: "button"
16
- }, Ee = ["aria-expanded"], $e = { class: "flex h-5 max-w-[14px] items-center justify-center" }, ze = { class: "flex flex-1 flex-row justify-between" }, Se = { class: "line-clamp-1 w-full text-left font-medium break-all" }, je = { class: "relative flex h-fit justify-end" }, Be = {
16
+ }, Ee = ["aria-expanded"], ze = { class: "flex h-5 max-w-[14px] shrink-0 items-center justify-center" }, Se = { class: "flex flex-1 flex-row justify-between" }, je = { class: "line-clamp-1 w-full text-left font-medium break-all" }, Be = { class: "relative flex h-fit items-center justify-end gap-0.5" }, We = {
17
17
  class: "flex items-center justify-center",
18
18
  type: "button"
19
- }, We = { key: 3 }, W = "hover:bg-sidebar-b-active indent-padding-left", Qe = /* @__PURE__ */ re({
19
+ }, Ae = { key: 3 }, A = "hover:bg-sidebar-b-active indent-padding-left", Xe = /* @__PURE__ */ re({
20
20
  __name: "RequestSidebarItem",
21
21
  props: {
22
22
  isDraggable: { type: Boolean, default: !1 },
@@ -28,20 +28,20 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
28
28
  emits: ["onDragEnd", "newTab", "openMenu"],
29
29
  setup(t, { emit: X }) {
30
30
  ue((n) => ({
31
- v0d47e407: te.value,
32
- v19387f52: ie.value
31
+ v337cd30d: te.value,
32
+ v1d572b91: ie.value
33
33
  }));
34
- const Z = X, { activeCollection: _, activeRequest: A, activeRouterParams: ee, activeWorkspace: x } = he(), {
34
+ const Z = X, { activeCollection: _, activeRequest: N, activeRouterParams: ee, activeWorkspace: x } = he(), {
35
35
  collections: q,
36
36
  tags: U,
37
37
  requests: T,
38
38
  requestExamples: M,
39
- collectionMutators: E,
40
- tagMutators: N,
41
- requestMutators: $,
42
- requestExampleMutators: O,
43
- events: P
44
- } = xe(), y = ge(), { collapsedSidebarFolders: w, toggleSidebarFolder: V } = ye(), { layout: d } = be(), i = v(() => {
39
+ collectionMutators: $,
40
+ tagMutators: O,
41
+ requestMutators: E,
42
+ requestExampleMutators: P,
43
+ events: V
44
+ } = xe(), h = ge(), { collapsedSidebarFolders: w, toggleSidebarFolder: z } = be(), { layout: d } = ye(), i = v(() => {
45
45
  const n = q[t.uid], e = U[t.uid], r = T[t.uid], a = M[t.uid];
46
46
  return n ? {
47
47
  title: n.info?.title || "Untitled Collection",
@@ -59,11 +59,11 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
59
59
  }
60
60
  } : void 0,
61
61
  warning: "This cannot be undone. You're about to delete the collection and all folders and requests inside it.",
62
- edit: (s, I) => {
63
- E.edit(n.uid, "info.title", s), I && E.edit(n.uid, "x-scalar-icon", I);
62
+ edit: (s, D) => {
63
+ $.edit(n.uid, "info.title", s), D && $.edit(n.uid, "x-scalar-icon", D);
64
64
  },
65
65
  delete: () => {
66
- x.value && E.delete(n, x.value);
66
+ x.value && $.delete(n, x.value);
67
67
  }
68
68
  } : e ? {
69
69
  title: e.name,
@@ -71,8 +71,8 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
71
71
  resourceTitle: "Tag",
72
72
  children: e.children,
73
73
  warning: "This cannot be undone. You're about to delete the tag and all requests inside it",
74
- edit: (s) => N.edit(e.uid, "name", s),
75
- delete: () => t.parentUids[0] && N.delete(e, t.parentUids[0])
74
+ edit: (s) => O.edit(e.uid, "name", s),
75
+ delete: () => t.parentUids[0] && O.delete(e, t.parentUids[0])
76
76
  } : r ? {
77
77
  title: r.summary ?? r.path,
78
78
  to: {
@@ -87,8 +87,8 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
87
87
  resourceTitle: "Request",
88
88
  warning: "This cannot be undone. You're about to delete the request.",
89
89
  children: r.examples.slice(1),
90
- edit: (s) => $.edit(r.uid, "summary", s),
91
- delete: () => t.parentUids[0] && $.delete(r, t.parentUids[0])
90
+ edit: (s) => E.edit(r.uid, "summary", s),
91
+ delete: () => t.parentUids[0] && E.delete(r, t.parentUids[0])
92
92
  } : a?.requestUid ? {
93
93
  title: a.name,
94
94
  to: {
@@ -104,8 +104,8 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
104
104
  resourceTitle: "Example",
105
105
  warning: "This cannot be undone. You're about to delete the example from the request.",
106
106
  children: [],
107
- edit: (s) => O.edit(a.uid, "name", s),
108
- delete: () => O.delete(a)
107
+ edit: (s) => P.edit(a.uid, "name", s),
108
+ delete: () => P.delete(a)
109
109
  } : {
110
110
  title: "Unknown",
111
111
  entity: {
@@ -117,33 +117,33 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
117
117
  edit: () => null,
118
118
  delete: () => null
119
119
  };
120
- }), D = v(
120
+ }), C = v(
121
121
  () => i.value.entity.type === "collection" && i.value.title === "Drafts"
122
122
  ), te = v(() => t.parentUids.length ? d === "modal" ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "12px"), ie = v(() => t.parentUids.length ? d === "modal" ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "0px"), ne = v(
123
- () => w[t.uid] || A.value?.uid === t.uid && i.value.entity.examples.length > 1
123
+ () => w[t.uid] || N.value?.uid === t.uid && i.value.entity.examples.length > 1
124
124
  ), le = v(
125
- () => typeof y.currentRoute.value.name == "string" && y.currentRoute.value.name.startsWith("request") && ee.value[R.Request] === "default" && A.value?.uid === t.uid
126
- ), z = de(null), F = v(() => {
125
+ () => typeof h.currentRoute.value.name == "string" && h.currentRoute.value.name.startsWith("request") && ee.value[R.Request] === "default" && N.value?.uid === t.uid
126
+ ), S = de(null), F = v(() => {
127
127
  let n = 0.5, e = 0.5;
128
- if (!z.value)
128
+ if (!S.value)
129
129
  return { ceiling: n, floor: e };
130
- const { draggingItem: r } = z.value;
130
+ const { draggingItem: r } = S.value;
131
131
  return !q[r?.id] && i.value.entity.type === "collection" ? (n = 1, e = 0) : i.value.entity.type === "tag" && (n = 0.8, e = 0.2), { ceiling: n, floor: e };
132
132
  }), ae = (n, e) => !(d === "modal" || M[e.id] || q[n.id]), oe = (n, e) => {
133
- n && (we(["default"]).some((s) => n[s]) ? Z("newTab", e.title || "", e.entity.uid) : e.to && y.push(e.to), pe(() => P.focusAddressBar.emit()));
133
+ n && (we(["default"]).some((s) => n[s]) ? Z("newTab", e.title || "", e.entity.uid) : e.to && h.push(e.to), pe(() => V.focusAddressBar.emit()));
134
134
  };
135
- function S(n) {
136
- const e = t.parentUids[0] ? q[t.parentUids[0]]?.uid || "" : n, r = t.parentUids[0] && U[n]?.name ? { tags: [U[n].name] } : {}, a = $.add(
135
+ function j(n) {
136
+ const e = t.parentUids[0] ? q[t.parentUids[0]]?.uid || "" : n, r = t.parentUids[0] && U[n]?.name ? { tags: [U[n].name] } : {}, a = E.add(
137
137
  r,
138
138
  e
139
139
  );
140
- a && (y.push({
140
+ a && (h.push({
141
141
  name: "request",
142
142
  params: {
143
143
  workspace: x.value?.uid,
144
144
  request: a.uid
145
145
  }
146
- }), P.hotKeys.emit({
146
+ }), V.hotKeys.emit({
147
147
  focusAddressBar: new KeyboardEvent("keydown", { key: "l" })
148
148
  }));
149
149
  }
@@ -159,7 +159,7 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
159
159
  });
160
160
  return (n, e) => {
161
161
  const r = ce("RequestSidebarItem", !0);
162
- return se.value ? (u(), C("li", {
162
+ return se.value ? (u(), I("li", {
163
163
  key: 0,
164
164
  class: g(["relative flex flex-row", [
165
165
  l(d) === "modal" && t.parentUids.length > 1 || l(d) !== "modal" && t.parentUids.length ? "before:bg-border indent-border-line-offset mb-[.5px] before:pointer-events-none before:absolute before:top-0 before:left-[calc(.75rem_+_.5px)] before:z-1 before:h-[calc(100%_+_.5px)] before:w-[.5px] last:mb-0 last:before:h-full" : ""
@@ -168,21 +168,21 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
168
168
  m(l(ve), {
169
169
  id: i.value.entity.uid,
170
170
  ref_key: "draggableRef",
171
- ref: z,
171
+ ref: S,
172
172
  ceiling: F.value.ceiling,
173
173
  class: "gap-1/2 flex flex-1 flex-col text-base",
174
174
  floor: F.value.floor,
175
175
  isDraggable: t.isDraggable,
176
176
  isDroppable: t.isDroppable,
177
177
  parentIds: t.parentUids,
178
- onOnDragEnd: e[12] || (e[12] = (...a) => n.$emit("onDragEnd", ...a))
178
+ onOnDragEnd: e[13] || (e[13] = (...a) => n.$emit("onDragEnd", ...a))
179
179
  }, {
180
180
  default: p(() => [
181
181
  (i.value.entity.type === "request" || i.value.entity.type === "requestExample") && i.value.to ? (u(), f(l(Q), {
182
182
  key: 0,
183
183
  class: "group no-underline",
184
184
  to: i.value.to,
185
- onClick: e[1] || (e[1] = h(
185
+ onClick: e[1] || (e[1] = y(
186
186
  (a) => oe(a, i.value),
187
187
  ["prevent"]
188
188
  ))
@@ -190,13 +190,13 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
190
190
  default: p(({ isExactActive: a }) => [
191
191
  o("div", {
192
192
  class: g(["relative flex min-h-8 w-full cursor-pointer flex-row items-start justify-between gap-0.5 rounded py-1.5 pr-2", [
193
- W,
193
+ A,
194
194
  a || le.value ? "bg-sidebar-b-active text-sidebar-c-active font-medium transition-none" : "text-sidebar-c-2"
195
195
  ]])
196
196
  }, [
197
- o("span", qe, j(i.value.title || "Untitled"), 1),
197
+ o("span", qe, B(i.value.title || "Untitled"), 1),
198
198
  o("div", Ue, [
199
- o("div", De, [
199
+ o("div", Ce, [
200
200
  l(d) !== "modal" ? (u(), f(l(k), {
201
201
  key: 0,
202
202
  class: g(["hover:bg-b-3 hidden aspect-square h-fit px-0.5 py-0 opacity-0 group-hover:flex group-hover:opacity-100 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100", {
@@ -205,7 +205,7 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
205
205
  size: "sm",
206
206
  type: "button",
207
207
  variant: "ghost",
208
- onClick: e[0] || (e[0] = h(
208
+ onClick: e[0] || (e[0] = y(
209
209
  (s) => n.$emit("openMenu", {
210
210
  item: i.value,
211
211
  parentUids: t.parentUids,
@@ -224,9 +224,9 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
224
224
  _: 1
225
225
  }, 8, ["class"])) : c("", !0)
226
226
  ]),
227
- o("span", Ie, [
228
- e[13] || (e[13] = B("   ", -1)),
229
- e[14] || (e[14] = o("span", { class: "sr-only" }, "HTTP Method:", -1)),
227
+ o("span", De, [
228
+ e[14] || (e[14] = W("   ", -1)),
229
+ e[15] || (e[15] = o("span", { class: "sr-only" }, "HTTP Method:", -1)),
230
230
  i.value.method ? (u(), f(l(ke), {
231
231
  key: 0,
232
232
  class: "font-bold",
@@ -241,42 +241,34 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
241
241
  key: 1,
242
242
  "aria-expanded": !!l(w)[i.value.entity.uid],
243
243
  class: g(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 no-underline focus-visible:z-10", [
244
- W,
244
+ A,
245
245
  {
246
- "bg-sidebar-b-active text-sidebar-c-active transition-none": typeof l(y).currentRoute.value.name == "string" && l(y).currentRoute.value.name.startsWith("collection") && l(y).currentRoute.value.params[l(R).Collection] === i.value.entity.uid,
246
+ "bg-sidebar-b-active text-sidebar-c-active transition-none": typeof l(h).currentRoute.value.name == "string" && l(h).currentRoute.value.name.startsWith("collection") && l(h).currentRoute.value.params[l(R).Collection] === i.value.entity.uid,
247
247
  "text-c-2": i.value.title === "Untitled Collection"
248
248
  }
249
249
  ]]),
250
250
  to: i.value.to
251
251
  }, {
252
252
  default: p(() => [
253
- o("span", {
254
- class: "flex h-5 max-w-[14px] cursor-pointer items-center justify-center",
255
- onClick: e[2] || (e[2] = h((a) => l(V)(i.value.entity.uid), ["stop", "prevent"]))
256
- }, [
257
- L(n.$slots, "leftIcon", {}, () => [
258
- m(l(G), {
259
- class: "text-c-3 shrink-0",
260
- open: !!l(w)[i.value.entity.uid]
261
- }, null, 8, ["open"])
262
- ], !0),
263
- e[15] || (e[15] = B("   ", -1))
253
+ o("span", Ie, [
254
+ L(n.$slots, "leftIcon", {}, void 0, !0),
255
+ e[16] || (e[16] = W("", -1))
264
256
  ]),
265
- o("div", Ce, [
266
- o("span", Re, j(i.value.title), 1),
267
- o("div", Te, [
257
+ o("div", Re, [
258
+ o("span", Te, B(i.value.title), 1),
259
+ o("div", Me, [
268
260
  o("div", {
269
261
  class: g(["items-center gap-px opacity-0 group-hover:flex group-hover:opacity-100 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100", {
270
262
  flex: t.menuItem.open,
271
263
  hidden: !t.menuItem.open || t.menuItem.item?.entity.uid !== i.value.entity.uid
272
264
  }])
273
265
  }, [
274
- l(d) !== "modal" && !D.value || D.value && H.value ? (u(), f(l(k), {
266
+ l(d) !== "modal" && !C.value || C.value && H.value ? (u(), f(l(k), {
275
267
  key: 0,
276
268
  class: "hover:bg-b-3 hover:text-c-1 aspect-square h-fit px-0.5 py-0 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100",
277
269
  size: "sm",
278
270
  variant: "ghost",
279
- onClick: e[3] || (e[3] = h(
271
+ onClick: e[2] || (e[2] = y(
280
272
  (a) => n.$emit("openMenu", {
281
273
  item: i.value,
282
274
  parentUids: t.parentUids,
@@ -299,7 +291,7 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
299
291
  class: "hover:bg-b-3 hover:text-c-1 aspect-square h-fit px-0.5 py-0 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100",
300
292
  size: "sm",
301
293
  variant: "ghost",
302
- onClick: e[4] || (e[4] = h((a) => S(i.value.entity.uid), ["stop", "prevent"]))
294
+ onClick: e[3] || (e[3] = y((a) => j(i.value.entity.uid), ["stop", "prevent"]))
303
295
  }, {
304
296
  default: p(() => [
305
297
  m(l(b), {
@@ -311,14 +303,14 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
311
303
  _: 1
312
304
  })) : c("", !0)
313
305
  ], 2),
314
- i.value.watchMode ? (u(), f(l(K), {
306
+ i.value.watchMode ? (u(), f(l(G), {
315
307
  key: 0,
316
- placement: "right",
308
+ content: `Watching: ${i.value.documentUrl}`,
317
309
  offset: 12,
318
- content: `Watching: ${i.value.documentUrl}`
310
+ placement: "right"
319
311
  }, {
320
312
  default: p(() => [
321
- o("button", Me, [
313
+ o("button", $e, [
322
314
  m(l(b), {
323
315
  class: g(["ml-0.5 text-sm", Y.value]),
324
316
  icon: "Watch",
@@ -329,42 +321,45 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
329
321
  ]),
330
322
  _: 1
331
323
  }, 8, ["content"])) : c("", !0),
332
- e[16] || (e[16] = o("span", null, " ", -1))
324
+ o("span", {
325
+ class: "flex cursor-pointer items-center justify-center",
326
+ onClick: e[4] || (e[4] = y((a) => l(z)(i.value.entity.uid), ["stop", "prevent"]))
327
+ }, [
328
+ m(l(K), {
329
+ class: "text-c-3 hover:text-c-1 shrink-0",
330
+ open: !!l(w)[i.value.entity.uid]
331
+ }, null, 8, ["open"])
332
+ ])
333
333
  ])
334
334
  ])
335
335
  ]),
336
336
  _: 3
337
- }, 8, ["aria-expanded", "class", "to"])) : l(d) !== "modal" || t.parentUids.length ? (u(), C("button", {
337
+ }, 8, ["aria-expanded", "class", "to"])) : l(d) !== "modal" || t.parentUids.length ? (u(), I("button", {
338
338
  key: 2,
339
339
  "aria-expanded": !!l(w)[i.value.entity.uid],
340
- class: g(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 focus-visible:z-10", [W]]),
340
+ class: g(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 focus-visible:z-10", [A]]),
341
341
  type: "button",
342
- onClick: e[7] || (e[7] = (a) => l(V)(i.value.entity.uid))
342
+ onClick: e[8] || (e[8] = (a) => l(z)(i.value.entity.uid))
343
343
  }, [
344
- o("span", $e, [
345
- L(n.$slots, "leftIcon", {}, () => [
346
- m(l(G), {
347
- class: "text-c-3 hover:text-c-1 shrink-0",
348
- open: !!l(w)[i.value.entity.uid]
349
- }, null, 8, ["open"])
350
- ], !0),
351
- e[17] || (e[17] = B("   ", -1))
344
+ o("span", ze, [
345
+ L(n.$slots, "leftIcon", {}, void 0, !0),
346
+ e[17] || (e[17] = W("   ", -1))
352
347
  ]),
353
- o("div", ze, [
354
- o("span", Se, j(i.value.title), 1),
355
- o("div", je, [
348
+ o("div", Se, [
349
+ o("span", je, B(i.value.title), 1),
350
+ o("div", Be, [
356
351
  o("div", {
357
352
  class: g(["items-center gap-px opacity-0 group-hover:flex group-hover:opacity-100 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100", {
358
353
  flex: t.menuItem.open,
359
354
  hidden: !t.menuItem.open || t.menuItem.item?.entity.uid !== i.value.entity.uid
360
355
  }])
361
356
  }, [
362
- l(d) !== "modal" && !D.value || D.value && H.value ? (u(), f(l(k), {
357
+ l(d) !== "modal" && !C.value || C.value && H.value ? (u(), f(l(k), {
363
358
  key: 0,
364
359
  class: "hover:bg-b-3 hover:text-c-1 aspect-square h-fit px-0.5 py-0 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100",
365
360
  size: "sm",
366
361
  variant: "ghost",
367
- onClick: e[5] || (e[5] = h(
362
+ onClick: e[5] || (e[5] = y(
368
363
  (a) => n.$emit("openMenu", {
369
364
  item: i.value,
370
365
  parentUids: t.parentUids,
@@ -387,7 +382,7 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
387
382
  class: "hover:bg-b-3 hover:text-c-1 aspect-square h-fit px-0.5 py-0 group-focus-visible:opacity-100 group-has-[:focus-visible]:opacity-100",
388
383
  size: "sm",
389
384
  variant: "ghost",
390
- onClick: e[6] || (e[6] = h((a) => S(i.value.entity.uid), ["stop", "prevent"]))
385
+ onClick: e[6] || (e[6] = y((a) => j(i.value.entity.uid), ["stop", "prevent"]))
391
386
  }, {
392
387
  default: p(() => [
393
388
  m(l(b), {
@@ -399,14 +394,14 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
399
394
  _: 1
400
395
  })) : c("", !0)
401
396
  ], 2),
402
- i.value.watchMode ? (u(), f(l(K), {
397
+ i.value.watchMode ? (u(), f(l(G), {
403
398
  key: 0,
404
399
  content: "Watching: {{ item.documentUrl }}",
405
- placement: "right",
406
- offset: 12
400
+ offset: 12,
401
+ placement: "right"
407
402
  }, {
408
403
  default: p(() => [
409
- o("button", Be, [
404
+ o("button", We, [
410
405
  m(l(b), {
411
406
  class: g(["ml-0.5 text-sm", Y.value]),
412
407
  icon: "Watch",
@@ -417,34 +412,42 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
417
412
  ]),
418
413
  _: 1
419
414
  })) : c("", !0),
420
- e[18] || (e[18] = o("span", null, " ", -1))
415
+ o("span", {
416
+ class: "flex cursor-pointer items-center justify-center",
417
+ onClick: e[7] || (e[7] = y((a) => l(z)(i.value.entity.uid), ["stop", "prevent"]))
418
+ }, [
419
+ m(l(K), {
420
+ class: "text-c-3 hover:text-c-1 shrink-0",
421
+ open: !!l(w)[i.value.entity.uid]
422
+ }, null, 8, ["open"])
423
+ ])
421
424
  ])
422
425
  ])
423
426
  ], 10, Ee)) : c("", !0),
424
- ne.value ? (u(), C("ul", We, [
425
- (u(!0), C(fe, null, me(i.value.children, (a) => (u(), f(r, {
427
+ ne.value ? (u(), I("ul", Ae, [
428
+ (u(!0), I(fe, null, me(i.value.children, (a) => (u(), f(r, {
426
429
  key: a,
427
430
  isDraggable: !l(M)[a],
428
431
  isDroppable: ae,
429
432
  menuItem: t.menuItem,
430
433
  parentUids: [...t.parentUids, t.uid],
431
434
  uid: a,
432
- onNewTab: e[8] || (e[8] = (s, I) => n.$emit("newTab", s, I)),
433
- onOnDragEnd: e[9] || (e[9] = (...s) => n.$emit("onDragEnd", ...s)),
434
- onOpenMenu: e[10] || (e[10] = (s) => n.$emit("openMenu", s))
435
+ onNewTab: e[9] || (e[9] = (s, D) => n.$emit("newTab", s, D)),
436
+ onOnDragEnd: e[10] || (e[10] = (...s) => n.$emit("onDragEnd", ...s)),
437
+ onOpenMenu: e[11] || (e[11] = (s) => n.$emit("openMenu", s))
435
438
  }, null, 8, ["isDraggable", "menuItem", "parentUids", "uid"]))), 128)),
436
439
  i.value.children.length === 0 ? (u(), f(l(k), {
437
440
  key: 0,
438
441
  class: g(["text-c-1 hover:bg-b-2 flex h-8 w-full justify-start gap-1.5 py-0 text-xs", t.parentUids.length ? "pl-9" : ""]),
439
442
  variant: "ghost",
440
- onClick: e[11] || (e[11] = (a) => S(i.value.entity.uid))
443
+ onClick: e[12] || (e[12] = (a) => j(i.value.entity.uid))
441
444
  }, {
442
445
  default: p(() => [
443
446
  m(l(b), {
444
447
  icon: "Add",
445
448
  size: "sm"
446
449
  }),
447
- e[19] || (e[19] = o("span", null, "Add Request", -1))
450
+ e[18] || (e[18] = o("span", null, "Add Request", -1))
448
451
  ]),
449
452
  _: 1
450
453
  }, 8, ["class"])) : c("", !0)
@@ -457,5 +460,5 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
457
460
  }
458
461
  });
459
462
  export {
460
- Qe as default
463
+ Xe as default
461
464
  };
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
33
33
  }));
34
34
  }, f = (u) => {
35
35
  u?.createNew && g.name === "request" && p();
36
- }, v = "2.26.1";
36
+ }, v = "2.27.1";
37
37
  return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (u, e) => (l(), n("div", W, [
38
38
  s("div", {
39
39
  class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.26.1",
21
+ "version": "2.27.1",
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
@@ -309,6 +309,7 @@
309
309
  "dependencies": {
310
310
  "@headlessui/tailwindcss": "^0.2.2",
311
311
  "@headlessui/vue": "1.7.23",
312
+ "@scalar/typebox": "^0.1.3",
312
313
  "@types/har-format": "^1.2.15",
313
314
  "@vueuse/core": "13.9.0",
314
315
  "@vueuse/integrations": "13.9.0",
@@ -326,26 +327,26 @@
326
327
  "whatwg-mimetype": "4.0.0",
327
328
  "yaml": "^2.8.0",
328
329
  "zod": "^4.3.5",
329
- "@scalar/helpers": "0.2.11",
330
- "@scalar/draggable": "0.3.0",
331
330
  "@scalar/analytics-client": "1.0.1",
332
- "@scalar/components": "0.19.1",
333
- "@scalar/icons": "0.5.2",
334
- "@scalar/import": "0.4.48",
335
- "@scalar/json-magic": "0.11.0",
336
- "@scalar/oas-utils": "0.6.39",
337
- "@scalar/object-utils": "1.2.25",
338
- "@scalar/openapi-parser": "0.24.9",
339
- "@scalar/postman-to-openapi": "0.4.3",
331
+ "@scalar/components": "0.19.4",
332
+ "@scalar/helpers": "0.2.12",
333
+ "@scalar/icons": "0.5.3",
334
+ "@scalar/import": "0.4.49",
335
+ "@scalar/draggable": "0.3.0",
336
+ "@scalar/json-magic": "0.11.1",
337
+ "@scalar/oas-utils": "0.6.42",
338
+ "@scalar/object-utils": "1.2.26",
339
+ "@scalar/openapi-parser": "0.24.10",
340
340
  "@scalar/openapi-types": "0.5.3",
341
- "@scalar/snippetz": "0.6.11",
342
- "@scalar/sidebar": "0.7.32",
341
+ "@scalar/sidebar": "0.7.35",
343
342
  "@scalar/themes": "0.14.0",
344
- "@scalar/types": "0.6.2",
345
- "@scalar/use-codemirror": "0.13.36",
346
- "@scalar/use-toasts": "0.9.1",
343
+ "@scalar/postman-to-openapi": "0.4.4",
344
+ "@scalar/types": "0.6.3",
345
+ "@scalar/use-codemirror": "0.13.39",
346
+ "@scalar/snippetz": "0.6.12",
347
347
  "@scalar/use-hooks": "0.3.7",
348
- "@scalar/workspace-store": "0.31.1"
348
+ "@scalar/use-toasts": "0.9.1",
349
+ "@scalar/workspace-store": "0.32.1"
349
350
  },
350
351
  "devDependencies": {
351
352
  "@tailwindcss/vite": "^4.1.18",
@@ -360,8 +361,9 @@
360
361
  "vite": "^7.3.1",
361
362
  "vite-svg-loader": "5.1.0",
362
363
  "vitest": "4.0.16",
364
+ "@scalar/galaxy": "0.5.13",
363
365
  "@scalar/build-tooling": "0.4.1",
364
- "@scalar/galaxy": "0.5.13"
366
+ "@scalar/pre-post-request-scripts": "0.0.89"
365
367
  },
366
368
  "scripts": {
367
369
  "build": "scalar-build-vite",
@@ -1,65 +0,0 @@
1
- import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
2
- import type { Component } from 'vue';
3
- /** A type representing the hooks that a client plugin can define */
4
- type ClientPluginHooks = {
5
- beforeRequest: (payload: {
6
- request: Request;
7
- }) => {
8
- request: Request;
9
- } | Promise<{
10
- request: Request;
11
- }>;
12
- responseReceived: (payload: {
13
- response: Response;
14
- request: Request;
15
- operation: OperationObject;
16
- }) => void | Promise<void>;
17
- };
18
- /** A type representing the components that a client plugin can define */
19
- type ClientPluginComponents = {
20
- request: Component;
21
- response: Component;
22
- };
23
- /**
24
- * ClientPlugin is used to extend the API Client with custom hooks and UI components.
25
- *
26
- * Example usage:
27
- *
28
- * const myPlugin: ClientPlugin = {
29
- * hooks: {
30
- * beforeRequest: (request) => {
31
- * // Modify the request before it is sent
32
- * request.headers.set('X-Custom-Header', 'foo');
33
- * return request;
34
- * },
35
- * responseReceived: async (response, operation) => {
36
- * // Handle post-response logic
37
- * const data = await response.json();
38
- * console.log('Received:', data, 'for operation:', operation.operationId);
39
- * }
40
- * },
41
- * components: {
42
- * request: MyRequestComponent, // Custom Vue component for rendering the request section
43
- * response: MyResponseComponent // Custom Vue component for rendering the response section
44
- * }
45
- * }
46
- */
47
- export type ClientPlugin = {
48
- hooks?: Partial<ClientPluginHooks>;
49
- components?: Partial<ClientPluginComponents>;
50
- };
51
- /**
52
- * Maps hook names to their expected payload types.
53
- * This ensures type safety when executing hooks with their corresponding payloads.
54
- * Derived from the ClientPlugin hooks definition.
55
- */
56
- type HookPayloadMap = {
57
- [K in keyof ClientPluginHooks]: Parameters<ClientPluginHooks[K]>[0];
58
- };
59
- /**
60
- * Execute any hook with type-safe payload handling.
61
- * The payload type is inferred from the hook name to ensure correct usage.
62
- */
63
- export declare const executeHook: <K extends keyof HookPayloadMap>(payload: HookPayloadMap[K], hookName: K, plugins: ClientPlugin[]) => Promise<HookPayloadMap[K]>;
64
- export {};
65
- //# sourceMappingURL=plugins.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,oEAAoE;AACpE,KAAK,iBAAiB,GAAG;IACvB,aAAa,EAAE,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACtG,gBAAgB,EAAE,CAAC,OAAO,EAAE;QAC1B,QAAQ,EAAE,QAAQ,CAAA;QAClB,OAAO,EAAE,OAAO,CAAA;QAChB,SAAS,EAAE,eAAe,CAAA;KAC3B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B,CAAA;AAED,yEAAyE;AACzE,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAC7C,CAAA;AAED;;;;GAIG;AACH,KAAK,cAAc,GAAG;KACnB,CAAC,IAAI,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,SAAS,MAAM,cAAc,EAC9D,SAAS,cAAc,CAAC,CAAC,CAAC,EAC1B,UAAU,CAAC,EACX,SAAS,YAAY,EAAE,KACtB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAY3B,CAAA"}
@@ -1,11 +0,0 @@
1
- const i = async (a, e, n) => {
2
- let o = a;
3
- for (const c of n) {
4
- const t = c.hooks?.[e];
5
- t && (o = await t(o) ?? o);
6
- }
7
- return o;
8
- };
9
- export {
10
- i as executeHook
11
- };