@scalar/api-client 2.1.6 → 2.1.7
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,15 +1,15 @@
|
|
|
1
|
-
function u(
|
|
2
|
-
return
|
|
3
|
-
if (
|
|
1
|
+
function u(a) {
|
|
2
|
+
return a.flatMap((e) => {
|
|
3
|
+
if (e.key === "value")
|
|
4
4
|
try {
|
|
5
|
-
const
|
|
6
|
-
return Object.keys(
|
|
7
|
-
key:
|
|
8
|
-
value:
|
|
5
|
+
const r = JSON.parse(e.value);
|
|
6
|
+
return Object.keys(r).map((t) => ({
|
|
7
|
+
key: t,
|
|
8
|
+
value: r[t]
|
|
9
9
|
}));
|
|
10
10
|
} catch {
|
|
11
11
|
}
|
|
12
|
-
return [];
|
|
12
|
+
return [e];
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";AAkhBA,wBAKG"}
|
|
@@ -4,12 +4,12 @@ import K from "../../components/Sidebar/Sidebar.vue.js";
|
|
|
4
4
|
import M from "../../components/Sidebar/SidebarButton.vue.js";
|
|
5
5
|
import T from "../../components/Sidebar/SidebarList.vue.js";
|
|
6
6
|
import U from "../../components/Sidebar/SidebarListElement.vue.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { environmentSchema as
|
|
12
|
-
import { nanoid as
|
|
7
|
+
import j from "../../components/SubpageHeader.vue.js";
|
|
8
|
+
import F from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
9
|
+
import H from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
10
|
+
import J from "../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
11
|
+
import { environmentSchema as O } from "@scalar/oas-utils/entities/environment";
|
|
12
|
+
import { nanoid as W } from "nanoid";
|
|
13
13
|
import { useRouter as q } from "vue-router";
|
|
14
14
|
import z from "./EnvironmentColors.vue.js";
|
|
15
15
|
import { useWorkspace as G } from "../../store/store.js";
|
|
@@ -18,9 +18,9 @@ const P = { class: "flex-1" }, Q = ["value"], X = { class: "colors ml-auto" }, v
|
|
|
18
18
|
setup(Y) {
|
|
19
19
|
const v = q(), { environments: l, environmentMutators: i } = G(), e = c(null), p = c(null), m = c(!1);
|
|
20
20
|
function y() {
|
|
21
|
-
const t =
|
|
21
|
+
const t = O.parse({
|
|
22
22
|
name: "New Environment",
|
|
23
|
-
uid:
|
|
23
|
+
uid: W(),
|
|
24
24
|
color: "grey",
|
|
25
25
|
raw: JSON.stringify({ exampleKey: "exampleValue" }, null, 2),
|
|
26
26
|
parsed: [],
|
|
@@ -28,12 +28,12 @@ const P = { class: "flex-1" }, Q = ["value"], X = { class: "colors ml-auto" }, v
|
|
|
28
28
|
});
|
|
29
29
|
i.add(t), e.value = t.uid, v.push(e.value);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function g(t) {
|
|
32
32
|
e.value && i.edit(e.value, "value", t);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const E = (t) => {
|
|
35
35
|
i.delete(t), e.value === t && (e.value = null);
|
|
36
|
-
},
|
|
36
|
+
}, k = (t) => e.value && i.edit(e.value, "color", t), x = () => {
|
|
37
37
|
v.currentRoute.value.params.environment === "default" && (e.value = l.default.uid);
|
|
38
38
|
}, b = () => {
|
|
39
39
|
e.value && !l[e.value].isDefault && (m.value = !0, R(() => {
|
|
@@ -44,9 +44,9 @@ const P = { class: "flex-1" }, Q = ["value"], X = { class: "colors ml-auto" }, v
|
|
|
44
44
|
const n = t.target.value;
|
|
45
45
|
e.value && !l[e.value].isDefault && i.edit(e.value, "name", n);
|
|
46
46
|
};
|
|
47
|
-
return S(x), (t, s) => (r(), d(
|
|
47
|
+
return S(x), (t, s) => (r(), d(j, null, {
|
|
48
48
|
default: o(() => [
|
|
49
|
-
a(
|
|
49
|
+
a(F, null, {
|
|
50
50
|
default: o(() => [
|
|
51
51
|
a(K, { title: "Environment" }, {
|
|
52
52
|
content: o(() => [
|
|
@@ -64,7 +64,7 @@ const P = { class: "flex-1" }, Q = ["value"], X = { class: "colors ml-auto" }, v
|
|
|
64
64
|
},
|
|
65
65
|
warningMessage: "Are you sure you want to delete this environment?",
|
|
66
66
|
onClick: (N) => e.value = n.uid,
|
|
67
|
-
onDelete: (N) =>
|
|
67
|
+
onDelete: (N) => E(n.uid)
|
|
68
68
|
}, null, 8, ["variable", "onClick", "onDelete"]))), 128))
|
|
69
69
|
]),
|
|
70
70
|
_: 1
|
|
@@ -81,16 +81,17 @@ const P = { class: "flex-1" }, Q = ["value"], X = { class: "colors ml-auto" }, v
|
|
|
81
81
|
]),
|
|
82
82
|
_: 1
|
|
83
83
|
}),
|
|
84
|
-
a(
|
|
84
|
+
a(H, { class: "flex-1" }, {
|
|
85
85
|
default: o(() => [
|
|
86
|
-
a(
|
|
86
|
+
a(J, null, I({
|
|
87
87
|
default: o(() => [
|
|
88
88
|
e.value ? (r(), d(A, {
|
|
89
89
|
key: 0,
|
|
90
90
|
class: "pl-px pr-2 md:px-2 py-2.5",
|
|
91
|
+
language: "json",
|
|
91
92
|
lineNumbers: "",
|
|
92
93
|
modelValue: u(l)[e.value].value,
|
|
93
|
-
"onUpdate:modelValue":
|
|
94
|
+
"onUpdate:modelValue": g
|
|
94
95
|
}, null, 8, ["modelValue"])) : $("", !0)
|
|
95
96
|
]),
|
|
96
97
|
_: 2
|
|
@@ -116,7 +117,7 @@ const P = { class: "flex-1" }, Q = ["value"], X = { class: "colors ml-auto" }, v
|
|
|
116
117
|
_("div", X, [
|
|
117
118
|
a(z, {
|
|
118
119
|
activeColor: u(l)[e.value].color,
|
|
119
|
-
onSelect:
|
|
120
|
+
onSelect: k
|
|
120
121
|
}, null, 8, ["activeColor"])
|
|
121
122
|
])
|
|
122
123
|
]),
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.1.
|
|
21
|
+
"version": "2.1.7",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -133,13 +133,13 @@
|
|
|
133
133
|
"@scalar/draggable": "0.1.5",
|
|
134
134
|
"@scalar/oas-utils": "0.2.47",
|
|
135
135
|
"@scalar/object-utils": "1.1.9",
|
|
136
|
+
"@scalar/openapi-parser": "0.8.4",
|
|
136
137
|
"@scalar/openapi-types": "0.1.1",
|
|
137
|
-
"@scalar/openapi-parser": "0.8.3",
|
|
138
|
-
"@scalar/types": "0.0.10",
|
|
139
138
|
"@scalar/themes": "0.9.31",
|
|
139
|
+
"@scalar/types": "0.0.10",
|
|
140
140
|
"@scalar/use-codemirror": "0.11.13",
|
|
141
|
-
"@scalar/use-
|
|
142
|
-
"@scalar/use-
|
|
141
|
+
"@scalar/use-tooltip": "1.0.2",
|
|
142
|
+
"@scalar/use-toasts": "0.7.6"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
145
|
"@types/content-type": "^1.1.8",
|