@debugkit/dashboard 0.3.1 → 0.5.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 (45) hide show
  1. package/dist/client/assets/_authed-DTn7rMla.js +1 -0
  2. package/dist/client/assets/_authed-Dc7covsB.js +7 -0
  3. package/dist/client/assets/{charts-C76vsG2N.js → charts-C0zeGTzu.js} +18 -18
  4. package/dist/client/assets/index-D12jr1bm.js +10 -0
  5. package/dist/client/assets/issues._fingerprint-C6ryZvIu.js +1 -0
  6. package/dist/client/assets/login-oLP1Yyz3.js +1 -0
  7. package/dist/client/assets/preload-helper-CDziuvpw.js +3 -0
  8. package/dist/client/assets/settings-9oQsCwdV.js +1 -0
  9. package/dist/client/assets/styles-DBg7wMRg.css +2 -0
  10. package/dist/client/assets/ui-BiRMJGWB.js +1 -0
  11. package/dist/server/assets/{_authed-ClbGOSDJ.js → _authed-CuDay0Tl.js} +296 -70
  12. package/dist/server/assets/{_authed-BaehIntL.js → _authed-DODQ_Iys.js} +28 -8
  13. package/dist/server/assets/{_tanstack-start-manifest_v-eNUCOzFz.js → _tanstack-start-manifest_v-BBxgjm04.js} +16 -7
  14. package/dist/server/assets/{charts-CNlV7Pga.js → charts-DzTVqJ8z.js} +21 -4
  15. package/dist/server/assets/{demo-DTdlXNgj.js → demo-hrRBo9_U.js} +87 -10
  16. package/dist/server/assets/dynamodb-DyPK9SVV.js +354 -0
  17. package/dist/server/assets/{firestore-BH-gx9no.js → firestore-B2xzpzYA.js} +89 -5
  18. package/dist/server/assets/fns-DPsnK0zS.js +79 -0
  19. package/dist/server/assets/fns-hk_OJe6M.js +250 -0
  20. package/dist/server/assets/{issues._fingerprint-D78dy5os.js → issues._fingerprint-CZCZDm7t.js} +159 -17
  21. package/dist/server/assets/{login-h3B5Vdhl.js → login-D-UG6SFw.js} +3 -3
  22. package/dist/server/assets/{queries-DIVV-5j6.js → memory-Do0CDoAX.js} +205 -505
  23. package/dist/server/assets/queries-CxHrgTdM.js +955 -0
  24. package/dist/server/assets/range-picker-0zbSGr3Z.js +106 -0
  25. package/dist/server/assets/rolldown-runtime-D8jQpDG7.js +12 -0
  26. package/dist/server/assets/{router-DqTf7XfT.js → router-CIIGBCmL.js} +84 -44
  27. package/dist/server/assets/settings-BHfngShx.js +371 -0
  28. package/dist/server/assets/src-D9VHcuh4.js +491 -0
  29. package/dist/server/assets/src-JXktBs5H.js +4 -0
  30. package/dist/server/assets/{ui-Lv-KcOoP.js → ui-BJokJdYa.js} +25 -3
  31. package/dist/server/server.js +32 -8
  32. package/package.json +4 -4
  33. package/dist/client/assets/_authed-Bi62GTX3.js +0 -7
  34. package/dist/client/assets/_authed-mWCAMokt.js +0 -1
  35. package/dist/client/assets/index-D7uhDdvA.js +0 -12
  36. package/dist/client/assets/issues._fingerprint-fVGLnT37.js +0 -1
  37. package/dist/client/assets/login-MqvT094Y.js +0 -1
  38. package/dist/client/assets/styles-CZZRuG1z.css +0 -2
  39. package/dist/client/assets/ui-Bj6uJIr8.js +0 -1
  40. package/dist/server/assets/dynamodb-DejcakaF.js +0 -187
  41. package/dist/server/assets/fns-CgB12FUN.js +0 -31
  42. package/dist/server/assets/fns-Yg8sT1Cb.js +0 -87
  43. package/dist/server/assets/memory-4DwW5cTO.js +0 -59
  44. package/dist/server/assets/rollups-JXbazRNh.js +0 -22
  45. package/dist/server/assets/src-D5jyi_C4.js +0 -235
@@ -0,0 +1,106 @@
1
+ import { useState } from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ // src/components/range-picker.tsx
4
+ var PRESETS = [
5
+ ["24h", "Last 24 hours"],
6
+ ["7d", "Last 7 days"],
7
+ ["14d", "Last 14 days"],
8
+ ["30d", "Last 30 days"],
9
+ ["90d", "Last 90 days"],
10
+ ["custom", "Custom range…"]
11
+ ];
12
+ function rangeSearch(s) {
13
+ const pick = (k) => typeof s[k] === "string" ? s[k] : void 0;
14
+ return {
15
+ range: pick("range"),
16
+ from: pick("from"),
17
+ to: pick("to")
18
+ };
19
+ }
20
+ /** Preset select, plus two date inputs for a custom range. Calls onChange with the new search params. */
21
+ function RangePicker({ value, today, onChange }) {
22
+ const [custom, setCustom] = useState(value.preset === "custom");
23
+ const [from, setFrom] = useState(value.from);
24
+ const [to, setTo] = useState(value.to);
25
+ const input = "rounded-md border border-line bg-panel px-2 py-1.5 text-sm";
26
+ return /* @__PURE__ */ jsxs("div", {
27
+ className: "flex flex-wrap items-center gap-2",
28
+ children: [/* @__PURE__ */ jsx("select", {
29
+ "aria-label": "Date range",
30
+ value: custom ? "custom" : value.preset,
31
+ onChange: (e) => {
32
+ const v = e.target.value;
33
+ if (v === "custom") return setCustom(true);
34
+ setCustom(false);
35
+ onChange({
36
+ range: v === "14d" ? void 0 : v,
37
+ from: void 0,
38
+ to: void 0
39
+ });
40
+ },
41
+ className: input,
42
+ children: PRESETS.map(([v, label]) => /* @__PURE__ */ jsx("option", {
43
+ value: v,
44
+ children: label
45
+ }, v))
46
+ }), custom && /* @__PURE__ */ jsxs("form", {
47
+ className: "flex flex-wrap items-center gap-2",
48
+ onSubmit: (e) => {
49
+ e.preventDefault();
50
+ if (from && to) onChange({
51
+ range: "custom",
52
+ from: from <= to ? from : to,
53
+ to: from <= to ? to : from
54
+ });
55
+ },
56
+ children: [
57
+ /* @__PURE__ */ jsx("input", {
58
+ type: "date",
59
+ "aria-label": "From",
60
+ value: from,
61
+ max: today,
62
+ onChange: (e) => setFrom(e.target.value),
63
+ className: input
64
+ }),
65
+ /* @__PURE__ */ jsx("span", {
66
+ className: "text-muted",
67
+ children: "to"
68
+ }),
69
+ /* @__PURE__ */ jsx("input", {
70
+ type: "date",
71
+ "aria-label": "To",
72
+ value: to,
73
+ max: today,
74
+ onChange: (e) => setTo(e.target.value),
75
+ className: input
76
+ }),
77
+ /* @__PURE__ */ jsx("button", {
78
+ type: "submit",
79
+ className: "rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white",
80
+ children: "Apply"
81
+ })
82
+ ]
83
+ })]
84
+ });
85
+ }
86
+ /** "Counts kept forever; details from 14 Sep" — shown when the range reaches past retention. */
87
+ function RetentionNote({ rangeFrom, retention }) {
88
+ if (!retention.detailsFrom || rangeFrom >= retention.detailsFrom) return null;
89
+ const when = (/* @__PURE__ */ new Date(`${retention.detailsFrom}T00:00:00Z`)).toLocaleDateString("en-GB", {
90
+ day: "numeric",
91
+ month: "short",
92
+ year: "numeric",
93
+ timeZone: "UTC"
94
+ });
95
+ return /* @__PURE__ */ jsxs("p", {
96
+ className: "rounded-lg border border-line bg-panel-2 px-3 py-2 text-xs text-muted",
97
+ children: [
98
+ "Raw events are kept for ",
99
+ retention.days,
100
+ " days, so details (stack traces, breadcrumbs) before ",
101
+ when,
102
+ " have expired. The counts and charts still cover the whole range."
103
+ ]
104
+ });
105
+ }
106
+ export { RetentionNote as n, rangeSearch as r, RangePicker as t };
@@ -0,0 +1,12 @@
1
+ // \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ export { __exportAll as t };
@@ -1,23 +1,14 @@
1
- import { i as getSessionUser, n as getLoginInfo, r as getOverview, t as getIssueDetail } from "./fns-CgB12FUN.js";
2
- import { n as ingest, r as parseIngestKeys, t as CORS_HEADERS } from "./src-D5jyi_C4.js";
3
- import { a as authorizeApi, d as getLocalWriteStore, f as getStore, n as buildIssueDetail, p as config, r as buildSummary, t as SUMMARY_FIELDS } from "./queries-DIVV-5j6.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.js";
2
+ import { a as getSettings, i as getSessionUser, n as getLoginInfo, r as getOverview, t as getIssueDetail } from "./fns-DPsnK0zS.js";
3
+ import { r as rangeSearch } from "./range-picker-0zbSGr3Z.js";
4
+ import { n as ingest, r as parseIngestKeys, t as CORS_HEADERS } from "./src-D9VHcuh4.js";
5
+ import { a as authorizeApi, b as getStore, n as buildIssueDetail, r as buildSummary, t as SUMMARY_FIELDS, x as config, y as getLocalWriteStore } from "./queries-CxHrgTdM.js";
4
6
  import { HeadContent, Outlet, Scripts, createFileRoute, createRootRoute, createRouter, lazyRouteComponent, notFound, redirect } from "@tanstack/react-router";
5
7
  import { jsx, jsxs } from "react/jsx-runtime";
6
- // \0rolldown/runtime.js
7
- var __defProp = Object.defineProperty;
8
- var __exportAll = (all, no_symbols) => {
9
- let target = {};
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
14
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
- return target;
16
- };
17
8
  // src/styles.css?url
18
- var styles_default = "/assets/styles-CZZRuG1z.css";
9
+ var styles_default = "/assets/styles-DBg7wMRg.css";
19
10
  // src/routes/__root.tsx
20
- var Route$7 = createRootRoute({
11
+ var Route$8 = createRootRoute({
21
12
  head: () => ({
22
13
  meta: [
23
14
  { charSet: "utf-8" },
@@ -52,33 +43,48 @@ function RootDocument({ children }) {
52
43
  });
53
44
  }
54
45
  // src/routes/_authed.tsx
55
- var $$splitComponentImporter$3 = () => import("./_authed-BaehIntL.js");
56
- var Route$6 = createFileRoute("/_authed")({
46
+ var $$splitComponentImporter$4 = () => import("./_authed-DODQ_Iys.js");
47
+ var Route$7 = createFileRoute("/_authed")({
57
48
  beforeLoad: async () => {
58
49
  const user = await getSessionUser();
59
50
  if (!user) throw redirect({ to: "/login" });
60
51
  return { user };
61
52
  },
62
- component: lazyRouteComponent($$splitComponentImporter$3, "component")
53
+ component: lazyRouteComponent($$splitComponentImporter$4, "component")
63
54
  });
64
55
  // src/routes/login.tsx
65
- var $$splitComponentImporter$2 = () => import("./login-h3B5Vdhl.js");
66
- var Route$5 = createFileRoute("/login")({
56
+ var $$splitComponentImporter$3 = () => import("./login-D-UG6SFw.js");
57
+ var Route$6 = createFileRoute("/login")({
67
58
  beforeLoad: async () => {
68
59
  if (await getSessionUser()) throw redirect({ to: "/" });
69
60
  },
70
61
  loader: () => getLoginInfo(),
71
- component: lazyRouteComponent($$splitComponentImporter$2, "component")
62
+ component: lazyRouteComponent($$splitComponentImporter$3, "component")
72
63
  });
73
64
  // src/routes/_authed/index.tsx
74
- var $$splitComponentImporter$1 = () => import("./_authed-ClbGOSDJ.js");
75
- var Route$4 = createFileRoute("/_authed/")({
65
+ var $$splitComponentImporter$2 = () => import("./_authed-CuDay0Tl.js");
66
+ var Route$5 = createFileRoute("/_authed/")({
76
67
  validateSearch: (s) => ({
77
68
  app: typeof s.app === "string" ? s.app : void 0,
78
- flow: typeof s.flow === "string" ? s.flow : void 0
69
+ flow: typeof s.flow === "string" ? s.flow : void 0,
70
+ status: typeof s.status === "string" ? s.status : void 0,
71
+ ...rangeSearch(s)
72
+ }),
73
+ loaderDeps: ({ search }) => ({
74
+ app: search.app,
75
+ range: search.range,
76
+ from: search.from,
77
+ to: search.to
79
78
  }),
79
+ loader: ({ deps }) => getOverview({ data: deps }),
80
+ component: lazyRouteComponent($$splitComponentImporter$2, "component")
81
+ });
82
+ // src/routes/_authed/settings.tsx
83
+ var $$splitComponentImporter$1 = () => import("./settings-BHfngShx.js");
84
+ var Route$4 = createFileRoute("/_authed/settings")({
85
+ validateSearch: (s) => ({ app: typeof s.app === "string" ? s.app : void 0 }),
80
86
  loaderDeps: ({ search }) => ({ app: search.app }),
81
- loader: ({ deps }) => getOverview({ data: { app: deps.app } }),
87
+ loader: ({ deps }) => getSettings({ data: deps }),
82
88
  component: lazyRouteComponent($$splitComponentImporter$1, "component")
83
89
  });
84
90
  // src/routes/api/ingest.ts
@@ -115,8 +121,17 @@ var Route$3 = createFileRoute("/api/ingest")({ server: { handlers: {
115
121
  /** GET /api/summary?app=<id> — the overview as JSON, for agents and scripts. */
116
122
  var Route$2 = createFileRoute("/api/summary")({ server: { handlers: { GET: async ({ request }) => {
117
123
  if (!authorizeApi(request)) return Response.json({ error: "unauthorized" }, { status: 401 });
118
- const app = new URL(request.url).searchParams.get("app") ?? void 0;
119
- const summary = await buildSummary(await getStore(), app, config().severity);
124
+ const q = new URL(request.url).searchParams;
125
+ const app = q.get("app") ?? void 0;
126
+ const range = {
127
+ range: q.get("range") ?? void 0,
128
+ from: q.get("from") ?? void 0,
129
+ to: q.get("to") ?? void 0
130
+ };
131
+ const summary = await buildSummary(await getStore(), app, config().severity, Date.now(), {
132
+ range,
133
+ retentionDays: config().retentionDays
134
+ });
120
135
  if (!summary) return Response.json({ error: "no data" }, { status: 404 });
121
136
  return Response.json({
122
137
  ...summary,
@@ -125,13 +140,21 @@ var Route$2 = createFileRoute("/api/summary")({ server: { handlers: { GET: async
125
140
  });
126
141
  } } } });
127
142
  // src/routes/_authed/issues.$fingerprint.tsx
128
- var $$splitComponentImporter = () => import("./issues._fingerprint-D78dy5os.js");
143
+ var $$splitComponentImporter = () => import("./issues._fingerprint-CZCZDm7t.js");
129
144
  var Route$1 = createFileRoute("/_authed/issues/$fingerprint")({
130
- validateSearch: (s) => ({ app: typeof s.app === "string" ? s.app : "" }),
131
- loaderDeps: ({ search }) => ({ app: search.app }),
145
+ validateSearch: (s) => ({
146
+ app: typeof s.app === "string" ? s.app : "",
147
+ ...rangeSearch(s)
148
+ }),
149
+ loaderDeps: ({ search }) => ({
150
+ app: search.app,
151
+ range: search.range,
152
+ from: search.from,
153
+ to: search.to
154
+ }),
132
155
  loader: async ({ params, deps }) => {
133
156
  const d = await getIssueDetail({ data: {
134
- app: deps.app,
157
+ ...deps,
135
158
  fingerprint: params.fingerprint
136
159
  } });
137
160
  if (!d) throw notFound();
@@ -139,40 +162,56 @@ var Route$1 = createFileRoute("/_authed/issues/$fingerprint")({
139
162
  },
140
163
  component: lazyRouteComponent($$splitComponentImporter, "component")
141
164
  });
165
+ /** Resolve (with the fixed version), ignore or reopen, and open a prefilled ticket. */
142
166
  // src/routes/api/issues/$fingerprint.ts
143
167
  /** GET /api/issues/<fingerprint>?app=<id> — one issue with breakdowns, sample stack, breadcrumbs and hints. */
144
168
  var Route = createFileRoute("/api/issues/$fingerprint")({ server: { handlers: { GET: async ({ request, params }) => {
145
169
  if (!authorizeApi(request)) return Response.json({ error: "unauthorized" }, { status: 401 });
146
- const app = new URL(request.url).searchParams.get("app");
170
+ const q = new URL(request.url).searchParams;
171
+ const app = q.get("app");
147
172
  if (!app) return Response.json({ error: "app query param required" }, { status: 400 });
148
- const detail = await buildIssueDetail(await getStore(), app, params.fingerprint, config().severity);
173
+ const range = {
174
+ range: q.get("range") ?? void 0,
175
+ from: q.get("from") ?? void 0,
176
+ to: q.get("to") ?? void 0
177
+ };
178
+ const detail = await buildIssueDetail(await getStore(), app, params.fingerprint, config().severity, Date.now(), {
179
+ range,
180
+ retentionDays: config().retentionDays,
181
+ trackers: config().trackers
182
+ });
149
183
  if (!detail) return Response.json({ error: "not found" }, { status: 404 });
150
184
  return Response.json(detail);
151
185
  } } } });
152
186
  // src/routeTree.gen.ts
153
- var AuthedRoute = Route$6.update({
187
+ var AuthedRoute = Route$7.update({
154
188
  id: "/_authed",
155
- getParentRoute: () => Route$7
189
+ getParentRoute: () => Route$8
156
190
  });
157
- var LoginRoute = Route$5.update({
191
+ var LoginRoute = Route$6.update({
158
192
  id: "/login",
159
193
  path: "/login",
160
- getParentRoute: () => Route$7
194
+ getParentRoute: () => Route$8
161
195
  });
162
- var AuthedIndexRoute = Route$4.update({
196
+ var AuthedIndexRoute = Route$5.update({
163
197
  id: "/",
164
198
  path: "/",
165
199
  getParentRoute: () => AuthedRoute
166
200
  });
201
+ var AuthedSettingsRoute = Route$4.update({
202
+ id: "/settings",
203
+ path: "/settings",
204
+ getParentRoute: () => AuthedRoute
205
+ });
167
206
  var ApiIngestRoute = Route$3.update({
168
207
  id: "/api/ingest",
169
208
  path: "/api/ingest",
170
- getParentRoute: () => Route$7
209
+ getParentRoute: () => Route$8
171
210
  });
172
211
  var ApiSummaryRoute = Route$2.update({
173
212
  id: "/api/summary",
174
213
  path: "/api/summary",
175
- getParentRoute: () => Route$7
214
+ getParentRoute: () => Route$8
176
215
  });
177
216
  var AuthedIssuesFingerprintRoute = Route$1.update({
178
217
  id: "/issues/$fingerprint",
@@ -182,9 +221,10 @@ var AuthedIssuesFingerprintRoute = Route$1.update({
182
221
  var ApiIssuesFingerprintRoute = Route.update({
183
222
  id: "/api/issues/$fingerprint",
184
223
  path: "/api/issues/$fingerprint",
185
- getParentRoute: () => Route$7
224
+ getParentRoute: () => Route$8
186
225
  });
187
226
  var AuthedRouteChildren = {
227
+ AuthedSettingsRoute,
188
228
  AuthedIndexRoute,
189
229
  AuthedIssuesFingerprintRoute
190
230
  };
@@ -195,7 +235,7 @@ var rootRouteChildren = {
195
235
  ApiSummaryRoute,
196
236
  ApiIssuesFingerprintRoute
197
237
  };
198
- var routeTree = Route$7._addFileChildren(rootRouteChildren)._addFileTypes();
238
+ var routeTree = Route$8._addFileChildren(rootRouteChildren)._addFileTypes();
199
239
  // src/router.tsx
200
240
  var router_exports = /* @__PURE__ */ __exportAll({ getRouter: () => getRouter });
201
241
  function getRouter() {
@@ -219,4 +259,4 @@ function getRouter() {
219
259
  })
220
260
  });
221
261
  }
222
- export { Route$6 as a, getRouter, Route$5 as i, Route$1 as n, Route$4 as r, router_exports as t };
262
+ export { Route$6 as a, getRouter, Route$5 as i, Route$1 as n, Route$7 as o, Route$4 as r, router_exports as t };