@scalar/api-client 2.2.23 → 2.2.25
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 +18 -0
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +63 -55
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +17 -16
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +97 -97
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +55 -61
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.2.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 00feb3e: fix: params not saving or sending
|
|
8
|
+
|
|
9
|
+
## 2.2.24
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 6890d7e: style: updates address bar server ui for multi server type
|
|
14
|
+
- ca2d98b: fix: sets active server on send request for non draft request only
|
|
15
|
+
- 6890d7e: fix: updates selected server logic on collection server selection
|
|
16
|
+
- Updated dependencies [ca2d98b]
|
|
17
|
+
- @scalar/oas-utils@0.2.93
|
|
18
|
+
- @scalar/import@0.2.13
|
|
19
|
+
- @scalar/postman-to-openapi@0.1.16
|
|
20
|
+
|
|
3
21
|
## 2.2.23
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AAyVA,wBAMG"}
|
|
@@ -1,88 +1,96 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActiveEntities as
|
|
3
|
-
import { ScalarDropdown as
|
|
4
|
-
import
|
|
5
|
-
import { useWorkspace as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as U, computed as i, watch as V, openBlock as l, createBlock as p, unref as o, withCtx as m, createElementBlock as a, createCommentVNode as x, Fragment as d, renderList as b, createVNode as c, createElementVNode as n, createTextVNode as E, toDisplayString as O } from "vue";
|
|
2
|
+
import { useActiveEntities as R } from "../../store/active-entities.js";
|
|
3
|
+
import { ScalarDropdown as W, ScalarDropdownDivider as h, ScalarDropdownItem as I, ScalarIcon as L } from "@scalar/components";
|
|
4
|
+
import g from "./AddressBarServerItem.vue.js";
|
|
5
|
+
import { useWorkspace as T } from "../../store/store.js";
|
|
6
|
+
const j = {
|
|
7
7
|
class: "font-code lg:text-sm text-xs whitespace-nowrap border border-b-3 border-solid rounded px-1.5 py-0.5 text-c-2 -outline-offset-1",
|
|
8
8
|
type: "button"
|
|
9
|
-
},
|
|
9
|
+
}, z = {
|
|
10
10
|
key: 0,
|
|
11
|
-
class: "text-xxs text-c-2
|
|
12
|
-
},
|
|
11
|
+
class: "text-xxs text-c-2 px-2.5 py-1"
|
|
12
|
+
}, F = { class: "flex items-center justify-center h-4 w-4" }, J = /* @__PURE__ */ U({
|
|
13
13
|
__name: "AddressBarServer",
|
|
14
|
-
setup(
|
|
15
|
-
const { activeRequest:
|
|
14
|
+
setup(M) {
|
|
15
|
+
const { activeRequest: u, activeCollection: f, activeServer: v } = R(), { isReadOnly: A, servers: S, collectionMutators: C, events: D } = T(), y = i(
|
|
16
16
|
() => {
|
|
17
|
-
var
|
|
18
|
-
return (e = (
|
|
17
|
+
var r, e;
|
|
18
|
+
return (e = (r = u.value) == null ? void 0 : r.servers) == null ? void 0 : e.map((t) => {
|
|
19
19
|
var s;
|
|
20
20
|
return {
|
|
21
|
-
id:
|
|
22
|
-
label: ((s = S[
|
|
21
|
+
id: t,
|
|
22
|
+
label: ((s = S[t]) == null ? void 0 : s.url) ?? "Unknown server"
|
|
23
23
|
};
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
),
|
|
26
|
+
), w = i(
|
|
27
27
|
() => {
|
|
28
|
-
var
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
var r, e;
|
|
29
|
+
return (
|
|
30
|
+
// Filters out servers already present in the request
|
|
31
|
+
(e = (r = f.value) == null ? void 0 : r.servers) == null ? void 0 : e.filter(
|
|
32
|
+
(t) => {
|
|
33
|
+
var s, _;
|
|
34
|
+
return !((_ = (s = u.value) == null ? void 0 : s.servers) != null && _.includes(t));
|
|
35
|
+
}
|
|
36
|
+
).map((t) => {
|
|
37
|
+
var s;
|
|
38
|
+
return {
|
|
39
|
+
id: t,
|
|
40
|
+
label: ((s = S[t]) == null ? void 0 : s.url) ?? "Unknown server"
|
|
41
|
+
};
|
|
42
|
+
})
|
|
43
|
+
);
|
|
36
44
|
}
|
|
37
45
|
), k = i(
|
|
38
46
|
() => {
|
|
39
|
-
var
|
|
40
|
-
return ((
|
|
47
|
+
var r, e;
|
|
48
|
+
return ((r = y.value) == null ? void 0 : r.length) && ((e = w.value) == null ? void 0 : e.length);
|
|
41
49
|
}
|
|
42
50
|
);
|
|
43
|
-
|
|
51
|
+
V([f, u], ([r, e]) => {
|
|
44
52
|
var s;
|
|
45
|
-
if (!
|
|
53
|
+
if (!r || r.selectedServerUid || e != null && e.selectedServerUid)
|
|
46
54
|
return;
|
|
47
|
-
const
|
|
48
|
-
|
|
55
|
+
const t = (s = r.servers) == null ? void 0 : s[0];
|
|
56
|
+
t && C.edit(r.uid, "selectedServerUid", t);
|
|
49
57
|
});
|
|
50
|
-
const
|
|
58
|
+
const N = () => D.commandPalette.emit({
|
|
51
59
|
commandName: "Add Server"
|
|
52
|
-
}),
|
|
53
|
-
var
|
|
54
|
-
return (e = (
|
|
60
|
+
}), B = i(() => {
|
|
61
|
+
var r, e, t;
|
|
62
|
+
return (e = (r = v.value) == null ? void 0 : r.url) != null && e.endsWith("/") ? v.value.url.slice(0, -1) : ((t = v.value) == null ? void 0 : t.url) || "";
|
|
55
63
|
});
|
|
56
|
-
return (
|
|
64
|
+
return (r, e) => (l(), p(o(W), {
|
|
57
65
|
class: "w-max",
|
|
58
66
|
teleport: ""
|
|
59
67
|
}, {
|
|
60
68
|
items: m(() => [
|
|
61
|
-
k.value ? (
|
|
62
|
-
(
|
|
63
|
-
key:
|
|
64
|
-
serverOption:
|
|
69
|
+
k.value ? (l(), a("div", z, " Request ")) : x("", !0),
|
|
70
|
+
(l(!0), a(d, null, b(y.value, (t) => (l(), p(g, {
|
|
71
|
+
key: t.id,
|
|
72
|
+
serverOption: t,
|
|
65
73
|
type: "request"
|
|
66
74
|
}, null, 8, ["serverOption"]))), 128)),
|
|
67
|
-
k.value ? (
|
|
68
|
-
c(
|
|
69
|
-
e[1] || (e[1] = n("div", { class: "text-xxs text-c-2
|
|
70
|
-
], 64)) :
|
|
71
|
-
(
|
|
72
|
-
key:
|
|
73
|
-
serverOption:
|
|
75
|
+
k.value ? (l(), a(d, { key: 1 }, [
|
|
76
|
+
c(o(h)),
|
|
77
|
+
e[1] || (e[1] = n("div", { class: "text-xxs text-c-2 px-2.5 py-1" }, "Collection", -1))
|
|
78
|
+
], 64)) : x("", !0),
|
|
79
|
+
(l(!0), a(d, null, b(w.value, (t) => (l(), p(g, {
|
|
80
|
+
key: t.id,
|
|
81
|
+
serverOption: t,
|
|
74
82
|
type: "collection"
|
|
75
83
|
}, null, 8, ["serverOption"]))), 128)),
|
|
76
|
-
|
|
77
|
-
c(
|
|
78
|
-
c(
|
|
84
|
+
o(A) ? x("", !0) : (l(), a(d, { key: 2 }, [
|
|
85
|
+
c(o(h)),
|
|
86
|
+
c(o(I), null, {
|
|
79
87
|
default: m(() => [
|
|
80
88
|
n("div", {
|
|
81
89
|
class: "font-code text-xxs flex items-center gap-1.5",
|
|
82
|
-
onClick:
|
|
90
|
+
onClick: N
|
|
83
91
|
}, [
|
|
84
|
-
n("div",
|
|
85
|
-
c(
|
|
92
|
+
n("div", F, [
|
|
93
|
+
c(o(L), {
|
|
86
94
|
icon: "Add",
|
|
87
95
|
size: "sm"
|
|
88
96
|
})
|
|
@@ -95,9 +103,9 @@ const T = {
|
|
|
95
103
|
], 64))
|
|
96
104
|
]),
|
|
97
105
|
default: m(() => [
|
|
98
|
-
n("button",
|
|
106
|
+
n("button", j, [
|
|
99
107
|
e[0] || (e[0] = n("span", { class: "sr-only" }, "Server:", -1)),
|
|
100
|
-
|
|
108
|
+
E(" " + O(B.value), 1)
|
|
101
109
|
])
|
|
102
110
|
]),
|
|
103
111
|
_: 1
|
|
@@ -105,5 +113,5 @@ const T = {
|
|
|
105
113
|
}
|
|
106
114
|
});
|
|
107
115
|
export {
|
|
108
|
-
|
|
116
|
+
J as default
|
|
109
117
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"AAyEA,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CACvD;;kBAIe,YAAY;UACpB,YAAY,GAAG,SAAS;;kBADhB,YAAY;UACpB,YAAY,GAAG,SAAS;;AAJhC,wBAyJK"}
|
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActiveEntities as
|
|
1
|
+
import { defineComponent as m, openBlock as f, createBlock as S, unref as l, withCtx as h, createElementVNode as n, normalizeClass as w, createVNode as k, toDisplayString as x } from "vue";
|
|
2
|
+
import { useActiveEntities as g } from "../../store/active-entities.js";
|
|
3
3
|
import { ScalarDropdownItem as y, ScalarIcon as C } from "@scalar/components";
|
|
4
4
|
import { useWorkspace as O } from "../../store/store.js";
|
|
5
|
-
const b = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */
|
|
5
|
+
const b = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */ m({
|
|
6
6
|
__name: "AddressBarServerItem",
|
|
7
7
|
props: {
|
|
8
8
|
serverOption: {},
|
|
9
9
|
type: {}
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
setup(a) {
|
|
12
|
+
const i = a, { activeCollection: o, activeRequest: r, activeServer: c } = g(), { collectionMutators: p, requestMutators: d } = O(), u = (e) => {
|
|
13
|
+
var t, s;
|
|
14
|
+
i.type === "collection" && o.value ? ((s = (t = r.value) == null ? void 0 : t.servers) != null && s.length && (r.value.selectedServerUid = ""), p.edit(
|
|
14
15
|
o.value.uid,
|
|
15
16
|
"selectedServerUid",
|
|
16
17
|
e
|
|
17
|
-
) :
|
|
18
|
-
|
|
18
|
+
)) : i.type === "request" && r.value && d.edit(
|
|
19
|
+
r.value.uid,
|
|
19
20
|
"selectedServerUid",
|
|
20
21
|
e
|
|
21
22
|
);
|
|
22
|
-
},
|
|
23
|
+
}, v = (e) => {
|
|
23
24
|
var t;
|
|
24
|
-
return ((t =
|
|
25
|
+
return ((t = c.value) == null ? void 0 : t.uid) === e;
|
|
25
26
|
};
|
|
26
|
-
return (e, t) => (
|
|
27
|
+
return (e, t) => (f(), S(l(y), {
|
|
27
28
|
key: "serverOption.id",
|
|
28
29
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
|
|
29
30
|
value: e.serverOption.id,
|
|
30
|
-
onClick: t[0] || (t[0] = (
|
|
31
|
+
onClick: t[0] || (t[0] = (s) => u(e.serverOption.id))
|
|
31
32
|
}, {
|
|
32
|
-
default:
|
|
33
|
+
default: h(() => [
|
|
33
34
|
n("div", {
|
|
34
35
|
class: w([
|
|
35
36
|
"flex size-4 items-center justify-center p-0.75 text-b-1 rounded-full",
|
|
36
|
-
|
|
37
|
+
v(e.serverOption.id) ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
|
|
37
38
|
])
|
|
38
39
|
}, [
|
|
39
|
-
|
|
40
|
+
k(l(C), {
|
|
40
41
|
icon: "Checkmark",
|
|
41
42
|
size: "xs",
|
|
42
43
|
thickness: "2.5"
|
|
43
44
|
})
|
|
44
45
|
], 2),
|
|
45
|
-
n("span", b,
|
|
46
|
+
n("span", b, x(e.serverOption.label), 1)
|
|
46
47
|
]),
|
|
47
48
|
_: 1
|
|
48
49
|
}, 8, ["value"]));
|