@scalar/api-client 2.0.59 → 2.0.62

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 (47) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  3. package/dist/components/CodeInput/CodeInput.vue2.js +16 -15
  4. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  5. package/dist/components/CodeInput/codeVariableWidget.js +35 -30
  6. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts +3 -0
  7. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -0
  8. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +114 -0
  9. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue2.js +4 -0
  10. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  11. package/dist/components/TopNav/TopNav.vue.js +2 -2
  12. package/dist/components/TopNav/TopNav.vue2.js +112 -64
  13. package/dist/layouts/App/create-api-client-app.d.ts +153 -129
  14. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  15. package/dist/layouts/Modal/create-api-client-modal.d.ts +306 -258
  16. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  17. package/dist/libs/create-client.d.ts +153 -129
  18. package/dist/libs/create-client.d.ts.map +1 -1
  19. package/dist/libs/event-busses/hot-keys-bus.d.ts +1 -1
  20. package/dist/libs/local-storage.js +1 -1
  21. package/dist/libs/normalizeHeaders.d.ts +1 -2
  22. package/dist/libs/normalizeHeaders.d.ts.map +1 -1
  23. package/dist/libs/sendRequest.d.ts +4 -5
  24. package/dist/libs/sendRequest.d.ts.map +1 -1
  25. package/dist/libs/sendRequest.js +104 -86
  26. package/dist/store/workspace.d.ts +302 -257
  27. package/dist/store/workspace.d.ts.map +1 -1
  28. package/dist/store/workspace.js +219 -216
  29. package/dist/style.css +1 -1
  30. package/dist/views/Environment/Environment.vue2.js +12 -12
  31. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  32. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +54 -52
  33. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  34. package/dist/views/Request/Request.vue.js +4 -4
  35. package/dist/views/Request/Request.vue2.js +91 -89
  36. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  37. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  38. package/dist/views/Request/RequestSection/RequestTable.vue2.js +1 -1
  39. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  40. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  41. package/dist/views/Request/RequestSidebarItem.vue2.js +82 -80
  42. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +2 -2
  43. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  44. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +20 -20
  45. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  46. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +47 -42
  47. package/package.json +8 -8
@@ -1,108 +1,156 @@
1
- import { defineComponent as L, reactive as R, ref as j, computed as B, watch as T, onMounted as A, onBeforeUnmount as E, openBlock as s, createElementBlock as h, createElementVNode as p, createVNode as g, unref as N, toDisplayString as M, Fragment as O, renderList as $, createBlock as z, pushScopeId as V, popScopeId as q } from "vue";
2
- import { ROUTES as K } from "../../constants.js";
3
- import { useClipboard as D } from "../../hooks/useClipboard.js";
4
- import { ScalarIcon as _ } from "@scalar/components";
5
- import { capitalize as F } from "@scalar/oas-utils/helpers";
6
- import H from "./TopNavItem.vue.js";
7
- import { useWorkspace as W } from "../../store/workspace.js";
8
- import { hotKeyBus as k } from "../../libs/event-busses/hot-keys-bus.js";
9
- const G = (l) => (V("data-v-ec38eda3"), l = l(), q(), l), J = { class: "flex h-10 t-app__top-nav" }, P = /* @__PURE__ */ G(() => /* @__PURE__ */ p("div", { class: "t-app__top-nav-draggable" }, null, -1)), Q = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, X = {
1
+ import { defineComponent as z, reactive as A, ref as B, computed as M, watch as C, onMounted as j, onBeforeUnmount as E, openBlock as f, createElementBlock as g, createElementVNode as h, createVNode as n, unref as l, withCtx as u, toDisplayString as O, createTextVNode as x, Fragment as V, renderList as D, createBlock as q, pushScopeId as K, popScopeId as F } from "vue";
2
+ import H from "../ScalarHotkey.vue.js";
3
+ import { ROUTES as W } from "../../constants.js";
4
+ import { useClipboard as G } from "../../hooks/useClipboard.js";
5
+ import { ScalarContextMenu as J, ScalarIcon as d, ScalarDropdown as P, ScalarDropdownItem as I } from "@scalar/components";
6
+ import { capitalize as Q } from "@scalar/oas-utils/helpers";
7
+ import X from "./TopNavItem.vue.js";
8
+ import { useWorkspace as Y } from "../../store/workspace.js";
9
+ import { hotKeyBus as w } from "../../libs/event-busses/hot-keys-bus.js";
10
+ const Z = (s) => (K("data-v-53f7f946"), s = s(), F(), s), ee = { class: "flex h-10 t-app__top-nav" }, te = /* @__PURE__ */ Z(() => /* @__PURE__ */ h("div", { class: "t-app__top-nav-draggable" }, null, -1)), oe = { class: "flex h-10 flex-1 items-center gap-1.5 text-sm font-medium relative" }, ae = {
10
11
  key: 0,
11
- class: "flex items-center gap-1 w-full justify-center"
12
- }, ce = /* @__PURE__ */ L({
12
+ class: "h-full w-full"
13
+ }, fe = /* @__PURE__ */ z({
13
14
  __name: "TopNav",
14
15
  props: {
15
16
  openNewTab: {}
16
17
  },
17
- setup(l) {
18
- const y = l, { activeRequest: I, router: c } = W(), { copyToClipboard: C } = D(), t = R([{ label: "", path: "", icon: "Add" }]), o = j(0), x = B(() => o.value);
19
- function v() {
18
+ setup(s) {
19
+ const S = s, { activeRequest: L, router: i } = Y(), { copyToClipboard: U } = G(), t = A([{ label: "", path: "", icon: "Add" }]), o = B(0), T = M(() => o.value);
20
+ function k() {
20
21
  var a;
21
- const e = K.find((r) => c.currentRoute.value.name == r.name);
22
+ const e = W.find((p) => i.currentRoute.value.name == p.name);
22
23
  e && ((e == null ? void 0 : e.name) === "request" ? t[o.value] = {
23
- label: ((a = I.value) == null ? void 0 : a.summary) || "",
24
- path: c.currentRoute.value.path,
24
+ label: ((a = L.value) == null ? void 0 : a.summary) || "",
25
+ path: i.currentRoute.value.path,
25
26
  icon: e.icon
26
27
  } : t[o.value] = {
27
- label: F(e == null ? void 0 : e.name) || "",
28
- path: c.currentRoute.value.path,
28
+ label: Q(e == null ? void 0 : e.name) || "",
29
+ path: i.currentRoute.value.path,
29
30
  icon: e.icon
30
31
  });
31
32
  }
32
- function u() {
33
- c.push(t[o.value].path);
33
+ function v() {
34
+ i.push(t[o.value].path);
34
35
  }
35
36
  function m() {
36
- t.push({ label: "", path: "", icon: "Add" }), o.value = t.length - 1, v();
37
+ t.push({ label: "", path: "", icon: "Add" }), o.value = t.length - 1, k();
37
38
  }
38
- function i(e) {
39
- o.value = e, u();
39
+ function r(e) {
40
+ o.value = e, v();
40
41
  }
41
- T(
42
- () => c.currentRoute.value.path,
42
+ C(
43
+ () => i.currentRoute.value.path,
43
44
  () => {
44
- v();
45
+ k();
45
46
  },
46
47
  { immediate: !0 }
47
48
  );
48
- function f(e) {
49
+ function _(e) {
49
50
  t.splice(e, 1), o.value = Math.min(
50
51
  o.value,
51
52
  t.length - 1
52
- ), u();
53
+ ), v();
53
54
  }
54
- const w = (e) => {
55
+ const N = (e) => {
55
56
  const a = new URL(window.location.href);
56
- a.pathname = t[e].path, C(a.toString());
57
- }, S = (e) => {
58
- t.splice(0, e), t.splice(1), o.value = 0, u();
59
- }, b = (e) => {
60
- if (e.addTopNav && m(), e.closeTopNav && f(o.value), e.navigateTopNavLeft && i(Math.max(o.value - 1, 0)), e.navigateTopNavRight && i(Math.min(o.value + 1, t.length - 1)), e.jumpToTab) {
57
+ a.pathname = t[e].path, U(a.toString());
58
+ }, R = (e) => {
59
+ t.splice(0, e), t.splice(1), o.value = 0, v();
60
+ }, y = (e) => {
61
+ if (e.addTopNav && m(), e.closeTopNav && _(o.value), e.navigateTopNavLeft && r(Math.max(o.value - 1, 0)), e.navigateTopNavRight && r(Math.min(o.value + 1, t.length - 1)), e.jumpToTab) {
61
62
  const a = Number(e.jumpToTab.key) - 1;
62
- a >= 0 && a < t.length && i(a);
63
+ a >= 0 && a < t.length && r(a);
63
64
  }
64
- e.jumpToLastTab && i(t.length - 1);
65
- }, U = (e) => {
65
+ e.jumpToLastTab && r(t.length - 1);
66
+ }, $ = (e) => {
66
67
  t.push({
67
68
  label: e.name,
68
69
  path: e.uid,
69
70
  icon: "ExternalLink"
70
71
  });
71
72
  };
72
- return T(
73
- () => y.openNewTab,
73
+ return C(
74
+ () => S.openNewTab,
74
75
  (e) => {
75
- e && U(e);
76
+ e && $(e);
76
77
  },
77
78
  { immediate: !0 }
78
- ), A(() => k.on(b)), E(() => k.off(b)), (e, a) => (s(), h("nav", J, [
79
- P,
80
- p("div", Q, [
81
- t.length === 1 ? (s(), h("div", X, [
82
- g(N(_), {
83
- icon: t[0].icon,
84
- size: "xs",
85
- thickness: "2.5"
86
- }, null, 8, ["icon"]),
87
- p("div", null, M(t[0].label), 1)
88
- ])) : (s(!0), h(O, { key: 1 }, $(t, (r, n) => (s(), z(H, {
89
- key: n,
90
- active: n === x.value,
91
- hotkey: (n + 1).toString(),
92
- icon: r.icon,
93
- label: r.label,
94
- onClick: (d) => i(n),
95
- onClose: (d) => f(n),
96
- onCloseOtherTabs: (d) => S(n),
97
- onCopyUrl: (d) => w(n),
79
+ ), j(() => w.on(y)), E(() => w.off(y)), (e, a) => (f(), g("nav", ee, [
80
+ te,
81
+ h("div", oe, [
82
+ t.length === 1 ? (f(), g("div", ae, [
83
+ n(l(J), { triggerClass: "flex gap-1.5 h-full items-center justify-center w-full" }, {
84
+ trigger: u(() => [
85
+ n(l(d), {
86
+ icon: t[0].icon,
87
+ size: "xs",
88
+ thickness: "2.5"
89
+ }, null, 8, ["icon"]),
90
+ h("span", null, O(t[0].label), 1)
91
+ ]),
92
+ content: u(() => [
93
+ n(l(P), {
94
+ class: "scalar-client",
95
+ static: ""
96
+ }, {
97
+ items: u(() => [
98
+ n(l(I), {
99
+ class: "flex items-center gap-1.5",
100
+ onClick: m
101
+ }, {
102
+ default: u(() => [
103
+ n(l(d), {
104
+ icon: "AddTab",
105
+ size: "sm",
106
+ thickness: "1.5"
107
+ }),
108
+ x(" New Tab "),
109
+ n(H, {
110
+ class: "bg-b-2 ml-auto",
111
+ hotkey: "T"
112
+ })
113
+ ]),
114
+ _: 1
115
+ }),
116
+ n(l(I), {
117
+ class: "flex items-center gap-1.5",
118
+ onClick: a[0] || (a[0] = (p) => N(T.value))
119
+ }, {
120
+ default: u(() => [
121
+ n(l(d), {
122
+ icon: "Link",
123
+ size: "sm",
124
+ thickness: "1.5"
125
+ }),
126
+ x(" Copy URL ")
127
+ ]),
128
+ _: 1
129
+ })
130
+ ]),
131
+ _: 1
132
+ })
133
+ ]),
134
+ _: 1
135
+ })
136
+ ])) : (f(!0), g(V, { key: 1 }, D(t, (p, c) => (f(), q(X, {
137
+ key: c,
138
+ active: c === T.value,
139
+ hotkey: (c + 1).toString(),
140
+ icon: p.icon,
141
+ label: p.label,
142
+ onClick: (b) => r(c),
143
+ onClose: (b) => _(c),
144
+ onCloseOtherTabs: (b) => R(c),
145
+ onCopyUrl: (b) => N(c),
98
146
  onNewTab: m
99
147
  }, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
100
- p("button", {
148
+ h("button", {
101
149
  class: "text-c-3 hover:bg-b-3 p-1.5 rounded-lg webkit-app-no-drag",
102
150
  type: "button",
103
151
  onClick: m
104
152
  }, [
105
- g(N(_), {
153
+ n(l(d), {
106
154
  icon: "Add",
107
155
  size: "xs",
108
156
  thickness: "2.5"
@@ -113,5 +161,5 @@ const G = (l) => (V("data-v-ec38eda3"), l = l(), q(), l), J = { class: "flex h-1
113
161
  }
114
162
  });
115
163
  export {
116
- ce as default
164
+ fe as default
117
165
  };