@scalar/api-client 2.0.57 → 2.0.58
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 +18 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +61 -58
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +31 -25
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +51 -45
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +47 -41
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -40
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +67 -61
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +30 -30
- package/dist/components/TopNav/TopNav.vue.d.ts +20 -1
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +64 -49
- package/dist/layouts/App/ApiClientApp.vue.d.ts +11 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +53 -49
- package/dist/libs/event-busses/cancel-request-bus.d.ts +2 -0
- package/dist/libs/event-busses/cancel-request-bus.d.ts.map +1 -0
- package/dist/libs/event-busses/cancel-request-bus.js +5 -0
- package/dist/libs/event-busses/hot-keys-bus.d.ts +3 -1
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.js +1 -0
- package/dist/libs/event-busses/index.d.ts +2 -1
- package/dist/libs/event-busses/index.d.ts.map +1 -1
- package/dist/libs/event-busses/index.js +11 -8
- package/dist/libs/index.js +21 -18
- package/dist/libs/local-storage.js +1 -1
- package/dist/libs/sendRequest.d.ts +2 -2
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +22 -21
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +100 -103
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts +11 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +3 -3
- package/dist/views/Request/Request.vue2.js +184 -174
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +2 -0
- 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 +139 -130
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts +3 -0
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +7 -0
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +39 -0
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +37 -30
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +23 -21
- package/package.json +7 -7
package/dist/store/workspace.js
CHANGED
|
@@ -3,18 +3,18 @@ import { useModal as je } from "@scalar/components";
|
|
|
3
3
|
import { createWorkspace as Ce } from "@scalar/oas-utils/entities/workspace";
|
|
4
4
|
import { createCollection as We } from "@scalar/oas-utils/entities/workspace/collection";
|
|
5
5
|
import { createCookie as ge } from "@scalar/oas-utils/entities/workspace/cookie";
|
|
6
|
-
import { createEnvironment as
|
|
7
|
-
import { createFolder as
|
|
6
|
+
import { createEnvironment as Ie } from "@scalar/oas-utils/entities/workspace/environment";
|
|
7
|
+
import { createFolder as Fe } from "@scalar/oas-utils/entities/workspace/folder";
|
|
8
8
|
import { createSecurityScheme as Ke, securitySchemeApiKeyIn as Ae } from "@scalar/oas-utils/entities/workspace/security";
|
|
9
9
|
import { createServer as Pe } from "@scalar/oas-utils/entities/workspace/server";
|
|
10
|
-
import { createRequest as Te, createRequestExample as
|
|
11
|
-
import { iterateTitle as _e, fetchSpecFromUrl as
|
|
12
|
-
import { getRequestBodyFromOperation as
|
|
13
|
-
import { importSpecToWorkspace as
|
|
10
|
+
import { createRequest as Te, createRequestExample as qe, createRequestExampleParameter as Ne } from "@scalar/oas-utils/entities/workspace/spec";
|
|
11
|
+
import { iterateTitle as _e, fetchSpecFromUrl as Be } from "@scalar/oas-utils/helpers";
|
|
12
|
+
import { getRequestBodyFromOperation as De } from "@scalar/oas-utils/spec-getters";
|
|
13
|
+
import { importSpecToWorkspace as Le } from "@scalar/oas-utils/transforms";
|
|
14
14
|
import { mutationFactory as E, LS_KEYS as b } from "@scalar/object-utils/mutator-record";
|
|
15
15
|
import { computed as u, reactive as l, ref as Ve, inject as $e, toRaw as Je } from "vue";
|
|
16
16
|
const lt = (H, y = !0) => {
|
|
17
|
-
const
|
|
17
|
+
const C = u(() => {
|
|
18
18
|
const e = {
|
|
19
19
|
[f.Collection]: "default",
|
|
20
20
|
[f.Environment]: "default",
|
|
@@ -32,17 +32,17 @@ const lt = (H, y = !0) => {
|
|
|
32
32
|
m,
|
|
33
33
|
l({}),
|
|
34
34
|
y && b.REQUEST
|
|
35
|
-
),
|
|
36
|
-
const
|
|
37
|
-
return
|
|
35
|
+
), N = (e, t, s) => {
|
|
36
|
+
const c = Te(e), i = Q(c, s);
|
|
37
|
+
return c.childUids.push(i.uid), h.add(c), t && (d[t] ? p.edit(t, "childUids", [
|
|
38
38
|
...d[t].childUids,
|
|
39
|
-
|
|
39
|
+
c.uid
|
|
40
40
|
]) : r[t] && R.edit(t, "childUids", [
|
|
41
41
|
...r[t].childUids,
|
|
42
|
-
|
|
43
|
-
])),
|
|
42
|
+
c.uid
|
|
43
|
+
])), c;
|
|
44
44
|
}, _ = (e, t) => {
|
|
45
|
-
e.childUids.forEach((s) =>
|
|
45
|
+
e.childUids.forEach((s) => g.delete(s)), t && d[t] ? p.edit(
|
|
46
46
|
t,
|
|
47
47
|
"childUids",
|
|
48
48
|
d[t].childUids.filter((s) => s !== e.uid)
|
|
@@ -52,25 +52,25 @@ const lt = (H, y = !0) => {
|
|
|
52
52
|
r[t].childUids.filter((s) => s !== e.uid)
|
|
53
53
|
), h.delete(e.uid);
|
|
54
54
|
}, U = u(() => {
|
|
55
|
-
var
|
|
56
|
-
const e =
|
|
55
|
+
var c, i;
|
|
56
|
+
const e = C.value[f.Request], t = (i = (c = Z.value) == null ? void 0 : c[0]) == null ? void 0 : i.uid, s = m[e] ?? m[t];
|
|
57
57
|
return xe(f.Request, s), s;
|
|
58
|
-
}),
|
|
58
|
+
}), B = (e, t = []) => {
|
|
59
59
|
const s = Object.values(d).find(
|
|
60
|
-
(
|
|
60
|
+
(i) => i.childUids.includes(e)
|
|
61
61
|
);
|
|
62
62
|
if (s) return [...t, s.uid];
|
|
63
|
-
const
|
|
64
|
-
({ childUids:
|
|
63
|
+
const c = Object.values(r).find(
|
|
64
|
+
({ childUids: i }) => i.includes(e)
|
|
65
65
|
);
|
|
66
|
-
return
|
|
67
|
-
},
|
|
68
|
-
|
|
66
|
+
return c ? B(c.uid, [...t, c.uid]) : t;
|
|
67
|
+
}, W = l({}), g = E(
|
|
68
|
+
W,
|
|
69
69
|
l({}),
|
|
70
70
|
y && b.REQUEST_EXAMPLE
|
|
71
71
|
), K = (e) => {
|
|
72
|
-
var t, s,
|
|
73
|
-
return
|
|
72
|
+
var t, s, c, i, n, v, k;
|
|
73
|
+
return Ne({
|
|
74
74
|
key: e.name,
|
|
75
75
|
value: e.schema && "default" in e.schema ? e.schema.default : e.schema && "examples" in e.schema && e.schema.examples.length > 0 ? e.schema.examples[0] : "",
|
|
76
76
|
description: e.description,
|
|
@@ -78,15 +78,15 @@ const lt = (H, y = !0) => {
|
|
|
78
78
|
enabled: !!e.required,
|
|
79
79
|
enum: (t = e.schema) == null ? void 0 : t.enum,
|
|
80
80
|
type: (s = e.schema) == null ? void 0 : s.type,
|
|
81
|
-
format: (
|
|
82
|
-
minimum: (
|
|
81
|
+
format: (c = e.schema) == null ? void 0 : c.format,
|
|
82
|
+
minimum: (i = e.schema) == null ? void 0 : i.minimum,
|
|
83
83
|
maximum: (n = e.schema) == null ? void 0 : n.maximum,
|
|
84
84
|
default: (v = e.schema) == null ? void 0 : v.default,
|
|
85
85
|
nullable: (k = e.schema) == null ? void 0 : k.nullable
|
|
86
86
|
});
|
|
87
87
|
}, Q = (e, t, s) => {
|
|
88
88
|
var k;
|
|
89
|
-
const
|
|
89
|
+
const c = {
|
|
90
90
|
path: Object.values(e.parameters.path).map(K),
|
|
91
91
|
query: Object.values(e.parameters.query).map(K),
|
|
92
92
|
headers: Object.values(e.parameters.headers).map(
|
|
@@ -95,7 +95,7 @@ const lt = (H, y = !0) => {
|
|
|
95
95
|
cookies: Object.values(e.parameters.cookies).map(
|
|
96
96
|
K
|
|
97
97
|
)
|
|
98
|
-
},
|
|
98
|
+
}, i = {
|
|
99
99
|
activeBody: "raw",
|
|
100
100
|
raw: {
|
|
101
101
|
encoding: "json",
|
|
@@ -103,30 +103,30 @@ const lt = (H, y = !0) => {
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
if (e.requestBody) {
|
|
106
|
-
const S =
|
|
106
|
+
const S = De({
|
|
107
107
|
httpVerb: e.method,
|
|
108
108
|
path: e.path,
|
|
109
109
|
information: {
|
|
110
110
|
requestBody: e.requestBody
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
((k = S == null ? void 0 : S.postData) == null ? void 0 : k.mimeType) === "application/json" && (
|
|
113
|
+
((k = S == null ? void 0 : S.postData) == null ? void 0 : k.mimeType) === "application/json" && (c.headers.push({
|
|
114
114
|
key: "Content-Type",
|
|
115
115
|
value: "application/json",
|
|
116
116
|
enabled: !0
|
|
117
|
-
}),
|
|
117
|
+
}), i.activeBody = "raw", i.raw.value = S.postData.text);
|
|
118
118
|
}
|
|
119
119
|
const n = s ?? _e(
|
|
120
120
|
(e.summary ?? "Example") + " #1",
|
|
121
|
-
(S) => e.childUids.some((o) => S ===
|
|
122
|
-
), v =
|
|
121
|
+
(S) => e.childUids.some((o) => S === W[o].name)
|
|
122
|
+
), v = qe({
|
|
123
123
|
url: t != null && t.url ? `{{${t == null ? void 0 : t.url}}}${e.path}` : e.path,
|
|
124
124
|
requestUid: e.uid,
|
|
125
|
-
parameters:
|
|
125
|
+
parameters: c,
|
|
126
126
|
name: n,
|
|
127
|
-
body:
|
|
127
|
+
body: i
|
|
128
128
|
});
|
|
129
|
-
return
|
|
129
|
+
return g.add(v), v;
|
|
130
130
|
}, ae = (e, t) => {
|
|
131
131
|
const s = Q(
|
|
132
132
|
e,
|
|
@@ -144,14 +144,14 @@ const lt = (H, y = !0) => {
|
|
|
144
144
|
m[e.requestUid].childUids.filter(
|
|
145
145
|
(t) => t !== e.uid
|
|
146
146
|
)
|
|
147
|
-
),
|
|
147
|
+
), g.delete(e.uid);
|
|
148
148
|
}, le = u(
|
|
149
149
|
() => {
|
|
150
150
|
var e;
|
|
151
|
-
return
|
|
151
|
+
return W[C.value[f.Examples]] ?? W[((e = U.value) == null ? void 0 : e.childUids[0]) ?? ""];
|
|
152
152
|
}
|
|
153
|
-
), re = u(() => Object.values(m).flatMap((e) => e.history).filter((e) => e.request && e.response).sort((e, t) => t.timestamp - e.timestamp)),
|
|
154
|
-
default:
|
|
153
|
+
), re = u(() => Object.values(m).flatMap((e) => e.history).filter((e) => e.request && e.response).sort((e, t) => t.timestamp - e.timestamp)), D = l({
|
|
154
|
+
default: Ie({
|
|
155
155
|
uid: "default",
|
|
156
156
|
name: "Global Environment",
|
|
157
157
|
color: "blue",
|
|
@@ -160,7 +160,7 @@ const lt = (H, y = !0) => {
|
|
|
160
160
|
isDefault: !0
|
|
161
161
|
})
|
|
162
162
|
}), G = E(
|
|
163
|
-
|
|
163
|
+
D,
|
|
164
164
|
l({}),
|
|
165
165
|
y && b.ENVIRONMENT
|
|
166
166
|
), ne = (e) => {
|
|
@@ -173,7 +173,7 @@ const lt = (H, y = !0) => {
|
|
|
173
173
|
const e = V.value.map((s) => ({
|
|
174
174
|
key: s.url,
|
|
175
175
|
value: s.url
|
|
176
|
-
})), t = Object.values(
|
|
176
|
+
})), t = Object.values(D).map((s) => {
|
|
177
177
|
try {
|
|
178
178
|
return {
|
|
179
179
|
_scalarEnvId: s.uid,
|
|
@@ -183,7 +183,7 @@ const lt = (H, y = !0) => {
|
|
|
183
183
|
return null;
|
|
184
184
|
}
|
|
185
185
|
}).filter((s) => s).flatMap(
|
|
186
|
-
(s) => Object.entries(s).flatMap(([
|
|
186
|
+
(s) => Object.entries(s).flatMap(([c, i]) => c !== "_scalarEnvId" ? [{ _scalarEnvId: s._scalarEnvId, key: c, value: i }] : [])
|
|
187
187
|
);
|
|
188
188
|
return [...e, ...t];
|
|
189
189
|
}), X = l({
|
|
@@ -202,7 +202,7 @@ const lt = (H, y = !0) => {
|
|
|
202
202
|
l({}),
|
|
203
203
|
y && b.COOKIE
|
|
204
204
|
), me = u(
|
|
205
|
-
() =>
|
|
205
|
+
() => C.value[f.Cookies]
|
|
206
206
|
), w = l({}), O = E(
|
|
207
207
|
w,
|
|
208
208
|
l({}),
|
|
@@ -220,7 +220,7 @@ const lt = (H, y = !0) => {
|
|
|
220
220
|
},
|
|
221
221
|
t.uid
|
|
222
222
|
);
|
|
223
|
-
return
|
|
223
|
+
return N({ summary: "My First Request" }, s.uid), t;
|
|
224
224
|
}, pe = (e) => {
|
|
225
225
|
if (Object.keys(w).length <= 1) {
|
|
226
226
|
console.warn("The last workspace cannot be deleted.");
|
|
@@ -230,26 +230,26 @@ const lt = (H, y = !0) => {
|
|
|
230
230
|
}, ve = (e, t) => {
|
|
231
231
|
w[e] ? O.edit(e, "name", t) : console.warn(`Workspace with uid ${e} not found.`);
|
|
232
232
|
}, x = u(
|
|
233
|
-
() => w[
|
|
234
|
-
),
|
|
233
|
+
() => w[C.value[f.Workspace]] ?? w[Object.keys(w)[0]]
|
|
234
|
+
), L = u(
|
|
235
235
|
() => {
|
|
236
236
|
var e;
|
|
237
237
|
return (e = x.value) == null ? void 0 : e.collectionUids.map((t) => d[t]).sort((t, s) => {
|
|
238
|
-
var
|
|
239
|
-
return ((
|
|
238
|
+
var c, i, n, v;
|
|
239
|
+
return ((i = (c = t.spec) == null ? void 0 : c.info) == null ? void 0 : i.title) === "Drafts" ? 1 : ((v = (n = s.spec) == null ? void 0 : n.info) == null ? void 0 : v.title) === "Drafts" ? -1 : 0;
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
), V = u(
|
|
243
243
|
() => {
|
|
244
244
|
var e;
|
|
245
|
-
return (e =
|
|
245
|
+
return (e = L.value) == null ? void 0 : e.flatMap(
|
|
246
246
|
(t) => t.spec.serverUids.map((s) => T[s])
|
|
247
247
|
);
|
|
248
248
|
}
|
|
249
249
|
), z = (e) => m[e] ?? r[e].childUids.flatMap((t) => z(t)), Z = u(
|
|
250
250
|
() => {
|
|
251
251
|
var e;
|
|
252
|
-
return (e =
|
|
252
|
+
return (e = L.value) == null ? void 0 : e.flatMap(
|
|
253
253
|
(t) => t.childUids.flatMap((s) => z(s))
|
|
254
254
|
);
|
|
255
255
|
}
|
|
@@ -267,9 +267,9 @@ const lt = (H, y = !0) => {
|
|
|
267
267
|
s.uid
|
|
268
268
|
]), p.add(s), s;
|
|
269
269
|
}, Se = (e) => {
|
|
270
|
-
var t, s,
|
|
270
|
+
var t, s, c;
|
|
271
271
|
if (x.value) {
|
|
272
|
-
if (((
|
|
272
|
+
if (((c = (s = (t = d[e.uid]) == null ? void 0 : t.spec) == null ? void 0 : s.info) == null ? void 0 : c.title) === "Drafts") {
|
|
273
273
|
console.warn("The drafts collection cannot be deleted");
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
@@ -277,20 +277,20 @@ const lt = (H, y = !0) => {
|
|
|
277
277
|
console.warn("You must have at least one collection");
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
|
-
e.childUids.forEach((
|
|
281
|
-
m[
|
|
280
|
+
e.childUids.forEach((i) => {
|
|
281
|
+
m[i] ? _(m[i]) : r[i] && J(r[i]);
|
|
282
282
|
}), O.edit(
|
|
283
283
|
x.value.uid,
|
|
284
284
|
"collectionUids",
|
|
285
285
|
x.value.collectionUids.filter(
|
|
286
|
-
(
|
|
286
|
+
(i) => i !== e.uid
|
|
287
287
|
)
|
|
288
288
|
), p.delete(e.uid);
|
|
289
289
|
}
|
|
290
290
|
}, A = u(() => {
|
|
291
291
|
const e = Object.values(d)[0];
|
|
292
292
|
if (!U.value) return e;
|
|
293
|
-
const t =
|
|
293
|
+
const t = B(U.value.uid);
|
|
294
294
|
if (!t.length) return null;
|
|
295
295
|
const s = t[t.length - 1];
|
|
296
296
|
return d[s] ?? e;
|
|
@@ -301,7 +301,7 @@ const lt = (H, y = !0) => {
|
|
|
301
301
|
l({}),
|
|
302
302
|
y && b.FOLDER
|
|
303
303
|
), ee = (e, t) => {
|
|
304
|
-
const s =
|
|
304
|
+
const s = Fe(e);
|
|
305
305
|
if (t)
|
|
306
306
|
if (d[t])
|
|
307
307
|
p.edit(t, "childUids", [
|
|
@@ -346,18 +346,18 @@ const lt = (H, y = !0) => {
|
|
|
346
346
|
var e, t;
|
|
347
347
|
return ((e = U.value) == null ? void 0 : e.security) ?? ((t = A.value) == null ? void 0 : t.spec.security) ?? [];
|
|
348
348
|
}
|
|
349
|
-
), I = (e, t, s,
|
|
350
|
-
const
|
|
351
|
-
P.add(
|
|
349
|
+
), I = (e, t, s, c = !1) => {
|
|
350
|
+
const i = Ke(e);
|
|
351
|
+
P.add(i), t && e.nameKey && p.edit(
|
|
352
352
|
t,
|
|
353
353
|
`securitySchemeDict.${e.nameKey}`,
|
|
354
|
-
|
|
354
|
+
i.uid
|
|
355
355
|
), s && (h.edit(s.uid, "securitySchemeUids", [
|
|
356
356
|
...s.securitySchemeUids,
|
|
357
|
-
|
|
358
|
-
]),
|
|
357
|
+
i.uid
|
|
358
|
+
]), c && h.edit(s.uid, "selectedSecuritySchemeUids", [
|
|
359
359
|
...s.selectedSecuritySchemeUids,
|
|
360
|
-
|
|
360
|
+
i.uid
|
|
361
361
|
]));
|
|
362
362
|
}, Re = (e, t) => {
|
|
363
363
|
t && (h.edit(
|
|
@@ -369,7 +369,7 @@ const lt = (H, y = !0) => {
|
|
|
369
369
|
"selectedSecuritySchemeUids",
|
|
370
370
|
t.selectedSecuritySchemeUids.filter((s) => s !== e.uid)
|
|
371
371
|
)), P.delete(e.uid);
|
|
372
|
-
}, T = l({}),
|
|
372
|
+
}, T = l({}), q = E(
|
|
373
373
|
T,
|
|
374
374
|
l({}),
|
|
375
375
|
y && b.SERVER
|
|
@@ -378,7 +378,7 @@ const lt = (H, y = !0) => {
|
|
|
378
378
|
t && p.edit(t, "spec.serverUids", [
|
|
379
379
|
...d[t].spec.serverUids,
|
|
380
380
|
s.uid
|
|
381
|
-
]),
|
|
381
|
+
]), q.add(s);
|
|
382
382
|
}, ke = (e, t) => {
|
|
383
383
|
p.edit(
|
|
384
384
|
t,
|
|
@@ -386,34 +386,35 @@ const lt = (H, y = !0) => {
|
|
|
386
386
|
d[t].spec.serverUids.filter(
|
|
387
387
|
(s) => s !== e
|
|
388
388
|
)
|
|
389
|
-
),
|
|
389
|
+
), q.delete(e);
|
|
390
390
|
}, se = async (e, t = "default", s) => {
|
|
391
391
|
var S;
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
(o) =>
|
|
392
|
+
const c = Je(e), i = await Le(c, s);
|
|
393
|
+
i.requests.forEach(
|
|
394
|
+
(o) => N(o, void 0, i.servers[0])
|
|
395
395
|
);
|
|
396
|
-
const n = $(
|
|
397
|
-
|
|
396
|
+
const n = $(i.collection, t);
|
|
397
|
+
i.folders.forEach((o) => ee(o)), i.servers.forEach((o) => te(o));
|
|
398
398
|
const v = Object.entries(
|
|
399
|
-
(((S =
|
|
399
|
+
(((S = i.components) == null ? void 0 : S.securitySchemes) || i.securityDefinitions) ?? {}
|
|
400
400
|
), k = (o, a) => {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
401
|
+
const M = Object.keys(o[0]);
|
|
402
|
+
if (!M.length) return;
|
|
403
|
+
const j = M.map(
|
|
404
|
+
(F) => n.securitySchemeDict[F]
|
|
405
|
+
);
|
|
406
|
+
h.edit(a.uid, "selectedSecuritySchemeUids", j);
|
|
406
407
|
};
|
|
407
408
|
v.forEach(([o, a]) => {
|
|
408
409
|
if (a && "flows" in a) {
|
|
409
410
|
const { flows: M, ...j } = a;
|
|
410
411
|
if (M) {
|
|
411
|
-
const
|
|
412
|
-
|
|
412
|
+
const F = Object.entries(M), [ce, oe] = F[0];
|
|
413
|
+
ce && oe && I(
|
|
413
414
|
{
|
|
414
415
|
...j,
|
|
415
416
|
type: "oauth2",
|
|
416
|
-
flow: { ...oe, type:
|
|
417
|
+
flow: { ...oe, type: ce },
|
|
417
418
|
nameKey: o
|
|
418
419
|
},
|
|
419
420
|
n.uid
|
|
@@ -443,20 +444,16 @@ const lt = (H, y = !0) => {
|
|
|
443
444
|
);
|
|
444
445
|
}), v.length && Object.values(m).forEach((o) => {
|
|
445
446
|
var M, j;
|
|
446
|
-
const a = ((M = o.security) == null ? void 0 : M.filter((
|
|
447
|
+
const a = ((M = o.security) == null ? void 0 : M.filter((F) => JSON.stringify(F) !== "{}")) ?? [];
|
|
447
448
|
a != null && a.length ? k(a, o) : typeof o.security > "u" && ((j = n.spec.security) != null && j.length) && k(n.spec.security, o);
|
|
448
449
|
});
|
|
449
450
|
};
|
|
450
451
|
async function Me(e, t, s) {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
await se(i, void 0, s);
|
|
454
|
-
} catch (i) {
|
|
455
|
-
console.error("Failed to fetch spec from URL:", i);
|
|
456
|
-
}
|
|
452
|
+
const c = await Be(e, t);
|
|
453
|
+
await se(c, void 0, s);
|
|
457
454
|
}
|
|
458
|
-
const
|
|
459
|
-
|
|
455
|
+
const ie = Ve(localStorage.getItem("sidebarWidth") || "280px"), Oe = (e) => {
|
|
456
|
+
ie.value = e, localStorage.setItem("sidebarWidth", e);
|
|
460
457
|
}, Ue = je();
|
|
461
458
|
return {
|
|
462
459
|
// ---------------------------------------------------------------------------
|
|
@@ -464,9 +461,9 @@ const lt = (H, y = !0) => {
|
|
|
464
461
|
workspaces: w,
|
|
465
462
|
collections: d,
|
|
466
463
|
cookies: X,
|
|
467
|
-
environments:
|
|
464
|
+
environments: D,
|
|
468
465
|
folders: r,
|
|
469
|
-
requestExamples:
|
|
466
|
+
requestExamples: W,
|
|
470
467
|
requests: m,
|
|
471
468
|
servers: T,
|
|
472
469
|
securitySchemes: Y,
|
|
@@ -474,23 +471,23 @@ const lt = (H, y = !0) => {
|
|
|
474
471
|
activeCookieId: me,
|
|
475
472
|
activeExample: le,
|
|
476
473
|
activeRequest: U,
|
|
477
|
-
activeRouterParams:
|
|
474
|
+
activeRouterParams: C,
|
|
478
475
|
activeSecurityRequirements: we,
|
|
479
476
|
activeSecuritySchemes: be,
|
|
480
477
|
activeServer: Ee,
|
|
481
478
|
activeWorkspace: x,
|
|
482
|
-
activeWorkspaceCollections:
|
|
479
|
+
activeWorkspaceCollections: L,
|
|
483
480
|
activeWorkspaceServers: V,
|
|
484
481
|
activeParsedEnvironments: ue,
|
|
485
482
|
activeWorkspaceRequests: Z,
|
|
486
483
|
modalState: Ue,
|
|
487
484
|
isReadOnly: ye,
|
|
488
485
|
router: H,
|
|
489
|
-
sidebarWidth:
|
|
486
|
+
sidebarWidth: ie,
|
|
490
487
|
setSidebarWidth: Oe,
|
|
491
488
|
// ---------------------------------------------------------------------------
|
|
492
489
|
// METHODS
|
|
493
|
-
findRequestFolders:
|
|
490
|
+
findRequestFolders: B,
|
|
494
491
|
importSpecFile: se,
|
|
495
492
|
importSpecFromUrl: Me,
|
|
496
493
|
cookieMutators: fe,
|
|
@@ -513,12 +510,12 @@ const lt = (H, y = !0) => {
|
|
|
513
510
|
requestMutators: {
|
|
514
511
|
...h,
|
|
515
512
|
rawAdd: h.add,
|
|
516
|
-
add:
|
|
513
|
+
add: N,
|
|
517
514
|
delete: _
|
|
518
515
|
},
|
|
519
516
|
requestExampleMutators: {
|
|
520
|
-
...
|
|
521
|
-
rawAdd:
|
|
517
|
+
...g,
|
|
518
|
+
rawAdd: g.add,
|
|
522
519
|
add: ae,
|
|
523
520
|
delete: de
|
|
524
521
|
},
|
|
@@ -530,8 +527,8 @@ const lt = (H, y = !0) => {
|
|
|
530
527
|
delete: Re
|
|
531
528
|
},
|
|
532
529
|
serverMutators: {
|
|
533
|
-
...
|
|
534
|
-
rawAdd:
|
|
530
|
+
...q,
|
|
531
|
+
rawAdd: q.add,
|
|
535
532
|
add: te,
|
|
536
533
|
delete: ke
|
|
537
534
|
},
|