@scalar/api-client 2.0.44 → 2.0.45

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 (72) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +77 -69
  5. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  6. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  7. package/dist/components/ContextBar.vue.js +5 -23
  8. package/dist/components/ContextBar.vue2.js +25 -2
  9. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +1 -1
  10. package/dist/components/Form/Form.vue.d.ts +12 -3
  11. package/dist/components/Form/Form.vue.d.ts.map +1 -1
  12. package/dist/components/Form/Form.vue.js +24 -24
  13. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  14. package/dist/components/HttpMethod/HttpMethod.vue.js +25 -22
  15. package/dist/components/SideNav/SideHelp.vue.js +1 -1
  16. package/dist/components/SideNav/SideNavLink.vue.js +2 -2
  17. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  18. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  19. package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
  20. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  21. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  22. package/dist/components/Sidebar/SidebarListElement.vue2.js +21 -21
  23. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  24. package/dist/components/Sidebar/SidebarListElementActions.vue.js +19 -18
  25. package/dist/components/Sidebar/SidebarToggle.vue.js +1 -1
  26. package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
  27. package/dist/components/SubpageHeader.vue.js +3 -3
  28. package/dist/components/SubpageHeader.vue2.js +7 -7
  29. package/dist/components/TopNav/TopNav.vue.js +2 -2
  30. package/dist/components/TopNav/TopNav.vue2.js +2 -2
  31. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  32. package/dist/components/TopNav/TopNavItem.vue.js +2 -2
  33. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  34. package/dist/components/ViewLayout/ViewLayout.vue.js +6 -6
  35. package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
  36. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  37. package/dist/errors.d.ts +5 -0
  38. package/dist/errors.d.ts.map +1 -0
  39. package/dist/errors.js +7 -0
  40. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  41. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  42. package/dist/libs/eventBusses/index.d.ts +1 -0
  43. package/dist/libs/eventBusses/index.d.ts.map +1 -1
  44. package/dist/libs/eventBusses/index.js +3 -1
  45. package/dist/libs/eventBusses/requestStatusBus.d.ts +5 -0
  46. package/dist/libs/eventBusses/requestStatusBus.d.ts.map +1 -0
  47. package/dist/libs/eventBusses/requestStatusBus.js +5 -0
  48. package/dist/libs/index.js +7 -5
  49. package/dist/libs/sendRequest.d.ts +2 -0
  50. package/dist/libs/sendRequest.d.ts.map +1 -1
  51. package/dist/libs/sendRequest.js +46 -37
  52. package/dist/style.css +1 -1
  53. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  54. package/dist/views/Cookies/CookieForm.vue.js +34 -17
  55. package/dist/views/Cookies/Cookies.vue2.js +9 -9
  56. package/dist/views/Environment/Environment.vue2.js +24 -24
  57. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  58. package/dist/views/Request/Request.vue.js +2 -2
  59. package/dist/views/Request/Request.vue2.js +170 -166
  60. package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
  61. package/dist/views/Request/RequestSection/RequestAuth.vue.js +2 -2
  62. package/dist/views/Request/RequestSection/RequestAuth.vue2.js +115 -126
  63. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  64. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +63 -42
  65. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  66. package/dist/views/Request/RequestSection/RequestSection.vue.js +69 -51
  67. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  68. package/dist/views/Request/RequestSidebarItem.vue2.js +4 -4
  69. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +18 -18
  70. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  71. package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
  72. package/package.json +6 -6
@@ -1,40 +1,40 @@
1
- import { defineComponent as b, resolveComponent as c, openBlock as o, createElementBlock as t, createVNode as n, normalizeClass as r, withModifiers as v, withCtx as f, createElementVNode as g, createCommentVNode as k, createTextVNode as w, toDisplayString as h } from "vue";
2
- import C from "./SidebarListElementActions.vue.js";
1
+ import { defineComponent as c, resolveComponent as v, openBlock as o, createElementBlock as n, createVNode as t, normalizeClass as l, withModifiers as f, withCtx as g, createElementVNode as r, createCommentVNode as h, toDisplayString as k } from "vue";
2
+ import w from "./SidebarListElementActions.vue.js";
3
3
  import { useRouter as _ } from "vue-router";
4
- const y = {
4
+ const C = {
5
5
  key: 0,
6
6
  class: "hover:bg-b-3 rounded p-1.5",
7
7
  type: "button"
8
- }, E = /* @__PURE__ */ b({
8
+ }, y = { class: "empty-variable-name" }, V = /* @__PURE__ */ c({
9
9
  __name: "SidebarListElement",
10
10
  props: {
11
11
  variable: {},
12
12
  warningMessage: {}
13
13
  },
14
14
  emits: ["delete"],
15
- setup(D, { emit: l }) {
16
- const i = l, s = _(), m = (e, a) => {
17
- e.metaKey ? window.open(a, "_blank") : s.push(a);
15
+ setup(D, { emit: i }) {
16
+ const s = i, m = _(), p = (e, a) => {
17
+ e.metaKey ? window.open(a, "_blank") : m.push(a);
18
18
  }, u = (e) => {
19
- i("delete", e);
19
+ s("delete", e);
20
20
  };
21
21
  return (e, a) => {
22
- const d = c("router-link");
23
- return o(), t("li", null, [
24
- n(d, {
25
- class: r(["text-c-2 hover:bg-b-2 group relative block flex items-center gap-1 rounded py-1 pr-2 font-medium no-underline", [e.variable.color ? "pl-1" : "pl-2"]]),
22
+ const d = v("router-link");
23
+ return o(), n("li", null, [
24
+ t(d, {
25
+ class: l(["text-c-2 hover:bg-b-2 group relative block flex items-center gap-1 rounded py-1 pr-2 font-medium no-underline", [e.variable.color ? "pl-1" : "pl-2"]]),
26
26
  exactActiveClass: "active-link",
27
27
  to: `${e.variable.uid}`,
28
- onClick: a[0] || (a[0] = v((p) => m(p, e.variable.uid), ["prevent"]))
28
+ onClick: a[0] || (a[0] = f((b) => p(b, e.variable.uid), ["prevent"]))
29
29
  }, {
30
- default: f(() => [
31
- e.variable.color ? (o(), t("button", y, [
32
- g("div", {
33
- class: r(["h-2.5 w-2.5 rounded-xl", `bg-${e.variable.color}`])
30
+ default: g(() => [
31
+ e.variable.color ? (o(), n("button", C, [
32
+ r("div", {
33
+ class: l(["h-2.5 w-2.5 rounded-xl", `bg-${e.variable.color}`])
34
34
  }, null, 2)
35
- ])) : k("", !0),
36
- w(" " + h(e.variable.name) + " ", 1),
37
- n(C, {
35
+ ])) : h("", !0),
36
+ r("span", y, k(e.variable.name), 1),
37
+ t(w, {
38
38
  variable: { ...e.variable, isDefault: e.variable.isDefault ?? !1 },
39
39
  warningMessage: e.warningMessage,
40
40
  onDelete: u
@@ -47,5 +47,5 @@ const y = {
47
47
  }
48
48
  });
49
49
  export {
50
- E as default
50
+ V as default
51
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarListElementActions.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarListElementActions.vue"],"names":[],"mappings":";cAoFY;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,SAAS,EAAE,OAAO,CAAA;KACnB;;;;cAJS;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,SAAS,EAAE,OAAO,CAAA;KACnB;;;;AAiLH,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"SidebarListElementActions.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarListElementActions.vue"],"names":[],"mappings":";cAqFY;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,SAAS,EAAE,OAAO,CAAA;KACnB;;;;cAJS;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,SAAS,EAAE,OAAO,CAAA;KACnB;;;;AA6LH,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,6 +1,6 @@
1
- import { defineComponent as k, ref as w, openBlock as l, createElementBlock as s, Fragment as g, createElementVNode as c, unref as a, createVNode as i, withModifiers as N, createCommentVNode as u, withCtx as x, createBlock as $ } from "vue";
1
+ import { defineComponent as k, ref as w, openBlock as l, createElementBlock as c, Fragment as g, createElementVNode as u, unref as a, createVNode as i, withModifiers as N, createCommentVNode as m, withCtx as x, createBlock as $ } from "vue";
2
2
  import D from "./Actions/DeleteSidebarListElement.vue.js";
3
- import { useModal as M, ScalarIcon as m, ScalarModal as A } from "@scalar/components";
3
+ import { useModal as M, ScalarIcon as d, ScalarModal as A } from "@scalar/components";
4
4
  import { useClipboard as S } from "../../hooks/useClipboard.js";
5
5
  const B = { class: "absolute flex right-1 opacity-0 group-hover:opacity-100" }, z = /* @__PURE__ */ k({
6
6
  __name: "SidebarListElementActions",
@@ -8,39 +8,39 @@ const B = { class: "absolute flex right-1 opacity-0 group-hover:opacity-100" },
8
8
  variable: {}
9
9
  },
10
10
  emits: ["delete"],
11
- setup(d, { emit: p }) {
12
- const { variable: v } = d, b = p, t = w({ action: "None", name: "" }), n = M(), { copyToClipboard: f } = S();
13
- function h(e) {
14
- t.value = { action: e, name: v.name }, n.show();
11
+ setup(p, { emit: v }) {
12
+ const { variable: b } = p, f = v, t = w({ action: "None", name: "" }), n = M(), { copyToClipboard: h } = S();
13
+ function C(e) {
14
+ t.value = { action: e, name: b.name }, n.show();
15
15
  }
16
- function C() {
16
+ function r() {
17
17
  n.hide(), t.value = { action: "None", name: "" };
18
18
  }
19
19
  function y(e) {
20
- b("delete", e), C();
20
+ f("delete", e), r();
21
21
  }
22
- return (e, o) => (l(), s(g, null, [
23
- c("div", B, [
24
- c("button", {
22
+ return (e, o) => (l(), c(g, null, [
23
+ u("div", B, [
24
+ u("button", {
25
25
  class: "text-c-3 hover:bg-b-3 hover:text-c-1 rounded p-[5px]",
26
26
  type: "button",
27
- onClick: o[0] || (o[0] = (r) => a(f)(e.variable.name))
27
+ onClick: o[0] || (o[0] = (s) => a(h)(e.variable.name))
28
28
  }, [
29
- i(a(m), {
29
+ i(a(d), {
30
30
  class: "h-3 w-3",
31
31
  icon: "Clipboard"
32
32
  })
33
33
  ]),
34
- e.variable.isDefault ? u("", !0) : (l(), s("button", {
34
+ e.variable.isDefault ? m("", !0) : (l(), c("button", {
35
35
  key: 0,
36
36
  class: "text-c-3 hover:bg-b-3 hover:text-c-1 rounded p-1",
37
37
  type: "button",
38
- onClick: o[1] || (o[1] = N((r) => h(
38
+ onClick: o[1] || (o[1] = N((s) => C(
39
39
  "Delete"
40
40
  /* Delete */
41
41
  ), ["prevent"]))
42
42
  }, [
43
- i(a(m), {
43
+ i(a(d), {
44
44
  class: "h-3.5 w-3.5",
45
45
  icon: "Close"
46
46
  })
@@ -56,8 +56,9 @@ const B = { class: "absolute flex right-1 opacity-0 group-hover:opacity-100" },
56
56
  key: 0,
57
57
  variableName: t.value.name,
58
58
  warningMessage: "Are you sure you want to delete this cookie?",
59
- onDelete: o[2] || (o[2] = (r) => y(e.variable.uid))
60
- }, null, 8, ["variableName"])) : u("", !0)
59
+ onClose: r,
60
+ onDelete: o[2] || (o[2] = (s) => y(e.variable.uid))
61
+ }, null, 8, ["variableName"])) : m("", !0)
61
62
  ]),
62
63
  _: 1
63
64
  }, 8, ["state", "title"])
@@ -25,7 +25,7 @@ const a = {
25
25
  emits: ["update:modelValue"],
26
26
  setup(u) {
27
27
  return (t, o) => (l(), n("button", {
28
- class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
28
+ class: "text-c-3 hover:bg-b-2 active:text-c-1 p-2 rounded",
29
29
  type: "button",
30
30
  onClick: o[0] || (o[0] = (p) => t.$emit("update:modelValue", !t.modelValue))
31
31
  }, [
@@ -1 +1 @@
1
- {"version":3,"file":"SubpageHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/SubpageHeader.vue"],"names":[],"mappings":"AA2CA,iBAAS,cAAc;qBAoFO,GAAG;EAehC;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SubpageHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/SubpageHeader.vue"],"names":[],"mappings":"AA2CA,iBAAS,cAAc;qBAuFO,GAAG;EAehC;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
- import o from "./SubpageHeader.vue2.js";
1
+ import a from "./SubpageHeader.vue2.js";
2
2
  /* empty css */
3
- import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-609611d1"]]);
3
+ import o from "../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ o(a, [["__scopeId", "data-v-a15baa95"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,25 +1,25 @@
1
- import { defineComponent as a, resolveComponent as d, openBlock as l, createElementBlock as p, createElementVNode as r, createVNode as t, unref as o, withCtx as i, renderSlot as u, pushScopeId as m, popScopeId as _ } from "vue";
2
- import { ScalarIcon as f } from "@scalar/components";
1
+ import { defineComponent as a, resolveComponent as d, openBlock as l, createElementBlock as i, createElementVNode as r, createVNode as t, unref as o, withCtx as p, renderSlot as u, pushScopeId as m, popScopeId as f } from "vue";
2
+ import { ScalarIcon as _ } from "@scalar/components";
3
3
  import { useRoute as h } from "vue-router";
4
- const k = (e) => (m("data-v-609611d1"), e = e(), _(), e), v = { class: "flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full bg-b-2 relative darkmode-subpage-wrapper" }, x = { class: "lg:min-h-header items-center w-full p-1 t-app__top-container flex items-center" }, b = /* @__PURE__ */ k(() => /* @__PURE__ */ r("span", { class: "leading-none" }, "Back To Requests", -1)), I = /* @__PURE__ */ a({
4
+ const b = (e) => (m("data-v-a15baa95"), e = e(), f(), e), v = { class: "flex flex-1 flex-col rounded pt-0 h-full bg-b-1 relative border-1/2 rounded mr-1.5 mb-1.5 overflow-hidden" }, x = { class: "lg:min-h-header items-center w-full p-1 t-app__top-container flex items-center border-b-1/2" }, k = /* @__PURE__ */ b(() => /* @__PURE__ */ r("span", { class: "leading-none" }, "Back To Requests", -1)), I = /* @__PURE__ */ a({
5
5
  __name: "SubpageHeader",
6
6
  setup(e) {
7
7
  const n = h();
8
8
  return (s, g) => {
9
9
  const c = d("router-link");
10
- return l(), p("div", v, [
10
+ return l(), i("div", v, [
11
11
  r("div", x, [
12
12
  t(c, {
13
13
  class: "text-c-2 text-sm font-medium ml-1 flex items-center p-1.5 hover:bg-b-3 rounded cursor-pointer gap-0.5 active:text-c-1 no-underline dark:hover:bg-b-2",
14
14
  to: `/workspace/${o(n).params.workspace}/request/default`
15
15
  }, {
16
- default: i(() => [
17
- t(o(f), {
16
+ default: p(() => [
17
+ t(o(_), {
18
18
  icon: "ChevronLeft",
19
19
  size: "md",
20
20
  thickness: "1.75"
21
21
  }),
22
- b
22
+ k
23
23
  ]),
24
24
  _: 1
25
25
  }, 8, ["to"])
@@ -1,7 +1,7 @@
1
1
  import o from "./TopNav.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-868c07b1"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-76f92299"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -4,7 +4,7 @@ import { ScalarIcon as h } from "@scalar/components";
4
4
  import { capitalize as V } from "@scalar/oas-utils/helpers";
5
5
  import j from "./TopNavItem.vue.js";
6
6
  import { useWorkspace as q } from "../../store/workspace.js";
7
- const L = (l) => (B("data-v-868c07b1"), l = l(), E(), l), $ = { class: "flex h-10 t-app__top-nav" }, D = /* @__PURE__ */ L(() => /* @__PURE__ */ i("div", { class: "t-app__top-nav-draggable" }, null, -1)), F = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, M = {
7
+ const L = (l) => (B("data-v-76f92299"), l = l(), E(), l), $ = { class: "flex h-10 t-app__top-nav" }, D = /* @__PURE__ */ L(() => /* @__PURE__ */ i("div", { class: "t-app__top-nav-draggable" }, null, -1)), F = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, M = {
8
8
  key: 0,
9
9
  class: "flex items-center gap-1 w-full justify-center"
10
10
  }, K = /* @__PURE__ */ N({
@@ -67,7 +67,7 @@ const L = (l) => (B("data-v-868c07b1"), l = l(), E(), l), $ = { class: "flex h-1
67
67
  onClose: (I) => k(o)
68
68
  }, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose"]))), 128)),
69
69
  i("button", {
70
- class: "text-c-3 hover:bg-b-2 p-1.5 rounded-lg webkit-app-no-drag",
70
+ class: "text-c-3 hover:bg-b-3 p-1.5 rounded-lg webkit-app-no-drag",
71
71
  type: "button",
72
72
  onClick: _
73
73
  }, [
@@ -1 +1 @@
1
- {"version":3,"file":"TopNavItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNavItem.vue"],"names":[],"mappings":"AA+HA,OAAO,EAAE,KAAK,IAAI,EAA6B,MAAM,oBAAoB,CAAA;;aAK9D,MAAM;YACP,OAAO;WACR,MAAM;UACP,IAAI;;;;;aAHD,MAAM;YACP,OAAO;WACR,MAAM;UACP,IAAI;;;;;AAqJZ,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"TopNavItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNavItem.vue"],"names":[],"mappings":"AAqIA,OAAO,EAAE,KAAK,IAAI,EAA6B,MAAM,oBAAoB,CAAA;;aAK9D,MAAM;YACP,OAAO;WACR,MAAM;UACP,IAAI;;;;;aAHD,MAAM;YACP,OAAO;WACR,MAAM;UACP,IAAI;;;;;AAyJZ,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./TopNavItem.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-26cc8e34"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-96375fac"]]);
5
5
  export {
6
- a as default
6
+ r as default
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ViewLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayout.vue"],"names":[],"mappings":"AAeA,iBAAS,cAAc;qBA4BM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ViewLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayout.vue"],"names":[],"mappings":"AAcA,iBAAS,cAAc;qBAuBM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,12 +1,12 @@
1
- import { openBlock as o, createElementBlock as r, renderSlot as t } from "vue";
1
+ import { openBlock as o, createElementBlock as t, renderSlot as r } from "vue";
2
2
  import n from "../../_virtual/_plugin-vue_export-helper.js";
3
- const l = {}, d = { class: "m-1 mt-0 flex min-h-0 flex-1 rounded xl:rounded-lg xl:border xl:overflow-hidden leading-3 z-0" };
4
- function c(e, s) {
5
- return o(), r("div", d, [
6
- t(e.$slots, "default")
3
+ const c = {}, l = { class: "flex min-h-0 flex-1 xl:overflow-hidden leading-3 z-0" };
4
+ function s(e, f) {
5
+ return o(), t("div", l, [
6
+ r(e.$slots, "default")
7
7
  ]);
8
8
  }
9
- const a = /* @__PURE__ */ n(l, [["render", c]]);
9
+ const a = /* @__PURE__ */ n(c, [["render", s]]);
10
10
  export {
11
11
  a as default
12
12
  };
@@ -1,6 +1,6 @@
1
1
  import { openBlock as o, createElementBlock as t, renderSlot as r } from "vue";
2
2
  import d from "../../_virtual/_plugin-vue_export-helper.js";
3
- const l = {}, c = { class: "divide divide-y xl:divide-y-0 xl:divide-x flex xl:flex-row flex-col custom-scroll rounded" };
3
+ const l = {}, c = { class: "divide divide-y xl:divide-y-0 xl:divide-x-1/2 flex xl:flex-row flex-col custom-scroll rounded" };
4
4
  function i(e, n) {
5
5
  return o(), t("div", c, [
6
6
  r(e.$slots, "default")
@@ -10,7 +10,7 @@ const a = ["aria-labelledby"], c = ["id"], u = /* @__PURE__ */ n({
10
10
  }, [
11
11
  i("div", {
12
12
  id: o(e),
13
- class: "xl:min-h-header py-2.5 flex items-center border-b px-4 xl:px-6 text-sm font-medium sticky top-0 bg-b-1 z-20 rounded-t xl:rounded-none"
13
+ class: "xl:min-h-header py-2.5 flex items-center border-b-1/2 px-4 xl:px-6 text-sm font-medium sticky top-0 bg-b-1 z-20 rounded-t xl:rounded-none"
14
14
  }, [
15
15
  l(t.$slots, "title")
16
16
  ], 8, c),
@@ -0,0 +1,5 @@
1
+ export declare const ERRORS: {
2
+ URL_EMPTY: string;
3
+ INVALID_URL: string;
4
+ };
5
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;CAGlB,CAAA"}
package/dist/errors.js ADDED
@@ -0,0 +1,7 @@
1
+ const e = {
2
+ URL_EMPTY: "The adress bar seems to be empty. Try adding an URL.",
3
+ INVALID_URL: "The URL seems to be invalid. Try adding a valid URL."
4
+ };
5
+ export {
6
+ e as ERRORS
7
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";AAkTA,wBAKG"}
1
+ {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";AAqTA,wBAKG"}
@@ -2,7 +2,7 @@ import o from "./ApiClientModal.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-31379688"]]);
5
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6ed1e26d"]]);
6
6
  export {
7
- a as default
7
+ m as default
8
8
  };
@@ -1,2 +1,3 @@
1
1
  export { executeRequestBus } from './executeRequestBus.js';
2
+ export { requestStatusBus } from './requestStatusBus.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/eventBusses/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/eventBusses/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,4 +1,6 @@
1
1
  import { executeRequestBus as u } from "./executeRequestBus.js";
2
+ import { requestStatusBus as s } from "./requestStatusBus.js";
2
3
  export {
3
- u as executeRequestBus
4
+ u as executeRequestBus,
5
+ s as requestStatusBus
4
6
  };
@@ -0,0 +1,5 @@
1
+ /** Possible request statuses */
2
+ type RequestStatus = 'start' | 'stop' | 'abort';
3
+ export declare const requestStatusBus: import("@vueuse/core").UseEventBusReturn<RequestStatus, any>;
4
+ export {};
5
+ //# sourceMappingURL=requestStatusBus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestStatusBus.d.ts","sourceRoot":"","sources":["../../../src/libs/eventBusses/requestStatusBus.ts"],"names":[],"mappings":"AAEA,gCAAgC;AAChC,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;AAO/C,eAAO,MAAM,gBAAgB,8DAAkD,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { useEventBus as t } from "@vueuse/core";
2
+ const s = Symbol(), u = t(s);
3
+ export {
4
+ u as requestStatusBus
5
+ };
@@ -1,15 +1,17 @@
1
1
  import { createApiClient as o } from "./create-client.js";
2
- import { formatBytes as m, formatMs as s } from "./formatters.js";
2
+ import { formatBytes as s, formatMs as m } from "./formatters.js";
3
3
  import { loadAllResources as a } from "./local-storage.js";
4
- import { syncPathParamsFromURL as x } from "./pathParams.js";
4
+ import { syncPathParamsFromURL as u } from "./pathParams.js";
5
5
  import { sendRequest as c } from "./sendRequest.js";
6
6
  import { executeRequestBus as R } from "./eventBusses/executeRequestBus.js";
7
+ import { requestStatusBus as q } from "./eventBusses/requestStatusBus.js";
7
8
  export {
8
9
  o as createApiClient,
9
10
  R as executeRequestBus,
10
- m as formatBytes,
11
- s as formatMs,
11
+ s as formatBytes,
12
+ m as formatMs,
12
13
  a as loadAllResources,
14
+ q as requestStatusBus,
13
15
  c as sendRequest,
14
- x as syncPathParamsFromURL
16
+ u as syncPathParamsFromURL
15
17
  };
@@ -1,6 +1,7 @@
1
1
  import type { Cookie } from '@scalar/oas-utils/entities/workspace/cookie';
2
2
  import type { SecurityScheme } from '@scalar/oas-utils/entities/workspace/security';
3
3
  import type { Request, RequestExample, ResponseInstance } from '@scalar/oas-utils/entities/workspace/spec';
4
+ import { type AxiosError } from 'axios';
4
5
  /**
5
6
  * Execute the request
6
7
  * called from the send button as well as keyboard shortcuts
@@ -9,5 +10,6 @@ export declare const sendRequest: (request: Request, example: RequestExample, ra
9
10
  sentTime?: number;
10
11
  request?: RequestExample;
11
12
  response?: ResponseInstance;
13
+ error?: AxiosError;
12
14
  }>;
13
15
  //# sourceMappingURL=sendRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../src/libs/sendRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EAEd,gBAAgB,EACjB,MAAM,2CAA2C,CAAA;AAwClD;;;GAGG;AACH,eAAO,MAAM,WAAW,YACb,OAAO,WACP,cAAc,UACf,MAAM,oBACI,cAAc,EAAE,aACvB,MAAM,qBACE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACxC,OAAO,CAAC;IACT,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAC5B,CAuNA,CAAA"}
1
+ {"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../src/libs/sendRequest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EAEd,gBAAgB,EACjB,MAAM,2CAA2C,CAAA;AAMlD,OAAc,EAAE,KAAK,UAAU,EAA2B,MAAM,OAAO,CAAA;AA8BvE;;;GAGG;AACH,eAAO,MAAM,WAAW,YACb,OAAO,WACP,cAAc,UACf,MAAM,oBACI,cAAc,EAAE,aACvB,MAAM,qBACE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACxC,OAAO,CAAC;IACT,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,CAkOA,CAAA"}
@@ -1,25 +1,26 @@
1
- import { normalizeHeaders as A } from "./normalizeHeaders.js";
2
- import { isValidUrl as $, redirectToProxy as q, shouldUseProxy as B } from "@scalar/oas-utils/helpers";
1
+ import { ERRORS as E } from "../errors.js";
2
+ import { normalizeHeaders as $ } from "./normalizeHeaders.js";
3
+ import { isValidUrl as L, redirectToProxy as q, shouldUseProxy as B } from "@scalar/oas-utils/helpers";
3
4
  import C from "axios";
4
5
  import O from "js-cookie";
5
6
  import U from "whatwg-mimetype";
6
7
  import { textMediaTypes as F } from "../views/Request/consts/mediaTypes.js";
7
- const l = (s = []) => s.reduce(
8
+ const f = (s = []) => s.reduce(
8
9
  (o, n) => (n.key && (o[n.key] = n.value), o),
9
10
  {}
10
- ), D = (s, o) => {
11
+ ), k = (s, o) => {
11
12
  const n = new U(o);
12
13
  if (F.includes(n.essence)) {
13
14
  const d = new TextDecoder(n.parameters.get("charset")).decode(s);
14
15
  return n.subtype === "json" ? JSON.parse(d) : d;
15
16
  } else
16
17
  return new Blob([s], { type: n.essence });
17
- }, m = async (s, o, n, u, d, f) => {
18
+ }, N = async (s, o, n, u, d, l) => {
18
19
  let i = n;
19
20
  o.parameters.path.forEach((e) => {
20
21
  !e.key || !e.value || (i = i.replace(`{${e.key}}`, e.value));
21
22
  });
22
- const a = l(
23
+ const a = f(
23
24
  o.parameters.headers.filter(({ enabled: e }) => e)
24
25
  );
25
26
  let c = null;
@@ -31,36 +32,43 @@ const l = (s = []) => s.reduce(
31
32
  a["Content-Type"] = "multipart/form-data";
32
33
  const e = new FormData();
33
34
  o.body.formData.encoding === "form-data" && (o.body.formData.value.forEach(
34
- (r) => {
35
- const t = r.file ? r.file : r.value;
36
- r.key && t && e.append(r.key, t);
35
+ (t) => {
36
+ const r = t.file ? t.file : t.value;
37
+ t.key && r && e.append(t.key, r);
37
38
  }
38
39
  ), c = e);
39
40
  }
40
- const p = [], [g, E] = i.split("?");
41
- new URLSearchParams(E ?? "").forEach((e, r) => {
41
+ const p = [], [D, g] = i.split("?");
42
+ new URLSearchParams(g ?? "").forEach((e, t) => {
42
43
  p.push({
43
- key: r,
44
+ key: t,
44
45
  value: e,
45
46
  enabled: !0
46
47
  });
47
48
  });
48
- const v = {
49
- ...l(
49
+ const w = {
50
+ ...f(
50
51
  o.parameters.query.filter(({ enabled: e }) => e).filter(({ value: e }) => e !== "")
51
52
  ),
52
- ...l(p)
53
+ ...f(p)
53
54
  }, y = {
54
- ...l(
55
+ ...f(
55
56
  (o.parameters.cookies ?? []).filter(({ enabled: e }) => e)
56
57
  )
57
58
  };
58
- if (f) {
59
+ if (l) {
60
+ if (!n)
61
+ throw new Error(E.URL_EMPTY);
62
+ try {
63
+ new URL(n);
64
+ } catch {
65
+ throw new Error(E.INVALID_URL);
66
+ }
59
67
  const e = new URL(n).host;
60
- Object.keys(f).forEach((r) => {
61
- const t = f[r];
62
- if (!t.domain) return;
63
- ($(t.domain) ? new URL(t.domain).origin : t.domain) === e && (y[t.name] = t.domain);
68
+ Object.keys(l).forEach((t) => {
69
+ const r = l[t];
70
+ if (!r.domain) return;
71
+ (L(r.domain) ? new URL(r.domain).origin : r.domain) === e && (y[r.name] = r.domain);
64
72
  });
65
73
  }
66
74
  u == null || u.forEach((e) => {
@@ -70,7 +78,7 @@ const l = (s = []) => s.reduce(
70
78
  y[e.name] = e.value;
71
79
  break;
72
80
  case "query":
73
- v[e.name] = e.value;
81
+ w[e.name] = e.value;
74
82
  break;
75
83
  case "header":
76
84
  a[e.name] = e.value;
@@ -85,8 +93,8 @@ const l = (s = []) => s.reduce(
85
93
  secure: !0
86
94
  });
87
95
  });
88
- const w = new URLSearchParams(v).toString();
89
- i = `${g}${w ? "?" + w : ""}`;
96
+ const v = new URLSearchParams(w).toString();
97
+ i = `${D}${v ? "?" + v : ""}`;
90
98
  const h = {
91
99
  url: q(d, i),
92
100
  method: s.method,
@@ -94,7 +102,7 @@ const l = (s = []) => s.reduce(
94
102
  headers: a
95
103
  };
96
104
  c && (h.data = c);
97
- const T = Date.now();
105
+ const R = Date.now();
98
106
  try {
99
107
  const e = await C(h);
100
108
  B(d, i) && [
@@ -103,33 +111,34 @@ const l = (s = []) => s.reduce(
103
111
  "Access-Control-Allow-Methods",
104
112
  "Access-Control-Expose-Headers"
105
113
  ].map((b) => b.toLowerCase()).forEach((b) => delete e.headers[b]);
106
- const r = e.data, t = e.headers["Content-Type"] ?? e.headers["content-type"] ?? "text/plain;charset=UTF-8", k = D(r, `${t}`), R = A(e.headers);
114
+ const t = e.data, r = e.headers["Content-Type"] ?? e.headers["content-type"] ?? "text/plain;charset=UTF-8", T = k(t, `${r}`), A = $(e.headers);
107
115
  return {
108
116
  sentTime: Date.now(),
109
117
  request: o,
110
118
  response: {
111
119
  ...e,
112
- headers: R,
113
- data: k,
114
- duration: Date.now() - T
120
+ headers: A,
121
+ data: T,
122
+ duration: Date.now() - R
115
123
  }
116
124
  };
117
125
  } catch (e) {
118
- const t = e.response;
126
+ const t = e, r = t.response;
119
127
  return console.error("ERROR", e), {
120
128
  sentTime: Date.now(),
121
129
  request: o,
122
- response: t ? {
123
- ...t,
124
- data: D(
125
- t.data,
130
+ response: r ? {
131
+ ...r,
132
+ data: k(
133
+ r.data,
126
134
  "text/plain;charset=UTF-8"
127
135
  ),
128
- duration: Date.now() - T
129
- } : void 0
136
+ duration: Date.now() - R
137
+ } : void 0,
138
+ error: t
130
139
  };
131
140
  }
132
141
  };
133
142
  export {
134
- m as sendRequest
143
+ N as sendRequest
135
144
  };