@websublime/vite-plugin-open-api-devtools 0.8.0 → 0.8.2
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-DgFhUiBH.js +750 -0
- package/dist/ModelsPage-DgFhUiBH.js.map +1 -0
- package/dist/{RoutesPage-DJQFqkO5.js → RoutesPage-DpasQCnt.js} +4 -4
- package/dist/{RoutesPage-DJQFqkO5.js.map → RoutesPage-DpasQCnt.js.map} +1 -1
- package/dist/{SimulatorPage-DAwHHeu0.js → SimulatorPage-CDTgl8ax.js} +154 -149
- package/dist/SimulatorPage-CDTgl8ax.js.map +1 -0
- package/dist/{TimelinePage-DdznQBTd.js → TimelinePage-CLlD6uZ8.js} +7 -7
- package/dist/{TimelinePage-DdznQBTd.js.map → TimelinePage-CLlD6uZ8.js.map} +1 -1
- package/dist/{check-CZ-YsL8n.js → check-D8w72KaI.js} +2 -2
- package/dist/{check-CZ-YsL8n.js.map → check-D8w72KaI.js.map} +1 -1
- package/dist/devtools.css +1 -1
- package/dist/devtools.js +1 -1
- package/dist/devtools.umd.cjs +3 -3
- package/dist/devtools.umd.cjs.map +1 -1
- package/dist/{format-xvYNYz8d.js → format-Bs9S93C7.js} +2 -2
- package/dist/{format-xvYNYz8d.js.map → format-Bs9S93C7.js.map} +1 -1
- package/dist/{main-C-2gO_cM.js → main-DUNgny3E.js} +6 -6
- package/dist/{main-C-2gO_cM.js.map → main-DUNgny3E.js.map} +1 -1
- package/dist/spa/assets/ModelsPage-BslYlawu.css +1 -0
- package/dist/spa/assets/ModelsPage-Ef8Z_K5t.js +4 -0
- package/dist/spa/assets/ModelsPage-Ef8Z_K5t.js.map +1 -0
- package/dist/spa/assets/{RoutesPage-DVkEOssu.js → RoutesPage-Rs-CBlOu.js} +2 -2
- package/dist/spa/assets/{RoutesPage-DVkEOssu.js.map → RoutesPage-Rs-CBlOu.js.map} +1 -1
- package/dist/spa/assets/SimulatorPage-CNh6VflM.js +2 -0
- package/dist/spa/assets/SimulatorPage-CNh6VflM.js.map +1 -0
- package/dist/spa/assets/SimulatorPage-DGEq_rzM.css +1 -0
- package/dist/spa/assets/{TimelinePage-C_LK2wKS.js → TimelinePage-2YaDXdDB.js} +2 -2
- package/dist/spa/assets/{TimelinePage-C_LK2wKS.js.map → TimelinePage-2YaDXdDB.js.map} +1 -1
- package/dist/spa/assets/check-CLk5nWxQ.js +2 -0
- package/dist/spa/assets/{check-B_DaLrgB.js.map → check-CLk5nWxQ.js.map} +1 -1
- package/dist/spa/assets/{format-r8dlo_ab.js → format-YtVMCGJx.js} +2 -2
- package/dist/spa/assets/{format-r8dlo_ab.js.map → format-YtVMCGJx.js.map} +1 -1
- package/dist/spa/assets/index-BSvrS_tt.css +1 -0
- package/dist/spa/assets/{index-Dff2RvrN.js → index-sPgNGnaU.js} +3 -3
- package/dist/spa/assets/{index-Dff2RvrN.js.map → index-sPgNGnaU.js.map} +1 -1
- package/dist/spa/assets/{trash-2-6KJWHoOC.js → trash-2-DCsOAZPr.js} +2 -2
- package/dist/spa/assets/{trash-2-6KJWHoOC.js.map → trash-2-DCsOAZPr.js.map} +1 -1
- package/dist/spa/assets/{triangle-alert-Dx8lMHrF.js → triangle-alert-DD8Mz05K.js} +2 -2
- package/dist/spa/assets/{triangle-alert-Dx8lMHrF.js.map → triangle-alert-DD8Mz05K.js.map} +1 -1
- package/dist/spa/assets/x-5pbhNHo3.js +2 -0
- package/dist/spa/assets/{x-B6bG8oob.js.map → x-5pbhNHo3.js.map} +1 -1
- package/dist/spa/index.html +2 -2
- package/dist/{trash-2-BiCAm7lq.js → trash-2-BaiQpXqE.js} +2 -2
- package/dist/{trash-2-BiCAm7lq.js.map → trash-2-BaiQpXqE.js.map} +1 -1
- package/dist/{triangle-alert-C8PD5_Zo.js → triangle-alert-CIaC9iQP.js} +2 -2
- package/dist/{triangle-alert-C8PD5_Zo.js.map → triangle-alert-CIaC9iQP.js.map} +1 -1
- package/dist/{x-Boe7tiDp.js → x-BI73Bc0z.js} +2 -2
- package/dist/{x-Boe7tiDp.js.map → x-BI73Bc0z.js.map} +1 -1
- package/package.json +14 -14
- package/dist/ModelsPage-DEKnJYaY.js +0 -629
- package/dist/ModelsPage-DEKnJYaY.js.map +0 -1
- package/dist/SimulatorPage-DAwHHeu0.js.map +0 -1
- package/dist/spa/assets/ModelsPage-DQN_XP0u.css +0 -1
- package/dist/spa/assets/ModelsPage-Dlw4slrw.js +0 -4
- package/dist/spa/assets/ModelsPage-Dlw4slrw.js.map +0 -1
- package/dist/spa/assets/SimulatorPage-B1voZDRi.css +0 -1
- package/dist/spa/assets/SimulatorPage-C2EEtkx8.js +0 -2
- package/dist/spa/assets/SimulatorPage-C2EEtkx8.js.map +0 -1
- package/dist/spa/assets/check-B_DaLrgB.js +0 -2
- package/dist/spa/assets/index-CFIFFTBf.css +0 -1
- package/dist/spa/assets/x-B6bG8oob.js +0 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { defineStore as
|
|
5
|
-
import { T as
|
|
6
|
-
import { T as
|
|
7
|
-
const
|
|
1
|
+
import { ref as f, computed as h, defineComponent as X, onMounted as Y, onUnmounted as ee, watch as te, createElementBlock as d, openBlock as r, createElementVNode as a, createVNode as I, unref as u, createCommentVNode as x, withDirectives as q, Fragment as U, renderList as N, toDisplayString as g, vModelSelect as O, vModelText as oe, normalizeClass as G, createBlock as W, resolveDynamicComponent as Z } from "vue";
|
|
2
|
+
import { c as se, u as le, Z as K, C as j, _ as ae } from "./main-DUNgny3E.js";
|
|
3
|
+
import { u as ne } from "./registry-BQhccWMq.js";
|
|
4
|
+
import { defineStore as ie } from "pinia";
|
|
5
|
+
import { T as J } from "./triangle-alert-CIaC9iQP.js";
|
|
6
|
+
import { T as Q } from "./trash-2-BaiQpXqE.js";
|
|
7
|
+
const re = se("plus", [
|
|
8
8
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
9
9
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
10
|
-
]),
|
|
10
|
+
]), B = [
|
|
11
11
|
{
|
|
12
12
|
id: "slow-network",
|
|
13
13
|
label: "Slow Network",
|
|
@@ -64,37 +64,37 @@ const ie = oe("plus", [
|
|
|
64
64
|
status: 401,
|
|
65
65
|
body: { error: "Unauthorized", message: "Authentication required" }
|
|
66
66
|
}
|
|
67
|
-
],
|
|
68
|
-
const i =
|
|
67
|
+
], ue = ie("simulation", () => {
|
|
68
|
+
const i = f(/* @__PURE__ */ new Map()), s = f(/* @__PURE__ */ new Map()), T = f(!1), c = f(null), y = h(() => Array.from(i.value.values())), L = h(() => i.value.size), _ = h(() => B), k = h(() => i.value.size > 0), p = h(() => {
|
|
69
69
|
const e = {
|
|
70
70
|
delay: [],
|
|
71
71
|
error: [],
|
|
72
72
|
empty: []
|
|
73
73
|
};
|
|
74
74
|
for (const n of i.value.values()) {
|
|
75
|
-
const v =
|
|
75
|
+
const v = S(n);
|
|
76
76
|
e[v].push(n);
|
|
77
77
|
}
|
|
78
78
|
return e;
|
|
79
79
|
});
|
|
80
|
-
function
|
|
81
|
-
const n = e.presetId ?
|
|
80
|
+
function S(e) {
|
|
81
|
+
const n = e.presetId ? B.find((v) => v.id === e.presetId) : null;
|
|
82
82
|
return n ? n.type : e.delay && e.delay > 0 ? "delay" : e.body === null ? "empty" : "error";
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function H(e) {
|
|
85
85
|
i.value.clear();
|
|
86
86
|
for (const n of e)
|
|
87
87
|
i.value.set(n.path, n);
|
|
88
88
|
c.value = null;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function M(e, n = !1) {
|
|
91
91
|
if (n) {
|
|
92
92
|
const v = i.value.get(e.path) || null;
|
|
93
93
|
s.value.set(e.path, v);
|
|
94
94
|
}
|
|
95
95
|
i.value.set(e.path, e);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function C(e, n = !1) {
|
|
98
98
|
if (n) {
|
|
99
99
|
const v = i.value.get(e) || null;
|
|
100
100
|
s.value.set(e, v);
|
|
@@ -104,119 +104,119 @@ const ie = oe("plus", [
|
|
|
104
104
|
function E() {
|
|
105
105
|
i.value.clear();
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function z(e) {
|
|
108
108
|
return i.value.get(e);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function F(e) {
|
|
111
111
|
return i.value.has(e);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
113
|
+
function b(e) {
|
|
114
|
+
return B.find((n) => n.id === e);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
return
|
|
116
|
+
function V(e, n, v) {
|
|
117
|
+
const R = b(n);
|
|
118
|
+
return R ? {
|
|
119
119
|
path: e,
|
|
120
120
|
operationId: v,
|
|
121
|
-
status:
|
|
122
|
-
delay:
|
|
123
|
-
body:
|
|
124
|
-
presetId:
|
|
121
|
+
status: R.status,
|
|
122
|
+
delay: R.delay,
|
|
123
|
+
body: R.body,
|
|
124
|
+
presetId: R.id
|
|
125
125
|
} : (c.value = `Preset not found: ${n}`, null);
|
|
126
126
|
}
|
|
127
|
-
function L(e) {
|
|
128
|
-
g.value = e;
|
|
129
|
-
}
|
|
130
127
|
function w(e) {
|
|
131
|
-
|
|
128
|
+
T.value = e;
|
|
132
129
|
}
|
|
133
|
-
function
|
|
130
|
+
function A(e) {
|
|
131
|
+
c.value = e, T.value = !1;
|
|
132
|
+
}
|
|
133
|
+
function D() {
|
|
134
134
|
c.value = null;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function P(e) {
|
|
137
137
|
if (!s.value.has(e))
|
|
138
138
|
return;
|
|
139
139
|
const n = s.value.get(e);
|
|
140
140
|
n == null ? i.value.delete(e) : i.value.set(e, n), s.value.delete(e);
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function $(e) {
|
|
143
143
|
console.log("[Simulation] Added:", e.path);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
|
|
145
|
+
function t(e) {
|
|
146
|
+
C(e.path), console.log("[Simulation] Removed:", e.path);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function l(e) {
|
|
149
149
|
E(), console.log("[Simulation] Cleared all:", e.count);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
e.success ? (s.value.delete(e.path), console.log("[Simulation] Set successfully:", e.path)) : (
|
|
151
|
+
function o(e) {
|
|
152
|
+
e.success ? (s.value.delete(e.path), console.log("[Simulation] Set successfully:", e.path)) : (P(e.path), A(`Failed to set simulation for ${e.path}`)), w(!1);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
e.success ? (s.value.delete(e.path), console.log("[Simulation] Cleared successfully:", e.path)) : (
|
|
154
|
+
function m(e) {
|
|
155
|
+
e.success ? (s.value.delete(e.path), console.log("[Simulation] Cleared successfully:", e.path)) : (P(e.path), A(`Failed to clear simulation for ${e.path}`)), w(!1);
|
|
156
156
|
}
|
|
157
157
|
return {
|
|
158
158
|
// State
|
|
159
159
|
simulations: i,
|
|
160
|
-
isLoading:
|
|
160
|
+
isLoading: T,
|
|
161
161
|
error: c,
|
|
162
162
|
// Getters
|
|
163
|
-
activeSimulations:
|
|
164
|
-
count:
|
|
165
|
-
presets:
|
|
166
|
-
hasActiveSimulations:
|
|
167
|
-
simulationsByType:
|
|
163
|
+
activeSimulations: y,
|
|
164
|
+
count: L,
|
|
165
|
+
presets: _,
|
|
166
|
+
hasActiveSimulations: k,
|
|
167
|
+
simulationsByType: p,
|
|
168
168
|
// Actions
|
|
169
|
-
setSimulations:
|
|
170
|
-
addSimulationLocal:
|
|
171
|
-
removeSimulationLocal:
|
|
169
|
+
setSimulations: H,
|
|
170
|
+
addSimulationLocal: M,
|
|
171
|
+
removeSimulationLocal: C,
|
|
172
172
|
clearSimulationsLocal: E,
|
|
173
|
-
getSimulation:
|
|
174
|
-
hasSimulation:
|
|
175
|
-
getPreset:
|
|
176
|
-
createSimulationFromPreset:
|
|
177
|
-
setLoading:
|
|
178
|
-
setError:
|
|
179
|
-
clearError:
|
|
180
|
-
rollbackSimulation:
|
|
173
|
+
getSimulation: z,
|
|
174
|
+
hasSimulation: F,
|
|
175
|
+
getPreset: b,
|
|
176
|
+
createSimulationFromPreset: V,
|
|
177
|
+
setLoading: w,
|
|
178
|
+
setError: A,
|
|
179
|
+
clearError: D,
|
|
180
|
+
rollbackSimulation: P,
|
|
181
181
|
// Event handlers
|
|
182
|
-
handleSimulationAdded:
|
|
183
|
-
handleSimulationRemoved:
|
|
184
|
-
handleSimulationsCleared:
|
|
185
|
-
handleSimulationSet:
|
|
186
|
-
handleSimulationCleared:
|
|
182
|
+
handleSimulationAdded: $,
|
|
183
|
+
handleSimulationRemoved: t,
|
|
184
|
+
handleSimulationsCleared: l,
|
|
185
|
+
handleSimulationSet: o,
|
|
186
|
+
handleSimulationCleared: m
|
|
187
187
|
};
|
|
188
|
-
}),
|
|
188
|
+
}), de = { class: "simulator-page" }, ce = { class: "simulator-form card" }, me = { class: "simulator-form__header" }, pe = { class: "simulator-form__body" }, ve = {
|
|
189
189
|
key: 0,
|
|
190
190
|
class: "simulator-form__row"
|
|
191
|
-
},
|
|
191
|
+
}, fe = ["value"], he = { class: "simulator-form__row" }, ye = ["value"], _e = { class: "simulator-presets" }, Se = ["title", "onClick"], be = { class: "simulator-preset__label" }, ge = ["disabled"], Te = { class: "simulator-active" }, ke = { class: "simulator-active__header" }, Ce = { class: "simulator-active__title" }, Pe = ["disabled"], Le = { class: "simulator-active__list" }, Ee = { class: "simulator-simulation__info" }, we = { class: "simulator-simulation__path font-mono" }, Ae = { class: "simulator-simulation__preset" }, Re = {
|
|
192
192
|
key: 0,
|
|
193
193
|
class: "text-muted"
|
|
194
|
-
},
|
|
194
|
+
}, Ie = ["disabled", "onClick"], Me = {
|
|
195
195
|
key: 0,
|
|
196
196
|
class: "empty-state"
|
|
197
|
-
},
|
|
197
|
+
}, ze = /* @__PURE__ */ X({
|
|
198
198
|
__name: "SimulatorPage",
|
|
199
199
|
setup(i) {
|
|
200
|
-
const s =
|
|
201
|
-
let
|
|
202
|
-
const C =
|
|
200
|
+
const s = ue(), T = ne(), { send: c, on: y, connected: L } = le(), _ = f(""), k = f("GET"), p = f(null), S = f(null), H = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
|
|
201
|
+
let M = [];
|
|
202
|
+
const C = f(/* @__PURE__ */ new Set()), E = h(() => T.endpoints.map((t) => ({
|
|
203
203
|
key: t.key,
|
|
204
204
|
label: `${t.method.toUpperCase()} ${t.path}`,
|
|
205
205
|
method: t.method.toUpperCase(),
|
|
206
206
|
path: t.path,
|
|
207
207
|
operationId: t.operationId
|
|
208
|
-
}))),
|
|
208
|
+
}))), z = h(() => {
|
|
209
209
|
const t = _.value.trim() !== "", l = p.value !== null;
|
|
210
210
|
return t && l;
|
|
211
|
-
}),
|
|
211
|
+
}), F = h(() => s.activeSimulations.map((t) => {
|
|
212
212
|
const l = t.presetId ? s.getPreset(t.presetId) : null;
|
|
213
213
|
return {
|
|
214
214
|
...t,
|
|
215
215
|
preset: l
|
|
216
216
|
};
|
|
217
|
-
})),
|
|
218
|
-
function
|
|
219
|
-
if (!
|
|
217
|
+
})), b = h(() => s.count);
|
|
218
|
+
function V() {
|
|
219
|
+
if (!z.value || !p.value || !s.getPreset(p.value)) return;
|
|
220
220
|
const l = _.value.trim();
|
|
221
221
|
if (!l.startsWith("/")) {
|
|
222
222
|
s.setError("Path must start with /");
|
|
@@ -230,7 +230,7 @@ const ie = oe("plus", [
|
|
|
230
230
|
s.setError("Path contains invalid characters");
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
|
-
const o = `${
|
|
233
|
+
const o = `${k.value.toLowerCase()}:${l}`, m = s.createSimulationFromPreset(
|
|
234
234
|
o,
|
|
235
235
|
p.value,
|
|
236
236
|
void 0
|
|
@@ -245,14 +245,14 @@ const ie = oe("plus", [
|
|
|
245
245
|
}
|
|
246
246
|
}), _.value = "", p.value = null, S.value = null);
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function w(t) {
|
|
249
249
|
s.removeSimulationLocal(t, !0), s.setLoading(!0), c({
|
|
250
250
|
type: "clear:simulation",
|
|
251
251
|
data: { path: t }
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
if (
|
|
254
|
+
function A() {
|
|
255
|
+
if (b.value !== 0) {
|
|
256
256
|
for (const t of s.activeSimulations)
|
|
257
257
|
C.value.add(t.path), s.removeSimulationLocal(t.path, !0), c({
|
|
258
258
|
type: "clear:simulation",
|
|
@@ -261,88 +261,93 @@ const ie = oe("plus", [
|
|
|
261
261
|
s.setLoading(!0);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function D() {
|
|
265
265
|
if (!S.value) return;
|
|
266
|
-
const t =
|
|
267
|
-
t && (
|
|
266
|
+
const t = T.endpoints.find((l) => l.key === S.value);
|
|
267
|
+
t && (k.value = t.method.toUpperCase(), _.value = t.path);
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function P() {
|
|
270
270
|
S.value = null;
|
|
271
271
|
}
|
|
272
|
+
function $() {
|
|
273
|
+
L.value && (s.setLoading(!0), c({ type: "get:registry" }));
|
|
274
|
+
}
|
|
272
275
|
return Y(() => {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
s.setSimulations(t.simulations);
|
|
276
|
+
M = [
|
|
277
|
+
y("simulation:active", (t) => {
|
|
278
|
+
s.setSimulations(t.simulations), s.setLoading(!1);
|
|
276
279
|
}),
|
|
277
|
-
|
|
280
|
+
y("simulation:added", (t) => {
|
|
278
281
|
s.handleSimulationAdded(t);
|
|
279
282
|
}),
|
|
280
|
-
|
|
283
|
+
y("simulation:removed", (t) => {
|
|
281
284
|
s.handleSimulationRemoved(t);
|
|
282
285
|
}),
|
|
283
|
-
|
|
286
|
+
y("simulations:cleared", (t) => {
|
|
284
287
|
s.handleSimulationsCleared(t);
|
|
285
288
|
}),
|
|
286
|
-
|
|
289
|
+
y("simulation:set", (t) => {
|
|
287
290
|
s.handleSimulationSet(t);
|
|
288
291
|
}),
|
|
289
|
-
|
|
292
|
+
y("simulation:cleared", (t) => {
|
|
290
293
|
C.value.has(t.path) && C.value.delete(t.path), s.handleSimulationCleared(t);
|
|
291
294
|
})
|
|
292
|
-
],
|
|
295
|
+
], L.value && $();
|
|
293
296
|
}), ee(() => {
|
|
294
|
-
for (const t of
|
|
297
|
+
for (const t of M)
|
|
295
298
|
t();
|
|
296
|
-
}), (
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
299
|
+
}), te(L, (t) => {
|
|
300
|
+
t ? $() : s.setLoading(!1);
|
|
301
|
+
}), (t, l) => (r(), d("div", de, [
|
|
302
|
+
a("div", ce, [
|
|
303
|
+
a("div", me, [
|
|
304
|
+
I(u(K), { size: 18 }),
|
|
300
305
|
l[3] || (l[3] = a("span", null, "Add Simulation", -1))
|
|
301
306
|
]),
|
|
302
|
-
a("div",
|
|
303
|
-
|
|
307
|
+
a("div", pe, [
|
|
308
|
+
E.value.length > 0 ? (r(), d("div", ve, [
|
|
304
309
|
l[5] || (l[5] = a("label", { class: "simulator-form__label" }, "Select Endpoint (optional):", -1)),
|
|
305
|
-
|
|
310
|
+
q(a("select", {
|
|
306
311
|
"onUpdate:modelValue": l[0] || (l[0] = (o) => S.value = o),
|
|
307
312
|
class: "input",
|
|
308
|
-
onChange:
|
|
313
|
+
onChange: D
|
|
309
314
|
}, [
|
|
310
315
|
l[4] || (l[4] = a("option", { value: null }, "Manual entry...", -1)),
|
|
311
|
-
(r(!0), d(
|
|
316
|
+
(r(!0), d(U, null, N(E.value, (o) => (r(), d("option", {
|
|
312
317
|
key: o.key,
|
|
313
318
|
value: o.key
|
|
314
|
-
},
|
|
319
|
+
}, g(o.label), 9, fe))), 128))
|
|
315
320
|
], 544), [
|
|
316
|
-
[
|
|
321
|
+
[O, S.value]
|
|
317
322
|
])
|
|
318
|
-
])) :
|
|
319
|
-
a("div",
|
|
320
|
-
|
|
321
|
-
"onUpdate:modelValue": l[1] || (l[1] = (o) =>
|
|
323
|
+
])) : x("", !0),
|
|
324
|
+
a("div", he, [
|
|
325
|
+
q(a("select", {
|
|
326
|
+
"onUpdate:modelValue": l[1] || (l[1] = (o) => k.value = o),
|
|
322
327
|
class: "simulator-form__method input",
|
|
323
|
-
onChange:
|
|
328
|
+
onChange: P
|
|
324
329
|
}, [
|
|
325
|
-
(r(), d(
|
|
330
|
+
(r(), d(U, null, N(H, (o) => a("option", {
|
|
326
331
|
key: o,
|
|
327
332
|
value: o
|
|
328
|
-
},
|
|
333
|
+
}, g(o), 9, ye)), 64))
|
|
329
334
|
], 544), [
|
|
330
|
-
[
|
|
335
|
+
[O, k.value]
|
|
331
336
|
]),
|
|
332
|
-
|
|
337
|
+
q(a("input", {
|
|
333
338
|
"onUpdate:modelValue": l[2] || (l[2] = (o) => _.value = o),
|
|
334
339
|
type: "text",
|
|
335
340
|
class: "simulator-form__path input",
|
|
336
341
|
placeholder: "/api/path",
|
|
337
|
-
onInput:
|
|
342
|
+
onInput: P
|
|
338
343
|
}, null, 544), [
|
|
339
|
-
[
|
|
344
|
+
[oe, _.value]
|
|
340
345
|
])
|
|
341
346
|
]),
|
|
342
|
-
a("div",
|
|
343
|
-
(r(!0), d(
|
|
347
|
+
a("div", _e, [
|
|
348
|
+
(r(!0), d(U, null, N(u(s).presets, (o) => (r(), d("button", {
|
|
344
349
|
key: o.id,
|
|
345
|
-
class:
|
|
350
|
+
class: G([
|
|
346
351
|
"simulator-preset",
|
|
347
352
|
{ "simulator-preset--selected": p.value === o.id },
|
|
348
353
|
`simulator-preset--${o.type}`
|
|
@@ -350,76 +355,76 @@ const ie = oe("plus", [
|
|
|
350
355
|
title: o.description,
|
|
351
356
|
onClick: (m) => p.value = o.id
|
|
352
357
|
}, [
|
|
353
|
-
(r(),
|
|
354
|
-
a("span",
|
|
355
|
-
], 10,
|
|
358
|
+
(r(), W(Z(o.type === "delay" ? u(j) : u(J)), { size: 14 })),
|
|
359
|
+
a("span", be, g(o.label), 1)
|
|
360
|
+
], 10, Se))), 128))
|
|
356
361
|
]),
|
|
357
362
|
a("button", {
|
|
358
363
|
class: "btn btn--primary",
|
|
359
|
-
disabled: !
|
|
360
|
-
onClick:
|
|
364
|
+
disabled: !z.value || u(s).isLoading,
|
|
365
|
+
onClick: V
|
|
361
366
|
}, [
|
|
362
|
-
|
|
367
|
+
I(u(re), { size: 16 }),
|
|
363
368
|
l[6] || (l[6] = a("span", null, "Add Simulation", -1))
|
|
364
|
-
], 8,
|
|
369
|
+
], 8, ge)
|
|
365
370
|
])
|
|
366
371
|
]),
|
|
367
|
-
a("div",
|
|
368
|
-
a("div",
|
|
369
|
-
a("span",
|
|
370
|
-
|
|
372
|
+
a("div", Te, [
|
|
373
|
+
a("div", ke, [
|
|
374
|
+
a("span", Ce, " Active Simulations (" + g(b.value) + ") ", 1),
|
|
375
|
+
b.value > 0 ? (r(), d("button", {
|
|
371
376
|
key: 0,
|
|
372
377
|
class: "btn btn--ghost",
|
|
373
378
|
disabled: u(s).isLoading,
|
|
374
|
-
onClick:
|
|
379
|
+
onClick: A
|
|
375
380
|
}, [
|
|
376
|
-
|
|
381
|
+
I(u(Q), { size: 14 }),
|
|
377
382
|
l[7] || (l[7] = a("span", null, "Clear All", -1))
|
|
378
|
-
], 8,
|
|
383
|
+
], 8, Pe)) : x("", !0)
|
|
379
384
|
]),
|
|
380
|
-
a("div",
|
|
381
|
-
(r(!0), d(
|
|
385
|
+
a("div", Le, [
|
|
386
|
+
(r(!0), d(U, null, N(F.value, (o) => (r(), d("div", {
|
|
382
387
|
key: o.path,
|
|
383
388
|
class: "simulator-simulation card"
|
|
384
389
|
}, [
|
|
385
390
|
a("div", Ee, [
|
|
386
|
-
a("span",
|
|
391
|
+
a("span", we, g(o.path), 1)
|
|
387
392
|
]),
|
|
388
|
-
a("div",
|
|
389
|
-
(r(),
|
|
393
|
+
a("div", Ae, [
|
|
394
|
+
(r(), W(Z(o.preset?.type === "delay" ? u(j) : u(J)), {
|
|
390
395
|
size: 14,
|
|
391
|
-
class:
|
|
396
|
+
class: G({
|
|
392
397
|
"text-warning": o.preset?.type === "delay",
|
|
393
398
|
"text-error": o.preset?.type === "error",
|
|
394
399
|
"text-muted": o.preset?.type === "empty"
|
|
395
400
|
})
|
|
396
401
|
}, null, 8, ["class"])),
|
|
397
|
-
a("span", null,
|
|
398
|
-
o.delay ? (r(), d("span",
|
|
402
|
+
a("span", null, g(o.preset?.label || `HTTP ${o.status}`), 1),
|
|
403
|
+
o.delay ? (r(), d("span", Re, " (" + g(o.delay) + "ms) ", 1)) : x("", !0)
|
|
399
404
|
]),
|
|
400
405
|
a("button", {
|
|
401
406
|
class: "btn btn--ghost btn--icon",
|
|
402
407
|
title: "Remove simulation",
|
|
403
408
|
disabled: u(s).isLoading,
|
|
404
|
-
onClick: (m) =>
|
|
409
|
+
onClick: (m) => w(o.path)
|
|
405
410
|
}, [
|
|
406
|
-
|
|
407
|
-
], 8,
|
|
411
|
+
I(u(Q), { size: 14 })
|
|
412
|
+
], 8, Ie)
|
|
408
413
|
]))), 128)),
|
|
409
|
-
|
|
410
|
-
|
|
414
|
+
b.value === 0 ? (r(), d("div", Me, [
|
|
415
|
+
I(u(K), {
|
|
411
416
|
size: 48,
|
|
412
417
|
class: "empty-state__icon"
|
|
413
418
|
}),
|
|
414
419
|
l[8] || (l[8] = a("h3", { class: "empty-state__title" }, "No active simulations", -1)),
|
|
415
420
|
l[9] || (l[9] = a("p", { class: "empty-state__description" }, " Add a simulation above to test error handling and slow responses. ", -1))
|
|
416
|
-
])) :
|
|
421
|
+
])) : x("", !0)
|
|
417
422
|
])
|
|
418
423
|
])
|
|
419
424
|
]));
|
|
420
425
|
}
|
|
421
|
-
}),
|
|
426
|
+
}), Ve = /* @__PURE__ */ ae(ze, [["__scopeId", "data-v-3076fbb2"]]);
|
|
422
427
|
export {
|
|
423
|
-
|
|
428
|
+
Ve as default
|
|
424
429
|
};
|
|
425
|
-
//# sourceMappingURL=SimulatorPage-
|
|
430
|
+
//# sourceMappingURL=SimulatorPage-CDTgl8ax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimulatorPage-CDTgl8ax.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, watch } 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, connected } = 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// Data Fetching\n// ==========================================================================\n\n/**\n * Fetch current simulations from server via get:registry command\n * (server responds with simulation:active event containing current simulations)\n */\nfunction fetchSimulations(): void {\n if (connected.value) {\n simulationStore.setLoading(true);\n send({ type: 'get:registry' });\n }\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 simulationStore.setLoading(false);\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 // Fetch current simulations if already connected\n if (connected.value) {\n fetchSimulations();\n }\n});\n\n// Cleanup on unmount to prevent memory leaks\nonUnmounted(() => {\n for (const unsub of unsubscribers) {\n unsub();\n }\n});\n\n// Re-fetch simulations when connection is (re)established, clear loading on disconnect\nwatch(connected, (isConnected) => {\n if (isConnected) {\n fetchSimulations();\n } else {\n simulationStore.setLoading(false);\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","connected","useWebSocket","newSimulationPath","newSimulationMethod","selectedPresetId","selectedEndpointKey","httpMethods","unsubscribers","pendingClears","availableEndpoints","e","canAddSimulation","hasPath","hasPreset","sim","simulationCount","addSimulation","trimmedPath","pathWithMethod","removeSimulation","clearAllSimulations","handleEndpointSelect","endpoint","handleManualInput","fetchSimulations","onMounted","onUnmounted","unsub","watch","isConnected","_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,IACN,QAAQ;AAAA,IACR,MAAM,EAAE,OAAO,qBAAqB,SAAS,sBAAA;AAAA,EAAsB;AAAA,EAErE;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM,EAAE,OAAO,aAAa,SAAS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