@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.
Files changed (98) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  4. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  5. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  7. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  8. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  9. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  11. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
  13. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  14. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  15. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +1 -1
  16. package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
  17. package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
  18. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  19. package/dist/components/DataTable/DataTableHeader.vue.d.ts.map +1 -1
  20. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  21. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  22. package/dist/components/DataTable/DataTableRow.vue.d.ts.map +1 -1
  23. package/dist/components/DataTable/DataTableText.vue.d.ts.map +1 -1
  24. package/dist/components/Form/Form.vue.d.ts.map +1 -1
  25. package/dist/components/HelpfulLink.vue.d.ts.map +1 -1
  26. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  27. package/dist/components/HttpMethod/HttpMethod.vue.js +26 -33
  28. package/dist/components/ScalarAsciiArt.vue.d.ts.map +1 -1
  29. package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
  30. package/dist/components/ScreenReader.vue.d.ts.map +1 -1
  31. package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
  32. package/dist/components/Search/SearchModal.vue.d.ts.map +1 -1
  33. package/dist/components/Search/SearchModal.vue.js +2 -2
  34. package/dist/components/Search/SearchModal.vue2.js +78 -75
  35. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  36. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  37. package/dist/components/SideNav/WorkspaceProfileIcon.vue.d.ts.map +1 -1
  38. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  39. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  40. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  41. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  42. package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
  43. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  44. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  45. package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
  46. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  47. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  48. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  49. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  50. package/dist/components/ViewLayout/ViewLayoutContent.vue.d.ts.map +1 -1
  51. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  52. package/dist/index.js +7 -6
  53. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  54. package/dist/layouts/App/createApiClientApp.js +5 -5
  55. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  56. package/dist/layouts/Modal/api-client-modal.d.ts +38 -2
  57. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
  58. package/dist/layouts/Modal/api-client-modal.js +52 -42
  59. package/dist/layouts/Modal/index.js +5 -4
  60. package/dist/store/workspace.d.ts +2 -2
  61. package/dist/store/workspace.d.ts.map +1 -1
  62. package/dist/store/workspace.js +94 -92
  63. package/dist/style.css +1 -1
  64. package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
  65. package/dist/views/Components/RequestBodies/RequestBodies.vue.d.ts.map +1 -1
  66. package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +1 -1
  67. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  68. package/dist/views/Cookies/CookieRaw.vue.d.ts.map +1 -1
  69. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  70. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  71. package/dist/views/Environment/EnvironmentColors.vue.d.ts.map +1 -1
  72. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  73. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  74. package/dist/views/Request/Request.vue.js +2 -2
  75. package/dist/views/Request/Request.vue2.js +117 -108
  76. package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
  77. package/dist/views/Request/RequestSection/RequestAuth.vue.js +19 -19
  78. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  79. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  80. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  81. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  82. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  83. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  84. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  85. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  87. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  88. package/dist/views/Request/ResponseSection/ResponseCookies.vue.d.ts.map +1 -1
  89. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  90. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.d.ts.map +1 -1
  91. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  92. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  93. package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
  94. package/dist/views/Request/components/OAuthScopesInput.vue.d.ts.map +1 -1
  95. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  96. package/dist/views/Servers/ServerForm.vue.d.ts.map +1 -1
  97. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  98. package/package.json +3 -5
@@ -1,4 +1,4 @@
1
- import { activeRouterParams as U, PathId as R, fallbackMissingParams as X } from "../router.js";
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 m, LS_KEYS as f } from "@scalar/object-utils/mutator-record";
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 h = !!(typeof window < "u" && ((B = document == null ? void 0 : document.getElementById("scalar-client")) != null && B.getAttribute("data-persist"))), y = i({}), b = m(
20
- y,
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
- h && f.REQUEST
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), b.add(o), t && (a[t] ? u.edit(t, "childUids", [
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] && p.edit(t, "childUids", [
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] ? u.edit(
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] && p.edit(
37
+ ) : n[t] && y.edit(
38
38
  t,
39
39
  "childUids",
40
40
  n[t].childUids.filter((s) => s !== e.uid)
41
- ), b.delete(e.uid);
41
+ ), R.delete(e.uid);
42
42
  }, k = r(() => {
43
43
  var o, c;
44
- const e = U.value[R.Request], t = (c = (o = Y.value) == null ? void 0 : o[0]) == null ? void 0 : c.uid, s = y[e] ?? y[t];
45
- return X(R.Request, s), s && D(s.uid).forEach(
46
- (d) => he(d, !0)
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 = m(
57
+ }, O = i({}), x = f(
58
58
  O,
59
59
  i({}),
60
- h && f.REQUEST_EXAMPLE
60
+ p && h.REQUEST_EXAMPLE
61
61
  ), q = (e) => {
62
- var t, s, o, c, d, l, v;
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: (d = e.schema) == null ? void 0 : d.maximum,
74
- default: (l = e.schema) == null ? void 0 : l.default,
75
- nullable: (v = e.schema) == null ? void 0 : v.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 v;
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 S = ne({
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
- ((v = S == null ? void 0 : S.postData) == null ? void 0 : v.mimeType) === "application/json" && (o.headers.push({
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 = S.postData.text);
103
+ }), c.activeBody = "raw", c.raw.value = v.postData.text);
104
104
  }
105
- const d = s ?? re(
105
+ const l = s ?? re(
106
106
  (e.summary ?? "Example") + " #1",
107
- (S) => e.childUids.some((G) => S === O[G].name)
108
- ), l = ie({
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: d,
112
+ name: l,
113
113
  body: c
114
114
  });
115
- return x.add(l), l;
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 b.edit(e.uid, "childUids", [
122
+ return R.edit(e.uid, "childUids", [
123
123
  ...e.childUids,
124
124
  s.uid
125
125
  ]), s;
126
126
  }, ye = (e) => {
127
- b.edit(
127
+ R.edit(
128
128
  e.requestUid,
129
129
  "childUids",
130
- y[e.requestUid].childUids.filter(
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[R.Examples]] ?? O[((e = k.value) == null ? void 0 : e.childUids[0]) ?? ""];
137
+ return O[U.value[b.Examples]] ?? O[((e = k.value) == null ? void 0 : e.childUids[0]) ?? ""];
138
138
  }
139
- ), Se = r(() => Object.values(y).flatMap((e) => e.history).filter((e) => e.request && e.response).sort((e, t) => t.timestamp - e.timestamp)), g = i({
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 = m(
148
+ }), N = f(
149
149
  g,
150
150
  i({}),
151
- h && f.ENVIRONMENT
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
- }), be = m(
186
+ }), Re = f(
187
187
  _,
188
188
  i({}),
189
- h && f.COOKIE
190
- ), Re = r(
191
- () => U.value[R.Cookies]
192
- ), w = i({}), E = m(
189
+ p && h.COOKIE
190
+ ), be = r(
191
+ () => U.value[b.Cookies]
192
+ ), w = i({}), S = f(
193
193
  w,
194
194
  i({}),
195
- h && f.WORKSPACE
195
+ p && h.WORKSPACE
196
196
  ), ke = (e = {}) => {
197
197
  const t = K(e);
198
- E.add(t);
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
- E.delete(e);
215
+ S.delete(e);
216
216
  }, M = r(
217
- () => w[U.value[R.Workspace]] ?? w[Object.keys(w)[0]]
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, d, l;
223
- return ((c = (o = t.spec) == null ? void 0 : o.info) == null ? void 0 : c.title) === "Drafts" ? 1 : ((l = (d = s.spec) == null ? void 0 : d.info) == null ? void 0 : l.title) === "Drafts" ? -1 : 0;
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) => y[e] ?? n[e].childUids.flatMap((t) => V(t)), Y = r(
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({}), u = m(
243
+ }), a = i({}), m = f(
244
244
  a,
245
245
  i({}),
246
- h && f.COLLECTION
246
+ p && h.COLLECTION
247
247
  ), P = (e, t) => {
248
248
  const s = Z(e);
249
- return E.edit(t, "collectionUids", [
249
+ return S.edit(t, "collectionUids", [
250
250
  ...w[t].collectionUids,
251
251
  s.uid
252
- ]), u.add(s), s;
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
- E.edit(
264
+ S.edit(
265
265
  M.value.uid,
266
266
  "collectionUids",
267
267
  M.value.collectionUids.filter((c) => c !== e)
268
- ), u.delete(e);
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({}), p = m(
279
+ ), n = i({}), y = f(
280
280
  n,
281
281
  i({}),
282
- h && f.FOLDER
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
- u.edit(t, "childUids", [
287
+ m.edit(t, "childUids", [
288
288
  ...a[t].childUids,
289
289
  s.uid
290
290
  ]);
291
291
  else if (n[t])
292
- p.edit(t, "childUids", [
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
- p.add(s);
300
+ y.add(s);
301
301
  }, je = (e, t) => {
302
- a[t] ? u.edit(
302
+ a[t] ? m.edit(
303
303
  t,
304
304
  "childUids",
305
305
  a[t].childUids.filter((s) => s !== e)
306
- ) : n[t] && p.edit(
306
+ ) : n[t] && y.edit(
307
307
  t,
308
308
  "childUids",
309
309
  n[t].childUids.filter((s) => s !== e)
310
- ), p.delete(e);
311
- }, T = i({}), J = m(
310
+ ), y.delete(e);
311
+ }, T = i({}), J = f(
312
312
  T,
313
313
  i({}),
314
- h && f.SECURITY_SCHEME
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 = m(
328
+ ), F = i({}), j = f(
329
329
  F,
330
330
  i({}),
331
- h && f.SERVER
331
+ p && h.SERVER
332
332
  ), Q = (e, t) => {
333
333
  const s = ce(e);
334
- t && u.edit(t, "spec.serverUids", [
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
- u.edit(
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 d;
349
- const o = me(e), c = await ue(o);
350
- s && E.add(K({ uid: t })), c.requests.forEach(
351
- (l) => I(l, void 0, c.servers[0])
352
- ), P(c.collection, t), c.folders.forEach((l) => H(l)), c.servers.forEach((l) => Q(l)), Object.entries(
353
- (((d = c.components) == null ? void 0 : d.securitySchemes) || c.securityDefinitions) ?? {}
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
- ([l, v]) => J.add(
356
- oe({ ...v, uid: l })
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 s = await de(e, t);
363
- await $(s);
364
- } catch (s) {
365
- console.error("Failed to fetch spec from URL:", s);
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: y,
379
+ requests: E,
378
380
  servers: F,
379
381
  securitySchemes: T,
380
382
  activeCollection: C,
381
- activeCookieId: Re,
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: be,
400
+ cookieMutators: Re,
399
401
  collectionMutators: {
400
- ...u,
401
- rawAdd: u.add,
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
- ...p,
411
- rawAdd: p.add,
412
+ ...y,
413
+ rawAdd: y.add,
412
414
  add: H,
413
415
  delete: je
414
416
  },
415
417
  requestMutators: {
416
- ...b,
417
- rawAdd: b.add,
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
- ...E,
437
- rawAdd: E.add,
438
+ ...S,
439
+ rawAdd: S.add,
438
440
  add: ke,
439
441
  delete: Oe
440
442
  }