@debugkit/dashboard 0.6.1 → 0.8.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 (58) hide show
  1. package/dist/client/assets/_authed-CNObwuZh.js +7 -0
  2. package/dist/client/assets/_authed-CuP-He8G.js +1 -0
  3. package/dist/client/assets/{charts-XyOWJI9T.js → charts-CUvev8lV.js} +7 -7
  4. package/dist/client/assets/copy-button-ORgLIh59.js +1 -0
  5. package/dist/client/assets/customers-DTMEprFQ.js +1 -0
  6. package/dist/client/assets/endpoints-lMSO2CdM.js +1 -0
  7. package/dist/client/assets/events._eventId-bWag-i8J.js +3 -0
  8. package/dist/client/assets/index-BNpacHyi.js +10 -0
  9. package/dist/client/assets/invite._token-CxXek2SP.js +1 -0
  10. package/dist/client/assets/issues._fingerprint-BQr85TVY.js +1 -0
  11. package/dist/client/assets/login-Dlk3GyyC.js +1 -0
  12. package/dist/client/assets/sessions._sessionId-3wNImMqM.js +1 -0
  13. package/dist/client/assets/settings-CzbEYB7k.js +1 -0
  14. package/dist/client/assets/src-Dq5mIUf0.js +3 -0
  15. package/dist/client/assets/styles-DPsgRH7g.css +2 -0
  16. package/dist/client/assets/team-Bud2-07A.js +1 -0
  17. package/dist/client/assets/timeline-BSDhQPpY.js +1 -0
  18. package/dist/client/assets/ui-CEv2y56s.js +1 -0
  19. package/dist/server/assets/{_authed-CrjuC0O3.js → _authed-DkkRwdZl.js} +19 -5
  20. package/dist/server/assets/{_authed-C-sIPXSO.js → _authed-DsB8kjZB.js} +318 -126
  21. package/dist/server/assets/_tanstack-start-manifest_v-D1_ErrJK.js +97 -0
  22. package/dist/server/assets/copy-button-D3RddzTw.js +52 -0
  23. package/dist/server/assets/customers-CvSLt_xV.js +163 -0
  24. package/dist/server/assets/{demo-BsMMDk_F.js → demo-BRTkdmQJ.js} +25 -4
  25. package/dist/server/assets/{dynamodb-Zkk1-mgz.js → dynamodb-B0V3ZO20.js} +45 -17
  26. package/dist/server/assets/endpoints-mPQXpH8C.js +371 -0
  27. package/dist/server/assets/{queries-BJxX3Kjp.js → errors-C2KEDL7l.js} +842 -62
  28. package/dist/server/assets/events._eventId-pkQBQ9sL.js +765 -0
  29. package/dist/server/assets/{firestore-C52q_vwM.js → firestore-Jd-LeWZI.js} +15 -6
  30. package/dist/server/assets/fns-B3PHbFwV.js +1295 -0
  31. package/dist/server/assets/{fns-DwGaMi8S.js → fns-Di0vMpkQ.js} +25 -3
  32. package/dist/server/assets/{invite._token-xnpnkdRv.js → invite._token-LwWF5YxP.js} +3 -3
  33. package/dist/server/assets/{issues._fingerprint-e7ubdJf0.js → issues._fingerprint-DAA0QCuA.js} +89 -11
  34. package/dist/server/assets/{login-EopnOJXA.js → login-DqjCU4DJ.js} +3 -3
  35. package/dist/server/assets/{memory-BssaqdZm.js → memory-aqsrtEUn.js} +377 -26
  36. package/dist/server/assets/router-C0Dauj2C.js +510 -0
  37. package/dist/server/assets/sessions._sessionId-D7JPV0M4.js +264 -0
  38. package/dist/server/assets/{settings-CaJN69N6.js → settings-Drjd64d7.js} +165 -5
  39. package/dist/server/assets/{src-D83GYTrp.js → src-C4fNgijW.js} +1 -1
  40. package/dist/server/assets/{team-B1UcM1jA.js → team-D7iXYnSE.js} +3 -3
  41. package/dist/server/assets/timeline-MDRNDhiA.js +132 -0
  42. package/dist/server/assets/{ui-BJokJdYa.js → ui-B_XHlLUQ.js} +53 -13
  43. package/dist/server/server.js +37 -21
  44. package/package.json +4 -4
  45. package/dist/client/assets/_authed-BN39b-7H.js +0 -1
  46. package/dist/client/assets/_authed-CspAf0jN.js +0 -7
  47. package/dist/client/assets/index-Bfb2UOzB.js +0 -10
  48. package/dist/client/assets/invite._token-B4HN51-h.js +0 -1
  49. package/dist/client/assets/issues._fingerprint-BV1QrETY.js +0 -1
  50. package/dist/client/assets/login-COlvJ5Je.js +0 -1
  51. package/dist/client/assets/preload-helper-Dscj_TcA.js +0 -3
  52. package/dist/client/assets/settings-Dl4EWeWC.js +0 -1
  53. package/dist/client/assets/styles-DztngwT9.css +0 -2
  54. package/dist/client/assets/team-7Zekz_Er.js +0 -1
  55. package/dist/client/assets/ui-C0HGOza2.js +0 -1
  56. package/dist/server/assets/_tanstack-start-manifest_v-CqaE4wze.js +0 -61
  57. package/dist/server/assets/fns-mbUIXXep.js +0 -529
  58. package/dist/server/assets/router-G99085_Q.js +0 -315
@@ -1,315 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.js";
2
- import { a as getOverview, c as getTeam, i as getLoginInfo, n as getInvite, o as getSessionUser, r as getIssueDetail, s as getSettings } from "./fns-DwGaMi8S.js";
3
- import { r as rangeSearch } from "./range-picker-0zbSGr3Z.js";
4
- import { A as getLocalWriteStore, M as config, _ as CORS_HEADERS, a as authorizeApi, j as getStore, n as buildIssueDetail, r as buildSummary, t as SUMMARY_FIELDS, v as ingest, y as parseIngestKeys } from "./queries-BJxX3Kjp.js";
5
- import { HeadContent, Outlet, Scripts, createFileRoute, createRootRoute, createRouter, lazyRouteComponent, notFound, redirect } from "@tanstack/react-router";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- // src/styles.css?url
8
- var styles_default = "/assets/styles-DztngwT9.css";
9
- // src/routes/__root.tsx
10
- var Route$10 = createRootRoute({
11
- head: () => ({
12
- meta: [
13
- { charSet: "utf-8" },
14
- {
15
- name: "viewport",
16
- content: "width=device-width, initial-scale=1"
17
- },
18
- { title: "deBug" },
19
- {
20
- name: "robots",
21
- content: "noindex"
22
- }
23
- ],
24
- links: [{
25
- rel: "stylesheet",
26
- href: styles_default
27
- }, {
28
- rel: "icon",
29
- href: "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='8' fill='%23d1242f'/><text x='16' y='22' font-size='16' text-anchor='middle' fill='white' font-family='sans-serif' font-weight='700'>dB</text></svg>"
30
- }]
31
- }),
32
- shellComponent: RootDocument,
33
- component: Outlet
34
- });
35
- function RootDocument({ children }) {
36
- return /* @__PURE__ */ jsxs("html", {
37
- lang: "en",
38
- children: [/* @__PURE__ */ jsx("head", { children: /* @__PURE__ */ jsx(HeadContent, {}) }), /* @__PURE__ */ jsxs("body", {
39
- className: "min-h-screen",
40
- children: [children, /* @__PURE__ */ jsx(Scripts, {})]
41
- })]
42
- });
43
- }
44
- // src/routes/_authed.tsx
45
- var $$splitComponentImporter$6 = () => import("./_authed-CrjuC0O3.js");
46
- var Route$9 = createFileRoute("/_authed")({
47
- beforeLoad: async () => {
48
- const user = await getSessionUser();
49
- if (!user) throw redirect({ to: "/login" });
50
- return { user };
51
- },
52
- component: lazyRouteComponent($$splitComponentImporter$6, "component")
53
- });
54
- // src/routes/login.tsx
55
- var $$splitComponentImporter$5 = () => import("./login-EopnOJXA.js");
56
- var Route$8 = createFileRoute("/login")({
57
- beforeLoad: async () => {
58
- if (await getSessionUser()) throw redirect({ to: "/" });
59
- },
60
- loader: () => getLoginInfo(),
61
- component: lazyRouteComponent($$splitComponentImporter$5, "component")
62
- });
63
- // src/routes/_authed/index.tsx
64
- var $$splitComponentImporter$4 = () => import("./_authed-C-sIPXSO.js");
65
- var Route$7 = createFileRoute("/_authed/")({
66
- validateSearch: (s) => ({
67
- app: typeof s.app === "string" ? s.app : void 0,
68
- flow: typeof s.flow === "string" ? s.flow : void 0,
69
- status: typeof s.status === "string" ? s.status : void 0,
70
- ...rangeSearch(s)
71
- }),
72
- loaderDeps: ({ search }) => ({
73
- app: search.app,
74
- range: search.range,
75
- from: search.from,
76
- to: search.to
77
- }),
78
- loader: ({ deps }) => getOverview({ data: deps }),
79
- component: lazyRouteComponent($$splitComponentImporter$4, "component")
80
- });
81
- // src/routes/_authed/settings.tsx
82
- var $$splitComponentImporter$3 = () => import("./settings-CaJN69N6.js");
83
- var Route$6 = createFileRoute("/_authed/settings")({
84
- validateSearch: (s) => ({ app: typeof s.app === "string" ? s.app : void 0 }),
85
- loaderDeps: ({ search }) => ({ app: search.app }),
86
- loader: ({ deps }) => getSettings({ data: deps }),
87
- component: lazyRouteComponent($$splitComponentImporter$3, "component")
88
- });
89
- // src/routes/_authed/team.tsx
90
- var $$splitComponentImporter$2 = () => import("./team-B1UcM1jA.js");
91
- var Route$5 = createFileRoute("/_authed/team")({
92
- loader: () => getTeam(),
93
- component: lazyRouteComponent($$splitComponentImporter$2, "component")
94
- });
95
- // src/routes/api/ingest.ts
96
- /**
97
- * POST /api/ingest — local development ingest, available only in demo mode.
98
- * Point the SDK at http://localhost:4400/api/ingest with ingestKey "pk_local".
99
- * In production, events go to the ingest function in your own cloud instead.
100
- */
101
- var Route$4 = createFileRoute("/api/ingest")({ server: { handlers: {
102
- OPTIONS: async () => new Response(null, {
103
- status: 204,
104
- headers: CORS_HEADERS
105
- }),
106
- POST: async ({ request }) => {
107
- const store = await getLocalWriteStore();
108
- if (!store) return Response.json({
109
- ok: false,
110
- error: "Local ingest is only available when DEBUG_STORE is demo or memory. Send events to your cloud ingest function."
111
- }, {
112
- status: 404,
113
- headers: CORS_HEADERS
114
- });
115
- const out = await ingest(await request.text(), request.headers.get("x-debug-key") ?? void 0, {
116
- store,
117
- keys: parseIngestKeys(config().localIngestKeys)
118
- });
119
- return Response.json(out.body, {
120
- status: out.status,
121
- headers: CORS_HEADERS
122
- });
123
- }
124
- } } });
125
- // src/routes/api/summary.ts
126
- /** GET /api/summary?app=<id> — the overview as JSON, for agents and scripts. */
127
- var Route$3 = createFileRoute("/api/summary")({ server: { handlers: { GET: async ({ request }) => {
128
- if (!await authorizeApi(request)) return Response.json({ error: "unauthorized" }, { status: 401 });
129
- const q = new URL(request.url).searchParams;
130
- const app = q.get("app") ?? void 0;
131
- const range = {
132
- range: q.get("range") ?? void 0,
133
- from: q.get("from") ?? void 0,
134
- to: q.get("to") ?? void 0
135
- };
136
- const summary = await buildSummary(await getStore(), app, config().severity, Date.now(), {
137
- range,
138
- retentionDays: config().retentionDays
139
- });
140
- if (!summary) return Response.json({ error: "no data" }, { status: 404 });
141
- return Response.json({
142
- ...summary,
143
- _fields: SUMMARY_FIELDS,
144
- _severityThresholds24h: config().severity
145
- });
146
- } } } });
147
- // src/routes/invite.$token.tsx
148
- var $$splitComponentImporter$1 = () => import("./invite._token-xnpnkdRv.js");
149
- var Route$2 = createFileRoute("/invite/$token")({
150
- loader: ({ params }) => getInvite({ data: { token: params.token } }),
151
- component: lazyRouteComponent($$splitComponentImporter$1, "component")
152
- });
153
- // src/routes/_authed/issues.$fingerprint.tsx
154
- var $$splitComponentImporter = () => import("./issues._fingerprint-e7ubdJf0.js");
155
- var Route$1 = createFileRoute("/_authed/issues/$fingerprint")({
156
- validateSearch: (s) => ({
157
- app: typeof s.app === "string" ? s.app : "",
158
- ...rangeSearch(s)
159
- }),
160
- loaderDeps: ({ search }) => ({
161
- app: search.app,
162
- range: search.range,
163
- from: search.from,
164
- to: search.to
165
- }),
166
- loader: async ({ params, deps }) => {
167
- const d = await getIssueDetail({ data: {
168
- ...deps,
169
- fingerprint: params.fingerprint
170
- } });
171
- if (!d) throw notFound();
172
- return d;
173
- },
174
- component: lazyRouteComponent($$splitComponentImporter, "component")
175
- });
176
- /** Resolve (with the fixed version), ignore or reopen, and open a prefilled ticket. */
177
- // src/routes/api/issues/$fingerprint.ts
178
- /** GET /api/issues/<fingerprint>?app=<id> — one issue with breakdowns, sample stack, breadcrumbs and hints. */
179
- var Route = createFileRoute("/api/issues/$fingerprint")({ server: { handlers: { GET: async ({ request, params }) => {
180
- if (!await authorizeApi(request)) return Response.json({ error: "unauthorized" }, { status: 401 });
181
- const q = new URL(request.url).searchParams;
182
- const app = q.get("app");
183
- if (!app) return Response.json({ error: "app query param required" }, { status: 400 });
184
- const range = {
185
- range: q.get("range") ?? void 0,
186
- from: q.get("from") ?? void 0,
187
- to: q.get("to") ?? void 0
188
- };
189
- const detail = await buildIssueDetail(await getStore(), app, params.fingerprint, config().severity, Date.now(), {
190
- range,
191
- retentionDays: config().retentionDays,
192
- trackers: config().trackers
193
- });
194
- if (!detail) return Response.json({ error: "not found" }, { status: 404 });
195
- return Response.json(detail);
196
- } } } });
197
- // src/routeTree.gen.ts
198
- var AuthedRoute = Route$9.update({
199
- id: "/_authed",
200
- getParentRoute: () => Route$10
201
- });
202
- var LoginRoute = Route$8.update({
203
- id: "/login",
204
- path: "/login",
205
- getParentRoute: () => Route$10
206
- });
207
- var AuthedIndexRoute = Route$7.update({
208
- id: "/",
209
- path: "/",
210
- getParentRoute: () => AuthedRoute
211
- });
212
- var AuthedSettingsRoute = Route$6.update({
213
- id: "/settings",
214
- path: "/settings",
215
- getParentRoute: () => AuthedRoute
216
- });
217
- var AuthedTeamRoute = Route$5.update({
218
- id: "/team",
219
- path: "/team",
220
- getParentRoute: () => AuthedRoute
221
- });
222
- var ApiIngestRoute = Route$4.update({
223
- id: "/api/ingest",
224
- path: "/api/ingest",
225
- getParentRoute: () => Route$10
226
- });
227
- var ApiSummaryRoute = Route$3.update({
228
- id: "/api/summary",
229
- path: "/api/summary",
230
- getParentRoute: () => Route$10
231
- });
232
- var InviteTokenRoute = Route$2.update({
233
- id: "/invite/$token",
234
- path: "/invite/$token",
235
- getParentRoute: () => Route$10
236
- });
237
- var AuthedIssuesFingerprintRoute = Route$1.update({
238
- id: "/issues/$fingerprint",
239
- path: "/issues/$fingerprint",
240
- getParentRoute: () => AuthedRoute
241
- });
242
- var ApiIssuesFingerprintRoute = Route.update({
243
- id: "/api/issues/$fingerprint",
244
- path: "/api/issues/$fingerprint",
245
- getParentRoute: () => Route$10
246
- });
247
- var AuthedRouteChildren = {
248
- AuthedSettingsRoute,
249
- AuthedTeamRoute,
250
- AuthedIndexRoute,
251
- AuthedIssuesFingerprintRoute
252
- };
253
- var rootRouteChildren = {
254
- AuthedRoute: AuthedRoute._addFileChildren(AuthedRouteChildren),
255
- LoginRoute,
256
- ApiIngestRoute,
257
- ApiSummaryRoute,
258
- InviteTokenRoute,
259
- ApiIssuesFingerprintRoute
260
- };
261
- var routeTree = Route$10._addFileChildren(rootRouteChildren)._addFileTypes();
262
- // src/server/errors.ts
263
- /** Firestore answers FAILED_PRECONDITION while an index deBug needs is missing or still building. */
264
- function isIndexError(message) {
265
- return /FAILED_PRECONDITION|requires an index|index is currently building/i.test(message);
266
- }
267
- // src/router.tsx
268
- var router_exports = /* @__PURE__ */ __exportAll({ getRouter: () => getRouter });
269
- function ErrorPage({ error }) {
270
- const message = error instanceof Error ? error.message : String(error);
271
- if (isIndexError(message)) {
272
- const building = /currently building/i.test(message);
273
- return /* @__PURE__ */ jsxs("div", {
274
- className: "mx-auto max-w-xl p-8",
275
- children: [
276
- /* @__PURE__ */ jsx("h1", {
277
- className: "text-lg font-semibold",
278
- children: building ? "Firestore is still building deBug's indexes" : "Firestore is missing an index deBug needs"
279
- }),
280
- /* @__PURE__ */ jsx("p", {
281
- className: "mt-2 text-sm text-muted",
282
- children: building ? "This takes a few minutes after setup or an upgrade. Reload the page shortly." : "Usually this means deBug was upgraded but its indexes weren't. Run npx debugkit deploy-dashboard (or npx debugkit init) to add them; your other indexes are left alone."
283
- }),
284
- /* @__PURE__ */ jsx("button", {
285
- className: "mt-4 rounded-md border border-line px-3 py-1.5 text-sm hover:bg-panel-2",
286
- onClick: () => window.location.reload(),
287
- children: "Reload"
288
- })
289
- ]
290
- });
291
- }
292
- return /* @__PURE__ */ jsxs("div", {
293
- className: "mx-auto max-w-xl p-8",
294
- children: [/* @__PURE__ */ jsx("h1", {
295
- className: "text-lg font-semibold",
296
- children: "Something went wrong"
297
- }), /* @__PURE__ */ jsx("pre", {
298
- className: "mt-3 overflow-auto rounded-md bg-panel-2 p-3 text-xs",
299
- children: message
300
- })]
301
- });
302
- }
303
- function getRouter() {
304
- return createRouter({
305
- routeTree,
306
- scrollRestoration: true,
307
- defaultPreload: "intent",
308
- defaultErrorComponent: ErrorPage,
309
- defaultNotFoundComponent: () => /* @__PURE__ */ jsx("div", {
310
- className: "p-8 text-muted",
311
- children: "Not found."
312
- })
313
- });
314
- }
315
- export { Route$6 as a, Route$9 as c, getRouter, Route$5 as i, Route$1 as n, Route$7 as o, Route$2 as r, Route$8 as s, router_exports as t };