@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
@@ -0,0 +1,19 @@
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/bundleActivity-CpuY9CTP.js
2
+ async function getBundleActivity(model, inputs) {
3
+ if (inputs.length === 0) return {};
4
+ const releases = inputs.map((input) => ({
5
+ releaseId: input.releaseId,
6
+ platform: input.platform,
7
+ channel: input.channel
8
+ }));
9
+ const activity = await model.getReleaseActivity({ releases });
10
+ return Object.fromEntries(activity.data.flatMap((item) => item.release === void 0 ? [] : [[item.release.releaseId, {
11
+ downloads: item.metrics.downloads,
12
+ activeDays: item.metrics.launches,
13
+ failedLaunches: item.metrics.failedLaunches,
14
+ measuredAtMs: activity.measuredAtMs,
15
+ coverage: activity.coverage
16
+ }]]));
17
+ }
18
+ //#endregion
19
+ export { getBundleActivity };
@@ -0,0 +1,49 @@
1
+ import "../_runtime.mjs";
2
+ import { mt as require_react, pt as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
3
+ import { O as cn } from "./sidebar-DKbx2ach.mjs";
4
+ require_react();
5
+ var import_jsx_runtime = require_jsx_runtime();
6
+ function Card({ className, ...props }) {
7
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
8
+ "data-slot": "card",
9
+ className: cn("rounded-xl border bg-card text-card-foreground shadow", className),
10
+ ...props
11
+ });
12
+ }
13
+ function CardHeader({ className, ...props }) {
14
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
15
+ "data-slot": "card-header",
16
+ className: cn("flex flex-col gap-1.5 p-6", className),
17
+ ...props
18
+ });
19
+ }
20
+ function CardTitle({ className, ...props }) {
21
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
22
+ "data-slot": "card-title",
23
+ className: cn("font-semibold leading-none tracking-tight", className),
24
+ ...props
25
+ });
26
+ }
27
+ function CardDescription({ className, ...props }) {
28
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
29
+ "data-slot": "card-description",
30
+ className: cn("text-sm text-muted-foreground", className),
31
+ ...props
32
+ });
33
+ }
34
+ function CardContent({ className, ...props }) {
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
36
+ "data-slot": "card-content",
37
+ className: cn("p-6 pt-0", className),
38
+ ...props
39
+ });
40
+ }
41
+ function CardFooter({ className, ...props }) {
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
43
+ "data-slot": "card-footer",
44
+ className: cn("flex items-center p-6 pt-0", className),
45
+ ...props
46
+ });
47
+ }
48
+ //#endregion
49
+ export { CardHeader as a, CardFooter as i, CardContent as n, CardTitle as o, CardDescription as r, Card as t };
@@ -0,0 +1,15 @@
1
+ import { loadConfig } from "@hot-updater/cli-tools";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/config-nsIcsHh8.js
3
+ var config_default = async () => {
4
+ const config = await loadConfig(null);
5
+ if (config.database === void 0) throw new Error("Set database in hot-updater.config.ts: the database your server runs on, such as d1Database(...), or standaloneRepository({ baseUrl }) to reach a self-hosted server through its admin API.");
6
+ if (config.storage === void 0) throw new Error("Set storage in hot-updater.config.ts: where your server stores bundles, which the console reads, such as r2Storage(...).");
7
+ return {
8
+ database: config.database,
9
+ storage: config.storage,
10
+ plugins: config.plugins,
11
+ console: { gitUrl: config.console.gitUrl }
12
+ };
13
+ };
14
+ //#endregion
15
+ export { config_default as default };
@@ -0,0 +1,36 @@
1
+ import { r as getRequest } from "./server-C43wq9ft.mjs";
2
+ import { requireConsoleAccess, t as resolveConsoleConfig } from "./auth.server-DM1J6NwR.mjs";
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/config.server-DDCZk3Sq.js
4
+ var configPromise = null;
5
+ var core = null;
6
+ var runtime = null;
7
+ var loadCachedConfig = async (request) => {
8
+ if (!configPromise) configPromise = resolveConsoleConfig(request).catch((error) => {
9
+ configPromise = null;
10
+ throw error;
11
+ });
12
+ return configPromise;
13
+ };
14
+ var prepareConfig = async (request = getRequest()) => {
15
+ try {
16
+ await requireConsoleAccess(request);
17
+ const config = await loadCachedConfig(request);
18
+ core ??= config.core;
19
+ if (!runtime) {
20
+ const { createConsoleRuntime } = await import("./runtime.server-fL0o6I2b.mjs");
21
+ runtime = createConsoleRuntime(config);
22
+ }
23
+ return {
24
+ config,
25
+ core,
26
+ runtime,
27
+ storage: config.storage
28
+ };
29
+ } catch (error) {
30
+ if (!(error instanceof Response && (error.status === 401 || error.status === 403))) console.error("Error during configuration initialization:", error);
31
+ throw error;
32
+ }
33
+ };
34
+ var isConfigLoaded = () => Boolean(configPromise);
35
+ //#endregion
36
+ export { isConfigLoaded, prepareConfig };
@@ -0,0 +1,17 @@
1
+ import { c as createMiddleware } from "./createMiddleware-BdBf_ezN.mjs";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/console-access-Da-2Qd7q.js
3
+ /**
4
+ * Refuses a caller the console does not authorize before a server function
5
+ * reads its input. TanStack Start runs a function's middleware before the
6
+ * function's own validator, so an anonymous or unlisted caller gets the access
7
+ * check's 401 or 403, never an input error, whatever it sends. Every server
8
+ * function except the sign-in reads in `auth-rpc.ts` uses it, and
9
+ * `console-access.spec.ts` checks that.
10
+ */
11
+ var consoleAccess = createMiddleware({ type: "function" }).server(async ({ next }) => {
12
+ const [{ getRequest }, { requireConsoleAccess }] = await Promise.all([import("./server-C43wq9ft.mjs").then((n) => n.t), import("./auth.server-DM1J6NwR.mjs")]);
13
+ await requireConsoleAccess(getRequest());
14
+ return next();
15
+ });
16
+ //#endregion
17
+ export { consoleAccess as t };
@@ -0,0 +1,55 @@
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/console-features-Dzu2iUGD.js
2
+ /**
3
+ * The console's features and the server plugin each one needs. The console
4
+ * serves a feature only when its config lists the plugin, as the server runs
5
+ * it, and against a self-hosted server (`standaloneRepository`) only the
6
+ * features its admin API serves (`remote`); the rest read the database.
7
+ * Navigation, route guards, and server functions all read this registry. Its
8
+ * other halves, keyed by the same features, hold what serves each feature on
9
+ * the server (`server/console-feature-apis.ts`) and what each adds to pages
10
+ * (`components/features/console-feature-ui.tsx`).
11
+ */
12
+ var consoleFeatures = {
13
+ insights: {
14
+ plugin: "insights",
15
+ label: "Insights",
16
+ remote: true
17
+ },
18
+ insightsAnalytics: {
19
+ plugin: "insights",
20
+ label: "Insights",
21
+ remote: false
22
+ },
23
+ apiKeys: {
24
+ plugin: "apiKeys",
25
+ label: "API keys",
26
+ remote: false
27
+ }
28
+ };
29
+ var featureIds = Object.keys(consoleFeatures);
30
+ /** The features on for the plugins the console's config lists, from where the console reads them. */
31
+ var resolveConsoleFeatures = (plugins, { remote }) => {
32
+ const installed = new Set(plugins);
33
+ return Object.fromEntries(featureIds.map((feature) => {
34
+ const { plugin, remote: servedRemotely } = consoleFeatures[feature];
35
+ return [feature, installed.has(plugin) && (servedRemotely || !remote)];
36
+ }));
37
+ };
38
+ /** Why a feature is off: its plugin is missing, or it reads a database the console does not open. */
39
+ var unavailableReason = (feature, { remote }) => remote && !consoleFeatures[feature].remote ? "remote" : "plugin";
40
+ /**
41
+ * A server function refused a feature the console does not serve: the
42
+ * features' 404. The client recognizes it by `name`, which survives
43
+ * serialization where the class does not.
44
+ */
45
+ var ConsoleFeatureUnavailableError = class extends Error {
46
+ name = "ConsoleFeatureUnavailableError";
47
+ status = 404;
48
+ constructor(feature, { remote }) {
49
+ super(unavailableReason(feature, { remote }) === "remote" ? "The console reads this from the database, and it reaches a self-hosted server through its admin API instead." : `The server runs without the ${consoleFeatures[feature].plugin}() plugin.`);
50
+ this.feature = feature;
51
+ }
52
+ };
53
+ var isConsoleFeatureUnavailableError = (error) => error instanceof Error && error.name === "ConsoleFeatureUnavailableError" && featureIds.includes(Reflect.get(error, "feature"));
54
+ //#endregion
55
+ export { unavailableReason as a, resolveConsoleFeatures as i, consoleFeatures as n, isConsoleFeatureUnavailableError as r, ConsoleFeatureUnavailableError as t };
@@ -0,0 +1,43 @@
1
+ import { n as consoleFeatures } from "./console-features-Dzu2iUGD.mjs";
2
+ import { u as createServerFn } from "./createMiddleware-BdBf_ezN.mjs";
3
+ import { k as createSsrRpc } from "./sidebar-DKbx2ach.mjs";
4
+ import { t as consoleAccess } from "./console-access-Da-2Qd7q.mjs";
5
+ import { _ as notFound } from "../_libs/@tanstack/react-router+[...].mjs";
6
+ import { n as queryOptions, r as useQuery } from "../_libs/tanstack__react-query.mjs";
7
+ //#region node_modules/.nitro/vite/services/ssr/assets/console-features-api-xAsSgFa_.js
8
+ /** The features this console serves, for navigation and route guards. */
9
+ var getConsoleFeaturesRpc = createServerFn({ method: "GET" }).middleware([consoleAccess]).handler(createSsrRpc("82ec3500e57f9e81dac6d3f3a7bd9e34915da3121429beec87b7ad153dc6eafe"));
10
+ var consoleFeaturesQueryKey = ["console", "features"];
11
+ var consoleFeaturesQueryOptions = () => queryOptions({
12
+ queryKey: consoleFeaturesQueryKey,
13
+ queryFn: () => getConsoleFeaturesRpc(),
14
+ staleTime: Infinity
15
+ });
16
+ /** The features the console serves; the authorized layout loads them first. */
17
+ var useConsoleFeatures = () => useQuery(consoleFeaturesQueryOptions());
18
+ /** Whether `feature` is on; false until the features load. */
19
+ var useConsoleFeature = (feature) => useConsoleFeatures().data?.features[feature] === true;
20
+ /** The feature in a route's not-found data, when a feature guard threw it. */
21
+ var notFoundFeature = (data) => {
22
+ const feature = typeof data === "object" && data !== null ? Reflect.get(data, "feature") : void 0;
23
+ return typeof feature === "string" && Object.hasOwn(consoleFeatures, feature) ? feature : void 0;
24
+ };
25
+ /**
26
+ * A feature route's `beforeLoad`: not found, naming the feature, when the
27
+ * console does not serve it. A failed features read lets the route load: the
28
+ * root layout answers a visitor it does not authorize, and the route's own
29
+ * reads report any other failure. The failure leaves the cache, which a
30
+ * server render sends to the browser: a refused visitor's failure is the 401
31
+ * or 403 Response, which the render cannot serialize.
32
+ */
33
+ var requireConsoleFeature = async (queryClient, feature) => {
34
+ const featureSet = await queryClient.ensureQueryData(consoleFeaturesQueryOptions()).catch(() => {
35
+ queryClient.removeQueries({
36
+ queryKey: consoleFeaturesQueryKey,
37
+ exact: true
38
+ });
39
+ });
40
+ if (featureSet !== void 0 && !featureSet.features[feature]) throw notFound({ data: { feature } });
41
+ };
42
+ //#endregion
43
+ export { useConsoleFeatures as a, useConsoleFeature as i, notFoundFeature as n, requireConsoleFeature as r, consoleFeaturesQueryOptions as t };
@@ -0,0 +1,19 @@
1
+ import { u as createServerFn } from "./createMiddleware-BdBf_ezN.mjs";
2
+ import { t as consoleAccess } from "./console-access-Da-2Qd7q.mjs";
3
+ import { t as createServerRpc } from "./createServerRpc-B_y2lrwA.mjs";
4
+ //#region node_modules/.nitro/vite/services/ssr/assets/console-features-rpc-qARGpB24.js
5
+ var getConsoleFeaturesRpc_createServerFn_handler = createServerRpc({
6
+ id: "82ec3500e57f9e81dac6d3f3a7bd9e34915da3121429beec87b7ad153dc6eafe",
7
+ name: "getConsoleFeaturesRpc",
8
+ filename: "src/lib/console-features-rpc.ts"
9
+ }, (opts) => getConsoleFeaturesRpc.__executeServer(opts));
10
+ var getConsoleFeaturesRpc = createServerFn({ method: "GET" }).middleware([consoleAccess]).handler(getConsoleFeaturesRpc_createServerFn_handler, async () => {
11
+ const { prepareConfig } = await import("./config.server-DDCZk3Sq.mjs");
12
+ const { runtime } = await prepareConfig();
13
+ return {
14
+ features: await runtime.features(),
15
+ remote: runtime.remote
16
+ };
17
+ });
18
+ //#endregion
19
+ export { getConsoleFeaturesRpc_createServerFn_handler };
@@ -1,15 +1,15 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
- //#region node_modules/.nitro/vite/services/ssr/assets/createServerFn-B2hcXoPM.js
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/createMiddleware-BdBf_ezN.js
3
3
  /**
4
4
  * Create a redirect Response understood by TanStack Router.
5
5
  *
6
6
  * Use from route `loader`/`beforeLoad` or server functions to trigger a
7
7
  * navigation. If `throw: true` is set, the redirect is thrown instead of
8
- * returned. When an absolute `href` is supplied and `reloadDocument` is not
9
- * set, a full-document navigation is inferred.
8
+ * returned. External `href` values are classified as full-document
9
+ * navigations when the router resolves the redirect.
10
10
  *
11
11
  * @param opts Options for the redirect. Common fields:
12
- * - `href`: absolute URL for external redirects; infers `reloadDocument`.
12
+ * - `href`: absolute URL for external redirects.
13
13
  * - `statusCode`: HTTP status code to use (defaults to 307).
14
14
  * - `headers`: additional headers to include on the Response.
15
15
  * - Standard navigation options like `to`, `params`, `search`, `replace`,
@@ -19,10 +19,6 @@ import { AsyncLocalStorage } from "node:async_hooks";
19
19
  */
20
20
  function redirect(opts) {
21
21
  opts.statusCode = opts.statusCode || opts.code || 307;
22
- if (!opts._builtLocation && !opts.reloadDocument && typeof opts.href === "string") try {
23
- new URL(opts.href);
24
- opts.reloadDocument = true;
25
- } catch {}
26
22
  const headers = new Headers(opts.headers);
27
23
  if (opts.href && headers.get("Location") === null) headers.set("Location", opts.href);
28
24
  const response = new Response(null, {
@@ -34,16 +30,9 @@ function redirect(opts) {
34
30
  return response;
35
31
  }
36
32
  /** Check whether a value is a TanStack Router redirect Response. */
37
- /** Check whether a value is a TanStack Router redirect Response. */
38
33
  function isRedirect(obj) {
39
34
  return obj instanceof Response && !!obj.options;
40
35
  }
41
- /** True if value is a redirect with a resolved `href` location. */
42
- /** True if value is a redirect with a resolved `href` location. */
43
- function isResolvedRedirect(obj) {
44
- return isRedirect(obj) && !!obj.options.href;
45
- }
46
- /** Parse a serialized redirect object back into a redirect Response. */
47
36
  /** Parse a serialized redirect object back into a redirect Response. */
48
37
  function parseRedirect(obj) {
49
38
  if (obj !== null && typeof obj === "object" && obj.isSerializedRedirect) return redirect(obj);
@@ -55,42 +44,12 @@ var X_TSS_SERIALIZED = "x-tss-serialized";
55
44
  var X_TSS_RAW_RESPONSE = "x-tss-raw";
56
45
  /** Content-Type for multiplexed framed responses (RawStream support) */
57
46
  var TSS_CONTENT_TYPE_FRAMED = "application/x-tss-framed";
58
- /**
59
- * Frame types for binary multiplexing protocol.
60
- */
61
- var FrameType = {
62
- JSON: 0,
63
- CHUNK: 1,
64
- END: 2,
65
- ERROR: 3
66
- };
47
+ /** Largest payload accepted by one framed-protocol record. */
48
+ var MAX_FRAME_PAYLOAD_SIZE = 16 * 1024 * 1024;
49
+ /** Largest number of raw streams accepted in one framed response. */
50
+ var MAX_FRAMED_STREAMS = 1024;
67
51
  /** Full Content-Type header value with version parameter */
68
52
  var TSS_CONTENT_TYPE_FRAMED_VERSIONED = `${TSS_CONTENT_TYPE_FRAMED}; v=1`;
69
- function isSafeKey(key) {
70
- return key !== "__proto__" && key !== "constructor" && key !== "prototype";
71
- }
72
- /**
73
- * Merge target and source into a new null-proto object, filtering dangerous keys.
74
- */
75
- function safeObjectMerge(target, source) {
76
- const result = Object.create(null);
77
- if (target) {
78
- for (const key of Object.keys(target)) if (isSafeKey(key)) result[key] = target[key];
79
- }
80
- if (source && typeof source === "object") {
81
- for (const key of Object.keys(source)) if (isSafeKey(key)) result[key] = source[key];
82
- }
83
- return result;
84
- }
85
- /**
86
- * Create a null-prototype object, optionally copying from source.
87
- */
88
- function createNullProtoObject(source) {
89
- if (!source) return Object.create(null);
90
- const obj = Object.create(null);
91
- for (const key of Object.keys(source)) if (isSafeKey(key)) obj[key] = source[key];
92
- return obj;
93
- }
94
53
  var GLOBAL_STORAGE_KEY = Symbol.for("tanstack-start:start-storage-context");
95
54
  var globalObj = globalThis;
96
55
  if (!globalObj[GLOBAL_STORAGE_KEY]) globalObj[GLOBAL_STORAGE_KEY] = new AsyncLocalStorage();
@@ -104,7 +63,6 @@ function getStartContext(opts) {
104
63
  return context;
105
64
  }
106
65
  var getStartOptions = () => getStartContext().startOptions;
107
- var getStartContextServerOnly = getStartContext;
108
66
  function splitSetCookieString(cookiesString) {
109
67
  if (Array.isArray(cookiesString)) return cookiesString.flatMap((c) => splitSetCookieString(c));
110
68
  if (typeof cookiesString !== "string") return [];
@@ -161,6 +119,32 @@ function mergeHeaders(...headers) {
161
119
  return acc;
162
120
  }, new Headers());
163
121
  }
122
+ function isSafeKey(key) {
123
+ return key !== "__proto__" && key !== "constructor" && key !== "prototype";
124
+ }
125
+ /**
126
+ * Merge target and source into a new null-proto object, filtering dangerous keys.
127
+ */
128
+ function safeObjectMerge(target, source) {
129
+ const result = Object.create(null);
130
+ if (target) {
131
+ for (const key of Object.keys(target)) if (isSafeKey(key)) result[key] = target[key];
132
+ }
133
+ if (source && typeof source === "object") {
134
+ for (const key of Object.keys(source)) if (isSafeKey(key)) result[key] = source[key];
135
+ }
136
+ return result;
137
+ }
138
+ /**
139
+ * Create a null-prototype object, optionally copying from source.
140
+ */
141
+ function createNullProtoObject(source) {
142
+ if (!source) return Object.create(null);
143
+ const obj = Object.create(null);
144
+ for (const key of Object.keys(source)) if (isSafeKey(key)) obj[key] = source[key];
145
+ return obj;
146
+ }
147
+ var getStartContextServerOnly = getStartContext;
164
148
  var createServerFn = (options, __opts) => {
165
149
  const resolvedOptions = __opts || options || {};
166
150
  if (typeof resolvedOptions.method === "undefined") resolvedOptions.method = "GET";
@@ -175,10 +159,10 @@ var createServerFn = (options, __opts) => {
175
159
  options: resolvedOptions,
176
160
  middleware: (middleware) => {
177
161
  const newMiddleware = [...resolvedOptions.middleware || []];
178
- middleware.map((m) => {
179
- if (TSS_SERVER_FUNCTION_FACTORY in m) {
180
- if (m.options.middleware) newMiddleware.push(...m.options.middleware);
181
- } else newMiddleware.push(m);
162
+ middleware.forEach((item) => {
163
+ if (TSS_SERVER_FUNCTION_FACTORY in item) {
164
+ if (item.options.middleware) newMiddleware.push(...item.options.middleware);
165
+ } else newMiddleware.push(item);
182
166
  });
183
167
  const res = createServerFn(void 0, {
184
168
  ...resolvedOptions,
@@ -220,7 +204,8 @@ var createServerFn = (options, __opts) => {
220
204
  const serverContextAfterGlobalMiddlewares = startContext.contextAfterGlobalMiddlewares;
221
205
  return await executeMiddleware(resolvedMiddleware, "server", {
222
206
  ...extractedFn,
223
- ...opts,
207
+ data: opts.data,
208
+ method: opts.method ?? resolvedOptions.method,
224
209
  serverFnMeta: extractedFn.serverFnMeta,
225
210
  context: safeObjectMerge(opts.context, serverContextAfterGlobalMiddlewares),
226
211
  request: startContext.request
@@ -355,5 +340,31 @@ function serverFnBaseToMiddleware(options) {
355
340
  }
356
341
  };
357
342
  }
343
+ var createMiddleware = (options, __opts) => {
344
+ const resolvedOptions = {
345
+ type: "request",
346
+ ...__opts || options
347
+ };
348
+ const setValidator = (validator) => {
349
+ return createMiddleware({}, Object.assign(resolvedOptions, {
350
+ validator,
351
+ inputValidator: validator
352
+ }));
353
+ };
354
+ return {
355
+ options: resolvedOptions,
356
+ middleware: (middleware) => {
357
+ return createMiddleware({}, Object.assign(resolvedOptions, { middleware }));
358
+ },
359
+ validator: setValidator,
360
+ inputValidator: setValidator,
361
+ client: (client) => {
362
+ return createMiddleware({}, Object.assign(resolvedOptions, { client }));
363
+ },
364
+ server: (server) => {
365
+ return createMiddleware({}, Object.assign(resolvedOptions, { server }));
366
+ }
367
+ };
368
+ };
358
369
  //#endregion
359
- export { X_TSS_RAW_RESPONSE as a, createServerFn as c, getStartOptions as d, isRedirect as f, safeObjectMerge as g, runWithStartContext as h, TSS_SERVER_FUNCTION as i, flattenMiddlewares as l, mergeHeaders as m, TSS_CONTENT_TYPE_FRAMED_VERSIONED as n, X_TSS_SERIALIZED as o, isResolvedRedirect as p, TSS_FORMDATA_CONTEXT as r, createNullProtoObject as s, FrameType as t, getStartContext as u };
370
+ export { safeObjectMerge as _, TSS_SERVER_FUNCTION as a, createMiddleware as c, flattenMiddlewares as d, getStartContext as f, runWithStartContext as g, mergeHeaders as h, TSS_FORMDATA_CONTEXT as i, createNullProtoObject as l, isRedirect as m, MAX_FRAME_PAYLOAD_SIZE as n, X_TSS_RAW_RESPONSE as o, getStartOptions as p, TSS_CONTENT_TYPE_FRAMED_VERSIONED as r, X_TSS_SERIALIZED as s, MAX_FRAMED_STREAMS as t, createServerFn as u };
@@ -1,5 +1,5 @@
1
- import { i as TSS_SERVER_FUNCTION } from "./createServerFn-B2hcXoPM.mjs";
2
- //#region node_modules/.nitro/vite/services/ssr/assets/createServerRpc-DB29C_5p.js
1
+ import { a as TSS_SERVER_FUNCTION } from "./createMiddleware-BdBf_ezN.mjs";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/createServerRpc-B_y2lrwA.js
3
3
  var createServerRpc = (serverFnMeta, splitImportFn) => {
4
4
  const url = "/_serverFn/" + serverFnMeta.id;
5
5
  return Object.assign(splitImportFn, {
@@ -1,9 +1,26 @@
1
- //#region node_modules/.nitro/vite/services/ssr/assets/databaseJsonValue-d6I3nAS4.js
2
- var DatabasePluginInputError = class extends Error {
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/databaseJsonValue-Bhxciy7Z.js
2
+ /** A bundle an operation names is not stored. */
3
+ var DatabaseBundleNotFoundError = class extends Error {
4
+ bundleId;
5
+ name = "DatabaseBundleNotFoundError";
6
+ constructor(bundleId) {
7
+ super(`Bundle "${bundleId}" was not found.`);
8
+ this.bundleId = bundleId;
9
+ }
10
+ };
11
+ /** A row a delete names is still referenced, such as a bundle a release uses. */
12
+ var DatabaseRowReferencedError = class extends Error {
13
+ name = "DatabaseRowReferencedError";
14
+ constructor() {
15
+ super("The database row is still referenced.");
16
+ }
17
+ };
18
+ /** Input a database operation refuses before touching storage. */
19
+ var DatabaseAdapterInputError = class extends Error {
3
20
  code;
4
- name = "DatabasePluginInputError";
21
+ name = "DatabaseAdapterInputError";
5
22
  constructor(code) {
6
- super(`Invalid database plugin input: ${code}`);
23
+ super(`Invalid database adapter input: ${code}`);
7
24
  this.code = code;
8
25
  }
9
26
  };
@@ -39,7 +56,13 @@ var isDatabaseJsonValue = (value) => {
39
56
  };
40
57
  return validate(value);
41
58
  };
59
+ /**
60
+ * Whether `value` is a plain object of JSON values a store keeps as they
61
+ * are: no cycles, accessors, non-finite numbers, or class instances. A
62
+ * plugin checks a `json` field's value with it before it writes, as
63
+ * Insights does for an event's metadata.
64
+ */
42
65
  var isDatabaseJsonObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && isDatabaseJsonValue(value);
43
66
  var isDatabaseMetadataObject = (value) => isDatabaseJsonObject(value) && (!Object.hasOwn(value, "app_version") || typeof value["app_version"] === "string");
44
67
  //#endregion
45
- export { isDatabaseMetadataObject as n, DatabasePluginInputError as t };
68
+ export { isDatabaseMetadataObject as a, isDatabaseJsonObject as i, DatabaseBundleNotFoundError as n, DatabaseRowReferencedError as r, DatabaseAdapterInputError as t };
@@ -0,0 +1,74 @@
1
+ import { O as stripBundleArtifactMetadata, f as getBundlePatches, m as getManifestStorageUri, p as getManifestFileHash, u as getAssetBaseStorageUri } from "./dist-Cxo9ghYv.mjs";
2
+ import { a as isDatabaseMetadataObject, t as DatabaseAdapterInputError } from "./databaseJsonValue-Bhxciy7Z.mjs";
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/databaseRows-DwMAjaF8.js
4
+ var bundleMetadataToRow = (metadata) => {
5
+ const value = stripBundleArtifactMetadata(metadata);
6
+ if (value === void 0) return {};
7
+ if (!isDatabaseMetadataObject(value)) throw new DatabaseAdapterInputError("invalid-data");
8
+ return value;
9
+ };
10
+ var releaseRowToRelease = (row) => ({
11
+ id: row.id,
12
+ revision: row.revision,
13
+ channelId: row.channel_id,
14
+ platform: row.platform,
15
+ kind: row.kind,
16
+ bundleId: row.bundle_id,
17
+ strategy: row.strategy,
18
+ targetAppVersion: row.target_app_version,
19
+ fingerprintHash: row.fingerprint_hash,
20
+ enabled: row.enabled,
21
+ shouldForceUpdate: row.should_force_update,
22
+ message: row.message,
23
+ rolloutCohortCount: row.rollout_cohort_count,
24
+ targetCohorts: row.target_cohorts,
25
+ operation: row.operation,
26
+ sourceReleaseId: row.source_release_id,
27
+ createdAtMs: row.created_at_ms,
28
+ updatedAtMs: row.updated_at_ms
29
+ });
30
+ var bundleToRow = (bundle) => {
31
+ const metadata = bundleMetadataToRow(bundle.metadata);
32
+ return {
33
+ id: bundle.id,
34
+ platform: bundle.platform,
35
+ git_commit_hash: bundle.gitCommitHash,
36
+ metadata,
37
+ manifest_storage_uri: getManifestStorageUri(bundle),
38
+ manifest_file_hash: getManifestFileHash(bundle),
39
+ asset_base_storage_uri: getAssetBaseStorageUri(bundle)
40
+ };
41
+ };
42
+ var bundleToPatchRows = (bundle) => getBundlePatches(bundle).map((patch, orderIndex) => ({
43
+ id: `${bundle.id}:${patch.baseBundleId}`,
44
+ bundle_id: bundle.id,
45
+ base_bundle_id: patch.baseBundleId,
46
+ base_file_hash: patch.baseFileHash,
47
+ patch_file_hash: patch.patchFileHash,
48
+ patch_storage_uri: patch.patchStorageUri,
49
+ byte_size: patch.byteSize,
50
+ order_index: orderIndex
51
+ }));
52
+ var comparePatchRows = (left, right) => left.order_index - right.order_index || left.id.localeCompare(right.id);
53
+ var patchRowToArtifact = (row) => ({
54
+ baseBundleId: row.base_bundle_id,
55
+ baseFileHash: row.base_file_hash,
56
+ byteSize: row.byte_size,
57
+ patchFileHash: row.patch_file_hash,
58
+ patchStorageUri: row.patch_storage_uri
59
+ });
60
+ var rowToBundle = (row, patchRows = []) => {
61
+ const patches = patchRows.slice().sort(comparePatchRows).map(patchRowToArtifact);
62
+ return {
63
+ id: row.id,
64
+ platform: row.platform,
65
+ gitCommitHash: row.git_commit_hash,
66
+ metadata: stripBundleArtifactMetadata(row.metadata),
67
+ manifestStorageUri: row.manifest_storage_uri,
68
+ manifestFileHash: row.manifest_file_hash,
69
+ assetBaseStorageUri: row.asset_base_storage_uri,
70
+ patches
71
+ };
72
+ };
73
+ //#endregion
74
+ export { rowToBundle as i, bundleToRow as n, releaseRowToRelease as r, bundleToPatchRows as t };
@@ -1,7 +1,7 @@
1
1
  import "../_runtime.mjs";
2
- import { A as DialogDescription$1, D as DialogTitle$1, E as DialogTrigger$1, J as require_react, M as DialogBackdrop, N as AlertDialogRoot, O as DialogPortal$1, T as AlertDialogTrigger$1, j as DialogClose, k as DialogPopup, q as require_jsx_runtime, w as DialogRoot } from "../_libs/@base-ui/react+[...].mjs";
2
+ import { $ as DialogBackdrop, G as AlertDialogRoot, J as DialogRoot, K as DialogTrigger$1, Q as DialogClose, W as AlertDialogTrigger$1, X as DialogPopup, Y as DialogPortal$1, Z as DialogDescription$1, mt as require_react, pt as require_jsx_runtime, q as DialogTitle$1 } from "../_libs/@base-ui/react+[...].mjs";
3
3
  import { t as X } from "../_libs/lucide-react.mjs";
4
- import { C as cn, t as Button$1 } from "./createSsrRpc-DjWNJ0uc.mjs";
4
+ import { O as cn, t as Button$1 } from "./sidebar-DKbx2ach.mjs";
5
5
  require_react();
6
6
  var import_jsx_runtime = require_jsx_runtime();
7
7
  function AlertDialog$1({ ...props }) {