@scalar/api-client 2.0.48 → 2.0.50
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 +20 -0
- package/dist/components/Sidebar/Sidebar.vue.d.ts +0 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +23 -25
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +2 -2
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +1 -1
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/local-storage.js +1 -1
- package/dist/store/workspace.d.ts +2 -2
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth.vue2.js +165 -148
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +29 -28
- package/dist/views/Request/consts/new-auth-options.d.ts +0 -1
- package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
- package/dist/views/Request/consts/new-auth-options.js +5 -6
- package/package.json +4 -4
|
@@ -1,180 +1,200 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useWorkspace as
|
|
1
|
+
import { defineComponent as K, ref as L, computed as C, openBlock as i, createBlock as b, withCtx as o, createElementVNode as h, toDisplayString as g, createVNode as u, unref as n, createElementBlock as c, Fragment as v, renderList as q, createTextVNode as f, withModifiers as z, createCommentVNode as A, capitalize as E, pushScopeId as Q, popScopeId as G } from "vue";
|
|
2
|
+
import J from "../../../components/DataTable/DataTableCell.vue.js";
|
|
3
|
+
import X from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
4
|
+
import { useWorkspace as Y } from "../../../store/workspace.js";
|
|
5
5
|
import V from "./RequestAuthDataTableInput.vue.js";
|
|
6
|
-
import { ScalarComboboxMultiselect as
|
|
7
|
-
import { camelToTitleWords as
|
|
8
|
-
import { ADD_AUTH_OPTIONS as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
6
|
+
import { ScalarComboboxMultiselect as Z, ScalarButton as ee, ScalarIcon as F } from "@scalar/components";
|
|
7
|
+
import { camelToTitleWords as te } from "@scalar/oas-utils/helpers";
|
|
8
|
+
import { ADD_AUTH_OPTIONS as le, ADD_AUTH_DICT as ae } from "../consts/new-auth-options.js";
|
|
9
|
+
import oe from "../../../components/DataTable/DataTable.vue.js";
|
|
10
|
+
import _ from "../../../components/DataTable/DataTableRow.vue.js";
|
|
11
|
+
import ue from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
12
|
+
import ne from "../components/OAuth2.vue.js";
|
|
13
|
+
const D = (S) => (Q("data-v-afbf407f"), S = S(), G(), S), ie = { class: "flex gap-1" }, se = /* @__PURE__ */ D(() => /* @__PURE__ */ h("div", { class: "text-c-2 h-8 flex min-w-[120px] items-center border-r-1/2 pr-0 pl-2" }, " Auth Type ", -1)), re = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "flex relative scroll-timeline-x w-full"
|
|
16
|
-
},
|
|
16
|
+
}, de = /* @__PURE__ */ D(() => /* @__PURE__ */ h("div", { class: "fade-left" }, null, -1)), ce = { class: "flex flex-1 gap-0.75 mr-1.5 items-center" }, pe = /* @__PURE__ */ D(() => /* @__PURE__ */ h("div", { class: "fade-right" }, null, -1)), me = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "pl-2"
|
|
19
|
-
},
|
|
19
|
+
}, $ = "*sclrMulti*", Te = /* @__PURE__ */ K({
|
|
20
20
|
__name: "RequestAuth",
|
|
21
21
|
props: {
|
|
22
22
|
title: {}
|
|
23
23
|
},
|
|
24
24
|
setup(S) {
|
|
25
25
|
const {
|
|
26
|
-
activeCollection:
|
|
27
|
-
activeRequest:
|
|
28
|
-
activeSecurityRequirements:
|
|
29
|
-
activeSecuritySchemes:
|
|
30
|
-
isReadOnly:
|
|
31
|
-
requestMutators:
|
|
32
|
-
securitySchemeMutators:
|
|
33
|
-
securitySchemes:
|
|
34
|
-
} =
|
|
35
|
-
switch (
|
|
26
|
+
activeCollection: T,
|
|
27
|
+
activeRequest: k,
|
|
28
|
+
activeSecurityRequirements: O,
|
|
29
|
+
activeSecuritySchemes: R,
|
|
30
|
+
isReadOnly: w,
|
|
31
|
+
requestMutators: P,
|
|
32
|
+
securitySchemeMutators: N,
|
|
33
|
+
securitySchemes: U
|
|
34
|
+
} = Y(), B = L(null), I = (t) => {
|
|
35
|
+
switch (t == null ? void 0 : t.type) {
|
|
36
36
|
case "apiKey":
|
|
37
|
-
return `${
|
|
37
|
+
return `${E(t.in)}`;
|
|
38
38
|
case "http":
|
|
39
|
-
return `${
|
|
39
|
+
return `${E(t.scheme)} Authentication`;
|
|
40
40
|
case "oauth2":
|
|
41
|
-
return
|
|
41
|
+
return te(t.flow.type);
|
|
42
42
|
case "openIdConnect":
|
|
43
43
|
return "Open ID Connect";
|
|
44
44
|
default:
|
|
45
45
|
return "None";
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
}, j = C(
|
|
48
48
|
() => {
|
|
49
49
|
var e;
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const t = (e = T.value) == null ? void 0 : e.securitySchemeDict, l = O.value.flatMap((d) => {
|
|
51
|
+
const a = Object.keys(d);
|
|
52
|
+
if (a.length === 0 && w.value)
|
|
53
|
+
return { id: "none", label: "None" };
|
|
54
|
+
if (!t) return [];
|
|
55
|
+
if (a.length > 1) {
|
|
56
|
+
const p = a.map((r) => {
|
|
57
|
+
const x = t[r];
|
|
58
|
+
return U[x];
|
|
59
|
+
}), s = p.map((r) => r.nameKey).join(" & ");
|
|
60
|
+
return {
|
|
61
|
+
id: $ + p.map((r) => r.uid).join($),
|
|
62
|
+
label: s
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return a.flatMap((p) => {
|
|
66
|
+
const s = t[p], r = U[s], x = I(r);
|
|
55
67
|
return {
|
|
56
68
|
id: s,
|
|
57
|
-
label:
|
|
58
|
-
labelWithoutId: x
|
|
69
|
+
label: x
|
|
59
70
|
};
|
|
60
71
|
});
|
|
61
72
|
});
|
|
62
|
-
if (
|
|
63
|
-
return
|
|
73
|
+
if (w.value)
|
|
74
|
+
return l;
|
|
64
75
|
{
|
|
65
|
-
const
|
|
66
|
-
const
|
|
76
|
+
const d = k.value.securitySchemeUids.map((s) => {
|
|
77
|
+
const r = U[s], x = I(r);
|
|
67
78
|
return {
|
|
68
79
|
id: s,
|
|
69
|
-
label: "name" in
|
|
70
|
-
labelWithoutId: x
|
|
80
|
+
label: "name" in r && r.name.length ? `${x} (${r.name})` : x
|
|
71
81
|
};
|
|
72
|
-
}),
|
|
73
|
-
(s) =>
|
|
82
|
+
}), a = k.value.selectedSecuritySchemeUids, p = d.filter(
|
|
83
|
+
(s) => a.includes(s.id)
|
|
74
84
|
);
|
|
75
85
|
return [
|
|
76
|
-
{ label: "Select auth", options: [...
|
|
86
|
+
{ label: "Select auth", options: [...l, ...p] },
|
|
77
87
|
{
|
|
78
88
|
label: "Add new auth",
|
|
79
|
-
options:
|
|
89
|
+
options: le
|
|
80
90
|
}
|
|
81
91
|
];
|
|
82
92
|
}
|
|
83
93
|
}
|
|
84
|
-
),
|
|
94
|
+
), M = (t) => {
|
|
95
|
+
if (t.startsWith($)) {
|
|
96
|
+
const l = t.split($);
|
|
97
|
+
return l.shift(), l;
|
|
98
|
+
} else
|
|
99
|
+
return [t];
|
|
100
|
+
}, m = C({
|
|
85
101
|
// Grab the selected OR first security scheme
|
|
86
|
-
get: () =>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
get: () => {
|
|
103
|
+
var l;
|
|
104
|
+
const t = new Set(
|
|
105
|
+
((l = k.value) == null ? void 0 : l.selectedSecuritySchemeUids) || []
|
|
106
|
+
);
|
|
107
|
+
return j.value.flatMap(
|
|
108
|
+
(e) => "options" in e ? e.options : e
|
|
109
|
+
).filter(
|
|
110
|
+
(e) => M(e.id).some((d) => t.has(d))
|
|
111
|
+
);
|
|
112
|
+
},
|
|
96
113
|
// Update the selected auth per this request
|
|
97
|
-
set: (
|
|
98
|
-
var e,
|
|
99
|
-
const
|
|
100
|
-
(s) =>
|
|
114
|
+
set: (t) => {
|
|
115
|
+
var e, d, a, p;
|
|
116
|
+
const l = t.find(
|
|
117
|
+
(s) => ae[s.id]
|
|
101
118
|
);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
119
|
+
l != null && l.payload && T.value ? ((p = (a = (d = (e = B.value) == null ? void 0 : e.comboboxPopoverRef) == null ? void 0 : d.popoverButtonRef) == null ? void 0 : a.el) == null || p.click(), N.add(
|
|
120
|
+
l.payload,
|
|
121
|
+
T.value.uid,
|
|
122
|
+
k.value,
|
|
106
123
|
!0
|
|
107
|
-
)) :
|
|
108
|
-
|
|
124
|
+
)) : P.edit(
|
|
125
|
+
k.value.uid,
|
|
109
126
|
"selectedSecuritySchemeUids",
|
|
110
|
-
|
|
127
|
+
t.flatMap((s) => M(s.id))
|
|
111
128
|
);
|
|
112
129
|
}
|
|
113
|
-
}),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
130
|
+
}), W = C(
|
|
131
|
+
() => m.value.flatMap(({ id: t }) => M(t)).map((t) => {
|
|
132
|
+
const l = U[t];
|
|
133
|
+
return `${I(l)} (${l.nameKey})`;
|
|
134
|
+
})
|
|
135
|
+
), y = (t, l, e) => N.edit(t.uid ?? "", l, e), H = (t) => {
|
|
136
|
+
const l = m.value.filter(
|
|
137
|
+
(e) => e.id !== t
|
|
118
138
|
);
|
|
119
|
-
|
|
139
|
+
m.value = l;
|
|
120
140
|
};
|
|
121
|
-
return (
|
|
141
|
+
return (t, l) => (i(), b(X, {
|
|
122
142
|
class: "group/params",
|
|
123
|
-
itemCount:
|
|
143
|
+
itemCount: m.value.length
|
|
124
144
|
}, {
|
|
125
|
-
title:
|
|
126
|
-
h("div",
|
|
145
|
+
title: o(() => [
|
|
146
|
+
h("div", ie, g(t.title), 1)
|
|
127
147
|
]),
|
|
128
|
-
default:
|
|
148
|
+
default: o(() => [
|
|
129
149
|
h("form", null, [
|
|
130
|
-
u(n(
|
|
150
|
+
u(n(oe), {
|
|
131
151
|
class: "flex-1",
|
|
132
152
|
columns: [""]
|
|
133
153
|
}, {
|
|
134
|
-
default:
|
|
135
|
-
u(n(
|
|
136
|
-
default:
|
|
137
|
-
u(n(
|
|
138
|
-
default:
|
|
139
|
-
u(n(
|
|
154
|
+
default: o(() => [
|
|
155
|
+
u(n(_), null, {
|
|
156
|
+
default: o(() => [
|
|
157
|
+
u(n(ue), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
|
|
158
|
+
default: o(() => [
|
|
159
|
+
u(n(Z), {
|
|
140
160
|
ref_key: "comboboxRef",
|
|
141
|
-
ref:
|
|
142
|
-
modelValue:
|
|
143
|
-
"onUpdate:modelValue":
|
|
161
|
+
ref: B,
|
|
162
|
+
modelValue: m.value,
|
|
163
|
+
"onUpdate:modelValue": l[0] || (l[0] = (e) => m.value = e),
|
|
144
164
|
class: "text-xs w-full",
|
|
145
165
|
fullWidth: "",
|
|
146
166
|
multiple: "",
|
|
147
|
-
options:
|
|
167
|
+
options: j.value,
|
|
148
168
|
style: { "margin-left": "120px" },
|
|
149
169
|
teleport: ""
|
|
150
170
|
}, {
|
|
151
|
-
default:
|
|
152
|
-
u(n(
|
|
171
|
+
default: o(() => [
|
|
172
|
+
u(n(ee), {
|
|
153
173
|
class: "h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal justify-start",
|
|
154
174
|
fullWidth: "",
|
|
155
175
|
variant: "ghost"
|
|
156
176
|
}, {
|
|
157
|
-
default:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
h("div",
|
|
162
|
-
(i(!0), c(v, null,
|
|
177
|
+
default: o(() => [
|
|
178
|
+
se,
|
|
179
|
+
m.value.length ? (i(), c("div", re, [
|
|
180
|
+
de,
|
|
181
|
+
h("div", ce, [
|
|
182
|
+
(i(!0), c(v, null, q(m.value, (e) => (i(), c("span", {
|
|
163
183
|
key: e.id,
|
|
164
184
|
class: "cm-pill flex items-center mx-0 h-fit"
|
|
165
185
|
}, [
|
|
166
|
-
|
|
167
|
-
u(n(
|
|
186
|
+
f(g(e.label) + " ", 1),
|
|
187
|
+
u(n(F), {
|
|
168
188
|
class: "ml-1 cursor-pointer text-c-3 hover:text-c-1",
|
|
169
189
|
icon: "Close",
|
|
170
190
|
size: "xs",
|
|
171
|
-
onClick:
|
|
191
|
+
onClick: z((d) => H(e.id), ["stop"])
|
|
172
192
|
}, null, 8, ["onClick"])
|
|
173
193
|
]))), 128))
|
|
174
194
|
]),
|
|
175
|
-
|
|
176
|
-
])) : (i(), c("div",
|
|
177
|
-
u(n(
|
|
195
|
+
pe
|
|
196
|
+
])) : (i(), c("div", me, " None ")),
|
|
197
|
+
u(n(F), {
|
|
178
198
|
class: "min-w-3 ml-auto mr-2.5",
|
|
179
199
|
icon: "ChevronDown",
|
|
180
200
|
size: "xs"
|
|
@@ -191,123 +211,120 @@ const C = (S) => (H("data-v-24e41ef0"), S = S(), Q(), S), oe = { class: "flex ga
|
|
|
191
211
|
]),
|
|
192
212
|
_: 1
|
|
193
213
|
}),
|
|
194
|
-
(i(!0), c(v, null,
|
|
214
|
+
(i(!0), c(v, null, q(n(R), (e, d) => (i(), c(v, {
|
|
195
215
|
key: e.uid
|
|
196
216
|
}, [
|
|
197
|
-
n(
|
|
217
|
+
n(R).length > 1 ? (i(), b(n(_), {
|
|
198
218
|
key: 0,
|
|
199
219
|
class: "group/delete"
|
|
200
220
|
}, {
|
|
201
|
-
default:
|
|
202
|
-
u(
|
|
203
|
-
default:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
p(U((t = d.value[r]) == null ? void 0 : t.label), 1)
|
|
207
|
-
];
|
|
208
|
-
}),
|
|
221
|
+
default: o(() => [
|
|
222
|
+
u(J, { class: "text-c-2 pl-2 text-xs font-medium flex items-center bg-b-2" }, {
|
|
223
|
+
default: o(() => [
|
|
224
|
+
f(g(W.value[d]), 1)
|
|
225
|
+
]),
|
|
209
226
|
_: 2
|
|
210
227
|
}, 1024)
|
|
211
228
|
]),
|
|
212
229
|
_: 2
|
|
213
|
-
}, 1024)) :
|
|
230
|
+
}, 1024)) : A("", !0),
|
|
214
231
|
e.type === "http" ? (i(), c(v, { key: 1 }, [
|
|
215
|
-
e.scheme === "bearer" ? (i(),
|
|
216
|
-
default:
|
|
232
|
+
e.scheme === "bearer" ? (i(), b(n(_), { key: 0 }, {
|
|
233
|
+
default: o(() => [
|
|
217
234
|
u(V, {
|
|
218
235
|
id: `http-bearer-token-${e.uid}`,
|
|
219
236
|
modelValue: e.value,
|
|
220
237
|
placeholder: "Token",
|
|
221
238
|
type: "password",
|
|
222
|
-
"onUpdate:modelValue": (
|
|
239
|
+
"onUpdate:modelValue": (a) => y(e, "value", a)
|
|
223
240
|
}, {
|
|
224
|
-
default:
|
|
225
|
-
|
|
241
|
+
default: o(() => [
|
|
242
|
+
f(" Bearer Token ")
|
|
226
243
|
]),
|
|
227
244
|
_: 2
|
|
228
245
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
229
246
|
]),
|
|
230
247
|
_: 2
|
|
231
248
|
}, 1024)) : e.scheme === "basic" ? (i(), c(v, { key: 1 }, [
|
|
232
|
-
u(n(
|
|
233
|
-
default:
|
|
249
|
+
u(n(_), null, {
|
|
250
|
+
default: o(() => [
|
|
234
251
|
u(V, {
|
|
235
252
|
id: `http-basic-username-${e.uid}`,
|
|
236
253
|
class: "text-c-2",
|
|
237
254
|
modelValue: e.value,
|
|
238
255
|
placeholder: "ScalarEnjoyer01",
|
|
239
256
|
required: "",
|
|
240
|
-
"onUpdate:modelValue": (
|
|
257
|
+
"onUpdate:modelValue": (a) => y(e, "value", a)
|
|
241
258
|
}, {
|
|
242
|
-
default:
|
|
243
|
-
|
|
259
|
+
default: o(() => [
|
|
260
|
+
f(" Username ")
|
|
244
261
|
]),
|
|
245
262
|
_: 2
|
|
246
263
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
247
264
|
]),
|
|
248
265
|
_: 2
|
|
249
266
|
}, 1024),
|
|
250
|
-
u(n(
|
|
251
|
-
default:
|
|
267
|
+
u(n(_), null, {
|
|
268
|
+
default: o(() => [
|
|
252
269
|
u(V, {
|
|
253
270
|
id: `http-basic-password-${e.uid}`,
|
|
254
271
|
modelValue: e.secondValue,
|
|
255
272
|
placeholder: "xxxxxx",
|
|
256
273
|
type: "password",
|
|
257
|
-
"onUpdate:modelValue": (
|
|
274
|
+
"onUpdate:modelValue": (a) => y(e, "secondValue", a)
|
|
258
275
|
}, {
|
|
259
|
-
default:
|
|
260
|
-
|
|
276
|
+
default: o(() => [
|
|
277
|
+
f(" Password ")
|
|
261
278
|
]),
|
|
262
279
|
_: 2
|
|
263
280
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
264
281
|
]),
|
|
265
282
|
_: 2
|
|
266
283
|
}, 1024)
|
|
267
|
-
], 64)) :
|
|
284
|
+
], 64)) : A("", !0)
|
|
268
285
|
], 64)) : e.type === "apiKey" ? (i(), c(v, { key: 2 }, [
|
|
269
|
-
n(
|
|
270
|
-
default:
|
|
286
|
+
n(w) ? (i(), b(n(_), { key: 1 }, {
|
|
287
|
+
default: o(() => [
|
|
271
288
|
u(V, {
|
|
272
289
|
id: `api-key-value-${e.uid}`,
|
|
273
290
|
modelValue: e.value,
|
|
274
291
|
placeholder: "Value",
|
|
275
|
-
"onUpdate:modelValue": (
|
|
292
|
+
"onUpdate:modelValue": (a) => y(e, "value", a)
|
|
276
293
|
}, {
|
|
277
|
-
default:
|
|
278
|
-
|
|
294
|
+
default: o(() => [
|
|
295
|
+
f(g(e.name), 1)
|
|
279
296
|
]),
|
|
280
297
|
_: 2
|
|
281
298
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
282
299
|
]),
|
|
283
300
|
_: 2
|
|
284
301
|
}, 1024)) : (i(), c(v, { key: 0 }, [
|
|
285
|
-
u(n(
|
|
286
|
-
default:
|
|
302
|
+
u(n(_), null, {
|
|
303
|
+
default: o(() => [
|
|
287
304
|
u(V, {
|
|
288
305
|
id: `api-key-name-${e.uid}`,
|
|
289
306
|
modelValue: e.name,
|
|
290
307
|
placeholder: "api-key",
|
|
291
|
-
"onUpdate:modelValue": (
|
|
308
|
+
"onUpdate:modelValue": (a) => y(e, "name", a)
|
|
292
309
|
}, {
|
|
293
|
-
default:
|
|
294
|
-
|
|
310
|
+
default: o(() => [
|
|
311
|
+
f(" Name ")
|
|
295
312
|
]),
|
|
296
313
|
_: 2
|
|
297
314
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
298
315
|
]),
|
|
299
316
|
_: 2
|
|
300
317
|
}, 1024),
|
|
301
|
-
u(n(
|
|
302
|
-
default:
|
|
318
|
+
u(n(_), null, {
|
|
319
|
+
default: o(() => [
|
|
303
320
|
u(V, {
|
|
304
321
|
id: `api-key-value-add-${e.uid}`,
|
|
305
322
|
modelValue: e.value,
|
|
306
323
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
307
|
-
"onUpdate:modelValue": (
|
|
324
|
+
"onUpdate:modelValue": (a) => y(e, "value", a)
|
|
308
325
|
}, {
|
|
309
|
-
default:
|
|
310
|
-
|
|
326
|
+
default: o(() => [
|
|
327
|
+
f(" Value ")
|
|
311
328
|
]),
|
|
312
329
|
_: 2
|
|
313
330
|
}, 1032, ["id", "modelValue", "onUpdate:modelValue"])
|
|
@@ -315,10 +332,10 @@ const C = (S) => (H("data-v-24e41ef0"), S = S(), Q(), S), oe = { class: "flex ga
|
|
|
315
332
|
_: 2
|
|
316
333
|
}, 1024)
|
|
317
334
|
], 64))
|
|
318
|
-
], 64)) : e.type === "oauth2" ? (i(),
|
|
335
|
+
], 64)) : e.type === "oauth2" ? (i(), b(n(ne), {
|
|
319
336
|
key: 3,
|
|
320
337
|
scheme: e
|
|
321
|
-
}, null, 8, ["scheme"])) :
|
|
338
|
+
}, null, 8, ["scheme"])) : A("", !0)
|
|
322
339
|
], 64))), 128))
|
|
323
340
|
]),
|
|
324
341
|
_: 1
|
|
@@ -330,5 +347,5 @@ const C = (S) => (H("data-v-24e41ef0"), S = S(), Q(), S), oe = { class: "flex ga
|
|
|
330
347
|
}
|
|
331
348
|
});
|
|
332
349
|
export {
|
|
333
|
-
|
|
350
|
+
Te as default
|
|
334
351
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/WorkspaceDropdown.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"WorkspaceDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/WorkspaceDropdown.vue"],"names":[],"mappings":";AAs7BA,wBAKG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as K, computed as O, ref as W, openBlock as p, createElementBlock as D, Fragment as S, createElementVNode as a, createVNode as t, unref as e, withCtx as s, renderList as U, createBlock as x, withModifiers as
|
|
1
|
+
import { defineComponent as K, computed as O, ref as W, openBlock as p, createElementBlock as D, Fragment as S, createElementVNode as a, createVNode as t, unref as e, withCtx as s, renderList as U, createBlock as x, withModifiers as w, normalizeClass as A, createTextVNode as k, toDisplayString as z, withKeys as F } from "vue";
|
|
2
2
|
import I from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
3
3
|
import { useWorkspace as L } from "../../../store/workspace.js";
|
|
4
4
|
import { useModal as $, ScalarDropdown as N, ScalarContextMenu as P, ScalarDropdownItem as m, ScalarIcon as c, ScalarTooltip as q, ScalarDropdownDivider as G, ScalarButton as _, ScalarModal as V, ScalarTextField as H } from "@scalar/components";
|
|
@@ -8,36 +8,36 @@ const X = { class: "xl:min-h-header xl:py-2.5 py-1 flex items-center border-b-1/
|
|
|
8
8
|
/* @__PURE__ */ a("div", { class: "flex items-center text-c-2" }, [
|
|
9
9
|
/* @__PURE__ */ a("span", null, "Only workspace cannot be deleted.")
|
|
10
10
|
])
|
|
11
|
-
], -1), se = /* @__PURE__ */ a("span", null, "Delete", -1), ae = { class: "flex items-center justify-center h-4 w-4" },
|
|
11
|
+
], -1), se = /* @__PURE__ */ a("span", null, "Delete", -1), ae = { class: "flex items-center justify-center h-4 w-4" }, ne = /* @__PURE__ */ a("span", null, "Create new workspace", -1), le = { class: "flex gap-3" }, me = /* @__PURE__ */ K({
|
|
12
12
|
__name: "WorkspaceDropdown",
|
|
13
13
|
setup(oe) {
|
|
14
|
-
const { activeWorkspace: f, workspaces: d, workspaceMutators: g } = L(), { push: b } = J(), j = (
|
|
15
|
-
|
|
16
|
-
}, y = O(() => Object.keys(d).length === 1), B = () => Q.emit({ commandName: "Create Workspace" }), o = W(""),
|
|
17
|
-
o.value = d[
|
|
14
|
+
const { activeWorkspace: f, workspaces: d, workspaceMutators: g } = L(), { push: b } = J(), j = (n) => {
|
|
15
|
+
n !== f.value.uid && b(`/workspace/${n}`);
|
|
16
|
+
}, y = O(() => Object.keys(d).length === 1), B = () => Q.emit({ commandName: "Create Workspace" }), o = W(""), r = W(""), v = $(), h = $(), R = (n) => {
|
|
17
|
+
o.value = d[n].name, r.value = n, v.show();
|
|
18
18
|
}, C = () => {
|
|
19
|
-
o.value.trim() && (g.rename(
|
|
20
|
-
}, T = (
|
|
21
|
-
o.value = d[
|
|
19
|
+
o.value.trim() && (g.rename(r.value, o.value.trim()), v.hide());
|
|
20
|
+
}, T = (n) => {
|
|
21
|
+
o.value = d[n].name, r.value = n, h.show();
|
|
22
22
|
}, E = async () => {
|
|
23
23
|
if (!y.value) {
|
|
24
|
-
const
|
|
25
|
-
if (delete
|
|
26
|
-
const
|
|
27
|
-
await b(`/workspace/${
|
|
24
|
+
const n = f.value.uid === r.value, l = { ...d };
|
|
25
|
+
if (delete l[r.value], g.delete(r.value), n) {
|
|
26
|
+
const i = Object.keys(l)[0];
|
|
27
|
+
await b(`/workspace/${i}/`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
h.hide();
|
|
31
31
|
};
|
|
32
|
-
return (
|
|
32
|
+
return (n, l) => (p(), D(S, null, [
|
|
33
33
|
a("div", X, [
|
|
34
34
|
t(e(N), null, {
|
|
35
35
|
items: s(() => [
|
|
36
|
-
(p(!0), D(S, null, U(e(d), (
|
|
36
|
+
(p(!0), D(S, null, U(e(d), (i, u) => (p(), x(e(P), { key: u }, {
|
|
37
37
|
trigger: s(() => [
|
|
38
38
|
t(e(m), {
|
|
39
39
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: w((M) => j(u), ["stop"])
|
|
41
41
|
}, {
|
|
42
42
|
default: s(() => [
|
|
43
43
|
a("div", {
|
|
@@ -52,7 +52,7 @@ const X = { class: "xl:min-h-header xl:py-2.5 py-1 flex items-center border-b-1/
|
|
|
52
52
|
thickness: "3.5"
|
|
53
53
|
})
|
|
54
54
|
], 2),
|
|
55
|
-
k(" " + z(
|
|
55
|
+
k(" " + z(i.name), 1)
|
|
56
56
|
]),
|
|
57
57
|
_: 2
|
|
58
58
|
}, 1032, ["onClick"])
|
|
@@ -84,7 +84,7 @@ const X = { class: "xl:min-h-header xl:py-2.5 py-1 flex items-center border-b-1/
|
|
|
84
84
|
t(e(m), {
|
|
85
85
|
class: "flex w-full",
|
|
86
86
|
disabled: "",
|
|
87
|
-
onMousedown:
|
|
87
|
+
onMousedown: l[0] || (l[0] = w(() => {
|
|
88
88
|
}, ["prevent"]))
|
|
89
89
|
}, {
|
|
90
90
|
default: s(() => [
|
|
@@ -106,7 +106,7 @@ const X = { class: "xl:min-h-header xl:py-2.5 py-1 flex items-center border-b-1/
|
|
|
106
106
|
})) : (p(), x(e(m), {
|
|
107
107
|
key: 1,
|
|
108
108
|
class: "flex !gap-2",
|
|
109
|
-
onMousedown:
|
|
109
|
+
onMousedown: w((M) => T(u), ["prevent"])
|
|
110
110
|
}, {
|
|
111
111
|
default: s(() => [
|
|
112
112
|
t(e(c), {
|
|
@@ -134,10 +134,11 @@ const X = { class: "xl:min-h-header xl:py-2.5 py-1 flex items-center border-b-1/
|
|
|
134
134
|
a("div", ae, [
|
|
135
135
|
t(e(c), {
|
|
136
136
|
class: "h-2.5",
|
|
137
|
-
icon: "Add"
|
|
137
|
+
icon: "Add",
|
|
138
|
+
thickness: "3"
|
|
138
139
|
})
|
|
139
140
|
]),
|
|
140
|
-
|
|
141
|
+
ne
|
|
141
142
|
]),
|
|
142
143
|
_: 1
|
|
143
144
|
})
|
|
@@ -166,14 +167,14 @@ const X = { class: "xl:min-h-header xl:py-2.5 py-1 flex items-center border-b-1/
|
|
|
166
167
|
]),
|
|
167
168
|
t(e(V), {
|
|
168
169
|
size: "sm",
|
|
169
|
-
state: e(
|
|
170
|
+
state: e(h),
|
|
170
171
|
title: `Delete ${o.value}`
|
|
171
172
|
}, {
|
|
172
173
|
default: s(() => [
|
|
173
174
|
t(I, {
|
|
174
175
|
variableName: o.value,
|
|
175
176
|
warningMessage: "Warning: Deleting this will delete all items inside of this",
|
|
176
|
-
onClose:
|
|
177
|
+
onClose: l[1] || (l[1] = (i) => e(h).hide()),
|
|
177
178
|
onDelete: E
|
|
178
179
|
}, null, 8, ["variableName"])
|
|
179
180
|
]),
|
|
@@ -186,16 +187,16 @@ const X = { class: "xl:min-h-header xl:py-2.5 py-1 flex items-center border-b-1/
|
|
|
186
187
|
default: s(() => [
|
|
187
188
|
t(e(H), {
|
|
188
189
|
modelValue: o.value,
|
|
189
|
-
"onUpdate:modelValue":
|
|
190
|
+
"onUpdate:modelValue": l[2] || (l[2] = (i) => o.value = i),
|
|
190
191
|
label: "Workspace",
|
|
191
192
|
labelShadowColor: "var(--scalar-background-1)",
|
|
192
|
-
onKeydown: F(
|
|
193
|
+
onKeydown: F(w(C, ["prevent"]), ["enter"])
|
|
193
194
|
}, null, 8, ["modelValue", "onKeydown"]),
|
|
194
|
-
a("div",
|
|
195
|
+
a("div", le, [
|
|
195
196
|
t(e(_), {
|
|
196
197
|
class: "flex-1",
|
|
197
198
|
variant: "outlined",
|
|
198
|
-
onClick:
|
|
199
|
+
onClick: l[3] || (l[3] = (i) => e(v).hide())
|
|
199
200
|
}, {
|
|
200
201
|
default: s(() => [
|
|
201
202
|
k(" Cancel ")
|