@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.
- package/CHANGELOG.md +47 -0
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +16 -15
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +35 -30
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts +3 -0
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -0
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +114 -0
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue2.js +4 -0
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +112 -64
- package/dist/layouts/App/create-api-client-app.d.ts +153 -129
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +306 -258
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +153 -129
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.d.ts +1 -1
- package/dist/libs/local-storage.js +1 -1
- package/dist/libs/normalizeHeaders.d.ts +1 -2
- package/dist/libs/normalizeHeaders.d.ts.map +1 -1
- package/dist/libs/sendRequest.d.ts +4 -5
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +104 -86
- package/dist/store/workspace.d.ts +302 -257
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +219 -216
- package/dist/style.css +1 -1
- package/dist/views/Environment/Environment.vue2.js +12 -12
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +54 -52
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +4 -4
- package/dist/views/Request/Request.vue2.js +91 -89
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +82 -80
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +20 -20
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +47 -42
- package/package.json +8 -8
|
@@ -1,108 +1,156 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
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: "
|
|
12
|
-
},
|
|
12
|
+
class: "h-full w-full"
|
|
13
|
+
}, fe = /* @__PURE__ */ z({
|
|
13
14
|
__name: "TopNav",
|
|
14
15
|
props: {
|
|
15
16
|
openNewTab: {}
|
|
16
17
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
function
|
|
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 =
|
|
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 =
|
|
24
|
-
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:
|
|
28
|
-
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
|
|
33
|
-
|
|
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,
|
|
37
|
+
t.push({ label: "", path: "", icon: "Add" }), o.value = t.length - 1, k();
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
o.value = e,
|
|
39
|
+
function r(e) {
|
|
40
|
+
o.value = e, v();
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
-
() =>
|
|
42
|
+
C(
|
|
43
|
+
() => i.currentRoute.value.path,
|
|
43
44
|
() => {
|
|
44
|
-
|
|
45
|
+
k();
|
|
45
46
|
},
|
|
46
47
|
{ immediate: !0 }
|
|
47
48
|
);
|
|
48
|
-
function
|
|
49
|
+
function _(e) {
|
|
49
50
|
t.splice(e, 1), o.value = Math.min(
|
|
50
51
|
o.value,
|
|
51
52
|
t.length - 1
|
|
52
|
-
),
|
|
53
|
+
), v();
|
|
53
54
|
}
|
|
54
|
-
const
|
|
55
|
+
const N = (e) => {
|
|
55
56
|
const a = new URL(window.location.href);
|
|
56
|
-
a.pathname = t[e].path,
|
|
57
|
-
},
|
|
58
|
-
t.splice(0, e), t.splice(1), o.value = 0,
|
|
59
|
-
},
|
|
60
|
-
if (e.addTopNav && m(), e.closeTopNav &&
|
|
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 &&
|
|
63
|
+
a >= 0 && a < t.length && r(a);
|
|
63
64
|
}
|
|
64
|
-
e.jumpToLastTab &&
|
|
65
|
-
},
|
|
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
|
|
73
|
-
() =>
|
|
73
|
+
return C(
|
|
74
|
+
() => S.openNewTab,
|
|
74
75
|
(e) => {
|
|
75
|
-
e &&
|
|
76
|
+
e && $(e);
|
|
76
77
|
},
|
|
77
78
|
{ immediate: !0 }
|
|
78
|
-
),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
t.length === 1 ? (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
164
|
+
fe as default
|
|
117
165
|
};
|