@hot-updater/console 1.2.0-rc.3 → 1.2.0-rc.30

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 (342) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{-native-builds-search-C-TGpFAm.js → -native-builds-search-DdHwfe4q.js} +1 -1
  3. package/.output/public/assets/BundleIdDisplay-CTBdtFQ8.js +1 -0
  4. package/.output/public/assets/ChannelBadge-CEabmopB.js +1 -0
  5. package/.output/public/assets/CompositeItem-KUM5yQVr.js +1 -0
  6. package/.output/public/assets/{ConsoleFeatureUnavailable-CUtcXuY2.js → ConsoleFeatureUnavailable-Be-0iTww.js} +1 -1
  7. package/.output/public/assets/{EventDetails-Dl2RvPAk.js → EventDetails-bDOYte1z.js} +1 -1
  8. package/.output/public/assets/HashValueDisplay-D2f0HmyU.js +1 -0
  9. package/.output/public/assets/{InsightsPageHeader-DHhqY3DT.js → InsightsPageHeader-Cj2ROSQO.js} +1 -1
  10. package/.output/public/assets/IosInstall-CHI2C4Yd.js +1 -0
  11. package/.output/public/assets/NativeBuildsNav-DaqxQPnG.js +1 -0
  12. package/.output/public/assets/{NotFoundPage-DZ3DxyRA.js → NotFoundPage-CVBtl68B.js} +1 -1
  13. package/.output/public/assets/{PlatformIcon-BBWQlWm9.js → PlatformIcon-DVnzzGqM.js} +1 -1
  14. package/.output/public/assets/RelativeTime-B4PK8qDw.js +1 -0
  15. package/.output/public/assets/RolloutPercentageBadge-D_I0Raj2.js +1 -0
  16. package/.output/public/assets/RowReason-B7VM1ztc.js +1 -0
  17. package/.output/public/assets/SandboxBadge-BVxHg_HF.js +1 -0
  18. package/.output/public/assets/TargetDisplay-KU7JhIWG.js +1 -0
  19. package/.output/public/assets/{alert-dialog-BqYScr9y.js → alert-dialog-Ch0QxRsa.js} +1 -1
  20. package/.output/public/assets/api-C1OPeiG1.js +1 -0
  21. package/.output/public/assets/api-keys-DLC8jjaM.js +1 -0
  22. package/.output/public/assets/api-keys-eDnzgFAf.js +1 -0
  23. package/.output/public/assets/arrow-left-DQjHJAnT.js +1 -0
  24. package/.output/public/assets/arrow-right-CXp_K3xK.js +1 -0
  25. package/.output/public/assets/arrow-up-right-BFafIOrq.js +1 -0
  26. package/.output/public/assets/badge-FZMD5vvS.js +1 -0
  27. package/.output/public/assets/card-CyHYmHue.js +1 -0
  28. package/.output/public/assets/check-CqWNyG93.js +1 -0
  29. package/.output/public/assets/chevron-right-DNbYTBX1.js +1 -0
  30. package/.output/public/assets/{circle-off-C7Muo0ss.js → circle-off-BCkZpskJ.js} +1 -1
  31. package/.output/public/assets/{clipboard-DQbOcrL7.js → clipboard-DZrZK5gR.js} +1 -1
  32. package/.output/public/assets/{console-features-api-DEXSwFtc.js → console-features-api-BO5V64P3.js} +1 -1
  33. package/.output/public/assets/{copy-DsuLj3oj.js → copy-CH1__JAW.js} +1 -1
  34. package/.output/public/assets/dialog-BLj71-Nf.js +1 -0
  35. package/.output/public/assets/{dist-CPlO6ko9.js → dist-DAM__Tdz.js} +1 -1
  36. package/.output/public/assets/{download-Cf24LBde.js → download-B2GjTySo.js} +1 -1
  37. package/.output/public/assets/empty--YaE5Z4p.js +1 -0
  38. package/.output/public/assets/field-CdhSgWhI.js +1 -0
  39. package/.output/public/assets/git-branch-DG1VDaKq.js +1 -0
  40. package/.output/public/assets/history-C0wv4htz.js +1 -0
  41. package/.output/public/assets/index-CgwVUC2n.js +10 -0
  42. package/.output/public/assets/{input-group-D3OUBk4n.js → input-group-XKLcUGoa.js} +1 -1
  43. package/.output/public/assets/insights-C94CdeAA.js +1 -0
  44. package/.output/public/assets/insights-DILMVpk8.js +2 -0
  45. package/.output/public/assets/insights-_j_ieOyh.js +42 -0
  46. package/.output/public/assets/insights-api-B6Gj74n5.js +1 -0
  47. package/.output/public/assets/{insights-search-DghCbEnk.js → insights-search-Bgvg6wSP.js} +1 -1
  48. package/.output/public/assets/insights-usage-rpc-BUCinjSN.js +1 -0
  49. package/.output/public/assets/insights_.distribution-Bb6_S-hD.js +2 -0
  50. package/.output/public/assets/insights_.distribution-CRkGNelG.js +1 -0
  51. package/.output/public/assets/insights_.distribution-CyAu3RN3.js +1 -0
  52. package/.output/public/assets/installations-BA01mqJE.js +1 -0
  53. package/.output/public/assets/installations-BsD6LgNc.js +2 -0
  54. package/.output/public/assets/installations-CYTzndfP.js +1 -0
  55. package/.output/public/assets/{key-round-DwNKkHhy.js → key-round-D7UgdXyA.js} +1 -1
  56. package/.output/public/assets/{link-DTEyW70e.js → link-CN3iHC4A.js} +2 -2
  57. package/.output/public/assets/{list--NIee1FZ.js → list-Bm-CfN5g.js} +1 -1
  58. package/.output/public/assets/loader-circle-iMqC-8ZE.js +1 -0
  59. package/.output/public/assets/native-builds-BMbws1g5.js +2 -0
  60. package/.output/public/assets/native-builds-xgHiHQML.js +1 -0
  61. package/.output/public/assets/native-builds_._buildId-B04z9yfk.js +1 -0
  62. package/.output/public/assets/native-builds_._buildId-DaMmTcHo.js +2 -0
  63. package/.output/public/assets/native-builds_.devices-CTzpCVsb.js +1 -0
  64. package/.output/public/assets/native-builds_.devices-D_kl2-bc.js +2 -0
  65. package/.output/public/assets/package-BmfoZ5Zj.js +1 -0
  66. package/.output/public/assets/plus-Db0KxLZp.js +1 -0
  67. package/.output/public/assets/preload-helper-CRQjUQaZ.js +1 -0
  68. package/.output/public/assets/{refresh-cw-B9HHjLej.js → refresh-cw-BHhBYjS8.js} +1 -1
  69. package/.output/public/assets/{relativeTime-YQt84dYr.js → relativeTime-BYRt19mj.js} +1 -1
  70. package/.output/public/assets/remote-config-Cxkr7_BP.js +1 -0
  71. package/.output/public/assets/remote-config-DAOyn5xL.js +1 -0
  72. package/.output/public/assets/remote-config-DXv25LX1.js +6 -0
  73. package/.output/public/assets/{rotate-cw-Cv2aVbYr.js → rotate-cw-Ba-slJea.js} +1 -1
  74. package/.output/public/assets/routes-DM3TyTLW.js +2 -0
  75. package/.output/public/assets/routes-Des97uK_.js +1 -0
  76. package/.output/public/assets/search-dJG2BYmx.js +1 -0
  77. package/.output/public/assets/select-CA8r-UUe.js +1 -0
  78. package/.output/public/assets/send-DuMOCzbD.js +1 -0
  79. package/.output/public/assets/{sidebar-Di9SN47G.js → sidebar-yC7KdImc.js} +1 -1
  80. package/.output/public/assets/smartphone-D1C6BRd_.js +1 -0
  81. package/.output/public/assets/styles-BHLI87EH.css +2 -0
  82. package/.output/public/assets/switch-BsV3d4km.js +1 -0
  83. package/.output/public/assets/table-D8YjT_ht.js +1 -0
  84. package/.output/public/assets/tabs-RdhEl9sE.js +1 -0
  85. package/.output/public/assets/trash-2-B5KIvrXy.js +1 -0
  86. package/.output/public/assets/{undo-2-CUX96_BG.js → undo-2-CFcU9dIB.js} +1 -1
  87. package/.output/public/assets/{useCompositeListItem-JmyDfo3-.js → useCompositeListItem-lAmUsXcc.js} +1 -1
  88. package/.output/public/assets/{useMutation-DbYw7boA.js → useMutation-w3qYaU2L.js} +1 -1
  89. package/.output/public/assets/valueToPercent-Bn8p2lng.js +1 -0
  90. package/.output/server/{__23tanstack-start-server-fn-resolver-DJQS4eWX.mjs → __23tanstack-start-server-fn-resolver-q4YFIDyr.mjs} +94 -46
  91. package/.output/server/_chunks/ssr-renderer.mjs +2 -2
  92. package/.output/server/_libs/@base-ui/react+[...].mjs +1488 -183
  93. package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
  94. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
  95. package/.output/server/_libs/_.mjs +2 -0
  96. package/.output/server/_libs/lucide-react.mjs +22 -28
  97. package/.output/server/_libs/next-themes.mjs +1 -1
  98. package/.output/server/_libs/react-redux+[...].mjs +1 -1
  99. package/.output/server/_libs/recharts+[...].mjs +1 -1
  100. package/.output/server/_libs/sonner.mjs +1 -1
  101. package/.output/server/_libs/tanstack__react-query.mjs +1 -1
  102. package/.output/server/_ssr/{-native-builds-search-CwNcoXf4.mjs → -native-builds-search-Mm_AZoRU.mjs} +9 -3
  103. package/.output/server/_ssr/{BundleIdDisplay-LdRkYdnN.mjs → BundleIdDisplay-DvzlYWq8.mjs} +3 -3
  104. package/.output/server/_ssr/ChannelBadge-qF_Pc5Ud.mjs +23 -0
  105. package/.output/server/_ssr/{ConsoleFeatureUnavailable-BN-FZ8eG.mjs → ConsoleFeatureUnavailable-DKUgr0N_.mjs} +7 -7
  106. package/.output/server/_ssr/{EventDetails-B77sWxgh.mjs → EventDetails-T1XtYEDD.mjs} +8 -8
  107. package/.output/server/_ssr/{HashValueDisplay-C4Vs4cmO.mjs → HashValueDisplay-Cas_zjIS.mjs} +7 -7
  108. package/.output/server/_ssr/{InsightsPageHeader-Dx4jJ7X0.mjs → InsightsPageHeader-BrllhUl2.mjs} +8 -8
  109. package/.output/server/_ssr/IosInstall-CEHI8F2M.mjs +615 -0
  110. package/.output/server/_ssr/NativeBuildsNav-2xSHyA1a.mjs +38 -0
  111. package/.output/server/_ssr/{NotFoundPage-DB5cXeVZ.mjs → NotFoundPage-D6H9vxj_.mjs} +3 -3
  112. package/.output/server/_ssr/{PlatformIcon-CFLiTjh1.mjs → PlatformIcon-BpGOEXjU.mjs} +13 -3
  113. package/.output/server/_ssr/RelativeTime-DpEVzDP9.mjs +237 -0
  114. package/.output/server/_ssr/{git-CTA8Aqr0.mjs → RolloutPercentageBadge-DW8-_w30.mjs} +20 -4
  115. package/.output/server/_ssr/RowReason-C-PjIxzq.mjs +186 -0
  116. package/.output/server/_ssr/SandboxBadge-CDdNew0R.mjs +97 -0
  117. package/.output/server/_ssr/TargetDisplay-BBsP7IaZ.mjs +83 -0
  118. package/.output/server/_ssr/{alert-dialog-DxboqQmd.mjs → alert-dialog-Bd4E9xdw.mjs} +2 -2
  119. package/.output/server/_ssr/{api-cvzOLlTy.mjs → api-BT7aA8UM.mjs} +167 -33
  120. package/.output/server/_ssr/{api-keys-C3QCQvpV.mjs → api-keys-D2NvcQZv.mjs} +2 -2
  121. package/.output/server/_ssr/{api-keys-CrbGr02t.mjs → api-keys-DjWpM20P.mjs} +11 -10
  122. package/.output/server/_ssr/{api-keys-rpc-BcTQzRLj.mjs → api-keys-rpc-nM5H7V7f.mjs} +4 -4
  123. package/.output/server/_ssr/{api-rpc-B48nsUak.mjs → api-rpc-DX4HynbW.mjs} +83 -35
  124. package/.output/server/_ssr/{auth-rpc-C0gtG9nJ.mjs → auth-rpc-LCxTtYz2.mjs} +5 -5
  125. package/.output/server/_ssr/{auth.server-B0JikHOQ.mjs → auth.server-CERo_xef.mjs} +797 -174
  126. package/.output/server/_ssr/{badge-oO-0mLsr.mjs → badge-Dpp4q7sD.mjs} +4 -45
  127. package/.output/server/_ssr/{bundleActivity-MLrjNJCT.mjs → bundleActivity-BP40zYSt.mjs} +1 -1
  128. package/.output/server/_ssr/card-CFCftDfI.mjs +49 -0
  129. package/.output/server/_ssr/{config.server-CJVHGJtr.mjs → config.server-5W5WD8x2.mjs} +4 -4
  130. package/.output/server/_ssr/{console-access-4TW5Af_n.mjs → console-access-B0S5YFUa.mjs} +2 -2
  131. package/.output/server/_ssr/{console-features-api-DfzZRyXa.mjs → console-features-api-CV_EReEj.mjs} +4 -4
  132. package/.output/server/_ssr/{console-features-rpc-DqNpa3U9.mjs → console-features-rpc-D3xlQsuy.mjs} +4 -4
  133. package/.output/server/_ssr/{console-features-BTV-XuhQ.mjs → console-features-xaGDhRC9.mjs} +1 -1
  134. package/.output/server/_ssr/{createServerRpc-BVvRVOz5.mjs → createServerRpc-DJZel12M.mjs} +1 -1
  135. package/.output/server/_ssr/{databaseConfig-B_Bg7qS5.mjs → databaseConfig-XAvDetmn.mjs} +1 -1
  136. package/.output/server/_ssr/{databaseJsonValue-kS7cvEtz.mjs → databaseJsonValue-DuUoft8j.mjs} +1 -1
  137. package/.output/server/_ssr/{databaseRows-B6H8Cmgq.mjs → databaseRows-BtRVBD0C.mjs} +3 -3
  138. package/.output/server/_ssr/deviceProfileToken-CwWb1lPq.mjs +82 -0
  139. package/.output/server/_ssr/{dialog-DsuMZ5oh.mjs → dialog-DQR_QI_X.mjs} +2 -2
  140. package/.output/server/_ssr/{dist-TEpM_UAD.mjs → dist-B6-irDRA.mjs} +1 -1
  141. package/.output/server/_ssr/{downloadBundle-DCmr7vsj.mjs → downloadBundle-DnoYpi36.mjs} +1 -1
  142. package/.output/server/_ssr/{empty-r4kJO91t.mjs → empty-C7PFnkCH.mjs} +3 -3
  143. package/.output/server/_ssr/{empty-plugin-adapters-zrZ0xs6n.mjs → empty-plugin-adapters-BYBYBaxo.mjs} +1 -1
  144. package/.output/server/_ssr/{failureReports-Cn_zU9S8.mjs → failureReports-BA2eg11O.mjs} +3 -3
  145. package/.output/server/_ssr/{field-DfXmt9CS.mjs → field-BqYN8sZT.mjs} +3 -3
  146. package/.output/server/_ssr/foldedPage-CqpVk31Q.mjs +176 -0
  147. package/.output/server/_ssr/{getBundleChildren-rtkEEJw5.mjs → getBundleChildren-CdqFonhl.mjs} +2 -2
  148. package/.output/server/_ssr/{input-group-BCO7zTpU.mjs → input-group-Brv0mmyp.mjs} +2 -2
  149. package/.output/server/_ssr/{insights-CRu5FUj8.mjs → insights--xI3A0KI.mjs} +5 -5
  150. package/.output/server/_ssr/{insights-DrrhPDER.mjs → insights-CD1e3EnW.mjs} +2 -2
  151. package/.output/server/_ssr/{insights-Csqlj6u7.mjs → insights-Dd0VdO-1.mjs} +27 -26
  152. package/.output/server/_ssr/{insights-api-NW5VCXqg.mjs → insights-api-Bt2XVa4Y.mjs} +5 -5
  153. package/.output/server/_ssr/{insights-errors-7BCwFybo.mjs → insights-errors-CXHg1lLV.mjs} +2 -2
  154. package/.output/server/_ssr/{insights-failures-B9VPkzZE.mjs → insights-failures-7zH97WOO.mjs} +2 -2
  155. package/.output/server/_ssr/{insights-failures-rpc-CoFrAOK9.mjs → insights-failures-rpc-DBGzXP5A.mjs} +11 -11
  156. package/.output/server/_ssr/{insights-recovery-BtXVU3ro.mjs → insights-recovery-BhOg6kz2.mjs} +1 -1
  157. package/.output/server/_ssr/{insights-recovery-rpc-sud_FyGW.mjs → insights-recovery-rpc-C6fAh-i_.mjs} +7 -7
  158. package/.output/server/_ssr/{insights-rpc-Ce2Isz9q.mjs → insights-rpc-pThKC9oj.mjs} +4 -4
  159. package/.output/server/_ssr/{insights-search-B0O3YoO2.mjs → insights-search-iFN4UaUv.mjs} +5 -5
  160. package/.output/server/_ssr/{insights-usage-DiGnuxW8.mjs → insights-usage-h8fipPTv.mjs} +1 -1
  161. package/.output/server/_ssr/{insights-usage-rpc-Cwf1t4aW.mjs → insights-usage-rpc-B-RLvdLZ.mjs} +5 -5
  162. package/.output/server/_ssr/{insights-usage-rpc-C-cS2F9s.mjs → insights-usage-rpc-CGHZQ9jq.mjs} +7 -7
  163. package/.output/server/_ssr/{insightsUsage-ClAmoUz8.mjs → insightsUsage-BjSiV_X_.mjs} +3 -3
  164. package/.output/server/_ssr/{insights_.distribution-DIkh5VqM.mjs → insights_.distribution-C6iXJ93Y.mjs} +15 -14
  165. package/.output/server/_ssr/{insights_.distribution-D52TkQ2V.mjs → insights_.distribution-E6Ns2aN7.mjs} +2 -2
  166. package/.output/server/_ssr/{insights_.distribution--3aR6Kpy.mjs → insights_.distribution-xHmfwwa5.mjs} +5 -5
  167. package/.output/server/_ssr/{installations-Bu4Lb0x9.mjs → installations-7V-Xyui8.mjs} +12 -12
  168. package/.output/server/_ssr/{installations-DftevpDt.mjs → installations-CZnN6slr.mjs} +4 -4
  169. package/.output/server/_ssr/{installations-C818mFCp.mjs → installations-D6Upc9Rt.mjs} +2 -2
  170. package/.output/server/_ssr/ios-devices-rpc-CXuHk24G.mjs +139 -0
  171. package/.output/server/_ssr/iosDeviceProfile-BESi_onx.mjs +176 -0
  172. package/.output/server/_ssr/iosDevices-BmvvvZRo.mjs +129 -0
  173. package/.output/server/_ssr/listReleases-DYYA5alS.mjs +94 -0
  174. package/.output/server/_ssr/{request-guard-CPdRBuGW.mjs → local-console-Dtxlsav0.mjs} +2 -9
  175. package/.output/server/_ssr/{native-builds-DOASMwGh.mjs → native-builds-BUojmVWC.mjs} +3 -3
  176. package/.output/server/_ssr/native-builds-BXBkklfA.mjs +197 -0
  177. package/.output/server/_ssr/native-builds-BhDCE89P.mjs +717 -0
  178. package/.output/server/_ssr/{native-builds_._buildId-CTytnLBB.mjs → native-builds_._buildId-DRiCNDdO.mjs} +3 -3
  179. package/.output/server/_ssr/native-builds_._buildId-DkMpG-OB.mjs +1176 -0
  180. package/.output/server/_ssr/native-builds_.devices-DSideebA.mjs +10 -0
  181. package/.output/server/_ssr/native-builds_.devices-DsOx1R36.mjs +702 -0
  182. package/.output/server/_ssr/nativeBuildDownloadLink-DDAUVU8q.mjs +96 -0
  183. package/.output/server/_ssr/nativeBuildInstall-CcBrfTsc.mjs +250 -0
  184. package/.output/server/_ssr/nativeBuilds-Cub0EUGN.mjs +287 -0
  185. package/.output/server/_ssr/{plugins-RIryUNWj.mjs → plugins-CX7wutet.mjs} +6 -6
  186. package/.output/server/_ssr/publicConsoleBase-f67NLLXZ.mjs +610 -0
  187. package/.output/server/_ssr/{release-adoption-DoAtNPED.mjs → release-adoption-DeICczY7.mjs} +2 -2
  188. package/.output/server/_ssr/{release-adoption-rpc-OizwttJD.mjs → release-adoption-rpc-BjMXMi9A.mjs} +9 -9
  189. package/.output/server/_ssr/{releaseAdoption-a2byXMfz.mjs → releaseAdoption-kHZo8P90.mjs} +4 -4
  190. package/.output/server/_ssr/{releaseCatalogCompiler-DLcean2k.mjs → releaseCatalogCompiler-D9dAMI17.mjs} +3 -3
  191. package/.output/server/_ssr/{releaseManagement-DHUux2az.mjs → releaseManagement-EPhok_Py.mjs} +1 -1
  192. package/.output/server/_ssr/{releaseReachability-DZOK_dH-.mjs → releaseReachability-DaZ7ifUF.mjs} +2 -2
  193. package/.output/server/_ssr/{remote-config-DaBgnVnL.mjs → remote-config-B1iZuZOF.mjs} +2 -2
  194. package/.output/server/_ssr/{remote-config-Dypc_nuk.mjs → remote-config-C_DprbJz.mjs} +23 -22
  195. package/.output/server/_ssr/{remote-config-DZu7gJLL.mjs → remote-config-C_q6FBE4.mjs} +3 -3
  196. package/.output/server/_ssr/{remote-config-rpc-DOfPhqli.mjs → remote-config-rpc-BFTPcMfZ.mjs} +5 -5
  197. package/.output/server/_ssr/request-guard-BPLyogIN.mjs +11 -0
  198. package/.output/server/_ssr/{router-BkRbvels.mjs → router-BDXPwfwl.mjs} +92 -59
  199. package/.output/server/_ssr/{routes-D9JnXVWL.mjs → routes-BJeztqpQ.mjs} +388 -432
  200. package/.output/server/_ssr/{routes-BeTsUkNX.mjs → routes-DpapxHLc.mjs} +14 -17
  201. package/.output/server/_ssr/{runtime.server-BdMY1blX.mjs → runtime.server-CkSbWaZm.mjs} +4 -4
  202. package/.output/server/_ssr/{schema-ChlRtZIo.mjs → schema-3oDJJFWa.mjs} +1 -1
  203. package/.output/server/_ssr/{schema-migration-rpc-B2VGxRY6.mjs → schema-migration-rpc-a4bLEdaP.mjs} +4 -4
  204. package/.output/server/_ssr/{select-Cywc0NmT.mjs → select-C9HpIZxd.mjs} +2 -2
  205. package/.output/server/_ssr/{server-Ds-fU1zf.mjs → server-C8ZmMWnn.mjs} +7 -7
  206. package/.output/server/_ssr/{sidebar-t0NiN0-2.mjs → sidebar-BrVL3L7R.mjs} +3 -3
  207. package/.output/server/_ssr/ssr.mjs +1 -1
  208. package/.output/server/_ssr/{start-BvDsQehg.mjs → start-D3noqqOK.mjs} +2 -2
  209. package/.output/server/_ssr/{switch-D1T38CnM.mjs → switch-DtnsoZHO.mjs} +3 -3
  210. package/.output/server/_ssr/{table-L9ZQgxNF.mjs → table-Bg7nCnct.mjs} +2 -2
  211. package/.output/server/_ssr/{tabs-BiByrAnU.mjs → tabs-BEIoGLTL.mjs} +4 -4
  212. package/.output/server/_ssr/{updateFailures-n-tGv90S.mjs → updateFailures-D0bP_Ume.mjs} +3 -3
  213. package/.output/server/_ssr/{uuidv7-BIF4nb_q.mjs → uuidv7-CmHbryZT.mjs} +2 -2
  214. package/.output/server/_ssr/{version-CQ98ZBpL-CWSkTT9J.mjs → version-CQ98ZBpL-NmbU0MD2.mjs} +1 -1
  215. package/.output/server/_tanstack-start-manifest_v-C_TPyfFP.mjs +225 -0
  216. package/.output/server/index.mjs +479 -381
  217. package/lib/index.d.mts +9 -0
  218. package/package.json +7 -30
  219. package/src/components/ChannelBadge.tsx +9 -9
  220. package/src/components/DataTable.tsx +347 -0
  221. package/src/components/FoldedRows.tsx +219 -0
  222. package/src/components/HashValueDisplay.tsx +6 -3
  223. package/src/components/PlatformIcon.tsx +10 -0
  224. package/src/components/RelativeTime.tsx +31 -0
  225. package/src/components/RowReason.tsx +56 -0
  226. package/src/components/TargetDisplay.tsx +69 -0
  227. package/src/components/ThemeProvider.tsx +11 -2
  228. package/src/components/features/api-keys/ApiKeysPage.tsx +1 -1
  229. package/src/components/features/channels/ChannelManagementDialog.tsx +5 -10
  230. package/src/components/features/insights/ReleaseActivity.tsx +1 -1
  231. package/src/components/features/native-builds/BuiltInBundleCard.tsx +108 -58
  232. package/src/components/features/native-builds/CommitLink.tsx +3 -2
  233. package/src/components/features/native-builds/ImportBuild.tsx +1 -1
  234. package/src/components/features/native-builds/InstallCard.tsx +310 -67
  235. package/src/components/features/native-builds/IosDevicesPage.tsx +944 -0
  236. package/src/components/features/native-builds/IosInstall.tsx +632 -0
  237. package/src/components/features/native-builds/IpaDevicesCard.tsx +111 -0
  238. package/src/components/features/native-builds/NativeBuildDetailPage.tsx +21 -4
  239. package/src/components/features/native-builds/NativeBuildsNav.tsx +44 -0
  240. package/src/components/features/native-builds/NativeBuildsPage.tsx +65 -76
  241. package/src/components/features/native-builds/NativeBuildsTable.tsx +668 -318
  242. package/src/components/features/native-builds/OlderBuildLabel.tsx +61 -0
  243. package/src/components/features/native-builds/PatchesCard.tsx +3 -2
  244. package/src/components/features/native-builds/ReleaseNativeBuildLink.tsx +4 -4
  245. package/src/components/features/native-builds/SandboxBadge.tsx +21 -0
  246. package/src/components/features/native-builds/ServedNowCard.tsx +33 -1
  247. package/src/components/features/native-builds/ShortHash.tsx +6 -3
  248. package/src/components/features/native-builds/StoreSubmission.tsx +18 -12
  249. package/src/components/features/native-builds/playTracks.ts +19 -0
  250. package/src/components/features/remote-config/PublishDialog.tsx +4 -1
  251. package/src/components/features/remote-config/VersionsCard.tsx +5 -2
  252. package/src/components/ui/badge.tsx +2 -0
  253. package/src/components/ui/sonner.tsx +3 -1
  254. package/src/index.ts +9 -0
  255. package/src/lib/api-rpc.ts +124 -35
  256. package/src/lib/api.ts +150 -14
  257. package/src/lib/ios-devices-api.ts +110 -0
  258. package/src/lib/ios-devices-rpc.ts +183 -0
  259. package/src/lib/native-builds.ts +160 -17
  260. package/src/lib/server/console-runtime.server.ts +9 -2
  261. package/src/lib/server/deviceProfileToken.ts +187 -0
  262. package/src/lib/server/foldedPage.ts +360 -0
  263. package/src/lib/server/iosDeviceProfile.ts +230 -0
  264. package/src/lib/server/iosDevices.ts +223 -0
  265. package/src/lib/server/listReleases.ts +101 -62
  266. package/src/lib/server/local-console.ts +1 -1
  267. package/src/lib/server/nativeBuildDownloadLink.ts +193 -0
  268. package/src/lib/server/nativeBuildInstall.ts +495 -0
  269. package/src/lib/server/nativeBuilds.ts +308 -59
  270. package/src/lib/server/plistText.ts +17 -0
  271. package/src/lib/server/publicConsoleBase.ts +17 -0
  272. package/src/routeTree.gen.ts +85 -18
  273. package/src/routes/-native-builds-search.ts +20 -0
  274. package/src/routes/[_]hot-updater/devices/device-response.ts +21 -0
  275. package/src/routes/[_]hot-updater/devices/device[.]mobileconfig.ts +17 -0
  276. package/src/routes/[_]hot-updater/native-builds/$buildId/manifest[.]plist.ts +22 -0
  277. package/src/routes/api/native-builds/$buildId/download.ts +22 -1
  278. package/src/routes/index.tsx +541 -532
  279. package/src/routes/native-builds_.devices.tsx +21 -0
  280. package/src/styles.css +24 -0
  281. package/.output/public/assets/HashValueDisplay-6lNRxDJX.js +0 -1
  282. package/.output/public/assets/RolloutPercentageBadge-Cxogpi8F.js +0 -1
  283. package/.output/public/assets/StoreSubmission-ViTkW4eJ.js +0 -1
  284. package/.output/public/assets/api-P2g8dCNg.js +0 -1
  285. package/.output/public/assets/api-keys-DWQC2q6y.js +0 -1
  286. package/.output/public/assets/api-keys-FueRkF9q.js +0 -1
  287. package/.output/public/assets/arrow-left-g9cKqXuC.js +0 -1
  288. package/.output/public/assets/arrow-right-CNII8TYn.js +0 -1
  289. package/.output/public/assets/arrow-up-right-DK8Zdg40.js +0 -1
  290. package/.output/public/assets/badge-DWFcDWho.js +0 -1
  291. package/.output/public/assets/check-CXVR3s3X.js +0 -1
  292. package/.output/public/assets/chevron-right-BoUXo82O.js +0 -1
  293. package/.output/public/assets/dialog-CNUPxNxH.js +0 -1
  294. package/.output/public/assets/empty-B3Uwdd6k.js +0 -1
  295. package/.output/public/assets/field-D-2-mnNh.js +0 -1
  296. package/.output/public/assets/history-DqHlgSuV.js +0 -1
  297. package/.output/public/assets/index-CqP5HPV6.js +0 -10
  298. package/.output/public/assets/insights-B-0odqpt.js +0 -42
  299. package/.output/public/assets/insights-BSVGfxSL.js +0 -1
  300. package/.output/public/assets/insights-NK5B6ReS.js +0 -2
  301. package/.output/public/assets/insights-api-BVCXJsoV.js +0 -1
  302. package/.output/public/assets/insights-usage-rpc-CKQH0pUS.js +0 -1
  303. package/.output/public/assets/insights_.distribution-CJvgwcVZ.js +0 -2
  304. package/.output/public/assets/insights_.distribution-DblZM0mO.js +0 -1
  305. package/.output/public/assets/insights_.distribution-dvk6vYDM.js +0 -1
  306. package/.output/public/assets/installations-B674P5Z5.js +0 -2
  307. package/.output/public/assets/installations-BWxczZ2t.js +0 -1
  308. package/.output/public/assets/installations-Dv4kWQYz.js +0 -1
  309. package/.output/public/assets/native-builds-BOC71grI.js +0 -1
  310. package/.output/public/assets/native-builds-D6rldpSh.js +0 -2
  311. package/.output/public/assets/native-builds-DAy2678K.js +0 -1
  312. package/.output/public/assets/native-builds_._buildId-DD58_Phd.js +0 -1
  313. package/.output/public/assets/native-builds_._buildId-DvQDKnUQ.js +0 -2
  314. package/.output/public/assets/plus-BReVKct-.js +0 -1
  315. package/.output/public/assets/preload-helper-B44EvKhG.js +0 -1
  316. package/.output/public/assets/remote-config-B7ujqhLa.js +0 -6
  317. package/.output/public/assets/remote-config-WjpozBG5.js +0 -1
  318. package/.output/public/assets/remote-config-gXeH6PBW.js +0 -1
  319. package/.output/public/assets/routes-BDdBIxYS.js +0 -1
  320. package/.output/public/assets/routes-CCD33Azv.js +0 -2
  321. package/.output/public/assets/search-BCel4Oy6.js +0 -1
  322. package/.output/public/assets/select-CBIU0_M1.js +0 -1
  323. package/.output/public/assets/smartphone-CMaSy_ir.js +0 -1
  324. package/.output/public/assets/styles-uK-0vUMk.css +0 -2
  325. package/.output/public/assets/switch-BpdiHL_t.js +0 -1
  326. package/.output/public/assets/table-Bpy3SvSo.js +0 -1
  327. package/.output/public/assets/tabs-Xmt7tZeG.js +0 -1
  328. package/.output/public/assets/useInfiniteQuery-DX4WpBRG.js +0 -1
  329. package/.output/public/assets/valueToPercent-BLwGy_xK.js +0 -1
  330. package/.output/server/_ssr/RolloutPercentageBadge-vmwE8iae.mjs +0 -21
  331. package/.output/server/_ssr/StoreSubmission-DE4vgy5B.mjs +0 -139
  332. package/.output/server/_ssr/listReleases-D_GY00SQ.mjs +0 -79
  333. package/.output/server/_ssr/native-builds-CWjU--fI.mjs +0 -510
  334. package/.output/server/_ssr/native-builds-DhXL5zf_.mjs +0 -137
  335. package/.output/server/_ssr/native-builds_._buildId-D4lYJLIU.mjs +0 -813
  336. package/.output/server/_ssr/nativeBuildQr-84cnFQPX.mjs +0 -59
  337. package/.output/server/_ssr/nativeBuilds-B_7BPjt_.mjs +0 -133
  338. package/.output/server/_ssr/qr-code-C7kNRIDX.mjs +0 -22
  339. package/.output/server/_tanstack-start-manifest_v-B5nsO5L4.mjs +0 -184
  340. package/src/lib/server/nativeBuildQr.ts +0 -73
  341. package/src/routes/[_]hot-updater/native-builds/qr.ts +0 -14
  342. /package/.output/public/assets/{uuidv7-zXMtwR9Q.js → uuidv7-DAoOOpz9.js} +0 -0
@@ -0,0 +1,223 @@
1
+ import type {
2
+ HotUpdaterCoreApi,
3
+ IosDeviceRow,
4
+ IosDeviceStatus,
5
+ } from "@hot-updater/plugin-core";
6
+
7
+ import type { ConsolePrincipal } from "../../index";
8
+ import {
9
+ createDeviceProfileToken,
10
+ DEVICE_PROFILE_TOKEN_TTL_MS,
11
+ verifyDeviceReceipt,
12
+ } from "./deviceProfileToken";
13
+ import {
14
+ CONSOLE_SECRET_ENV,
15
+ readConsoleSecret,
16
+ } from "./nativeBuildDownloadLink";
17
+
18
+ /** A registry page: past an Apple account's yearly limit of devices. */
19
+ const PAGE = 200;
20
+
21
+ /** `ios_devices.name`'s bound in core's schema. */
22
+ const NAME_MAX_LENGTH = 100;
23
+
24
+ /** Who is looking at the iOS devices page, and what they may do. */
25
+ export interface IosDeviceViewer {
26
+ /** The signed-in email, lower-cased. */
27
+ readonly email: string;
28
+ /**
29
+ * Whether this person approves, renames, and removes devices: anyone on
30
+ * the local Console, or the hosted Console's `console.deviceApprovers`.
31
+ */
32
+ readonly canApprove: boolean;
33
+ /** Whether the hosted Console lists anyone who approves. */
34
+ readonly approversConfigured: boolean;
35
+ }
36
+
37
+ const forbidden = (message: string) =>
38
+ new Response(message, {
39
+ status: 403,
40
+ headers: { "content-type": "text/plain; charset=utf-8" },
41
+ });
42
+
43
+ /** Whether this is `hot-updater console`, the local runtime, by its mode. */
44
+ const isLocalConsole = async () => {
45
+ const { default: localConsoleGuard } =
46
+ await import("virtual:hot-updater-console/request-guard");
47
+ return localConsoleGuard !== undefined;
48
+ };
49
+
50
+ /**
51
+ * The viewer's rights over the registry. The local Console is recognized by
52
+ * its mode, never by an email, so a hosted user named like the local one
53
+ * gains nothing. A hosted approver is an email in `deviceApprovers`.
54
+ */
55
+ export const iosDeviceViewer = async (
56
+ principal: ConsolePrincipal,
57
+ deviceApprovers: readonly string[],
58
+ ): Promise<IosDeviceViewer> => {
59
+ const email = principal.email.trim().toLowerCase();
60
+ const local = await isLocalConsole();
61
+ return {
62
+ email,
63
+ canApprove: local || deviceApprovers.includes(email),
64
+ approversConfigured: local || deviceApprovers.length > 0,
65
+ };
66
+ };
67
+
68
+ /** Refuses anyone but an approver, on the server, whatever the UI sent. */
69
+ export const requireDeviceApprover = (viewer: IosDeviceViewer) => {
70
+ if (!viewer.canApprove) {
71
+ throw forbidden("Only a device approver can do this.");
72
+ }
73
+ };
74
+
75
+ /** Every registry row, newest first, or one status's. */
76
+ export const listIosDevices = async (
77
+ core: Pick<HotUpdaterCoreApi, "listIosDevices">,
78
+ status?: IosDeviceStatus,
79
+ ): Promise<IosDeviceRow[]> => {
80
+ const rows: IosDeviceRow[] = [];
81
+ for (let after: string | undefined; ; ) {
82
+ const page = await core.listIosDevices({
83
+ order: "desc",
84
+ limit: PAGE,
85
+ ...(status === undefined ? {} : { status }),
86
+ ...(after === undefined ? {} : { after }),
87
+ });
88
+ rows.push(...page);
89
+ if (page.length < PAGE) return rows;
90
+ after = page.at(-1)!.id;
91
+ }
92
+ };
93
+
94
+ /** A device name as the registry stores it, or a refusal. */
95
+ export const deviceName = (name: unknown): string => {
96
+ const trimmed = typeof name === "string" ? name.trim() : "";
97
+ if (trimmed.length === 0 || trimmed.length > NAME_MAX_LENGTH) {
98
+ throw new TypeError(
99
+ `Name the device in 1 to ${NAME_MAX_LENGTH} characters.`,
100
+ );
101
+ }
102
+ return trimmed;
103
+ };
104
+
105
+ /** The name a device gets before anyone types one: the person's, then "iPhone". */
106
+ export const defaultDeviceName = (principal: ConsolePrincipal) => {
107
+ const owner =
108
+ principal.name?.trim() || principal.email.split("@")[0]?.trim() || "";
109
+ return owner === ""
110
+ ? "iPhone"
111
+ : `${owner}'s iPhone`.slice(0, NAME_MAX_LENGTH);
112
+ };
113
+
114
+ /**
115
+ * Whether an iPhone can register through this Console: not through the local
116
+ * one, which an iPhone can't reach, nor without the secret that signs links.
117
+ */
118
+ export const deviceRegistration = async (
119
+ request: Request,
120
+ ): Promise<"ready" | "local-console" | "no-secret"> => {
121
+ if (await isLocalConsole()) return "local-console";
122
+ return readConsoleSecret(request) === undefined ? "no-secret" : "ready";
123
+ };
124
+
125
+ export type DeviceProfileLinkResult =
126
+ | {
127
+ readonly status: "issued";
128
+ /** The `t` of the profile route. */
129
+ readonly token: string;
130
+ readonly expiresAt: string;
131
+ }
132
+ /** An iPhone can't reach a Console on this computer. */
133
+ | { readonly status: "local-console" }
134
+ | { readonly status: "no-secret"; readonly secretName: string };
135
+
136
+ /**
137
+ * A new capability for this person's iPhone profile: `register` saves the
138
+ * iPhone as requested under `name`, `identify` only tells build `buildId`'s
139
+ * page which iPhone it is. It reads and stores nothing.
140
+ */
141
+ export const issueDeviceProfileLink = async (
142
+ request: Request,
143
+ viewer: IosDeviceViewer,
144
+ input:
145
+ | { readonly mode: "register"; readonly name: string }
146
+ | { readonly mode: "identify"; readonly buildId: string },
147
+ now: number = Date.now(),
148
+ ): Promise<DeviceProfileLinkResult> => {
149
+ if (await isLocalConsole()) return { status: "local-console" };
150
+ const secret = readConsoleSecret(request);
151
+ if (secret === undefined) {
152
+ return { status: "no-secret", secretName: CONSOLE_SECRET_ENV };
153
+ }
154
+ const token = await createDeviceProfileToken(
155
+ secret,
156
+ input.mode === "register"
157
+ ? { m: "register", e: viewer.email, n: deviceName(input.name) }
158
+ : { m: "identify", e: viewer.email, b: input.buildId },
159
+ now,
160
+ );
161
+ return {
162
+ status: "issued",
163
+ token,
164
+ expiresAt: new Date(now + DEVICE_PROFILE_TOKEN_TTL_MS).toISOString(),
165
+ };
166
+ };
167
+
168
+ /**
169
+ * Requests the iPhone a receipt names, for the person whose profile made it:
170
+ * the UDID comes from the receipt alone. Another person's receipt, an expired
171
+ * one, or none, is refused.
172
+ */
173
+ export const requestIosDeviceAccess = async (
174
+ request: Request,
175
+ core: Pick<HotUpdaterCoreApi, "requestIosDevice">,
176
+ viewer: IosDeviceViewer,
177
+ input: { readonly receipt: string; readonly name: string },
178
+ ) => {
179
+ const secret = readConsoleSecret(request);
180
+ const receipt =
181
+ secret === undefined
182
+ ? "invalid"
183
+ : await verifyDeviceReceipt(secret, input.receipt);
184
+ if (receipt === "expired") {
185
+ throw forbidden("Check this iPhone again: its check has expired.");
186
+ }
187
+ if (receipt === "invalid" || receipt.e !== viewer.email) {
188
+ throw forbidden("Check this iPhone again from this account.");
189
+ }
190
+ return core.requestIosDevice({
191
+ udid: receipt.u,
192
+ name: deviceName(input.name),
193
+ requestedBy: viewer.email,
194
+ });
195
+ };
196
+
197
+ /**
198
+ * Removes a device from the registry, as read now: an approver removes any,
199
+ * and the person who asked withdraws their own while it is still requested.
200
+ * Null when it is gone already.
201
+ */
202
+ export const removeIosDevice = async (
203
+ core: Pick<HotUpdaterCoreApi, "findIosDevice" | "deleteIosDevice">,
204
+ viewer: IosDeviceViewer,
205
+ udid: string,
206
+ ): Promise<IosDeviceRow | null> => {
207
+ const device = await core.findIosDevice(udid);
208
+ if (device === null) return null;
209
+ if (viewer.canApprove) return core.deleteIosDevice(device.id);
210
+ if (device.status !== "pending" || device.requested_by !== viewer.email) {
211
+ throw forbidden("Only a device approver can remove this device.");
212
+ }
213
+ // Only while it is still this person's request: an approval meanwhile
214
+ // makes it an approver's to remove.
215
+ const withdrawn = await core.deleteIosDevice(device.id, {
216
+ status: "pending",
217
+ requestedBy: viewer.email,
218
+ });
219
+ if (withdrawn === null && (await core.findIosDevice(udid)) !== null) {
220
+ throw forbidden("It was approved meanwhile. A device approver removes it.");
221
+ }
222
+ return withdrawn;
223
+ };
@@ -1,27 +1,13 @@
1
1
  import type {
2
2
  HotUpdaterCoreApi,
3
3
  ReleaseFilter,
4
- ReleaseRow,
5
4
  } from "@hot-updater/plugin-core";
6
5
 
7
- export interface ReleaseListInput {
8
- /** One of the filter sets the release indexes serve. */
9
- readonly filter: ReleaseFilter;
10
- /** Releases older than this id: the next page. */
11
- readonly beforeReleaseId?: string;
12
- /** Releases newer than this id: the previous page. */
13
- readonly afterReleaseId?: string;
14
- readonly limit: number;
15
- }
16
-
17
- export interface ReleaseListResult {
18
- /** Newest first. */
19
- readonly data: readonly ReleaseRow[];
20
- /** `beforeReleaseId` of the next page, when there may be older releases. */
21
- readonly next?: string;
22
- /** `afterReleaseId` of the previous page, when there may be newer releases. */
23
- readonly previous?: string;
24
- }
6
+ import { type FoldedPage, foldedPage, readFold } from "./foldedPage";
7
+ import {
8
+ addReleaseReachability,
9
+ type ReleaseListRow,
10
+ } from "./releaseReachability";
25
11
 
26
12
  const isRecord = (value: unknown): value is Record<string, unknown> =>
27
13
  typeof value === "object" && value !== null;
@@ -76,51 +62,104 @@ export const readReleaseFilter = (value: unknown): ReleaseFilter => {
76
62
  }
77
63
  };
78
64
 
65
+ /** A page of releases that leads with the reachable ones. */
66
+ export type ReleaseFoldedPage = FoldedPage<ReleaseListRow>;
67
+
79
68
  /**
80
- * One page of releases, newest first, through the index the filter names:
81
- * each page reads only its own rows. `next` is set for a full page, so the
82
- * last page may lead to an empty one.
69
+ * Whether a filter asks for unreachable releases: Disabled, whose every
70
+ * release no catalog serves, or one bundle. Its releases fold none.
83
71
  */
84
- export async function listReleases(
85
- core: Pick<HotUpdaterCoreApi, "listReleases">,
86
- input: ReleaseListInput,
87
- ): Promise<ReleaseListResult> {
88
- const { filter, limit } = input;
89
- if (input.afterReleaseId !== undefined) {
90
- // Newer releases, read oldest first from the cursor, then turned around.
91
- const data = (
92
- await core.listReleases({
93
- filter,
94
- order: "asc",
95
- after: input.afterReleaseId,
96
- limit,
97
- })
98
- ).reverse();
99
- const first = data[0]?.id;
100
- const last = data.at(-1)?.id;
101
- return {
102
- data,
103
- ...(last === undefined ? {} : { next: last }),
104
- ...(first !== undefined && data.length === limit
105
- ? { previous: first }
106
- : {}),
107
- };
108
- }
109
- const data = await core.listReleases({
110
- filter,
111
- order: "desc",
112
- limit,
113
- ...(input.beforeReleaseId === undefined
114
- ? {}
115
- : { after: input.beforeReleaseId }),
116
- });
117
- const first = data[0]?.id;
118
- const last = data.at(-1)?.id;
72
+ export const asksForUnreachable = (filter: ReleaseFilter): boolean =>
73
+ filter.kind === "bundle" ||
74
+ ((filter.kind === "scope" || filter.kind === "channelPlatform") &&
75
+ filter.enabled === false);
76
+
77
+ /** The core reads a page makes, with each scope's catalog read once. */
78
+ const readingCatalogsOnce = (
79
+ core: Pick<HotUpdaterCoreApi, "listReleases" | "getReleaseCatalogRow">,
80
+ ) => {
81
+ const catalogs = new Map<
82
+ string,
83
+ ReturnType<HotUpdaterCoreApi["getReleaseCatalogRow"]>
84
+ >();
119
85
  return {
120
- data,
121
- ...(last !== undefined && data.length === limit ? { next: last } : {}),
122
- ...(first !== undefined && input.beforeReleaseId !== undefined
123
- ? { previous: first }
124
- : {}),
86
+ listReleases: core.listReleases.bind(core),
87
+ getReleaseCatalogRow: (scopeKey: string) => {
88
+ if (!catalogs.has(scopeKey)) {
89
+ catalogs.set(scopeKey, core.getReleaseCatalogRow(scopeKey));
90
+ }
91
+ return catalogs.get(scopeKey)!;
92
+ },
125
93
  };
94
+ };
95
+
96
+ /**
97
+ * One page of releases, newest first, that leads with the reachable ones:
98
+ * each run of unreachable releases between them folds, split around the
99
+ * selected release, which shows where it sits and counts toward no page.
100
+ * It reads the filter's index a chunk at a time (at most
101
+ * `FOLDED_PAGE_READ_BUDGET` rows), and each scope's catalog once. A filter
102
+ * that asks for unreachable releases folds none.
103
+ */
104
+ export function listReleaseFolds(
105
+ core: Pick<HotUpdaterCoreApi, "listReleases" | "getReleaseCatalogRow">,
106
+ {
107
+ filter,
108
+ beforeReleaseId,
109
+ afterReleaseId,
110
+ releaseId,
111
+ }: {
112
+ readonly filter: ReleaseFilter;
113
+ readonly beforeReleaseId?: string;
114
+ readonly afterReleaseId?: string;
115
+ /** The selected release, which never folds. */
116
+ readonly releaseId?: string;
117
+ },
118
+ ): Promise<ReleaseFoldedPage> {
119
+ const reads = readingCatalogsOnce(core);
120
+ const foldsNone = asksForUnreachable(filter);
121
+ return foldedPage<ReleaseListRow>({
122
+ read: async (input) =>
123
+ addReleaseReachability(
124
+ reads,
125
+ await reads.listReleases({ filter, ...input }),
126
+ ),
127
+ classify: async (releases) =>
128
+ new Set(
129
+ releases
130
+ .filter((release) => foldsNone || !release.currentlyUnreachable)
131
+ .map(({ id }) => id),
132
+ ),
133
+ ...(beforeReleaseId === undefined ? {} : { before: beforeReleaseId }),
134
+ ...(afterReleaseId === undefined ? {} : { after: afterReleaseId }),
135
+ // The selected release shows where it sits, and moves no page edge.
136
+ ...(releaseId === undefined ? {} : { pinned: releaseId }),
137
+ });
138
+ }
139
+
140
+ /** One chunk of a fold's releases, as `listReleaseFolds` folded them. */
141
+ export function readReleaseFold(
142
+ core: Pick<HotUpdaterCoreApi, "listReleases" | "getReleaseCatalogRow">,
143
+ {
144
+ filter,
145
+ ...fold
146
+ }: {
147
+ readonly filter: ReleaseFilter;
148
+ readonly from?: string;
149
+ readonly to: string;
150
+ readonly after?: string;
151
+ },
152
+ ): Promise<{
153
+ readonly rows: readonly ReleaseListRow[];
154
+ readonly next?: string;
155
+ }> {
156
+ const reads = readingCatalogsOnce(core);
157
+ return readFold<ReleaseListRow>({
158
+ read: async (input) =>
159
+ addReleaseReachability(
160
+ reads,
161
+ await reads.listReleases({ filter, ...input }),
162
+ ),
163
+ ...fold,
164
+ });
126
165
  }
@@ -25,7 +25,7 @@ export interface LocalConsoleGuardOptions {
25
25
  }
26
26
 
27
27
  /** Compares in time that depends only on the lengths. */
28
- const sameSecret = (given: string, expected: string): boolean => {
28
+ export const sameSecret = (given: string, expected: string): boolean => {
29
29
  if (given.length !== expected.length) return false;
30
30
  let difference = 0;
31
31
  for (let index = 0; index < given.length; index += 1) {
@@ -0,0 +1,193 @@
1
+ import { getRequest } from "@tanstack/react-start/server";
2
+
3
+ import { sameSecret } from "./local-console";
4
+
5
+ /**
6
+ * How long a signed download link works. A link holds its own expiry and the
7
+ * Console stores nothing, so a new one never ends an older one.
8
+ */
9
+ export const NATIVE_BUILD_DOWNLOAD_LINK_TTL_MS = 30 * 24 * 60 * 60 * 1000;
10
+
11
+ /**
12
+ * The Console's secret, which a hosted Console already has for its sessions:
13
+ * a host's guide lists it. Links sign with a key derived from it, so a link
14
+ * is never a signature the sessions could take, and rotating it ends both.
15
+ */
16
+ export const CONSOLE_SECRET_ENV = "BETTER_AUTH_SECRET";
17
+
18
+ /** The length the Console's deployment guide asks of the secret. */
19
+ const MIN_SECRET_LENGTH = 32;
20
+
21
+ /** Separates the links' key from every other use of the Console's secret. */
22
+ const KEY_CONTEXT = "hot-updater/console/signed-links/v1";
23
+
24
+ /** What a link grants, so a token for anything else never verifies as one. */
25
+ const DOWNLOAD_PURPOSE = "native-build-download";
26
+
27
+ /** `<expiry in Unix seconds>.<HMAC-SHA256, base64url>`. */
28
+ const TOKEN_PATTERN = /^(\d{1,12})\.([A-Za-z0-9_-]{43})$/u;
29
+
30
+ const encoder = new TextEncoder();
31
+
32
+ const hmac = async (key: BufferSource, message: string) =>
33
+ new Uint8Array(
34
+ await crypto.subtle.sign(
35
+ "HMAC",
36
+ await crypto.subtle.importKey(
37
+ "raw",
38
+ key,
39
+ { name: "HMAC", hash: "SHA-256" },
40
+ false,
41
+ ["sign"],
42
+ ),
43
+ encoder.encode(message),
44
+ ),
45
+ );
46
+
47
+ const base64Url = (bytes: Uint8Array) =>
48
+ btoa(String.fromCharCode(...bytes))
49
+ .replaceAll("+", "-")
50
+ .replaceAll("/", "_")
51
+ .replaceAll("=", "");
52
+
53
+ const signatureOf = async (
54
+ secret: string,
55
+ buildId: string,
56
+ expiresAtSeconds: string,
57
+ ) =>
58
+ base64Url(
59
+ await hmac(
60
+ await hmac(encoder.encode(secret), KEY_CONTEXT),
61
+ `${DOWNLOAD_PURPOSE}\n${buildId}\n${expiresAtSeconds}`,
62
+ ),
63
+ );
64
+
65
+ /**
66
+ * The Console's secret from the host's environment, or undefined without one
67
+ * long enough to sign with. A Worker's secrets come with the request.
68
+ */
69
+ export const readConsoleSecret = (request: Request): string | undefined => {
70
+ const { runtime } = request as Request & {
71
+ readonly runtime?: {
72
+ readonly cloudflare?: { readonly env?: Record<string, unknown> };
73
+ };
74
+ };
75
+ const value =
76
+ runtime?.cloudflare?.env?.[CONSOLE_SECRET_ENV] ??
77
+ (typeof process === "undefined"
78
+ ? undefined
79
+ : process.env[CONSOLE_SECRET_ENV]);
80
+ const secret = typeof value === "string" ? value.trim() : "";
81
+ return secret.length >= MIN_SECRET_LENGTH ? secret : undefined;
82
+ };
83
+
84
+ /** A token that lets its bearer download one build until `expiresAtMs`. */
85
+ export const createNativeBuildDownloadToken = async (
86
+ secret: string,
87
+ buildId: string,
88
+ expiresAtMs: number,
89
+ ): Promise<string> => {
90
+ const expiresAtSeconds = String(Math.floor(expiresAtMs / 1000));
91
+ return `${expiresAtSeconds}.${await signatureOf(secret, buildId, expiresAtSeconds)}`;
92
+ };
93
+
94
+ /**
95
+ * Whether a token lets its bearer download `buildId` now. The expiry counts
96
+ * only under a signature that holds, so `expired` says nothing to a forger.
97
+ */
98
+ export const verifyNativeBuildDownloadToken = async (
99
+ secret: string,
100
+ buildId: string,
101
+ token: string,
102
+ now: number = Date.now(),
103
+ ): Promise<"valid" | "expired" | "invalid"> => {
104
+ const match = TOKEN_PATTERN.exec(token);
105
+ if (match === null) return "invalid";
106
+ const [, expiresAtSeconds, signature] = match as unknown as [
107
+ string,
108
+ string,
109
+ string,
110
+ ];
111
+ // Compares base64url text rather than decoded bytes: a signature's last
112
+ // character carries unused bits, so a changed one could decode the same.
113
+ if (
114
+ !sameSecret(signature, await signatureOf(secret, buildId, expiresAtSeconds))
115
+ ) {
116
+ return "invalid";
117
+ }
118
+ return now >= Number(expiresAtSeconds) * 1000 ? "expired" : "valid";
119
+ };
120
+
121
+ const refusal = (message: string) =>
122
+ new Response(message, {
123
+ status: 403,
124
+ headers: {
125
+ "cache-control": "no-store",
126
+ "content-type": "text/plain; charset=utf-8",
127
+ },
128
+ });
129
+
130
+ /**
131
+ * The 403 for a download link's token, or undefined when it lets its bearer
132
+ * download `buildId`. The answer never repeats the token.
133
+ */
134
+ export const refuseNativeBuildDownloadToken = async (
135
+ request: Request,
136
+ buildId: string,
137
+ token: string,
138
+ ): Promise<Response | undefined> => {
139
+ const secret = readConsoleSecret(request);
140
+ if (secret === undefined) {
141
+ return refusal(
142
+ `This Console can't check download links. Set ${CONSOLE_SECRET_ENV} on it.`,
143
+ );
144
+ }
145
+ switch (await verifyNativeBuildDownloadToken(secret, buildId, token)) {
146
+ case "valid":
147
+ return undefined;
148
+ case "expired":
149
+ return refusal(
150
+ "This download link has expired. Open the build's Console page for a new one.",
151
+ );
152
+ case "invalid":
153
+ return refusal(
154
+ "This download link isn't valid. Open the build's Console page for a new one.",
155
+ );
156
+ }
157
+ };
158
+
159
+ export type NativeBuildDownloadLinkResult =
160
+ | {
161
+ readonly status: "issued";
162
+ /** The `t` query parameter of the build's download route. */
163
+ readonly token: string;
164
+ readonly expiresAt: string;
165
+ }
166
+ /** The local console's lock asks for its session on every route. */
167
+ | { readonly status: "local-console" }
168
+ | { readonly status: "no-secret"; readonly secretName: string };
169
+
170
+ /**
171
+ * A new signed download link's token, for a caller the Console already let
172
+ * in. It reads nothing and stores nothing.
173
+ */
174
+ export const issueNativeBuildDownloadLink = async (
175
+ buildId: string,
176
+ request: Request = getRequest(),
177
+ now: number = Date.now(),
178
+ ttlMs: number = NATIVE_BUILD_DOWNLOAD_LINK_TTL_MS,
179
+ ): Promise<NativeBuildDownloadLinkResult> => {
180
+ const { default: localConsoleGuard } =
181
+ await import("virtual:hot-updater-console/request-guard");
182
+ if (localConsoleGuard !== undefined) return { status: "local-console" };
183
+ const secret = readConsoleSecret(request);
184
+ if (secret === undefined) {
185
+ return { status: "no-secret", secretName: CONSOLE_SECRET_ENV };
186
+ }
187
+ const expiresAt = now + ttlMs;
188
+ return {
189
+ status: "issued",
190
+ token: await createNativeBuildDownloadToken(secret, buildId, expiresAt),
191
+ expiresAt: new Date(expiresAt).toISOString(),
192
+ };
193
+ };