@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,360 @@
1
+ /*
2
+ * A list page that counts only its ordinary rows, the ones a list leads with
3
+ * (a reachable bundle, the newest build of a distribution path), and folds
4
+ * every run of other rows between them into one entry: how many rows it
5
+ * holds and where they lie, never the rows themselves. A fold's rows load
6
+ * when someone opens it. Pages read ahead through the list's own index, up to
7
+ * a budget of rows, and keep no state: a page's cursor says where it starts
8
+ * and where the pages before it started, so Previous reads a page again
9
+ * exactly as Next read it.
10
+ */
11
+
12
+ /** How many ordinary rows one page shows. */
13
+ export const FOLDED_PAGE_SIZE = 20;
14
+
15
+ /** The most rows one page reads, the list's and any it reads to classify them. */
16
+ export const FOLDED_PAGE_READ_BUDGET = 200;
17
+
18
+ /** How many rows one read of the index takes. */
19
+ export const FOLDED_PAGE_CHUNK = 50;
20
+
21
+ /** The count a fold shows exactly; past it, "100+". */
22
+ export const FOLD_COUNT_CAP = 100;
23
+
24
+ /** How many earlier pages a cursor remembers, for Previous. */
25
+ export const FOLDED_PAGE_HISTORY = 20;
26
+
27
+ /**
28
+ * A run of folded rows between two ordinary ones: the IDs between `from`
29
+ * (the row above it, not in it; none at the top of the list) and `to` (its
30
+ * last row, in it), newest first.
31
+ */
32
+ export interface Fold {
33
+ readonly kind: "fold";
34
+ /** How many rows it holds, up to `FOLD_COUNT_CAP`. */
35
+ readonly count: number;
36
+ /** Whether it holds more than `count`: past the cap, or past the page. */
37
+ readonly more: boolean;
38
+ readonly from?: string;
39
+ readonly to: string;
40
+ }
41
+
42
+ export type FoldedEntry<T> = { readonly kind: "row"; readonly row: T } | Fold;
43
+
44
+ /**
45
+ * Where the previous page is: a `before` cursor (none: the newest page), or,
46
+ * when no cursor remembers it, the rows newer than `after`.
47
+ */
48
+ export type PreviousPage =
49
+ | { readonly before?: string }
50
+ | { readonly after: string };
51
+
52
+ export interface FoldedPage<T> {
53
+ /** Ordinary rows and folds, newest first. */
54
+ readonly entries: readonly FoldedEntry<T>[];
55
+ /** `before` of the next page, when there may be older rows. */
56
+ readonly next?: string;
57
+ /** The previous page, when there may be newer rows. */
58
+ readonly previous?: PreviousPage;
59
+ }
60
+
61
+ /** The rows a page may still read; reads and classification spend it. */
62
+ export interface ReadBudget {
63
+ left: number;
64
+ }
65
+
66
+ /**
67
+ * One read of the list's index: rows older (`desc`) or newer (`asc`) than
68
+ * `after`, up to `through`, which ends the read with that row.
69
+ */
70
+ export type ReadRows<T> = (input: {
71
+ readonly order: "asc" | "desc";
72
+ readonly after?: string;
73
+ readonly through?: string;
74
+ readonly limit: number;
75
+ }) => Promise<readonly T[]>;
76
+
77
+ /**
78
+ * Which rows of a chunk are ordinary: the list's own rule, with its own
79
+ * reads, which spend `budget` too. `newerThan` is the newest row of a
80
+ * page under a cursor: the rows above it are on earlier pages.
81
+ */
82
+ export type ClassifyRows<T> = (
83
+ rows: readonly T[],
84
+ context: {
85
+ readonly budget: ReadBudget;
86
+ /** The order `rows` came in: newest first, or oldest first. */
87
+ readonly order: "asc" | "desc";
88
+ readonly newerThan?: string;
89
+ },
90
+ ) => Promise<ReadonlySet<string>>;
91
+
92
+ /*
93
+ * A cursor: `s.` (it remembers every page back to the second) or `t.` (it
94
+ * forgot the oldest), then the IDs pages start under, this page's first. A
95
+ * bare ID, as an older link holds, remembers no page.
96
+ */
97
+ const SEPARATOR = ".";
98
+ const ID = /^[0-9A-Za-z-]+$/u;
99
+
100
+ interface Cursor {
101
+ /** The ID this page reads under. */
102
+ readonly id: string;
103
+ /** The IDs the pages before it read under, nearest first. */
104
+ readonly history: readonly string[];
105
+ /** Whether `history` reaches the second page. */
106
+ readonly complete: boolean;
107
+ }
108
+
109
+ const parseCursor = (token: string): Cursor => {
110
+ const [mark, ...ids] = token.split(SEPARATOR);
111
+ if ((mark === "s" || mark === "t") && ids.length > 0) {
112
+ if (!ids.every((id) => ID.test(id))) {
113
+ throw new Error("Invalid page cursor.");
114
+ }
115
+ return { id: ids[0]!, history: ids.slice(1), complete: mark === "s" };
116
+ }
117
+ if (!ID.test(token)) throw new Error("Invalid page cursor.");
118
+ return { id: token, history: [], complete: false };
119
+ };
120
+
121
+ const cursorToken = (ids: readonly string[], complete: boolean) => {
122
+ const kept = ids.slice(0, FOLDED_PAGE_HISTORY + 1);
123
+ return [complete && kept.length === ids.length ? "s" : "t", ...kept].join(
124
+ SEPARATOR,
125
+ );
126
+ };
127
+
128
+ interface Scanned<T> {
129
+ readonly row: T;
130
+ /** Whether it counts toward the page: an ordinary row. */
131
+ readonly ordinary: boolean;
132
+ /** Whether it shows as a row: an ordinary one, or the pinned one. */
133
+ readonly shown: boolean;
134
+ }
135
+
136
+ /**
137
+ * Reads from `after` in `order`, a chunk at a time, while the budget lasts,
138
+ * until it finds the ordinary row past `size` of them: the first of the page
139
+ * beyond, which is left out (`beyond`). `ended` when the index ran out.
140
+ */
141
+ async function scan<T extends { readonly id: string }>(
142
+ read: ReadRows<T>,
143
+ classify: ClassifyRows<T>,
144
+ order: "asc" | "desc",
145
+ after: string | undefined,
146
+ size: number,
147
+ budget: ReadBudget,
148
+ pinned: string | undefined,
149
+ ): Promise<{ rows: Scanned<T>[]; ended: boolean; beyond: boolean }> {
150
+ const rows: Scanned<T>[] = [];
151
+ let ordinary = 0;
152
+ let cursor = after;
153
+ // Rows newer than the page's first row are on earlier pages.
154
+ let pageTop: string | undefined;
155
+ while (budget.left > 0) {
156
+ const limit = Math.min(FOLDED_PAGE_CHUNK, budget.left);
157
+ const chunk = await read({
158
+ order,
159
+ limit,
160
+ ...(cursor === undefined ? {} : { after: cursor }),
161
+ });
162
+ budget.left -= chunk.length;
163
+ pageTop ??= chunk[0]?.id;
164
+ const ordinaryIds =
165
+ chunk.length === 0
166
+ ? new Set<string>()
167
+ : await classify(chunk, {
168
+ budget,
169
+ order,
170
+ ...(order === "desc" && after !== undefined && pageTop !== undefined
171
+ ? { newerThan: pageTop }
172
+ : {}),
173
+ });
174
+ for (const row of chunk) {
175
+ const isOrdinary = ordinaryIds.has(row.id);
176
+ if (isOrdinary && ordinary === size) {
177
+ return { rows, ended: false, beyond: true };
178
+ }
179
+ if (isOrdinary) ordinary += 1;
180
+ rows.push({
181
+ row,
182
+ ordinary: isOrdinary,
183
+ shown: isOrdinary || row.id === pinned,
184
+ });
185
+ }
186
+ if (chunk.length < limit) return { rows, ended: true, beyond: false };
187
+ cursor = chunk.at(-1)!.id;
188
+ }
189
+ return { rows, ended: false, beyond: false };
190
+ }
191
+
192
+ /**
193
+ * Rows newest first as entries: each run of folded rows one fold. `above`
194
+ * is the row over the first one; `topContinues` and `bottomContinues` say a
195
+ * run at either edge goes on past the page.
196
+ */
197
+ const entriesOf = <T extends { readonly id: string }>(
198
+ rows: readonly Scanned<T>[],
199
+ above: string | undefined,
200
+ { topContinues = false, bottomContinues = false } = {},
201
+ ): FoldedEntry<T>[] => {
202
+ const entries: FoldedEntry<T>[] = [];
203
+ let run: T[] = [];
204
+ let from = above;
205
+ const close = (continues: boolean) => {
206
+ if (run.length === 0) return;
207
+ entries.push({
208
+ kind: "fold",
209
+ count: Math.min(run.length, FOLD_COUNT_CAP),
210
+ more: run.length > FOLD_COUNT_CAP || continues,
211
+ ...(from === undefined ? {} : { from }),
212
+ to: run.at(-1)!.id,
213
+ });
214
+ run = [];
215
+ };
216
+ for (const { row, shown } of rows) {
217
+ if (shown) {
218
+ close(entries.length === 0 && topContinues);
219
+ entries.push({ kind: "row", row });
220
+ from = row.id;
221
+ } else {
222
+ run.push(row);
223
+ }
224
+ }
225
+ close(bottomContinues || (entries.length === 0 && topContinues));
226
+ return entries;
227
+ };
228
+
229
+ /**
230
+ * One page newest first. `before` is a cursor from `next` or `previous`;
231
+ * `after` reads the page above a row, when no cursor remembers it; neither
232
+ * is the newest page. A page holds `size` ordinary rows and the folds
233
+ * between them, and the run of folded rows under its last ordinary row, so
234
+ * the next page starts with an ordinary row. It reads at most `budget` rows:
235
+ * a page that runs out first ends in a fold that goes on, and the next page
236
+ * continues it.
237
+ */
238
+ export async function foldedPage<T extends { readonly id: string }>({
239
+ read,
240
+ classify,
241
+ before,
242
+ after,
243
+ pinned,
244
+ size = FOLDED_PAGE_SIZE,
245
+ budget = FOLDED_PAGE_READ_BUDGET,
246
+ }: {
247
+ readonly read: ReadRows<T>;
248
+ readonly classify: ClassifyRows<T>;
249
+ readonly before?: string;
250
+ readonly after?: string;
251
+ /**
252
+ * A row that shows wherever it sits, folded or not, such as the one a
253
+ * link selects: it splits its run, and counts toward no page, so it stays
254
+ * on the page whose run holds it.
255
+ */
256
+ readonly pinned?: string;
257
+ readonly size?: number;
258
+ readonly budget?: number;
259
+ }): Promise<FoldedPage<T>> {
260
+ const left: ReadBudget = { left: budget };
261
+ if (after === undefined) {
262
+ const cursor = before === undefined ? undefined : parseCursor(before);
263
+ const { rows, ended } = await scan(
264
+ read,
265
+ classify,
266
+ "desc",
267
+ cursor?.id,
268
+ size,
269
+ left,
270
+ pinned,
271
+ );
272
+ const last = rows.at(-1)?.row.id;
273
+ // Out of budget inside a run: the run goes on past this page.
274
+ const outOfBudget = !ended && left.left === 0;
275
+ const pages = cursor === undefined ? [] : [cursor.id, ...cursor.history];
276
+ const complete = cursor === undefined || cursor.complete;
277
+ const previous = (): PreviousPage | undefined => {
278
+ if (cursor === undefined) return undefined;
279
+ if (cursor.history.length > 0) {
280
+ return { before: cursorToken(cursor.history, cursor.complete) };
281
+ }
282
+ if (cursor.complete) return {};
283
+ return { after: rows[0]?.row.id ?? cursor.id };
284
+ };
285
+ const previousPage = previous();
286
+ return {
287
+ entries: entriesOf(rows, cursor?.id, { bottomContinues: outOfBudget }),
288
+ ...(!ended && last !== undefined
289
+ ? { next: cursorToken([last, ...pages], complete) }
290
+ : {}),
291
+ ...(previousPage === undefined ? {} : { previous: previousPage }),
292
+ };
293
+ }
294
+
295
+ // The page above `after`, read upward. The run just above `after` ends
296
+ // that page. A run above its top ordinary row belongs to the page above
297
+ // it when the next ordinary row up is in: the page above starts there. Out
298
+ // of budget, the last row read is kept as the edge, so the read stays in
299
+ // budget and the run over the page's top goes on past it.
300
+ const { rows, ended, beyond } = await scan(
301
+ read,
302
+ classify,
303
+ "asc",
304
+ after,
305
+ size,
306
+ left,
307
+ pinned,
308
+ );
309
+ let top = rows.length;
310
+ let above: string | undefined;
311
+ if (beyond) {
312
+ while (top > 0 && !rows[top - 1]!.ordinary) top -= 1;
313
+ above = rows[top]?.row.id;
314
+ } else if (!ended && rows.length > 0) {
315
+ top -= 1;
316
+ above = rows[top]!.row.id;
317
+ }
318
+ const page = rows.slice(0, top).reverse();
319
+ const first = page[0]?.row.id;
320
+ return {
321
+ entries: entriesOf(page, ended ? undefined : above, {
322
+ topContinues: !ended && !beyond,
323
+ }),
324
+ ...(page.length > 0
325
+ ? { next: cursorToken([page.at(-1)!.row.id], false) }
326
+ : {}),
327
+ ...(!ended && first !== undefined ? { previous: { after: first } } : {}),
328
+ };
329
+ }
330
+
331
+ /**
332
+ * One chunk of a fold's rows, newest first: the rows under `from` (or under
333
+ * `after`, the last row of the chunk before) down to `to`. `next` is the
334
+ * `after` of the next chunk, while the fold goes on.
335
+ */
336
+ export async function readFold<T extends { readonly id: string }>({
337
+ read,
338
+ from,
339
+ to,
340
+ after,
341
+ limit = FOLDED_PAGE_CHUNK,
342
+ }: {
343
+ readonly read: ReadRows<T>;
344
+ readonly from?: string;
345
+ readonly to: string;
346
+ readonly after?: string;
347
+ readonly limit?: number;
348
+ }): Promise<{ readonly rows: readonly T[]; readonly next?: string }> {
349
+ const cursor = after ?? from;
350
+ // The read ends at `to`, so it reads the fold's rows and no other.
351
+ const rows = await read({
352
+ order: "desc",
353
+ limit,
354
+ through: to,
355
+ ...(cursor === undefined ? {} : { after: cursor }),
356
+ });
357
+ const last = rows.at(-1)?.id;
358
+ const done = rows.length < limit || last === to;
359
+ return { rows, ...(done || last === undefined ? {} : { next: last }) };
360
+ }
@@ -0,0 +1,230 @@
1
+ import type { HotUpdaterCoreApi } from "@hot-updater/plugin-core";
2
+ import { readProfileServiceUdid } from "@hot-updater/protocol/native-artifact";
3
+
4
+ import {
5
+ IOS_DEVICES_PATH,
6
+ IOS_DEVICE_PROFILE_PATH,
7
+ IOS_DEVICE_RESPONSE_PATH,
8
+ IOS_DEVICE_TOKEN_PARAM,
9
+ nativeBuildDetailPath,
10
+ } from "../native-builds";
11
+ import {
12
+ createDeviceReceipt,
13
+ type DeviceProfileGrant,
14
+ verifyDeviceProfileToken,
15
+ } from "./deviceProfileToken";
16
+ import { readConsoleSecret } from "./nativeBuildDownloadLink";
17
+ import { escapePlistText } from "./plistText";
18
+ import { publicConsoleBase } from "./publicConsoleBase";
19
+
20
+ /** The most a Profile Service answer holds: a plist and a device's certificates. */
21
+ const MAX_RESPONSE_BYTES = 64 * 1024;
22
+
23
+ const refusal = (status: number, message: string) =>
24
+ new Response(message, {
25
+ status,
26
+ headers: {
27
+ "cache-control": "no-store",
28
+ "content-type": "text/plain; charset=utf-8",
29
+ "referrer-policy": "no-referrer",
30
+ },
31
+ });
32
+
33
+ const methodRefusal = (allow: string) => {
34
+ const response = refusal(405, "Method Not Allowed");
35
+ response.headers.set("allow", allow);
36
+ return response;
37
+ };
38
+
39
+ /**
40
+ * The grant a request's `t` carries, or the 403 that refuses it, checked
41
+ * before anything else is read: the profile routes take no session.
42
+ */
43
+ const grantOf = async (
44
+ request: Request,
45
+ ): Promise<
46
+ | {
47
+ readonly grant: DeviceProfileGrant;
48
+ readonly token: string;
49
+ readonly secret: string;
50
+ }
51
+ | Response
52
+ > => {
53
+ const secret = readConsoleSecret(request);
54
+ if (secret === undefined) {
55
+ return refusal(
56
+ 403,
57
+ "This Console can't register iPhones without its secret.",
58
+ );
59
+ }
60
+ const token = new URL(request.url).searchParams.get(IOS_DEVICE_TOKEN_PARAM);
61
+ const grant =
62
+ token === null ? "invalid" : await verifyDeviceProfileToken(secret, token);
63
+ if (grant === "expired") {
64
+ return refusal(403, "This link has expired. Open the Console page again.");
65
+ }
66
+ if (grant === "invalid") {
67
+ return refusal(403, "This link isn't valid. Open the Console page again.");
68
+ }
69
+ return { grant, token: token!, secret };
70
+ };
71
+
72
+ /**
73
+ * The profile an iPhone installs to report its UDID, at
74
+ * `/_hot-updater/devices/device.mobileconfig?t=<capability>`. It takes no
75
+ * session, since Safari's download carries none here, and reads nothing:
76
+ * the capability is all it answers to. The callback URL carries the same
77
+ * capability. It asks for the UDID alone, and iOS keeps no profile afterwards.
78
+ *
79
+ * - 400: the Console isn't on HTTPS, which iOS needs;
80
+ * - 403: no capability, or one that isn't valid or has expired;
81
+ * - 405: a method other than GET or HEAD.
82
+ */
83
+ export const serveDeviceProfile = async (
84
+ request: Request,
85
+ ): Promise<Response> => {
86
+ if (request.method !== "GET" && request.method !== "HEAD") {
87
+ return methodRefusal("GET, HEAD");
88
+ }
89
+ const checked = await grantOf(request);
90
+ if (checked instanceof Response) return checked;
91
+ const base = publicConsoleBase(request, IOS_DEVICE_PROFILE_PATH);
92
+ if (!base.startsWith("https://")) {
93
+ return refusal(
94
+ 400,
95
+ "An iPhone needs this Console on HTTPS with a certificate it trusts.",
96
+ );
97
+ }
98
+ const host = new URL(base).host;
99
+ const callback = `${base}${IOS_DEVICE_RESPONSE_PATH}?${IOS_DEVICE_TOKEN_PARAM}=${encodeURIComponent(checked.token)}`;
100
+ const purpose =
101
+ checked.grant.m === "register"
102
+ ? "to request this iPhone for ad hoc builds"
103
+ : "to check whether a build can install on it";
104
+ const profile = `<?xml version="1.0" encoding="UTF-8"?>
105
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
106
+ <plist version="1.0">
107
+ <dict>
108
+ <key>PayloadContent</key>
109
+ <dict>
110
+ <key>URL</key>
111
+ <string>${escapePlistText(callback)}</string>
112
+ <key>DeviceAttributes</key>
113
+ <array>
114
+ <string>UDID</string>
115
+ </array>
116
+ <key>Challenge</key>
117
+ <string>hot-updater</string>
118
+ </dict>
119
+ <key>PayloadOrganization</key>
120
+ <string>Hot Updater</string>
121
+ <key>PayloadDisplayName</key>
122
+ <string>Hot Updater Device Profile</string>
123
+ <key>PayloadDescription</key>
124
+ <string>Sends this iPhone's ID (UDID) to ${escapePlistText(host)}, ${purpose}. Nothing stays installed.</string>
125
+ <key>PayloadIdentifier</key>
126
+ <string>dev.hot-updater.device-profile</string>
127
+ <key>PayloadUUID</key>
128
+ <string>6D3F4C0E-52C4-4C8B-9E0A-7B1E5A0C2F11</string>
129
+ <key>PayloadVersion</key>
130
+ <integer>1</integer>
131
+ <key>PayloadType</key>
132
+ <string>Profile Service</string>
133
+ </dict>
134
+ </plist>
135
+ `;
136
+ return new Response(request.method === "HEAD" ? null : profile, {
137
+ headers: {
138
+ "cache-control": "no-store",
139
+ "content-type": "application/x-apple-aspen-config",
140
+ "referrer-policy": "no-referrer",
141
+ "x-content-type-options": "nosniff",
142
+ },
143
+ });
144
+ };
145
+
146
+ /** A request's body, or null past `limit` bytes, which are never buffered. */
147
+ const readBoundedBody = async (
148
+ request: Request,
149
+ limit: number,
150
+ ): Promise<Uint8Array | null> => {
151
+ if (Number(request.headers.get("content-length") ?? 0) > limit) {
152
+ await request.body?.cancel().catch(() => {});
153
+ return null;
154
+ }
155
+ const reader = request.body?.getReader();
156
+ if (reader === undefined) return new Uint8Array(0);
157
+ const body = new Uint8Array(limit);
158
+ let length = 0;
159
+ try {
160
+ for (;;) {
161
+ const { done, value } = await reader.read();
162
+ if (done) return body.subarray(0, length);
163
+ if (length + value.byteLength > limit) return null;
164
+ body.set(value, length);
165
+ length += value.byteLength;
166
+ }
167
+ } finally {
168
+ await reader.cancel().catch(() => {});
169
+ }
170
+ };
171
+
172
+ /**
173
+ * Where iOS posts the device's answer, at `/_hot-updater/devices/
174
+ * device-response?t=<capability>`, without a session, since Settings has
175
+ * none. The capability is checked before the body is read. It takes the
176
+ * UDID's text and verifies no signature: a person approves every device.
177
+ *
178
+ * - `register`: saves the iPhone as requested by the capability's email, one
179
+ * read and at most one write, and goes back to the iOS devices page;
180
+ * - `identify`: saves nothing and goes back to the build's page with a receipt
181
+ * of the UDID for that email, which Request access takes.
182
+ *
183
+ * Where it goes back to comes from the capability, never from the request.
184
+ * iOS asks for a 301.
185
+ *
186
+ * - 400: no well-formed UDID;
187
+ * - 403: no capability, or one that isn't valid or has expired;
188
+ * - 405: a method other than POST;
189
+ * - 413: a body over 64 KiB.
190
+ */
191
+ export const receiveDeviceResponse = async (
192
+ request: Request,
193
+ loadCore: () => Promise<Pick<HotUpdaterCoreApi, "requestIosDevice">>,
194
+ ): Promise<Response> => {
195
+ if (request.method !== "POST") return methodRefusal("POST");
196
+ const checked = await grantOf(request);
197
+ if (checked instanceof Response) {
198
+ await request.body?.cancel().catch(() => {});
199
+ return checked;
200
+ }
201
+ const body = await readBoundedBody(request, MAX_RESPONSE_BYTES);
202
+ if (body === null) return refusal(413, "This answer is too large.");
203
+ const udid = readProfileServiceUdid(body);
204
+ if (udid === null) return refusal(400, "This answer has no device ID.");
205
+ const { grant, secret } = checked;
206
+ const base = publicConsoleBase(request, IOS_DEVICE_RESPONSE_PATH);
207
+ let location: string;
208
+ if (grant.m === "register") {
209
+ const core = await loadCore();
210
+ await core.requestIosDevice({
211
+ udid,
212
+ name: grant.n ?? "iPhone",
213
+ requestedBy: grant.e,
214
+ });
215
+ location = `${base}${IOS_DEVICES_PATH}#udid=${encodeURIComponent(udid)}&requested=1`;
216
+ } else {
217
+ const receipt = await createDeviceReceipt(secret, { u: udid, e: grant.e });
218
+ const page =
219
+ grant.b === undefined ? IOS_DEVICES_PATH : nativeBuildDetailPath(grant.b);
220
+ location = `${base}${page}#udid=${encodeURIComponent(udid)}&r=${encodeURIComponent(receipt)}`;
221
+ }
222
+ return new Response(null, {
223
+ status: 301,
224
+ headers: {
225
+ "cache-control": "no-store",
226
+ "referrer-policy": "no-referrer",
227
+ location,
228
+ },
229
+ });
230
+ };