@scalar/api-client 2.0.27 → 2.0.28
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 +14 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/ContextBar.vue.d.ts.map +1 -1
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableHeader.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableRow.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableText.vue.d.ts.map +1 -1
- package/dist/components/Form/Form.vue.d.ts.map +1 -1
- package/dist/components/HelpfulLink.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +26 -33
- package/dist/components/ScalarAsciiArt.vue.d.ts.map +1 -1
- package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
- package/dist/components/ScreenReader.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchModal.vue.js +2 -2
- package/dist/components/Search/SearchModal.vue2.js +78 -75
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/WorkspaceProfileIcon.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/createApiClientApp.js +5 -5
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/api-client-modal.d.ts +38 -2
- package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/api-client-modal.js +52 -42
- package/dist/layouts/Modal/index.js +5 -4
- package/dist/store/workspace.d.ts +2 -2
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +94 -92
- package/dist/style.css +1 -1
- package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
- package/dist/views/Components/RequestBodies/RequestBodies.vue.d.ts.map +1 -1
- package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieRaw.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentColors.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- 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 +117 -108
- package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth.vue.js +19 -19
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Servers/ServerForm.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/package.json +3 -5
package/dist/store/workspace.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { activeRouterParams as U, PathId as
|
|
1
|
+
import { activeRouterParams as U, PathId as b, fallbackMissingParams as X } from "../router.js";
|
|
2
2
|
import { useModal as z } from "@scalar/components";
|
|
3
3
|
import { createWorkspace as K } from "@scalar/oas-utils/entities/workspace";
|
|
4
4
|
import { createCollection as Z } from "@scalar/oas-utils/entities/workspace/collection";
|
|
@@ -11,39 +11,39 @@ import { createRequest as ae, createRequestExample as ie, createRequestExamplePa
|
|
|
11
11
|
import { iterateTitle as re, fetchSpecFromUrl as de } from "@scalar/oas-utils/helpers";
|
|
12
12
|
import { getRequestBodyFromOperation as ne } from "@scalar/oas-utils/spec-getters";
|
|
13
13
|
import { importSpecToWorkspace as ue } from "@scalar/oas-utils/transforms";
|
|
14
|
-
import { mutationFactory as
|
|
14
|
+
import { mutationFactory as f, LS_KEYS as h } from "@scalar/object-utils/mutator-record";
|
|
15
15
|
import { reactive as i, computed as r, toRaw as me } from "vue";
|
|
16
16
|
import { useSidebar as fe } from "../hooks/useSidebar.js";
|
|
17
17
|
const { setCollapsedSidebarFolder: he } = fe();
|
|
18
18
|
var B;
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const p = !!(typeof window < "u" && ((B = document == null ? void 0 : document.getElementById("scalar-client")) != null && B.getAttribute("data-persist"))), E = i({}), R = f(
|
|
20
|
+
E,
|
|
21
21
|
i({}),
|
|
22
|
-
|
|
22
|
+
p && h.REQUEST
|
|
23
23
|
), I = (e, t, s) => {
|
|
24
24
|
const o = ae(e), c = L(o, s);
|
|
25
|
-
return o.childUids.push(c.uid),
|
|
25
|
+
return o.childUids.push(c.uid), R.add(o), t && (a[t] ? m.edit(t, "childUids", [
|
|
26
26
|
...a[t].childUids,
|
|
27
27
|
o.uid
|
|
28
|
-
]) : n[t] &&
|
|
28
|
+
]) : n[t] && y.edit(t, "childUids", [
|
|
29
29
|
...n[t].childUids,
|
|
30
30
|
o.uid
|
|
31
31
|
])), o;
|
|
32
32
|
}, pe = (e, t) => {
|
|
33
|
-
e.childUids.forEach((s) => x.delete(s)), a[t] ?
|
|
33
|
+
e.childUids.forEach((s) => x.delete(s)), a[t] ? m.edit(
|
|
34
34
|
t,
|
|
35
35
|
"childUids",
|
|
36
36
|
a[t].childUids.filter((s) => s !== e.uid)
|
|
37
|
-
) : n[t] &&
|
|
37
|
+
) : n[t] && y.edit(
|
|
38
38
|
t,
|
|
39
39
|
"childUids",
|
|
40
40
|
n[t].childUids.filter((s) => s !== e.uid)
|
|
41
|
-
),
|
|
41
|
+
), R.delete(e.uid);
|
|
42
42
|
}, k = r(() => {
|
|
43
43
|
var o, c;
|
|
44
|
-
const e = U.value[
|
|
45
|
-
return X(
|
|
46
|
-
(
|
|
44
|
+
const e = U.value[b.Request], t = (c = (o = Y.value) == null ? void 0 : o[0]) == null ? void 0 : c.uid, s = E[e] ?? E[t];
|
|
45
|
+
return X(b.Request, s), s && D(s.uid).forEach(
|
|
46
|
+
(l) => he(l, !0)
|
|
47
47
|
), s;
|
|
48
48
|
}), D = (e, t = []) => {
|
|
49
49
|
const s = Object.values(a).find(
|
|
@@ -54,12 +54,12 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
54
54
|
({ childUids: c }) => c.includes(e)
|
|
55
55
|
);
|
|
56
56
|
return o ? D(o.uid, [...t, o.uid]) : t;
|
|
57
|
-
}, O = i({}), x =
|
|
57
|
+
}, O = i({}), x = f(
|
|
58
58
|
O,
|
|
59
59
|
i({}),
|
|
60
|
-
|
|
60
|
+
p && h.REQUEST_EXAMPLE
|
|
61
61
|
), q = (e) => {
|
|
62
|
-
var t, s, o, c,
|
|
62
|
+
var t, s, o, c, l, u, d;
|
|
63
63
|
return le({
|
|
64
64
|
key: e.name,
|
|
65
65
|
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] : "",
|
|
@@ -70,12 +70,12 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
70
70
|
type: (s = e.schema) == null ? void 0 : s.type,
|
|
71
71
|
format: (o = e.schema) == null ? void 0 : o.format,
|
|
72
72
|
minimum: (c = e.schema) == null ? void 0 : c.minimum,
|
|
73
|
-
maximum: (
|
|
74
|
-
default: (
|
|
75
|
-
nullable: (
|
|
73
|
+
maximum: (l = e.schema) == null ? void 0 : l.maximum,
|
|
74
|
+
default: (u = e.schema) == null ? void 0 : u.default,
|
|
75
|
+
nullable: (d = e.schema) == null ? void 0 : d.nullable
|
|
76
76
|
});
|
|
77
77
|
}, L = (e, t, s) => {
|
|
78
|
-
var
|
|
78
|
+
var d;
|
|
79
79
|
const o = {
|
|
80
80
|
path: Object.values(e.parameters.path).map(q),
|
|
81
81
|
query: Object.values(e.parameters.query).map(q),
|
|
@@ -89,54 +89,54 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
if (e.requestBody) {
|
|
92
|
-
const
|
|
92
|
+
const v = ne({
|
|
93
93
|
httpVerb: e.method,
|
|
94
94
|
path: e.path,
|
|
95
95
|
information: {
|
|
96
96
|
requestBody: e.requestBody
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
|
-
((
|
|
99
|
+
((d = v == null ? void 0 : v.postData) == null ? void 0 : d.mimeType) === "application/json" && (o.headers.push({
|
|
100
100
|
key: "Content-Type",
|
|
101
101
|
value: "application/json",
|
|
102
102
|
enabled: !0
|
|
103
|
-
}), c.activeBody = "raw", c.raw.value =
|
|
103
|
+
}), c.activeBody = "raw", c.raw.value = v.postData.text);
|
|
104
104
|
}
|
|
105
|
-
const
|
|
105
|
+
const l = s ?? re(
|
|
106
106
|
(e.summary ?? "Example") + " #1",
|
|
107
|
-
(
|
|
108
|
-
),
|
|
107
|
+
(v) => e.childUids.some((G) => v === O[G].name)
|
|
108
|
+
), u = ie({
|
|
109
109
|
url: t != null && t.url ? `{{${t == null ? void 0 : t.url}}}${e.path}` : e.path,
|
|
110
110
|
requestUid: e.uid,
|
|
111
111
|
parameters: o,
|
|
112
|
-
name:
|
|
112
|
+
name: l,
|
|
113
113
|
body: c
|
|
114
114
|
});
|
|
115
|
-
return x.add(
|
|
115
|
+
return x.add(u), u;
|
|
116
116
|
}, ve = (e, t) => {
|
|
117
117
|
const s = L(
|
|
118
118
|
e,
|
|
119
119
|
A.value[0],
|
|
120
120
|
t
|
|
121
121
|
);
|
|
122
|
-
return
|
|
122
|
+
return R.edit(e.uid, "childUids", [
|
|
123
123
|
...e.childUids,
|
|
124
124
|
s.uid
|
|
125
125
|
]), s;
|
|
126
126
|
}, ye = (e) => {
|
|
127
|
-
|
|
127
|
+
R.edit(
|
|
128
128
|
e.requestUid,
|
|
129
129
|
"childUids",
|
|
130
|
-
|
|
130
|
+
E[e.requestUid].childUids.filter(
|
|
131
131
|
(t) => t !== e.uid
|
|
132
132
|
)
|
|
133
133
|
), x.delete(e.uid);
|
|
134
134
|
}, Ee = r(
|
|
135
135
|
() => {
|
|
136
136
|
var e;
|
|
137
|
-
return O[U.value[
|
|
137
|
+
return O[U.value[b.Examples]] ?? O[((e = k.value) == null ? void 0 : e.childUids[0]) ?? ""];
|
|
138
138
|
}
|
|
139
|
-
), Se = r(() => Object.values(
|
|
139
|
+
), Se = r(() => Object.values(E).flatMap((e) => e.history).filter((e) => e.request && e.response).sort((e, t) => t.timestamp - e.timestamp)), g = i({
|
|
140
140
|
default: te({
|
|
141
141
|
uid: "default",
|
|
142
142
|
name: "Global Environment",
|
|
@@ -145,10 +145,10 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
145
145
|
parsed: [],
|
|
146
146
|
isDefault: !0
|
|
147
147
|
})
|
|
148
|
-
}), N =
|
|
148
|
+
}), N = f(
|
|
149
149
|
g,
|
|
150
150
|
i({}),
|
|
151
|
-
|
|
151
|
+
p && h.ENVIRONMENT
|
|
152
152
|
), we = (e) => {
|
|
153
153
|
if (e === "default") {
|
|
154
154
|
console.warn("Default environment cannot be deleted.");
|
|
@@ -183,19 +183,19 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
183
183
|
httpOnly: !1,
|
|
184
184
|
sameSite: "None"
|
|
185
185
|
})
|
|
186
|
-
}),
|
|
186
|
+
}), Re = f(
|
|
187
187
|
_,
|
|
188
188
|
i({}),
|
|
189
|
-
|
|
190
|
-
),
|
|
191
|
-
() => U.value[
|
|
192
|
-
), w = i({}),
|
|
189
|
+
p && h.COOKIE
|
|
190
|
+
), be = r(
|
|
191
|
+
() => U.value[b.Cookies]
|
|
192
|
+
), w = i({}), S = f(
|
|
193
193
|
w,
|
|
194
194
|
i({}),
|
|
195
|
-
|
|
195
|
+
p && h.WORKSPACE
|
|
196
196
|
), ke = (e = {}) => {
|
|
197
197
|
const t = K(e);
|
|
198
|
-
|
|
198
|
+
S.add(t);
|
|
199
199
|
const s = P(
|
|
200
200
|
{
|
|
201
201
|
spec: {
|
|
@@ -212,15 +212,15 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
212
212
|
console.warn("Default environment cannot be deleted.");
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
|
-
|
|
215
|
+
S.delete(e);
|
|
216
216
|
}, M = r(
|
|
217
|
-
() => w[U.value[
|
|
217
|
+
() => w[U.value[b.Workspace]] ?? w[Object.keys(w)[0]]
|
|
218
218
|
), W = r(
|
|
219
219
|
() => {
|
|
220
220
|
var e;
|
|
221
221
|
return (e = M.value) == null ? void 0 : e.collectionUids.map((t) => a[t]).sort((t, s) => {
|
|
222
|
-
var o, c,
|
|
223
|
-
return ((c = (o = t.spec) == null ? void 0 : o.info) == null ? void 0 : c.title) === "Drafts" ? 1 : ((
|
|
222
|
+
var o, c, l, u;
|
|
223
|
+
return ((c = (o = t.spec) == null ? void 0 : o.info) == null ? void 0 : c.title) === "Drafts" ? 1 : ((u = (l = s.spec) == null ? void 0 : l.info) == null ? void 0 : u.title) === "Drafts" ? -1 : 0;
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
), A = r(
|
|
@@ -230,7 +230,7 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
230
230
|
(t) => t.spec.serverUids.map((s) => F[s])
|
|
231
231
|
);
|
|
232
232
|
}
|
|
233
|
-
), V = (e) =>
|
|
233
|
+
), V = (e) => E[e] ?? n[e].childUids.flatMap((t) => V(t)), Y = r(
|
|
234
234
|
() => {
|
|
235
235
|
var e;
|
|
236
236
|
return (e = W.value) == null ? void 0 : e.flatMap(
|
|
@@ -240,16 +240,16 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
240
240
|
), xe = r(() => {
|
|
241
241
|
var e;
|
|
242
242
|
return ((e = M.value) == null ? void 0 : e.isReadOnly) ?? !1;
|
|
243
|
-
}), a = i({}),
|
|
243
|
+
}), a = i({}), m = f(
|
|
244
244
|
a,
|
|
245
245
|
i({}),
|
|
246
|
-
|
|
246
|
+
p && h.COLLECTION
|
|
247
247
|
), P = (e, t) => {
|
|
248
248
|
const s = Z(e);
|
|
249
|
-
return
|
|
249
|
+
return S.edit(t, "collectionUids", [
|
|
250
250
|
...w[t].collectionUids,
|
|
251
251
|
s.uid
|
|
252
|
-
]),
|
|
252
|
+
]), m.add(s), s;
|
|
253
253
|
}, Ce = (e) => {
|
|
254
254
|
var t, s, o;
|
|
255
255
|
if (M.value) {
|
|
@@ -261,11 +261,11 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
261
261
|
console.warn("You must have at least one collection");
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
S.edit(
|
|
265
265
|
M.value.uid,
|
|
266
266
|
"collectionUids",
|
|
267
267
|
M.value.collectionUids.filter((c) => c !== e)
|
|
268
|
-
),
|
|
268
|
+
), m.delete(e);
|
|
269
269
|
}
|
|
270
270
|
}, C = r(() => {
|
|
271
271
|
const e = Object.values(a)[0];
|
|
@@ -276,20 +276,20 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
276
276
|
return a[s] ?? e;
|
|
277
277
|
}), qe = r(
|
|
278
278
|
() => C.value && F[C.value.selectedServerUid]
|
|
279
|
-
), n = i({}),
|
|
279
|
+
), n = i({}), y = f(
|
|
280
280
|
n,
|
|
281
281
|
i({}),
|
|
282
|
-
|
|
282
|
+
p && h.FOLDER
|
|
283
283
|
), H = (e, t) => {
|
|
284
284
|
const s = se(e);
|
|
285
285
|
if (t)
|
|
286
286
|
if (a[t])
|
|
287
|
-
|
|
287
|
+
m.edit(t, "childUids", [
|
|
288
288
|
...a[t].childUids,
|
|
289
289
|
s.uid
|
|
290
290
|
]);
|
|
291
291
|
else if (n[t])
|
|
292
|
-
|
|
292
|
+
y.edit(t, "childUids", [
|
|
293
293
|
...n[t].childUids,
|
|
294
294
|
s.uid
|
|
295
295
|
]);
|
|
@@ -297,21 +297,21 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
297
297
|
console.error("Could not find folder's parent ID");
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
|
|
300
|
+
y.add(s);
|
|
301
301
|
}, je = (e, t) => {
|
|
302
|
-
a[t] ?
|
|
302
|
+
a[t] ? m.edit(
|
|
303
303
|
t,
|
|
304
304
|
"childUids",
|
|
305
305
|
a[t].childUids.filter((s) => s !== e)
|
|
306
|
-
) : n[t] &&
|
|
306
|
+
) : n[t] && y.edit(
|
|
307
307
|
t,
|
|
308
308
|
"childUids",
|
|
309
309
|
n[t].childUids.filter((s) => s !== e)
|
|
310
|
-
),
|
|
311
|
-
}, T = i({}), J =
|
|
310
|
+
), y.delete(e);
|
|
311
|
+
}, T = i({}), J = f(
|
|
312
312
|
T,
|
|
313
313
|
i({}),
|
|
314
|
-
|
|
314
|
+
p && h.SECURITY_SCHEME
|
|
315
315
|
), Ue = r(
|
|
316
316
|
() => {
|
|
317
317
|
var e;
|
|
@@ -325,18 +325,18 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
325
325
|
var e, t;
|
|
326
326
|
return ((e = k.value) == null ? void 0 : e.security) ?? ((t = C.value) == null ? void 0 : t.spec.security) ?? [];
|
|
327
327
|
}
|
|
328
|
-
), F = i({}), j =
|
|
328
|
+
), F = i({}), j = f(
|
|
329
329
|
F,
|
|
330
330
|
i({}),
|
|
331
|
-
|
|
331
|
+
p && h.SERVER
|
|
332
332
|
), Q = (e, t) => {
|
|
333
333
|
const s = ce(e);
|
|
334
|
-
t &&
|
|
334
|
+
t && m.edit(t, "spec.serverUids", [
|
|
335
335
|
...a[t].spec.serverUids,
|
|
336
336
|
s.uid
|
|
337
337
|
]), j.add(s);
|
|
338
338
|
}, Ie = (e, t) => {
|
|
339
|
-
|
|
339
|
+
m.edit(
|
|
340
340
|
t,
|
|
341
341
|
"spec.serverUids",
|
|
342
342
|
a[t].spec.serverUids.filter(
|
|
@@ -344,25 +344,27 @@ const h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.g
|
|
|
344
344
|
)
|
|
345
345
|
), j.delete(e);
|
|
346
346
|
};
|
|
347
|
-
async function $(e, t = "default", s = !0) {
|
|
348
|
-
var
|
|
349
|
-
const
|
|
350
|
-
s &&
|
|
351
|
-
(
|
|
352
|
-
),
|
|
353
|
-
(
|
|
347
|
+
async function $(e, t = "default", s = !0, o = !1) {
|
|
348
|
+
var u;
|
|
349
|
+
const c = me(e), l = await ue(c);
|
|
350
|
+
s && S.add(
|
|
351
|
+
K({ uid: t, isReadOnly: o })
|
|
352
|
+
), l.requests.forEach(
|
|
353
|
+
(d) => I(d, void 0, l.servers[0])
|
|
354
|
+
), P(l.collection, t), l.folders.forEach((d) => H(d)), l.servers.forEach((d) => Q(d)), Object.entries(
|
|
355
|
+
(((u = l.components) == null ? void 0 : u.securitySchemes) || l.securityDefinitions) ?? {}
|
|
354
356
|
).forEach(
|
|
355
|
-
([
|
|
356
|
-
oe({ ...v, uid:
|
|
357
|
+
([d, v]) => J.add(
|
|
358
|
+
oe({ ...v, uid: d })
|
|
357
359
|
)
|
|
358
360
|
);
|
|
359
361
|
}
|
|
360
|
-
async function De(e, t) {
|
|
362
|
+
async function De(e, t, s = !1) {
|
|
361
363
|
try {
|
|
362
|
-
const
|
|
363
|
-
await $(s);
|
|
364
|
-
} catch (
|
|
365
|
-
console.error("Failed to fetch spec from URL:",
|
|
364
|
+
const o = await de(e, t);
|
|
365
|
+
await $(o, void 0, void 0, s);
|
|
366
|
+
} catch (o) {
|
|
367
|
+
console.error("Failed to fetch spec from URL:", o);
|
|
366
368
|
}
|
|
367
369
|
}
|
|
368
370
|
const ge = z(), Xe = () => ({
|
|
@@ -374,11 +376,11 @@ const ge = z(), Xe = () => ({
|
|
|
374
376
|
environments: g,
|
|
375
377
|
folders: n,
|
|
376
378
|
requestExamples: O,
|
|
377
|
-
requests:
|
|
379
|
+
requests: E,
|
|
378
380
|
servers: F,
|
|
379
381
|
securitySchemes: T,
|
|
380
382
|
activeCollection: C,
|
|
381
|
-
activeCookieId:
|
|
383
|
+
activeCookieId: be,
|
|
382
384
|
activeExample: Ee,
|
|
383
385
|
activeRequest: k,
|
|
384
386
|
activeSecurityRequirements: Fe,
|
|
@@ -395,10 +397,10 @@ const ge = z(), Xe = () => ({
|
|
|
395
397
|
// METHODS
|
|
396
398
|
importSpecFile: $,
|
|
397
399
|
importSpecFromUrl: De,
|
|
398
|
-
cookieMutators:
|
|
400
|
+
cookieMutators: Re,
|
|
399
401
|
collectionMutators: {
|
|
400
|
-
...
|
|
401
|
-
rawAdd:
|
|
402
|
+
...m,
|
|
403
|
+
rawAdd: m.add,
|
|
402
404
|
add: P,
|
|
403
405
|
delete: Ce
|
|
404
406
|
},
|
|
@@ -407,14 +409,14 @@ const ge = z(), Xe = () => ({
|
|
|
407
409
|
delete: we
|
|
408
410
|
},
|
|
409
411
|
folderMutators: {
|
|
410
|
-
...
|
|
411
|
-
rawAdd:
|
|
412
|
+
...y,
|
|
413
|
+
rawAdd: y.add,
|
|
412
414
|
add: H,
|
|
413
415
|
delete: je
|
|
414
416
|
},
|
|
415
417
|
requestMutators: {
|
|
416
|
-
...
|
|
417
|
-
rawAdd:
|
|
418
|
+
...R,
|
|
419
|
+
rawAdd: R.add,
|
|
418
420
|
add: I,
|
|
419
421
|
delete: pe
|
|
420
422
|
},
|
|
@@ -433,8 +435,8 @@ const ge = z(), Xe = () => ({
|
|
|
433
435
|
delete: Ie
|
|
434
436
|
},
|
|
435
437
|
workspaceMutators: {
|
|
436
|
-
...
|
|
437
|
-
rawAdd:
|
|
438
|
+
...S,
|
|
439
|
+
rawAdd: S.add,
|
|
438
440
|
add: ke,
|
|
439
441
|
delete: Oe
|
|
440
442
|
}
|