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

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 (285) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/ConsoleFeatureUnavailable-D0LPL1Gy.js +1 -0
  3. package/.output/public/assets/HashValueDisplay-BmuB4FW-.js +1 -0
  4. package/.output/public/assets/InsightsInfo--v4SC07c.js +1 -0
  5. package/.output/public/assets/InsightsPageHeader-dU83CAQY.js +1 -0
  6. package/.output/public/assets/NotFoundPage-B5mhGG2a.js +1 -0
  7. package/.output/public/assets/api-D-vOVlQ4.js +1 -0
  8. package/.output/public/assets/api-keys-Csh8ARKU.js +1 -0
  9. package/.output/public/assets/api-keys-OMPUoA_A.js +1 -0
  10. package/.output/public/assets/arrow-left-Bwq9X1eS.js +1 -0
  11. package/.output/public/assets/arrow-up-right-BkOVn4if.js +1 -0
  12. package/.output/public/assets/card-C_7d6O9a.js +1 -0
  13. package/.output/public/assets/console-features-api-C1jRZTGw.js +1 -0
  14. package/.output/public/assets/dialog-DE8wFN_P.js +1 -0
  15. package/.output/public/assets/dist-C7ENGzpS.js +1 -0
  16. package/.output/public/assets/empty-CVd5NlQD.js +1 -0
  17. package/.output/public/assets/field-C06q1iC9.js +1 -0
  18. package/.output/public/assets/index-BeWlQtO6.js +11 -0
  19. package/.output/public/assets/input-group-Bi61biIA.js +1 -0
  20. package/.output/public/assets/insights-BjnAtC0f.js +2 -0
  21. package/.output/public/assets/insights-D86m11yH.js +42 -0
  22. package/.output/public/assets/insights-DpYstMoY.js +1 -0
  23. package/.output/public/assets/insights-recovery-rpc-BIm5_ALc.js +1 -0
  24. package/.output/public/assets/insights-search-KIF7mRtB.js +1 -0
  25. package/.output/public/assets/insights-usage-rpc-VHj8vyBt.js +1 -0
  26. package/.output/public/assets/insights_.distribution-ADcrX48c.js +2 -0
  27. package/.output/public/assets/insights_.distribution-CuuJUN6Y.js +1 -0
  28. package/.output/public/assets/insights_.distribution-DJRjuXsO.js +1 -0
  29. package/.output/public/assets/installations-BSBBzqWs.js +2 -0
  30. package/.output/public/assets/installations-DqIE6WcO.js +1 -0
  31. package/.output/public/assets/installations-UsELbDvw.js +1 -0
  32. package/.output/public/assets/loader-circle-CnCBxzHp.js +1 -0
  33. package/.output/public/assets/mutation-Csp7xUNh.js +1 -0
  34. package/.output/public/assets/preload-helper-B-cOmpLH.js +1 -0
  35. package/.output/public/assets/refresh-cw-FF1NtzlQ.js +1 -0
  36. package/.output/public/assets/routes-CoN9XHP_.js +2 -0
  37. package/.output/public/assets/routes-DT1jB0Zi.js +1 -0
  38. package/.output/public/assets/sidebar-D8mJRF15.js +3 -0
  39. package/.output/public/assets/styles-Bwt7v6U5.css +2 -0
  40. package/.output/public/assets/table-WBgfvgXg.js +1 -0
  41. package/.output/public/assets/useCompositeListItem-CloBmDwn.js +1 -0
  42. package/.output/public/assets/useMutation-DO8cvsTx.js +1 -0
  43. package/.output/public/assets/useOpenInteractionType-ReGr9GzJ.js +1 -0
  44. package/.output/public/assets/valueToPercent-BvPAi4bP.js +1 -0
  45. package/.output/server/{__23tanstack-start-server-fn-resolver-B7ioJhtE.mjs → __23tanstack-start-server-fn-resolver-DMRD4e4f.mjs} +51 -47
  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 +3803 -4023
  49. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +141 -98
  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__history.mjs +68 -41
  67. package/.output/server/_libs/tanstack__query-core.mjs +1618 -309
  68. package/.output/server/_libs/tanstack__react-query.mjs +262 -22
  69. package/.output/server/_libs/verkit.mjs +99 -1
  70. package/.output/server/_runtime.mjs +10 -1
  71. package/.output/server/_ssr/ConsoleFeatureUnavailable-Du7jNPNS.mjs +58 -0
  72. package/.output/server/_ssr/{HashValueDisplay-DwpGLfrl.mjs → HashValueDisplay-GQvFkXoi.mjs} +3 -3
  73. package/.output/server/_ssr/InsightsInfo-Do7QSaFR.mjs +37 -0
  74. package/.output/server/_ssr/InsightsPageHeader-DSUWUWRc.mjs +154 -0
  75. package/.output/server/_ssr/NotFoundPage-DsF4Vrhg.mjs +37 -0
  76. package/.output/server/_ssr/api-BEiVs0H7.mjs +203 -0
  77. package/.output/server/_ssr/api-keys-BrvBWGRf.mjs +5 -0
  78. package/.output/server/_ssr/{api-keys-CZeTPQys.mjs → api-keys-K5v32nf7.mjs} +49 -9
  79. package/.output/server/_ssr/api-keys-rpc-B96bBllm.mjs +52 -0
  80. package/.output/server/_ssr/api-rpc-DcUe280B.mjs +296 -0
  81. package/.output/server/_ssr/{auth-rpc-DUaeOWKK.mjs → auth-rpc-C68W56DP.mjs} +6 -6
  82. package/.output/server/_ssr/auth.server-DM1J6NwR.mjs +5712 -0
  83. package/.output/server/_ssr/bundleActivity-CpuY9CTP.mjs +19 -0
  84. package/.output/server/_ssr/card-CPAEKx0w.mjs +49 -0
  85. package/.output/server/_ssr/config-nsIcsHh8.mjs +15 -0
  86. package/.output/server/_ssr/config.server-DDCZk3Sq.mjs +36 -0
  87. package/.output/server/_ssr/console-access-Da-2Qd7q.mjs +17 -0
  88. package/.output/server/_ssr/console-features-Dzu2iUGD.mjs +55 -0
  89. package/.output/server/_ssr/console-features-api-xAsSgFa_.mjs +43 -0
  90. package/.output/server/_ssr/console-features-rpc-qARGpB24.mjs +19 -0
  91. package/.output/server/_ssr/{createServerFn-B2hcXoPM.mjs → createMiddleware-BdBf_ezN.mjs} +67 -56
  92. package/.output/server/_ssr/{createServerRpc-DB29C_5p.mjs → createServerRpc-B_y2lrwA.mjs} +2 -2
  93. package/.output/server/_ssr/{databaseJsonValue-d6I3nAS4.mjs → databaseJsonValue-Bhxciy7Z.mjs} +28 -5
  94. package/.output/server/_ssr/databaseRows-DwMAjaF8.mjs +74 -0
  95. package/.output/server/_ssr/{dialog-DS-nw-pA.mjs → dialog-q__BJ7mQ.mjs} +2 -2
  96. package/.output/server/_ssr/{dist-CyzPaI5v.mjs → dist-Cxo9ghYv.mjs} +140 -6
  97. package/.output/server/_ssr/{downloadBundle-CNnYxYO2.mjs → downloadBundle-BW9I-pMQ.mjs} +10 -10
  98. package/.output/server/_ssr/empty-DcBTAooP.mjs +49 -0
  99. package/.output/server/_ssr/{empty-plugin-adapters-B5QvGpEl.mjs → empty-plugin-adapters-CYdinE-i.mjs} +1 -1
  100. package/.output/server/_ssr/{table-CnZmon_Z.mjs → field-QCDBVpXA.mjs} +63 -51
  101. package/.output/server/_ssr/getBundleChildren-DIAGCF4a.mjs +22 -0
  102. package/.output/server/_ssr/{input-group-BpsnmvZw.mjs → input-group-hCk2nUoU.mjs} +2 -2
  103. package/.output/server/_ssr/insights-BfBO0RFr.mjs +1238 -0
  104. package/.output/server/_ssr/insights-DsAU3-TB.mjs +14 -0
  105. package/.output/server/_ssr/insights-RIfg447W.mjs +5 -0
  106. package/.output/server/_ssr/insights-api-CDn-QQHU.mjs +105 -0
  107. package/.output/server/_ssr/insights-failures-BBGMhuUr.mjs +44 -0
  108. package/.output/server/_ssr/insights-failures-rpc-rA2dctK2.mjs +21 -0
  109. package/.output/server/_ssr/insights-recovery-Dpk6Mfb9.mjs +28 -0
  110. package/.output/server/_ssr/insights-recovery-rpc-BCaF-xSd.mjs +46 -0
  111. package/.output/server/_ssr/insights-recovery-rpc-CcgYyUHk.mjs +20 -0
  112. package/.output/server/_ssr/{insights-rpc-38DujK0G.mjs → insights-rpc-keycmwzw.mjs} +22 -14
  113. package/.output/server/_ssr/insights-search-BRg5VsNe.mjs +25 -0
  114. package/.output/server/_ssr/insights-usage-cbw9n2Fq.mjs +29 -0
  115. package/.output/server/_ssr/insights-usage-rpc-BKgV1QDf.mjs +29 -0
  116. package/.output/server/_ssr/insights-usage-rpc-D-JYachy.mjs +41 -0
  117. package/.output/server/_ssr/insightsRecovery-B7oMc8d8.mjs +45 -0
  118. package/.output/server/_ssr/insightsUsage-Oa7kk5ek.mjs +56 -0
  119. package/.output/server/_ssr/insights_.distribution-BIqOqRW0.mjs +335 -0
  120. package/.output/server/_ssr/insights_.distribution-CuUrDa7P.mjs +5 -0
  121. package/.output/server/_ssr/insights_.distribution-RT_6x_ud.mjs +14 -0
  122. package/.output/server/_ssr/{installations-DiVKEF5T.mjs → installations-BO5CjX2z.mjs} +517 -54
  123. package/.output/server/_ssr/installations-BjaHiIfh.mjs +5 -0
  124. package/.output/server/_ssr/installations-Dt5luA-N.mjs +69 -0
  125. package/.output/server/_ssr/listReleases-BitHzOYB.mjs +79 -0
  126. package/.output/server/_ssr/releaseManagement-B3e7I8J9.mjs +11 -0
  127. package/.output/server/_ssr/{router-B9wG_9f8.mjs → router-DfVAixxe.mjs} +135 -139
  128. package/.output/server/_ssr/{routes-D7Yh_jfj.mjs → routes-C6LstNp8.mjs} +176 -455
  129. package/.output/server/_ssr/routes-Q3Uhmwwz.mjs +292 -0
  130. package/.output/server/_ssr/runtime.server-fL0o6I2b.mjs +1459 -0
  131. package/.output/server/_ssr/schema-BKY9SqaY.mjs +25 -0
  132. package/.output/server/_ssr/select-CUlInmjk.mjs +107 -0
  133. package/.output/server/_ssr/server-C43wq9ft.mjs +8330 -0
  134. package/.output/server/_ssr/{createSsrRpc-DjWNJ0uc.mjs → sidebar-DKbx2ach.mjs} +117 -63
  135. package/.output/server/_ssr/ssr.mjs +1 -1
  136. package/.output/server/_ssr/start-BXUOv_n8.mjs +4 -0
  137. package/.output/server/_ssr/table-NGWV8B-S.mjs +53 -0
  138. package/.output/server/_ssr/updateFailures-Jwe2Baab.mjs +24 -0
  139. package/.output/server/_ssr/{uuidv7-D0QFkPL_.mjs → uuidv7-C8bwiZr8.mjs} +2 -2
  140. package/.output/server/_tanstack-start-manifest_v-WQ5qGn8n.mjs +124 -0
  141. package/.output/server/index.mjs +267 -162
  142. package/LICENSE +13 -14
  143. package/README.md +82 -72
  144. package/lib/index.d.mts +23 -11
  145. package/lib/vite-internal.mjs +13 -3
  146. package/lib/vite.d.mts +2 -0
  147. package/package.json +14 -14
  148. package/src/components/AppSidebar.tsx +100 -71
  149. package/src/components/ConsoleAccessPage.tsx +5 -1
  150. package/src/components/ConsoleFeatureUnavailable.tsx +80 -0
  151. package/src/components/NotFoundPage.tsx +7 -7
  152. package/src/components/features/FeatureSlots.tsx +99 -0
  153. package/src/components/features/api-keys/apiKeysFeatureUi.tsx +15 -0
  154. package/src/components/features/bundles/BundleMetadata.tsx +8 -5
  155. package/src/components/features/bundles/RolloutCohortsDialog.tsx +1 -1
  156. package/src/components/features/channels/ChannelManagementDialog.tsx +2 -5
  157. package/src/components/features/insights/AppUsage.tsx +370 -0
  158. package/src/components/features/insights/EstimatedCount.tsx +18 -0
  159. package/src/components/features/insights/EventDetails.tsx +117 -37
  160. package/src/components/features/insights/EventHistoryCard.tsx +112 -26
  161. package/src/components/features/insights/EventHistoryList.tsx +2 -2
  162. package/src/components/features/insights/InsightsControls.tsx +265 -102
  163. package/src/components/features/insights/InsightsErrorAlert.tsx +14 -1
  164. package/src/components/features/insights/InsightsInfo.tsx +48 -0
  165. package/src/components/features/insights/InsightsOverview.tsx +176 -173
  166. package/src/components/features/insights/InsightsPageHeader.tsx +35 -20
  167. package/src/components/features/insights/InsightsPeriodSelector.tsx +89 -0
  168. package/src/components/features/insights/InstallationHistoryCard.tsx +52 -10
  169. package/src/components/features/insights/InstallationMatchesCard.tsx +1 -1
  170. package/src/components/features/insights/ReleaseActivity.tsx +188 -0
  171. package/src/components/features/insights/ReportingDevicesSummary.tsx +65 -0
  172. package/src/components/features/insights/UpdateFailures.tsx +319 -0
  173. package/src/components/features/insights/insightsFeatureUi.tsx +35 -0
  174. package/src/components/features/releases/ReleaseEditorSheet.tsx +30 -7
  175. package/src/components/ui/card.tsx +1 -1
  176. package/src/components/ui/empty.tsx +101 -0
  177. package/src/components/ui/scroll-area.tsx +52 -0
  178. package/src/components/ui/sidebar.tsx +22 -29
  179. package/src/components/ui/tabs.tsx +81 -0
  180. package/src/index.ts +26 -19
  181. package/src/lib/api-keys-api.ts +0 -28
  182. package/src/lib/api-keys-rpc.ts +27 -38
  183. package/src/lib/api-rpc.ts +189 -266
  184. package/src/lib/api.ts +19 -102
  185. package/src/lib/bundle-activity.ts +31 -0
  186. package/src/lib/console-access.ts +20 -0
  187. package/src/lib/console-features-api.ts +68 -0
  188. package/src/lib/console-features-rpc.ts +13 -0
  189. package/src/lib/console-features.ts +91 -0
  190. package/src/lib/insights-api.ts +37 -1
  191. package/src/lib/insights-failures-rpc.ts +21 -0
  192. package/src/lib/insights-failures.ts +129 -0
  193. package/src/lib/insights-recovery-rpc.ts +51 -0
  194. package/src/lib/insights-recovery.ts +68 -0
  195. package/src/lib/insights-retention.ts +21 -0
  196. package/src/lib/insights-rpc.ts +30 -12
  197. package/src/lib/insights-search.ts +58 -0
  198. package/src/lib/insights-usage-rpc.ts +29 -0
  199. package/src/lib/insights-usage.ts +74 -0
  200. package/src/lib/insights-view.ts +38 -2
  201. package/src/lib/scroll-restoration.ts +21 -0
  202. package/src/lib/server/adminInsights.ts +124 -0
  203. package/src/lib/server/auth.server.ts +13 -5
  204. package/src/lib/server/bundleActivity.ts +37 -0
  205. package/src/lib/server/config.server.ts +21 -74
  206. package/src/lib/server/console-feature-apis.ts +59 -0
  207. package/src/lib/server/console-runtime.server.ts +82 -38
  208. package/src/lib/server/downloadBundle.ts +16 -15
  209. package/src/lib/server/getBundleChildren.ts +31 -122
  210. package/src/lib/server/insightsRecovery.ts +55 -0
  211. package/src/lib/server/insightsUsage.ts +63 -0
  212. package/src/lib/server/listReleases.ts +109 -44
  213. package/src/lib/server/releaseReachability.ts +8 -7
  214. package/src/lib/server/runtime.server.ts +120 -31
  215. package/src/lib/server/updateFailures.ts +31 -0
  216. package/src/routeTree.gen.ts +44 -44
  217. package/src/router.tsx +3 -2
  218. package/src/routes/-installations-search.ts +32 -8
  219. package/src/routes/-releases-search.ts +76 -29
  220. package/src/routes/__root.tsx +10 -4
  221. package/src/routes/api/bundles/$bundleId/download.ts +2 -5
  222. package/src/routes/api-keys.tsx +5 -2
  223. package/src/routes/index.tsx +167 -104
  224. package/src/routes/insights.tsx +100 -59
  225. package/src/routes/insights_.distribution.tsx +398 -0
  226. package/src/routes/installations.tsx +98 -41
  227. package/src/vite-internal.ts +15 -3
  228. package/src/vite.ts +2 -0
  229. package/.output/public/assets/HashValueDisplay-CB0Eskit.js +0 -1
  230. package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +0 -1
  231. package/.output/public/assets/api-keys-BzKocqRy.js +0 -1
  232. package/.output/public/assets/api-keys-api-BHcODB7q.js +0 -1
  233. package/.output/public/assets/card-Dhr_eFYj.js +0 -1
  234. package/.output/public/assets/chart-no-axes-combined-Dy4WJv2U.js +0 -1
  235. package/.output/public/assets/composite-Bp98A0Ld.js +0 -1
  236. package/.output/public/assets/createServerFn-CA8fs7QD.js +0 -3
  237. package/.output/public/assets/dialog-CUTrcPlB.js +0 -1
  238. package/.output/public/assets/dist-C_NydL0e.js +0 -1
  239. package/.output/public/assets/index-DdAz-CXv.js +0 -10
  240. package/.output/public/assets/input-group-cSOG4wh_.js +0 -1
  241. package/.output/public/assets/insights-C0PBSZ-n.js +0 -1
  242. package/.output/public/assets/installations-CE33wgbY.js +0 -2
  243. package/.output/public/assets/installations-CStZja8x.js +0 -1
  244. package/.output/public/assets/lazyRouteComponent-Ccp3bwBY.js +0 -1
  245. package/.output/public/assets/link-CI8idAUi.js +0 -1
  246. package/.output/public/assets/loader-circle-BoxLrsOu.js +0 -1
  247. package/.output/public/assets/preload-helper-CQ36nxok.js +0 -1
  248. package/.output/public/assets/refresh-cw-Bqc72UZG.js +0 -1
  249. package/.output/public/assets/routes-DGVXdzpw.js +0 -2
  250. package/.output/public/assets/routes-DTlwOr8I.js +0 -1
  251. package/.output/public/assets/shield-check-uK3MHWJZ.js +0 -1
  252. package/.output/public/assets/signing-CMf4aqDO.js +0 -1
  253. package/.output/public/assets/styles-BCvbtKsm.css +0 -2
  254. package/.output/public/assets/table-2vcV89QB.js +0 -1
  255. package/.output/public/assets/useCompositeListItem-CHLITE_4.js +0 -1
  256. package/.output/public/assets/x-DCd0j8c6.js +0 -1
  257. package/.output/server/_ssr/InsightsPageHeader-Df4Brj8u.mjs +0 -484
  258. package/.output/server/_ssr/api-keys-api-BUPQVSpk.mjs +0 -60
  259. package/.output/server/_ssr/api-keys-rpc-Cs7tS5_j.mjs +0 -136
  260. package/.output/server/_ssr/api-rpc-tAupfGQm.mjs +0 -1399
  261. package/.output/server/_ssr/auth.server-DW71WzsD.mjs +0 -47
  262. package/.output/server/_ssr/bundle-signing-rpc-BhnBw0-d.mjs +0 -16
  263. package/.output/server/_ssr/bundle-signing.server-C4NW5mWx.mjs +0 -12
  264. package/.output/server/_ssr/card-BRiPmi0C.mjs +0 -108
  265. package/.output/server/_ssr/config-Dv8qLDZ0.mjs +0 -13
  266. package/.output/server/_ssr/config.server-afDuAwaG.mjs +0 -368
  267. package/.output/server/_ssr/databaseRows-5bCRTxm-.mjs +0 -126
  268. package/.output/server/_ssr/deleteBundle-BTGwBgzx.mjs +0 -66
  269. package/.output/server/_ssr/getBundleChildren-C0vh4ZvE.mjs +0 -50
  270. package/.output/server/_ssr/insights-BdS364Xu.mjs +0 -460
  271. package/.output/server/_ssr/insightsContract-fjJDBeEE.mjs +0 -303
  272. package/.output/server/_ssr/installations-CtA59MQG.mjs +0 -29
  273. package/.output/server/_ssr/routes-CKrrS2q2.mjs +0 -37
  274. package/.output/server/_ssr/runtime.server-DacU1TBV.mjs +0 -438
  275. package/.output/server/_ssr/server-D_C2rMzf.mjs +0 -7468
  276. package/.output/server/_ssr/signing-Dz1WkZOf.mjs +0 -133
  277. package/.output/server/_ssr/start-DpViQGnt.mjs +0 -4
  278. package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +0 -97
  279. package/src/components/features/insights/InsightsBundleReports.tsx +0 -51
  280. package/src/components/features/signing/BundleSigningPage.tsx +0 -139
  281. package/src/lib/bundle-signing-api.ts +0 -14
  282. package/src/lib/bundle-signing-rpc.ts +0 -16
  283. package/src/lib/server/bundle-signing.server.ts +0 -23
  284. package/src/lib/server/deleteBundle.ts +0 -145
  285. 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 };