@scalar/api-client 2.2.15 → 2.2.16
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
CHANGED
|
@@ -11,9 +11,9 @@ const S = /* @__PURE__ */ P({
|
|
|
11
11
|
paramKey: {}
|
|
12
12
|
},
|
|
13
13
|
setup(E) {
|
|
14
|
-
const
|
|
14
|
+
const s = E, { activeRequest: o, activeExample: n, activeServer: d } = M(), { requestMutators: v, requestExampleMutators: f } = T(), l = _(() => {
|
|
15
15
|
const e = n.value;
|
|
16
|
-
return e ? e.parameters[
|
|
16
|
+
return e ? e.parameters[s.paramKey].map((t) => {
|
|
17
17
|
var r;
|
|
18
18
|
return {
|
|
19
19
|
...t,
|
|
@@ -21,47 +21,47 @@ const S = /* @__PURE__ */ P({
|
|
|
21
21
|
};
|
|
22
22
|
}) : [];
|
|
23
23
|
}), K = (e, t, r) => {
|
|
24
|
-
var
|
|
25
|
-
if (!
|
|
26
|
-
const
|
|
24
|
+
var p, a;
|
|
25
|
+
if (!o.value || !n.value) return;
|
|
26
|
+
const u = n.value.parameters[s.paramKey], i = (p = u[e]) == null ? void 0 : p.key;
|
|
27
27
|
if (t === "key") {
|
|
28
|
-
if ((a =
|
|
28
|
+
if ((a = u[e]) != null && a.required)
|
|
29
29
|
return;
|
|
30
30
|
if (r) {
|
|
31
|
-
const c = encodeURIComponent(
|
|
31
|
+
const c = encodeURIComponent(i), m = encodeURIComponent(r), x = new RegExp(`(?<=/):${c}(?=[/?#]|$)`, "g"), C = o.value.path.replace(
|
|
32
32
|
x,
|
|
33
33
|
`:${m}`
|
|
34
34
|
);
|
|
35
|
-
|
|
35
|
+
v.edit(o.value.uid, "path", C);
|
|
36
36
|
} else {
|
|
37
|
-
|
|
38
|
-
const c = new RegExp(`/:${encodeURIComponent(
|
|
39
|
-
|
|
37
|
+
u.splice(e, 1);
|
|
38
|
+
const c = new RegExp(`/:${encodeURIComponent(i)}(?=[/?#]|$)`, "g"), m = o.value.path.replace(c, "");
|
|
39
|
+
v.edit(o.value.uid, "path", m);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
f.edit(
|
|
43
43
|
n.value.uid,
|
|
44
|
-
`parameters.${
|
|
44
|
+
`parameters.${s.paramKey}.${e}.${t}`,
|
|
45
45
|
r
|
|
46
46
|
);
|
|
47
47
|
}, k = (e) => {
|
|
48
|
-
var
|
|
48
|
+
var p;
|
|
49
49
|
if (!n.value) return;
|
|
50
|
-
const t = ((
|
|
51
|
-
(a) =>
|
|
50
|
+
const t = ((p = e.match(N.PATH)) == null ? void 0 : p.map((a) => a.slice(1, -1))) || [], r = n.value.parameters[s.paramKey], u = new Map(r.map((a) => [a.key, a])), i = t.map(
|
|
51
|
+
(a) => u.get(a) || { key: a, value: "", enabled: !0 }
|
|
52
52
|
);
|
|
53
53
|
r.forEach((a) => {
|
|
54
|
-
!t.includes(a.key) && (a.value || a.required) &&
|
|
55
|
-
}), r.splice(0, r.length, ...
|
|
54
|
+
!t.includes(a.key) && (a.value || a.required) && i.push(a);
|
|
55
|
+
}), r.splice(0, r.length, ...i), f.edit(
|
|
56
56
|
n.value.uid,
|
|
57
|
-
`parameters.${
|
|
57
|
+
`parameters.${s.paramKey}`,
|
|
58
58
|
r
|
|
59
59
|
);
|
|
60
60
|
}, h = (e) => {
|
|
61
61
|
e && k(e);
|
|
62
62
|
};
|
|
63
63
|
return y(
|
|
64
|
-
() =>
|
|
64
|
+
() => o.value,
|
|
65
65
|
(e) => {
|
|
66
66
|
var t;
|
|
67
67
|
e && h((t = d.value) == null ? void 0 : t.url);
|
|
@@ -75,17 +75,17 @@ const S = /* @__PURE__ */ P({
|
|
|
75
75
|
e !== t && h(e);
|
|
76
76
|
}
|
|
77
77
|
), (e, t) => (g(), R(V, {
|
|
78
|
-
itemCount:
|
|
78
|
+
itemCount: l.value.length
|
|
79
79
|
}, {
|
|
80
80
|
title: $(() => [
|
|
81
81
|
b(q(e.title), 1)
|
|
82
82
|
]),
|
|
83
83
|
default: $(() => [
|
|
84
|
-
|
|
84
|
+
l.value.length ? (g(), R(U, {
|
|
85
85
|
key: 0,
|
|
86
86
|
class: "flex-1",
|
|
87
87
|
isEnabledHidden: "",
|
|
88
|
-
items:
|
|
88
|
+
items: l.value,
|
|
89
89
|
onUpdateRow: K
|
|
90
90
|
}, null, 8, ["items"])) : w("", !0)
|
|
91
91
|
]),
|
|
@@ -17,7 +17,7 @@ const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
|
|
|
17
17
|
a.commandPalette.emit({ commandName: "Create Request" });
|
|
18
18
|
}, y = (i) => {
|
|
19
19
|
i != null && i.createNew && v.name === "request" && f();
|
|
20
|
-
}, h = "2.2.
|
|
20
|
+
}, h = "2.2.16";
|
|
21
21
|
return R(() => a.hotKeys.on(y)), C(() => a.hotKeys.off(y)), (i, e) => (r(), l("div", K, [
|
|
22
22
|
o("div", {
|
|
23
23
|
class: k(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.2.
|
|
21
|
+
"version": "2.2.16",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -170,17 +170,17 @@
|
|
|
170
170
|
"yaml": "^2.4.5",
|
|
171
171
|
"zod": "^3.23.8",
|
|
172
172
|
"@scalar/components": "0.13.7",
|
|
173
|
-
"@scalar/draggable": "0.1.7",
|
|
174
|
-
"@scalar/import": "0.2.9",
|
|
175
173
|
"@scalar/icons": "0.1.2",
|
|
176
|
-
"@scalar/oas-utils": "0.2.90",
|
|
177
|
-
"@scalar/openapi-parser": "0.10.1",
|
|
178
|
-
"@scalar/postman-to-openapi": "0.1.13",
|
|
179
174
|
"@scalar/object-utils": "1.1.12",
|
|
180
|
-
"@scalar/
|
|
175
|
+
"@scalar/openapi-parser": "0.10.1",
|
|
176
|
+
"@scalar/draggable": "0.1.7",
|
|
181
177
|
"@scalar/openapi-types": "0.1.5",
|
|
178
|
+
"@scalar/import": "0.2.9",
|
|
179
|
+
"@scalar/postman-to-openapi": "0.1.13",
|
|
182
180
|
"@scalar/use-codemirror": "0.11.51",
|
|
181
|
+
"@scalar/oas-utils": "0.2.90",
|
|
183
182
|
"@scalar/use-hooks": "0.1.10",
|
|
183
|
+
"@scalar/themes": "0.9.57",
|
|
184
184
|
"@scalar/use-toasts": "0.7.7",
|
|
185
185
|
"@scalar/types": "0.0.25",
|
|
186
186
|
"@scalar/use-tooltip": "1.0.4"
|