@scalar/api-client 2.1.19 → 2.1.21

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 (105) hide show
  1. package/CHANGELOG.md +20 -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 -79
  5. package/dist/components/AddressBar/AddressBarServer.vue.js +23 -23
  6. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -45
  8. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +6 -0
  9. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  11. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +89 -91
  12. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
  13. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  14. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  15. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +29 -32
  16. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  17. package/dist/components/TopNav/TopNav.vue.js +3 -3
  18. package/dist/components/TopNav/TopNav.vue2.js +41 -40
  19. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  20. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
  21. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  22. package/dist/layouts/App/ApiClientApp.vue.js +38 -38
  23. package/dist/layouts/App/create-api-client-app.d.ts +33 -26
  24. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  25. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  26. package/dist/layouts/Modal/ApiClientModal.vue2.js +15 -15
  27. package/dist/layouts/Modal/create-api-client-modal.d.ts +66 -52
  28. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  29. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  30. package/dist/layouts/Web/ApiClientWeb.vue.js +30 -30
  31. package/dist/layouts/Web/create-api-client-web.d.ts +33 -26
  32. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  33. package/dist/libs/create-client.d.ts +33 -26
  34. package/dist/libs/create-client.d.ts.map +1 -1
  35. package/dist/libs/event-bus.d.ts +41 -0
  36. package/dist/libs/event-bus.d.ts.map +1 -0
  37. package/dist/libs/event-bus.js +32 -0
  38. package/dist/libs/{event-busses/hot-keys-bus.d.ts → hot-keys.d.ts} +6 -7
  39. package/dist/libs/hot-keys.d.ts.map +1 -0
  40. package/dist/libs/hot-keys.js +45 -0
  41. package/dist/libs/index.d.ts +3 -1
  42. package/dist/libs/index.d.ts.map +1 -1
  43. package/dist/libs/index.js +31 -33
  44. package/dist/libs/send-request.d.ts +4 -1
  45. package/dist/libs/send-request.d.ts.map +1 -1
  46. package/dist/libs/send-request.js +103 -103
  47. package/dist/store/collections.d.ts +4 -4
  48. package/dist/store/events.d.ts +29 -0
  49. package/dist/store/events.d.ts.map +1 -0
  50. package/dist/store/events.js +31 -0
  51. package/dist/store/request-example.d.ts +2 -2
  52. package/dist/store/requests.d.ts +4 -4
  53. package/dist/store/security-schemes.d.ts +4 -4
  54. package/dist/store/servers.d.ts +4 -4
  55. package/dist/store/store.d.ts +66 -52
  56. package/dist/store/store.d.ts.map +1 -1
  57. package/dist/store/store.js +75 -73
  58. package/dist/store/tags.d.ts +4 -4
  59. package/dist/store/workspace.d.ts +4 -4
  60. package/dist/style.css +1 -1
  61. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  62. package/dist/views/Request/Request.vue.js +1 -1
  63. package/dist/views/Request/Request.vue2.js +63 -63
  64. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  65. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  66. package/dist/views/Request/RequestSidebar.vue2.js +101 -102
  67. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  68. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  69. package/dist/views/Request/RequestSidebarItem.vue2.js +76 -76
  70. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  71. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  72. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +33 -34
  73. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts +16 -0
  74. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts.map +1 -0
  75. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +31 -0
  76. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +5 -0
  77. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  78. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  79. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -33
  80. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  81. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +3 -3
  82. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +17 -18
  83. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  84. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +20 -20
  85. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  86. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +68 -56
  87. package/dist/views/Request/components/WorkspaceDropdown.vue.js +29 -30
  88. package/package.json +6 -6
  89. package/dist/libs/event-busses/cancel-request-bus.d.ts +0 -2
  90. package/dist/libs/event-busses/cancel-request-bus.d.ts.map +0 -1
  91. package/dist/libs/event-busses/cancel-request-bus.js +0 -5
  92. package/dist/libs/event-busses/command-palette-bus.d.ts +0 -14
  93. package/dist/libs/event-busses/command-palette-bus.d.ts.map +0 -1
  94. package/dist/libs/event-busses/command-palette-bus.js +0 -5
  95. package/dist/libs/event-busses/execute-request-bus.d.ts +0 -2
  96. package/dist/libs/event-busses/execute-request-bus.d.ts.map +0 -1
  97. package/dist/libs/event-busses/execute-request-bus.js +0 -5
  98. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +0 -1
  99. package/dist/libs/event-busses/hot-keys-bus.js +0 -47
  100. package/dist/libs/event-busses/index.d.ts +0 -6
  101. package/dist/libs/event-busses/index.d.ts.map +0 -1
  102. package/dist/libs/event-busses/index.js +0 -15
  103. package/dist/libs/event-busses/request-status-bus.d.ts +0 -5
  104. package/dist/libs/event-busses/request-status-bus.d.ts.map +0 -1
  105. package/dist/libs/event-busses/request-status-bus.js +0 -5
@@ -1,62 +1,59 @@
1
- import { defineComponent as y, onMounted as k, onBeforeUnmount as R, openBlock as a, createElementBlock as c, createElementVNode as e, unref as t, createTextVNode as s, toDisplayString as v, createCommentVNode as p, createVNode as n, pushScopeId as g, popScopeId as b } from "vue";
2
- import C from "../../../assets/computer.ascii.js";
3
- import B from "../../../components/ScalarAsciiArt.vue.js";
1
+ import { defineComponent as y, onMounted as k, onBeforeUnmount as R, openBlock as n, createElementBlock as r, createElementVNode as e, unref as t, createTextVNode as c, toDisplayString as b, createCommentVNode as d, createVNode as l, pushScopeId as g, popScopeId as C } from "vue";
2
+ import v from "../../../assets/computer.ascii.js";
3
+ import N from "../../../components/ScalarAsciiArt.vue.js";
4
4
  import u from "../../../components/ScalarHotkey.vue.js";
5
- import { useWorkspace as N } from "../../../store/store.js";
6
- import { hotKeyBus as d } from "../../../libs/event-busses/hot-keys-bus.js";
7
- import { executeRequestBus as S } from "../../../libs/event-busses/execute-request-bus.js";
8
- import { commandPaletteBus as q } from "../../../libs/event-busses/command-palette-bus.js";
9
- const f = (o) => (g("data-v-43fc1968"), o = o(), b(), o), V = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, w = { class: "flex h-[calc(100%_-_50px)] flex-col items-center justify-center" }, E = {
5
+ import { useWorkspace as S } from "../../../store/store.js";
6
+ const f = (o) => (g("data-v-cddb96c9"), o = o(), C(), o), q = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, V = { class: "flex h-[calc(100%_-_50px)] flex-col items-center justify-center" }, B = {
10
7
  key: 0,
11
8
  class: "scalar-version-number"
12
- }, I = /* @__PURE__ */ f(() => /* @__PURE__ */ e("b", null, "Beta", -1)), P = /* @__PURE__ */ f(() => /* @__PURE__ */ e("div", { class: "mt-1" }, [
9
+ }, w = /* @__PURE__ */ f(() => /* @__PURE__ */ e("b", null, "Beta", -1)), E = /* @__PURE__ */ f(() => /* @__PURE__ */ e("div", { class: "mt-1" }, [
13
10
  /* @__PURE__ */ e("a", {
14
11
  href: "https://github.com/scalar/scalar/issues/2669",
15
12
  target: "_blank"
16
13
  }, " Roadmap ")
17
- ], -1)), A = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, T = /* @__PURE__ */ y({
14
+ ], -1)), I = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, j = /* @__PURE__ */ y({
18
15
  __name: "ResponseEmpty",
19
16
  setup(o) {
20
- const { isReadOnly: _, activeWorkspace: h } = N(), r = () => {
21
- q.emit({ commandName: "Create Request" });
22
- }, i = (l) => {
23
- l.openCommandPaletteRequest && r();
24
- }, x = "2.1.19";
25
- return k(() => d.on(i)), R(() => d.off(i)), (l, m) => (a(), c("div", V, [
26
- e("div", w, [
27
- t(h).isReadOnly ? p("", !0) : (a(), c("div", E, [
28
- s(" Scalar V" + v(t(x)) + " ", 1),
29
- I,
30
- s(" Release "),
31
- P
17
+ const { isReadOnly: _, activeWorkspace: h, events: s } = S(), i = () => {
18
+ s.commandPalette.emit({ commandName: "Create Request" });
19
+ }, m = (a) => {
20
+ a != null && a.openCommandPaletteRequest && i();
21
+ }, x = "2.1.21";
22
+ return k(() => s.hotKeys.on(m)), R(() => s.hotKeys.off(m)), (a, p) => (n(), r("div", q, [
23
+ e("div", V, [
24
+ t(h).isReadOnly ? d("", !0) : (n(), r("div", B, [
25
+ c(" Scalar V" + b(t(x)) + " ", 1),
26
+ w,
27
+ c(" Release "),
28
+ E
32
29
  ])),
33
- n(B, {
34
- art: t(C),
30
+ l(N, {
31
+ art: t(v),
35
32
  class: "text-c-3"
36
33
  }, null, 8, ["art"])
37
34
  ]),
38
- e("div", A, [
35
+ e("div", I, [
39
36
  e("button", {
40
37
  class: "flex items-center gap-1.5",
41
38
  type: "button",
42
- onClick: m[0] || (m[0] = (K) => t(S).emit())
39
+ onClick: p[0] || (p[0] = (K) => t(s).executeRequest.emit())
43
40
  }, [
44
- s(" Send Request "),
45
- n(u, { hotkey: "↵" })
41
+ c(" Send Request "),
42
+ l(u, { hotkey: "↵" })
46
43
  ]),
47
- t(_) ? p("", !0) : (a(), c("button", {
44
+ t(_) ? d("", !0) : (n(), r("button", {
48
45
  key: 0,
49
46
  class: "flex items-center gap-1.5",
50
47
  type: "button",
51
- onClick: r
48
+ onClick: i
52
49
  }, [
53
- s(" New Request "),
54
- n(u, { hotkey: "N" })
50
+ c(" New Request "),
51
+ l(u, { hotkey: "N" })
55
52
  ]))
56
53
  ])
57
54
  ]));
58
55
  }
59
56
  });
60
57
  export {
61
- T as default
58
+ j as default
62
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseLoadingOverlay.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseLoadingOverlay.vue"],"names":[],"mappings":";AA0LA,wBAKG"}
1
+ {"version":3,"file":"ResponseLoadingOverlay.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseLoadingOverlay.vue"],"names":[],"mappings":";AA4LA,wBAKG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ResponseLoadingOverlay.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-156fbea7"]]);
3
+ import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ef5f83d8"]]);
5
5
  export {
6
- p as default
6
+ f as default
7
7
  };
@@ -1,39 +1,38 @@
1
- import { defineComponent as l, ref as c, openBlock as s, createBlock as u, Transition as d, withCtx as i, unref as e, createElementBlock as m, createVNode as r, createTextVNode as f, createCommentVNode as p } from "vue";
2
- import { useLoadingState as g, ScalarLoading as _, ScalarButton as v } from "@scalar/components";
3
- import { cancelRequestBus as x } from "../../../libs/event-busses/cancel-request-bus.js";
4
- import { requestStatusBus as B } from "../../../libs/event-busses/request-status-bus.js";
1
+ import { defineComponent as c, ref as u, openBlock as i, createBlock as d, Transition as m, withCtx as l, unref as e, createElementBlock as f, createVNode as r, createTextVNode as p, createCommentVNode as g } from "vue";
2
+ import { useLoadingState as _, ScalarLoading as v, ScalarButton as x } from "@scalar/components";
3
+ import { useWorkspace as k } from "../../../store/store.js";
5
4
  const L = {
6
5
  key: 0,
7
6
  class: "absolute inset-0 bg-b-1 flex flex-col gap-6 items-center justify-center"
8
- }, N = /* @__PURE__ */ l({
7
+ }, y = /* @__PURE__ */ c({
9
8
  __name: "ResponseLoadingOverlay",
10
9
  setup(S) {
11
- const t = g(), o = c();
12
- return B.on((a) => {
13
- a === "start" ? o.value = setTimeout(() => t.startLoading(), 1e3) : (clearTimeout(o.value), o.value = void 0, t.stopLoading());
14
- }), (a, n) => (s(), u(d, null, {
15
- default: i(() => [
16
- e(t).isLoading ? (s(), m("div", L, [
17
- r(e(_), {
10
+ const { events: a } = k(), t = _(), o = u();
11
+ return a.requestStatus.on((n) => {
12
+ n === "start" ? o.value = setTimeout(() => t.startLoading(), 1e3) : (clearTimeout(o.value), o.value = void 0, t.stopLoading());
13
+ }), (n, s) => (i(), d(m, null, {
14
+ default: l(() => [
15
+ e(t).isLoading ? (i(), f("div", L, [
16
+ r(e(v), {
18
17
  class: "text-c-3",
19
18
  loadingState: e(t),
20
19
  size: "3xl"
21
20
  }, null, 8, ["loadingState"]),
22
- r(e(v), {
21
+ r(e(x), {
23
22
  variant: "ghost",
24
- onClick: n[0] || (n[0] = (k) => e(x).emit())
23
+ onClick: s[0] || (s[0] = (C) => e(a).cancelRequest.emit())
25
24
  }, {
26
- default: i(() => [
27
- f(" Cancel ")
25
+ default: l(() => [
26
+ p(" Cancel ")
28
27
  ]),
29
28
  _: 1
30
29
  })
31
- ])) : p("", !0)
30
+ ])) : g("", !0)
32
31
  ]),
33
32
  _: 1
34
33
  }));
35
34
  }
36
35
  });
37
36
  export {
38
- N as default
37
+ y as default
39
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseMetaInformation.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseMetaInformation.vue"],"names":[],"mappings":"AAyEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;;cAQrC,gBAAgB;;cAAhB,gBAAgB;;AA+HlD,wBAMG;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":"ResponseMetaInformation.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseMetaInformation.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;;cAQrC,gBAAgB;;cAAhB,gBAAgB;;AAgIlD,wBAMG;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,45 +1,45 @@
1
- import { defineComponent as y, ref as c, computed as k, openBlock as t, createElementBlock as s, toDisplayString as o, unref as m, Fragment as d, createElementVNode as g, createCommentVNode as v, createBlock as C, withCtx as B, createTextVNode as I } from "vue";
2
- import S from "../../../components/HelpfulLink.vue.js";
3
- import { httpStatusCodes as L } from "@scalar/oas-utils/helpers";
4
- import N from "pretty-bytes";
1
+ import { defineComponent as y, ref as i, computed as g, openBlock as t, createElementBlock as s, toDisplayString as o, unref as m, Fragment as d, createElementVNode as C, createCommentVNode as v, createBlock as I, withCtx as B, createTextVNode as S } from "vue";
2
+ import L from "../../../components/HelpfulLink.vue.js";
3
+ import { httpStatusCodes as N } from "@scalar/oas-utils/helpers";
4
+ import V from "pretty-bytes";
5
5
  import f from "pretty-ms";
6
- import { requestStatusBus as V } from "../../../libs/event-busses/request-status-bus.js";
7
- const w = { class: "flex gap-1.5 text-c-3 pl-1" }, E = { key: 0 }, M = { key: 0 }, q = { key: 1 }, b = /* @__PURE__ */ y({
6
+ import { useWorkspace as w } from "../../../store/store.js";
7
+ const E = { class: "flex gap-1.5 text-c-3 pl-1" }, M = { key: 0 }, q = { key: 0 }, x = { key: 1 }, b = /* @__PURE__ */ y({
8
8
  __name: "ResponseMetaInformation",
9
9
  props: {
10
10
  response: {}
11
11
  },
12
12
  setup(h) {
13
- const _ = h, r = c(), a = c(0);
14
- V.on((e) => {
13
+ const _ = h, { events: k } = w(), r = i(), a = i(0);
14
+ k.requestStatus.on((e) => {
15
15
  e === "start" ? r.value = setInterval(() => a.value += 1e3, 1e3) : (clearInterval(r.value), r.value = void 0, a.value = 0);
16
16
  });
17
17
  const l = (e) => {
18
- var p, i;
18
+ var p, c;
19
19
  const u = parseInt(
20
- ((p = e.headers) == null ? void 0 : p["Content-Length"]) || ((i = e.headers) == null ? void 0 : i["content-length"]) || "0",
20
+ ((p = e.headers) == null ? void 0 : p["Content-Length"]) || ((c = e.headers) == null ? void 0 : c["content-length"]) || "0",
21
21
  10
22
22
  );
23
- return u ? N(u) : void 0;
24
- }, n = k(() => {
23
+ return u ? V(u) : void 0;
24
+ }, n = g(() => {
25
25
  const e = _.response.status;
26
26
  if (e)
27
- return L[e] ?? void 0;
27
+ return N[e] ?? void 0;
28
28
  });
29
- return (e, u) => (t(), s("div", w, [
30
- r.value && a.value ? (t(), s("span", E, o(m(f)(a.value)), 1)) : (t(), s(d, { key: 1 }, [
31
- g("span", null, o(m(f)(e.response.duration)), 1),
32
- l(e.response) ? (t(), s("span", M, o(l(e.response)), 1)) : v("", !0),
29
+ return (e, u) => (t(), s("div", E, [
30
+ r.value && a.value ? (t(), s("span", M, o(m(f)(a.value)), 1)) : (t(), s(d, { key: 1 }, [
31
+ C("span", null, o(m(f)(e.response.duration)), 1),
32
+ l(e.response) ? (t(), s("span", q, o(l(e.response)), 1)) : v("", !0),
33
33
  n.value ? (t(), s(d, { key: 1 }, [
34
- n.value.url ? (t(), C(S, {
34
+ n.value.url ? (t(), I(L, {
35
35
  key: 0,
36
36
  href: n.value.url
37
37
  }, {
38
38
  default: B(() => [
39
- I(o(e.response.status) + " " + o(n.value.name), 1)
39
+ S(o(e.response.status) + " " + o(n.value.name), 1)
40
40
  ]),
41
41
  _: 1
42
- }, 8, ["href"])) : (t(), s("span", q, o(e.response.status) + " " + o(n.value.name), 1))
42
+ }, 8, ["href"])) : (t(), s("span", x, o(e.response.status) + " " + o(n.value.name), 1))
43
43
  ], 64)) : v("", !0)
44
44
  ], 64))
45
45
  ]));
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseSection.vue"],"names":[],"mappings":"AA+GA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;;cAS3D,gBAAgB,GAAG,SAAS;;cAA5B,gBAAgB,GAAG,SAAS;;AA4NxC,wBAMG;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":"ResponseSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseSection.vue"],"names":[],"mappings":"AA+HA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;;cAU3D,gBAAgB,GAAG,SAAS;;cAA5B,gBAAgB,GAAG,SAAS;;AAkPxC,wBAMG;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,89 +1,101 @@
1
- import { defineComponent as h, computed as u, ref as x, openBlock as r, createBlock as n, withCtx as d, createVNode as i, unref as y, createElementVNode as f, createTextVNode as C, createCommentVNode as l, createElementBlock as A, Fragment as B } from "vue";
2
- import S from "../../../components/ContextBar.vue.js";
3
- import $ from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
- import g from "./ResponseBody.vue.js";
5
- import E from "./ResponseEmpty.vue.js";
6
- import H from "./ResponseLoadingOverlay.vue.js";
7
- import N from "./ResponseMetaInformation.vue.js";
8
- import { ScalarIcon as R } from "@scalar/components";
9
- import V from "./ResponseCookies.vue.js";
10
- import L from "./ResponseHeaders.vue.js";
11
- const q = { class: "flex items-center flex-1" }, I = { class: "custom-scroll relative flex flex-1 flex-col px-2 xl:px-4 py-2.5" }, X = /* @__PURE__ */ h({
1
+ import { defineComponent as A, computed as i, ref as C, openBlock as t, createBlock as a, withCtx as d, createVNode as c, unref as S, createElementVNode as f, createTextVNode as B, createCommentVNode as l, createElementBlock as v, Fragment as _ } from "vue";
2
+ import g from "../../../components/ContextBar.vue.js";
3
+ import H from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
+ import R from "./ResponseBody.vue.js";
5
+ import V from "./ResponseEmpty.vue.js";
6
+ import $ from "./ResponseLoadingOverlay.vue.js";
7
+ import E from "./ResponseMetaInformation.vue.js";
8
+ import { ScalarIcon as I } from "@scalar/components";
9
+ import L from "./ResponseBodyVirtual.vue.js";
10
+ /* empty css */
11
+ import N from "./ResponseCookies.vue.js";
12
+ import O from "./ResponseHeaders.vue.js";
13
+ const T = { class: "flex items-center flex-1" }, q = { class: "custom-scroll relative flex flex-1 flex-col px-2 xl:px-4 py-2.5" }, z = 5e6, J = /* @__PURE__ */ A({
12
14
  __name: "ResponseSection",
13
15
  props: {
14
16
  response: {}
15
17
  },
16
- setup(v) {
17
- const a = v, c = u(() => {
18
- var s;
19
- const o = (s = a.response) == null ? void 0 : s.headers;
20
- return o ? Object.keys(o).map((e) => ({
21
- name: e,
22
- value: o[e],
18
+ setup(k) {
19
+ const r = k, p = i(() => {
20
+ var n;
21
+ const e = (n = r.response) == null ? void 0 : n.headers;
22
+ return e ? Object.keys(e).map((o) => ({
23
+ name: o,
24
+ value: e[o],
23
25
  required: !1
24
26
  })).filter(
25
- (e) => ![
27
+ (o) => ![
26
28
  "rest-api-client-content-length",
27
29
  "X-API-Client-Content-Length"
28
- ].includes(e.name)
30
+ ].includes(o.name)
29
31
  ) : [];
30
- }), k = u(
32
+ }), y = i(
31
33
  () => {
32
- var o;
33
- return ((o = a.response) == null ? void 0 : o.cookieHeaderKeys.flatMap((s) => {
34
- var m, p;
35
- const e = (p = (m = a.response) == null ? void 0 : m.headers) == null ? void 0 : p[s];
36
- return e ? {
37
- name: s,
38
- value: e,
34
+ var e;
35
+ return ((e = r.response) == null ? void 0 : e.cookieHeaderKeys.flatMap((n) => {
36
+ var m, u;
37
+ const o = (u = (m = r.response) == null ? void 0 : m.headers) == null ? void 0 : u[n];
38
+ return o ? {
39
+ name: n,
40
+ value: o,
39
41
  required: !1
40
42
  } : [];
41
43
  })) ?? [];
42
44
  }
43
- ), _ = ["All", "Cookies", "Headers", "Body"], t = x("All");
44
- return (o, s) => (r(), n($, null, {
45
+ ), h = ["All", "Cookies", "Headers", "Body"], s = C("All"), x = i(
46
+ () => {
47
+ var e;
48
+ return typeof ((e = r.response) == null ? void 0 : e.data) == "string" && r.response.data.length > z;
49
+ }
50
+ );
51
+ return (e, n) => (t(), a(H, null, {
45
52
  title: d(() => [
46
- i(y(R), {
53
+ c(S(I), {
47
54
  class: "text-c-3 mr-2 rotate-180",
48
55
  icon: "ExternalLink",
49
56
  size: "sm",
50
57
  thickness: "2.5"
51
58
  }),
52
- f("div", q, [
53
- C(" Response "),
54
- o.response ? (r(), n(N, {
59
+ f("div", T, [
60
+ B(" Response "),
61
+ e.response ? (t(), a(E, {
55
62
  key: 0,
56
- response: o.response
63
+ response: e.response
57
64
  }, null, 8, ["response"])) : l("", !0),
58
- i(S, {
59
- activeSection: t.value,
60
- sections: _,
61
- onSetActiveSection: s[0] || (s[0] = (e) => t.value = e)
65
+ c(g, {
66
+ activeSection: s.value,
67
+ sections: h,
68
+ onSetActiveSection: n[0] || (n[0] = (o) => s.value = o)
62
69
  }, null, 8, ["activeSection"])
63
70
  ])
64
71
  ]),
65
72
  default: d(() => {
66
- var e;
73
+ var o;
67
74
  return [
68
- f("div", I, [
69
- o.response ? (r(), A(B, { key: 1 }, [
70
- t.value === "All" || t.value === "Cookies" ? (r(), n(V, {
75
+ f("div", q, [
76
+ e.response ? (t(), v(_, { key: 1 }, [
77
+ s.value === "All" || s.value === "Cookies" ? (t(), a(N, {
71
78
  key: 0,
72
- cookies: k.value
79
+ cookies: y.value
73
80
  }, null, 8, ["cookies"])) : l("", !0),
74
- t.value === "All" || t.value === "Headers" ? (r(), n(L, {
81
+ s.value === "All" || s.value === "Headers" ? (t(), a(O, {
75
82
  key: 1,
76
- headers: c.value
83
+ headers: p.value
77
84
  }, null, 8, ["headers"])) : l("", !0),
78
- t.value === "All" || t.value === "Body" ? (r(), n(g, {
79
- key: 2,
80
- active: !0,
81
- data: (e = a.response) == null ? void 0 : e.data,
82
- headers: c.value,
83
- title: "Body"
84
- }, null, 8, ["data", "headers"])) : l("", !0)
85
- ], 64)) : (r(), n(E, { key: 0 })),
86
- i(H)
85
+ s.value === "All" || s.value === "Body" ? (t(), v(_, { key: 2 }, [
86
+ x.value ? (t(), a(L, {
87
+ key: 0,
88
+ content: r.response.data
89
+ }, null, 8, ["content"])) : (t(), a(R, {
90
+ key: 1,
91
+ active: !0,
92
+ data: (o = r.response) == null ? void 0 : o.data,
93
+ headers: p.value,
94
+ title: "Body"
95
+ }, null, 8, ["data", "headers"]))
96
+ ], 64)) : l("", !0)
97
+ ], 64)) : (t(), a(V, { key: 0 })),
98
+ c($)
87
99
  ])
88
100
  ];
89
101
  }),
@@ -92,5 +104,5 @@ const q = { class: "flex items-center flex-1" }, I = { class: "custom-scroll rel
92
104
  }
93
105
  });
94
106
  export {
95
- X as default
107
+ J as default
96
108
  };
@@ -1,26 +1,25 @@
1
- import { defineComponent as R, computed as O, ref as M, openBlock as u, createElementBlock as W, createElementVNode as o, createVNode as t, unref as e, withCtx as s, Fragment as A, renderList as I, createBlock as x, withModifiers as r, normalizeClass as L, toDisplayString as z } from "vue";
2
- import U from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
3
- import V from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
4
- import { useModal as C, ScalarDropdown as $, ScalarDropdownItem as m, ScalarIcon as i, ScalarTooltip as q, ScalarButton as S, ScalarDropdownDivider as F, ScalarModal as N } from "@scalar/components";
5
- import { useRouter as P } from "vue-router";
6
- import { useWorkspace as Y } from "../../../store/store.js";
7
- import { commandPaletteBus as G } from "../../../libs/event-busses/command-palette-bus.js";
1
+ import { defineComponent as O, computed as A, ref as M, openBlock as u, createElementBlock as W, createElementVNode as o, createVNode as t, unref as e, withCtx as s, Fragment as I, renderList as L, createBlock as x, withModifiers as r, normalizeClass as U, toDisplayString as z } from "vue";
2
+ import V from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
3
+ import q from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
4
+ import { useModal as C, ScalarDropdown as $, ScalarDropdownItem as m, ScalarIcon as i, ScalarTooltip as F, ScalarButton as S, ScalarDropdownDivider as P, ScalarModal as N } from "@scalar/components";
5
+ import { useRouter as Y } from "vue-router";
6
+ import { useWorkspace as G } from "../../../store/store.js";
8
7
  const H = { class: "flex items-center text-sm w-[inherit]" }, J = { class: "font-medium m-0 text-sm flex gap-1.5 items-center" }, K = { class: "line-clamp-1 text-left w-[calc(100%-10px)]" }, Q = { class: "text-ellipsis overflow-hidden" }, X = /* @__PURE__ */ o("span", null, "Rename", -1), Z = /* @__PURE__ */ o("span", null, "Delete", -1), ee = /* @__PURE__ */ o("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-100 p-2 text-xxs leading-5 z-10 text-c-1" }, [
9
8
  /* @__PURE__ */ o("div", { class: "flex items-center text-c-2" }, [
10
9
  /* @__PURE__ */ o("span", null, "Only workspace cannot be deleted.")
11
10
  ])
12
- ], -1), te = /* @__PURE__ */ o("span", null, "Delete", -1), se = { class: "flex items-center justify-center h-4 w-4" }, ne = /* @__PURE__ */ o("span", null, "Create Workspace", -1), ue = /* @__PURE__ */ R({
11
+ ], -1), te = /* @__PURE__ */ o("span", null, "Delete", -1), se = { class: "flex items-center justify-center h-4 w-4" }, ne = /* @__PURE__ */ o("span", null, "Create Workspace", -1), pe = /* @__PURE__ */ O({
13
12
  __name: "WorkspaceDropdown",
14
13
  setup(oe) {
15
- const { activeWorkspace: f, workspaces: d, workspaceMutators: _ } = Y(), { push: g } = P(), T = (n) => {
14
+ const { activeWorkspace: f, workspaces: d, workspaceMutators: _, events: T } = G(), { push: g } = Y(), E = (n) => {
16
15
  n !== f.value.uid && g(`/workspace/${n}`);
17
- }, b = O(() => Object.keys(d).length === 1), E = () => G.emit({ commandName: "Create Workspace" }), h = M(""), c = M(""), v = C(), w = C(), y = (n) => {
18
- h.value = d[n].name, c.value = n, v.show();
19
- }, j = (n) => {
20
- n.trim() && (_.edit(c.value, "name", n.trim()), v.hide());
16
+ }, b = A(() => Object.keys(d).length === 1), j = () => T.commandPalette.emit({ commandName: "Create Workspace" }), v = M(""), c = M(""), h = C(), w = C(), y = (n) => {
17
+ v.value = d[n].name, c.value = n, h.show();
18
+ }, B = (n) => {
19
+ n.trim() && (_.edit(c.value, "name", n.trim()), h.hide());
21
20
  }, D = (n) => {
22
- h.value = d[n].name, c.value = n, w.show();
23
- }, B = async () => {
21
+ v.value = d[n].name, c.value = n, w.show();
22
+ }, R = async () => {
24
23
  if (!b.value) {
25
24
  const n = f.value.uid === c.value, a = { ...d };
26
25
  if (delete a[c.value], _.delete(c.value), n) {
@@ -34,14 +33,14 @@ const H = { class: "flex items-center text-sm w-[inherit]" }, J = { class: "font
34
33
  o("div", H, [
35
34
  t(e($), null, {
36
35
  items: s(() => [
37
- (u(!0), W(A, null, I(e(d), (p, l) => (u(), x(e(m), {
36
+ (u(!0), W(I, null, L(e(d), (p, l) => (u(), x(e(m), {
38
37
  key: l,
39
38
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
40
- onClick: r((k) => T(l), ["stop"])
39
+ onClick: r((k) => E(l), ["stop"])
41
40
  }, {
42
41
  default: s(() => [
43
42
  o("div", {
44
- class: L([
43
+ class: U([
45
44
  "flex items-center justify-center rounded-full p-[3px] w-4 h-4 group-hover/item:shadow-border",
46
45
  e(f).uid === l ? "bg-blue text-b-1" : "text-transparent"
47
46
  ])
@@ -71,7 +70,7 @@ const H = { class: "flex items-center text-sm w-[inherit]" }, J = { class: "font
71
70
  ]),
72
71
  _: 2
73
72
  }, 1032, ["onMousedown", "onTouchend"]),
74
- b.value ? (u(), x(e(q), {
73
+ b.value ? (u(), x(e(F), {
75
74
  key: 0,
76
75
  class: "z-10",
77
76
  side: "bottom"
@@ -140,10 +139,10 @@ const H = { class: "flex items-center text-sm w-[inherit]" }, J = { class: "font
140
139
  ]),
141
140
  _: 2
142
141
  }, 1032, ["onClick"]))), 128)),
143
- t(e(F)),
142
+ t(e(P)),
144
143
  t(e(m), {
145
144
  class: "flex items-center gap-1.5",
146
- onClick: E
145
+ onClick: j
147
146
  }, {
148
147
  default: s(() => [
149
148
  o("div", se, [
@@ -186,25 +185,25 @@ const H = { class: "flex items-center text-sm w-[inherit]" }, J = { class: "font
186
185
  title: "Delete workspace"
187
186
  }, {
188
187
  default: s(() => [
189
- t(U, {
190
- variableName: h.value,
188
+ t(V, {
189
+ variableName: v.value,
191
190
  warningMessage: "This cannot be undone. You’re about to delete the workspace and everything inside it.",
192
191
  onClose: a[2] || (a[2] = (p) => e(w).hide()),
193
- onDelete: B
192
+ onDelete: R
194
193
  }, null, 8, ["variableName"])
195
194
  ]),
196
195
  _: 1
197
196
  }, 8, ["state"]),
198
197
  t(e(N), {
199
198
  size: "xxs",
200
- state: e(v),
199
+ state: e(h),
201
200
  title: "Rename Workspace"
202
201
  }, {
203
202
  default: s(() => [
204
- t(V, {
205
- name: h.value,
206
- onClose: a[3] || (a[3] = (p) => e(v).hide()),
207
- onEdit: j
203
+ t(q, {
204
+ name: v.value,
205
+ onClose: a[3] || (a[3] = (p) => e(h).hide()),
206
+ onEdit: B
208
207
  }, null, 8, ["name"])
209
208
  ]),
210
209
  _: 1
@@ -213,5 +212,5 @@ const H = { class: "flex items-center text-sm w-[inherit]" }, J = { class: "font
213
212
  }
214
213
  });
215
214
  export {
216
- ue as default
215
+ pe as default
217
216
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.1.19",
21
+ "version": "2.1.21",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -157,17 +157,17 @@
157
157
  "whatwg-mimetype": "^4.0.0",
158
158
  "yaml": "^2.4.5",
159
159
  "zod": "^3.23.8",
160
- "@scalar/icons": "0.1.0",
161
- "@scalar/components": "0.12.51",
162
160
  "@scalar/draggable": "0.1.5",
163
- "@scalar/oas-utils": "0.2.54",
161
+ "@scalar/components": "0.12.53",
162
+ "@scalar/oas-utils": "0.2.55",
163
+ "@scalar/icons": "0.1.0",
164
164
  "@scalar/object-utils": "1.1.10",
165
165
  "@scalar/openapi-parser": "0.8.6",
166
166
  "@scalar/openapi-types": "0.1.2",
167
- "@scalar/types": "0.0.14",
168
167
  "@scalar/themes": "0.9.36",
168
+ "@scalar/types": "0.0.14",
169
169
  "@scalar/use-toasts": "0.7.6",
170
- "@scalar/use-codemirror": "0.11.18",
170
+ "@scalar/use-codemirror": "0.11.20",
171
171
  "@scalar/use-tooltip": "1.0.2"
172
172
  },
173
173
  "devDependencies": {
@@ -1,2 +0,0 @@
1
- export declare const cancelRequestBus: import("@vueuse/core").UseEventBusReturn<void, any>;
2
- //# sourceMappingURL=cancel-request-bus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-request-bus.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/cancel-request-bus.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB,qDAAmC,CAAA"}
@@ -1,5 +0,0 @@
1
- import { useEventBus as e } from "@vueuse/core";
2
- const s = Symbol(), c = e(s);
3
- export {
4
- c as cancelRequestBus
5
- };
@@ -1,14 +0,0 @@
1
- import type { CommandNames } from '../../components/CommandPalette/TheCommandPalette.vue.js';
2
- export type CommandPaletteEvent = {
3
- /** The command name which matches with the command palette */
4
- commandName?: CommandNames;
5
- /** Any extra metadata we want to pass to the command palettes */
6
- metaData?: Record<string, any>;
7
- };
8
- /**
9
- * Event bus for controlling the Command Palette
10
- *
11
- * @param commandName - the command name you wish to execute, leave empty for the full palette
12
- */
13
- export declare const commandPaletteBus: import("@vueuse/core").UseEventBusReturn<CommandPaletteEvent, any>;
14
- //# sourceMappingURL=command-palette-bus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-palette-bus.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/command-palette-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAA;AAGrF,MAAM,MAAM,mBAAmB,GAAG;IAChC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B,CAAA;AAGD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,oEAAiC,CAAA"}
@@ -1,5 +0,0 @@
1
- import { useEventBus as t } from "@vueuse/core";
2
- const e = Symbol(), m = t(e);
3
- export {
4
- m as commandPaletteBus
5
- };
@@ -1,2 +0,0 @@
1
- export declare const executeRequestBus: import("@vueuse/core").UseEventBusReturn<void, any>;
2
- //# sourceMappingURL=execute-request-bus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execute-request-bus.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/execute-request-bus.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB,qDAAoC,CAAA"}