@scalar/api-client 2.2.8 → 2.2.9
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 +21 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +65 -65
- package/dist/components/CodeInput/codeVariableWidget.d.ts +6 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +72 -68
- package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.vue.js +20 -15
- package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCell.vue.js +16 -11
- package/dist/components/DataTable/DataTableHeader.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableHeader.vue.js +11 -12
- package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +3 -3
- package/dist/components/DataTable/DataTableInput.vue2.js +9 -9
- package/dist/components/DataTable/index.js +14 -14
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +87 -67
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +2 -2
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.js +4 -4
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +8 -4
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue2.js +52 -32
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +3 -0
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +43 -31
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +32 -31
- package/dist/layouts/App/create-api-client-app.d.ts +49 -42
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +103 -89
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +31 -19
- package/dist/layouts/Web/create-api-client-web.d.ts +49 -42
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +50 -44
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/env-helpers.d.ts +9 -0
- package/dist/libs/env-helpers.d.ts.map +1 -0
- package/dist/libs/env-helpers.js +4 -0
- package/dist/libs/environment-parser.d.ts +3 -4
- package/dist/libs/environment-parser.d.ts.map +1 -1
- package/dist/libs/environment-parser.js +5 -4
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +24 -22
- package/dist/libs/send-request/send-request.d.ts +5 -2
- package/dist/libs/send-request/send-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.js +106 -104
- package/dist/routes.d.ts +11 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +13 -7
- package/dist/store/active-entities.d.ts +18 -11
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +108 -69
- package/dist/store/collections.d.ts +17 -15
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +62 -41
- package/dist/store/environment.d.ts +4 -4
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +7 -3
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/router-params.d.ts +1 -1
- package/dist/store/router-params.d.ts.map +1 -1
- package/dist/store/router-params.js +7 -7
- package/dist/store/store.d.ts +49 -42
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +76 -72
- package/dist/store/workspace.d.ts +12 -12
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/vue.d.ts +10 -0
- package/dist/types/vue.d.ts.map +1 -0
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +75 -70
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +308 -152
- package/dist/views/Environment/EnvironmentColorModal.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentColorModal.vue.js +20 -18
- package/dist/views/Environment/EnvironmentColors.vue.d.ts +4 -1
- package/dist/views/Environment/EnvironmentColors.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentColors.vue.js +83 -58
- package/dist/views/Environment/EnvironmentModal.vue.d.ts +7 -0
- package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentModal.vue.js +119 -37
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +4 -5
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +73 -63
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +60 -61
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +185 -187
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +27 -24
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +35 -187
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +7 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +7 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +207 -0
- package/dist/views/Request/RequestSection/{RequestAuthDataTableInput.vue.d.ts → RequestAuth/RequestAuthDataTableInput.vue.d.ts} +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +43 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +5 -134
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +176 -2
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +2 -0
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/index.js +4 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +129 -109
- 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 +32 -38
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/auth.d.ts.map +1 -1
- package/dist/views/Request/libs/auth.js +3 -3
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +9 -8
- package/package.json +19 -9
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +0 -1
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.js +0 -46
- /package/dist/views/Request/RequestSection/{RequestAuthDataTableInput.vue2.js → RequestAuth/RequestAuthDataTableInput.vue2.js} +0 -0
|
@@ -1,180 +1,320 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
|
|
1
|
+
import { defineComponent as re, ref as f, watch as se, onMounted as ie, onBeforeUnmount as ue, openBlock as m, createBlock as h, withCtx as d, createVNode as u, createElementVNode as y, createElementBlock as M, Fragment as U, renderList as z, unref as r, normalizeClass as A, createTextVNode as B, toDisplayString as W, withDirectives as de, withModifiers as ce, createCommentVNode as K, vShow as me, createSlots as ve } from "vue";
|
|
2
|
+
import fe from "../../components/CodeInput/CodeInput.vue.js";
|
|
3
|
+
import pe from "../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
|
|
4
|
+
import xe from "../../components/Sidebar/Sidebar.vue.js";
|
|
5
|
+
import be from "../../components/Sidebar/SidebarButton.vue.js";
|
|
6
|
+
import he from "../../components/Sidebar/SidebarList.vue.js";
|
|
7
|
+
import F from "../../components/Sidebar/SidebarListElement.vue.js";
|
|
8
|
+
import ye from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
9
|
+
import Ce from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
10
|
+
import ke from "../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
11
|
+
import { useActiveEntities as Ee } from "../../store/active-entities.js";
|
|
12
|
+
import { useModal as $, ScalarIcon as G, ScalarButton as ge, ScalarModal as _e } from "@scalar/components";
|
|
13
|
+
import { LibraryIcon as Ie } from "@scalar/icons";
|
|
14
|
+
import { useToasts as we } from "@scalar/use-toasts";
|
|
15
|
+
import { useRouter as Se, useRoute as Me } from "vue-router";
|
|
16
|
+
import $e from "./EnvironmentColorModal.vue.js";
|
|
17
|
+
import Ve from "./EnvironmentModal.vue.js";
|
|
18
|
+
import { useWorkspace as Ne } from "../../store/store.js";
|
|
19
|
+
import { useSidebar as Oe } from "../../hooks/useSidebar.js";
|
|
20
|
+
const Re = { class: "flex-1" }, je = ["onClick"], nn = /* @__PURE__ */ re({
|
|
18
21
|
__name: "Environment",
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
uid: se(),
|
|
28
|
-
color: e.color,
|
|
29
|
-
value: h(a),
|
|
30
|
-
isDefault: !1
|
|
31
|
-
});
|
|
32
|
-
r.add(w), o.value = w.uid, f.push(o.value), p.hide();
|
|
22
|
+
setup(De) {
|
|
23
|
+
const p = Se(), C = Me(), { activeWorkspace: V, activeEnvironment: J, activeWorkspaceCollections: s } = Ee(), { events: N, workspaceMutators: T, collectionMutators: x } = Ne(), { collapsedSidebarFolders: b, toggleSidebarFolder: k } = Oe(), E = $(), g = $(), _ = $(), O = f(null), l = f("default"), R = f(""), v = f(void 0), c = f(void 0), I = f(void 0), { toast: j } = we(), H = (e) => JSON.parse(e);
|
|
24
|
+
function D(e, o, n) {
|
|
25
|
+
var t;
|
|
26
|
+
e && (o.uid === n ? j(
|
|
27
|
+
`Environment name already used in ${(t = o.info) == null ? void 0 : t.title}`,
|
|
28
|
+
"error"
|
|
29
|
+
) : j("Environment name already used in another collection", "error"));
|
|
33
30
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
function q(e) {
|
|
32
|
+
s.value.some(
|
|
33
|
+
(n) => {
|
|
34
|
+
const t = Object.keys(
|
|
35
|
+
n["x-scalar-environments"] || {}
|
|
36
|
+
).includes(e.name);
|
|
37
|
+
return D(t, n, e.collectionId), t;
|
|
38
|
+
}
|
|
39
|
+
) || (e.collectionId && (x.addEnvironment(
|
|
40
|
+
e.name,
|
|
41
|
+
{
|
|
42
|
+
variables: {},
|
|
43
|
+
color: e.color
|
|
44
|
+
},
|
|
45
|
+
e.collectionId
|
|
46
|
+
), b[e.collectionId] || k(e.collectionId), p.push({
|
|
47
|
+
name: "environment.collection",
|
|
48
|
+
params: {
|
|
49
|
+
collectionId: e.collectionId,
|
|
50
|
+
environmentId: e.name
|
|
51
|
+
}
|
|
52
|
+
})), g.hide());
|
|
43
53
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
function P(e) {
|
|
55
|
+
var o;
|
|
56
|
+
if (J) {
|
|
57
|
+
const n = H(e);
|
|
58
|
+
if (l.value === "default")
|
|
59
|
+
T.edit(
|
|
60
|
+
V.value.uid,
|
|
61
|
+
"environments",
|
|
62
|
+
n
|
|
63
|
+
);
|
|
64
|
+
else {
|
|
65
|
+
const t = s.value.find(
|
|
66
|
+
(a) => {
|
|
67
|
+
var i;
|
|
68
|
+
return (i = a["x-scalar-environments"]) == null ? void 0 : i[l.value ?? ""];
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
(o = t == null ? void 0 : t["x-scalar-environments"]) != null && o[l.value ?? ""] && (t["x-scalar-environments"][l.value ?? ""].variables = n, x.edit(
|
|
72
|
+
t.uid,
|
|
73
|
+
"x-scalar-environments",
|
|
74
|
+
t["x-scalar-environments"]
|
|
75
|
+
));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const S = (e) => {
|
|
80
|
+
v.value = e, g.show();
|
|
81
|
+
}, Q = (e, o) => {
|
|
82
|
+
c.value = e, v.value = o, I.value = e, _.show();
|
|
83
|
+
}, X = (e) => {
|
|
84
|
+
var o, n, t;
|
|
85
|
+
O.value = e, R.value = ((t = (n = (o = s.value.find(
|
|
86
|
+
(a) => {
|
|
87
|
+
var i;
|
|
88
|
+
return (i = a["x-scalar-environments"]) == null ? void 0 : i[e];
|
|
89
|
+
}
|
|
90
|
+
)) == null ? void 0 : o["x-scalar-environments"]) == null ? void 0 : n[e]) == null ? void 0 : t.color) ?? "", E.show();
|
|
91
|
+
}, Y = (e) => {
|
|
92
|
+
const o = O.value;
|
|
93
|
+
typeof o == "string" && (s.value.some(
|
|
94
|
+
(t) => {
|
|
95
|
+
var a;
|
|
96
|
+
return (a = t["x-scalar-environments"]) == null ? void 0 : a[o];
|
|
97
|
+
}
|
|
98
|
+
) && s.value.forEach((t) => {
|
|
99
|
+
var a;
|
|
100
|
+
(a = t["x-scalar-environments"]) != null && a[o] && (t["x-scalar-environments"][o].color = e, x.edit(
|
|
48
101
|
t.uid,
|
|
49
|
-
"
|
|
50
|
-
|
|
102
|
+
"x-scalar-environments",
|
|
103
|
+
t["x-scalar-environments"]
|
|
51
104
|
));
|
|
105
|
+
}), E.hide());
|
|
106
|
+
};
|
|
107
|
+
function Z(e) {
|
|
108
|
+
s.value.forEach((n) => {
|
|
109
|
+
x.removeEnvironment(e, n.uid);
|
|
52
110
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
111
|
+
const o = s.value.flatMap(
|
|
112
|
+
(n) => Object.keys(n["x-scalar-environments"] || {})
|
|
113
|
+
);
|
|
114
|
+
if (o.length > 0) {
|
|
115
|
+
const n = o[o.length - 1], t = s.value.find(
|
|
116
|
+
(a) => Object.keys(a["x-scalar-environments"] || {}).includes(
|
|
117
|
+
n
|
|
118
|
+
)
|
|
58
119
|
);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
120
|
+
l.value = n, p.push({
|
|
121
|
+
name: "environment.collection",
|
|
122
|
+
params: {
|
|
123
|
+
collectionId: t == null ? void 0 : t.uid,
|
|
124
|
+
environmentId: n
|
|
125
|
+
}
|
|
126
|
+
}), t && !b[t.uid] && k(t.uid);
|
|
127
|
+
} else
|
|
128
|
+
l.value = "default", p.push({
|
|
129
|
+
name: "environment",
|
|
130
|
+
params: { environment: "default" }
|
|
131
|
+
});
|
|
65
132
|
}
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
133
|
+
const ee = () => l.value === "default" ? "Global Environment" : l.value, ne = () => {
|
|
134
|
+
var e, o, n;
|
|
135
|
+
return l.value === "default" ? JSON.stringify(V.value.environments, null, 2) : JSON.stringify(
|
|
136
|
+
(n = (o = (e = s.value.find(
|
|
137
|
+
(t) => {
|
|
138
|
+
var a;
|
|
139
|
+
return (a = t["x-scalar-environments"]) == null ? void 0 : a[l.value ?? ""];
|
|
140
|
+
}
|
|
141
|
+
)) == null ? void 0 : e["x-scalar-environments"]) == null ? void 0 : o[l.value ?? ""]) == null ? void 0 : n.variables,
|
|
142
|
+
null,
|
|
143
|
+
2
|
|
144
|
+
);
|
|
145
|
+
}, te = (e) => b[e], L = (e) => {
|
|
146
|
+
e != null && e.createNew && C.name === "environment" && S();
|
|
147
|
+
};
|
|
148
|
+
se(
|
|
149
|
+
() => [C.params.collectionId, C.params.environmentId],
|
|
150
|
+
([e, o]) => {
|
|
151
|
+
e ? l.value = o : l.value = "default";
|
|
77
152
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
o.value && !l[o.value].isDefault && (y.value = !0, Z(() => {
|
|
87
|
-
var e;
|
|
88
|
-
(e = V.value) == null || e.focus();
|
|
89
|
-
}));
|
|
90
|
-
}, B = (e) => {
|
|
91
|
-
const n = e.target.value;
|
|
92
|
-
o.value && !l[o.value].isDefault && r.edit(o.value, "name", n);
|
|
93
|
-
}, N = (e) => {
|
|
94
|
-
e != null && e.createNew && k.name === "environment" && x({ name: "", color: "" });
|
|
95
|
-
}, A = () => {
|
|
96
|
-
p.show();
|
|
153
|
+
), ie(() => {
|
|
154
|
+
l.value = C.params.environmentId || "default", N.hotKeys.on(L);
|
|
155
|
+
const { collectionId: e } = p.currentRoute.value.params;
|
|
156
|
+
e && !b[e] && k(e);
|
|
157
|
+
}), ue(() => N.hotKeys.off(L));
|
|
158
|
+
const oe = (e, o, n) => {
|
|
159
|
+
const t = n ? `/workspace/default/environment/${n}/${o}` : `/workspace/default/environment/${o}`;
|
|
160
|
+
e.metaKey ? window.open(t, "_blank") : p.push({ path: t });
|
|
97
161
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
162
|
+
function ae() {
|
|
163
|
+
c.value = void 0, v.value = void 0, I.value = void 0, _.hide();
|
|
164
|
+
}
|
|
165
|
+
function le(e) {
|
|
166
|
+
s.value.some(
|
|
167
|
+
(n) => {
|
|
168
|
+
const t = Object.keys(
|
|
169
|
+
n["x-scalar-environments"] || {}
|
|
170
|
+
).includes(e);
|
|
171
|
+
return D(
|
|
172
|
+
t,
|
|
173
|
+
n,
|
|
174
|
+
v.value
|
|
175
|
+
), t;
|
|
176
|
+
}
|
|
177
|
+
) || (e && c.value !== "default" && s.value.forEach((n) => {
|
|
178
|
+
var t;
|
|
179
|
+
if ((t = n["x-scalar-environments"]) != null && t[c.value ?? ""]) {
|
|
180
|
+
const a = n["x-scalar-environments"][c.value ?? ""];
|
|
181
|
+
delete n["x-scalar-environments"][c.value ?? ""], n["x-scalar-environments"][e] = a, x.edit(
|
|
182
|
+
n.uid,
|
|
183
|
+
"x-scalar-environments",
|
|
184
|
+
n["x-scalar-environments"]
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
}), e && l.value === c.value && (l.value = e), c.value = void 0, v.value = void 0, I.value = void 0, _.hide());
|
|
188
|
+
}
|
|
189
|
+
return (e, o) => (m(), h(ye, null, {
|
|
190
|
+
default: d(() => [
|
|
191
|
+
u(xe, { title: "Collections" }, {
|
|
192
|
+
content: d(() => [
|
|
193
|
+
y("div", Re, [
|
|
194
|
+
u(he, null, {
|
|
195
|
+
default: d(() => [
|
|
196
|
+
(m(), h(F, {
|
|
197
|
+
key: "default",
|
|
112
198
|
class: "text-xs",
|
|
113
199
|
isCopyable: !1,
|
|
200
|
+
type: "environment",
|
|
114
201
|
variable: {
|
|
115
|
-
name:
|
|
116
|
-
uid:
|
|
117
|
-
|
|
118
|
-
isDefault:
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
202
|
+
name: "Global Environment",
|
|
203
|
+
uid: "default",
|
|
204
|
+
icon: "Globe",
|
|
205
|
+
isDefault: !0
|
|
206
|
+
}
|
|
207
|
+
})),
|
|
208
|
+
(m(!0), M(U, null, z(r(s), (n) => {
|
|
209
|
+
var t;
|
|
210
|
+
return m(), M("div", {
|
|
211
|
+
key: n.uid,
|
|
212
|
+
class: "flex flex-col gap-0.25"
|
|
213
|
+
}, [
|
|
214
|
+
y("button", {
|
|
215
|
+
class: "flex font-medium gap-1.5 group items-center px-2 py-1.5 text-left text-sm w-full break-words rounded hover:bg-b-2",
|
|
216
|
+
type: "button",
|
|
217
|
+
onClick: (a) => r(k)(n.uid)
|
|
218
|
+
}, [
|
|
219
|
+
u(r(Ie), {
|
|
220
|
+
class: "text-sidebar-c-2 size-3.5 stroke-[2.25] group-hover:hidden",
|
|
221
|
+
src: n["x-scalar-icon"] || "interface-content-folder"
|
|
222
|
+
}, null, 8, ["src"]),
|
|
223
|
+
u(r(G), {
|
|
224
|
+
class: A(["text-c-3 hidden text-sm group-hover:block", {
|
|
225
|
+
"rotate-90": r(b)[n.uid]
|
|
226
|
+
}]),
|
|
227
|
+
icon: "ChevronRight",
|
|
228
|
+
size: "sm",
|
|
229
|
+
thickness: "2.5"
|
|
230
|
+
}, null, 8, ["class"]),
|
|
231
|
+
B(" " + W(((t = n.info) == null ? void 0 : t.title) ?? ""), 1)
|
|
232
|
+
], 8, je),
|
|
233
|
+
de(y("div", {
|
|
234
|
+
class: A({
|
|
235
|
+
"before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-[calc(1rem_-_1.5px)] before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] flex flex-col gap-px mb-[.5px] last:mb-0 relative": Object.keys(n["x-scalar-environments"] || {}).length > 0
|
|
236
|
+
})
|
|
237
|
+
}, [
|
|
238
|
+
(m(!0), M(U, null, z(n["x-scalar-environments"], (a, i) => (m(), h(F, {
|
|
239
|
+
key: i,
|
|
240
|
+
class: "text-xs [&>a]:pl-5",
|
|
241
|
+
collectionId: n.uid,
|
|
242
|
+
isCopyable: !1,
|
|
243
|
+
isDeletable: !0,
|
|
244
|
+
isRenameable: !0,
|
|
245
|
+
type: "environment",
|
|
246
|
+
variable: {
|
|
247
|
+
name: i,
|
|
248
|
+
uid: i,
|
|
249
|
+
color: a.color ?? "#8E8E8E",
|
|
250
|
+
isDefault: !1
|
|
251
|
+
},
|
|
252
|
+
warningMessage: "Are you sure you want to delete this environment?",
|
|
253
|
+
onClick: ce((w) => oe(w, i, n.uid), ["prevent"]),
|
|
254
|
+
onColorModal: (w) => X(i),
|
|
255
|
+
onDelete: (w) => Z(i),
|
|
256
|
+
onRename: (w) => Q(i, n.uid)
|
|
257
|
+
}, null, 8, ["collectionId", "variable", "onClick", "onColorModal", "onDelete", "onRename"]))), 128)),
|
|
258
|
+
Object.keys(n["x-scalar-environments"] || {}).length === 0 ? (m(), h(r(ge), {
|
|
259
|
+
key: 0,
|
|
260
|
+
class: "mb-[.5px] flex gap-1.5 h-8 text-c-1 pl-6 py-0 justify-start text-xs w-full hover:bg-b-2",
|
|
261
|
+
variant: "ghost",
|
|
262
|
+
onClick: (a) => S(n.uid)
|
|
263
|
+
}, {
|
|
264
|
+
default: d(() => [
|
|
265
|
+
u(r(G), {
|
|
266
|
+
class: "ml-0.5 h-2.5 w-2.5",
|
|
267
|
+
icon: "Add",
|
|
268
|
+
thickness: "3"
|
|
269
|
+
}),
|
|
270
|
+
o[2] || (o[2] = y("span", null, "Add Environment", -1))
|
|
271
|
+
]),
|
|
272
|
+
_: 2
|
|
273
|
+
}, 1032, ["onClick"])) : K("", !0)
|
|
274
|
+
], 2), [
|
|
275
|
+
[me, te(n.uid)]
|
|
276
|
+
])
|
|
277
|
+
]);
|
|
278
|
+
}), 128))
|
|
125
279
|
]),
|
|
126
280
|
_: 1
|
|
127
281
|
})
|
|
128
282
|
])
|
|
129
283
|
]),
|
|
130
|
-
button:
|
|
131
|
-
|
|
132
|
-
click:
|
|
284
|
+
button: d(() => [
|
|
285
|
+
u(be, {
|
|
286
|
+
click: S,
|
|
133
287
|
hotkey: "N"
|
|
134
288
|
}, {
|
|
135
|
-
title:
|
|
136
|
-
|
|
289
|
+
title: d(() => o[3] || (o[3] = [
|
|
290
|
+
B("Add Environment")
|
|
137
291
|
])),
|
|
138
292
|
_: 1
|
|
139
293
|
})
|
|
140
294
|
]),
|
|
141
295
|
_: 1
|
|
142
296
|
}),
|
|
143
|
-
|
|
144
|
-
default:
|
|
145
|
-
|
|
146
|
-
default:
|
|
147
|
-
|
|
297
|
+
u(Ce, { class: "flex-1" }, {
|
|
298
|
+
default: d(() => [
|
|
299
|
+
u(ke, null, ve({
|
|
300
|
+
default: d(() => [
|
|
301
|
+
l.value ? (m(), h(fe, {
|
|
148
302
|
key: 0,
|
|
149
303
|
class: "pl-px pr-2 md:px-4 py-2",
|
|
150
304
|
isCopyable: "",
|
|
151
305
|
language: "json",
|
|
152
306
|
lineNumbers: "",
|
|
153
307
|
lint: "",
|
|
154
|
-
modelValue:
|
|
155
|
-
"onUpdate:modelValue":
|
|
156
|
-
}, null, 8, ["modelValue"])) :
|
|
308
|
+
modelValue: ne(),
|
|
309
|
+
"onUpdate:modelValue": P
|
|
310
|
+
}, null, 8, ["modelValue"])) : K("", !0)
|
|
157
311
|
]),
|
|
158
312
|
_: 2
|
|
159
313
|
}, [
|
|
160
|
-
|
|
314
|
+
l.value ? {
|
|
161
315
|
name: "title",
|
|
162
|
-
fn:
|
|
163
|
-
|
|
164
|
-
key: 0,
|
|
165
|
-
onDblclick: R
|
|
166
|
-
}, X(u(l)[o.value].name), 33)) : (m(), g("input", {
|
|
167
|
-
key: 1,
|
|
168
|
-
ref_key: "nameInputRef",
|
|
169
|
-
ref: V,
|
|
170
|
-
class: "ring-1 ring-offset-4 ring-b-outline rounded",
|
|
171
|
-
spellcheck: "false",
|
|
172
|
-
type: "text",
|
|
173
|
-
value: u(l)[o.value].name,
|
|
174
|
-
onBlur: t[0] || (t[0] = (n) => y.value = !1),
|
|
175
|
-
onInput: B,
|
|
176
|
-
onKeyup: t[1] || (t[1] = Y((n) => y.value = !1, ["enter"]))
|
|
177
|
-
}, null, 40, ye))
|
|
316
|
+
fn: d(() => [
|
|
317
|
+
y("span", null, W(ee()), 1)
|
|
178
318
|
]),
|
|
179
319
|
key: "0"
|
|
180
320
|
} : void 0
|
|
@@ -182,22 +322,38 @@ const pe = { class: "flex-1" }, ye = ["value"], Ke = /* @__PURE__ */ z({
|
|
|
182
322
|
]),
|
|
183
323
|
_: 1
|
|
184
324
|
}),
|
|
185
|
-
|
|
186
|
-
selectedColor:
|
|
187
|
-
state:
|
|
188
|
-
onCancel:
|
|
189
|
-
onSubmit:
|
|
325
|
+
u($e, {
|
|
326
|
+
selectedColor: R.value,
|
|
327
|
+
state: r(E),
|
|
328
|
+
onCancel: o[0] || (o[0] = (n) => r(E).hide()),
|
|
329
|
+
onSubmit: Y
|
|
190
330
|
}, null, 8, ["selectedColor", "state"]),
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
331
|
+
u(Ve, {
|
|
332
|
+
activeWorkspaceCollections: r(s),
|
|
333
|
+
collectionId: v.value,
|
|
334
|
+
state: r(g),
|
|
335
|
+
onCancel: o[1] || (o[1] = (n) => r(g).hide()),
|
|
336
|
+
onSubmit: q
|
|
337
|
+
}, null, 8, ["activeWorkspaceCollections", "collectionId", "state"]),
|
|
338
|
+
u(r(_e), {
|
|
339
|
+
size: "xxs",
|
|
340
|
+
state: r(_),
|
|
341
|
+
title: `Edit ${c.value}`
|
|
342
|
+
}, {
|
|
343
|
+
default: d(() => [
|
|
344
|
+
u(pe, {
|
|
345
|
+
name: I.value ?? "",
|
|
346
|
+
onClose: ae,
|
|
347
|
+
onEdit: le
|
|
348
|
+
}, null, 8, ["name"])
|
|
349
|
+
]),
|
|
350
|
+
_: 1
|
|
351
|
+
}, 8, ["state", "title"])
|
|
196
352
|
]),
|
|
197
353
|
_: 1
|
|
198
354
|
}));
|
|
199
355
|
}
|
|
200
356
|
});
|
|
201
357
|
export {
|
|
202
|
-
|
|
358
|
+
nn as default
|
|
203
359
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentColorModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentColorModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentColorModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentColorModal.vue"],"names":[],"mappings":"AAgDA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,oBAAoB,CAAA;AAOjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAC;;;;;;;;AAoJF,wBAQG"}
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { ScalarModal as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as m, ref as u, openBlock as d, createBlock as f, unref as p, withCtx as C, createElementVNode as v, createVNode as n } from "vue";
|
|
2
|
+
import _ from "../../components/Sidebar/Actions/SidebarListElementForm.vue.js";
|
|
3
|
+
import { ScalarModal as x } from "@scalar/components";
|
|
4
|
+
import S from "./EnvironmentColors.vue.js";
|
|
5
|
+
const b = { class: "flex flex-col gap-4" }, M = /* @__PURE__ */ m({
|
|
6
6
|
__name: "EnvironmentColorModal",
|
|
7
7
|
props: {
|
|
8
8
|
state: {},
|
|
9
9
|
selectedColor: {}
|
|
10
10
|
},
|
|
11
11
|
emits: ["cancel", "submit"],
|
|
12
|
-
setup(r, { emit:
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
setup(r, { emit: a }) {
|
|
13
|
+
const s = r, o = a, e = u(""), c = (t) => {
|
|
14
|
+
e.value = t;
|
|
15
|
+
}, i = () => {
|
|
16
|
+
o("submit", e.value), e.value = "";
|
|
15
17
|
};
|
|
16
|
-
return (
|
|
18
|
+
return (t, l) => (d(), f(p(x), {
|
|
17
19
|
size: "xxs",
|
|
18
|
-
state:
|
|
20
|
+
state: t.state,
|
|
19
21
|
title: "Edit Environment Color"
|
|
20
22
|
}, {
|
|
21
23
|
default: C(() => [
|
|
22
|
-
v("div",
|
|
23
|
-
n(
|
|
24
|
-
activeColor:
|
|
24
|
+
v("div", b, [
|
|
25
|
+
n(S, {
|
|
26
|
+
activeColor: e.value || s.selectedColor,
|
|
25
27
|
class: "p-1 w-full",
|
|
26
|
-
onSelect:
|
|
28
|
+
onSelect: c
|
|
27
29
|
}, null, 8, ["activeColor"]),
|
|
28
|
-
n(
|
|
29
|
-
onCancel:
|
|
30
|
-
onSubmit:
|
|
30
|
+
n(_, {
|
|
31
|
+
onCancel: l[0] || (l[0] = (E) => o("cancel")),
|
|
32
|
+
onSubmit: i
|
|
31
33
|
})
|
|
32
34
|
])
|
|
33
35
|
]),
|
|
@@ -36,5 +38,5 @@ const S = { class: "flex flex-col gap-4" }, B = /* @__PURE__ */ c({
|
|
|
36
38
|
}
|
|
37
39
|
});
|
|
38
40
|
export {
|
|
39
|
-
|
|
41
|
+
M as default
|
|
40
42
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
activeColor: string;
|
|
3
|
+
selector?: boolean;
|
|
3
4
|
};
|
|
4
5
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
6
|
select: (color: string) => any;
|
|
6
7
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
8
|
onSelect?: ((color: string) => any) | undefined;
|
|
8
|
-
}>, {
|
|
9
|
+
}>, {
|
|
10
|
+
selector: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
9
12
|
export default _default;
|
|
10
13
|
//# sourceMappingURL=EnvironmentColors.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentColors.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentColors.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentColors.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentColors.vue"],"names":[],"mappings":"AAoKA,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;;;;;;cADW,OAAO;;AA2PtB,wBASG"}
|