@debugkit/dashboard 0.7.0 → 0.9.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.
Files changed (62) hide show
  1. package/dist/client/assets/_authed-C29P68T-.js +1 -0
  2. package/dist/client/assets/_authed-D-dYbHoP.js +7 -0
  3. package/dist/client/assets/{charts-XyOWJI9T.js → charts--S1o8iId.js} +6 -6
  4. package/dist/client/assets/copy-button-BJkvWYRY.js +1 -0
  5. package/dist/client/assets/customers-Cwx5qEO1.js +1 -0
  6. package/dist/client/assets/endpoints-zz1TotR2.js +1 -0
  7. package/dist/client/assets/events._eventId-Bx6TfUjv.js +3 -0
  8. package/dist/client/assets/index-COHr_cc3.js +10 -0
  9. package/dist/client/assets/invite._token-DiDJMnQu.js +1 -0
  10. package/dist/client/assets/issues._fingerprint-Cv522h2j.js +1 -0
  11. package/dist/client/assets/login-CKkpc0t5.js +1 -0
  12. package/dist/client/assets/sessions._sessionId-B0NxM46y.js +1 -0
  13. package/dist/client/assets/settings-CIlF10MI.js +1 -0
  14. package/dist/client/assets/src-BKSiJUs3.js +3 -0
  15. package/dist/client/assets/styles-GAsMUS4-.css +2 -0
  16. package/dist/client/assets/team-BRuVQ2bU.js +1 -0
  17. package/dist/client/assets/timeline-BIGo9MCA.js +1 -0
  18. package/dist/client/assets/ui-CaEZB1j2.js +1 -0
  19. package/dist/client/assets/version-banner-VFvyqbPh.js +1 -0
  20. package/dist/server/assets/_authed-BJWDiF9i.js +92 -0
  21. package/dist/server/assets/{_authed-C-sIPXSO.js → _authed-X9u_5JUy.js} +318 -126
  22. package/dist/server/assets/_tanstack-start-manifest_v-C6vaeBdY.js +90 -0
  23. package/dist/server/assets/copy-button-D3RddzTw.js +52 -0
  24. package/dist/server/assets/customers-827fC5I3.js +163 -0
  25. package/dist/server/assets/{demo-BsMMDk_F.js → demo-DDNiXCgj.js} +29 -7
  26. package/dist/server/assets/{dynamodb-Zkk1-mgz.js → dynamodb-Cd4blXkh.js} +98 -17
  27. package/dist/server/assets/endpoints-_T0NSOyA.js +371 -0
  28. package/dist/server/assets/{queries-BJxX3Kjp.js → errors-Po4Tt5zd.js} +893 -66
  29. package/dist/server/assets/events._eventId-Dcsu4oVO.js +765 -0
  30. package/dist/server/assets/{firestore-C52q_vwM.js → firestore-c8Sz2Q4O.js} +26 -6
  31. package/dist/server/assets/{fns-DwGaMi8S.js → fns-BiUOnY1_.js} +27 -3
  32. package/dist/server/assets/fns-CVbk8Gf9.js +1310 -0
  33. package/dist/server/assets/{invite._token-xnpnkdRv.js → invite._token-7DjEeeaD.js} +3 -3
  34. package/dist/server/assets/{issues._fingerprint-e7ubdJf0.js → issues._fingerprint-vc9r3jgg.js} +89 -11
  35. package/dist/server/assets/{login-EopnOJXA.js → login-CwKAx9Bj.js} +3 -3
  36. package/dist/server/assets/{memory-BssaqdZm.js → memory-Bv4C8uyK.js} +431 -28
  37. package/dist/server/assets/router-Dk3XHn7B.js +512 -0
  38. package/dist/server/assets/sessions._sessionId-BvXxK9qF.js +264 -0
  39. package/dist/server/assets/{settings-CaJN69N6.js → settings-B9NLQjl1.js} +221 -5
  40. package/dist/server/assets/{src-D83GYTrp.js → src-oWPSAvXv.js} +1 -1
  41. package/dist/server/assets/{team-B1UcM1jA.js → team-Bsm2wFG0.js} +3 -3
  42. package/dist/server/assets/timeline-MDRNDhiA.js +132 -0
  43. package/dist/server/assets/{ui-BJokJdYa.js → ui-SAkSlP7f.js} +53 -13
  44. package/dist/server/assets/version-banner-nf-yZurq.js +106 -0
  45. package/dist/server/assets/versions-BOlL8jam.js +58 -0
  46. package/dist/server/server.js +41 -21
  47. package/package.json +4 -4
  48. package/dist/client/assets/_authed-BN39b-7H.js +0 -1
  49. package/dist/client/assets/_authed-CspAf0jN.js +0 -7
  50. package/dist/client/assets/index-Bfb2UOzB.js +0 -10
  51. package/dist/client/assets/invite._token-B4HN51-h.js +0 -1
  52. package/dist/client/assets/issues._fingerprint-BV1QrETY.js +0 -1
  53. package/dist/client/assets/login-COlvJ5Je.js +0 -1
  54. package/dist/client/assets/preload-helper-Dscj_TcA.js +0 -3
  55. package/dist/client/assets/settings-Dl4EWeWC.js +0 -1
  56. package/dist/client/assets/styles-DztngwT9.css +0 -2
  57. package/dist/client/assets/team-7Zekz_Er.js +0 -1
  58. package/dist/client/assets/ui-C0HGOza2.js +0 -1
  59. package/dist/server/assets/_authed-CrjuC0O3.js +0 -73
  60. package/dist/server/assets/_tanstack-start-manifest_v-CqaE4wze.js +0 -61
  61. package/dist/server/assets/fns-mbUIXXep.js +0 -529
  62. package/dist/server/assets/router-G99085_Q.js +0 -315
@@ -0,0 +1,371 @@
1
+ import { n as RetentionNote, t as RangePicker } from "./range-picker-0zbSGr3Z.js";
2
+ import { a as joined, i as clock } from "./timeline-MDRNDhiA.js";
3
+ import { l as timeAgo, t as Card } from "./ui-SAkSlP7f.js";
4
+ import { c as Route } from "./router-Dk3XHn7B.js";
5
+ import { Link, useNavigate } from "@tanstack/react-router";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ // src/routes/_authed/endpoints.tsx?tsr-split=component
8
+ var SORTS = {
9
+ failing: "Most failures",
10
+ slow: "Slowest",
11
+ busy: "Busiest"
12
+ };
13
+ function EndpointsPage() {
14
+ const report = Route.useLoaderData();
15
+ const { sort = "failing" } = Route.useSearch();
16
+ const navigate = useNavigate({ from: Route.fullPath });
17
+ if (!report) return /* @__PURE__ */ jsx("main", {
18
+ className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
19
+ children: /* @__PURE__ */ jsx("h1", {
20
+ className: "text-xl font-semibold",
21
+ children: "No apps have sent events yet"
22
+ })
23
+ });
24
+ const { range, services, selected } = report;
25
+ const endpoints = sorted(report.endpoints, sort);
26
+ return /* @__PURE__ */ jsxs("main", {
27
+ className: "mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6",
28
+ children: [
29
+ /* @__PURE__ */ jsxs("div", {
30
+ className: "flex flex-wrap items-end justify-between gap-3",
31
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h1", {
32
+ className: "text-xl font-semibold tracking-tight",
33
+ children: "Endpoints"
34
+ }), /* @__PURE__ */ jsxs("p", {
35
+ className: "mt-1 text-sm text-muted",
36
+ children: [
37
+ "Which backend services and calls fail or are slow in ",
38
+ range.label,
39
+ "."
40
+ ]
41
+ })] }), /* @__PURE__ */ jsxs("div", {
42
+ className: "flex flex-wrap items-center gap-2",
43
+ children: [/* @__PURE__ */ jsx(RangePicker, {
44
+ value: range,
45
+ today: report.generatedAt.slice(0, 10),
46
+ onChange: (r) => navigate({ search: (s) => ({
47
+ ...s,
48
+ ...r
49
+ }) })
50
+ }, `${range.preset}${range.from}${range.to}`), report.apps.length > 1 && /* @__PURE__ */ jsx("select", {
51
+ "aria-label": "App",
52
+ value: report.app,
53
+ onChange: (e) => navigate({ search: (s) => ({
54
+ ...s,
55
+ app: e.target.value,
56
+ endpoint: void 0
57
+ }) }),
58
+ className: "rounded-md border border-line bg-panel px-2 py-1.5 text-sm",
59
+ children: report.apps.map((a) => /* @__PURE__ */ jsx("option", { children: a }, a))
60
+ })]
61
+ })]
62
+ }),
63
+ /* @__PURE__ */ jsx(RetentionNote, {
64
+ rangeFrom: range.from,
65
+ retention: report.retention
66
+ }),
67
+ selected && /* @__PURE__ */ jsx(EndpointDetail, {
68
+ app: report.app,
69
+ row: selected.endpoint,
70
+ failures: selected.failures
71
+ }),
72
+ report.missing && /* @__PURE__ */ jsxs("p", {
73
+ className: "rounded-lg border border-line bg-panel-2 px-3 py-2 text-sm text-muted",
74
+ children: [
75
+ /* @__PURE__ */ jsx("span", {
76
+ className: "font-mono text-ink",
77
+ children: report.missing
78
+ }),
79
+ " had no calls or failures in ",
80
+ range.label,
81
+ "."
82
+ ]
83
+ }),
84
+ endpoints.length === 0 ? /* @__PURE__ */ jsxs("p", {
85
+ className: "text-sm text-muted",
86
+ children: [
87
+ "No API calls recorded in ",
88
+ range.label,
89
+ ". Calls are counted when the SDK's network capture is on, and failures when they're stored as errors."
90
+ ]
91
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [services.length > 1 && /* @__PURE__ */ jsx(Services, { rows: services }), /* @__PURE__ */ jsxs(Card, {
92
+ title: `${endpoints.length} endpoint${endpoints.length === 1 ? "" : "s"}`,
93
+ subtitle: "Calls, failure rate and timings count every call the SDK saw. Statuses and backend codes count the stored failures, which the SDK samples.",
94
+ right: /* @__PURE__ */ jsx("span", {
95
+ className: "flex gap-1 text-xs",
96
+ role: "group",
97
+ "aria-label": "Sort endpoints",
98
+ children: Object.keys(SORTS).map((k) => /* @__PURE__ */ jsx(Link, {
99
+ to: "/endpoints",
100
+ search: (s) => ({
101
+ ...s,
102
+ sort: k === "failing" ? void 0 : k
103
+ }),
104
+ "aria-pressed": sort === k,
105
+ className: `whitespace-nowrap rounded-md border px-2 py-1 ${sort === k ? "border-ink text-ink" : "border-line text-muted hover:text-ink"}`,
106
+ children: SORTS[k]
107
+ }, k))
108
+ }),
109
+ children: [
110
+ /* @__PURE__ */ jsx("div", {
111
+ className: "-mx-4 overflow-x-auto sm:mx-0",
112
+ children: /* @__PURE__ */ jsxs("table", {
113
+ className: "tabular w-full min-w-[720px] text-left text-sm",
114
+ children: [/* @__PURE__ */ jsx("thead", {
115
+ className: "text-xs text-muted",
116
+ children: /* @__PURE__ */ jsxs("tr", {
117
+ className: "border-b border-line",
118
+ children: [
119
+ /* @__PURE__ */ jsx("th", {
120
+ className: "px-4 py-2 font-medium sm:px-2",
121
+ children: "Endpoint"
122
+ }),
123
+ /* @__PURE__ */ jsx("th", {
124
+ className: "px-2 py-2 text-right font-medium",
125
+ children: "Calls"
126
+ }),
127
+ /* @__PURE__ */ jsx("th", {
128
+ className: "px-2 py-2 text-right font-medium",
129
+ children: "Failed"
130
+ }),
131
+ /* @__PURE__ */ jsx("th", {
132
+ className: "px-2 py-2 text-right font-medium",
133
+ children: "p50"
134
+ }),
135
+ /* @__PURE__ */ jsx("th", {
136
+ className: "px-2 py-2 text-right font-medium",
137
+ children: "p95"
138
+ }),
139
+ /* @__PURE__ */ jsx("th", {
140
+ className: "px-2 py-2 font-medium",
141
+ children: "Statuses"
142
+ }),
143
+ /* @__PURE__ */ jsx("th", {
144
+ className: "px-2 py-2 font-medium",
145
+ children: "Backend codes"
146
+ })
147
+ ]
148
+ })
149
+ }), /* @__PURE__ */ jsx("tbody", { children: endpoints.map((r) => /* @__PURE__ */ jsxs("tr", {
150
+ className: `border-b border-line last:border-0 ${selected?.endpoint.endpoint === r.endpoint ? "bg-panel-2" : ""}`,
151
+ children: [
152
+ /* @__PURE__ */ jsx("td", {
153
+ className: "max-w-[320px] px-4 py-2 sm:px-2",
154
+ children: /* @__PURE__ */ jsx(Link, {
155
+ to: "/endpoints",
156
+ search: (s) => ({
157
+ ...s,
158
+ endpoint: r.endpoint
159
+ }),
160
+ className: "block hover:underline",
161
+ title: r.endpoint,
162
+ children: /* @__PURE__ */ jsx(EndpointName, { row: r })
163
+ })
164
+ }),
165
+ /* @__PURE__ */ jsx("td", {
166
+ className: "px-2 py-2 text-right text-muted",
167
+ children: count(r.calls)
168
+ }),
169
+ /* @__PURE__ */ jsx("td", {
170
+ className: `px-2 py-2 text-right ${r.failureRate !== null && r.failureRate >= .05 ? "font-semibold text-sev-critical" : "text-muted"}`,
171
+ children: r.failureRate !== null ? pct(r.failureRate) : r.failures ? `${r.failures} stored` : "—"
172
+ }),
173
+ /* @__PURE__ */ jsx("td", {
174
+ className: "px-2 py-2 text-right",
175
+ children: ms(r.p50)
176
+ }),
177
+ /* @__PURE__ */ jsx("td", {
178
+ className: `px-2 py-2 text-right font-semibold ${r.p95 !== null && r.p95 >= 3e3 ? "text-sev-high" : ""}`,
179
+ children: ms(r.p95)
180
+ }),
181
+ /* @__PURE__ */ jsx("td", {
182
+ className: "px-2 py-2",
183
+ children: /* @__PURE__ */ jsx(Counts, { items: r.statuses })
184
+ }),
185
+ /* @__PURE__ */ jsx("td", {
186
+ className: "px-2 py-2",
187
+ children: /* @__PURE__ */ jsx(Counts, { items: r.backendCodes })
188
+ })
189
+ ]
190
+ }, r.endpoint)) })]
191
+ })
192
+ }),
193
+ /* @__PURE__ */ jsx("p", {
194
+ className: "mt-2 text-xs text-muted",
195
+ children: "Failed: calls the SDK counted as failed (status 400 and above on mobile). p50/p95: half / 95% of calls finished within this time. \"—\": the SDK sent no request timings for that endpoint."
196
+ }),
197
+ report.truncated && /* @__PURE__ */ jsx("p", {
198
+ className: "mt-1 text-xs text-muted",
199
+ children: "There were more stored failures than one page reads: statuses, backend codes and failure lists may be undercounted. Pick a shorter period for exact ones."
200
+ })
201
+ ]
202
+ })] })
203
+ ]
204
+ });
205
+ }
206
+ function EndpointDetail({ app, row, failures }) {
207
+ return /* @__PURE__ */ jsxs(Card, {
208
+ title: joined([
209
+ row.service,
210
+ row.method,
211
+ row.path
212
+ ]) ?? row.endpoint,
213
+ subtitle: `${row.failures} stored failure${row.failures === 1 ? "" : "s"} in this period${row.lastFailure ? `, the last ${timeAgo(row.lastFailure)}` : ""}. Newest first.`,
214
+ children: [/* @__PURE__ */ jsxs("div", {
215
+ className: "mb-3 flex flex-wrap gap-x-6 gap-y-1 text-sm",
216
+ children: [
217
+ /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
218
+ className: "text-muted",
219
+ children: "Calls "
220
+ }), count(row.calls)] }),
221
+ /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
222
+ className: "text-muted",
223
+ children: "Failure rate "
224
+ }), rate(row.failureRate)] }),
225
+ /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
226
+ className: "text-muted",
227
+ children: "p50 "
228
+ }), ms(row.p50)] }),
229
+ /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
230
+ className: "text-muted",
231
+ children: "p95 "
232
+ }), ms(row.p95)] }),
233
+ /* @__PURE__ */ jsx(Link, {
234
+ to: "/endpoints",
235
+ search: (s) => ({
236
+ ...s,
237
+ endpoint: void 0
238
+ }),
239
+ className: "ml-auto text-xs text-muted hover:text-ink hover:underline",
240
+ children: "Close"
241
+ })
242
+ ]
243
+ }), failures.length === 0 ? /* @__PURE__ */ jsx("p", {
244
+ className: "text-sm text-muted",
245
+ children: "No stored failures for this endpoint in this period."
246
+ }) : /* @__PURE__ */ jsx("ul", {
247
+ className: "divide-y divide-line",
248
+ children: failures.map((f) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Link, {
249
+ to: "/events/$eventId",
250
+ params: { eventId: f.eventId },
251
+ search: {
252
+ app,
253
+ issue: f.fingerprint
254
+ },
255
+ className: "grid grid-cols-[1fr_auto] gap-x-4 gap-y-0.5 px-1 py-2 text-sm hover:bg-panel-2 sm:grid-cols-[11rem_5rem_1fr_auto]",
256
+ children: [
257
+ /* @__PURE__ */ jsx("span", {
258
+ title: f.ts,
259
+ children: clock(f.ts)
260
+ }),
261
+ /* @__PURE__ */ jsx("span", {
262
+ className: "justify-self-end font-semibold text-sev-critical sm:justify-self-start",
263
+ children: f.status
264
+ }),
265
+ /* @__PURE__ */ jsx("span", {
266
+ className: "min-w-0 break-words text-muted",
267
+ children: joined([
268
+ f.backendCode && `code ${f.backendCode}`,
269
+ f.backendTitle && `"${f.backendTitle}"`,
270
+ f.errorKind,
271
+ f.traceId && `trace ${f.traceId.slice(0, 8)}…`
272
+ ], " · ") ?? "No backend detail"
273
+ }),
274
+ /* @__PURE__ */ jsxs("span", {
275
+ className: "font-mono text-xs text-muted sm:text-right",
276
+ children: [f.userId ?? "", f.durationMs !== void 0 ? ` · ${f.durationMs} ms` : ""]
277
+ })
278
+ ]
279
+ }) }, f.eventId))
280
+ })]
281
+ });
282
+ }
283
+ /** Endpoints added up per backend service: which one is failing or slow, at a glance. */
284
+ function Services({ rows }) {
285
+ return /* @__PURE__ */ jsxs(Card, {
286
+ title: "By service",
287
+ subtitle: "Each backend service's endpoints added up. The slowest p95 is its slowest endpoint's.",
288
+ children: [/* @__PURE__ */ jsx("ul", {
289
+ className: "grid gap-2 sm:grid-cols-2 lg:grid-cols-3",
290
+ children: rows.map((r) => /* @__PURE__ */ jsxs("li", {
291
+ className: "rounded-lg border border-line px-3 py-2 text-sm",
292
+ children: [/* @__PURE__ */ jsxs("div", {
293
+ className: "flex items-baseline justify-between gap-2",
294
+ children: [/* @__PURE__ */ jsx("span", {
295
+ className: r.service ? "font-medium" : "text-muted",
296
+ children: r.service ?? "Unnamed hosts"
297
+ }), /* @__PURE__ */ jsxs("span", {
298
+ className: `tabular ${r.failureRate !== null && r.failureRate >= .05 ? "font-semibold text-sev-critical" : "text-muted"}`,
299
+ children: [rate(r.failureRate), " failed"]
300
+ })]
301
+ }), /* @__PURE__ */ jsxs("div", {
302
+ className: "tabular mt-0.5 text-xs text-muted",
303
+ children: [
304
+ count(r.calls),
305
+ " calls · ",
306
+ r.endpoints,
307
+ " endpoint",
308
+ r.endpoints === 1 ? "" : "s",
309
+ " · slowest p95 ",
310
+ /* @__PURE__ */ jsx("span", {
311
+ className: r.worstP95 !== null && r.worstP95 >= 3e3 ? "font-semibold text-sev-high" : "",
312
+ children: ms(r.worstP95)
313
+ }),
314
+ r.failures > 0 && ` · ${r.failures} stored failure${r.failures === 1 ? "" : "s"}`
315
+ ]
316
+ })]
317
+ }, r.service ?? ""))
318
+ }), rows.some((r) => !r.service) && /* @__PURE__ */ jsx("p", {
319
+ className: "mt-2 text-xs text-muted",
320
+ children: "Name hosts in Settings, or set the SDK's network.baseUrls, to group unnamed ones."
321
+ })]
322
+ });
323
+ }
324
+ /** The endpoints in the order picked: most failures (as the server sends them), slowest p95, or most calls. */
325
+ function sorted(rows, sort) {
326
+ if (sort === "failing") return rows;
327
+ const by = sort === "slow" ? (r) => r.p95 === null ? -1 : Number.isFinite(r.p95) ? r.p95 : 1e9 : (r) => r.calls ?? -1;
328
+ return [...rows].sort((a, b) => by(b) - by(a));
329
+ }
330
+ var count = (n) => n === null ? "—" : n.toLocaleString();
331
+ var rate = (r) => r === null ? "—" : pct(r);
332
+ function EndpointName({ row }) {
333
+ return /* @__PURE__ */ jsxs("span", {
334
+ className: "break-words",
335
+ children: [row.service && /* @__PURE__ */ jsxs("span", {
336
+ className: "font-medium",
337
+ children: [row.service, " "]
338
+ }), /* @__PURE__ */ jsx("span", {
339
+ className: "font-mono text-xs",
340
+ children: joined([row.method, row.path])
341
+ })]
342
+ });
343
+ }
344
+ function Counts({ items }) {
345
+ if (!items.length) return /* @__PURE__ */ jsx("span", {
346
+ className: "text-muted",
347
+ children: "—"
348
+ });
349
+ return /* @__PURE__ */ jsxs("span", {
350
+ className: "flex flex-wrap gap-1",
351
+ children: [items.slice(0, 3).map((c) => /* @__PURE__ */ jsxs("span", {
352
+ className: "rounded bg-panel-2 px-1.5 py-0.5 font-mono text-[11px]",
353
+ children: [c.key, /* @__PURE__ */ jsxs("span", {
354
+ className: "text-muted",
355
+ children: [" ×", c.count]
356
+ })]
357
+ }, c.key)), items.length > 3 && /* @__PURE__ */ jsxs("span", {
358
+ className: "text-[11px] text-muted",
359
+ children: ["+", items.length - 3]
360
+ })]
361
+ });
362
+ }
363
+ function pct(r) {
364
+ return `${(r * 100).toFixed(r < .1 ? 1 : 0)}%`;
365
+ }
366
+ function ms(v) {
367
+ if (v === null) return "—";
368
+ if (!Number.isFinite(v)) return "> 10 s";
369
+ return v >= 1e3 ? `≤ ${(v / 1e3).toFixed(v % 1e3 ? 1 : 0)} s` : `≤ ${v} ms`;
370
+ }
371
+ export { EndpointsPage as component };