@scalar/api-client 2.22.3 → 2.23.0

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 (46) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  4. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  5. package/dist/v2/features/app/App.vue.js +111 -85
  6. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  7. package/dist/v2/features/app/app-state.js +115 -114
  8. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  9. package/dist/v2/features/app/helpers/routes.js +31 -25
  10. package/dist/v2/features/import-listener/ImportListener.vue.d.ts +52 -0
  11. package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +1 -0
  12. package/dist/v2/features/import-listener/ImportListener.vue.js +91 -0
  13. package/dist/v2/features/import-listener/ImportListener.vue2.js +4 -0
  14. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +7 -0
  15. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +1 -0
  16. package/dist/v2/features/import-listener/components/DropEventListener.vue.js +81 -0
  17. package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +4 -0
  18. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +40 -0
  19. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +1 -0
  20. package/dist/v2/features/import-listener/components/ImportModal.vue.js +170 -0
  21. package/dist/v2/features/import-listener/components/ImportModal.vue3.js +5 -0
  22. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +29 -0
  23. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +1 -0
  24. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +83 -0
  25. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +4 -0
  26. package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts +16 -0
  27. package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts.map +1 -0
  28. package/dist/v2/features/import-listener/helpers/generate-unique-slug.js +11 -0
  29. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +8 -0
  30. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +1 -0
  31. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +4 -0
  32. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts +30 -0
  33. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts.map +1 -0
  34. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.js +31 -0
  35. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +15 -0
  36. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +1 -0
  37. package/dist/v2/features/import-listener/helpers/load-document-from-source.js +28 -0
  38. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +15 -0
  39. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +1 -0
  40. package/dist/v2/features/import-listener/helpers/wait-for-condition.js +16 -0
  41. package/dist/v2/features/import-listener/index.d.ts +2 -0
  42. package/dist/v2/features/import-listener/index.d.ts.map +1 -0
  43. package/dist/v2/features/import-listener/index.js +4 -0
  44. package/dist/v2/features/operation/Operation.vue.js +1 -1
  45. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  46. package/package.json +13 -8
@@ -1,59 +1,59 @@
1
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";
2
+ import { sortByOrder as V } from "@scalar/helpers/array/sort-by-order";
3
+ import { isHttpMethod as Y } from "@scalar/helpers/http/is-http-method";
4
+ import { createSidebarState as j, generateReverseIndex as z } from "@scalar/sidebar";
5
5
  import { createWorkspaceStore as C } from "@scalar/workspace-store/client";
6
6
  import { createWorkspaceEventBus as J } from "@scalar/workspace-store/events";
7
7
  import { generateUniqueValue as M } from "@scalar/workspace-store/helpers/generate-unique-value";
8
- import { getParentEntry as m } from "@scalar/workspace-store/navigation";
8
+ import { getParentEntry as d } from "@scalar/workspace-store/navigation";
9
9
  import { createWorkspaceStorePersistence as G } from "@scalar/workspace-store/persistence";
10
10
  import { persistencePlugin as Q } from "@scalar/workspace-store/plugins/client";
11
11
  import { extensions as X } from "@scalar/workspace-store/schemas/extensions";
12
12
  import { shallowRef as E, computed as i, ref as p, watch as Z } from "vue";
13
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";
14
+ import { getTabDetails as ae } from "../../helpers/get-tab-details.js";
15
+ import { slugify as te } from "../../helpers/slugify.js";
16
16
  import { workspaceStorage as ne } from "../../helpers/storage.js";
17
17
  import { initializeAppEventHandlers as re } from "./app-events.js";
18
18
  const oe = 1e3, h = J({
19
19
  debug: !1
20
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
21
  Z(l, (e) => {
22
- e && e.afterEach((t) => ge(t));
22
+ e && e.afterEach((a) => ge(a));
23
23
  });
24
- const d = i(() => l.value?.currentRoute.value ?? null);
25
- function c(e, t) {
26
- const a = t?.params[e];
27
- if (typeof a == "string")
28
- return e === "method" ? a && j(a) ? a : void 0 : decodeURIComponent(a);
24
+ const m = i(() => l.value?.currentRoute.value ?? null);
25
+ function c(e, a) {
26
+ const t = a?.params[e];
27
+ if (typeof t == "string")
28
+ return e === "method" ? t && Y(t) ? t : void 0 : decodeURIComponent(t);
29
29
  }
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}`;
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, a) => `${e}/${a}`;
31
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,
32
+ (e) => e.map(({ teamUid: a, namespace: t, slug: n, name: u }) => ({
33
+ id: g(t, n),
34
+ teamUid: a,
35
+ namespace: t,
36
36
  slug: n,
37
37
  label: u
38
38
  }))
39
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)
40
+ const ce = async ({ namespace: e, slug: a }) => C({
41
+ plugins: [await Q({ workspaceId: `${e}-${a}`, debounceDelay: oe })]
42
+ }), ue = async (e, a) => {
43
+ const t = await x.getItem({ namespace: e, slug: a });
44
+ if (!t)
45
45
  return {
46
46
  success: !1
47
47
  };
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, {
48
+ const n = await ce({ namespace: e, slug: a });
49
+ return n.loadWorkspace(t.workspace), W.value = { id: g(t.namespace, t.slug), label: t.name }, o.value = n, {
50
50
  success: !0,
51
51
  workspace: n.workspace
52
52
  };
53
53
  }, le = async ({
54
54
  name: e,
55
- teamUid: t,
56
- namespace: a,
55
+ teamUid: a,
56
+ namespace: t,
57
57
  slug: n
58
58
  }) => {
59
59
  const u = C();
@@ -75,10 +75,10 @@ const ce = async ({ namespace: e, slug: t }) => C({
75
75
  }
76
76
  });
77
77
  const s = await x.setItem(
78
- { namespace: a, slug: n },
78
+ { namespace: t, slug: n },
79
79
  {
80
80
  name: e,
81
- teamUid: t,
81
+ teamUid: a,
82
82
  workspace: u.exportWorkspace()
83
83
  }
84
84
  );
@@ -89,41 +89,44 @@ const ce = async ({ namespace: e, slug: t }) => C({
89
89
  slug: s.slug,
90
90
  label: s.name
91
91
  }), s;
92
- }, L = async (e, t) => {
92
+ }, L = async (e, a) => {
93
93
  await l.value?.push({
94
94
  name: "workspace.environment",
95
- params: { namespace: e, workspaceSlug: t }
95
+ params: { namespace: e, workspaceSlug: a }
96
96
  });
97
97
  }, N = async ({
98
98
  key: e,
99
- name: t
99
+ name: a
100
100
  }) => {
101
101
  o.value = null;
102
- const a = await M({
103
- defaultValue: e?.slug ?? t,
102
+ const t = await M({
103
+ defaultValue: e?.slug ?? a,
104
104
  // Use the provided id if it exists, otherwise use the name
105
105
  validation: async (s) => !await x.has({ namespace: e?.namespace ?? "local", slug: s }),
106
106
  maxRetries: 100,
107
- transformation: ae
107
+ transformation: te
108
108
  });
109
- if (!a)
109
+ if (!t)
110
110
  return;
111
111
  const n = {
112
112
  teamUid: e?.teamUid,
113
113
  namespace: e?.namespace,
114
- slug: a,
115
- name: t
114
+ slug: t,
115
+ name: a
116
116
  }, u = await le(n);
117
117
  return await L(u.namespace, u.slug), u;
118
- }, ie = async (e, t) => {
118
+ }, ie = async (e, a) => {
119
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", {
120
+ const t = await ue(e, a);
121
+ if (t.success) {
122
+ const u = t.workspace["x-scalar-active-tab"] ?? 0, s = t.workspace["x-scalar-tabs"], D = s?.[u];
123
+ D && await l.value?.replace({
124
+ path: D.path,
125
+ query: m.value?.query ?? {}
126
+ }), s && u >= s.length && h.emit("tabs:update:tabs", {
124
127
  "x-scalar-active-tab": 0
125
128
  }), s || h.emit("tabs:update:tabs", {
126
- "x-scalar-tabs": [U(d.value)],
129
+ "x-scalar-tabs": [U(m.value)],
127
130
  "x-scalar-active-tab": 0
128
131
  }), f.value = !1;
129
132
  return;
@@ -139,157 +142,155 @@ const ce = async ({ namespace: e, slug: t }) => C({
139
142
  const e = o.value;
140
143
  if (!e)
141
144
  return [];
142
- const t = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
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 = ({
145
+ const a = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
146
+ return V(Object.keys(e.workspace.documents), a, (t) => t).map((t) => e.workspace.documents[t]?.["x-scalar-navigation"]).filter(A);
147
+ }), r = j(P), y = ({
145
148
  document: e,
146
- path: t,
147
- method: a,
149
+ path: a,
150
+ method: t,
148
151
  example: n
149
- }) => JSON.stringify([e, t, a, n].filter(A)), R = i(
152
+ }) => JSON.stringify([e, a, t, n].filter(A)), R = i(
150
153
  () => z({
151
154
  items: P.value,
152
155
  nestedKey: "children",
153
156
  filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
154
157
  getId: (e) => {
155
- const t = m("document", e), a = m("operation", e);
156
- return S({
157
- document: t?.name ?? "",
158
- path: a?.path,
159
- method: a?.method,
158
+ const a = d("document", e), t = d("operation", e);
159
+ return y({
160
+ document: a?.name ?? "",
161
+ path: t?.path,
162
+ method: t?.method,
160
163
  example: e.type === "example" ? e.name : void 0
161
164
  });
162
165
  }
163
166
  })
164
167
  ), b = (e) => {
165
- const t = R.value.get(S(e));
166
- return t || R.value.get(
167
- S({
168
+ const a = R.value.get(y(e));
169
+ return a || R.value.get(
170
+ y({
168
171
  document: e.document,
169
172
  path: e.path,
170
173
  method: e.method
171
174
  })
172
175
  );
173
176
  }, _ = (e) => {
174
- const t = r.getEntryById(e);
175
- if (!t) {
177
+ const a = r.getEntryById(e);
178
+ if (!a) {
176
179
  console.warn(`Could not find sidebar entry with id ${e} to select`);
177
180
  return;
178
181
  }
179
- if (t.type === "document") {
182
+ if (a.type === "document") {
180
183
  if (r.selectedItem.value === e) {
181
184
  r.setExpanded(e, !r.isExpanded(e));
182
185
  return;
183
186
  }
184
187
  return r.setSelected(e), r.setExpanded(e, !0), l.value?.push({
185
188
  name: "document.overview",
186
- params: { documentSlug: t.name }
189
+ params: { documentSlug: a.name }
187
190
  });
188
191
  }
189
- if (t.type === "operation") {
192
+ if (a.type === "operation") {
190
193
  if (r.isSelected(e)) {
191
194
  r.setExpanded(e, !r.isExpanded(e));
192
195
  return;
193
196
  }
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({
197
+ const t = a.children?.find((n) => n.type === "example");
198
+ return t ? (r.setSelected(t.id), r.setExpanded(t.id, !0)) : r.setSelected(e), l.value?.push({
196
199
  name: "example",
197
200
  params: {
198
- documentSlug: m("document", t)?.name,
199
- pathEncoded: encodeURIComponent(t.path),
200
- method: t.method,
201
- exampleName: a?.name ?? "default"
201
+ documentSlug: d("document", a)?.name,
202
+ pathEncoded: encodeURIComponent(a.path),
203
+ method: a.method,
204
+ exampleName: t?.name ?? "default"
202
205
  }
203
206
  });
204
207
  }
205
- if (t.type === "example") {
208
+ if (a.type === "example") {
206
209
  r.setSelected(e);
207
- const a = m("operation", t);
210
+ const t = d("operation", a);
208
211
  return l.value?.push({
209
212
  name: "example",
210
213
  params: {
211
- documentSlug: m("document", t)?.name,
212
- pathEncoded: encodeURIComponent(a?.path ?? ""),
213
- method: a?.method,
214
- exampleName: t.name
214
+ documentSlug: d("document", a)?.name,
215
+ pathEncoded: encodeURIComponent(t?.path ?? ""),
216
+ method: t?.method,
217
+ exampleName: a.name
215
218
  }
216
219
  });
217
220
  }
218
- if (t.type === "text")
221
+ if (a.type === "text")
219
222
  return l.value?.push({
220
223
  name: "document.overview",
221
224
  params: {
222
- documentSlug: m("document", t)?.name
225
+ documentSlug: d("document", a)?.name
223
226
  }
224
227
  });
225
228
  r.setExpanded(e, !r.isExpanded(e));
226
229
  }, pe = async () => {
227
230
  if (!o.value)
228
231
  return;
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);
232
+ const e = o.value.workspace["x-scalar-active-tab"] ?? 0, a = o.value.workspace["x-scalar-tabs"]?.[e];
233
+ a && await l.value?.replace(a.path);
231
234
  }, F = (e) => {
232
235
  e && o.value?.buildSidebar(e);
233
236
  }, me = (e) => {
234
- const t = T.value?.["x-scalar-navigation"]?.name;
235
- if (!t)
237
+ const a = T.value?.["x-scalar-navigation"]?.name;
238
+ if (!a)
236
239
  return;
237
- const a = b({
238
- document: t,
240
+ const t = b({
241
+ document: a,
239
242
  path: e.path,
240
243
  method: e.method,
241
244
  example: e.exampleKey
242
245
  });
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);
246
+ (!t || t.type !== "example") && (F(a), m.value && H(m.value));
247
+ }, de = 288, ve = i(() => o.value?.workspace?.["x-scalar-sidebar-width"] ?? de), fe = (e) => o.value?.update("x-scalar-sidebar-width", e), S = p(!0), he = "x-scalar-tabs", we = "x-scalar-active-tab", U = (e) => {
248
+ const a = c("method", e), t = c("pathEncoded", e), n = c("documentSlug", e), u = c("workspaceSlug", e);
246
249
  return {
247
- ...te({
250
+ ...ae({
248
251
  workspace: u,
249
252
  document: n,
250
- path: a,
251
- method: t,
253
+ path: t,
254
+ method: a,
252
255
  getEntryByLocation: b
253
256
  }),
254
- path: d.value?.path ?? ""
257
+ path: m.value?.path ?? ""
255
258
  };
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];
258
- if (!t) {
259
+ }, K = i(() => o.value?.workspace[he] ?? [U(m.value)]), xe = i(() => o.value?.workspace[we] ?? 0), q = async (e) => {
260
+ const a = K.value[e];
261
+ if (!a) {
259
262
  console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
260
263
  return;
261
264
  }
262
- const a = `${window.location.origin}${t.path}`;
265
+ const t = `${window.location.origin}${a.path}`;
263
266
  try {
264
- await navigator.clipboard.writeText(a);
267
+ await navigator.clipboard.writeText(t);
265
268
  } catch (n) {
266
269
  console.error("Failed to copy URL to clipboard:", n);
267
270
  }
268
271
  }, 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);
272
+ const a = c("workspaceSlug", e), t = c("documentSlug", e);
273
+ if (v.value = c("namespace", e), k.value = a, w.value = t, B.value = c("method", e), O.value = c("pathEncoded", e), $.value = c("exampleName", e), !(!v.value || !a)) {
274
+ if (e.path !== "" && ne.setCurrentPath(e.path), g(v.value, a) !== W.value?.id)
275
+ return ie(v.value, a);
276
+ t && t !== o.value?.workspace[X.workspace.activeDocument] && o?.value?.update("x-scalar-active-document", t), be(e), H(e);
276
277
  }
277
278
  }, 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);
282
- if (!t) {
279
+ const a = o.value?.workspace["x-scalar-tabs"] ?? [], t = o.value?.workspace["x-scalar-active-tab"] ?? 0, n = a[t];
280
+ !n || n.path === e.path || (a[t] = U(e));
281
+ }, H = (e) => {
282
+ const a = c("documentSlug", e);
283
+ if (!a) {
283
284
  r.setSelected(null);
284
285
  return;
285
286
  }
286
- const a = b({
287
- document: t,
287
+ const t = b({
288
+ document: a,
288
289
  path: c("pathEncoded", e),
289
290
  method: c("method", e),
290
291
  example: c("exampleName", e)
291
292
  });
292
- a && (r.setSelected(a.id), r.setExpanded(a.id, !0));
293
+ t && (r.setSelected(t.id), r.setExpanded(t.id, !0));
293
294
  };
294
295
  re({
295
296
  eventBus: h,
@@ -299,8 +300,8 @@ re({
299
300
  rebuildSidebar: F,
300
301
  onAfterExampleCreation: me,
301
302
  onSelectSidebarItem: _,
302
- onCopyTabUrl: (e) => H(e),
303
- onToggleSidebar: () => y.value = !y.value
303
+ onCopyTabUrl: (e) => q(e),
304
+ onToggleSidebar: () => S.value = !S.value
304
305
  });
305
306
  function Pe(e) {
306
307
  return e && (l.value = e), {
@@ -309,7 +310,7 @@ function Pe(e) {
309
310
  sidebar: {
310
311
  state: r,
311
312
  width: ve,
312
- isOpen: y,
313
+ isOpen: S,
313
314
  handleSelectItem: _,
314
315
  handleSidebarWidthUpdate: fe,
315
316
  getEntryByLocation: b
@@ -317,7 +318,7 @@ function Pe(e) {
317
318
  tabs: {
318
319
  state: K,
319
320
  activeTabIndex: xe,
320
- copyTabUrl: H
321
+ copyTabUrl: q
321
322
  },
322
323
  workspace: {
323
324
  create: N,
@@ -328,7 +329,7 @@ function Pe(e) {
328
329
  },
329
330
  eventBus: h,
330
331
  router: l,
331
- currentRoute: d,
332
+ currentRoute: m,
332
333
  loading: f,
333
334
  activeEntities: {
334
335
  namespace: v,
@@ -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;AAC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A;IAC/B,eAAe,EAAE,qBAAqB,CAAA;IACtC,cAAc,EAAE,cAAc,CAAA;IAC9B,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C,OAAO,EAAE,YAAY,EAAE,CAAA;CAGxB,CAAA;AAED,oCAAoC;AACpC,MAAM,MAAM,eAAe,GAAG,UAAU,GACtC,CACI;IACE,cAAc,EAAE,UAAU,CAAA;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;;;;;;;;;IAgIM,CAAA"}
@@ -1,14 +1,15 @@
1
- import n from "../../collection/components/Authentication.vue.js";
2
- import e from "../../collection/components/Cookies.vue.js";
3
- import o from "../../collection/components/Environment.vue.js";
4
- import m from "../../collection/components/Overview.vue.js";
5
- import a from "../../collection/components/Servers.vue.js";
6
- import t from "../../collection/components/Settings.vue.js";
7
- import c from "../../collection/DocumentCollection.vue.js";
8
- import p from "../../collection/WorkspaceCollection.vue.js";
9
- import r from "../../operation/Operation.vue.js";
10
- import { workspaceStorage as i } from "../../../helpers/storage.js";
11
- const g = [
1
+ import { mergeSearchParams as i } from "@scalar/helpers/url/merge-urls";
2
+ import s from "../../collection/components/Authentication.vue.js";
3
+ import o from "../../collection/components/Cookies.vue.js";
4
+ import n from "../../collection/components/Environment.vue.js";
5
+ import h from "../../collection/components/Overview.vue.js";
6
+ import d from "../../collection/components/Servers.vue.js";
7
+ import a from "../../collection/components/Settings.vue.js";
8
+ import f from "../../collection/DocumentCollection.vue.js";
9
+ import u from "../../collection/WorkspaceCollection.vue.js";
10
+ import l from "../../operation/Operation.vue.js";
11
+ import { workspaceStorage as m } from "../../../helpers/storage.js";
12
+ const A = [
12
13
  {
13
14
  path: "/@:namespace/:workspaceSlug",
14
15
  children: [
@@ -19,13 +20,13 @@ const g = [
19
20
  {
20
21
  name: "example",
21
22
  path: "path/:pathEncoded/method/:method/example/:exampleName",
22
- component: r
23
+ component: l
23
24
  },
24
25
  // Document Page
25
26
  {
26
27
  name: "document",
27
28
  path: "",
28
- component: c,
29
+ component: f,
29
30
  children: [
30
31
  // Redirect to overview
31
32
  {
@@ -39,37 +40,37 @@ const g = [
39
40
  {
40
41
  name: "document.overview",
41
42
  path: "overview",
42
- component: m
43
+ component: h
43
44
  },
44
45
  // Document servers
45
46
  {
46
47
  name: "document.servers",
47
48
  path: "servers",
48
- component: a
49
+ component: d
49
50
  },
50
51
  // Document environment
51
52
  {
52
53
  name: "document.environment",
53
54
  path: "environment",
54
- component: o
55
+ component: n
55
56
  },
56
57
  // Document authentication
57
58
  {
58
59
  name: "document.authentication",
59
60
  path: "authentication",
60
- component: n
61
+ component: s
61
62
  },
62
63
  // Document cookies
63
64
  {
64
65
  name: "document.cookies",
65
66
  path: "cookies",
66
- component: e
67
+ component: o
67
68
  },
68
69
  // Document settings
69
70
  {
70
71
  name: "document.settings",
71
72
  path: "settings",
72
- component: t
73
+ component: a
73
74
  }
74
75
  ]
75
76
  }
@@ -79,25 +80,25 @@ const g = [
79
80
  {
80
81
  name: "workspace",
81
82
  path: "",
82
- component: p,
83
+ component: u,
83
84
  children: [
84
85
  // Workspace environment
85
86
  {
86
87
  name: "workspace.environment",
87
88
  path: "environment",
88
- component: o
89
+ component: n
89
90
  },
90
91
  // Workspace cookies
91
92
  {
92
93
  name: "workspace.cookies",
93
94
  path: "cookies",
94
- component: e
95
+ component: o
95
96
  },
96
97
  // Workspace settings
97
98
  {
98
99
  name: "workspace.settings",
99
100
  path: "settings",
100
- component: t
101
+ component: a
101
102
  }
102
103
  ]
103
104
  }
@@ -105,9 +106,14 @@ const g = [
105
106
  },
106
107
  {
107
108
  path: "/:pathMatch(.*)*",
108
- redirect: () => i.getLastPath() ?? "/@local/local/drafts/overview"
109
+ redirect: () => {
110
+ const e = "/@local/local/drafts/overview", r = m.getLastPath() ?? e;
111
+ m.setCurrentPath(e);
112
+ const t = new URL(r, "http://example.com"), c = new URLSearchParams(window.location.search), p = i(t.searchParams, c);
113
+ return `${t.pathname}?${p.toString()}`;
114
+ }
109
115
  }
110
116
  ];
111
117
  export {
112
- g as ROUTES
118
+ A as ROUTES
113
119
  };
@@ -0,0 +1,52 @@
1
+ import { type ScalarListboxOption } from '@scalar/components';
2
+ import { type WorkspaceStore } from '@scalar/workspace-store/client';
3
+ type __VLS_Props = {
4
+ /**
5
+ * The workspace store instance.
6
+ * This is null during initialization until the store is ready.
7
+ */
8
+ workspaceStore: WorkspaceStore | null;
9
+ /**
10
+ * The currently active workspace.
11
+ * This represents the workspace that the user is currently working in.
12
+ */
13
+ activeWorkspace: {
14
+ id: string;
15
+ label: string;
16
+ } | null;
17
+ /**
18
+ * The list of all available workspaces.
19
+ * Used to render options for workspace switching and selection.
20
+ */
21
+ workspaces: ScalarListboxOption[];
22
+ /**
23
+ * The dark mode setting.
24
+ * This is used to determine the color mode of the import modal.
25
+ */
26
+ darkMode: boolean;
27
+ };
28
+ declare var __VLS_17: {};
29
+ type __VLS_Slots = {} & {
30
+ default?: (props: typeof __VLS_17) => any;
31
+ };
32
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
33
+ "create:workspace": (payload: {
34
+ name: string;
35
+ }) => any;
36
+ "select:workspace": (id?: string | undefined) => any;
37
+ "navigateTo:document": (slug: string) => any;
38
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
39
+ "onCreate:workspace"?: ((payload: {
40
+ name: string;
41
+ }) => any) | undefined;
42
+ "onSelect:workspace"?: ((id?: string | undefined) => any) | undefined;
43
+ "onNavigateTo:document"?: ((slug: string) => any) | undefined;
44
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
45
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
46
+ export default _default;
47
+ type __VLS_WithSlots<T, S> = T & {
48
+ new (): {
49
+ $slots: S;
50
+ };
51
+ };
52
+ //# sourceMappingURL=ImportListener.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImportListener.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/import-listener/ImportListener.vue"],"names":[],"mappings":"AA4MA,OAAO,EAAY,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,gCAAgC,CAAA;AAYvC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,cAAc,EAAE,cAAc,GAAG,IAAI,CAAA;IACrC;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACrD;;;OAGG;IACH,UAAU,EAAE,mBAAmB,EAAE,CAAA;IACjC;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAC;AA4MF,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA0BhD,QAAA,MAAM,eAAe;;cA/NsB,MAAM;;;;;;cAAN,MAAM;;;;kFAsO/C,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}