@scalar/api-client 2.29.1 → 2.29.3

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.
@@ -1,72 +1,72 @@
1
1
  import { isDefined as M } from "@scalar/helpers/array/is-defined";
2
- import { sortByOrder as pe } from "@scalar/helpers/array/sort-by-order";
3
- import { migrateLocalStorageToIndexDb as me } from "@scalar/oas-utils/migrations";
4
- import { createSidebarState as de, generateReverseIndex as ve } from "@scalar/sidebar";
2
+ import { sortByOrder as de } from "@scalar/helpers/array/sort-by-order";
3
+ import { migrateLocalStorageToIndexDb as ve } from "@scalar/oas-utils/migrations";
4
+ import { createSidebarState as fe, generateReverseIndex as he } from "@scalar/sidebar";
5
5
  import { createWorkspaceStore as Y } from "@scalar/workspace-store/client";
6
- import { createWorkspaceEventBus as fe } from "@scalar/workspace-store/events";
7
- import { generateUniqueValue as he } from "@scalar/workspace-store/helpers/generate-unique-value";
8
- import { getParentEntry as f } from "@scalar/workspace-store/navigation";
9
- import { createWorkspaceStorePersistence as we, getWorkspaceId as h } from "@scalar/workspace-store/persistence";
10
- import { persistencePlugin as ge } from "@scalar/workspace-store/plugins/client";
11
- import { extensions as ke } from "@scalar/workspace-store/schemas/extensions";
12
- import { ref as p, computed as u, shallowRef as j } from "vue";
6
+ import { createWorkspaceEventBus as we } from "@scalar/workspace-store/events";
7
+ import { generateUniqueValue as ge } from "@scalar/workspace-store/helpers/generate-unique-value";
8
+ import { getParentEntry as h } from "@scalar/workspace-store/navigation";
9
+ import { createWorkspaceStorePersistence as ke, getWorkspaceId as w } from "@scalar/workspace-store/persistence";
10
+ import { persistencePlugin as xe } from "@scalar/workspace-store/plugins/client";
11
+ import { extensions as be } from "@scalar/workspace-store/schemas/extensions";
12
+ import { ref as p, computed as u, shallowRef as j, readonly as ye } from "vue";
13
13
  import { getRouteParam as l } from "./helpers/get-route-param.js";
14
- import { groupWorkspacesByTeam as xe } from "./helpers/group-workspaces.js";
15
- import { getActiveEnvironment as be } from "../../helpers/get-active-environment.js";
16
- import { getTabDetails as ye } from "../../helpers/get-tab-details.js";
17
- import { slugify as Se } from "../../helpers/slugify.js";
18
- import { workspaceStorage as Ee } from "../../helpers/storage.js";
19
- import { initializeAppEventHandlers as We } from "./app-events.js";
20
- import { filterWorkspacesByTeam as Ue, canLoadWorkspace as Ie } from "./helpers/filter-workspaces.js";
21
- const Te = 1e3, De = 288, Je = async ({
14
+ import { groupWorkspacesByTeam as Se } from "./helpers/group-workspaces.js";
15
+ import { getActiveEnvironment as Ee } from "../../helpers/get-active-environment.js";
16
+ import { getTabDetails as We } from "../../helpers/get-tab-details.js";
17
+ import { slugify as Ue } from "../../helpers/slugify.js";
18
+ import { workspaceStorage as Te } from "../../helpers/storage.js";
19
+ import { initializeAppEventHandlers as Ie } from "./app-events.js";
20
+ import { filterWorkspacesByTeam as De, canLoadWorkspace as H } from "./helpers/filter-workspaces.js";
21
+ const Re = 1e3, Ae = 288, Xe = async ({
22
22
  router: i,
23
- fileLoader: H
23
+ fileLoader: z
24
24
  }) => {
25
- const k = fe({
25
+ const S = we({
26
26
  debug: !1
27
- }), { workspace: w } = await we();
28
- await me();
29
- const x = p("local"), g = p(void 0), b = p(void 0), y = p(void 0), B = p(void 0), L = p(void 0), N = p(void 0), S = p(!1);
30
- i.afterEach((e) => le(e));
31
- const d = u(() => i.currentRoute.value ?? null), E = j(null), v = p([]), W = u(() => Ue(v.value, x.value)), z = u(() => xe(W.value, x.value)), s = j(null), D = u(() => s.value?.workspace.documents[y.value ?? ""] || null), G = u(() => be(s.value, D.value));
32
- v.value = await w.getAll().then(
27
+ }), { workspace: g } = await ke();
28
+ await ve();
29
+ const k = p("local"), f = p(void 0), x = p(void 0), E = p(void 0), B = p(void 0), L = p(void 0), N = p(void 0), W = p(!1);
30
+ i.afterEach((e) => ue(e));
31
+ const d = u(() => i.currentRoute.value ?? null), U = j(null), v = p([]), b = u(() => De(v.value, k.value)), G = u(() => Se(b.value, k.value)), s = j(null), D = u(() => s.value?.workspace.documents[E.value ?? ""] || null), J = u(() => Ee(s.value, D.value));
32
+ v.value = await g.getAll().then(
33
33
  (e) => e.map(({ teamUid: a, namespace: t, slug: n, name: c }) => ({
34
- id: h(t, n),
34
+ id: w(t, n),
35
35
  teamUid: a,
36
36
  namespace: t,
37
37
  slug: n,
38
38
  label: c
39
39
  }))
40
40
  );
41
- const J = async (e) => {
42
- const a = g.value, t = b.value;
41
+ const Q = async (e) => {
42
+ const a = f.value, t = x.value;
43
43
  if (!a || !t)
44
44
  return;
45
- const n = h(a, t);
46
- await w.updateName({ namespace: a, slug: t }, e) !== void 0 && (v.value = v.value.map((o) => o.id === n ? { ...o, label: e } : o), E.value = { id: n, label: e });
47
- }, Q = async ({
45
+ const n = w(a, t);
46
+ await g.updateName({ namespace: a, slug: t }, e) !== void 0 && (v.value = v.value.map((o) => o.id === n ? { ...o, label: e } : o), U.value = { id: n, label: e });
47
+ }, X = async ({
48
48
  namespace: e,
49
49
  slug: a
50
50
  }) => Y({
51
51
  plugins: [
52
- await ge({
53
- workspaceId: h(e, a),
54
- debounceDelay: Te
52
+ await xe({
53
+ workspaceId: w(e, a),
54
+ debounceDelay: Re
55
55
  })
56
56
  ],
57
- fileLoader: H
58
- }), X = async (e, a) => {
59
- const t = await w.getItem({ namespace: e, slug: a });
57
+ fileLoader: z
58
+ }), Z = async (e, a) => {
59
+ const t = await g.getItem({ namespace: e, slug: a });
60
60
  if (!t)
61
61
  return {
62
62
  success: !1
63
63
  };
64
- const n = await Q({ namespace: e, slug: a });
65
- return n.loadWorkspace(t.workspace), E.value = { id: h(t.namespace, t.slug), label: t.name }, s.value = n, {
64
+ const n = await X({ namespace: e, slug: a });
65
+ return n.loadWorkspace(t.workspace), U.value = { id: w(t.namespace, t.slug), label: t.name }, s.value = n, {
66
66
  success: !0,
67
67
  workspace: n.workspace
68
68
  };
69
- }, Z = async ({
69
+ }, ee = async ({
70
70
  name: e,
71
71
  teamUid: a,
72
72
  namespace: t,
@@ -90,7 +90,7 @@ const Te = 1e3, De = 288, Je = async ({
90
90
  "x-scalar-icon": "interface-edit-tool-pencil"
91
91
  }
92
92
  });
93
- const o = await w.setItem(
93
+ const o = await g.setItem(
94
94
  { namespace: t, slug: n },
95
95
  {
96
96
  name: e,
@@ -99,13 +99,13 @@ const Te = 1e3, De = 288, Je = async ({
99
99
  }
100
100
  );
101
101
  return v.value.push({
102
- id: h(o.namespace, o.slug),
102
+ id: w(o.namespace, o.slug),
103
103
  teamUid: o.teamUid,
104
104
  namespace: o.namespace,
105
105
  slug: o.slug,
106
106
  label: o.name
107
107
  }), o;
108
- }, U = async (e, a) => {
108
+ }, y = async (e, a) => {
109
109
  if (!e || !a) {
110
110
  await i.push("/");
111
111
  return;
@@ -128,66 +128,73 @@ const Te = 1e3, De = 288, Je = async ({
128
128
  name: n
129
129
  }) => {
130
130
  s.value = null;
131
- const c = await he({
131
+ const c = await ge({
132
132
  defaultValue: t ?? n,
133
133
  // Use the provided id if it exists, otherwise use the name
134
- validation: async (T) => !await w.has({ namespace: a ?? "local", slug: T }),
134
+ validation: async (I) => !await g.has({ namespace: a ?? "local", slug: I }),
135
135
  maxRetries: 100,
136
- transformation: Se
136
+ transformation: Ue
137
137
  });
138
138
  if (!c)
139
139
  return;
140
- const m = await Z({
140
+ const m = await ee({
141
141
  teamUid: e,
142
142
  namespace: a,
143
143
  slug: c,
144
144
  name: n
145
145
  });
146
- return await U(m.namespace, m.slug), m;
147
- }, ee = async (e, a) => {
148
- s.value = null, S.value = !0;
149
- const t = await X(e, a);
146
+ return await y(m.namespace, m.slug), m;
147
+ }, ae = async (e, a) => {
148
+ s.value = null, W.value = !0;
149
+ const t = await Z(e, a);
150
150
  if (t.success) {
151
- const o = t.workspace["x-scalar-active-tab"] ?? 0, m = t.workspace["x-scalar-tabs"], T = m?.[o];
152
- T && await i.replace({
153
- path: T.path,
151
+ const o = t.workspace["x-scalar-active-tab"] ?? 0, m = t.workspace["x-scalar-tabs"], I = m?.[o];
152
+ I && await i.replace({
153
+ path: I.path,
154
154
  query: d.value?.query ?? {}
155
- }), m && o >= m.length && k.emit("tabs:update:tabs", {
155
+ }), m && o >= m.length && S.emit("tabs:update:tabs", {
156
156
  "x-scalar-active-tab": 0
157
- }), m || k.emit("tabs:update:tabs", {
157
+ }), m || S.emit("tabs:update:tabs", {
158
158
  "x-scalar-tabs": [C(d.value)],
159
159
  "x-scalar-active-tab": 0
160
- }), S.value = !1;
160
+ }), W.value = !1;
161
161
  return;
162
162
  }
163
- const n = W.value.find((o) => o.teamUid === "local" && o.slug === "default") ?? W.value[0];
163
+ const n = b.value.find((o) => o.teamUid === "local" && o.slug === "default") ?? b.value[0];
164
164
  if (n)
165
- return U(n.namespace, n.slug);
165
+ return y(n.namespace, n.slug);
166
166
  const c = await O({
167
167
  name: "Default Workspace",
168
168
  slug: "default"
169
169
  });
170
- if (S.value = !1, !c)
170
+ if (W.value = !1, !c)
171
171
  return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
172
172
  r.reset();
173
+ }, te = (e) => {
174
+ k.value = e;
175
+ const a = b.value.find(
176
+ (t) => t.namespace === f.value && t.slug === x.value
177
+ );
178
+ if (!(a && H(a.teamUid, e)))
179
+ return y("local", "default");
173
180
  }, _ = u(() => {
174
181
  const e = s.value;
175
182
  if (!e)
176
183
  return [];
177
184
  const a = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
178
- return pe(Object.keys(e.workspace.documents), a, (t) => t).map((t) => e.workspace.documents[t]?.["x-scalar-navigation"]).filter(M);
179
- }), r = de(_), R = ({
185
+ return de(Object.keys(e.workspace.documents), a, (t) => t).map((t) => e.workspace.documents[t]?.["x-scalar-navigation"]).filter(M);
186
+ }), r = fe(_), R = ({
180
187
  document: e,
181
188
  path: a,
182
189
  method: t,
183
190
  example: n
184
191
  }) => JSON.stringify([e, a, t, n].filter(M)), P = u(
185
- () => ve({
192
+ () => he({
186
193
  items: _.value,
187
194
  nestedKey: "children",
188
195
  filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
189
196
  getId: (e) => {
190
- const a = f("document", e), t = f("operation", e);
197
+ const a = h("document", e), t = h("operation", e);
191
198
  return R({
192
199
  document: a?.name ?? "",
193
200
  path: t?.path,
@@ -196,7 +203,7 @@ const Te = 1e3, De = 288, Je = async ({
196
203
  });
197
204
  }
198
205
  })
199
- ), I = (e) => {
206
+ ), T = (e) => {
200
207
  const a = P.value.get(R(e));
201
208
  return a || P.value.get(
202
209
  R({
@@ -230,7 +237,7 @@ const Te = 1e3, De = 288, Je = async ({
230
237
  return t ? (r.setSelected(t.id), r.setExpanded(t.id, !0)) : r.setSelected(e), i.push({
231
238
  name: "example",
232
239
  params: {
233
- documentSlug: f("document", a)?.name,
240
+ documentSlug: h("document", a)?.name,
234
241
  pathEncoded: encodeURIComponent(a.path),
235
242
  method: a.method,
236
243
  exampleName: t?.name ?? "default"
@@ -239,11 +246,11 @@ const Te = 1e3, De = 288, Je = async ({
239
246
  }
240
247
  if (a.type === "example") {
241
248
  r.setSelected(e);
242
- const t = f("operation", a);
249
+ const t = h("operation", a);
243
250
  return i.push({
244
251
  name: "example",
245
252
  params: {
246
- documentSlug: f("document", a)?.name,
253
+ documentSlug: h("document", a)?.name,
247
254
  pathEncoded: encodeURIComponent(t?.path ?? ""),
248
255
  method: t?.method,
249
256
  exampleName: a.name
@@ -254,41 +261,41 @@ const Te = 1e3, De = 288, Je = async ({
254
261
  return i.push({
255
262
  name: "document.overview",
256
263
  params: {
257
- documentSlug: f("document", a)?.name
264
+ documentSlug: h("document", a)?.name
258
265
  }
259
266
  });
260
267
  r.setExpanded(e, !r.isExpanded(e));
261
- }, ae = async () => {
268
+ }, ne = async () => {
262
269
  if (!s.value)
263
270
  return;
264
271
  const e = s.value.workspace["x-scalar-active-tab"] ?? 0, a = s.value.workspace["x-scalar-tabs"]?.[e];
265
272
  a && await i.replace(a.path);
266
273
  }, F = (e) => {
267
274
  e && s.value?.buildSidebar(e);
268
- }, te = (e) => {
275
+ }, se = (e) => {
269
276
  const a = D.value?.["x-scalar-navigation"]?.name;
270
277
  if (!a)
271
278
  return;
272
- const t = I({
279
+ const t = T({
273
280
  document: a,
274
281
  path: e.path,
275
282
  method: e.method,
276
283
  example: e.exampleKey
277
284
  });
278
285
  (!t || t.type !== "example") && (F(a), d.value && q(d.value));
279
- }, ne = u(() => s.value?.workspace?.["x-scalar-sidebar-width"] ?? De), se = (e) => s.value?.update("x-scalar-sidebar-width", e), A = p(!0), oe = "x-scalar-tabs", re = "x-scalar-active-tab", C = (e) => {
286
+ }, oe = u(() => s.value?.workspace?.["x-scalar-sidebar-width"] ?? Ae), re = (e) => s.value?.update("x-scalar-sidebar-width", e), A = p(!0), ce = "x-scalar-tabs", le = "x-scalar-active-tab", C = (e) => {
280
287
  const a = l("method", e), t = l("pathEncoded", e), n = l("documentSlug", e), c = l("workspaceSlug", e);
281
288
  return {
282
- ...ye({
289
+ ...We({
283
290
  workspace: c,
284
291
  document: n,
285
292
  path: t,
286
293
  method: a,
287
- getEntryByLocation: I
294
+ getEntryByLocation: T
288
295
  }),
289
296
  path: d.value?.path ?? ""
290
297
  };
291
- }, K = u(() => s.value?.workspace[oe] ?? [C(d.value)]), ce = u(() => s.value?.workspace[re] ?? 0), $ = async (e) => {
298
+ }, K = u(() => s.value?.workspace[ce] ?? [C(d.value)]), ie = u(() => s.value?.workspace[le] ?? 0), $ = async (e) => {
292
299
  const a = K.value[e];
293
300
  if (!a) {
294
301
  console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
@@ -300,19 +307,19 @@ const Te = 1e3, De = 288, Je = async ({
300
307
  } catch (n) {
301
308
  console.error("Failed to copy URL to clipboard:", n);
302
309
  }
303
- }, le = (e) => {
310
+ }, ue = (e) => {
304
311
  const a = l("workspaceSlug", e), t = l("documentSlug", e), n = l("namespace", e);
305
312
  if (!n || !a)
306
313
  return;
307
314
  const c = v.value.find(
308
315
  (o) => o.slug === a && o.namespace === n
309
316
  );
310
- if (c && !Ie(c.teamUid, x.value))
311
- return U("local", "default");
312
- if (g.value = n, b.value = a, y.value = t, B.value = l("method", e), L.value = l("pathEncoded", e), N.value = l("exampleName", e), e.path !== "" && Ee.setCurrentPath(e.path), h(g.value, a) !== E.value?.id)
313
- return ee(g.value, a);
314
- t && t !== s.value?.workspace[ke.workspace.activeDocument] && s?.value?.update("x-scalar-active-document", t), ie(e), q(e);
315
- }, ie = (e) => {
317
+ if (c && !H(c.teamUid, k.value))
318
+ return y("local", "default");
319
+ if (f.value = n, x.value = a, E.value = t, B.value = l("method", e), L.value = l("pathEncoded", e), N.value = l("exampleName", e), e.path !== "" && Te.setCurrentPath(e.path), w(f.value, a) !== U.value?.id)
320
+ return ae(f.value, a);
321
+ t && t !== s.value?.workspace[be.workspace.activeDocument] && s?.value?.update("x-scalar-active-document", t), pe(e), q(e);
322
+ }, pe = (e) => {
316
323
  const a = s.value?.workspace["x-scalar-tabs"] ?? [], t = s.value?.workspace["x-scalar-active-tab"] ?? 0, n = a[t];
317
324
  !n || n.path === e.path || (a[t] = C(e));
318
325
  }, q = (e) => {
@@ -321,7 +328,7 @@ const Te = 1e3, De = 288, Je = async ({
321
328
  r.setSelected(null);
322
329
  return;
323
330
  }
324
- const t = I({
331
+ const t = T({
325
332
  document: a,
326
333
  path: l("pathEncoded", e),
327
334
  method: l("method", e),
@@ -329,19 +336,19 @@ const Te = 1e3, De = 288, Je = async ({
329
336
  });
330
337
  t && (r.setSelected(t.id), r.setExpanded(t.id, !0));
331
338
  };
332
- We({
333
- eventBus: k,
339
+ Ie({
340
+ eventBus: S,
334
341
  router: i,
335
342
  store: s,
336
- navigateToCurrentTab: ae,
343
+ navigateToCurrentTab: ne,
337
344
  rebuildSidebar: F,
338
- onAfterExampleCreation: te,
345
+ onAfterExampleCreation: se,
339
346
  onSelectSidebarItem: V,
340
347
  onCopyTabUrl: (e) => $(e),
341
348
  onToggleSidebar: () => A.value = !A.value,
342
- renameWorkspace: J
349
+ renameWorkspace: Q
343
350
  });
344
- const ue = u(() => {
351
+ const me = u(() => {
345
352
  const e = s.value?.workspace["x-scalar-color-mode"] ?? "system";
346
353
  return e === "system" ? window.matchMedia?.("(prefers-color-scheme: dark)")?.matches ?? !1 : e === "dark";
347
354
  });
@@ -350,44 +357,45 @@ const Te = 1e3, De = 288, Je = async ({
350
357
  store: s,
351
358
  sidebar: {
352
359
  state: r,
353
- width: ne,
360
+ width: oe,
354
361
  isOpen: A,
355
362
  handleSelectItem: V,
356
- handleSidebarWidthUpdate: se,
357
- getEntryByLocation: I
363
+ handleSidebarWidthUpdate: re,
364
+ getEntryByLocation: T
358
365
  },
359
366
  tabs: {
360
367
  state: K,
361
- activeTabIndex: ce,
368
+ activeTabIndex: ie,
362
369
  copyTabUrl: $
363
370
  },
364
371
  workspace: {
365
372
  create: O,
366
373
  workspaceList: v,
367
- filteredWorkspaceList: W,
368
- workspaceGroups: z,
369
- activeWorkspace: E,
370
- navigateToWorkspace: U,
371
- isOpen: u(() => !!(b.value && !y.value))
374
+ filteredWorkspaceList: b,
375
+ workspaceGroups: G,
376
+ activeWorkspace: U,
377
+ navigateToWorkspace: y,
378
+ isOpen: u(() => !!(x.value && !E.value))
372
379
  },
373
- eventBus: k,
380
+ eventBus: S,
374
381
  router: i,
375
382
  currentRoute: d,
376
- loading: S,
383
+ loading: W,
377
384
  activeEntities: {
378
- namespace: g,
379
- workspaceSlug: b,
380
- documentSlug: y,
385
+ namespace: f,
386
+ workspaceSlug: x,
387
+ documentSlug: E,
381
388
  path: L,
382
389
  method: B,
383
390
  exampleName: N,
384
- teamUid: x
391
+ teamUid: ye(k),
392
+ setTeamUid: te
385
393
  },
386
- environment: G,
394
+ environment: J,
387
395
  document: D,
388
- isDarkMode: ue
396
+ isDarkMode: me
389
397
  };
390
398
  };
391
399
  export {
392
- Je as createAppState
400
+ Xe as createAppState
393
401
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":"AA2OA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":"AA6PA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import t from "./Authentication.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-9d8e1c09"]]);
4
+ const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-ac90d255"]]);
5
5
  export {
6
- e as default
6
+ i as default
7
7
  };
@@ -1,8 +1,9 @@
1
- import { defineComponent as d, computed as c, createBlock as v, openBlock as y, withCtx as n, createElementVNode as i, normalizeClass as a, createVNode as s, unref as r, createTextVNode as u } from "vue";
1
+ import { defineComponent as d, computed as i, createBlock as v, openBlock as y, withCtx as n, createElementVNode as a, normalizeClass as r, createVNode as s, unref as l, createTextVNode as u } from "vue";
2
2
  import { ScalarToggle as h } from "@scalar/components";
3
- import p from "../../settings/components/Section.vue.js";
4
- import S from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
5
- const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
3
+ import f from "../../settings/components/Section.vue.js";
4
+ import { getActiveProxyUrl as S } from "../../../helpers/get-active-proxy-url.js";
5
+ import p from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
6
+ const x = { class: "flex h-8 items-center" }, V = /* @__PURE__ */ d({
6
7
  __name: "Authentication",
7
8
  props: {
8
9
  documentSlug: {},
@@ -21,14 +22,14 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
21
22
  collectionType: {}
22
23
  },
23
24
  setup(e) {
24
- const o = c(
25
+ const o = i(
25
26
  () => e.document?.["x-scalar-set-operation-security"] ?? !1
26
- ), m = c(
27
+ ), m = i(
27
28
  () => e.document?.servers?.find(
28
- ({ url: l }) => l === e.document?.["x-scalar-selected-server"]
29
+ ({ url: c }) => c === e.document?.["x-scalar-selected-server"]
29
30
  ) ?? null
30
31
  );
31
- return (l, t) => (y(), v(p, null, {
32
+ return (c, t) => (y(), v(f, null, {
32
33
  title: n(() => [...t[1] || (t[1] = [
33
34
  u("Authentication", -1)
34
35
  ])]),
@@ -36,8 +37,8 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
36
37
  u(" If enabled, all selected authentication will apply to all operations in this document. You can override this by disabling the toggle and authentication will then be applied at the operation level. ", -1)
37
38
  ])]),
38
39
  actions: n(() => [
39
- i("div", f, [
40
- s(r(h), {
40
+ a("div", x, [
41
+ s(l(h), {
41
42
  class: "w-4",
42
43
  modelValue: o.value,
43
44
  "onUpdate:modelValue": t[0] || (t[0] = () => e.eventBus.emit("document:toggle:security"))
@@ -45,11 +46,11 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
45
46
  ])
46
47
  ]),
47
48
  default: n(() => [
48
- i("div", {
49
- class: a(!o.value && "cursor-not-allowed")
49
+ a("div", {
50
+ class: r(!o.value && "cursor-not-allowed")
50
51
  }, [
51
- s(r(S), {
52
- class: a([
52
+ s(l(p), {
53
+ class: r([
53
54
  "scalar-collection-auth border-none!",
54
55
  !o.value && "pointer-events-none opacity-50 mix-blend-luminosity"
55
56
  ]),
@@ -57,7 +58,10 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
57
58
  eventBus: e.eventBus,
58
59
  isStatic: "",
59
60
  meta: { type: "document" },
60
- proxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"] ?? "",
61
+ proxyUrl: l(S)(
62
+ e.workspaceStore.workspace["x-scalar-active-proxy"],
63
+ e.layout
64
+ ) ?? "",
61
65
  securityRequirements: e.document?.security ?? [],
62
66
  securitySchemes: e.securitySchemes,
63
67
  selectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
@@ -74,5 +78,5 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
74
78
  }
75
79
  });
76
80
  export {
77
- B as default
81
+ V as default
78
82
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"names":[],"mappings":"AA0LA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"names":[],"mappings":"AA8MA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,8 @@
1
- import { defineComponent as r, createBlock as c, openBlock as a, unref as n } from "vue";
1
+ import { defineComponent as d, createBlock as a, openBlock as n, unref as o } from "vue";
2
+ import { getActiveProxyUrl as i } from "../../../helpers/get-active-proxy-url.js";
2
3
  import s from "../../settings/DocumentSettings.vue.js";
3
- import i from "../../settings/CollectionSettings.vue.js";
4
- const x = /* @__PURE__ */ r({
4
+ import h from "../../settings/CollectionSettings.vue.js";
5
+ const f = /* @__PURE__ */ d({
5
6
  __name: "Settings",
6
7
  props: {
7
8
  documentSlug: {},
@@ -22,33 +23,36 @@ const x = /* @__PURE__ */ r({
22
23
  setup(e) {
23
24
  const m = (t) => {
24
25
  e.eventBus.emit("document:update:watch-mode", t);
25
- }, u = (t) => {
26
- e.eventBus.emit("workspace:update:theme", t);
27
26
  }, l = (t) => {
27
+ e.eventBus.emit("workspace:update:theme", t);
28
+ }, u = (t) => {
28
29
  e.eventBus.emit("workspace:update:active-proxy", t);
29
- }, d = (t) => {
30
+ }, r = (t) => {
30
31
  e.eventBus.emit("workspace:update:color-mode", t);
31
32
  };
32
- return (t, o) => e.collectionType === "document" ? (a(), c(n(s), {
33
+ return (t, c) => e.collectionType === "document" ? (n(), a(o(s), {
33
34
  key: 0,
34
35
  documentUrl: e.document?.["x-scalar-original-source-url"],
35
36
  isDraftDocument: e.documentSlug === "drafts",
36
37
  title: e.document?.info.title ?? "",
37
38
  watchMode: e.document?.["x-scalar-watch-mode"],
38
- "onDelete:document": o[0] || (o[0] = (h) => e.eventBus.emit("document:delete:document", { name: e.documentSlug })),
39
+ "onDelete:document": c[0] || (c[0] = (v) => e.eventBus.emit("document:delete:document", { name: e.documentSlug })),
39
40
  "onUpdate:watchMode": m
40
- }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (a(), c(n(i), {
41
+ }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (n(), a(o(h), {
41
42
  key: 1,
42
- activeProxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"],
43
+ activeProxyUrl: o(i)(
44
+ e.workspaceStore.workspace["x-scalar-active-proxy"],
45
+ e.layout
46
+ ),
43
47
  activeThemeSlug: e.workspaceStore.workspace["x-scalar-theme"] ?? "none",
44
48
  colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
45
49
  customThemes: e.customThemes,
46
- "onUpdate:colorMode": d,
47
- "onUpdate:proxyUrl": l,
48
- "onUpdate:themeSlug": u
50
+ "onUpdate:colorMode": r,
51
+ "onUpdate:proxyUrl": u,
52
+ "onUpdate:themeSlug": l
49
53
  }, null, 8, ["activeProxyUrl", "activeThemeSlug", "colorMode", "customThemes"]));
50
54
  }
51
55
  });
52
56
  export {
53
- x as default
57
+ f as default
54
58
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAqNA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAM/D;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;IAD/B,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;iGAqR/B,CAAC"}
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AA2NA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAO/D;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;IAD/B,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;iGAgS/B,CAAC"}