@hot-updater/console 1.0.0-rc.2 → 1.0.0-rc.20

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 (275) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/ConsoleFeatureUnavailable-B9VYGA3N.js +1 -0
  3. package/.output/public/assets/HashValueDisplay-D880zntR.js +1 -0
  4. package/.output/public/assets/InsightsInfo-By_sPjTE.js +1 -0
  5. package/.output/public/assets/InsightsPageHeader-9_kx_LL7.js +1 -0
  6. package/.output/public/assets/NotFoundPage-Dys8C0cW.js +1 -0
  7. package/.output/public/assets/api-CtarlV0l.js +1 -0
  8. package/.output/public/assets/api-keys-DFF_QqtN.js +1 -0
  9. package/.output/public/assets/api-keys-evfsQ4sN.js +1 -0
  10. package/.output/public/assets/arrow-left-BP9D-ta_.js +1 -0
  11. package/.output/public/assets/arrow-up-right-CDP9Tevw.js +1 -0
  12. package/.output/public/assets/card-DzCPSRsh.js +1 -0
  13. package/.output/public/assets/console-features-api-yv7rm3DX.js +1 -0
  14. package/.output/public/assets/dialog-BDvCy_QO.js +1 -0
  15. package/.output/public/assets/dist-Clb6cQ9l.js +1 -0
  16. package/.output/public/assets/empty-C5x9mn_s.js +1 -0
  17. package/.output/public/assets/field-Bou7shoO.js +1 -0
  18. package/.output/public/assets/index-0eg3l8aC.js +10 -0
  19. package/.output/public/assets/input-group-DVtWFUUF.js +1 -0
  20. package/.output/public/assets/insights-2MbdiSNv.js +1 -0
  21. package/.output/public/assets/insights-C6tmCZHk.js +2 -0
  22. package/.output/public/assets/insights-CadS_aIA.js +42 -0
  23. package/.output/public/assets/insights-recovery-rpc-wvdyM4LD.js +1 -0
  24. package/.output/public/assets/insights-search-KIF7mRtB.js +1 -0
  25. package/.output/public/assets/insights-usage-rpc-qUkNtrWr.js +1 -0
  26. package/.output/public/assets/insights_.distribution-BhBs6PNA.js +1 -0
  27. package/.output/public/assets/insights_.distribution-CItZw3-8.js +1 -0
  28. package/.output/public/assets/insights_.distribution-CJUH_wAS.js +2 -0
  29. package/.output/public/assets/installations-CH2H7JQt.js +2 -0
  30. package/.output/public/assets/installations-DMeMuwsW.js +1 -0
  31. package/.output/public/assets/installations-DnvxI9Dt.js +1 -0
  32. package/.output/public/assets/loader-circle-Ca7C9YY1.js +1 -0
  33. package/.output/public/assets/mutation-x9L28_CD.js +1 -0
  34. package/.output/public/assets/preload-helper-BN-UkjOE.js +1 -0
  35. package/.output/public/assets/refresh-cw-CVGqvy8Z.js +1 -0
  36. package/.output/public/assets/routes-BhK8DuZA.js +1 -0
  37. package/.output/public/assets/routes-veKtDW39.js +2 -0
  38. package/.output/public/assets/sidebar-B45aMqRm.js +3 -0
  39. package/.output/public/assets/styles-Dn0pK1EX.css +2 -0
  40. package/.output/public/assets/table-CwLnN6KX.js +1 -0
  41. package/.output/public/assets/useCompositeListItem-CF7vsfcA.js +1 -0
  42. package/.output/public/assets/useMutation-CN1ygYEr.js +1 -0
  43. package/.output/public/assets/useOpenInteractionType-AnAMWYIY.js +1 -0
  44. package/.output/public/assets/valueToPercent-C-t8FT0y.js +1 -0
  45. package/.output/server/{__23tanstack-start-server-fn-resolver-B7ioJhtE.mjs → __23tanstack-start-server-fn-resolver-CUQLz7hs.mjs} +52 -40
  46. package/.output/server/_libs/@base-ui/react+[...].mjs +7044 -3622
  47. package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
  48. package/.output/server/_libs/@tanstack/react-router+[...].mjs +49 -3
  49. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +4 -4
  50. package/.output/server/_libs/d3-array.mjs +231 -0
  51. package/.output/server/_libs/d3-color.mjs +330 -0
  52. package/.output/server/_libs/d3-format.mjs +252 -0
  53. package/.output/server/_libs/d3-interpolate.mjs +207 -0
  54. package/.output/server/_libs/d3-path.mjs +77 -0
  55. package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
  56. package/.output/server/_libs/d3-shape.mjs +818 -0
  57. package/.output/server/_libs/decimal.js-light.mjs +884 -0
  58. package/.output/server/_libs/es-toolkit.mjs +1159 -0
  59. package/.output/server/_libs/eventemitter3.mjs +236 -0
  60. package/.output/server/_libs/immer.mjs +532 -0
  61. package/.output/server/_libs/lucide-react.mjs +46 -32
  62. package/.output/server/_libs/next-themes.mjs +2 -2
  63. package/.output/server/_libs/react-redux+[...].mjs +205 -0
  64. package/.output/server/_libs/recharts+[...].mjs +14350 -0
  65. package/.output/server/_libs/sonner.mjs +2 -2
  66. package/.output/server/_libs/tanstack__react-query.mjs +8 -3
  67. package/.output/server/_libs/verkit.mjs +99 -1
  68. package/.output/server/_runtime.mjs +10 -1
  69. package/.output/server/_ssr/ConsoleFeatureUnavailable-DoxET2AT.mjs +58 -0
  70. package/.output/server/_ssr/{HashValueDisplay-DwpGLfrl.mjs → HashValueDisplay-BplboHEb.mjs} +3 -3
  71. package/.output/server/_ssr/InsightsInfo-o2YPd5Qc.mjs +37 -0
  72. package/.output/server/_ssr/InsightsPageHeader-NExCJL1I.mjs +154 -0
  73. package/.output/server/_ssr/NotFoundPage-Cd-A8ock.mjs +37 -0
  74. package/.output/server/_ssr/api-B1Ro0uys.mjs +202 -0
  75. package/.output/server/_ssr/api-C0G9MTMI.mjs +4205 -0
  76. package/.output/server/_ssr/{api-keys-CZeTPQys.mjs → api-keys-CT3HG7KT.mjs} +49 -9
  77. package/.output/server/_ssr/api-keys-Dvvy1sem.mjs +5 -0
  78. package/.output/server/_ssr/api-keys-rpc-b1qTTFfG.mjs +52 -0
  79. package/.output/server/_ssr/api-rpc-Cbns2MGx.mjs +338 -0
  80. package/.output/server/_ssr/{auth-rpc-DUaeOWKK.mjs → auth-rpc-DChS7m9y.mjs} +6 -6
  81. package/.output/server/_ssr/auth.server-Ccqz2iVv.mjs +37 -0
  82. package/.output/server/_ssr/bundleActivity-D17Pb_h5.mjs +19 -0
  83. package/.output/server/_ssr/card-DMbcvlPz.mjs +49 -0
  84. package/.output/server/_ssr/config-DMEJdhoW.mjs +13 -0
  85. package/.output/server/_ssr/config.server-DyypN6cQ.mjs +60 -0
  86. package/.output/server/_ssr/console-access-KpPv5lin.mjs +17 -0
  87. package/.output/server/_ssr/console-features-CsbyHYfK.mjs +55 -0
  88. package/.output/server/_ssr/console-features-api-B-KVuo4p.mjs +43 -0
  89. package/.output/server/_ssr/console-features-rpc-Djyo5740.mjs +19 -0
  90. package/.output/server/_ssr/{createServerFn-B2hcXoPM.mjs → createMiddleware-B_I3Ll4M.mjs} +28 -2
  91. package/.output/server/_ssr/{createServerRpc-DB29C_5p.mjs → createServerRpc-DuNm5mmo.mjs} +2 -2
  92. package/.output/server/_ssr/databaseRows-CXxf_VIB.mjs +132 -0
  93. package/.output/server/_ssr/{deleteBundle-BTGwBgzx.mjs → deleteBundle-Dcc21Lbd.mjs} +9 -19
  94. package/.output/server/_ssr/{dialog-DS-nw-pA.mjs → dialog-cOmLTUV2.mjs} +2 -2
  95. package/.output/server/_ssr/{dist-CyzPaI5v.mjs → dist-B-r4u3Lg.mjs} +28 -5
  96. package/.output/server/_ssr/{downloadBundle-CNnYxYO2.mjs → downloadBundle-CexOFoZ4.mjs} +6 -7
  97. package/.output/server/_ssr/empty-BHoY_5jt.mjs +49 -0
  98. package/.output/server/_ssr/{table-CnZmon_Z.mjs → field-mjhcNEXD.mjs} +63 -51
  99. package/.output/server/_ssr/getBundleChildren-DbDXe9wB.mjs +22 -0
  100. package/.output/server/_ssr/{input-group-BpsnmvZw.mjs → input-group-96H30HWC.mjs} +2 -2
  101. package/.output/server/_ssr/insights-D25VDVaz.mjs +5 -0
  102. package/.output/server/_ssr/insights-D359GJFL.mjs +14 -0
  103. package/.output/server/_ssr/insights-DgFv1NsO.mjs +1238 -0
  104. package/.output/server/_ssr/insights-api-ChAKrbhG.mjs +105 -0
  105. package/.output/server/_ssr/insights-failures-WQ-ttjOx.mjs +44 -0
  106. package/.output/server/_ssr/insights-failures-rpc-BFsqlltN.mjs +21 -0
  107. package/.output/server/_ssr/insights-recovery-DkL6bxMW.mjs +28 -0
  108. package/.output/server/_ssr/insights-recovery-rpc-2P5m8F62.mjs +46 -0
  109. package/.output/server/_ssr/insights-recovery-rpc-Tj8vNC19.mjs +20 -0
  110. package/.output/server/_ssr/{insights-rpc-38DujK0G.mjs → insights-rpc-DrkVmV9o.mjs} +22 -14
  111. package/.output/server/_ssr/insights-search-BsalnNw-.mjs +25 -0
  112. package/.output/server/_ssr/insights-usage-1nVTQrLy.mjs +29 -0
  113. package/.output/server/_ssr/insights-usage-rpc-Ct_4xHhZ.mjs +29 -0
  114. package/.output/server/_ssr/insights-usage-rpc-DaYIRtFK.mjs +41 -0
  115. package/.output/server/_ssr/insightsRecovery-CpGucWN1.mjs +45 -0
  116. package/.output/server/_ssr/insightsUsage-JYpKZAF7.mjs +56 -0
  117. package/.output/server/_ssr/insights_.distribution-Bcu6uYs_.mjs +5 -0
  118. package/.output/server/_ssr/insights_.distribution-D3Csuyjw.mjs +14 -0
  119. package/.output/server/_ssr/insights_.distribution-jQZEF07J.mjs +335 -0
  120. package/.output/server/_ssr/installations-B8Vh54lH.mjs +69 -0
  121. package/.output/server/_ssr/installations-BI5kelHv.mjs +5 -0
  122. package/.output/server/_ssr/{installations-DiVKEF5T.mjs → installations-Cxikllmx.mjs} +517 -54
  123. package/.output/server/_ssr/listReleases-DqU9t1l3.mjs +79 -0
  124. package/.output/server/_ssr/releaseManagement-B3e7I8J9.mjs +11 -0
  125. package/.output/server/_ssr/{router-B9wG_9f8.mjs → router-CRkm-wHD.mjs} +117 -124
  126. package/.output/server/_ssr/routes-B3IJo_jL.mjs +292 -0
  127. package/.output/server/_ssr/{routes-D7Yh_jfj.mjs → routes-CNAi0Mmv.mjs} +176 -455
  128. package/.output/server/_ssr/runtime.server-NucbYjc7.mjs +1372 -0
  129. package/.output/server/_ssr/select-BkPAJFL7.mjs +107 -0
  130. package/.output/server/_ssr/{server-D_C2rMzf.mjs → server-DKJYsaCP.mjs} +6 -32
  131. package/.output/server/_ssr/{createSsrRpc-DjWNJ0uc.mjs → sidebar-Cw1VuC7d.mjs} +117 -63
  132. package/.output/server/_ssr/ssr.mjs +1 -1
  133. package/.output/server/_ssr/table-q0P9wz7x.mjs +53 -0
  134. package/.output/server/_ssr/updateFailures-DMU9f0pK.mjs +24 -0
  135. package/.output/server/_ssr/{uuidv7-D0QFkPL_.mjs → uuidv7-BzSO-fr-.mjs} +2 -2
  136. package/.output/server/_tanstack-start-manifest_v-Bb0gKDbb.mjs +124 -0
  137. package/.output/server/index.mjs +273 -168
  138. package/README.md +71 -65
  139. package/lib/index.d.mts +13 -11
  140. package/lib/vite-internal.mjs +6 -3
  141. package/package.json +8 -8
  142. package/src/components/AppSidebar.tsx +91 -71
  143. package/src/components/ConsoleAccessPage.tsx +5 -1
  144. package/src/components/ConsoleFeatureUnavailable.tsx +82 -0
  145. package/src/components/NotFoundPage.tsx +7 -7
  146. package/src/components/features/FeatureSlots.tsx +99 -0
  147. package/src/components/features/api-keys/apiKeysFeatureUi.tsx +15 -0
  148. package/src/components/features/bundles/BundleMetadata.tsx +7 -4
  149. package/src/components/features/channels/ChannelManagementDialog.tsx +2 -5
  150. package/src/components/features/insights/AppUsage.tsx +370 -0
  151. package/src/components/features/insights/EstimatedCount.tsx +18 -0
  152. package/src/components/features/insights/EventDetails.tsx +117 -37
  153. package/src/components/features/insights/EventHistoryCard.tsx +112 -26
  154. package/src/components/features/insights/EventHistoryList.tsx +2 -2
  155. package/src/components/features/insights/InsightsControls.tsx +265 -102
  156. package/src/components/features/insights/InsightsErrorAlert.tsx +14 -1
  157. package/src/components/features/insights/InsightsInfo.tsx +48 -0
  158. package/src/components/features/insights/InsightsOverview.tsx +176 -173
  159. package/src/components/features/insights/InsightsPageHeader.tsx +35 -20
  160. package/src/components/features/insights/InsightsPeriodSelector.tsx +89 -0
  161. package/src/components/features/insights/InstallationHistoryCard.tsx +52 -10
  162. package/src/components/features/insights/InstallationMatchesCard.tsx +1 -1
  163. package/src/components/features/insights/ReleaseActivity.tsx +188 -0
  164. package/src/components/features/insights/ReportingDevicesSummary.tsx +65 -0
  165. package/src/components/features/insights/UpdateFailures.tsx +319 -0
  166. package/src/components/features/insights/insightsFeatureUi.tsx +35 -0
  167. package/src/components/features/releases/ReleaseEditorSheet.tsx +24 -1
  168. package/src/components/ui/card.tsx +1 -1
  169. package/src/components/ui/empty.tsx +101 -0
  170. package/src/components/ui/scroll-area.tsx +52 -0
  171. package/src/components/ui/sidebar.tsx +22 -29
  172. package/src/components/ui/tabs.tsx +81 -0
  173. package/src/index.ts +12 -17
  174. package/src/lib/api-keys-api.ts +0 -28
  175. package/src/lib/api-keys-rpc.ts +27 -38
  176. package/src/lib/api-rpc.ts +197 -221
  177. package/src/lib/api.ts +11 -13
  178. package/src/lib/bundle-activity.ts +31 -0
  179. package/src/lib/console-access.ts +20 -0
  180. package/src/lib/console-features-api.ts +68 -0
  181. package/src/lib/console-features-rpc.ts +13 -0
  182. package/src/lib/console-features.ts +91 -0
  183. package/src/lib/insights-api.ts +37 -1
  184. package/src/lib/insights-failures-rpc.ts +21 -0
  185. package/src/lib/insights-failures.ts +129 -0
  186. package/src/lib/insights-recovery-rpc.ts +51 -0
  187. package/src/lib/insights-recovery.ts +68 -0
  188. package/src/lib/insights-retention.ts +21 -0
  189. package/src/lib/insights-rpc.ts +30 -12
  190. package/src/lib/insights-search.ts +58 -0
  191. package/src/lib/insights-usage-rpc.ts +29 -0
  192. package/src/lib/insights-usage.ts +74 -0
  193. package/src/lib/insights-view.ts +38 -2
  194. package/src/lib/scroll-restoration.ts +21 -0
  195. package/src/lib/server/adminInsights.ts +124 -0
  196. package/src/lib/server/auth.server.ts +13 -5
  197. package/src/lib/server/bundleActivity.ts +37 -0
  198. package/src/lib/server/config.server.ts +16 -32
  199. package/src/lib/server/console-feature-apis.ts +59 -0
  200. package/src/lib/server/console-runtime.server.ts +6 -40
  201. package/src/lib/server/deleteBundle.ts +16 -25
  202. package/src/lib/server/downloadBundle.ts +7 -10
  203. package/src/lib/server/getBundleChildren.ts +31 -122
  204. package/src/lib/server/insightsRecovery.ts +55 -0
  205. package/src/lib/server/insightsUsage.ts +63 -0
  206. package/src/lib/server/listReleases.ts +109 -44
  207. package/src/lib/server/releaseReachability.ts +4 -3
  208. package/src/lib/server/runtime.server.ts +132 -31
  209. package/src/lib/server/updateFailures.ts +31 -0
  210. package/src/routeTree.gen.ts +21 -21
  211. package/src/router.tsx +3 -2
  212. package/src/routes/-installations-search.ts +32 -8
  213. package/src/routes/-releases-search.ts +76 -29
  214. package/src/routes/__root.tsx +10 -4
  215. package/src/routes/api/bundles/$bundleId/download.ts +2 -5
  216. package/src/routes/api-keys.tsx +5 -2
  217. package/src/routes/index.tsx +167 -104
  218. package/src/routes/insights.tsx +100 -59
  219. package/src/routes/insights_.distribution.tsx +398 -0
  220. package/src/routes/installations.tsx +98 -41
  221. package/src/vite-internal.ts +6 -3
  222. package/.output/public/assets/HashValueDisplay-CB0Eskit.js +0 -1
  223. package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +0 -1
  224. package/.output/public/assets/api-keys-BzKocqRy.js +0 -1
  225. package/.output/public/assets/api-keys-api-BHcODB7q.js +0 -1
  226. package/.output/public/assets/card-Dhr_eFYj.js +0 -1
  227. package/.output/public/assets/chart-no-axes-combined-Dy4WJv2U.js +0 -1
  228. package/.output/public/assets/composite-Bp98A0Ld.js +0 -1
  229. package/.output/public/assets/createServerFn-CA8fs7QD.js +0 -3
  230. package/.output/public/assets/dialog-CUTrcPlB.js +0 -1
  231. package/.output/public/assets/dist-C_NydL0e.js +0 -1
  232. package/.output/public/assets/index-DdAz-CXv.js +0 -10
  233. package/.output/public/assets/input-group-cSOG4wh_.js +0 -1
  234. package/.output/public/assets/insights-C0PBSZ-n.js +0 -1
  235. package/.output/public/assets/installations-CE33wgbY.js +0 -2
  236. package/.output/public/assets/installations-CStZja8x.js +0 -1
  237. package/.output/public/assets/lazyRouteComponent-Ccp3bwBY.js +0 -1
  238. package/.output/public/assets/link-CI8idAUi.js +0 -1
  239. package/.output/public/assets/loader-circle-BoxLrsOu.js +0 -1
  240. package/.output/public/assets/preload-helper-CQ36nxok.js +0 -1
  241. package/.output/public/assets/refresh-cw-Bqc72UZG.js +0 -1
  242. package/.output/public/assets/routes-DGVXdzpw.js +0 -2
  243. package/.output/public/assets/routes-DTlwOr8I.js +0 -1
  244. package/.output/public/assets/shield-check-uK3MHWJZ.js +0 -1
  245. package/.output/public/assets/signing-CMf4aqDO.js +0 -1
  246. package/.output/public/assets/styles-BCvbtKsm.css +0 -2
  247. package/.output/public/assets/table-2vcV89QB.js +0 -1
  248. package/.output/public/assets/useCompositeListItem-CHLITE_4.js +0 -1
  249. package/.output/public/assets/x-DCd0j8c6.js +0 -1
  250. package/.output/server/_ssr/InsightsPageHeader-Df4Brj8u.mjs +0 -484
  251. package/.output/server/_ssr/api-keys-api-BUPQVSpk.mjs +0 -60
  252. package/.output/server/_ssr/api-keys-rpc-Cs7tS5_j.mjs +0 -136
  253. package/.output/server/_ssr/api-rpc-tAupfGQm.mjs +0 -1399
  254. package/.output/server/_ssr/auth.server-DW71WzsD.mjs +0 -47
  255. package/.output/server/_ssr/bundle-signing-rpc-BhnBw0-d.mjs +0 -16
  256. package/.output/server/_ssr/bundle-signing.server-C4NW5mWx.mjs +0 -12
  257. package/.output/server/_ssr/card-BRiPmi0C.mjs +0 -108
  258. package/.output/server/_ssr/config-Dv8qLDZ0.mjs +0 -13
  259. package/.output/server/_ssr/config.server-afDuAwaG.mjs +0 -368
  260. package/.output/server/_ssr/databaseJsonValue-d6I3nAS4.mjs +0 -45
  261. package/.output/server/_ssr/databaseRows-5bCRTxm-.mjs +0 -126
  262. package/.output/server/_ssr/getBundleChildren-C0vh4ZvE.mjs +0 -50
  263. package/.output/server/_ssr/insights-BdS364Xu.mjs +0 -460
  264. package/.output/server/_ssr/insightsContract-fjJDBeEE.mjs +0 -303
  265. package/.output/server/_ssr/installations-CtA59MQG.mjs +0 -29
  266. package/.output/server/_ssr/routes-CKrrS2q2.mjs +0 -37
  267. package/.output/server/_ssr/runtime.server-DacU1TBV.mjs +0 -438
  268. package/.output/server/_ssr/signing-Dz1WkZOf.mjs +0 -133
  269. package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +0 -97
  270. package/src/components/features/insights/InsightsBundleReports.tsx +0 -51
  271. package/src/components/features/signing/BundleSigningPage.tsx +0 -139
  272. package/src/lib/bundle-signing-api.ts +0 -14
  273. package/src/lib/bundle-signing-rpc.ts +0 -16
  274. package/src/lib/server/bundle-signing.server.ts +0 -23
  275. package/src/routes/signing.tsx +0 -37
@@ -1,484 +0,0 @@
1
- import { r as __toESM } from "../_runtime.mjs";
2
- import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
3
- import { J as require_react, q as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
4
- import { F as ChartNoAxesCombined, I as ArrowUpRight, N as ChevronDown, P as Check, d as RefreshCw, h as PackageCheck, n as TriangleAlert, u as RotateCcw, z as Activity } from "../_libs/lucide-react.mjs";
5
- import { S as buttonVariants, _ as Skeleton, g as SidebarTrigger, t as Button$1, w as createSsrRpc } from "./createSsrRpc-DjWNJ0uc.mjs";
6
- import { m as Link } from "../_libs/@tanstack/react-router+[...].mjs";
7
- import { n as useQuery } from "../_libs/tanstack__react-query.mjs";
8
- import { a as Badge, d as CardTitle, i as AlertTitle, o as Card, r as AlertDescription, s as CardContent, t as Alert, u as CardHeader } from "./card-BRiPmi0C.mjs";
9
- import { c as TableBody, d as TableHeader, f as TableRow, l as TableCell, s as Table, u as TableHead } from "./table-CnZmon_Z.mjs";
10
- import { t as HashValueDisplay } from "./HashValueDisplay-DwpGLfrl.mjs";
11
- //#region node_modules/.nitro/vite/services/ssr/assets/InsightsPageHeader-Df4Brj8u.js
12
- var import_react = /* @__PURE__ */ __toESM(require_react());
13
- var import_jsx_runtime = require_jsx_runtime();
14
- var readOverview = (input) => input;
15
- var readEventsPage = (input) => input;
16
- var readInstallationEventsPage = (input) => input;
17
- var readInstallationPage = (input) => input;
18
- var readInstallId = (input) => input;
19
- var getReportingInstallationsRpc = createServerFn({ method: "GET" }).validator(readOverview).handler(createSsrRpc("ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd"));
20
- var listInsightsEventsRpc = createServerFn({ method: "GET" }).validator(readEventsPage).handler(createSsrRpc("d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19"));
21
- var listInsightsInstallationEventsRpc = createServerFn({ method: "GET" }).validator(readInstallationEventsPage).handler(createSsrRpc("3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0"));
22
- var getInsightsInstallationRpc = createServerFn({ method: "GET" }).validator(readInstallId).handler(createSsrRpc("6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370"));
23
- var findInsightsInstallationsRpc = createServerFn({ method: "GET" }).validator(readInstallationPage).handler(createSsrRpc("735c501f6d5ea81a445ff2b6b2ea6a1b589e3c6f63a465a881822c80ae71e7d1"));
24
- var STALE_TIME_MS = 3e4;
25
- var queryKeys = {
26
- reportingInstallations: (input) => [
27
- "insights",
28
- "reporting-installations",
29
- input
30
- ],
31
- events: (input) => [
32
- "insights",
33
- "events",
34
- input
35
- ],
36
- installations: (input) => [
37
- "insights",
38
- "installations",
39
- input
40
- ],
41
- installation: (installId) => [
42
- "insights",
43
- "installation",
44
- installId
45
- ],
46
- installationEvents: (input) => [
47
- "insights",
48
- "installation-events",
49
- input
50
- ]
51
- };
52
- var useReportingInstallationsQuery = (input) => useQuery({
53
- queryKey: queryKeys.reportingInstallations(input),
54
- queryFn: () => getReportingInstallationsRpc({ data: input }),
55
- refetchOnWindowFocus: true,
56
- staleTime: STALE_TIME_MS
57
- });
58
- var useInsightsEventsQuery = (input, enabled) => useQuery({
59
- queryKey: queryKeys.events(input),
60
- queryFn: () => listInsightsEventsRpc({ data: input }),
61
- enabled,
62
- refetchOnWindowFocus: true,
63
- staleTime: STALE_TIME_MS
64
- });
65
- var useInsightsInstallationsQuery = (input, enabled) => useQuery({
66
- queryKey: queryKeys.installations(input),
67
- queryFn: () => findInsightsInstallationsRpc({ data: input }),
68
- enabled: enabled && input.identity.length > 0,
69
- staleTime: STALE_TIME_MS
70
- });
71
- var useInsightsInstallationQuery = (installId, enabled) => useQuery({
72
- queryKey: queryKeys.installation(installId),
73
- queryFn: () => getInsightsInstallationRpc({ data: { installId } }),
74
- enabled: enabled && installId.length > 0,
75
- staleTime: STALE_TIME_MS
76
- });
77
- var useInsightsInstallationEventsQuery = (input, enabled) => useQuery({
78
- queryKey: queryKeys.installationEvents(input),
79
- queryFn: () => listInsightsInstallationEventsRpc({ data: input }),
80
- enabled: enabled && input.installId.length > 0,
81
- refetchOnWindowFocus: true,
82
- staleTime: STALE_TIME_MS
83
- });
84
- var eventTypes = {
85
- UPDATE_APPLIED: {
86
- label: "Bundle applied",
87
- variant: "success",
88
- icon: Check
89
- },
90
- RECOVERED: {
91
- label: "Recovered",
92
- variant: "warning",
93
- icon: RotateCcw
94
- },
95
- RELEASE_ADOPTED: {
96
- label: "Bundle adopted",
97
- variant: "success",
98
- icon: PackageCheck
99
- },
100
- UNCHANGED: {
101
- label: "Activity reported",
102
- variant: "secondary",
103
- icon: Activity
104
- }
105
- };
106
- function useInsightsTimeFormat() {
107
- const [timeZone, setTimeZone] = (0, import_react.useState)("UTC");
108
- (0, import_react.useEffect)(() => {
109
- setTimeZone(Intl.DateTimeFormat().resolvedOptions().timeZone);
110
- }, []);
111
- return new Intl.DateTimeFormat("en", {
112
- timeZone,
113
- timeZoneName: "shortOffset",
114
- year: "numeric",
115
- month: "2-digit",
116
- day: "2-digit",
117
- hour: "2-digit",
118
- minute: "2-digit",
119
- second: "2-digit",
120
- hourCycle: "h23"
121
- });
122
- }
123
- function formatInsightsTimestamp(value, formatter) {
124
- const parts = Object.fromEntries(formatter.formatToParts(new Date(value)).map(({ type, value }) => [type, value]));
125
- const offset = parts.timeZoneName === "GMT" ? "GMT+0" : parts.timeZoneName;
126
- return `${parts.year}/${parts.month}/${parts.day} ${parts.hour}:${parts.minute}:${parts.second} ${offset}`;
127
- }
128
- function EventTimestamp({ value, formatter, touch = false }) {
129
- const date = new Date(value);
130
- const localTime = formatInsightsTimestamp(value, formatter);
131
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
132
- className: "group/time",
133
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", {
134
- className: `cursor-pointer list-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/30 [&::-webkit-details-marker]:hidden ${touch ? "flex min-h-11 items-center" : ""}`,
135
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
136
- className: "flex items-center gap-1",
137
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {
138
- dateTime: date.toISOString(),
139
- className: "whitespace-nowrap",
140
- children: localTime
141
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, {
142
- "aria-hidden": "true",
143
- className: "size-3 text-muted-foreground group-open/time:rotate-180"
144
- })]
145
- })
146
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
147
- className: "mt-2 text-muted-foreground",
148
- children: date.toISOString().replace("T", " ").replace("Z", " UTC")
149
- })]
150
- });
151
- }
152
- function EventTypeBadge({ type }) {
153
- const eventType = eventTypes[type];
154
- const Icon = eventType.icon;
155
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
156
- variant: eventType.variant,
157
- className: "gap-1 whitespace-nowrap [&_svg]:size-3",
158
- title: type === "UNCHANGED" ? "App activity reported on the current bundle without a bundle transition." : type === "RELEASE_ADOPTED" ? "A different release was adopted without changing the bundle." : void 0,
159
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { "aria-hidden": "true" }), eventType.label]
160
- });
161
- }
162
- function EventBundleTransition({ event, touch = false }) {
163
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
164
- className: "grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-2",
165
- children: [
166
- event.fromBundleId ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
167
- className: "text-muted-foreground",
168
- children: "From"
169
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
170
- value: event.fromBundleId,
171
- buttonClassName: touch ? "min-h-11 px-3" : void 0
172
- }) })] }) : null,
173
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
174
- className: "text-muted-foreground",
175
- children: event.type === "UNCHANGED" ? "Current" : "To"
176
- }),
177
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
178
- value: event.toBundleId,
179
- buttonClassName: touch ? "min-h-11 px-3" : void 0
180
- }) })
181
- ]
182
- });
183
- }
184
- function EventHistoryList({ events, formatter, renderIdentity }) {
185
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
186
- className: "px-4 pb-2 text-xs text-muted-foreground sm:px-6",
187
- children: "Time in your browser zone"
188
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", {
189
- "aria-label": "Events",
190
- className: "divide-y border-y",
191
- children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
192
- className: "flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6",
193
- children: [
194
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
195
- className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-1",
196
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTypeBadge, { type: event.type }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
197
- className: "text-xs tabular-nums",
198
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTimestamp, {
199
- value: event.receivedAtMs,
200
- formatter,
201
- touch: true
202
- })
203
- })]
204
- }),
205
- renderIdentity?.(event),
206
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
207
- className: "flex flex-wrap gap-x-2 gap-y-1 text-sm",
208
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
209
- className: "sr-only",
210
- children: "App"
211
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dd", { children: [
212
- event.platform === "ios" ? "iOS" : "Android",
213
- " ",
214
- event.appVersion
215
- ] })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
216
- className: "min-w-0 text-muted-foreground",
217
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
218
- className: "sr-only",
219
- children: "Channel"
220
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
221
- className: "wrap-anywhere",
222
- children: event.channel
223
- })]
224
- })]
225
- }),
226
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
227
- className: "text-xs",
228
- "aria-label": "Bundle",
229
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventBundleTransition, {
230
- event,
231
- touch: true
232
- })
233
- })
234
- ]
235
- }, event.id))
236
- })] });
237
- }
238
- function InsightsErrorAlert({ fallbackTitle }) {
239
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, {
240
- variant: "destructive",
241
- children: [
242
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleAlert, { "aria-hidden": "true" }),
243
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: fallbackTitle }),
244
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: "Refresh to try again. If this keeps happening, check your Insights provider connection." })
245
- ]
246
- });
247
- }
248
- function InsightsPagination({ hasPrevious, label, nextCursor, onNext, onPrevious, pageLength, pageNumber }) {
249
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
250
- "aria-label": `${label} pagination`,
251
- className: "flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6",
252
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
253
- className: "text-xs text-muted-foreground tabular-nums",
254
- children: [
255
- "Page ",
256
- pageNumber,
257
- " · ",
258
- pageLength.toLocaleString(),
259
- " rows"
260
- ]
261
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
262
- className: "flex gap-2",
263
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
264
- className: "h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2",
265
- disabled: !hasPrevious,
266
- onClick: onPrevious,
267
- size: "sm",
268
- type: "button",
269
- variant: "outline",
270
- children: "Previous"
271
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
272
- className: "h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2",
273
- disabled: nextCursor === null,
274
- onClick: onNext,
275
- size: "sm",
276
- type: "button",
277
- variant: "outline",
278
- children: "Next"
279
- })]
280
- })]
281
- });
282
- }
283
- function EventIdentity({ event, eventsLocation, touch = false }) {
284
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
285
- className: touch ? "flex min-w-0 flex-wrap items-center justify-between gap-2" : "flex min-w-0 flex-col items-start gap-2",
286
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
287
- className: buttonVariants({
288
- className: touch ? "-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm" : "-ml-2 max-w-full justify-start",
289
- size: "sm",
290
- variant: "ghost"
291
- }),
292
- to: "/installations",
293
- search: {
294
- ...eventsLocation,
295
- query: event.installId || void 0,
296
- installId: event.installId
297
- },
298
- "aria-label": `View history for ${event.userId ?? event.username ?? "anonymous installation"} (${event.installId})`,
299
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
300
- className: touch ? "min-w-0 text-left wrap-anywhere" : "truncate",
301
- children: event.userId ?? event.username ?? "Anonymous installation"
302
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowUpRight, {
303
- "aria-hidden": "true",
304
- "data-icon": "inline-end"
305
- })]
306
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
307
- value: event.installId,
308
- maxLength: 13,
309
- buttonClassName: touch ? "min-h-11 px-3" : void 0
310
- })]
311
- });
312
- }
313
- function EventHistoryCard({ children, error, eventsLocation, history, isFetching, isLoading, onNext, onPrevious, onRefresh, pageNumber, title = "All events" }) {
314
- const dateTimeFormat = useInsightsTimeFormat();
315
- const hasPrevious = pageNumber > 1;
316
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, {
317
- className: "@container min-w-0 shadow-sm",
318
- "aria-busy": isFetching,
319
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardHeader, {
320
- className: "gap-4 p-4 sm:p-6",
321
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
322
- className: "flex flex-wrap items-center justify-between gap-3",
323
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardTitle, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: title }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
324
- className: "h-11 lg:h-8",
325
- disabled: isFetching,
326
- onClick: onRefresh,
327
- size: "lg",
328
- variant: "outline",
329
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RefreshCw, {
330
- "aria-hidden": "true",
331
- "data-icon": "inline-start"
332
- }), "Refresh"]
333
- })]
334
- }), children]
335
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardContent, {
336
- className: "min-w-0 p-0",
337
- children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
338
- className: "flex flex-col gap-4 p-6",
339
- role: "status",
340
- "aria-label": "Loading events",
341
- children: [
342
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-12 w-full" }),
343
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-12 w-full" }),
344
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-12 w-full" })
345
- ]
346
- }) : error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
347
- className: "px-6 pb-6",
348
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InsightsErrorAlert, {
349
- error,
350
- fallbackTitle: "Event history unavailable"
351
- })
352
- }) : history ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [history.data.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
353
- className: "@[58rem]:hidden",
354
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventHistoryList, {
355
- events: history.data,
356
- formatter: dateTimeFormat,
357
- renderIdentity: (event) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventIdentity, {
358
- event,
359
- eventsLocation,
360
- touch: true
361
- })
362
- })
363
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
364
- className: "hidden @[58rem]:block",
365
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table, {
366
- className: "min-w-4xl table-fixed",
367
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, {
368
- className: "[&>th]:px-4 sm:[&>th]:px-6",
369
- children: [
370
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
371
- className: "w-64",
372
- children: "Time"
373
- }),
374
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
375
- className: "w-48",
376
- children: "Event"
377
- }),
378
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
379
- className: "w-48",
380
- children: "User / installation"
381
- }),
382
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
383
- className: "w-32",
384
- children: "App"
385
- }),
386
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
387
- className: "w-52",
388
- children: "Bundle"
389
- })
390
- ]
391
- }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableBody, { children: history.data.map((event) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, {
392
- className: "[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6",
393
- children: [
394
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
395
- className: "whitespace-normal text-xs tabular-nums",
396
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTimestamp, {
397
- value: event.receivedAtMs,
398
- formatter: dateTimeFormat
399
- })
400
- }),
401
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTypeBadge, { type: event.type }) }),
402
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventIdentity, {
403
- event,
404
- eventsLocation
405
- }) }),
406
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
407
- className: "whitespace-normal text-xs",
408
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
409
- className: "flex flex-col gap-2",
410
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
411
- event.platform === "ios" ? "iOS" : "Android",
412
- " ",
413
- event.appVersion
414
- ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
415
- className: "text-muted-foreground",
416
- children: event.channel
417
- })]
418
- })
419
- }),
420
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
421
- className: "whitespace-normal text-xs",
422
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventBundleTransition, { event })
423
- })
424
- ]
425
- }, event.id)) })]
426
- })
427
- })] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
428
- className: "px-6 pb-6 text-sm text-muted-foreground",
429
- children: hasPrevious || history.nextCursor ? "No events on this page" : title === "All events" ? "No events recorded yet" : "No matching reports in this period"
430
- }), history.data.length > 0 || hasPrevious || history.nextCursor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InsightsPagination, {
431
- hasPrevious,
432
- label: title,
433
- nextCursor: history.nextCursor,
434
- onNext,
435
- onPrevious,
436
- pageLength: history.data.length,
437
- pageNumber
438
- }) : null] }) : null
439
- })]
440
- });
441
- }
442
- function InsightsPageHeader({ view }) {
443
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
444
- className: "sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-3 border-b bg-background px-3 py-3 sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm",
445
- children: [
446
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SidebarTrigger, { className: "-ml-1 size-11 lg:size-7" }),
447
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
448
- className: "flex items-center gap-1.5",
449
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartNoAxesCombined, {
450
- "aria-hidden": "true",
451
- className: "size-3.5 text-muted-foreground"
452
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
453
- className: "text-sm font-medium",
454
- children: "Insights"
455
- })]
456
- }),
457
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
458
- "aria-label": "Insights views",
459
- className: "ml-auto flex gap-1",
460
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
461
- "aria-current": view === "overview" ? "page" : void 0,
462
- className: buttonVariants({
463
- className: "h-11 px-3 lg:h-8 lg:px-2.5",
464
- size: "lg",
465
- variant: view === "overview" ? "secondary" : "ghost"
466
- }),
467
- to: "/insights",
468
- children: "Overview"
469
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
470
- "aria-current": view === "events" ? "page" : void 0,
471
- className: buttonVariants({
472
- className: "h-11 px-3 lg:h-8 lg:px-2.5",
473
- size: "lg",
474
- variant: view === "events" ? "secondary" : "ghost"
475
- }),
476
- to: "/installations",
477
- children: "Events"
478
- })]
479
- })
480
- ]
481
- });
482
- }
483
- //#endregion
484
- export { EventTypeBadge as a, InsightsPagination as c, useInsightsInstallationQuery as d, useInsightsInstallationsQuery as f, EventTimestamp as i, useInsightsEventsQuery as l, useReportingInstallationsQuery as m, EventHistoryCard as n, InsightsErrorAlert as o, useInsightsTimeFormat as p, EventHistoryList as r, InsightsPageHeader as s, EventBundleTransition as t, useInsightsInstallationEventsQuery as u };
@@ -1,60 +0,0 @@
1
- import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
2
- import { w as createSsrRpc } from "./createSsrRpc-DjWNJ0uc.mjs";
3
- import { g as redirect } from "../_libs/@tanstack/react-router+[...].mjs";
4
- import { i as useQueryClient, n as useQuery, t as useMutation } from "../_libs/tanstack__react-query.mjs";
5
- //#region node_modules/.nitro/vite/services/ssr/assets/api-keys-api-BUPQVSpk.js
6
- var parseName = (input) => {
7
- const name = typeof input === "object" && input !== null ? Reflect.get(input, "name") : void 0;
8
- if (typeof name !== "string") throw new TypeError("API key name must be a string.");
9
- return { name };
10
- };
11
- var parseId = (input) => {
12
- const id = typeof input === "object" && input !== null ? Reflect.get(input, "id") : void 0;
13
- if (typeof id !== "string" || !/^api-[A-Za-z0-9_-]{43}$/u.test(id)) throw new TypeError("Invalid API key id.");
14
- return { id };
15
- };
16
- var getApiKeyCapabilityRpc = createServerFn({ method: "GET" }).handler(createSsrRpc("29665ce3a33cde2eb2ee082694288db269438f62f3a4d0a005dec3256e0f15c1"));
17
- var listApiKeysRpc = createServerFn({ method: "GET" }).handler(createSsrRpc("2c7f3cdb9bd3cab2c026a48abdc84c362db0362924a08679052a325640aec56b"));
18
- var createApiKeyRpc = createServerFn({ method: "POST" }).validator(parseName).handler(createSsrRpc("68a2d94ee016be64936401f5eba60ab08a47ff373e1cf9de48e4413336e6034b"));
19
- var revokeApiKeyRpc = createServerFn({ method: "POST" }).validator(parseId).handler(createSsrRpc("a1cb80b19ca72a64fb631ca28ebb9b6941db245983de082d5dd3203ec2eef795"));
20
- var apiKeyQueryKeys = {
21
- capability: ["api-keys", "capability"],
22
- list: ["api-keys", "list"]
23
- };
24
- var getApiKeyCapabilityQueryOptions = () => ({
25
- queryKey: apiKeyQueryKeys.capability,
26
- queryFn: () => getApiKeyCapabilityRpc(),
27
- staleTime: Infinity
28
- });
29
- var useApiKeyCapabilityQuery = () => useQuery(getApiKeyCapabilityQueryOptions());
30
- var ensureApiKeyRouteAccess = async (queryClient) => {
31
- if (!(await queryClient.ensureQueryData(getApiKeyCapabilityQueryOptions())).apiKeys) throw redirect({
32
- to: "/",
33
- search: {},
34
- replace: true
35
- });
36
- };
37
- var useApiKeysQuery = () => useQuery({
38
- queryKey: apiKeyQueryKeys.list,
39
- queryFn: () => listApiKeysRpc()
40
- });
41
- var useCreateApiKeyMutation = () => {
42
- const queryClient = useQueryClient();
43
- return useMutation({
44
- mutationFn: (name) => createApiKeyRpc({ data: { name } }),
45
- onSuccess: async () => {
46
- await queryClient.invalidateQueries({ queryKey: apiKeyQueryKeys.list });
47
- }
48
- });
49
- };
50
- var useRevokeApiKeyMutation = () => {
51
- const queryClient = useQueryClient();
52
- return useMutation({
53
- mutationFn: (id) => revokeApiKeyRpc({ data: { id } }),
54
- onSuccess: async () => {
55
- await queryClient.invalidateQueries({ queryKey: apiKeyQueryKeys.list });
56
- }
57
- });
58
- };
59
- //#endregion
60
- export { useRevokeApiKeyMutation as a, useCreateApiKeyMutation as i, useApiKeyCapabilityQuery as n, useApiKeysQuery as r, ensureApiKeyRouteAccess as t };
@@ -1,136 +0,0 @@
1
- import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
2
- import { t as createServerRpc } from "./createServerRpc-DB29C_5p.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/api-keys-rpc-Cs7tS5_j.js
4
- var BASE64URL_32_PATTERN = /^[A-Za-z0-9_-]{43}$/u;
5
- var bytesToBase64Url = (bytes) => {
6
- let binary = "";
7
- for (const byte of bytes) binary += String.fromCharCode(byte);
8
- return btoa(binary).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/u, "");
9
- };
10
- var isApiKey = (value) => {
11
- if (!BASE64URL_32_PATTERN.test(value)) return false;
12
- try {
13
- const base64 = value.replaceAll("-", "+").replaceAll("_", "/");
14
- const binary = atob(`${base64}=`);
15
- const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));
16
- return bytes.byteLength === 32 && bytesToBase64Url(bytes) === value;
17
- } catch {
18
- return false;
19
- }
20
- };
21
- var hashApiKey = async (apiKey) => {
22
- if (!isApiKey(apiKey)) throw new TypeError("API key must be a canonical 32-byte base64url value.");
23
- const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(apiKey));
24
- return bytesToBase64Url(new Uint8Array(digest));
25
- };
26
- var apiKeyId = () => {
27
- const bytes = /* @__PURE__ */ new Uint8Array(16);
28
- crypto.getRandomValues(bytes);
29
- return `api-${bytesToBase64Url(bytes)}`;
30
- };
31
- var normalizeApiKeyName = (name) => {
32
- const normalized = name.trim();
33
- if (normalized.length === 0 || normalized.length > 64 || /[\p{Cc}\p{Cf}]/u.test(normalized)) throw new TypeError("API key names must contain 1-64 visible characters.");
34
- return normalized;
35
- };
36
- var toApiKeyMetadata = ({ hash: _hash, ...metadata }) => Object.freeze(metadata);
37
- var registerApiKey = async (input) => {
38
- const hash = await hashApiKey(input.apiKey);
39
- const createdAtMs = input.createdAtMs ?? Date.now();
40
- if (!Number.isSafeInteger(createdAtMs) || createdAtMs < 0) throw new TypeError("API key creation time must be non-negative.");
41
- const record = Object.freeze({
42
- created_at_ms: createdAtMs,
43
- hash,
44
- id: apiKeyId(),
45
- name: normalizeApiKeyName(input.name),
46
- prefix: input.apiKey.slice(0, 6),
47
- revoked_at_ms: null,
48
- role: "client"
49
- });
50
- if (await input.apiKeys.create(record) === "existing") {
51
- const existing = await input.apiKeys.findByHash(hash);
52
- if (existing === null || existing.revoked_at_ms !== null) throw new Error("The API key has been revoked.");
53
- return Object.freeze({
54
- apiKey: input.apiKey,
55
- record: toApiKeyMetadata(existing)
56
- });
57
- }
58
- return Object.freeze({
59
- apiKey: input.apiKey,
60
- record: toApiKeyMetadata(record)
61
- });
62
- };
63
- var createApiKey = (input) => {
64
- const bytes = /* @__PURE__ */ new Uint8Array(32);
65
- crypto.getRandomValues(bytes);
66
- return registerApiKey({
67
- apiKey: bytesToBase64Url(bytes),
68
- apiKeys: input.apiKeys,
69
- name: input.name
70
- });
71
- };
72
- var toApiKeyView = ({ hash: _hash, ...record }) => record;
73
- var parseName = (input) => {
74
- const name = typeof input === "object" && input !== null ? Reflect.get(input, "name") : void 0;
75
- if (typeof name !== "string") throw new TypeError("API key name must be a string.");
76
- return { name };
77
- };
78
- var parseId = (input) => {
79
- const id = typeof input === "object" && input !== null ? Reflect.get(input, "id") : void 0;
80
- if (typeof id !== "string" || !/^api-[A-Za-z0-9_-]{43}$/u.test(id)) throw new TypeError("Invalid API key id.");
81
- return { id };
82
- };
83
- var requireStore = async () => {
84
- const { prepareConfig } = await import("./config.server-afDuAwaG.mjs");
85
- const { apiKeyStore } = await prepareConfig();
86
- if (apiKeyStore === null) throw new Error("API keys are not supported by the configured database plugin.");
87
- return apiKeyStore;
88
- };
89
- var getApiKeyCapabilityRpc_createServerFn_handler = createServerRpc({
90
- id: "29665ce3a33cde2eb2ee082694288db269438f62f3a4d0a005dec3256e0f15c1",
91
- name: "getApiKeyCapabilityRpc",
92
- filename: "src/lib/api-keys-rpc.ts"
93
- }, (opts) => getApiKeyCapabilityRpc.__executeServer(opts));
94
- var getApiKeyCapabilityRpc = createServerFn({ method: "GET" }).handler(getApiKeyCapabilityRpc_createServerFn_handler, async () => {
95
- const { prepareConfig } = await import("./config.server-afDuAwaG.mjs");
96
- const { apiKeyStore } = await prepareConfig();
97
- return { apiKeys: apiKeyStore !== null };
98
- });
99
- var listApiKeysRpc_createServerFn_handler = createServerRpc({
100
- id: "2c7f3cdb9bd3cab2c026a48abdc84c362db0362924a08679052a325640aec56b",
101
- name: "listApiKeysRpc",
102
- filename: "src/lib/api-keys-rpc.ts"
103
- }, (opts) => listApiKeysRpc.__executeServer(opts));
104
- var listApiKeysRpc = createServerFn({ method: "GET" }).handler(listApiKeysRpc_createServerFn_handler, async () => {
105
- return [...await (await requireStore()).list()].sort((left, right) => right.created_at_ms - left.created_at_ms).map(toApiKeyView);
106
- });
107
- var createApiKeyRpc_createServerFn_handler = createServerRpc({
108
- id: "68a2d94ee016be64936401f5eba60ab08a47ff373e1cf9de48e4413336e6034b",
109
- name: "createApiKeyRpc",
110
- filename: "src/lib/api-keys-rpc.ts"
111
- }, (opts) => createApiKeyRpc.__executeServer(opts));
112
- var createApiKeyRpc = createServerFn({ method: "POST" }).validator(parseName).handler(createApiKeyRpc_createServerFn_handler, async ({ data }) => {
113
- const created = await createApiKey({
114
- apiKeys: await requireStore(),
115
- name: data.name
116
- });
117
- return {
118
- apiKey: created.apiKey,
119
- record: created.record
120
- };
121
- });
122
- var revokeApiKeyRpc_createServerFn_handler = createServerRpc({
123
- id: "a1cb80b19ca72a64fb631ca28ebb9b6941db245983de082d5dd3203ec2eef795",
124
- name: "revokeApiKeyRpc",
125
- filename: "src/lib/api-keys-rpc.ts"
126
- }, (opts) => revokeApiKeyRpc.__executeServer(opts));
127
- var revokeApiKeyRpc = createServerFn({ method: "POST" }).validator(parseId).handler(revokeApiKeyRpc_createServerFn_handler, async ({ data }) => {
128
- const revoked = await (await requireStore()).revoke({
129
- id: data.id,
130
- revokedAtMs: Date.now()
131
- });
132
- if (revoked === null) throw new Error("API key not found.");
133
- return toApiKeyView(revoked);
134
- });
135
- //#endregion
136
- export { createApiKeyRpc_createServerFn_handler, getApiKeyCapabilityRpc_createServerFn_handler, listApiKeysRpc_createServerFn_handler, revokeApiKeyRpc_createServerFn_handler };