@scalar/api-client 2.0.45 → 2.0.46

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 (69) hide show
  1. package/CHANGELOG.md +8 -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 +16 -16
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarHistory.vue.js +24 -25
  7. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  8. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  9. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +23 -23
  10. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +6 -6
  11. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  13. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +1 -1
  14. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  15. package/dist/components/ContextBar.vue.js +2 -2
  16. package/dist/components/ContextBar.vue2.js +10 -10
  17. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  18. package/dist/components/HttpMethod/HttpMethod.vue.js +5 -67
  19. package/dist/components/HttpMethod/HttpMethod.vue2.js +61 -2
  20. package/dist/components/Search/SearchModal.vue2.js +22 -22
  21. package/dist/components/SubpageHeader.vue.js +2 -2
  22. package/dist/components/SubpageHeader.vue2.js +2 -2
  23. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  24. package/dist/layouts/App/ApiClientApp.vue.js +46 -43
  25. package/dist/layouts/App/create-api-client-app.d.ts +158 -81
  26. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  27. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  28. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  29. package/dist/layouts/Modal/ApiClientModal.vue2.js +24 -20
  30. package/dist/layouts/Modal/create-api-client-modal.d.ts +316 -162
  31. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  32. package/dist/libs/create-client.d.ts +159 -83
  33. package/dist/libs/create-client.d.ts.map +1 -1
  34. package/dist/libs/create-client.js +18 -19
  35. package/dist/libs/event-busses/command-palette.d.ts.map +1 -0
  36. package/dist/libs/{eventBusses/executeRequestBus.d.ts → event-busses/execute-requestBus.d.ts} +1 -1
  37. package/dist/libs/event-busses/execute-requestBus.d.ts.map +1 -0
  38. package/dist/libs/event-busses/hot-key.d.ts +34 -0
  39. package/dist/libs/event-busses/hot-key.d.ts.map +1 -0
  40. package/dist/libs/event-busses/hot-key.js +25 -0
  41. package/dist/libs/event-busses/index.d.ts +5 -0
  42. package/dist/libs/event-busses/index.d.ts.map +1 -0
  43. package/dist/libs/event-busses/index.js +12 -0
  44. package/dist/libs/{eventBusses/requestStatusBus.d.ts → event-busses/request-status-bus.d.ts} +1 -1
  45. package/dist/libs/event-busses/request-status-bus.d.ts.map +1 -0
  46. package/dist/libs/index.d.ts +1 -1
  47. package/dist/libs/index.d.ts.map +1 -1
  48. package/dist/libs/index.js +19 -13
  49. package/dist/store/workspace.d.ts +316 -162
  50. package/dist/store/workspace.d.ts.map +1 -1
  51. package/dist/style.css +1 -1
  52. package/dist/views/Request/Request.vue.js +2 -2
  53. package/dist/views/Request/Request.vue2.js +4 -4
  54. package/dist/views/Request/RequestSidebarItem.vue2.js +32 -32
  55. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  56. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +19 -19
  57. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  58. package/dist/views/Request/components/WorkspaceDropdown.vue.js +9 -9
  59. package/package.json +6 -6
  60. package/dist/libs/eventBusses/command-palette.d.ts.map +0 -1
  61. package/dist/libs/eventBusses/executeRequestBus.d.ts.map +0 -1
  62. package/dist/libs/eventBusses/index.d.ts +0 -3
  63. package/dist/libs/eventBusses/index.d.ts.map +0 -1
  64. package/dist/libs/eventBusses/index.js +0 -6
  65. package/dist/libs/eventBusses/requestStatusBus.d.ts.map +0 -1
  66. /package/dist/libs/{eventBusses → event-busses}/command-palette.d.ts +0 -0
  67. /package/dist/libs/{eventBusses → event-busses}/command-palette.js +0 -0
  68. /package/dist/libs/{eventBusses/executeRequestBus.js → event-busses/execute-requestBus.js} +0 -0
  69. /package/dist/libs/{eventBusses/requestStatusBus.js → event-busses/request-status-bus.js} +0 -0
@@ -1,10 +1,10 @@
1
- import { defineComponent as y, ref as i, watch as b, computed as C, openBlock as w, createBlock as E, unref as d, withCtx as r, createElementVNode as h, createVNode as R, createTextVNode as m, toDisplayString as p, createElementBlock as F, Fragment as N, renderList as A, createSlots as D, pushScopeId as T, popScopeId as W } from "vue";
1
+ import { defineComponent as y, ref as i, watch as _, computed as C, openBlock as w, createBlock as E, unref as d, withCtx as r, createElementVNode as h, createVNode as R, createTextVNode as m, toDisplayString as p, createElementBlock as F, Fragment as N, renderList as A, createSlots as D, pushScopeId as T, popScopeId as W } from "vue";
2
2
  import { useWorkspace as L } from "../../store/workspace.js";
3
- import { ScalarModal as U, ScalarSearchInput as j, ScalarSearchResultList as K, ScalarSearchResultItem as O } from "@scalar/components";
4
- import { useMagicKeys as P, whenever as g } from "@vueuse/core";
5
- import z from "fuse.js";
6
- import { useRouter as G } from "vue-router";
7
- import H from "../HttpMethod/HttpMethod.vue.js";
3
+ import { ScalarModal as U, ScalarSearchInput as j, ScalarSearchResultList as H, ScalarSearchResultItem as K } from "@scalar/components";
4
+ import { useMagicKeys as O, whenever as g } from "@vueuse/core";
5
+ import P from "fuse.js";
6
+ import { useRouter as z } from "vue-router";
7
+ import G from "../HttpMethod/HttpMethod.vue.js";
8
8
  const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(() => /* @__PURE__ */ h("div", { class: "ref-search-meta" }, [
9
9
  /* @__PURE__ */ h("span", null, "↑↓ Navigate"),
10
10
  /* @__PURE__ */ h("span", null, "⏎ Select")
@@ -14,12 +14,12 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
14
14
  modalState: {}
15
15
  },
16
16
  setup(u) {
17
- const c = u, $ = G(), { activeWorkspaceRequests: B } = L(), v = P(), l = i([]), f = i([]), o = i(0), s = i(""), _ = i(null), S = new z(l.value, {
17
+ const c = u, M = z(), { activeWorkspaceRequests: B } = L(), v = O(), l = i([]), f = i([]), o = i(0), s = i(""), I = i(null), S = new P(l.value, {
18
18
  keys: ["title", "description", "body"]
19
- }), M = () => {
19
+ }), $ = () => {
20
20
  o.value = 0, f.value = S.search(s.value);
21
21
  };
22
- b(
22
+ _(
23
23
  () => c.modalState.open,
24
24
  (e) => {
25
25
  var a;
@@ -27,9 +27,9 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
27
27
  l.value.length > 0 && (l.value = [], S.setCollection(l.value));
28
28
  return;
29
29
  }
30
- (a = _.value) == null || a.focus(), s.value = "", o.value = 0, f.value = [];
30
+ (a = I.value) == null || a.focus(), s.value = "", o.value = 0, f.value = [];
31
31
  }
32
- ), b(
32
+ ), _(
33
33
  B,
34
34
  (e) => {
35
35
  Object.values(e).forEach((a) => {
@@ -44,8 +44,8 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
44
44
  },
45
45
  { immediate: !0 }
46
46
  );
47
- function I(e) {
48
- $.push(e.item.id), c.modalState.hide();
47
+ function V(e) {
48
+ M.push(e.item.id), c.modalState.hide();
49
49
  }
50
50
  const k = C(
51
51
  () => n.value[o.value]
@@ -55,7 +55,7 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
55
55
  })) : f.value
56
56
  );
57
57
  return g(v.enter, () => {
58
- c.modalState.open && window && I(k.value);
58
+ c.modalState.open && window && V(k.value);
59
59
  }), g(v.ArrowDown, () => {
60
60
  var e;
61
61
  c.modalState.open && window && (o.value < n.value.length - 1 ? o.value++ : o.value = 0, (e = document.getElementById(`search-modal-${k.value.item.id}`)) == null || e.scrollIntoView({
@@ -75,16 +75,16 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
75
75
  default: r(() => [
76
76
  h("div", {
77
77
  ref_key: "searchModalRef",
78
- ref: _,
78
+ ref: I,
79
79
  class: "ref-search-container"
80
80
  }, [
81
81
  R(d(j), {
82
82
  modelValue: s.value,
83
83
  "onUpdate:modelValue": a[0] || (a[0] = (t) => s.value = t),
84
- onInput: M
84
+ onInput: $
85
85
  }, null, 8, ["modelValue"])
86
86
  ], 512),
87
- R(d(K), {
87
+ R(d(H), {
88
88
  class: "ref-search-results custom-scroll",
89
89
  noResults: !n.value.length
90
90
  }, {
@@ -92,16 +92,16 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
92
92
  m(p(s.value), 1)
93
93
  ]),
94
94
  default: r(() => [
95
- (w(!0), F(N, null, A(n.value, (t, V) => (w(), E(d(O), {
95
+ (w(!0), F(N, null, A(n.value, (t, b) => (w(), E(d(K), {
96
96
  id: `#search-modal-${t.item.id}`,
97
97
  key: t.refIndex,
98
- active: o.value === V,
98
+ active: o.value === b,
99
99
  icon: "Terminal",
100
- onClick: (x) => I(t),
101
- onFocus: (x) => o.value = V
100
+ onClick: (x) => V(t),
101
+ onFocus: (x) => o.value = b
102
102
  }, D({
103
103
  addon: r(() => [
104
- R(d(H), {
104
+ R(d(G), {
105
105
  method: t.item.httpVerb ?? "get"
106
106
  }, null, 8, ["method"])
107
107
  ]),
@@ -1,7 +1,7 @@
1
- import a from "./SubpageHeader.vue2.js";
1
+ import e from "./SubpageHeader.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ o(a, [["__scopeId", "data-v-a15baa95"]]);
4
+ const p = /* @__PURE__ */ o(e, [["__scopeId", "data-v-8a69ee40"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,7 +1,7 @@
1
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
2
  import { ScalarIcon as _ } from "@scalar/components";
3
3
  import { useRoute as h } from "vue-router";
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({
4
+ const b = (e) => (m("data-v-8a69ee40"), 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();
@@ -10,7 +10,7 @@ const b = (e) => (m("data-v-a15baa95"), e = e(), f(), e), v = { class: "flex fle
10
10
  return l(), i("div", v, [
11
11
  r("div", x, [
12
12
  t(c, {
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",
13
+ class: "text-c-2 text-sm font-medium ml-1 flex items-center p-1.5 hover:bg-b-2 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
16
  default: p(() => [
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";AAqTA,wBAKG"}
1
+ {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";AAiVA,wBAKG"}
@@ -1,72 +1,75 @@
1
- import { defineComponent as u, onMounted as f, watchEffect as _, onBeforeMount as g, computed as h, openBlock as r, createElementBlock as m, Fragment as k, createElementVNode as i, createVNode as a, unref as s, withCtx as v, createBlock as p, KeepAlive as y, resolveDynamicComponent as S, createCommentVNode as x } from "vue";
2
- import T from "../../components/SideNav/SideNav.vue.js";
3
- import C from "../../components/TopNav/TopNav.vue.js";
4
- import { useWorkspace as w } from "../../store/workspace.js";
5
- import { addScalarClassesToHeadless as B } from "@scalar/components";
6
- import { LS_KEYS as L } from "@scalar/object-utils/mutator-record";
1
+ import { defineComponent as _, onMounted as i, watchEffect as v, onBeforeMount as y, onBeforeUnmount as h, computed as k, openBlock as l, createElementBlock as d, Fragment as g, createElementVNode as p, createVNode as a, unref as n, withCtx as w, createBlock as f, KeepAlive as S, resolveDynamicComponent as x, createCommentVNode as T } from "vue";
2
+ import C from "../../components/SideNav/SideNav.vue.js";
3
+ import L from "../../components/TopNav/TopNav.vue.js";
4
+ import { useWorkspace as B } from "../../store/workspace.js";
5
+ import { addScalarClassesToHeadless as E } from "@scalar/components";
6
+ import { LS_KEYS as K } from "@scalar/object-utils/mutator-record";
7
7
  import { getThemeStyles as M } from "@scalar/themes";
8
8
  import { ScalarToasts as W } from "@scalar/use-toasts";
9
9
  import { RouterView as A } from "vue-router";
10
- import { loadAllResources as E } from "../../libs/local-storage.js";
11
- import K from "../../components/CommandPalette/TheCommandPalette.vue.js";
12
- import { useDarkModeState as N } from "../../hooks/useDarkModeState.js";
13
- const b = ["innerHTML"], V = {
10
+ import { loadAllResources as D } from "../../libs/local-storage.js";
11
+ import N from "../../components/CommandPalette/TheCommandPalette.vue.js";
12
+ import { useDarkModeState as b } from "../../hooks/useDarkModeState.js";
13
+ import { handleHotKeyDown as H } from "../../libs/event-busses/hot-key.js";
14
+ const V = ["innerHTML"], F = {
14
15
  key: 0,
15
16
  class: "flex min-h-0 flex-1"
16
- }, D = { class: "flex flex-1 flex-col min-w-0" }, J = /* @__PURE__ */ u({
17
+ }, O = { class: "flex flex-1 flex-col min-w-0" }, ee = /* @__PURE__ */ _({
17
18
  __name: "ApiClientApp",
18
- setup(F) {
19
- f(() => {
20
- _(() => {
21
- document.body.classList.toggle("dark-mode", n.value), document.body.classList.toggle("light-mode", !n.value);
19
+ setup(P) {
20
+ i(() => {
21
+ v(() => {
22
+ document.body.classList.toggle("dark-mode", c.value), document.body.classList.toggle("light-mode", !c.value);
22
23
  });
23
24
  });
24
- const { isDark: n } = N(), t = w();
25
- g(async () => {
26
- if (localStorage.getItem(L.WORKSPACE)) {
27
- const l = {};
28
- let c = 0, o = 0, e = "";
25
+ const { isDark: c } = b(), r = B();
26
+ y(async () => {
27
+ if (localStorage.getItem(K.WORKSPACE)) {
28
+ const o = {};
29
+ let s = 0, t = 0, e = "";
29
30
  for (e in localStorage)
30
- Object.prototype.hasOwnProperty.call(localStorage, e) && (o = (localStorage[e].length + e.length) * 2, c += o, l[e] = (o / 1024).toFixed(2) + " KB");
31
- l.Total = (c / 1024).toFixed(2) + " KB", console.table(l), E(t);
31
+ Object.prototype.hasOwnProperty.call(localStorage, e) && (t = (localStorage[e].length + e.length) * 2, s += t, o[e] = (t / 1024).toFixed(2) + " KB");
32
+ o.Total = (s / 1024).toFixed(2) + " KB", console.table(o), D(r);
32
33
  } else
33
- t.workspaceMutators.add({
34
+ r.workspaceMutators.add({
34
35
  uid: "default",
35
36
  name: "Workspace",
36
37
  proxyUrl: "https://proxy.scalar.com"
37
38
  });
38
- B();
39
+ E();
39
40
  });
40
- const d = h(
41
- () => t.activeWorkspace.value && `<style>
42
- ${M(t.activeWorkspace.value.themeId, {
41
+ const m = (o) => H(o);
42
+ i(() => window.addEventListener("keydown", m)), h(() => window.removeEventListener("keydown", m));
43
+ const u = k(
44
+ () => r.activeWorkspace.value && `<style>
45
+ ${M(r.activeWorkspace.value.themeId, {
43
46
  fonts: !0
44
47
  })}</style>`
45
48
  );
46
- return (l, c) => {
47
- var o;
48
- return r(), m(k, null, [
49
- i("div", { innerHTML: d.value }, null, 8, b),
50
- a(C),
51
- (o = s(t).activeWorkspace.value) != null && o.uid ? (r(), m("main", V, [
52
- a(T),
53
- a(s(K)),
54
- i("div", D, [
55
- a(s(A), null, {
56
- default: v(({ Component: e }) => [
57
- (r(), p(y, null, [
58
- (r(), p(S(e)))
49
+ return (o, s) => {
50
+ var t;
51
+ return l(), d(g, null, [
52
+ p("div", { innerHTML: u.value }, null, 8, V),
53
+ a(L),
54
+ (t = n(r).activeWorkspace.value) != null && t.uid ? (l(), d("main", F, [
55
+ a(C),
56
+ a(n(N)),
57
+ p("div", O, [
58
+ a(n(A), null, {
59
+ default: w(({ Component: e }) => [
60
+ (l(), f(S, null, [
61
+ (l(), f(x(e)))
59
62
  ], 1024))
60
63
  ]),
61
64
  _: 1
62
65
  })
63
66
  ])
64
- ])) : x("", !0),
65
- a(s(W))
67
+ ])) : T("", !0),
68
+ a(n(W))
66
69
  ], 64);
67
70
  };
68
71
  }
69
72
  });
70
73
  export {
71
- J as default
74
+ ee as default
72
75
  };