@scalar/api-client 2.22.2 → 2.22.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
  4. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +9 -9
  5. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  7. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +100 -91
  8. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +2 -0
  9. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  10. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +2 -2
  11. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +43 -37
  12. package/dist/v2/components/layout/ValueEmitter.vue.d.ts +6 -2
  13. package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -1
  14. package/dist/v2/components/layout/ValueEmitter.vue.js +10 -10
  15. package/dist/v2/components/server/ServerDropdown.vue.d.ts +2 -0
  16. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  17. package/dist/v2/components/server/ServerDropdown.vue.js +48 -42
  18. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  19. package/dist/v2/features/app/App.vue.js +48 -46
  20. package/dist/v2/features/app/app-state.d.ts +23 -12
  21. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  22. package/dist/v2/features/app/app-state.js +194 -163
  23. package/dist/v2/features/app/helpers/routes.d.ts +1 -1
  24. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  25. package/dist/v2/features/app/helpers/routes.js +7 -7
  26. package/dist/v2/features/operation/Operation.vue.js +1 -1
  27. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  28. package/package.json +10 -10
@@ -1,50 +1,63 @@
1
- import { isDefined as D } from "@scalar/helpers/array/is-defined";
2
- import { sortByOrder as $ } from "@scalar/helpers/array/sort-by-order";
3
- import { isHttpMethod as H } from "@scalar/helpers/http/is-http-method";
4
- import { createSidebarState as V, generateReverseIndex as Y } from "@scalar/sidebar";
5
- import { createWorkspaceStore as R } from "@scalar/workspace-store/client";
6
- import { createWorkspaceEventBus as j } from "@scalar/workspace-store/events";
7
- import { generateUniqueValue as q } from "@scalar/workspace-store/helpers/generate-unique-value";
8
- import { getParentEntry as p } from "@scalar/workspace-store/navigation";
9
- import { createWorkspaceStorePersistence as z } from "@scalar/workspace-store/persistence";
10
- import { persistencePlugin as J } from "@scalar/workspace-store/plugins/client";
11
- import { extensions as M } from "@scalar/workspace-store/schemas/extensions";
12
- import { shallowRef as g, computed as u, ref as l, watch as G } from "vue";
13
- import { getActiveEnvironment as Q } from "../../helpers/get-active-environment.js";
14
- import { getTabDetails as X } from "../../helpers/get-tab-details.js";
15
- import { slugify as Z } from "../../helpers/slugify.js";
16
- import { workspaceStorage as ee } from "../../helpers/storage.js";
17
- import { initializeAppEventHandlers as te } from "./app-events.js";
18
- const ae = 1e3, v = j({
1
+ import { isDefined as A } from "@scalar/helpers/array/is-defined";
2
+ import { sortByOrder as Y } from "@scalar/helpers/array/sort-by-order";
3
+ import { isHttpMethod as j } from "@scalar/helpers/http/is-http-method";
4
+ import { createSidebarState as q, generateReverseIndex as z } from "@scalar/sidebar";
5
+ import { createWorkspaceStore as C } from "@scalar/workspace-store/client";
6
+ import { createWorkspaceEventBus as J } from "@scalar/workspace-store/events";
7
+ import { generateUniqueValue as M } from "@scalar/workspace-store/helpers/generate-unique-value";
8
+ import { getParentEntry as m } from "@scalar/workspace-store/navigation";
9
+ import { createWorkspaceStorePersistence as G } from "@scalar/workspace-store/persistence";
10
+ import { persistencePlugin as Q } from "@scalar/workspace-store/plugins/client";
11
+ import { extensions as X } from "@scalar/workspace-store/schemas/extensions";
12
+ import { shallowRef as E, computed as i, ref as p, watch as Z } from "vue";
13
+ import { getActiveEnvironment as ee } from "../../helpers/get-active-environment.js";
14
+ import { getTabDetails as te } from "../../helpers/get-tab-details.js";
15
+ import { slugify as ae } from "../../helpers/slugify.js";
16
+ import { workspaceStorage as ne } from "../../helpers/storage.js";
17
+ import { initializeAppEventHandlers as re } from "./app-events.js";
18
+ const oe = 1e3, h = J({
19
19
  debug: !1
20
- }), x = l(void 0), f = l(void 0), A = l(void 0), C = l(void 0), U = l(void 0), m = l(!1), c = g(null);
21
- G(c, (e) => {
22
- e && e.afterEach((t) => he(t));
20
+ }), v = p(void 0), k = p(void 0), w = p(void 0), B = p(void 0), O = p(void 0), $ = p(void 0), f = p(!1), l = E(null);
21
+ Z(l, (e) => {
22
+ e && e.afterEach((t) => ge(t));
23
23
  });
24
- const d = u(() => c.value?.currentRoute.value ?? null);
25
- function s(e, t) {
24
+ const d = i(() => l.value?.currentRoute.value ?? null);
25
+ function c(e, t) {
26
26
  const a = t?.params[e];
27
27
  if (typeof a == "string")
28
- return e === "method" ? a && H(a) ? a : void 0 : decodeURIComponent(a);
28
+ return e === "method" ? a && j(a) ? a : void 0 : decodeURIComponent(a);
29
29
  }
30
- const y = g(null), S = l([]), n = g(null), E = u(() => n.value?.workspace.documents[f.value ?? ""] || null), re = u(() => Q(n.value, E.value)), { workspace: h } = await z();
31
- S.value = await h.getAll().then((e) => e.map(({ id: t, name: a }) => ({ id: t, label: a })));
32
- const ne = async ({ workspaceId: e }) => R({
33
- plugins: [await J({ workspaceId: e, debounceDelay: ae })]
34
- }), oe = async (e) => {
35
- const t = await h.getItem(e);
36
- if (!t)
30
+ const W = E(null), I = p([]), o = E(null), T = i(() => o.value?.workspace.documents[w.value ?? ""] || null), se = i(() => ee(o.value, T.value)), { workspace: x } = await G(), g = (e, t) => `${e}/${t}`;
31
+ I.value = await x.getAll().then(
32
+ (e) => e.map(({ teamUid: t, namespace: a, slug: n, name: u }) => ({
33
+ id: g(a, n),
34
+ teamUid: t,
35
+ namespace: a,
36
+ slug: n,
37
+ label: u
38
+ }))
39
+ );
40
+ const ce = async ({ namespace: e, slug: t }) => C({
41
+ plugins: [await Q({ workspaceId: `${e}-${t}`, debounceDelay: oe })]
42
+ }), ue = async (e, t) => {
43
+ const a = await x.getItem({ namespace: e, slug: t });
44
+ if (!a)
37
45
  return {
38
46
  success: !1
39
47
  };
40
- const a = await ne({ workspaceId: e });
41
- return a.loadWorkspace(t.workspace), y.value = { id: e, label: t.name }, n.value = a, {
48
+ const n = await ce({ namespace: e, slug: t });
49
+ return n.loadWorkspace(a.workspace), W.value = { id: g(a.namespace, a.slug), label: a.name }, o.value = n, {
42
50
  success: !0,
43
- workspace: a.workspace
51
+ workspace: n.workspace
44
52
  };
45
- }, se = async ({ id: e, name: t }) => {
46
- const a = R();
47
- await a.addDocument({
53
+ }, le = async ({
54
+ name: e,
55
+ teamUid: t,
56
+ namespace: a,
57
+ slug: n
58
+ }) => {
59
+ const u = C();
60
+ await u.addDocument({
48
61
  name: "drafts",
49
62
  document: {
50
63
  openapi: "3.1.0",
@@ -60,70 +73,87 @@ const ne = async ({ workspaceId: e }) => R({
60
73
  "x-scalar-original-document-hash": "drafts",
61
74
  "x-scalar-icon": "interface-edit-tool-pencil"
62
75
  }
63
- }), await h.setItem(e, {
64
- name: t,
65
- workspace: a.exportWorkspace()
66
- }), S.value.push({ id: e, label: t });
67
- }, B = async (e) => {
68
- e && await c.value?.push({
76
+ });
77
+ const s = await x.setItem(
78
+ { namespace: a, slug: n },
79
+ {
80
+ name: e,
81
+ teamUid: t,
82
+ workspace: u.exportWorkspace()
83
+ }
84
+ );
85
+ return I.value.push({
86
+ id: g(s.namespace, s.slug),
87
+ teamUid: s.teamUid,
88
+ namespace: s.namespace,
89
+ slug: s.slug,
90
+ label: s.name
91
+ }), s;
92
+ }, L = async (e, t) => {
93
+ await l.value?.push({
69
94
  name: "workspace.environment",
70
- params: { workspaceSlug: e }
95
+ params: { namespace: e, workspaceSlug: t }
71
96
  });
72
- }, O = async ({
73
- id: e,
97
+ }, N = async ({
98
+ key: e,
74
99
  name: t
75
100
  }) => {
76
- n.value = null;
77
- const a = await q({
78
- defaultValue: e ?? t,
101
+ o.value = null;
102
+ const a = await M({
103
+ defaultValue: e?.slug ?? t,
79
104
  // Use the provided id if it exists, otherwise use the name
80
- validation: async (i) => !await h.has(i),
105
+ validation: async (s) => !await x.has({ namespace: e?.namespace ?? "local", slug: s }),
81
106
  maxRetries: 100,
82
- transformation: Z
107
+ transformation: ae
83
108
  });
84
109
  if (!a)
85
110
  return;
86
- const o = { id: a, name: t };
87
- return await se(o), await B(a), o;
88
- }, ce = async (e) => {
89
- n.value = null, m.value = !0;
90
- const t = await oe(e);
91
- if (t.success) {
92
- const o = t.workspace["x-scalar-active-tab"] ?? 0, i = t.workspace["x-scalar-tabs"], W = i?.[o];
93
- W && await c.value?.replace(W.path), i && o >= i.length && v.emit("tabs:update:tabs", {
111
+ const n = {
112
+ teamUid: e?.teamUid,
113
+ namespace: e?.namespace,
114
+ slug: a,
115
+ name: t
116
+ }, u = await le(n);
117
+ return await L(u.namespace, u.slug), u;
118
+ }, ie = async (e, t) => {
119
+ o.value = null, f.value = !0;
120
+ const a = await ue(e, t);
121
+ if (a.success) {
122
+ const u = a.workspace["x-scalar-active-tab"] ?? 0, s = a.workspace["x-scalar-tabs"], D = s?.[u];
123
+ D && await l.value?.replace(D.path), s && u >= s.length && h.emit("tabs:update:tabs", {
94
124
  "x-scalar-active-tab": 0
95
- }), i || v.emit("tabs:update:tabs", {
96
- "x-scalar-tabs": [I(d.value)],
125
+ }), s || h.emit("tabs:update:tabs", {
126
+ "x-scalar-tabs": [U(d.value)],
97
127
  "x-scalar-active-tab": 0
98
- }), m.value = !1;
128
+ }), f.value = !1;
99
129
  return;
100
130
  }
101
- const a = await O({
131
+ const n = await N({
102
132
  name: "Default Workspace",
103
- id: "default"
133
+ key: { slug: "default" }
104
134
  });
105
- if (m.value = !1, !a)
135
+ if (f.value = !1, !n)
106
136
  return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
107
137
  r.reset();
108
- }, L = u(() => {
109
- const e = n.value;
138
+ }, P = i(() => {
139
+ const e = o.value;
110
140
  if (!e)
111
141
  return [];
112
142
  const t = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
113
- return $(Object.keys(e.workspace.documents), t, (a) => a).map((a) => e.workspace.documents[a]?.["x-scalar-navigation"]).filter(D);
114
- }), r = V(L), b = ({
143
+ return Y(Object.keys(e.workspace.documents), t, (a) => a).map((a) => e.workspace.documents[a]?.["x-scalar-navigation"]).filter(A);
144
+ }), r = q(P), S = ({
115
145
  document: e,
116
146
  path: t,
117
147
  method: a,
118
- example: o
119
- }) => JSON.stringify([e, t, a, o].filter(D)), T = u(
120
- () => Y({
121
- items: L.value,
148
+ example: n
149
+ }) => JSON.stringify([e, t, a, n].filter(A)), R = i(
150
+ () => z({
151
+ items: P.value,
122
152
  nestedKey: "children",
123
153
  filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
124
154
  getId: (e) => {
125
- const t = p("document", e), a = p("operation", e);
126
- return b({
155
+ const t = m("document", e), a = m("operation", e);
156
+ return S({
127
157
  document: t?.name ?? "",
128
158
  path: a?.path,
129
159
  method: a?.method,
@@ -131,16 +161,16 @@ const ne = async ({ workspaceId: e }) => R({
131
161
  });
132
162
  }
133
163
  })
134
- ), w = (e) => {
135
- const t = T.value.get(b(e));
136
- return t || T.value.get(
137
- b({
164
+ ), b = (e) => {
165
+ const t = R.value.get(S(e));
166
+ return t || R.value.get(
167
+ S({
138
168
  document: e.document,
139
169
  path: e.path,
140
170
  method: e.method
141
171
  })
142
172
  );
143
- }, N = (e) => {
173
+ }, _ = (e) => {
144
174
  const t = r.getEntryById(e);
145
175
  if (!t) {
146
176
  console.warn(`Could not find sidebar entry with id ${e} to select`);
@@ -151,7 +181,7 @@ const ne = async ({ workspaceId: e }) => R({
151
181
  r.setExpanded(e, !r.isExpanded(e));
152
182
  return;
153
183
  }
154
- return r.setSelected(e), r.setExpanded(e, !0), c.value?.push({
184
+ return r.setSelected(e), r.setExpanded(e, !0), l.value?.push({
155
185
  name: "document.overview",
156
186
  params: { documentSlug: t.name }
157
187
  });
@@ -161,11 +191,11 @@ const ne = async ({ workspaceId: e }) => R({
161
191
  r.setExpanded(e, !r.isExpanded(e));
162
192
  return;
163
193
  }
164
- const a = t.children?.find((o) => o.type === "example");
165
- return a ? (r.setSelected(a.id), r.setExpanded(a.id, !0)) : r.setSelected(e), c.value?.push({
194
+ const a = t.children?.find((n) => n.type === "example");
195
+ return a ? (r.setSelected(a.id), r.setExpanded(a.id, !0)) : r.setSelected(e), l.value?.push({
166
196
  name: "example",
167
197
  params: {
168
- documentSlug: p("document", t)?.name,
198
+ documentSlug: m("document", t)?.name,
169
199
  pathEncoded: encodeURIComponent(t.path),
170
200
  method: t.method,
171
201
  exampleName: a?.name ?? "default"
@@ -174,11 +204,11 @@ const ne = async ({ workspaceId: e }) => R({
174
204
  }
175
205
  if (t.type === "example") {
176
206
  r.setSelected(e);
177
- const a = p("operation", t);
178
- return c.value?.push({
207
+ const a = m("operation", t);
208
+ return l.value?.push({
179
209
  name: "example",
180
210
  params: {
181
- documentSlug: p("document", t)?.name,
211
+ documentSlug: m("document", t)?.name,
182
212
  pathEncoded: encodeURIComponent(a?.path ?? ""),
183
213
  method: a?.method,
184
214
  exampleName: t.name
@@ -186,45 +216,45 @@ const ne = async ({ workspaceId: e }) => R({
186
216
  });
187
217
  }
188
218
  if (t.type === "text")
189
- return c.value?.push({
219
+ return l.value?.push({
190
220
  name: "document.overview",
191
221
  params: {
192
- documentSlug: p("document", t)?.name
222
+ documentSlug: m("document", t)?.name
193
223
  }
194
224
  });
195
225
  r.setExpanded(e, !r.isExpanded(e));
196
- }, ue = async () => {
197
- if (!n.value)
226
+ }, pe = async () => {
227
+ if (!o.value)
198
228
  return;
199
- const e = n.value.workspace["x-scalar-active-tab"] ?? 0, t = n.value.workspace["x-scalar-tabs"]?.[e];
200
- t && await c.value?.replace(t.path);
201
- }, P = (e) => {
202
- e && n.value?.buildSidebar(e);
203
- }, ie = (e) => {
204
- const t = E.value?.["x-scalar-navigation"]?.name;
229
+ const e = o.value.workspace["x-scalar-active-tab"] ?? 0, t = o.value.workspace["x-scalar-tabs"]?.[e];
230
+ t && await l.value?.replace(t.path);
231
+ }, F = (e) => {
232
+ e && o.value?.buildSidebar(e);
233
+ }, me = (e) => {
234
+ const t = T.value?.["x-scalar-navigation"]?.name;
205
235
  if (!t)
206
236
  return;
207
- const a = w({
237
+ const a = b({
208
238
  document: t,
209
239
  path: e.path,
210
240
  method: e.method,
211
241
  example: e.exampleKey
212
242
  });
213
- (!a || a.type !== "example") && (P(t), d.value && K(d.value));
214
- }, le = 288, pe = u(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? le), de = (e) => n.value?.update("x-scalar-sidebar-width", e), k = l(!0), me = "x-scalar-tabs", ve = "x-scalar-active-tab", I = (e) => {
215
- const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e), i = s("workspaceSlug", e);
243
+ (!a || a.type !== "example") && (F(t), d.value && V(d.value));
244
+ }, de = 288, ve = i(() => o.value?.workspace?.["x-scalar-sidebar-width"] ?? de), fe = (e) => o.value?.update("x-scalar-sidebar-width", e), y = p(!0), he = "x-scalar-tabs", we = "x-scalar-active-tab", U = (e) => {
245
+ const t = c("method", e), a = c("pathEncoded", e), n = c("documentSlug", e), u = c("workspaceSlug", e);
216
246
  return {
217
- ...X({
218
- workspace: i,
219
- document: o,
247
+ ...te({
248
+ workspace: u,
249
+ document: n,
220
250
  path: a,
221
251
  method: t,
222
- getEntryByLocation: w
252
+ getEntryByLocation: b
223
253
  }),
224
254
  path: d.value?.path ?? ""
225
255
  };
226
- }, _ = u(() => n.value?.workspace[me] ?? [I(d.value)]), fe = u(() => n.value?.workspace[ve] ?? 0), F = async (e) => {
227
- const t = _.value[e];
256
+ }, K = i(() => o.value?.workspace[he] ?? [U(d.value)]), xe = i(() => o.value?.workspace[we] ?? 0), H = async (e) => {
257
+ const t = K.value[e];
228
258
  if (!t) {
229
259
  console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
230
260
  return;
@@ -232,85 +262,86 @@ const ne = async ({ workspaceId: e }) => R({
232
262
  const a = `${window.location.origin}${t.path}`;
233
263
  try {
234
264
  await navigator.clipboard.writeText(a);
235
- } catch (o) {
236
- console.error("Failed to copy URL to clipboard:", o);
265
+ } catch (n) {
266
+ console.error("Failed to copy URL to clipboard:", n);
237
267
  }
238
- }, he = (e) => {
239
- const t = s("workspaceSlug", e), a = s("documentSlug", e);
240
- if (x.value = t, f.value = a, A.value = s("method", e), C.value = s("pathEncoded", e), U.value = s("exampleName", e), !!t) {
241
- if (e.path !== "" && ee.setCurrentPath(e.path), t !== y.value?.id)
242
- return ce(t);
243
- if (a && a !== n.value?.workspace[M.workspace.activeDocument])
244
- return n?.value?.update("x-scalar-active-document", a);
245
- we(e), K(e);
268
+ }, ge = (e) => {
269
+ const t = c("workspaceSlug", e), a = c("documentSlug", e);
270
+ if (v.value = c("namespace", e), k.value = t, w.value = a, B.value = c("method", e), O.value = c("pathEncoded", e), $.value = c("exampleName", e), !(!v.value || !t)) {
271
+ if (e.path !== "" && ne.setCurrentPath(e.path), g(v.value, t) !== W.value?.id)
272
+ return ie(v.value, t);
273
+ if (a && a !== o.value?.workspace[X.workspace.activeDocument])
274
+ return o?.value?.update("x-scalar-active-document", a);
275
+ be(e), V(e);
246
276
  }
247
- }, we = (e) => {
248
- const t = n.value?.workspace["x-scalar-tabs"] ?? [], a = n.value?.workspace["x-scalar-active-tab"] ?? 0, o = t[a];
249
- !o || o.path === e.path || (t[a] = I(e));
250
- }, K = (e) => {
251
- const t = s("documentSlug", e);
277
+ }, be = (e) => {
278
+ const t = o.value?.workspace["x-scalar-tabs"] ?? [], a = o.value?.workspace["x-scalar-active-tab"] ?? 0, n = t[a];
279
+ !n || n.path === e.path || (t[a] = U(e));
280
+ }, V = (e) => {
281
+ const t = c("documentSlug", e);
252
282
  if (!t) {
253
283
  r.setSelected(null);
254
284
  return;
255
285
  }
256
- const a = w({
286
+ const a = b({
257
287
  document: t,
258
- path: s("pathEncoded", e),
259
- method: s("method", e),
260
- example: s("exampleName", e)
288
+ path: c("pathEncoded", e),
289
+ method: c("method", e),
290
+ example: c("exampleName", e)
261
291
  });
262
292
  a && (r.setSelected(a.id), r.setExpanded(a.id, !0));
263
293
  };
264
- te({
265
- eventBus: v,
266
- router: c,
267
- store: n,
268
- navigateToCurrentTab: ue,
269
- rebuildSidebar: P,
270
- onAfterExampleCreation: ie,
271
- onSelectSidebarItem: N,
272
- onCopyTabUrl: (e) => F(e),
273
- onToggleSidebar: () => k.value = !k.value
294
+ re({
295
+ eventBus: h,
296
+ router: l,
297
+ store: o,
298
+ navigateToCurrentTab: pe,
299
+ rebuildSidebar: F,
300
+ onAfterExampleCreation: me,
301
+ onSelectSidebarItem: _,
302
+ onCopyTabUrl: (e) => H(e),
303
+ onToggleSidebar: () => y.value = !y.value
274
304
  });
275
- function Le(e) {
276
- return e && (c.value = e), {
305
+ function Pe(e) {
306
+ return e && (l.value = e), {
277
307
  /** Active workspace store */
278
- store: n,
308
+ store: o,
279
309
  sidebar: {
280
310
  state: r,
281
- width: pe,
282
- isOpen: k,
283
- handleSelectItem: N,
284
- handleSidebarWidthUpdate: de,
285
- getEntryByLocation: w
311
+ width: ve,
312
+ isOpen: y,
313
+ handleSelectItem: _,
314
+ handleSidebarWidthUpdate: fe,
315
+ getEntryByLocation: b
286
316
  },
287
317
  tabs: {
288
- state: _,
289
- activeTabIndex: fe,
290
- copyTabUrl: F
318
+ state: K,
319
+ activeTabIndex: xe,
320
+ copyTabUrl: H
291
321
  },
292
322
  workspace: {
293
- create: O,
294
- workspaceList: S,
295
- activeWorkspace: y,
296
- setId: B,
297
- isOpen: u(() => !!(x.value && !f.value))
323
+ create: N,
324
+ workspaceList: I,
325
+ activeWorkspace: W,
326
+ navigateToWorkspace: L,
327
+ isOpen: i(() => !!(k.value && !w.value))
298
328
  },
299
- eventBus: v,
300
- router: c,
329
+ eventBus: h,
330
+ router: l,
301
331
  currentRoute: d,
302
- loading: m,
332
+ loading: f,
303
333
  activeEntities: {
304
- workspaceSlug: x,
305
- documentSlug: f,
306
- path: C,
307
- method: A,
308
- exampleName: U
334
+ namespace: v,
335
+ workspaceSlug: k,
336
+ documentSlug: w,
337
+ path: O,
338
+ method: B,
339
+ exampleName: $
309
340
  },
310
- environment: re,
311
- document: E
341
+ environment: se,
342
+ document: T
312
343
  };
313
344
  }
314
345
  export {
315
- Le as useAppState
346
+ Pe as useAppState
316
347
  };
@@ -32,7 +32,7 @@ export type CollectionProps = RouteProps & ({
32
32
  collectionType: 'workspace';
33
33
  document: null;
34
34
  });
35
- export type ScalarClientAppRouteParams = 'workspaceSlug' | 'documentSlug' | 'pathEncoded' | 'method' | 'exampleName';
35
+ export type ScalarClientAppRouteParams = 'namespace' | 'workspaceSlug' | 'documentSlug' | 'pathEncoded' | 'method' | 'exampleName';
36
36
  /** Routes for the API client app and web, the same as modal + workspace routes */
37
37
  export declare const ROUTES: ({
38
38
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,C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A;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GACD;IACE,cAAc,EAAE,WAAW,CAAA;IAC3B,QAAQ,EAAE,IAAI,CAAA;CACf,CACJ,CAAA;AAEH,MAAM,MAAM,0BAA0B,GAClC,WAAW,GACX,eAAe,GACf,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,CAAA;AAEjB,kFAAkF;AAClF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAlBK,UAAU;8BAChB,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;oCALE,UAAU;8BAChB,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;;;;;;;;;;;;;;gCALE,UAAU;0BAChB,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;gCALE,UAAU;0BAChB,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;;;;;;;;IAgHM,CAAA"}
@@ -5,21 +5,21 @@ import m from "../../collection/components/Overview.vue.js";
5
5
  import a from "../../collection/components/Servers.vue.js";
6
6
  import t from "../../collection/components/Settings.vue.js";
7
7
  import c from "../../collection/DocumentCollection.vue.js";
8
- import r from "../../collection/WorkspaceCollection.vue.js";
9
- import p from "../../operation/Operation.vue.js";
8
+ import p from "../../collection/WorkspaceCollection.vue.js";
9
+ import r from "../../operation/Operation.vue.js";
10
10
  import { workspaceStorage as i } from "../../../helpers/storage.js";
11
11
  const g = [
12
12
  {
13
- path: "/workspace/:workspaceSlug",
13
+ path: "/@:namespace/:workspaceSlug",
14
14
  children: [
15
15
  {
16
- path: "document/:documentSlug",
16
+ path: ":documentSlug",
17
17
  children: [
18
18
  // Example page
19
19
  {
20
20
  name: "example",
21
21
  path: "path/:pathEncoded/method/:method/example/:exampleName",
22
- component: p
22
+ component: r
23
23
  },
24
24
  // Document Page
25
25
  {
@@ -79,7 +79,7 @@ const g = [
79
79
  {
80
80
  name: "workspace",
81
81
  path: "",
82
- component: r,
82
+ component: p,
83
83
  children: [
84
84
  // Workspace environment
85
85
  {
@@ -105,7 +105,7 @@ const g = [
105
105
  },
106
106
  {
107
107
  path: "/:pathMatch(.*)*",
108
- redirect: () => i.getLastPath() ?? "/workspace/default/document/drafts/overview"
108
+ redirect: () => i.getLastPath() ?? "/@local/local/drafts/overview"
109
109
  }
110
110
  ];
111
111
  export {
@@ -69,7 +69,7 @@ const b = {
69
69
  type: "document"
70
70
  }), h = n(
71
71
  () => C(o(e.options)?.hiddenClients)
72
- ), f = "2.22.2";
72
+ ), f = "2.22.3";
73
73
  return (t, a) => e.path && e.method && e.exampleName && l.value ? (c(), x(i(p), {
74
74
  key: 0,
75
75
  appVersion: i(f),
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
33
33
  }));
34
34
  }, f = (u) => {
35
35
  u?.createNew && g.name === "request" && p();
36
- }, v = "2.22.2";
36
+ }, v = "2.22.3";
37
37
  return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (u, e) => (l(), n("div", W, [
38
38
  s("div", {
39
39
  class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.22.2",
21
+ "version": "2.22.3",
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
@@ -321,26 +321,26 @@
321
321
  "whatwg-mimetype": "4.0.0",
322
322
  "yaml": "^2.8.0",
323
323
  "zod": "^4.3.5",
324
+ "@scalar/components": "0.17.2",
324
325
  "@scalar/analytics-client": "1.0.1",
325
- "@scalar/components": "0.17.1",
326
- "@scalar/helpers": "0.2.10",
327
326
  "@scalar/draggable": "0.3.0",
328
- "@scalar/icons": "0.5.2",
329
327
  "@scalar/import": "0.4.47",
330
- "@scalar/object-utils": "1.2.24",
328
+ "@scalar/icons": "0.5.2",
331
329
  "@scalar/json-magic": "0.9.5",
332
- "@scalar/oas-utils": "0.6.31",
330
+ "@scalar/oas-utils": "0.6.32",
333
331
  "@scalar/openapi-parser": "0.24.6",
332
+ "@scalar/object-utils": "1.2.24",
334
333
  "@scalar/openapi-types": "0.5.3",
335
334
  "@scalar/postman-to-openapi": "0.4.2",
336
- "@scalar/sidebar": "0.7.24",
335
+ "@scalar/sidebar": "0.7.25",
337
336
  "@scalar/snippetz": "0.6.10",
338
337
  "@scalar/themes": "0.14.0",
338
+ "@scalar/use-codemirror": "0.13.29",
339
339
  "@scalar/types": "0.6.1",
340
- "@scalar/use-codemirror": "0.13.28",
341
- "@scalar/use-toasts": "0.9.1",
342
340
  "@scalar/use-hooks": "0.3.7",
343
- "@scalar/workspace-store": "0.28.0"
341
+ "@scalar/use-toasts": "0.9.1",
342
+ "@scalar/workspace-store": "0.28.1",
343
+ "@scalar/helpers": "0.2.10"
344
344
  },
345
345
  "devDependencies": {
346
346
  "@tailwindcss/vite": "^4.1.18",