@websublime/vite-plugin-open-api-devtools 0.8.5 → 0.9.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/ModelsPage-OOYQ3USo.js +798 -0
  2. package/dist/ModelsPage-OOYQ3USo.js.map +1 -0
  3. package/dist/{RoutesPage-BCKS0kdj.js → RoutesPage-BgsspZkr.js} +191 -191
  4. package/dist/RoutesPage-BgsspZkr.js.map +1 -0
  5. package/dist/SimulatorPage-g9fGUP4F.js +436 -0
  6. package/dist/SimulatorPage-g9fGUP4F.js.map +1 -0
  7. package/dist/TimelinePage-D_GD3OjL.js +861 -0
  8. package/dist/TimelinePage-D_GD3OjL.js.map +1 -0
  9. package/dist/{check-BZ_jBwd4.js → check-B4mNtdMg.js} +2 -2
  10. package/dist/{check-BZ_jBwd4.js.map → check-B4mNtdMg.js.map} +1 -1
  11. package/dist/devtools.css +1 -1
  12. package/dist/devtools.js +1 -1
  13. package/dist/devtools.umd.cjs +3 -3
  14. package/dist/devtools.umd.cjs.map +1 -1
  15. package/dist/{format-Dq-zmlAN.js → format-Dj37a-xS.js} +2 -2
  16. package/dist/{format-Dq-zmlAN.js.map → format-Dj37a-xS.js.map} +1 -1
  17. package/dist/main-CWgkFc8w.js +620 -0
  18. package/dist/main-CWgkFc8w.js.map +1 -0
  19. package/dist/registry-SW4SCwV5.js +216 -0
  20. package/dist/registry-SW4SCwV5.js.map +1 -0
  21. package/dist/spa/assets/{ModelsPage-8zCKSqIw.css → ModelsPage-CrseRvBH.css} +1 -1
  22. package/dist/spa/assets/ModelsPage-CxzHlUKB.js +4 -0
  23. package/dist/spa/assets/ModelsPage-CxzHlUKB.js.map +1 -0
  24. package/dist/spa/assets/RoutesPage-BchriFi3.js +2 -0
  25. package/dist/spa/assets/RoutesPage-BchriFi3.js.map +1 -0
  26. package/dist/spa/assets/{RoutesPage-BVXzvJ2S.css → RoutesPage-Wp_sf4Io.css} +1 -1
  27. package/dist/spa/assets/SimulatorPage-CHGPhn5Y.js +2 -0
  28. package/dist/spa/assets/SimulatorPage-CHGPhn5Y.js.map +1 -0
  29. package/dist/spa/assets/SimulatorPage-p6R5JJTE.css +1 -0
  30. package/dist/spa/assets/{TimelinePage-BDyp8kvu.css → TimelinePage-ED20f46Y.css} +1 -1
  31. package/dist/spa/assets/TimelinePage-zBBJCjLX.js +2 -0
  32. package/dist/spa/assets/TimelinePage-zBBJCjLX.js.map +1 -0
  33. package/dist/spa/assets/check-CDp1nxJT.js +2 -0
  34. package/dist/spa/assets/{check-DaD3RpI4.js.map → check-CDp1nxJT.js.map} +1 -1
  35. package/dist/spa/assets/{format-er1_KlP8.js → format-DA0n5kox.js} +2 -2
  36. package/dist/spa/assets/{format-er1_KlP8.js.map → format-DA0n5kox.js.map} +1 -1
  37. package/dist/spa/assets/index-Ddu0x8qb.js +3 -0
  38. package/dist/spa/assets/index-Ddu0x8qb.js.map +1 -0
  39. package/dist/spa/assets/registry-CKvK0Ln5.js +2 -0
  40. package/dist/spa/assets/registry-CKvK0Ln5.js.map +1 -0
  41. package/dist/spa/assets/{trash-2-BhRxw6RN.js → trash-2-B1UuFJDm.js} +2 -2
  42. package/dist/spa/assets/{trash-2-BhRxw6RN.js.map → trash-2-B1UuFJDm.js.map} +1 -1
  43. package/dist/spa/assets/{triangle-alert-QXcMwGDR.js → triangle-alert-ITT7135L.js} +2 -2
  44. package/dist/spa/assets/{triangle-alert-QXcMwGDR.js.map → triangle-alert-ITT7135L.js.map} +1 -1
  45. package/dist/spa/assets/{vue-vendor-Bkktf9yg.js → vue-vendor-D62nux6V.js} +2 -2
  46. package/dist/spa/assets/{vue-vendor-Bkktf9yg.js.map → vue-vendor-D62nux6V.js.map} +1 -1
  47. package/dist/spa/assets/x-YOimnrsL.js +2 -0
  48. package/dist/spa/assets/{x-DGt4DUCk.js.map → x-YOimnrsL.js.map} +1 -1
  49. package/dist/spa/index.html +2 -2
  50. package/dist/{trash-2-D9Av3Lfp.js → trash-2-CDLzu4_Y.js} +2 -2
  51. package/dist/{trash-2-D9Av3Lfp.js.map → trash-2-CDLzu4_Y.js.map} +1 -1
  52. package/dist/{triangle-alert-6Spra6HA.js → triangle-alert-BP3-t-po.js} +2 -2
  53. package/dist/{triangle-alert-6Spra6HA.js.map → triangle-alert-BP3-t-po.js.map} +1 -1
  54. package/dist/{x-DI-fqJ3g.js → x-BZzigrBR.js} +2 -2
  55. package/dist/{x-DI-fqJ3g.js.map → x-BZzigrBR.js.map} +1 -1
  56. package/package.json +13 -12
  57. package/dist/ModelsPage-DxcKgz3y.js +0 -757
  58. package/dist/ModelsPage-DxcKgz3y.js.map +0 -1
  59. package/dist/RoutesPage-BCKS0kdj.js.map +0 -1
  60. package/dist/SimulatorPage-BlbxLDdf.js +0 -430
  61. package/dist/SimulatorPage-BlbxLDdf.js.map +0 -1
  62. package/dist/TimelinePage-BhtcWy3o.js +0 -849
  63. package/dist/TimelinePage-BhtcWy3o.js.map +0 -1
  64. package/dist/main-DmyM_bX3.js +0 -537
  65. package/dist/main-DmyM_bX3.js.map +0 -1
  66. package/dist/registry-BQhccWMq.js +0 -153
  67. package/dist/registry-BQhccWMq.js.map +0 -1
  68. package/dist/spa/assets/ModelsPage-Bd7YM0_p.js +0 -4
  69. package/dist/spa/assets/ModelsPage-Bd7YM0_p.js.map +0 -1
  70. package/dist/spa/assets/RoutesPage-YQcTov5t.js +0 -2
  71. package/dist/spa/assets/RoutesPage-YQcTov5t.js.map +0 -1
  72. package/dist/spa/assets/SimulatorPage-DGEq_rzM.css +0 -1
  73. package/dist/spa/assets/SimulatorPage-DPxecZGS.js +0 -2
  74. package/dist/spa/assets/SimulatorPage-DPxecZGS.js.map +0 -1
  75. package/dist/spa/assets/TimelinePage-CbWvtFc_.js +0 -2
  76. package/dist/spa/assets/TimelinePage-CbWvtFc_.js.map +0 -1
  77. package/dist/spa/assets/check-DaD3RpI4.js +0 -2
  78. package/dist/spa/assets/index-x38XzU3c.js +0 -3
  79. package/dist/spa/assets/index-x38XzU3c.js.map +0 -1
  80. package/dist/spa/assets/registry-DjJcdO1T.js +0 -2
  81. package/dist/spa/assets/registry-DjJcdO1T.js.map +0 -1
  82. package/dist/spa/assets/x-DGt4DUCk.js +0 -2
@@ -1,849 +0,0 @@
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-Dq-zmlAN.js";
3
- import { c as fe, C as P, Z as ve, _ as de, u as ke } from "./main-DmyM_bX3.js";
4
- import { C as oe } from "./check-BZ_jBwd4.js";
5
- import { T as qe } from "./triangle-alert-6Spra6HA.js";
6
- import { defineStore as Ce } from "pinia";
7
- import { X as ye } from "./x-DI-fqJ3g.js";
8
- import { T as $e } from "./trash-2-D9Av3Lfp.js";
9
- const Se = fe("circle-check-big", [
10
- ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
11
- ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
12
- ]);
13
- const re = fe("copy", [
14
- ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
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" }]
16
- ]), Te = Ce("timeline", () => {
17
- const n = T([]), s = T(!1), r = T(null), d = T({
18
- methods: [],
19
- statusCodes: [],
20
- searchQuery: "",
21
- simulatedOnly: null
22
- }), q = T(null), g = T(500), p = /* @__PURE__ */ new Map();
23
- function z(t) {
24
- return t < 200 ? "1xx" : t < 300 ? "2xx" : t < 400 ? "3xx" : t < 500 ? "4xx" : "5xx";
25
- }
26
- const H = v(() => {
27
- let t = n.value;
28
- if (d.value.searchQuery.trim()) {
29
- const i = d.value.searchQuery.toLowerCase().trim();
30
- t = t.filter((m) => m.request.path.toLowerCase().includes(i) || m.request.operationId.toLowerCase().includes(i));
31
- }
32
- return d.value.methods.length > 0 && (t = t.filter(
33
- (i) => d.value.methods.includes(i.request.method.toUpperCase())
34
- )), d.value.statusCodes.length > 0 && (t = t.filter((i) => {
35
- if (i.status === null) return !1;
36
- const m = z(i.status);
37
- return d.value.statusCodes.includes(m);
38
- })), d.value.simulatedOnly !== null && (t = t.filter((i) => i.simulated === d.value.simulatedOnly)), t;
39
- }), B = v(() => q.value ? n.value.find((t) => t.id === q.value) ?? null : null), Q = v(() => n.value.length), O = v(() => n.value.filter((t) => t.response !== null).length), D = v(() => n.value.filter((t) => t.response === null).length), w = v(() => {
40
- const t = {
41
- "1xx": 0,
42
- "2xx": 0,
43
- "3xx": 0,
44
- "4xx": 0,
45
- "5xx": 0
46
- };
47
- for (const i of n.value)
48
- if (i.status !== null) {
49
- const m = z(i.status);
50
- t[m]++;
51
- }
52
- return t;
53
- }), L = v(() => {
54
- const t = n.value.filter((m) => m.duration !== null);
55
- if (t.length === 0) return 0;
56
- const i = t.reduce((m, E) => m + (E.duration ?? 0), 0);
57
- return Math.round(i / t.length);
58
- });
59
- function U(t) {
60
- const i = {
61
- id: t.id,
62
- request: t,
63
- response: null,
64
- status: null,
65
- duration: null,
66
- simulated: !1
67
- }, m = p.get(t.id);
68
- m && (l(i, m), p.delete(t.id)), n.value.unshift(i), n.value.length > g.value && (n.value = n.value.slice(0, g.value));
69
- }
70
- function b(t) {
71
- const i = n.value.find((m) => m.id === t.requestId);
72
- if (i)
73
- l(i, t), p.delete(t.requestId);
74
- else if (p.set(t.requestId, t), p.size > 100) {
75
- const m = f(t);
76
- n.value.unshift(m), p.delete(t.requestId), n.value.length > g.value && (n.value = n.value.slice(0, g.value));
77
- }
78
- }
79
- function l(t, i) {
80
- t.response = i, t.status = i.status, t.duration = i.duration, t.simulated = i.simulated;
81
- }
82
- function f(t) {
83
- const i = {
84
- id: t.requestId,
85
- method: "UNKNOWN",
86
- path: "/unknown",
87
- operationId: "unknown",
88
- timestamp: Date.now(),
89
- // Use current time as fallback
90
- headers: {},
91
- query: {},
92
- body: void 0
93
- };
94
- return {
95
- id: t.requestId,
96
- request: i,
97
- response: t,
98
- status: t.status,
99
- duration: t.duration,
100
- simulated: t.simulated
101
- };
102
- }
103
- function C(t) {
104
- for (const [i, m] of p) {
105
- const E = t.get(i);
106
- E ? (l(E, m), p.delete(i)) : (t.set(i, f(m)), p.delete(i));
107
- }
108
- }
109
- function se(t, i) {
110
- for (const [m, E] of i) {
111
- const I = t.get(m);
112
- I ? l(I, E) : p.set(m, E);
113
- }
114
- }
115
- function ne(t) {
116
- for (const [i, m] of p)
117
- t.has(i) || (t.set(i, f(m)), p.delete(i));
118
- }
119
- function ie(t) {
120
- const i = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
121
- for (const I of t.entries)
122
- if (I.type === "request") {
123
- const F = I.data;
124
- i.set(F.id, {
125
- id: F.id,
126
- request: F,
127
- response: null,
128
- status: null,
129
- duration: null,
130
- simulated: !1
131
- });
132
- } else if (I.type === "response") {
133
- const F = I.data;
134
- m.set(F.requestId, F);
135
- }
136
- C(i), se(i, m), ne(i);
137
- const E = Array.from(i.values()).sort(
138
- (I, F) => F.request.timestamp - I.request.timestamp
139
- );
140
- n.value = E.slice(0, g.value), r.value = null;
141
- }
142
- function G() {
143
- n.value = [], q.value = null, p.clear();
144
- }
145
- function le(t) {
146
- s.value = t;
147
- }
148
- function J(t) {
149
- r.value = t, s.value = !1;
150
- }
151
- function K() {
152
- r.value = null;
153
- }
154
- function X(t) {
155
- d.value.searchQuery = t;
156
- }
157
- function Y(t) {
158
- const i = d.value.methods.indexOf(t);
159
- i === -1 ? d.value.methods.push(t) : d.value.methods.splice(i, 1);
160
- }
161
- function ee(t) {
162
- const i = d.value.statusCodes.indexOf(t);
163
- i === -1 ? d.value.statusCodes.push(t) : d.value.statusCodes.splice(i, 1);
164
- }
165
- function te(t) {
166
- d.value.simulatedOnly = t;
167
- }
168
- function y() {
169
- d.value = {
170
- methods: [],
171
- statusCodes: [],
172
- searchQuery: "",
173
- simulatedOnly: null
174
- };
175
- }
176
- function _() {
177
- return d.value.searchQuery.trim() !== "" || d.value.methods.length > 0 || d.value.statusCodes.length > 0 || d.value.simulatedOnly !== null;
178
- }
179
- function h(t) {
180
- q.value = t;
181
- }
182
- function ae(t) {
183
- const i = Math.max(1, t);
184
- g.value = i, n.value.length > i && (n.value = n.value.slice(0, i));
185
- }
186
- return {
187
- // State
188
- entries: n,
189
- isLoading: s,
190
- error: r,
191
- filter: d,
192
- selectedEntryId: q,
193
- maxEntries: g,
194
- // Getters
195
- filteredEntries: H,
196
- selectedEntry: B,
197
- totalCount: Q,
198
- completedCount: O,
199
- pendingCount: D,
200
- statusCounts: w,
201
- averageDuration: L,
202
- // Actions
203
- addRequest: U,
204
- addResponse: b,
205
- setTimelineData: ie,
206
- clearTimeline: G,
207
- setLoading: le,
208
- setError: J,
209
- clearError: K,
210
- setSearchQuery: X,
211
- toggleMethodFilter: Y,
212
- toggleStatusFilter: ee,
213
- setSimulatedFilter: te,
214
- clearFilters: y,
215
- hasActiveFilters: _,
216
- selectEntry: h,
217
- setMaxEntries: ae
218
- };
219
- }), Be = { class: "timeline-detail" }, we = {
220
- key: 0,
221
- class: "timeline-detail__empty"
222
- }, Ee = {
223
- key: 1,
224
- class: "timeline-detail__content"
225
- }, Ie = { class: "timeline-detail__header" }, Re = { class: "timeline-detail__summary" }, ze = { class: "timeline-detail__path font-mono" }, Oe = { class: "timeline-detail__meta" }, De = {
226
- key: 1,
227
- class: "status-badge status-badge--pending"
228
- }, Fe = { class: "timeline-detail__duration" }, He = {
229
- key: 2,
230
- class: "timeline-detail__simulated",
231
- title: "Simulated response"
232
- }, Qe = { class: "timeline-detail__actions" }, Le = { class: "timeline-detail__info" }, Me = { class: "timeline-detail__info-item" }, Ae = { class: "timeline-detail__info-value font-mono" }, Ne = { class: "timeline-detail__info-item" }, je = { class: "timeline-detail__info-value font-mono" }, Pe = { class: "timeline-detail__info-item" }, Ue = { class: "timeline-detail__info-value font-mono" }, Je = { class: "timeline-detail__section" }, Ve = {
233
- key: 0,
234
- class: "timeline-detail__subsection"
235
- }, We = ["aria-expanded"], Ze = { class: "text-muted" }, Ge = {
236
- id: "requestQuery-panel",
237
- class: "timeline-detail__subsection-content"
238
- }, Ke = { class: "timeline-detail__kv-key font-mono" }, Xe = { class: "timeline-detail__kv-value font-mono" }, Ye = {
239
- key: 1,
240
- class: "timeline-detail__subsection"
241
- }, et = ["aria-expanded"], tt = { class: "text-muted" }, st = {
242
- id: "requestHeaders-panel",
243
- class: "timeline-detail__subsection-content"
244
- }, nt = { class: "timeline-detail__kv-key font-mono" }, it = { class: "timeline-detail__kv-value font-mono" }, lt = {
245
- key: 2,
246
- class: "timeline-detail__subsection"
247
- }, at = {
248
- class: "timeline-detail__subsection-header",
249
- role: "group"
250
- }, ot = ["aria-expanded"], rt = {
251
- id: "requestBody-panel",
252
- class: "timeline-detail__subsection-content"
253
- }, ut = { class: "timeline-detail__json" }, dt = {
254
- key: 0,
255
- class: "timeline-detail__section"
256
- }, ct = {
257
- key: 0,
258
- class: "timeline-detail__subsection"
259
- }, mt = ["aria-expanded"], yt = { class: "text-muted" }, _t = {
260
- id: "responseHeaders-panel",
261
- class: "timeline-detail__subsection-content"
262
- }, ft = { class: "timeline-detail__kv-key font-mono" }, vt = { class: "timeline-detail__kv-value font-mono" }, pt = {
263
- key: 1,
264
- class: "timeline-detail__subsection"
265
- }, ht = {
266
- class: "timeline-detail__subsection-header",
267
- role: "group"
268
- }, gt = ["aria-expanded"], bt = {
269
- id: "responseBody-panel",
270
- class: "timeline-detail__subsection-content"
271
- }, xt = { class: "timeline-detail__json" }, kt = {
272
- key: 1,
273
- class: "timeline-detail__section timeline-detail__section--pending"
274
- }, qt = { class: "timeline-detail__pending" }, Ct = /* @__PURE__ */ ue({
275
- __name: "TimelineDetail",
276
- props: {
277
- entry: {}
278
- },
279
- setup(n) {
280
- const s = n, r = T({
281
- requestHeaders: !0,
282
- requestQuery: !0,
283
- requestBody: !0,
284
- responseHeaders: !0,
285
- responseBody: !0
286
- }), d = T(null), q = v(() => s.entry ? new Date(s.entry.request.timestamp).toLocaleString("en-US", {
287
- year: "numeric",
288
- month: "short",
289
- day: "numeric",
290
- hour: "2-digit",
291
- minute: "2-digit",
292
- second: "2-digit",
293
- fractionalSecondDigits: 3,
294
- hour12: !1
295
- }) : ""), g = v(() => s.entry?.duration == null ? "pending..." : s.entry.duration < 1e3 ? `${s.entry.duration}ms` : `${(s.entry.duration / 1e3).toFixed(2)}s`), p = v(() => s.entry?.status ? s.entry.status < 200 ? "status-badge--1xx" : s.entry.status < 300 ? "status-badge--2xx" : s.entry.status < 400 ? "status-badge--3xx" : s.entry.status < 500 ? "status-badge--4xx" : "status-badge--5xx" : "status-badge--pending"), z = v(() => s.entry?.request.query ? Object.keys(s.entry.request.query).length > 0 : !1), H = v(() => s.entry?.request.headers ? Object.keys(s.entry.request.headers).length > 0 : !1), B = v(() => s.entry?.request.body !== void 0 && s.entry?.request.body !== null), Q = v(() => s.entry?.response?.headers ? Object.keys(s.entry.response.headers).length > 0 : !1), O = v(() => s.entry?.response?.body !== void 0 && s.entry?.response?.body !== null);
296
- function D(b) {
297
- try {
298
- return JSON.stringify(b, null, 2);
299
- } catch {
300
- return String(b);
301
- }
302
- }
303
- function w(b) {
304
- r.value[b] = !r.value[b];
305
- }
306
- async function L(b, l) {
307
- try {
308
- await navigator.clipboard.writeText(b), d.value = l, setTimeout(() => {
309
- d.value = null;
310
- }, 2e3);
311
- } catch (f) {
312
- console.error("Failed to copy:", f);
313
- }
314
- }
315
- async function U() {
316
- if (!s.entry) return;
317
- const b = {
318
- request: s.entry.request,
319
- response: s.entry.response
320
- };
321
- await L(JSON.stringify(b, null, 2), "full");
322
- }
323
- return (b, l) => (o(), u("div", Be, [
324
- n.entry ? (o(), u("div", Ee, [
325
- e("div", Ie, [
326
- e("div", Re, [
327
- e("span", {
328
- class: R(["method-badge", `method-badge--${n.entry.request.method.toLowerCase()}`])
329
- }, c(a(_e)(n.entry.request.method)), 3),
330
- e("span", ze, c(n.entry.request.path), 1)
331
- ]),
332
- e("div", Oe, [
333
- n.entry.status !== null ? (o(), u("span", {
334
- key: 0,
335
- class: R(["status-badge", p.value])
336
- }, c(n.entry.status), 3)) : (o(), u("span", De, "pending")),
337
- e("span", Fe, [
338
- x(a(P), { size: 14 }),
339
- A(" " + c(g.value), 1)
340
- ]),
341
- n.entry.simulated ? (o(), u("span", He, [
342
- x(a(ve), { size: 14 }),
343
- l[9] || (l[9] = A(" Simulated ", -1))
344
- ])) : k("", !0)
345
- ]),
346
- e("div", Qe, [
347
- e("button", {
348
- type: "button",
349
- class: "btn btn--ghost btn--sm",
350
- title: "Copy as JSON",
351
- onClick: U
352
- }, [
353
- (o(), $(S(d.value === "full" ? a(oe) : a(re)), { size: 14 })),
354
- A(" " + c(d.value === "full" ? "Copied!" : "Copy JSON"), 1)
355
- ])
356
- ])
357
- ]),
358
- e("div", Le, [
359
- e("div", Me, [
360
- l[10] || (l[10] = e("span", { class: "timeline-detail__info-label" }, "Timestamp", -1)),
361
- e("span", Ae, c(q.value), 1)
362
- ]),
363
- e("div", Ne, [
364
- l[11] || (l[11] = e("span", { class: "timeline-detail__info-label" }, "Operation ID", -1)),
365
- e("span", je, c(n.entry.request.operationId), 1)
366
- ]),
367
- e("div", Pe, [
368
- l[12] || (l[12] = e("span", { class: "timeline-detail__info-label" }, "Request ID", -1)),
369
- e("span", Ue, c(n.entry.id), 1)
370
- ])
371
- ]),
372
- e("div", Je, [
373
- l[16] || (l[16] = e("h3", { class: "timeline-detail__section-title" }, "Request", -1)),
374
- z.value ? (o(), u("div", Ve, [
375
- e("button", {
376
- type: "button",
377
- class: "timeline-detail__subsection-header",
378
- "aria-expanded": r.value.requestQuery,
379
- "aria-controls": "requestQuery-panel",
380
- onClick: l[0] || (l[0] = (f) => w("requestQuery"))
381
- }, [
382
- (o(), $(S(r.value.requestQuery ? a(N) : a(Z)), { size: 16 })),
383
- l[13] || (l[13] = e("span", null, "Query Parameters", -1)),
384
- e("span", Ze, "(" + c(Object.keys(n.entry.request.query).length) + ")", 1)
385
- ], 8, We),
386
- V(e("div", Ge, [
387
- (o(!0), u(M, null, j(n.entry.request.query, (f, C) => (o(), u("div", {
388
- key: C,
389
- class: "timeline-detail__kv-row"
390
- }, [
391
- e("span", Ke, c(C), 1),
392
- e("span", Xe, c(Array.isArray(f) ? f.join(", ") : f), 1)
393
- ]))), 128))
394
- ], 512), [
395
- [W, r.value.requestQuery]
396
- ])
397
- ])) : k("", !0),
398
- H.value ? (o(), u("div", Ye, [
399
- e("button", {
400
- type: "button",
401
- class: "timeline-detail__subsection-header",
402
- "aria-expanded": r.value.requestHeaders,
403
- "aria-controls": "requestHeaders-panel",
404
- onClick: l[1] || (l[1] = (f) => w("requestHeaders"))
405
- }, [
406
- (o(), $(S(r.value.requestHeaders ? a(N) : a(Z)), { size: 16 })),
407
- l[14] || (l[14] = e("span", null, "Headers", -1)),
408
- e("span", tt, "(" + c(Object.keys(n.entry.request.headers).length) + ")", 1)
409
- ], 8, et),
410
- V(e("div", st, [
411
- (o(!0), u(M, null, j(n.entry.request.headers, (f, C) => (o(), u("div", {
412
- key: C,
413
- class: "timeline-detail__kv-row"
414
- }, [
415
- e("span", nt, c(C), 1),
416
- e("span", it, c(f), 1)
417
- ]))), 128))
418
- ], 512), [
419
- [W, r.value.requestHeaders]
420
- ])
421
- ])) : k("", !0),
422
- B.value ? (o(), u("div", lt, [
423
- e("div", at, [
424
- e("button", {
425
- type: "button",
426
- class: "timeline-detail__subsection-toggle",
427
- "aria-expanded": r.value.requestBody,
428
- "aria-controls": "requestBody-panel",
429
- onClick: l[2] || (l[2] = (f) => w("requestBody"))
430
- }, [
431
- (o(), $(S(r.value.requestBody ? a(N) : a(Z)), { size: 16 })),
432
- l[15] || (l[15] = e("span", null, "Body", -1))
433
- ], 8, ot),
434
- e("button", {
435
- type: "button",
436
- class: "btn btn--ghost btn--icon btn--sm",
437
- title: "Copy body",
438
- onClick: l[3] || (l[3] = ce((f) => L(D(n.entry.request.body), "reqBody"), ["stop"]))
439
- }, [
440
- (o(), $(S(d.value === "reqBody" ? a(oe) : a(re)), { size: 12 }))
441
- ])
442
- ]),
443
- V(e("div", rt, [
444
- e("pre", ut, c(D(n.entry.request.body)), 1)
445
- ], 512), [
446
- [W, r.value.requestBody]
447
- ])
448
- ])) : k("", !0)
449
- ]),
450
- n.entry.response ? (o(), u("div", dt, [
451
- l[19] || (l[19] = e("h3", { class: "timeline-detail__section-title" }, "Response", -1)),
452
- Q.value ? (o(), u("div", ct, [
453
- e("button", {
454
- type: "button",
455
- class: "timeline-detail__subsection-header",
456
- "aria-expanded": r.value.responseHeaders,
457
- "aria-controls": "responseHeaders-panel",
458
- onClick: l[4] || (l[4] = (f) => w("responseHeaders"))
459
- }, [
460
- (o(), $(S(r.value.responseHeaders ? a(N) : a(Z)), { size: 16 })),
461
- l[17] || (l[17] = e("span", null, "Headers", -1)),
462
- e("span", yt, "(" + c(Object.keys(n.entry.response.headers).length) + ")", 1)
463
- ], 8, mt),
464
- V(e("div", _t, [
465
- (o(!0), u(M, null, j(n.entry.response.headers, (f, C) => (o(), u("div", {
466
- key: C,
467
- class: "timeline-detail__kv-row"
468
- }, [
469
- e("span", ft, c(C), 1),
470
- e("span", vt, c(f), 1)
471
- ]))), 128))
472
- ], 512), [
473
- [W, r.value.responseHeaders]
474
- ])
475
- ])) : k("", !0),
476
- O.value ? (o(), u("div", pt, [
477
- e("div", ht, [
478
- e("button", {
479
- type: "button",
480
- class: "timeline-detail__subsection-toggle",
481
- "aria-expanded": r.value.responseBody,
482
- "aria-controls": "responseBody-panel",
483
- onClick: l[5] || (l[5] = (f) => w("responseBody"))
484
- }, [
485
- (o(), $(S(r.value.responseBody ? a(N) : a(Z)), { size: 16 })),
486
- l[18] || (l[18] = e("span", null, "Body", -1))
487
- ], 8, gt),
488
- e("button", {
489
- type: "button",
490
- class: "btn btn--ghost btn--icon btn--sm",
491
- title: "Copy body",
492
- onClick: l[6] || (l[6] = ce((f) => L(D(n.entry.response.body), "resBody"), ["stop"]))
493
- }, [
494
- (o(), $(S(d.value === "resBody" ? a(oe) : a(re)), { size: 12 }))
495
- ])
496
- ]),
497
- V(e("div", bt, [
498
- e("pre", xt, c(D(n.entry.response.body)), 1)
499
- ], 512), [
500
- [W, r.value.responseBody]
501
- ])
502
- ])) : k("", !0)
503
- ])) : (o(), u("div", kt, [
504
- l[21] || (l[21] = e("h3", { class: "timeline-detail__section-title" }, "Response", -1)),
505
- e("div", qt, [
506
- x(a(P), {
507
- size: 24,
508
- class: "timeline-detail__pending-icon"
509
- }),
510
- l[20] || (l[20] = e("span", { class: "text-muted" }, "Waiting for response...", -1))
511
- ])
512
- ]))
513
- ])) : (o(), u("div", we, [
514
- x(a(P), {
515
- size: 48,
516
- class: "timeline-detail__empty-icon"
517
- }),
518
- l[7] || (l[7] = e("h3", { class: "timeline-detail__empty-title" }, "Select an entry", -1)),
519
- l[8] || (l[8] = e("p", { class: "timeline-detail__empty-description" }, " Click on a timeline entry to view its details. ", -1))
520
- ]))
521
- ]));
522
- }
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 = {
524
- key: 1,
525
- class: "status-badge status-badge--pending"
526
- }, It = { class: "timeline-entry__duration font-mono text-muted" }, Rt = {
527
- key: 0,
528
- class: "timeline-entry__simulated",
529
- title: "Simulated response"
530
- }, zt = /* @__PURE__ */ ue({
531
- __name: "TimelineEntry",
532
- props: {
533
- entry: {},
534
- isSelected: { type: Boolean, default: !1 }
535
- },
536
- emits: ["select"],
537
- setup(n, { emit: s }) {
538
- const r = n, d = s, q = v(() => new Date(r.entry.request.timestamp).toLocaleTimeString("en-US", {
539
- hour12: !1,
540
- hour: "2-digit",
541
- minute: "2-digit",
542
- second: "2-digit",
543
- fractionalSecondDigits: 3
544
- })), g = v(() => r.entry.duration === null ? "pending..." : r.entry.duration < 1e3 ? `${r.entry.duration}ms` : `${(r.entry.duration / 1e3).toFixed(2)}s`), p = v(() => r.entry.status === null ? "status-badge--pending" : r.entry.status < 200 ? "status-badge--1xx" : r.entry.status < 300 ? "status-badge--2xx" : r.entry.status < 400 ? "status-badge--3xx" : r.entry.status < 500 ? "status-badge--4xx" : "status-badge--5xx"), z = v(() => r.entry.status === null ? P : r.entry.status < 400 ? Se : qe), H = v(() => r.entry.response === null);
545
- function B() {
546
- d("select", r.entry.id);
547
- }
548
- return (Q, O) => (o(), u("button", {
549
- type: "button",
550
- class: R([
551
- "timeline-entry",
552
- { "timeline-entry--selected": n.isSelected },
553
- { "timeline-entry--pending": H.value },
554
- { "timeline-entry--simulated": n.entry.simulated }
555
- ]),
556
- onClick: B
557
- }, [
558
- e("div", St, c(q.value), 1),
559
- e("div", Tt, [
560
- e("span", {
561
- class: R(["method-badge", `method-badge--${n.entry.request.method.toLowerCase()}`])
562
- }, c(a(_e)(n.entry.request.method)), 3)
563
- ]),
564
- e("div", Bt, c(n.entry.request.path), 1),
565
- e("div", wt, [
566
- n.entry.status !== null ? (o(), u("span", {
567
- key: 0,
568
- class: R(["status-badge", p.value])
569
- }, [
570
- (o(), $(S(z.value), { size: 12 })),
571
- A(" " + c(n.entry.status), 1)
572
- ], 2)) : (o(), u("span", Et, [
573
- x(a(P), { size: 12 }),
574
- O[0] || (O[0] = A(" pending ", -1))
575
- ]))
576
- ]),
577
- e("div", It, c(g.value), 1),
578
- n.entry.simulated ? (o(), u("div", Rt, [
579
- x(a(ve), { size: 14 })
580
- ])) : k("", !0)
581
- ], 2));
582
- }
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 = {
584
- key: 0,
585
- class: "timeline-filter-toggle__badge"
586
- }, At = { class: "timeline-stats" }, Nt = { class: "timeline-stats__item" }, jt = {
587
- key: 0,
588
- class: "timeline-stats__separator"
589
- }, Pt = {
590
- key: 1,
591
- class: "timeline-stats__item"
592
- }, Ut = ["disabled"], Jt = {
593
- key: 0,
594
- class: "timeline-filters"
595
- }, Vt = { class: "timeline-filters__section" }, Wt = { class: "timeline-filters__methods" }, Zt = ["onClick"], Gt = { class: "timeline-filters__section" }, Kt = { class: "timeline-filters__status" }, Xt = ["onClick"], Yt = { class: "timeline-filters__status-count" }, es = { class: "timeline-filters__section" }, ts = { class: "timeline-filters__type" }, ss = {
596
- key: 0,
597
- class: "timeline-filters__actions"
598
- }, ns = { class: "timeline-content" }, is = {
599
- key: 0,
600
- class: "timeline-loading"
601
- }, ls = {
602
- key: 1,
603
- class: "timeline-error"
604
- }, as = { class: "timeline-error__message" }, os = {
605
- key: 2,
606
- class: "timeline-empty empty-state"
607
- }, rs = {
608
- key: 3,
609
- class: "timeline-empty empty-state"
610
- }, us = { class: "timeline-list-panel" }, ds = { class: "timeline-list" }, cs = { class: "timeline-detail-panel" }, ms = /* @__PURE__ */ ue({
611
- __name: "TimelinePage",
612
- setup(n) {
613
- const s = Te(), { send: r, on: d, connected: q } = ke(), g = T(!1), p = T(null), z = [
614
- "GET",
615
- "POST",
616
- "PUT",
617
- "PATCH",
618
- "DELETE",
619
- "OPTIONS",
620
- "HEAD",
621
- "TRACE"
622
- ], H = ["2xx", "3xx", "4xx", "5xx"];
623
- function B() {
624
- q.value && (s.setLoading(!0), r({ type: "get:timeline" }));
625
- }
626
- function Q(y) {
627
- s.setTimelineData(y), s.setLoading(!1);
628
- }
629
- function O(y) {
630
- s.addRequest(y);
631
- }
632
- function D(y) {
633
- s.addResponse(y);
634
- }
635
- function w() {
636
- s.clearTimeline();
637
- }
638
- function L() {
639
- r({ type: "clear:timeline" }), s.clearTimeline();
640
- }
641
- function U(y) {
642
- s.selectEntry(y);
643
- }
644
- function b(y) {
645
- const _ = y.target;
646
- s.setSearchQuery(_.value);
647
- }
648
- function l() {
649
- s.setSearchQuery(""), p.value?.focus();
650
- }
651
- function f(y) {
652
- s.toggleMethodFilter(y);
653
- }
654
- function C(y) {
655
- return s.filter.methods.includes(y);
656
- }
657
- function se(y) {
658
- s.toggleStatusFilter(y);
659
- }
660
- function ne(y) {
661
- return s.filter.statusCodes.includes(y);
662
- }
663
- function ie() {
664
- const y = s.filter.simulatedOnly;
665
- s.setSimulatedFilter(y === !0 ? null : !0);
666
- }
667
- function G() {
668
- s.clearFilters();
669
- }
670
- function le() {
671
- g.value = !g.value;
672
- }
673
- const J = v(() => s.hasActiveFilters()), K = v(() => s.filter.methods.length + s.filter.statusCodes.length + (s.filter.simulatedOnly !== null ? 1 : 0));
674
- let X = null, Y = null, ee = null, te = null;
675
- return pe(() => {
676
- X = d("timeline", Q), Y = d("request", O), ee = d("response", D), te = d("timeline:cleared", w), q.value && B();
677
- }), he(() => {
678
- X?.(), Y?.(), ee?.(), te?.();
679
- }), ge(q, (y) => {
680
- y && B();
681
- }), (y, _) => (o(), u("div", Dt, [
682
- e("div", Ft, [
683
- e("div", Ht, [
684
- x(a(me), {
685
- size: 16,
686
- class: "timeline-search__icon"
687
- }),
688
- e("input", {
689
- ref_key: "searchInputRef",
690
- ref: p,
691
- type: "text",
692
- class: "timeline-search__input input",
693
- placeholder: "Search by path or operation...",
694
- value: a(s).filter.searchQuery,
695
- onInput: b
696
- }, null, 40, Qt),
697
- a(s).filter.searchQuery ? (o(), u("button", {
698
- key: 0,
699
- type: "button",
700
- class: "timeline-search__clear btn btn--ghost btn--icon",
701
- title: "Clear search",
702
- onClick: l
703
- }, [
704
- x(a(ye), { size: 14 })
705
- ])) : k("", !0)
706
- ]),
707
- e("button", {
708
- type: "button",
709
- class: R([
710
- "timeline-filter-toggle btn btn--secondary",
711
- { "timeline-filter-toggle--active": J.value }
712
- ]),
713
- "aria-expanded": g.value,
714
- onClick: le
715
- }, [
716
- x(a(be), { size: 16 }),
717
- _[0] || (_[0] = e("span", null, "Filters", -1)),
718
- K.value > 0 ? (o(), u("span", Mt, c(K.value), 1)) : k("", !0),
719
- (o(), $(S(g.value ? a(xe) : a(N)), { size: 14 }))
720
- ], 10, Lt),
721
- e("div", At, [
722
- e("span", Nt, c(a(s).filteredEntries.length) + " requests ", 1),
723
- a(s).averageDuration > 0 ? (o(), u("span", jt, "|")) : k("", !0),
724
- a(s).averageDuration > 0 ? (o(), u("span", Pt, " avg " + c(a(s).averageDuration) + "ms ", 1)) : k("", !0)
725
- ]),
726
- e("button", {
727
- type: "button",
728
- class: "btn btn--secondary btn--icon",
729
- title: "Clear timeline",
730
- disabled: a(s).entries.length === 0,
731
- onClick: L
732
- }, [
733
- x(a($e), { size: 16 })
734
- ], 8, Ut)
735
- ]),
736
- g.value ? (o(), u("div", Jt, [
737
- e("div", Vt, [
738
- _[1] || (_[1] = e("h4", { class: "timeline-filters__title" }, "Methods", -1)),
739
- e("div", Wt, [
740
- (o(), u(M, null, j(z, (h) => e("button", {
741
- key: h,
742
- type: "button",
743
- class: R([
744
- "method-badge",
745
- `method-badge--${h.toLowerCase()}`,
746
- { "method-badge--inactive": !C(h) && a(s).filter.methods.length > 0 }
747
- ]),
748
- onClick: (ae) => f(h)
749
- }, c(h), 11, Zt)), 64))
750
- ])
751
- ]),
752
- e("div", Gt, [
753
- _[2] || (_[2] = e("h4", { class: "timeline-filters__title" }, "Status", -1)),
754
- e("div", Kt, [
755
- (o(), u(M, null, j(H, (h) => e("button", {
756
- key: h,
757
- type: "button",
758
- class: R([
759
- "timeline-filters__status-btn",
760
- `timeline-filters__status-btn--${h}`,
761
- { "timeline-filters__status-btn--active": ne(h) }
762
- ]),
763
- onClick: (ae) => se(h)
764
- }, [
765
- A(c(h) + " ", 1),
766
- e("span", Yt, " (" + c(a(s).statusCounts[h]) + ") ", 1)
767
- ], 10, Xt)), 64))
768
- ])
769
- ]),
770
- e("div", es, [
771
- _[3] || (_[3] = e("h4", { class: "timeline-filters__title" }, "Type", -1)),
772
- e("div", ts, [
773
- e("button", {
774
- type: "button",
775
- class: R([
776
- "timeline-filters__status-btn",
777
- { "timeline-filters__status-btn--active": a(s).filter.simulatedOnly }
778
- ]),
779
- onClick: ie
780
- }, " Simulated only ", 2)
781
- ])
782
- ]),
783
- J.value ? (o(), u("div", ss, [
784
- e("button", {
785
- type: "button",
786
- class: "btn btn--ghost",
787
- onClick: G
788
- }, [
789
- x(a(ye), { size: 14 }),
790
- _[4] || (_[4] = A(" Clear all filters ", -1))
791
- ])
792
- ])) : k("", !0)
793
- ])) : k("", !0),
794
- e("div", ns, [
795
- a(s).isLoading ? (o(), u("div", is, [..._[5] || (_[5] = [
796
- e("div", { class: "timeline-loading__spinner" }, null, -1),
797
- e("span", { class: "text-muted" }, "Loading timeline...", -1)
798
- ])])) : a(s).error ? (o(), u("div", ls, [
799
- e("p", as, c(a(s).error), 1),
800
- e("button", {
801
- type: "button",
802
- class: "btn btn--primary",
803
- onClick: B
804
- }, " Retry ")
805
- ])) : a(s).entries.length === 0 ? (o(), u("div", os, [
806
- x(a(P), {
807
- size: 48,
808
- class: "empty-state__icon"
809
- }),
810
- _[6] || (_[6] = e("h3", { class: "empty-state__title" }, "No requests yet", -1)),
811
- _[7] || (_[7] = e("p", { class: "empty-state__description" }, " API requests will appear here in real-time as they are made. ", -1))
812
- ])) : a(s).filteredEntries.length === 0 ? (o(), u("div", rs, [
813
- x(a(me), {
814
- size: 48,
815
- class: "empty-state__icon"
816
- }),
817
- _[8] || (_[8] = e("h3", { class: "empty-state__title" }, "No matching requests", -1)),
818
- _[9] || (_[9] = e("p", { class: "empty-state__description" }, " Try adjusting your search or filters. ", -1)),
819
- J.value ? (o(), u("button", {
820
- key: 0,
821
- type: "button",
822
- class: "btn btn--secondary",
823
- onClick: G
824
- }, " Clear filters ")) : k("", !0)
825
- ])) : (o(), u(M, { key: 4 }, [
826
- e("div", us, [
827
- e("div", ds, [
828
- (o(!0), u(M, null, j(a(s).filteredEntries, (h) => (o(), $(Ot, {
829
- key: h.id,
830
- entry: h,
831
- "is-selected": a(s).selectedEntryId === h.id,
832
- onSelect: U
833
- }, null, 8, ["entry", "is-selected"]))), 128))
834
- ])
835
- ]),
836
- e("div", cs, [
837
- x($t, {
838
- entry: a(s).selectedEntry
839
- }, null, 8, ["entry"])
840
- ])
841
- ], 64))
842
- ])
843
- ]));
844
- }
845
- }), xs = /* @__PURE__ */ de(ms, [["__scopeId", "data-v-a5c73778"]]);
846
- export {
847
- xs as default
848
- };
849
- //# sourceMappingURL=TimelinePage-BhtcWy3o.js.map