@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.
- package/CHANGELOG.md +21 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +9 -9
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +100 -91
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +2 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +43 -37
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts +6 -2
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.js +10 -10
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +2 -0
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.js +48 -42
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +48 -46
- package/dist/v2/features/app/app-state.d.ts +23 -12
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +194 -163
- package/dist/v2/features/app/helpers/routes.d.ts +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +7 -7
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +10 -10
|
@@ -1,50 +1,63 @@
|
|
|
1
|
-
import { isDefined as
|
|
2
|
-
import { sortByOrder as
|
|
3
|
-
import { isHttpMethod as
|
|
4
|
-
import { createSidebarState as
|
|
5
|
-
import { createWorkspaceStore as
|
|
6
|
-
import { createWorkspaceEventBus as
|
|
7
|
-
import { generateUniqueValue as
|
|
8
|
-
import { getParentEntry as
|
|
9
|
-
import { createWorkspaceStorePersistence as
|
|
10
|
-
import { persistencePlugin as
|
|
11
|
-
import { extensions as
|
|
12
|
-
import { shallowRef as
|
|
13
|
-
import { getActiveEnvironment as
|
|
14
|
-
import { getTabDetails as
|
|
15
|
-
import { slugify as
|
|
16
|
-
import { workspaceStorage as
|
|
17
|
-
import { initializeAppEventHandlers as
|
|
18
|
-
const
|
|
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
|
-
}),
|
|
21
|
-
|
|
22
|
-
e && e.afterEach((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 =
|
|
25
|
-
function
|
|
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 &&
|
|
28
|
+
return e === "method" ? a && j(a) ? a : void 0 : decodeURIComponent(a);
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
41
|
-
return
|
|
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:
|
|
51
|
+
workspace: n.workspace
|
|
44
52
|
};
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
})
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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: {
|
|
95
|
+
params: { namespace: e, workspaceSlug: t }
|
|
71
96
|
});
|
|
72
|
-
},
|
|
73
|
-
|
|
97
|
+
}, N = async ({
|
|
98
|
+
key: e,
|
|
74
99
|
name: t
|
|
75
100
|
}) => {
|
|
76
|
-
|
|
77
|
-
const a = await
|
|
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 (
|
|
105
|
+
validation: async (s) => !await x.has({ namespace: e?.namespace ?? "local", slug: s }),
|
|
81
106
|
maxRetries: 100,
|
|
82
|
-
transformation:
|
|
107
|
+
transformation: ae
|
|
83
108
|
});
|
|
84
109
|
if (!a)
|
|
85
110
|
return;
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
}),
|
|
96
|
-
"x-scalar-tabs": [
|
|
125
|
+
}), s || h.emit("tabs:update:tabs", {
|
|
126
|
+
"x-scalar-tabs": [U(d.value)],
|
|
97
127
|
"x-scalar-active-tab": 0
|
|
98
|
-
}),
|
|
128
|
+
}), f.value = !1;
|
|
99
129
|
return;
|
|
100
130
|
}
|
|
101
|
-
const
|
|
131
|
+
const n = await N({
|
|
102
132
|
name: "Default Workspace",
|
|
103
|
-
|
|
133
|
+
key: { slug: "default" }
|
|
104
134
|
});
|
|
105
|
-
if (
|
|
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
|
-
},
|
|
109
|
-
const e =
|
|
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
|
|
114
|
-
}), r =
|
|
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:
|
|
119
|
-
}) => JSON.stringify([e, t, a,
|
|
120
|
-
() =>
|
|
121
|
-
items:
|
|
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 =
|
|
126
|
-
return
|
|
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
|
-
),
|
|
135
|
-
const t =
|
|
136
|
-
return t ||
|
|
137
|
-
|
|
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
|
-
},
|
|
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),
|
|
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((
|
|
165
|
-
return a ? (r.setSelected(a.id), r.setExpanded(a.id, !0)) : r.setSelected(e),
|
|
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:
|
|
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 =
|
|
178
|
-
return
|
|
207
|
+
const a = m("operation", t);
|
|
208
|
+
return l.value?.push({
|
|
179
209
|
name: "example",
|
|
180
210
|
params: {
|
|
181
|
-
documentSlug:
|
|
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
|
|
219
|
+
return l.value?.push({
|
|
190
220
|
name: "document.overview",
|
|
191
221
|
params: {
|
|
192
|
-
documentSlug:
|
|
222
|
+
documentSlug: m("document", t)?.name
|
|
193
223
|
}
|
|
194
224
|
});
|
|
195
225
|
r.setExpanded(e, !r.isExpanded(e));
|
|
196
|
-
},
|
|
197
|
-
if (!
|
|
226
|
+
}, pe = async () => {
|
|
227
|
+
if (!o.value)
|
|
198
228
|
return;
|
|
199
|
-
const e =
|
|
200
|
-
t && await
|
|
201
|
-
},
|
|
202
|
-
e &&
|
|
203
|
-
},
|
|
204
|
-
const t =
|
|
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 =
|
|
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") && (
|
|
214
|
-
},
|
|
215
|
-
const t =
|
|
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
|
-
...
|
|
218
|
-
workspace:
|
|
219
|
-
document:
|
|
247
|
+
...te({
|
|
248
|
+
workspace: u,
|
|
249
|
+
document: n,
|
|
220
250
|
path: a,
|
|
221
251
|
method: t,
|
|
222
|
-
getEntryByLocation:
|
|
252
|
+
getEntryByLocation: b
|
|
223
253
|
}),
|
|
224
254
|
path: d.value?.path ?? ""
|
|
225
255
|
};
|
|
226
|
-
},
|
|
227
|
-
const t =
|
|
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 (
|
|
236
|
-
console.error("Failed to copy URL to clipboard:",
|
|
265
|
+
} catch (n) {
|
|
266
|
+
console.error("Failed to copy URL to clipboard:", n);
|
|
237
267
|
}
|
|
238
|
-
},
|
|
239
|
-
const t =
|
|
240
|
-
if (
|
|
241
|
-
if (e.path !== "" &&
|
|
242
|
-
return
|
|
243
|
-
if (a && a !==
|
|
244
|
-
return
|
|
245
|
-
|
|
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
|
-
},
|
|
248
|
-
const t =
|
|
249
|
-
!
|
|
250
|
-
},
|
|
251
|
-
const t =
|
|
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 =
|
|
286
|
+
const a = b({
|
|
257
287
|
document: t,
|
|
258
|
-
path:
|
|
259
|
-
method:
|
|
260
|
-
example:
|
|
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
|
-
|
|
265
|
-
eventBus:
|
|
266
|
-
router:
|
|
267
|
-
store:
|
|
268
|
-
navigateToCurrentTab:
|
|
269
|
-
rebuildSidebar:
|
|
270
|
-
onAfterExampleCreation:
|
|
271
|
-
onSelectSidebarItem:
|
|
272
|
-
onCopyTabUrl: (e) =>
|
|
273
|
-
onToggleSidebar: () =>
|
|
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
|
|
276
|
-
return e && (
|
|
305
|
+
function Pe(e) {
|
|
306
|
+
return e && (l.value = e), {
|
|
277
307
|
/** Active workspace store */
|
|
278
|
-
store:
|
|
308
|
+
store: o,
|
|
279
309
|
sidebar: {
|
|
280
310
|
state: r,
|
|
281
|
-
width:
|
|
282
|
-
isOpen:
|
|
283
|
-
handleSelectItem:
|
|
284
|
-
handleSidebarWidthUpdate:
|
|
285
|
-
getEntryByLocation:
|
|
311
|
+
width: ve,
|
|
312
|
+
isOpen: y,
|
|
313
|
+
handleSelectItem: _,
|
|
314
|
+
handleSidebarWidthUpdate: fe,
|
|
315
|
+
getEntryByLocation: b
|
|
286
316
|
},
|
|
287
317
|
tabs: {
|
|
288
|
-
state:
|
|
289
|
-
activeTabIndex:
|
|
290
|
-
copyTabUrl:
|
|
318
|
+
state: K,
|
|
319
|
+
activeTabIndex: xe,
|
|
320
|
+
copyTabUrl: H
|
|
291
321
|
},
|
|
292
322
|
workspace: {
|
|
293
|
-
create:
|
|
294
|
-
workspaceList:
|
|
295
|
-
activeWorkspace:
|
|
296
|
-
|
|
297
|
-
isOpen:
|
|
323
|
+
create: N,
|
|
324
|
+
workspaceList: I,
|
|
325
|
+
activeWorkspace: W,
|
|
326
|
+
navigateToWorkspace: L,
|
|
327
|
+
isOpen: i(() => !!(k.value && !w.value))
|
|
298
328
|
},
|
|
299
|
-
eventBus:
|
|
300
|
-
router:
|
|
329
|
+
eventBus: h,
|
|
330
|
+
router: l,
|
|
301
331
|
currentRoute: d,
|
|
302
|
-
loading:
|
|
332
|
+
loading: f,
|
|
303
333
|
activeEntities: {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
334
|
+
namespace: v,
|
|
335
|
+
workspaceSlug: k,
|
|
336
|
+
documentSlug: w,
|
|
337
|
+
path: O,
|
|
338
|
+
method: B,
|
|
339
|
+
exampleName: $
|
|
309
340
|
},
|
|
310
|
-
environment:
|
|
311
|
-
document:
|
|
341
|
+
environment: se,
|
|
342
|
+
document: T
|
|
312
343
|
};
|
|
313
344
|
}
|
|
314
345
|
export {
|
|
315
|
-
|
|
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,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;IACp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"../../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
|
|
9
|
-
import
|
|
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: "
|
|
13
|
+
path: "/@:namespace/:workspaceSlug",
|
|
14
14
|
children: [
|
|
15
15
|
{
|
|
16
|
-
path: "
|
|
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:
|
|
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:
|
|
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() ?? "/
|
|
108
|
+
redirect: () => i.getLastPath() ?? "/@local/local/drafts/overview"
|
|
109
109
|
}
|
|
110
110
|
];
|
|
111
111
|
export {
|
|
@@ -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.
|
|
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.
|
|
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/
|
|
328
|
+
"@scalar/icons": "0.5.2",
|
|
331
329
|
"@scalar/json-magic": "0.9.5",
|
|
332
|
-
"@scalar/oas-utils": "0.6.
|
|
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.
|
|
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/
|
|
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",
|