@scalar/api-client 2.2.24 → 2.2.26
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
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.2.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [a36fada]
|
|
8
|
+
- @scalar/oas-utils@0.2.94
|
|
9
|
+
- @scalar/import@0.2.14
|
|
10
|
+
- @scalar/postman-to-openapi@0.1.17
|
|
11
|
+
|
|
12
|
+
## 2.2.25
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 00feb3e: fix: params not saving or sending
|
|
17
|
+
|
|
3
18
|
## 2.2.24
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AA8MA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAKxC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AAuUF,wBAOG"}
|
|
@@ -1,76 +1,70 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import
|
|
5
|
-
import { ScalarTooltip as
|
|
6
|
-
import { requestExampleParametersSchema as
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as K, computed as y, onMounted as $, ref as E, watch as S, openBlock as T, createBlock as A, withCtx as n, createTextVNode as h, toDisplayString as R, createElementVNode as i, createVNode as f, unref as k, withModifiers as z, nextTick as x } from "vue";
|
|
2
|
+
import B from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useActiveEntities as M } from "../../../store/active-entities.js";
|
|
4
|
+
import N from "./RequestTable.vue.js";
|
|
5
|
+
import { ScalarTooltip as V, ScalarButton as W } from "@scalar/components";
|
|
6
|
+
import { requestExampleParametersSchema as b } from "@scalar/oas-utils/entities/spec";
|
|
7
|
+
import { useWorkspace as D } from "../../../store/store.js";
|
|
8
|
+
const O = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, U = { class: "sr-only" }, Z = /* @__PURE__ */ K({
|
|
9
9
|
__name: "RequestParams",
|
|
10
10
|
props: {
|
|
11
11
|
title: {},
|
|
12
12
|
paramKey: {}
|
|
13
13
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
14
|
+
setup(_) {
|
|
15
|
+
const r = _, { activeRequest: u, activeExample: s } = M(), { requestExampleMutators: o } = D(), l = y(
|
|
16
16
|
() => {
|
|
17
17
|
var e;
|
|
18
|
-
return ((e = s.value) == null ? void 0 : e.parameters[
|
|
18
|
+
return ((e = s.value) == null ? void 0 : e.parameters[r.paramKey]) ?? [];
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
|
-
|
|
21
|
+
$(() => {
|
|
22
22
|
v();
|
|
23
23
|
});
|
|
24
24
|
const p = () => {
|
|
25
25
|
if (!u.value || !s.value) return;
|
|
26
|
-
const e =
|
|
26
|
+
const e = b.parse({ enabled: !1 }), t = [...l.value, e];
|
|
27
27
|
o.edit(
|
|
28
28
|
s.value.uid,
|
|
29
|
-
`parameters.${
|
|
29
|
+
`parameters.${r.paramKey}`,
|
|
30
30
|
t
|
|
31
31
|
);
|
|
32
|
-
},
|
|
33
|
-
var g, y, h, k, b, R, _;
|
|
32
|
+
}, m = E(null), q = (e, t, d) => {
|
|
34
33
|
if (!u.value || !s.value) return;
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
const a = [...
|
|
38
|
-
a[e]
|
|
39
|
-
|
|
40
|
-
[t]: d || "",
|
|
41
|
-
value: ((g = a[e]) == null ? void 0 : g.value) || "",
|
|
42
|
-
key: ((y = a[e]) == null ? void 0 : y.key) || "",
|
|
43
|
-
enabled: ((h = a[e]) == null ? void 0 : h.enabled) ?? !1
|
|
44
|
-
}, (((k = a[e]) == null ? void 0 : k.key) !== "" || ((b = a[e]) == null ? void 0 : b.value) !== "") && (a[e].enabled = !0), ((R = a[e]) == null ? void 0 : R.key) === "" && ((_ = a[e]) == null ? void 0 : _.value) === "" && a.splice(e, 1), o.edit(
|
|
34
|
+
const c = l.value;
|
|
35
|
+
if (c.length > e) {
|
|
36
|
+
const a = [...c];
|
|
37
|
+
if (!a[e]) return;
|
|
38
|
+
a[e] = { ...a[e], [t]: d }, (a[e].key !== "" || a[e].value !== "") && (a[e].enabled = !0), a[e].key === "" && a[e].value === "" && a.splice(e, 1), o.edit(
|
|
45
39
|
s.value.uid,
|
|
46
|
-
`parameters.${
|
|
40
|
+
`parameters.${r.paramKey}`,
|
|
47
41
|
a
|
|
48
42
|
);
|
|
49
43
|
} else {
|
|
50
|
-
const a = [
|
|
44
|
+
const a = [b.parse({ [t]: d })];
|
|
51
45
|
o.edit(
|
|
52
46
|
s.value.uid,
|
|
53
|
-
`parameters.${
|
|
47
|
+
`parameters.${r.paramKey}`,
|
|
54
48
|
a
|
|
55
|
-
),
|
|
56
|
-
var
|
|
57
|
-
if (!
|
|
58
|
-
(
|
|
49
|
+
), x(() => {
|
|
50
|
+
var g;
|
|
51
|
+
if (!m.value) return;
|
|
52
|
+
(g = m.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || g.focus();
|
|
59
53
|
});
|
|
60
54
|
}
|
|
61
|
-
e ===
|
|
62
|
-
},
|
|
55
|
+
e === c.length - 1 && p();
|
|
56
|
+
}, C = (e, t) => u.value && s.value && o.edit(
|
|
63
57
|
s.value.uid,
|
|
64
|
-
`parameters.${
|
|
58
|
+
`parameters.${r.paramKey}.${e}.enabled`,
|
|
65
59
|
t
|
|
66
60
|
), P = () => {
|
|
67
61
|
if (!u.value || !s.value) return;
|
|
68
62
|
const e = l.value.filter((t) => t.required);
|
|
69
63
|
o.edit(
|
|
70
64
|
s.value.uid,
|
|
71
|
-
`parameters.${
|
|
65
|
+
`parameters.${r.paramKey}`,
|
|
72
66
|
e
|
|
73
|
-
),
|
|
67
|
+
), x(() => {
|
|
74
68
|
p();
|
|
75
69
|
});
|
|
76
70
|
};
|
|
@@ -79,46 +73,46 @@ const L = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
79
73
|
p();
|
|
80
74
|
else if (l.value.length >= 1) {
|
|
81
75
|
const e = l.value[l.value.length - 1];
|
|
82
|
-
|
|
76
|
+
e && e.key !== "" && e.value !== "" && p();
|
|
83
77
|
}
|
|
84
78
|
}
|
|
85
|
-
const
|
|
79
|
+
const w = y(
|
|
86
80
|
() => l.value.filter((e) => e.key || e.value).length
|
|
87
81
|
);
|
|
88
|
-
return
|
|
82
|
+
return S(
|
|
89
83
|
() => s.value,
|
|
90
84
|
(e, t) => {
|
|
91
85
|
e !== t && v();
|
|
92
86
|
},
|
|
93
87
|
{ immediate: !0 }
|
|
94
|
-
), (e, t) => (
|
|
88
|
+
), (e, t) => (T(), A(B, {
|
|
95
89
|
class: "group/params",
|
|
96
|
-
itemCount:
|
|
90
|
+
itemCount: w.value
|
|
97
91
|
}, {
|
|
98
|
-
title:
|
|
99
|
-
|
|
92
|
+
title: n(() => [
|
|
93
|
+
h(R(e.title), 1)
|
|
100
94
|
]),
|
|
101
|
-
actions:
|
|
102
|
-
i("div",
|
|
103
|
-
f(
|
|
95
|
+
actions: n(() => [
|
|
96
|
+
i("div", O, [
|
|
97
|
+
f(k(V), {
|
|
104
98
|
side: "right",
|
|
105
99
|
sideOffset: 12
|
|
106
100
|
}, {
|
|
107
|
-
trigger:
|
|
108
|
-
f(
|
|
101
|
+
trigger: n(() => [
|
|
102
|
+
f(k(W), {
|
|
109
103
|
class: "px-1 transition-none",
|
|
110
104
|
size: "sm",
|
|
111
105
|
variant: "ghost",
|
|
112
|
-
onClick:
|
|
106
|
+
onClick: z(P, ["stop"])
|
|
113
107
|
}, {
|
|
114
|
-
default:
|
|
115
|
-
t[0] || (t[0] =
|
|
116
|
-
i("span",
|
|
108
|
+
default: n(() => [
|
|
109
|
+
t[0] || (t[0] = h(" Clear ")),
|
|
110
|
+
i("span", U, "All " + R(e.title), 1)
|
|
117
111
|
]),
|
|
118
112
|
_: 1
|
|
119
113
|
})
|
|
120
114
|
]),
|
|
121
|
-
content:
|
|
115
|
+
content: n(() => t[1] || (t[1] = [
|
|
122
116
|
i("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-context p-2 text-xxs leading-5 z-10 text-c-1" }, [
|
|
123
117
|
i("div", { class: "flex items-center text-c-2" }, [
|
|
124
118
|
i("span", null, "Clear optional parameters")
|
|
@@ -129,17 +123,17 @@ const L = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
129
123
|
})
|
|
130
124
|
])
|
|
131
125
|
]),
|
|
132
|
-
default:
|
|
126
|
+
default: n(() => [
|
|
133
127
|
i("div", {
|
|
134
128
|
ref_key: "tableWrapperRef",
|
|
135
|
-
ref:
|
|
129
|
+
ref: m
|
|
136
130
|
}, [
|
|
137
|
-
f(
|
|
131
|
+
f(N, {
|
|
138
132
|
class: "flex-1",
|
|
139
133
|
columns: ["32px", "", ""],
|
|
140
134
|
items: l.value,
|
|
141
|
-
onToggleRow:
|
|
142
|
-
onUpdateRow:
|
|
135
|
+
onToggleRow: C,
|
|
136
|
+
onUpdateRow: q
|
|
143
137
|
}, null, 8, ["items"])
|
|
144
138
|
], 512)
|
|
145
139
|
]),
|
|
@@ -148,5 +142,5 @@ const L = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
148
142
|
}
|
|
149
143
|
});
|
|
150
144
|
export {
|
|
151
|
-
|
|
145
|
+
Z as default
|
|
152
146
|
};
|
|
@@ -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.26";
|
|
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.26",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -170,20 +170,20 @@
|
|
|
170
170
|
"yaml": "^2.4.5",
|
|
171
171
|
"zod": "^3.23.8",
|
|
172
172
|
"@scalar/components": "0.13.10",
|
|
173
|
-
"@scalar/draggable": "0.1.8",
|
|
174
173
|
"@scalar/icons": "0.1.2",
|
|
175
|
-
"@scalar/
|
|
176
|
-
"@scalar/oas-utils": "0.2.93",
|
|
174
|
+
"@scalar/draggable": "0.1.8",
|
|
177
175
|
"@scalar/openapi-parser": "0.10.2",
|
|
176
|
+
"@scalar/import": "0.2.14",
|
|
178
177
|
"@scalar/object-utils": "1.1.12",
|
|
179
178
|
"@scalar/openapi-types": "0.1.5",
|
|
179
|
+
"@scalar/postman-to-openapi": "0.1.17",
|
|
180
|
+
"@scalar/oas-utils": "0.2.94",
|
|
180
181
|
"@scalar/themes": "0.9.58",
|
|
181
|
-
"@scalar/postman-to-openapi": "0.1.16",
|
|
182
182
|
"@scalar/types": "0.0.25",
|
|
183
183
|
"@scalar/use-codemirror": "0.11.54",
|
|
184
|
-
"@scalar/use-
|
|
184
|
+
"@scalar/use-hooks": "0.1.11",
|
|
185
185
|
"@scalar/use-toasts": "0.7.7",
|
|
186
|
-
"@scalar/use-
|
|
186
|
+
"@scalar/use-tooltip": "1.0.4"
|
|
187
187
|
},
|
|
188
188
|
"devDependencies": {
|
|
189
189
|
"@types/js-cookie": "^3.0.6",
|
|
@@ -200,8 +200,8 @@
|
|
|
200
200
|
"vite": "^5.4.10",
|
|
201
201
|
"vite-svg-loader": "^5.1.0",
|
|
202
202
|
"vitest": "^1.6.0",
|
|
203
|
-
"@scalar/
|
|
204
|
-
"@scalar/
|
|
203
|
+
"@scalar/galaxy": "0.2.16",
|
|
204
|
+
"@scalar/build-tooling": "0.1.12"
|
|
205
205
|
},
|
|
206
206
|
"scripts": {
|
|
207
207
|
"build": "vite build && pnpm types:build && tsc-alias -p tsconfig.build.json",
|