@websublime/vite-plugin-open-api-devtools 0.4.0 → 0.6.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/dist/ModelsPage-CSuUHUuV.js +629 -0
- package/dist/ModelsPage-CSuUHUuV.js.map +1 -0
- package/dist/RoutesPage-D3FSr2Y6.js +520 -0
- package/dist/RoutesPage-D3FSr2Y6.js.map +1 -0
- package/dist/SimulatorPage-CzJrwWzc.js +425 -0
- package/dist/SimulatorPage-CzJrwWzc.js.map +1 -0
- package/dist/{TimelinePage-CMchXIlE.js → TimelinePage-HGh13pF3.js} +25 -23
- package/dist/TimelinePage-HGh13pF3.js.map +1 -0
- package/dist/check-BLIoatWd.js +6 -0
- package/dist/check-BLIoatWd.js.map +1 -0
- package/dist/devtools.css +1 -1
- package/dist/devtools.js +1 -1
- package/dist/devtools.umd.cjs +3 -1
- package/dist/devtools.umd.cjs.map +1 -1
- package/dist/{format-CE7KDbll.js → format-lBEBG5Y6.js} +11 -16
- package/dist/format-lBEBG5Y6.js.map +1 -0
- package/dist/{main-AUiFaD93.js → main-DKt7pJsx.js} +5 -5
- package/dist/{main-AUiFaD93.js.map → main-DKt7pJsx.js.map} +1 -1
- package/dist/registry-BQhccWMq.js +153 -0
- package/dist/registry-BQhccWMq.js.map +1 -0
- package/dist/trash-2-RxS9jzWT.js +12 -0
- package/dist/trash-2-RxS9jzWT.js.map +1 -0
- package/dist/triangle-alert-gLhIcFT5.js +16 -0
- package/dist/triangle-alert-gLhIcFT5.js.map +1 -0
- package/dist/x-UqfnjULc.js +9 -0
- package/dist/x-UqfnjULc.js.map +1 -0
- package/package.json +14 -13
- package/dist/ModelsPage-D-qLEz14.js +0 -93
- package/dist/ModelsPage-D-qLEz14.js.map +0 -1
- package/dist/RoutesPage-D7H_CupP.js +0 -665
- package/dist/RoutesPage-D7H_CupP.js.map +0 -1
- package/dist/SimulatorPage-9sBeAxQI.js +0 -229
- package/dist/SimulatorPage-9sBeAxQI.js.map +0 -1
- package/dist/TimelinePage-CMchXIlE.js.map +0 -1
- package/dist/format-CE7KDbll.js.map +0 -1
- package/dist/triangle-alert-ZH4fYFnz.js +0 -24
- package/dist/triangle-alert-ZH4fYFnz.js.map +0 -1
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { ref as y, computed as f, defineComponent as X, onMounted as Y, onUnmounted as ee, createElementBlock as d, openBlock as r, createElementVNode as a, createVNode as R, unref as u, createCommentVNode as $, withDirectives as V, Fragment as x, renderList as U, toDisplayString as b, vModelSelect as q, vModelText as te, normalizeClass as B, createBlock as O, resolveDynamicComponent as G } from "vue";
|
|
2
|
+
import { c as oe, u as se, Z as W, C as Z, _ as le } from "./main-DKt7pJsx.js";
|
|
3
|
+
import { u as ae } from "./registry-BQhccWMq.js";
|
|
4
|
+
import { defineStore as ne } from "pinia";
|
|
5
|
+
import { T as K } from "./triangle-alert-gLhIcFT5.js";
|
|
6
|
+
import { T as j } from "./trash-2-RxS9jzWT.js";
|
|
7
|
+
const ie = oe("plus", [
|
|
8
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
9
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
10
|
+
]), D = [
|
|
11
|
+
{
|
|
12
|
+
id: "slow-network",
|
|
13
|
+
label: "Slow Network",
|
|
14
|
+
description: "3000ms delay (3G simulation)",
|
|
15
|
+
type: "delay",
|
|
16
|
+
status: 200,
|
|
17
|
+
delay: 3e3
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "server-error",
|
|
21
|
+
label: "Server Error",
|
|
22
|
+
description: "Returns HTTP 500",
|
|
23
|
+
type: "error",
|
|
24
|
+
status: 500,
|
|
25
|
+
body: { error: "Internal Server Error", message: "Simulated server error" }
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "rate-limit",
|
|
29
|
+
label: "Rate Limited",
|
|
30
|
+
description: "Returns HTTP 429",
|
|
31
|
+
type: "error",
|
|
32
|
+
status: 429,
|
|
33
|
+
body: { error: "Too Many Requests", message: "Rate limit exceeded" }
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "not-found",
|
|
37
|
+
label: "Not Found",
|
|
38
|
+
description: "Returns HTTP 404",
|
|
39
|
+
type: "error",
|
|
40
|
+
status: 404,
|
|
41
|
+
body: { error: "Not Found", message: "Resource not found" }
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "request-timeout",
|
|
45
|
+
label: "Request Timeout",
|
|
46
|
+
description: "30000ms delay (simulates timeout)",
|
|
47
|
+
type: "delay",
|
|
48
|
+
status: 200,
|
|
49
|
+
delay: 3e4
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "empty-response",
|
|
53
|
+
label: "Empty Response",
|
|
54
|
+
description: "Returns HTTP 200 with empty body",
|
|
55
|
+
type: "empty",
|
|
56
|
+
status: 200,
|
|
57
|
+
body: null
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "unauthorized",
|
|
61
|
+
label: "Unauthorized",
|
|
62
|
+
description: "Returns HTTP 401",
|
|
63
|
+
type: "error",
|
|
64
|
+
status: 401,
|
|
65
|
+
body: { error: "Unauthorized", message: "Authentication required" }
|
|
66
|
+
}
|
|
67
|
+
], re = ne("simulation", () => {
|
|
68
|
+
const i = y(/* @__PURE__ */ new Map()), s = y(/* @__PURE__ */ new Map()), g = y(!1), c = y(null), h = f(() => Array.from(i.value.values())), _ = f(() => i.value.size), T = f(() => D), p = f(() => i.value.size > 0), S = f(() => {
|
|
69
|
+
const e = {
|
|
70
|
+
delay: [],
|
|
71
|
+
error: [],
|
|
72
|
+
empty: []
|
|
73
|
+
};
|
|
74
|
+
for (const n of i.value.values()) {
|
|
75
|
+
const v = N(n);
|
|
76
|
+
e[v].push(n);
|
|
77
|
+
}
|
|
78
|
+
return e;
|
|
79
|
+
});
|
|
80
|
+
function N(e) {
|
|
81
|
+
const n = e.presetId ? D.find((v) => v.id === e.presetId) : null;
|
|
82
|
+
return n ? n.type : e.delay && e.delay > 0 ? "delay" : e.body === null ? "empty" : "error";
|
|
83
|
+
}
|
|
84
|
+
function I(e) {
|
|
85
|
+
i.value.clear();
|
|
86
|
+
for (const n of e)
|
|
87
|
+
i.value.set(n.path, n);
|
|
88
|
+
c.value = null;
|
|
89
|
+
}
|
|
90
|
+
function C(e, n = !1) {
|
|
91
|
+
if (n) {
|
|
92
|
+
const v = i.value.get(e.path) || null;
|
|
93
|
+
s.value.set(e.path, v);
|
|
94
|
+
}
|
|
95
|
+
i.value.set(e.path, e);
|
|
96
|
+
}
|
|
97
|
+
function P(e, n = !1) {
|
|
98
|
+
if (n) {
|
|
99
|
+
const v = i.value.get(e) || null;
|
|
100
|
+
s.value.set(e, v);
|
|
101
|
+
}
|
|
102
|
+
return i.value.delete(e);
|
|
103
|
+
}
|
|
104
|
+
function E() {
|
|
105
|
+
i.value.clear();
|
|
106
|
+
}
|
|
107
|
+
function H(e) {
|
|
108
|
+
return i.value.get(e);
|
|
109
|
+
}
|
|
110
|
+
function k(e) {
|
|
111
|
+
return i.value.has(e);
|
|
112
|
+
}
|
|
113
|
+
function M(e) {
|
|
114
|
+
return D.find((n) => n.id === e);
|
|
115
|
+
}
|
|
116
|
+
function F(e, n, v) {
|
|
117
|
+
const A = M(n);
|
|
118
|
+
return A ? {
|
|
119
|
+
path: e,
|
|
120
|
+
operationId: v,
|
|
121
|
+
status: A.status,
|
|
122
|
+
delay: A.delay,
|
|
123
|
+
body: A.body,
|
|
124
|
+
presetId: A.id
|
|
125
|
+
} : (c.value = `Preset not found: ${n}`, null);
|
|
126
|
+
}
|
|
127
|
+
function L(e) {
|
|
128
|
+
g.value = e;
|
|
129
|
+
}
|
|
130
|
+
function w(e) {
|
|
131
|
+
c.value = e, g.value = !1;
|
|
132
|
+
}
|
|
133
|
+
function z() {
|
|
134
|
+
c.value = null;
|
|
135
|
+
}
|
|
136
|
+
function t(e) {
|
|
137
|
+
if (!s.value.has(e))
|
|
138
|
+
return;
|
|
139
|
+
const n = s.value.get(e);
|
|
140
|
+
n == null ? i.value.delete(e) : i.value.set(e, n), s.value.delete(e);
|
|
141
|
+
}
|
|
142
|
+
function l(e) {
|
|
143
|
+
console.log("[Simulation] Added:", e.path);
|
|
144
|
+
}
|
|
145
|
+
function o(e) {
|
|
146
|
+
P(e.path), console.log("[Simulation] Removed:", e.path);
|
|
147
|
+
}
|
|
148
|
+
function m(e) {
|
|
149
|
+
E(), console.log("[Simulation] Cleared all:", e.count);
|
|
150
|
+
}
|
|
151
|
+
function J(e) {
|
|
152
|
+
e.success ? (s.value.delete(e.path), console.log("[Simulation] Set successfully:", e.path)) : (t(e.path), w(`Failed to set simulation for ${e.path}`)), L(!1);
|
|
153
|
+
}
|
|
154
|
+
function Q(e) {
|
|
155
|
+
e.success ? (s.value.delete(e.path), console.log("[Simulation] Cleared successfully:", e.path)) : (t(e.path), w(`Failed to clear simulation for ${e.path}`)), L(!1);
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
// State
|
|
159
|
+
simulations: i,
|
|
160
|
+
isLoading: g,
|
|
161
|
+
error: c,
|
|
162
|
+
// Getters
|
|
163
|
+
activeSimulations: h,
|
|
164
|
+
count: _,
|
|
165
|
+
presets: T,
|
|
166
|
+
hasActiveSimulations: p,
|
|
167
|
+
simulationsByType: S,
|
|
168
|
+
// Actions
|
|
169
|
+
setSimulations: I,
|
|
170
|
+
addSimulationLocal: C,
|
|
171
|
+
removeSimulationLocal: P,
|
|
172
|
+
clearSimulationsLocal: E,
|
|
173
|
+
getSimulation: H,
|
|
174
|
+
hasSimulation: k,
|
|
175
|
+
getPreset: M,
|
|
176
|
+
createSimulationFromPreset: F,
|
|
177
|
+
setLoading: L,
|
|
178
|
+
setError: w,
|
|
179
|
+
clearError: z,
|
|
180
|
+
rollbackSimulation: t,
|
|
181
|
+
// Event handlers
|
|
182
|
+
handleSimulationAdded: l,
|
|
183
|
+
handleSimulationRemoved: o,
|
|
184
|
+
handleSimulationsCleared: m,
|
|
185
|
+
handleSimulationSet: J,
|
|
186
|
+
handleSimulationCleared: Q
|
|
187
|
+
};
|
|
188
|
+
}), ue = { class: "simulator-page" }, de = { class: "simulator-form card" }, ce = { class: "simulator-form__header" }, me = { class: "simulator-form__body" }, pe = {
|
|
189
|
+
key: 0,
|
|
190
|
+
class: "simulator-form__row"
|
|
191
|
+
}, ve = ["value"], ye = { class: "simulator-form__row" }, fe = ["value"], he = { class: "simulator-presets" }, _e = ["title", "onClick"], Se = { class: "simulator-preset__label" }, be = ["disabled"], ge = { class: "simulator-active" }, Te = { class: "simulator-active__header" }, ke = { class: "simulator-active__title" }, Ce = ["disabled"], Pe = { class: "simulator-active__list" }, Ee = { class: "simulator-simulation__info" }, Le = { class: "simulator-simulation__path font-mono" }, we = { class: "simulator-simulation__preset" }, Ae = {
|
|
192
|
+
key: 0,
|
|
193
|
+
class: "text-muted"
|
|
194
|
+
}, Re = ["disabled", "onClick"], Ie = {
|
|
195
|
+
key: 0,
|
|
196
|
+
class: "empty-state"
|
|
197
|
+
}, Me = /* @__PURE__ */ X({
|
|
198
|
+
__name: "SimulatorPage",
|
|
199
|
+
setup(i) {
|
|
200
|
+
const s = re(), g = ae(), { send: c, on: h } = se(), _ = y(""), T = y("GET"), p = y(null), S = y(null), N = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
|
|
201
|
+
let I = [];
|
|
202
|
+
const C = y(/* @__PURE__ */ new Set()), P = f(() => g.endpoints.map((t) => ({
|
|
203
|
+
key: t.key,
|
|
204
|
+
label: `${t.method.toUpperCase()} ${t.path}`,
|
|
205
|
+
method: t.method.toUpperCase(),
|
|
206
|
+
path: t.path,
|
|
207
|
+
operationId: t.operationId
|
|
208
|
+
}))), E = f(() => {
|
|
209
|
+
const t = _.value.trim() !== "", l = p.value !== null;
|
|
210
|
+
return t && l;
|
|
211
|
+
}), H = f(() => s.activeSimulations.map((t) => {
|
|
212
|
+
const l = t.presetId ? s.getPreset(t.presetId) : null;
|
|
213
|
+
return {
|
|
214
|
+
...t,
|
|
215
|
+
preset: l
|
|
216
|
+
};
|
|
217
|
+
})), k = f(() => s.count);
|
|
218
|
+
function M() {
|
|
219
|
+
if (!E.value || !p.value || !s.getPreset(p.value)) return;
|
|
220
|
+
const l = _.value.trim();
|
|
221
|
+
if (!l.startsWith("/")) {
|
|
222
|
+
s.setError("Path must start with /");
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (l.length > 500) {
|
|
226
|
+
s.setError("Path is too long (max 500 characters)");
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (!/^\/[\w\-/{}:.]*$/.test(l)) {
|
|
230
|
+
s.setError("Path contains invalid characters");
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const o = `${T.value.toLowerCase()}:${l}`, m = s.createSimulationFromPreset(
|
|
234
|
+
o,
|
|
235
|
+
p.value,
|
|
236
|
+
void 0
|
|
237
|
+
);
|
|
238
|
+
m && (s.addSimulationLocal(m, !0), s.setLoading(!0), c({
|
|
239
|
+
type: "set:simulation",
|
|
240
|
+
data: {
|
|
241
|
+
path: m.path,
|
|
242
|
+
status: m.status,
|
|
243
|
+
delay: m.delay,
|
|
244
|
+
body: m.body
|
|
245
|
+
}
|
|
246
|
+
}), _.value = "", p.value = null, S.value = null);
|
|
247
|
+
}
|
|
248
|
+
function F(t) {
|
|
249
|
+
s.removeSimulationLocal(t, !0), s.setLoading(!0), c({
|
|
250
|
+
type: "clear:simulation",
|
|
251
|
+
data: { path: t }
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function L() {
|
|
255
|
+
if (k.value !== 0) {
|
|
256
|
+
for (const t of s.activeSimulations)
|
|
257
|
+
C.value.add(t.path), s.removeSimulationLocal(t.path, !0), c({
|
|
258
|
+
type: "clear:simulation",
|
|
259
|
+
data: { path: t.path }
|
|
260
|
+
});
|
|
261
|
+
s.setLoading(!0);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function w() {
|
|
265
|
+
if (!S.value) return;
|
|
266
|
+
const t = g.endpoints.find((l) => l.key === S.value);
|
|
267
|
+
t && (T.value = t.method.toUpperCase(), _.value = t.path);
|
|
268
|
+
}
|
|
269
|
+
function z() {
|
|
270
|
+
S.value = null;
|
|
271
|
+
}
|
|
272
|
+
return Y(() => {
|
|
273
|
+
I = [
|
|
274
|
+
h("simulation:active", (t) => {
|
|
275
|
+
s.setSimulations(t.simulations);
|
|
276
|
+
}),
|
|
277
|
+
h("simulation:added", (t) => {
|
|
278
|
+
s.handleSimulationAdded(t);
|
|
279
|
+
}),
|
|
280
|
+
h("simulation:removed", (t) => {
|
|
281
|
+
s.handleSimulationRemoved(t);
|
|
282
|
+
}),
|
|
283
|
+
h("simulations:cleared", (t) => {
|
|
284
|
+
s.handleSimulationsCleared(t);
|
|
285
|
+
}),
|
|
286
|
+
h("simulation:set", (t) => {
|
|
287
|
+
s.handleSimulationSet(t);
|
|
288
|
+
}),
|
|
289
|
+
h("simulation:cleared", (t) => {
|
|
290
|
+
C.value.has(t.path) && C.value.delete(t.path), s.handleSimulationCleared(t);
|
|
291
|
+
})
|
|
292
|
+
], c({ type: "get:registry" });
|
|
293
|
+
}), ee(() => {
|
|
294
|
+
for (const t of I)
|
|
295
|
+
t();
|
|
296
|
+
}), (t, l) => (r(), d("div", ue, [
|
|
297
|
+
a("div", de, [
|
|
298
|
+
a("div", ce, [
|
|
299
|
+
R(u(W), { size: 18 }),
|
|
300
|
+
l[3] || (l[3] = a("span", null, "Add Simulation", -1))
|
|
301
|
+
]),
|
|
302
|
+
a("div", me, [
|
|
303
|
+
P.value.length > 0 ? (r(), d("div", pe, [
|
|
304
|
+
l[5] || (l[5] = a("label", { class: "simulator-form__label" }, "Select Endpoint (optional):", -1)),
|
|
305
|
+
V(a("select", {
|
|
306
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => S.value = o),
|
|
307
|
+
class: "input",
|
|
308
|
+
onChange: w
|
|
309
|
+
}, [
|
|
310
|
+
l[4] || (l[4] = a("option", { value: null }, "Manual entry...", -1)),
|
|
311
|
+
(r(!0), d(x, null, U(P.value, (o) => (r(), d("option", {
|
|
312
|
+
key: o.key,
|
|
313
|
+
value: o.key
|
|
314
|
+
}, b(o.label), 9, ve))), 128))
|
|
315
|
+
], 544), [
|
|
316
|
+
[q, S.value]
|
|
317
|
+
])
|
|
318
|
+
])) : $("", !0),
|
|
319
|
+
a("div", ye, [
|
|
320
|
+
V(a("select", {
|
|
321
|
+
"onUpdate:modelValue": l[1] || (l[1] = (o) => T.value = o),
|
|
322
|
+
class: "simulator-form__method input",
|
|
323
|
+
onChange: z
|
|
324
|
+
}, [
|
|
325
|
+
(r(), d(x, null, U(N, (o) => a("option", {
|
|
326
|
+
key: o,
|
|
327
|
+
value: o
|
|
328
|
+
}, b(o), 9, fe)), 64))
|
|
329
|
+
], 544), [
|
|
330
|
+
[q, T.value]
|
|
331
|
+
]),
|
|
332
|
+
V(a("input", {
|
|
333
|
+
"onUpdate:modelValue": l[2] || (l[2] = (o) => _.value = o),
|
|
334
|
+
type: "text",
|
|
335
|
+
class: "simulator-form__path input",
|
|
336
|
+
placeholder: "/api/path",
|
|
337
|
+
onInput: z
|
|
338
|
+
}, null, 544), [
|
|
339
|
+
[te, _.value]
|
|
340
|
+
])
|
|
341
|
+
]),
|
|
342
|
+
a("div", he, [
|
|
343
|
+
(r(!0), d(x, null, U(u(s).presets, (o) => (r(), d("button", {
|
|
344
|
+
key: o.id,
|
|
345
|
+
class: B([
|
|
346
|
+
"simulator-preset",
|
|
347
|
+
{ "simulator-preset--selected": p.value === o.id },
|
|
348
|
+
`simulator-preset--${o.type}`
|
|
349
|
+
]),
|
|
350
|
+
title: o.description,
|
|
351
|
+
onClick: (m) => p.value = o.id
|
|
352
|
+
}, [
|
|
353
|
+
(r(), O(G(o.type === "delay" ? u(Z) : u(K)), { size: 14 })),
|
|
354
|
+
a("span", Se, b(o.label), 1)
|
|
355
|
+
], 10, _e))), 128))
|
|
356
|
+
]),
|
|
357
|
+
a("button", {
|
|
358
|
+
class: "btn btn--primary",
|
|
359
|
+
disabled: !E.value || u(s).isLoading,
|
|
360
|
+
onClick: M
|
|
361
|
+
}, [
|
|
362
|
+
R(u(ie), { size: 16 }),
|
|
363
|
+
l[6] || (l[6] = a("span", null, "Add Simulation", -1))
|
|
364
|
+
], 8, be)
|
|
365
|
+
])
|
|
366
|
+
]),
|
|
367
|
+
a("div", ge, [
|
|
368
|
+
a("div", Te, [
|
|
369
|
+
a("span", ke, " Active Simulations (" + b(k.value) + ") ", 1),
|
|
370
|
+
k.value > 0 ? (r(), d("button", {
|
|
371
|
+
key: 0,
|
|
372
|
+
class: "btn btn--ghost",
|
|
373
|
+
disabled: u(s).isLoading,
|
|
374
|
+
onClick: L
|
|
375
|
+
}, [
|
|
376
|
+
R(u(j), { size: 14 }),
|
|
377
|
+
l[7] || (l[7] = a("span", null, "Clear All", -1))
|
|
378
|
+
], 8, Ce)) : $("", !0)
|
|
379
|
+
]),
|
|
380
|
+
a("div", Pe, [
|
|
381
|
+
(r(!0), d(x, null, U(H.value, (o) => (r(), d("div", {
|
|
382
|
+
key: o.path,
|
|
383
|
+
class: "simulator-simulation card"
|
|
384
|
+
}, [
|
|
385
|
+
a("div", Ee, [
|
|
386
|
+
a("span", Le, b(o.path), 1)
|
|
387
|
+
]),
|
|
388
|
+
a("div", we, [
|
|
389
|
+
(r(), O(G(o.preset?.type === "delay" ? u(Z) : u(K)), {
|
|
390
|
+
size: 14,
|
|
391
|
+
class: B({
|
|
392
|
+
"text-warning": o.preset?.type === "delay",
|
|
393
|
+
"text-error": o.preset?.type === "error",
|
|
394
|
+
"text-muted": o.preset?.type === "empty"
|
|
395
|
+
})
|
|
396
|
+
}, null, 8, ["class"])),
|
|
397
|
+
a("span", null, b(o.preset?.label || `HTTP ${o.status}`), 1),
|
|
398
|
+
o.delay ? (r(), d("span", Ae, " (" + b(o.delay) + "ms) ", 1)) : $("", !0)
|
|
399
|
+
]),
|
|
400
|
+
a("button", {
|
|
401
|
+
class: "btn btn--ghost btn--icon",
|
|
402
|
+
title: "Remove simulation",
|
|
403
|
+
disabled: u(s).isLoading,
|
|
404
|
+
onClick: (m) => F(o.path)
|
|
405
|
+
}, [
|
|
406
|
+
R(u(j), { size: 14 })
|
|
407
|
+
], 8, Re)
|
|
408
|
+
]))), 128)),
|
|
409
|
+
k.value === 0 ? (r(), d("div", Ie, [
|
|
410
|
+
R(u(W), {
|
|
411
|
+
size: 48,
|
|
412
|
+
class: "empty-state__icon"
|
|
413
|
+
}),
|
|
414
|
+
l[8] || (l[8] = a("h3", { class: "empty-state__title" }, "No active simulations", -1)),
|
|
415
|
+
l[9] || (l[9] = a("p", { class: "empty-state__description" }, " Add a simulation above to test error handling and slow responses. ", -1))
|
|
416
|
+
])) : $("", !0)
|
|
417
|
+
])
|
|
418
|
+
])
|
|
419
|
+
]));
|
|
420
|
+
}
|
|
421
|
+
}), Fe = /* @__PURE__ */ le(Me, [["__scopeId", "data-v-e5fd28b0"]]);
|
|
422
|
+
export {
|
|
423
|
+
Fe as default
|
|
424
|
+
};
|
|
425
|
+
//# sourceMappingURL=SimulatorPage-CzJrwWzc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimulatorPage-CzJrwWzc.js","sources":["../../../node_modules/.pnpm/lucide-vue-next@0.513.0_vue@3.5.27_typescript@5.9.3_/node_modules/lucide-vue-next/dist/esm/icons/plus.js","../src/stores/simulation.ts","../src/pages/SimulatorPage.vue"],"sourcesContent":["/**\n * @license lucide-vue-next v0.513.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Plus = createLucideIcon(\"plus\", [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }]\n]);\n\nexport { Plus as default };\n//# sourceMappingURL=plus.js.map\n","/**\n * Simulation Store\n *\n * What: Pinia store for managing error and delay simulations\n * How: Manages simulation state and communicates with server via WebSocket\n * Why: Enables developers to test error handling and loading states\n *\n * @module stores/simulation\n */\n\nimport { defineStore } from 'pinia';\nimport { computed, ref } from 'vue';\n\n/**\n * Simulation preset type\n */\nexport type SimulationPresetType = 'delay' | 'error' | 'empty';\n\n/**\n * Simulation preset definition\n */\nexport interface SimulationPreset {\n id: string;\n label: string;\n description: string;\n type: SimulationPresetType;\n status: number;\n delay?: number;\n body?: unknown;\n}\n\n/**\n * Active simulation state\n */\nexport interface ActiveSimulation {\n path: string;\n operationId?: string;\n status: number;\n delay?: number;\n body?: unknown;\n presetId?: string;\n}\n\n/**\n * Preset definitions matching PRD FR-104 requirements\n */\nexport const SIMULATION_PRESETS: SimulationPreset[] = [\n {\n id: 'slow-network',\n label: 'Slow Network',\n description: '3000ms delay (3G simulation)',\n type: 'delay',\n status: 200,\n delay: 3000,\n },\n {\n id: 'server-error',\n label: 'Server Error',\n description: 'Returns HTTP 500',\n type: 'error',\n status: 500,\n body: { error: 'Internal Server Error', message: 'Simulated server error' },\n },\n {\n id: 'rate-limit',\n label: 'Rate Limited',\n description: 'Returns HTTP 429',\n type: 'error',\n status: 429,\n body: { error: 'Too Many Requests', message: 'Rate limit exceeded' },\n },\n {\n id: 'not-found',\n label: 'Not Found',\n description: 'Returns HTTP 404',\n type: 'error',\n status: 404,\n body: { error: 'Not Found', message: 'Resource not found' },\n },\n {\n id: 'request-timeout',\n label: 'Request Timeout',\n description: '30000ms delay (simulates timeout)',\n type: 'delay',\n status: 200,\n delay: 30000,\n },\n {\n id: 'empty-response',\n label: 'Empty Response',\n description: 'Returns HTTP 200 with empty body',\n type: 'empty',\n status: 200,\n body: null,\n },\n {\n id: 'unauthorized',\n label: 'Unauthorized',\n description: 'Returns HTTP 401',\n type: 'error',\n status: 401,\n body: { error: 'Unauthorized', message: 'Authentication required' },\n },\n];\n\n/**\n * Simulation store for managing endpoint simulations\n *\n * Provides:\n * - Active simulations storage and retrieval\n * - Preset definitions and lookup\n * - WebSocket command integration\n * - Simulation count and status tracking\n */\nexport const useSimulationStore = defineStore('simulation', () => {\n // ==========================================================================\n // State\n // ==========================================================================\n\n /**\n * Active simulations keyed by path\n * One simulation per path (enforced by Map)\n */\n const simulations = ref<Map<string, ActiveSimulation>>(new Map());\n\n /**\n * Previous simulation state for rollback on failure\n * Keyed by path, stores the simulation before optimistic update\n */\n const previousSimulations = ref<Map<string, ActiveSimulation | null>>(new Map());\n\n /**\n * Loading state for async operations\n */\n const isLoading = ref(false);\n\n /**\n * Error state\n */\n const error = ref<string | null>(null);\n\n // ==========================================================================\n // Getters / Computed\n // ==========================================================================\n\n /**\n * All active simulations as an array\n */\n const activeSimulations = computed(() => {\n return Array.from(simulations.value.values());\n });\n\n /**\n * Count of active simulations\n */\n const count = computed(() => simulations.value.size);\n\n /**\n * Available presets\n */\n const presets = computed(() => SIMULATION_PRESETS);\n\n /**\n * Check if any simulations are active\n */\n const hasActiveSimulations = computed(() => simulations.value.size > 0);\n\n /**\n * Get simulations grouped by type\n */\n const simulationsByType = computed(() => {\n const grouped = {\n delay: [] as ActiveSimulation[],\n error: [] as ActiveSimulation[],\n empty: [] as ActiveSimulation[],\n };\n\n for (const simulation of simulations.value.values()) {\n const type = getSimulationType(simulation);\n grouped[type].push(simulation);\n }\n\n return grouped;\n });\n\n /**\n * Determine simulation type from simulation config\n */\n function getSimulationType(simulation: ActiveSimulation): SimulationPresetType {\n const preset = simulation.presetId\n ? SIMULATION_PRESETS.find((p) => p.id === simulation.presetId)\n : null;\n\n if (preset) {\n return preset.type;\n }\n\n if (simulation.delay && simulation.delay > 0) {\n return 'delay';\n }\n\n if (simulation.body === null) {\n return 'empty';\n }\n\n return 'error';\n }\n\n // ==========================================================================\n // Actions\n // ==========================================================================\n\n /**\n * Set active simulations from server (e.g., on 'simulation:active' event)\n */\n function setSimulations(newSimulations: ActiveSimulation[]): void {\n simulations.value.clear();\n for (const simulation of newSimulations) {\n simulations.value.set(simulation.path, simulation);\n }\n error.value = null;\n }\n\n /**\n * Add a new simulation locally\n * Note: This updates local state only. Use addSimulation() to sync with server.\n * @param storeForRollback - If true, stores previous state for rollback\n */\n function addSimulationLocal(simulation: ActiveSimulation, storeForRollback = false): void {\n if (storeForRollback) {\n // Store previous state (null if didn't exist)\n const previous = simulations.value.get(simulation.path) || null;\n previousSimulations.value.set(simulation.path, previous);\n }\n simulations.value.set(simulation.path, simulation);\n }\n\n /**\n * Remove a simulation locally by path\n * Note: This updates local state only. Use removeSimulation() to sync with server.\n * @param storeForRollback - If true, stores previous state for rollback\n */\n function removeSimulationLocal(path: string, storeForRollback = false): boolean {\n if (storeForRollback) {\n // Store previous state before removing\n const previous = simulations.value.get(path) || null;\n previousSimulations.value.set(path, previous);\n }\n return simulations.value.delete(path);\n }\n\n /**\n * Clear all simulations locally\n * Note: This updates local state only. Use clearSimulations() to sync with server.\n */\n function clearSimulationsLocal(): void {\n simulations.value.clear();\n }\n\n /**\n * Get a simulation by path\n */\n function getSimulation(path: string): ActiveSimulation | undefined {\n return simulations.value.get(path);\n }\n\n /**\n * Check if a simulation exists for a path\n */\n function hasSimulation(path: string): boolean {\n return simulations.value.has(path);\n }\n\n /**\n * Get a preset by ID\n */\n function getPreset(id: string): SimulationPreset | undefined {\n return SIMULATION_PRESETS.find((p) => p.id === id);\n }\n\n /**\n * Create a simulation from a preset\n */\n function createSimulationFromPreset(\n path: string,\n presetId: string,\n operationId?: string,\n ): ActiveSimulation | null {\n const preset = getPreset(presetId);\n if (!preset) {\n error.value = `Preset not found: ${presetId}`;\n return null;\n }\n\n return {\n path,\n operationId,\n status: preset.status,\n delay: preset.delay,\n body: preset.body,\n presetId: preset.id,\n };\n }\n\n /**\n * Set loading state\n */\n function setLoading(loading: boolean): void {\n isLoading.value = loading;\n }\n\n /**\n * Set error state\n */\n function setError(errorMessage: string): void {\n error.value = errorMessage;\n isLoading.value = false;\n }\n\n /**\n * Clear error state\n */\n function clearError(): void {\n error.value = null;\n }\n\n /**\n * Rollback a simulation to its previous state\n * @param path - The path of the simulation to rollback\n */\n function rollbackSimulation(path: string): void {\n if (!previousSimulations.value.has(path)) {\n return;\n }\n\n const previous = previousSimulations.value.get(path);\n if (previous === null || previous === undefined) {\n // Was added optimistically, remove it\n simulations.value.delete(path);\n } else {\n // Restore previous state\n simulations.value.set(path, previous);\n }\n\n // Clear rollback data\n previousSimulations.value.delete(path);\n }\n\n /**\n * Handle simulation:added event from server\n */\n function handleSimulationAdded(data: { path: string }): void {\n // Server will send 'simulation:active' event with full state\n // This event is just a notification\n console.log('[Simulation] Added:', data.path);\n }\n\n /**\n * Handle simulation:removed event from server\n */\n function handleSimulationRemoved(data: { path: string }): void {\n removeSimulationLocal(data.path);\n console.log('[Simulation] Removed:', data.path);\n }\n\n /**\n * Handle simulations:cleared event from server\n */\n function handleSimulationsCleared(data: { count: number }): void {\n clearSimulationsLocal();\n console.log('[Simulation] Cleared all:', data.count);\n }\n\n /**\n * Handle simulation:set response from server\n */\n function handleSimulationSet(data: { path: string; success: boolean }): void {\n if (data.success) {\n // Clear rollback data on success\n previousSimulations.value.delete(data.path);\n console.log('[Simulation] Set successfully:', data.path);\n } else {\n // Rollback optimistic update on failure\n rollbackSimulation(data.path);\n setError(`Failed to set simulation for ${data.path}`);\n }\n setLoading(false);\n }\n\n /**\n * Handle simulation:cleared response from server\n */\n function handleSimulationCleared(data: { path: string; success: boolean }): void {\n if (data.success) {\n // Clear rollback data on success\n previousSimulations.value.delete(data.path);\n console.log('[Simulation] Cleared successfully:', data.path);\n } else {\n // Rollback optimistic removal on failure\n rollbackSimulation(data.path);\n setError(`Failed to clear simulation for ${data.path}`);\n }\n setLoading(false);\n }\n\n // ==========================================================================\n // Return\n // ==========================================================================\n\n return {\n // State\n simulations,\n isLoading,\n error,\n\n // Getters\n activeSimulations,\n count,\n presets,\n hasActiveSimulations,\n simulationsByType,\n\n // Actions\n setSimulations,\n addSimulationLocal,\n removeSimulationLocal,\n clearSimulationsLocal,\n getSimulation,\n hasSimulation,\n getPreset,\n createSimulationFromPreset,\n setLoading,\n setError,\n clearError,\n rollbackSimulation,\n\n // Event handlers\n handleSimulationAdded,\n handleSimulationRemoved,\n handleSimulationsCleared,\n handleSimulationSet,\n handleSimulationCleared,\n };\n});\n","<!--\n SimulatorPage.vue - Error Simulation Controls Page\n\n What: Provides controls for simulating various API error conditions\n How: Manages simulation state via simulation store and WebSocket commands\n Why: Allows developers to test error handling without modifying backend code\n-->\n\n<script setup lang=\"ts\">\nimport { AlertTriangle, Clock, Plus, Trash2, Zap } from 'lucide-vue-next';\nimport { computed, onMounted, onUnmounted, ref } from 'vue';\nimport { useWebSocket } from '../composables/useWebSocket';\nimport { useRegistryStore } from '../stores/registry';\nimport type { ActiveSimulation } from '../stores/simulation';\nimport { useSimulationStore } from '../stores/simulation';\n\n// ==========================================================================\n// Types\n// ==========================================================================\n\ninterface SimulationActiveEvent {\n simulations: ActiveSimulation[];\n}\n\ninterface SimulationPathEvent {\n path: string;\n}\n\ninterface SimulationsClearedEvent {\n count: number;\n}\n\ninterface SimulationSetEvent {\n path: string;\n success: boolean;\n}\n\ninterface SimulationClearedEvent {\n path: string;\n success: boolean;\n}\n\n// ==========================================================================\n// Composables\n// ==========================================================================\n\nconst simulationStore = useSimulationStore();\nconst registryStore = useRegistryStore();\nconst { send, on } = useWebSocket();\n\n// ==========================================================================\n// State\n// ==========================================================================\n\n/** Path input for new simulation */\nconst newSimulationPath = ref('');\n\n/** Method input for new simulation */\nconst newSimulationMethod = ref('GET');\n\n/** Selected preset ID */\nconst selectedPresetId = ref<string | null>(null);\n\n/** Selected endpoint key (for dropdown selection) */\nconst selectedEndpointKey = ref<string | null>(null);\n\n/** Available HTTP methods */\nconst httpMethods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS', 'HEAD'];\n\n/** WebSocket event unsubscribe functions (populated in onMounted) */\nlet unsubscribers: Array<() => void> = [];\n\n/** Simulations pending clear (for rollback on partial failures) */\nconst pendingClears = ref<Set<string>>(new Set());\n\n// ==========================================================================\n// Computed\n// ==========================================================================\n\n/**\n * Available endpoints for selection\n */\nconst availableEndpoints = computed(() => {\n return registryStore.endpoints.map((e) => ({\n key: e.key,\n label: `${e.method.toUpperCase()} ${e.path}`,\n method: e.method.toUpperCase(),\n path: e.path,\n operationId: e.operationId,\n }));\n});\n\n/**\n * Check if we can add a new simulation\n */\nconst canAddSimulation = computed(() => {\n const hasPath = newSimulationPath.value.trim() !== '';\n const hasPreset = selectedPresetId.value !== null;\n return hasPath && hasPreset;\n});\n\n/**\n * Active simulations for display\n */\nconst activeSimulations = computed(() => {\n return simulationStore.activeSimulations.map((sim) => {\n const preset = sim.presetId ? simulationStore.getPreset(sim.presetId) : null;\n return {\n ...sim,\n preset,\n };\n });\n});\n\n/**\n * Simulation count\n */\nconst simulationCount = computed(() => simulationStore.count);\n\n// ==========================================================================\n// Methods\n// ==========================================================================\n\n/**\n * Add a new simulation\n */\nfunction addSimulation(): void {\n if (!canAddSimulation.value || !selectedPresetId.value) return;\n\n const preset = simulationStore.getPreset(selectedPresetId.value);\n if (!preset) return;\n\n // Validate path input\n const trimmedPath = newSimulationPath.value.trim();\n\n // Path must start with /\n if (!trimmedPath.startsWith('/')) {\n simulationStore.setError('Path must start with /');\n return;\n }\n\n // Path must not be too long (reasonable limit)\n if (trimmedPath.length > 500) {\n simulationStore.setError('Path is too long (max 500 characters)');\n return;\n }\n\n // Path should only contain valid URL path characters\n if (!/^\\/[\\w\\-/{}:.]*$/.test(trimmedPath)) {\n simulationStore.setError('Path contains invalid characters');\n return;\n }\n\n // Combine method and path to create endpoint key (e.g., \"get:/pets\")\n const pathWithMethod = `${newSimulationMethod.value.toLowerCase()}:${trimmedPath}`;\n const simulation = simulationStore.createSimulationFromPreset(\n pathWithMethod,\n selectedPresetId.value,\n undefined,\n );\n\n if (!simulation) return;\n\n // Optimistically add to local state (store previous state for rollback)\n simulationStore.addSimulationLocal(simulation, true);\n simulationStore.setLoading(true);\n\n // Send command to server\n send({\n type: 'set:simulation',\n data: {\n path: simulation.path,\n status: simulation.status,\n delay: simulation.delay,\n body: simulation.body,\n },\n });\n\n // Reset form\n newSimulationPath.value = '';\n selectedPresetId.value = null;\n selectedEndpointKey.value = null;\n}\n\n/**\n * Remove an active simulation\n */\nfunction removeSimulation(path: string): void {\n // Optimistically remove from local state (store previous state for rollback)\n simulationStore.removeSimulationLocal(path, true);\n simulationStore.setLoading(true);\n\n // Send command to server\n send({\n type: 'clear:simulation',\n data: { path },\n });\n}\n\n/**\n * Clear all simulations\n */\nfunction clearAllSimulations(): void {\n if (simulationCount.value === 0) return;\n\n // Mark each simulation as pending clear and store for rollback\n for (const simulation of simulationStore.activeSimulations) {\n pendingClears.value.add(simulation.path);\n\n // Store previous state for rollback\n simulationStore.removeSimulationLocal(simulation.path, true);\n\n // Send clear command to server\n send({\n type: 'clear:simulation',\n data: { path: simulation.path },\n });\n }\n\n simulationStore.setLoading(true);\n\n // Note: Individual simulations will be removed from local state\n // only when we receive the corresponding \"simulation:cleared\" event\n // with success: true. Failed clears will be rolled back automatically.\n}\n\n/**\n * Handle endpoint selection from dropdown\n */\nfunction handleEndpointSelect(): void {\n if (!selectedEndpointKey.value) return;\n\n const endpoint = registryStore.endpoints.find((e) => e.key === selectedEndpointKey.value);\n if (!endpoint) return;\n\n newSimulationMethod.value = endpoint.method.toUpperCase();\n newSimulationPath.value = endpoint.path;\n}\n\n/**\n * Handle manual path/method input\n */\nfunction handleManualInput(): void {\n // Clear endpoint selection when user types manually\n selectedEndpointKey.value = null;\n}\n\n// ==========================================================================\n// Lifecycle\n// ==========================================================================\n\nonMounted(() => {\n // Subscribe to simulation events and collect unsubscribe functions\n unsubscribers = [\n on('simulation:active', (data: SimulationActiveEvent) => {\n simulationStore.setSimulations(data.simulations);\n }),\n\n on('simulation:added', (data: SimulationPathEvent) => {\n simulationStore.handleSimulationAdded(data);\n }),\n\n on('simulation:removed', (data: SimulationPathEvent) => {\n simulationStore.handleSimulationRemoved(data);\n }),\n\n on('simulations:cleared', (data: SimulationsClearedEvent) => {\n simulationStore.handleSimulationsCleared(data);\n }),\n\n on('simulation:set', (data: SimulationSetEvent) => {\n simulationStore.handleSimulationSet(data);\n }),\n\n on('simulation:cleared', (data: SimulationClearedEvent) => {\n // Remove from pending clears if it was part of clearAll\n if (pendingClears.value.has(data.path)) {\n pendingClears.value.delete(data.path);\n }\n\n // Delegate to store handler (handles success/failure and rollback)\n simulationStore.handleSimulationCleared(data);\n }),\n ];\n\n // Request current simulations from server\n send({ type: 'get:registry' });\n});\n\n// Cleanup on unmount to prevent memory leaks\nonUnmounted(() => {\n for (const unsub of unsubscribers) {\n unsub();\n }\n});\n</script>\n\n<template>\n <div class=\"simulator-page\">\n <!-- Add Simulation Form -->\n <div class=\"simulator-form card\">\n <div class=\"simulator-form__header\">\n <Zap :size=\"18\" />\n <span>Add Simulation</span>\n </div>\n\n <div class=\"simulator-form__body\">\n <!-- Endpoint Selector (optional) -->\n <div v-if=\"availableEndpoints.length > 0\" class=\"simulator-form__row\">\n <label class=\"simulator-form__label\">Select Endpoint (optional):</label>\n <select\n v-model=\"selectedEndpointKey\"\n class=\"input\"\n @change=\"handleEndpointSelect\"\n >\n <option :value=\"null\">Manual entry...</option>\n <option\n v-for=\"endpoint in availableEndpoints\"\n :key=\"endpoint.key\"\n :value=\"endpoint.key\"\n >\n {{ endpoint.label }}\n </option>\n </select>\n </div>\n\n <!-- Method and Path -->\n <div class=\"simulator-form__row\">\n <select\n v-model=\"newSimulationMethod\"\n class=\"simulator-form__method input\"\n @change=\"handleManualInput\"\n >\n <option v-for=\"method in httpMethods\" :key=\"method\" :value=\"method\">\n {{ method }}\n </option>\n </select>\n <input\n v-model=\"newSimulationPath\"\n type=\"text\"\n class=\"simulator-form__path input\"\n placeholder=\"/api/path\"\n @input=\"handleManualInput\"\n />\n </div>\n\n <!-- Preset Selection -->\n <div class=\"simulator-presets\">\n <button\n v-for=\"preset in simulationStore.presets\"\n :key=\"preset.id\"\n :class=\"[\n 'simulator-preset',\n { 'simulator-preset--selected': selectedPresetId === preset.id },\n `simulator-preset--${preset.type}`,\n ]\"\n :title=\"preset.description\"\n @click=\"selectedPresetId = preset.id\"\n >\n <component\n :is=\"preset.type === 'delay' ? Clock : AlertTriangle\"\n :size=\"14\"\n />\n <span class=\"simulator-preset__label\">{{ preset.label }}</span>\n </button>\n </div>\n\n <!-- Add Button -->\n <button\n class=\"btn btn--primary\"\n :disabled=\"!canAddSimulation || simulationStore.isLoading\"\n @click=\"addSimulation\"\n >\n <Plus :size=\"16\" />\n <span>Add Simulation</span>\n </button>\n </div>\n </div>\n\n <!-- Active Simulations -->\n <div class=\"simulator-active\">\n <div class=\"simulator-active__header\">\n <span class=\"simulator-active__title\">\n Active Simulations ({{ simulationCount }})\n </span>\n <button\n v-if=\"simulationCount > 0\"\n class=\"btn btn--ghost\"\n :disabled=\"simulationStore.isLoading\"\n @click=\"clearAllSimulations\"\n >\n <Trash2 :size=\"14\" />\n <span>Clear All</span>\n </button>\n </div>\n\n <div class=\"simulator-active__list\">\n <div\n v-for=\"simulation in activeSimulations\"\n :key=\"simulation.path\"\n class=\"simulator-simulation card\"\n >\n <div class=\"simulator-simulation__info\">\n <span class=\"simulator-simulation__path font-mono\">\n {{ simulation.path }}\n </span>\n </div>\n <div class=\"simulator-simulation__preset\">\n <component\n :is=\"simulation.preset?.type === 'delay' ? Clock : AlertTriangle\"\n :size=\"14\"\n :class=\"{\n 'text-warning': simulation.preset?.type === 'delay',\n 'text-error': simulation.preset?.type === 'error',\n 'text-muted': simulation.preset?.type === 'empty',\n }\"\n />\n <span>\n {{ simulation.preset?.label || `HTTP ${simulation.status}` }}\n </span>\n <span v-if=\"simulation.delay\" class=\"text-muted\">\n ({{ simulation.delay }}ms)\n </span>\n </div>\n <button\n class=\"btn btn--ghost btn--icon\"\n title=\"Remove simulation\"\n :disabled=\"simulationStore.isLoading\"\n @click=\"removeSimulation(simulation.path)\"\n >\n <Trash2 :size=\"14\" />\n </button>\n </div>\n\n <!-- Empty State -->\n <div v-if=\"simulationCount === 0\" class=\"empty-state\">\n <Zap :size=\"48\" class=\"empty-state__icon\" />\n <h3 class=\"empty-state__title\">No active simulations</h3>\n <p class=\"empty-state__description\">\n Add a simulation above to test error handling and slow responses.\n </p>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<style scoped>\n.simulator-page {\n display: flex;\n flex-direction: column;\n gap: var(--devtools-space-lg);\n height: 100%;\n padding: var(--devtools-space-md);\n overflow-y: auto;\n}\n\n/* Form */\n.simulator-form {\n flex-shrink: 0;\n}\n\n.simulator-form__header {\n display: flex;\n align-items: center;\n gap: var(--devtools-space-sm);\n padding-bottom: var(--devtools-space-md);\n margin-bottom: var(--devtools-space-md);\n border-bottom: 1px solid var(--devtools-border);\n font-weight: var(--font-weight-6);\n font-size: var(--font-size-1);\n}\n\n.simulator-form__body {\n display: flex;\n flex-direction: column;\n gap: var(--devtools-space-md);\n}\n\n.simulator-form__row {\n display: flex;\n flex-direction: column;\n gap: var(--devtools-space-xs);\n}\n\n.simulator-form__row:has(.simulator-form__method) {\n flex-direction: row;\n gap: var(--devtools-space-sm);\n}\n\n.simulator-form__label {\n font-size: var(--font-size-0);\n font-weight: var(--font-weight-5);\n color: var(--devtools-text);\n}\n\n.simulator-form__method {\n width: 100px;\n flex-shrink: 0;\n}\n\n.simulator-form__path {\n flex: 1;\n}\n\n/* Presets */\n.simulator-presets {\n display: flex;\n flex-wrap: wrap;\n gap: var(--devtools-space-xs);\n}\n\n.simulator-preset {\n display: inline-flex;\n align-items: center;\n gap: var(--devtools-space-xs);\n padding: var(--devtools-space-xs) var(--devtools-space-sm);\n background-color: var(--devtools-surface-elevated);\n border: 1px solid var(--devtools-border);\n border-radius: var(--devtools-radius-sm);\n font-family: var(--devtools-font-sans);\n font-size: var(--font-size-0);\n cursor: pointer;\n transition: all var(--devtools-transition-fast);\n}\n\n.simulator-preset:hover {\n background-color: var(--devtools-border);\n}\n\n.simulator-preset--selected {\n border-color: var(--devtools-primary);\n background-color: color-mix(\n in srgb,\n var(--devtools-primary) 15%,\n transparent\n );\n}\n\n.simulator-preset--delay {\n color: var(--devtools-warning);\n}\n\n.simulator-preset--error {\n color: var(--devtools-error);\n}\n\n.simulator-preset--empty {\n color: var(--devtools-text-muted);\n}\n\n.simulator-preset__label {\n color: var(--devtools-text);\n}\n\n/* Active Simulations */\n.simulator-active {\n flex: 1;\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n.simulator-active__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: var(--devtools-space-md);\n}\n\n.simulator-active__title {\n font-weight: var(--font-weight-6);\n font-size: var(--font-size-1);\n}\n\n.simulator-active__list {\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: var(--devtools-space-xs);\n}\n\n/* Simulation Item */\n.simulator-simulation {\n display: flex;\n align-items: center;\n gap: var(--devtools-space-md);\n padding: var(--devtools-space-sm) var(--devtools-space-md);\n}\n\n.simulator-simulation__info {\n display: flex;\n align-items: center;\n gap: var(--devtools-space-sm);\n flex: 1;\n}\n\n.simulator-simulation__path {\n font-size: var(--font-size-1);\n color: var(--devtools-text);\n}\n\n.simulator-simulation__preset {\n display: flex;\n align-items: center;\n gap: var(--devtools-space-xs);\n font-size: var(--font-size-0);\n color: var(--devtools-text-muted);\n}\n\n/* Color utilities */\n.text-warning {\n color: var(--devtools-warning);\n}\n\n.text-error {\n color: var(--devtools-error);\n}\n\n.text-muted {\n color: var(--devtools-text-muted);\n}\n</style>\n"],"names":["Plus","createLucideIcon","SIMULATION_PRESETS","useSimulationStore","defineStore","simulations","ref","previousSimulations","isLoading","error","activeSimulations","computed","count","presets","hasActiveSimulations","simulationsByType","grouped","simulation","type","getSimulationType","preset","p","setSimulations","newSimulations","addSimulationLocal","storeForRollback","previous","removeSimulationLocal","path","clearSimulationsLocal","getSimulation","hasSimulation","getPreset","id","createSimulationFromPreset","presetId","operationId","setLoading","loading","setError","errorMessage","clearError","rollbackSimulation","handleSimulationAdded","data","handleSimulationRemoved","handleSimulationsCleared","handleSimulationSet","handleSimulationCleared","simulationStore","registryStore","useRegistryStore","send","on","useWebSocket","newSimulationPath","newSimulationMethod","selectedPresetId","selectedEndpointKey","httpMethods","unsubscribers","pendingClears","availableEndpoints","e","canAddSimulation","hasPath","hasPreset","sim","simulationCount","addSimulation","trimmedPath","pathWithMethod","removeSimulation","clearAllSimulations","handleEndpointSelect","endpoint","handleManualInput","onMounted","onUnmounted","unsub","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_createVNode","_unref","Zap","_cache","_hoisted_4","_hoisted_5","$event","_Fragment","_renderList","_toDisplayString","_hoisted_6","_hoisted_7","method","_hoisted_8","_hoisted_9","_normalizeClass","_createBlock","_resolveDynamicComponent","Clock","AlertTriangle","_hoisted_11","_hoisted_13","_hoisted_14","_hoisted_15","Trash2","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_23"],"mappings":";;;;;;AASA,MAAMA,KAAOC,GAAiB,QAAQ;AAAA,EACpC,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAC3C,CAAC,GCkCYC,IAAyC;AAAA,EACpD;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM,EAAE,OAAO,yBAAyB,SAAS,yBAAA;AAAA,EAAyB;AAAA,EAE5E;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,I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AAA,IAAAN,EAEI,KAAA,EAFD,OAAM,8BAA2B,uEAEpC,EAAA;AAAA,UAAA;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { ref as T, computed as v, defineComponent as ue, createElementBlock as u, openBlock as o, createVNode as x, createElementVNode as e, unref as a, normalizeClass as R, toDisplayString as c, createCommentVNode as k, createTextVNode as A, createBlock as $, resolveDynamicComponent as S, withDirectives as V, Fragment as M, renderList as j, vShow as W, withModifiers as
|
|
2
|
-
import { g as
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ref as T, computed as v, defineComponent as ue, createElementBlock as u, openBlock as o, createVNode as x, createElementVNode as e, unref as a, normalizeClass as R, toDisplayString as c, createCommentVNode as k, createTextVNode as A, createBlock as $, resolveDynamicComponent as S, withDirectives as V, Fragment as M, renderList as j, vShow as W, withModifiers as ce, onMounted as pe, onUnmounted as he, watch as ge } from "vue";
|
|
2
|
+
import { g as _e, C as N, a as Z, S as me, F as be, b as xe } from "./format-lBEBG5Y6.js";
|
|
3
|
+
import { c as fe, C as P, Z as ve, _ as de, u as ke } from "./main-DKt7pJsx.js";
|
|
4
|
+
import { C as oe } from "./check-BLIoatWd.js";
|
|
5
|
+
import { T as qe } from "./triangle-alert-gLhIcFT5.js";
|
|
6
|
+
import { defineStore as Ce } from "pinia";
|
|
7
|
+
import { X as ye } from "./x-UqfnjULc.js";
|
|
8
|
+
import { T as $e } from "./trash-2-RxS9jzWT.js";
|
|
9
|
+
const Se = fe("circle-check-big", [
|
|
8
10
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
9
11
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
10
12
|
]);
|
|
11
|
-
const re =
|
|
13
|
+
const re = fe("copy", [
|
|
12
14
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
13
15
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
14
|
-
]), Te =
|
|
16
|
+
]), Te = Ce("timeline", () => {
|
|
15
17
|
const n = T([]), s = T(!1), r = T(null), d = T({
|
|
16
18
|
methods: [],
|
|
17
19
|
statusCodes: [],
|
|
@@ -324,7 +326,7 @@ const re = de("copy", [
|
|
|
324
326
|
e("div", Re, [
|
|
325
327
|
e("span", {
|
|
326
328
|
class: R(["method-badge", `method-badge--${n.entry.request.method.toLowerCase()}`])
|
|
327
|
-
}, c(a(
|
|
329
|
+
}, c(a(_e)(n.entry.request.method)), 3),
|
|
328
330
|
e("span", ze, c(n.entry.request.path), 1)
|
|
329
331
|
]),
|
|
330
332
|
e("div", Oe, [
|
|
@@ -433,7 +435,7 @@ const re = de("copy", [
|
|
|
433
435
|
type: "button",
|
|
434
436
|
class: "btn btn--ghost btn--icon btn--sm",
|
|
435
437
|
title: "Copy body",
|
|
436
|
-
onClick: l[3] || (l[3] =
|
|
438
|
+
onClick: l[3] || (l[3] = ce((f) => L(D(n.entry.request.body), "reqBody"), ["stop"]))
|
|
437
439
|
}, [
|
|
438
440
|
(o(), $(S(d.value === "reqBody" ? a(oe) : a(re)), { size: 12 }))
|
|
439
441
|
])
|
|
@@ -487,7 +489,7 @@ const re = de("copy", [
|
|
|
487
489
|
type: "button",
|
|
488
490
|
class: "btn btn--ghost btn--icon btn--sm",
|
|
489
491
|
title: "Copy body",
|
|
490
|
-
onClick: l[6] || (l[6] =
|
|
492
|
+
onClick: l[6] || (l[6] = ce((f) => L(D(n.entry.response.body), "resBody"), ["stop"]))
|
|
491
493
|
}, [
|
|
492
494
|
(o(), $(S(d.value === "resBody" ? a(oe) : a(re)), { size: 12 }))
|
|
493
495
|
])
|
|
@@ -518,7 +520,7 @@ const re = de("copy", [
|
|
|
518
520
|
]))
|
|
519
521
|
]));
|
|
520
522
|
}
|
|
521
|
-
}), $t = /* @__PURE__ */
|
|
523
|
+
}), $t = /* @__PURE__ */ de(Ct, [["__scopeId", "data-v-b4bdd2d2"]]), St = { class: "timeline-entry__time font-mono text-muted" }, Tt = { class: "timeline-entry__method" }, Bt = { class: "timeline-entry__path font-mono" }, wt = { class: "timeline-entry__status" }, Et = {
|
|
522
524
|
key: 1,
|
|
523
525
|
class: "status-badge status-badge--pending"
|
|
524
526
|
}, It = { class: "timeline-entry__duration font-mono text-muted" }, Rt = {
|
|
@@ -557,7 +559,7 @@ const re = de("copy", [
|
|
|
557
559
|
e("div", Tt, [
|
|
558
560
|
e("span", {
|
|
559
561
|
class: R(["method-badge", `method-badge--${n.entry.request.method.toLowerCase()}`])
|
|
560
|
-
}, c(a(
|
|
562
|
+
}, c(a(_e)(n.entry.request.method)), 3)
|
|
561
563
|
]),
|
|
562
564
|
e("div", Bt, c(n.entry.request.path), 1),
|
|
563
565
|
e("div", wt, [
|
|
@@ -578,7 +580,7 @@ const re = de("copy", [
|
|
|
578
580
|
])) : k("", !0)
|
|
579
581
|
], 2));
|
|
580
582
|
}
|
|
581
|
-
}), Ot = /* @__PURE__ */
|
|
583
|
+
}), Ot = /* @__PURE__ */ de(zt, [["__scopeId", "data-v-a073dbdf"]]), Dt = { class: "timeline-page" }, Ft = { class: "timeline-toolbar" }, Ht = { class: "timeline-search" }, Qt = ["value"], Lt = ["aria-expanded"], Mt = {
|
|
582
584
|
key: 0,
|
|
583
585
|
class: "timeline-filter-toggle__badge"
|
|
584
586
|
}, At = { class: "timeline-stats" }, Nt = { class: "timeline-stats__item" }, jt = {
|
|
@@ -679,7 +681,7 @@ const re = de("copy", [
|
|
|
679
681
|
}), (y, _) => (o(), u("div", Dt, [
|
|
680
682
|
e("div", Ft, [
|
|
681
683
|
e("div", Ht, [
|
|
682
|
-
x(a(
|
|
684
|
+
x(a(me), {
|
|
683
685
|
size: 16,
|
|
684
686
|
class: "timeline-search__icon"
|
|
685
687
|
}),
|
|
@@ -699,7 +701,7 @@ const re = de("copy", [
|
|
|
699
701
|
title: "Clear search",
|
|
700
702
|
onClick: l
|
|
701
703
|
}, [
|
|
702
|
-
x(a(
|
|
704
|
+
x(a(ye), { size: 14 })
|
|
703
705
|
])) : k("", !0)
|
|
704
706
|
]),
|
|
705
707
|
e("button", {
|
|
@@ -728,7 +730,7 @@ const re = de("copy", [
|
|
|
728
730
|
disabled: a(s).entries.length === 0,
|
|
729
731
|
onClick: L
|
|
730
732
|
}, [
|
|
731
|
-
x(a(
|
|
733
|
+
x(a($e), { size: 16 })
|
|
732
734
|
], 8, Ut)
|
|
733
735
|
]),
|
|
734
736
|
g.value ? (o(), u("div", Jt, [
|
|
@@ -784,7 +786,7 @@ const re = de("copy", [
|
|
|
784
786
|
class: "btn btn--ghost",
|
|
785
787
|
onClick: G
|
|
786
788
|
}, [
|
|
787
|
-
x(a(
|
|
789
|
+
x(a(ye), { size: 14 }),
|
|
788
790
|
_[4] || (_[4] = A(" Clear all filters ", -1))
|
|
789
791
|
])
|
|
790
792
|
])) : k("", !0)
|
|
@@ -808,7 +810,7 @@ const re = de("copy", [
|
|
|
808
810
|
_[6] || (_[6] = e("h3", { class: "empty-state__title" }, "No requests yet", -1)),
|
|
809
811
|
_[7] || (_[7] = e("p", { class: "empty-state__description" }, " API requests will appear here in real-time as they are made. ", -1))
|
|
810
812
|
])) : a(s).filteredEntries.length === 0 ? (o(), u("div", rs, [
|
|
811
|
-
x(a(
|
|
813
|
+
x(a(me), {
|
|
812
814
|
size: 48,
|
|
813
815
|
class: "empty-state__icon"
|
|
814
816
|
}),
|
|
@@ -840,8 +842,8 @@ const re = de("copy", [
|
|
|
840
842
|
])
|
|
841
843
|
]));
|
|
842
844
|
}
|
|
843
|
-
}),
|
|
845
|
+
}), xs = /* @__PURE__ */ de(ms, [["__scopeId", "data-v-a5c73778"]]);
|
|
844
846
|
export {
|
|
845
|
-
|
|
847
|
+
xs as default
|
|
846
848
|
};
|
|
847
|
-
//# sourceMappingURL=TimelinePage-
|
|
849
|
+
//# sourceMappingURL=TimelinePage-HGh13pF3.js.map
|