@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.
- package/CHANGELOG.md +6 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +111 -85
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +115 -114
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +31 -25
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts +52 -0
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/ImportListener.vue.js +91 -0
- package/dist/v2/features/import-listener/ImportListener.vue2.js +4 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +7 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.js +81 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +4 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +40 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.js +170 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue3.js +5 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +29 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +83 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +4 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts +16 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.js +11 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +8 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +4 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts +30 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.js +31 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +15 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.js +28 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +15 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.js +16 -0
- package/dist/v2/features/import-listener/index.d.ts +2 -0
- package/dist/v2/features/import-listener/index.d.ts.map +1 -0
- package/dist/v2/features/import-listener/index.js +4 -0
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- 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
|
|
3
|
-
import { isHttpMethod as
|
|
4
|
-
import { createSidebarState as
|
|
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
|
|
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
|
|
15
|
-
import { slugify as
|
|
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((
|
|
22
|
+
e && e.afterEach((a) => ge(a));
|
|
23
23
|
});
|
|
24
|
-
const
|
|
25
|
-
function c(e,
|
|
26
|
-
const
|
|
27
|
-
if (typeof
|
|
28
|
-
return e === "method" ?
|
|
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,
|
|
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:
|
|
33
|
-
id: g(
|
|
34
|
-
teamUid:
|
|
35
|
-
namespace:
|
|
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:
|
|
41
|
-
plugins: [await Q({ workspaceId: `${e}-${
|
|
42
|
-
}), ue = async (e,
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
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:
|
|
49
|
-
return n.loadWorkspace(
|
|
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:
|
|
56
|
-
namespace:
|
|
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:
|
|
78
|
+
{ namespace: t, slug: n },
|
|
79
79
|
{
|
|
80
80
|
name: e,
|
|
81
|
-
teamUid:
|
|
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,
|
|
92
|
+
}, L = async (e, a) => {
|
|
93
93
|
await l.value?.push({
|
|
94
94
|
name: "workspace.environment",
|
|
95
|
-
params: { namespace: e, workspaceSlug:
|
|
95
|
+
params: { namespace: e, workspaceSlug: a }
|
|
96
96
|
});
|
|
97
97
|
}, N = async ({
|
|
98
98
|
key: e,
|
|
99
|
-
name:
|
|
99
|
+
name: a
|
|
100
100
|
}) => {
|
|
101
101
|
o.value = null;
|
|
102
|
-
const
|
|
103
|
-
defaultValue: e?.slug ??
|
|
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:
|
|
107
|
+
transformation: te
|
|
108
108
|
});
|
|
109
|
-
if (!
|
|
109
|
+
if (!t)
|
|
110
110
|
return;
|
|
111
111
|
const n = {
|
|
112
112
|
teamUid: e?.teamUid,
|
|
113
113
|
namespace: e?.namespace,
|
|
114
|
-
slug:
|
|
115
|
-
name:
|
|
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,
|
|
118
|
+
}, ie = async (e, a) => {
|
|
119
119
|
o.value = null, f.value = !0;
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
const u =
|
|
123
|
-
D && await l.value?.replace(
|
|
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(
|
|
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
|
|
143
|
-
return
|
|
144
|
-
}), r =
|
|
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:
|
|
147
|
-
method:
|
|
149
|
+
path: a,
|
|
150
|
+
method: t,
|
|
148
151
|
example: n
|
|
149
|
-
}) => JSON.stringify([e,
|
|
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
|
|
156
|
-
return
|
|
157
|
-
document:
|
|
158
|
-
path:
|
|
159
|
-
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
|
|
166
|
-
return
|
|
167
|
-
|
|
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
|
|
175
|
-
if (!
|
|
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 (
|
|
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:
|
|
189
|
+
params: { documentSlug: a.name }
|
|
187
190
|
});
|
|
188
191
|
}
|
|
189
|
-
if (
|
|
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
|
|
195
|
-
return
|
|
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:
|
|
199
|
-
pathEncoded: encodeURIComponent(
|
|
200
|
-
method:
|
|
201
|
-
exampleName:
|
|
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 (
|
|
208
|
+
if (a.type === "example") {
|
|
206
209
|
r.setSelected(e);
|
|
207
|
-
const
|
|
210
|
+
const t = d("operation", a);
|
|
208
211
|
return l.value?.push({
|
|
209
212
|
name: "example",
|
|
210
213
|
params: {
|
|
211
|
-
documentSlug:
|
|
212
|
-
pathEncoded: encodeURIComponent(
|
|
213
|
-
method:
|
|
214
|
-
exampleName:
|
|
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 (
|
|
221
|
+
if (a.type === "text")
|
|
219
222
|
return l.value?.push({
|
|
220
223
|
name: "document.overview",
|
|
221
224
|
params: {
|
|
222
|
-
documentSlug:
|
|
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,
|
|
230
|
-
|
|
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
|
|
235
|
-
if (!
|
|
237
|
+
const a = T.value?.["x-scalar-navigation"]?.name;
|
|
238
|
+
if (!a)
|
|
236
239
|
return;
|
|
237
|
-
const
|
|
238
|
-
document:
|
|
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
|
-
(!
|
|
244
|
-
}, de = 288, ve = i(() => o.value?.workspace?.["x-scalar-sidebar-width"] ?? de), fe = (e) => o.value?.update("x-scalar-sidebar-width", e),
|
|
245
|
-
const
|
|
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
|
-
...
|
|
250
|
+
...ae({
|
|
248
251
|
workspace: u,
|
|
249
252
|
document: n,
|
|
250
|
-
path:
|
|
251
|
-
method:
|
|
253
|
+
path: t,
|
|
254
|
+
method: a,
|
|
252
255
|
getEntryByLocation: b
|
|
253
256
|
}),
|
|
254
|
-
path:
|
|
257
|
+
path: m.value?.path ?? ""
|
|
255
258
|
};
|
|
256
|
-
}, K = i(() => o.value?.workspace[he] ?? [U(
|
|
257
|
-
const
|
|
258
|
-
if (!
|
|
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
|
|
265
|
+
const t = `${window.location.origin}${a.path}`;
|
|
263
266
|
try {
|
|
264
|
-
await navigator.clipboard.writeText(
|
|
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
|
|
270
|
-
if (v.value = c("namespace", e), k.value =
|
|
271
|
-
if (e.path !== "" && ne.setCurrentPath(e.path), g(v.value,
|
|
272
|
-
return ie(v.value,
|
|
273
|
-
|
|
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
|
|
279
|
-
!n || n.path === e.path || (t
|
|
280
|
-
},
|
|
281
|
-
const
|
|
282
|
-
if (!
|
|
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
|
|
287
|
-
document:
|
|
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
|
-
|
|
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) =>
|
|
303
|
-
onToggleSidebar: () =>
|
|
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:
|
|
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:
|
|
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:
|
|
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;
|
|
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;AAEnE,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,CAAA;AAU7G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,kBAAkB,CAAA;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
|
|
2
|
-
import
|
|
3
|
-
import o from "../../collection/components/
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
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:
|
|
23
|
+
component: l
|
|
23
24
|
},
|
|
24
25
|
// Document Page
|
|
25
26
|
{
|
|
26
27
|
name: "document",
|
|
27
28
|
path: "",
|
|
28
|
-
component:
|
|
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:
|
|
43
|
+
component: h
|
|
43
44
|
},
|
|
44
45
|
// Document servers
|
|
45
46
|
{
|
|
46
47
|
name: "document.servers",
|
|
47
48
|
path: "servers",
|
|
48
|
-
component:
|
|
49
|
+
component: d
|
|
49
50
|
},
|
|
50
51
|
// Document environment
|
|
51
52
|
{
|
|
52
53
|
name: "document.environment",
|
|
53
54
|
path: "environment",
|
|
54
|
-
component:
|
|
55
|
+
component: n
|
|
55
56
|
},
|
|
56
57
|
// Document authentication
|
|
57
58
|
{
|
|
58
59
|
name: "document.authentication",
|
|
59
60
|
path: "authentication",
|
|
60
|
-
component:
|
|
61
|
+
component: s
|
|
61
62
|
},
|
|
62
63
|
// Document cookies
|
|
63
64
|
{
|
|
64
65
|
name: "document.cookies",
|
|
65
66
|
path: "cookies",
|
|
66
|
-
component:
|
|
67
|
+
component: o
|
|
67
68
|
},
|
|
68
69
|
// Document settings
|
|
69
70
|
{
|
|
70
71
|
name: "document.settings",
|
|
71
72
|
path: "settings",
|
|
72
|
-
component:
|
|
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:
|
|
83
|
+
component: u,
|
|
83
84
|
children: [
|
|
84
85
|
// Workspace environment
|
|
85
86
|
{
|
|
86
87
|
name: "workspace.environment",
|
|
87
88
|
path: "environment",
|
|
88
|
-
component:
|
|
89
|
+
component: n
|
|
89
90
|
},
|
|
90
91
|
// Workspace cookies
|
|
91
92
|
{
|
|
92
93
|
name: "workspace.cookies",
|
|
93
94
|
path: "cookies",
|
|
94
|
-
component:
|
|
95
|
+
component: o
|
|
95
96
|
},
|
|
96
97
|
// Workspace settings
|
|
97
98
|
{
|
|
98
99
|
name: "workspace.settings",
|
|
99
100
|
path: "settings",
|
|
100
|
-
component:
|
|
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: () =>
|
|
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
|
-
|
|
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"}
|