@hot-updater/console 1.2.0-rc.11 → 1.2.0-rc.13

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 (209) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{-native-builds-search-C-TGpFAm.js → -native-builds-search-DC2PutLU.js} +1 -1
  3. package/.output/public/assets/{ConsoleFeatureUnavailable-CUtcXuY2.js → ConsoleFeatureUnavailable-oMmbaqF6.js} +1 -1
  4. package/.output/public/assets/{EventDetails-Dl2RvPAk.js → EventDetails-ly7ygfdH.js} +1 -1
  5. package/.output/public/assets/{HashValueDisplay-6lNRxDJX.js → HashValueDisplay-BNoXZADg.js} +1 -1
  6. package/.output/public/assets/{InsightsPageHeader-DHhqY3DT.js → InsightsPageHeader-q2FgL8xS.js} +1 -1
  7. package/.output/public/assets/RolloutPercentageBadge-frllRncE.js +1 -0
  8. package/.output/public/assets/{StoreSubmission-ViTkW4eJ.js → StoreSubmission-D8BGGGgn.js} +1 -1
  9. package/.output/public/assets/api-BEEYDSCX.js +1 -0
  10. package/.output/public/assets/{api-keys-FueRkF9q.js → api-keys-B0N3SixL.js} +1 -1
  11. package/.output/public/assets/api-keys-DFAOfU4U.js +1 -0
  12. package/.output/public/assets/{index-DH9-mB8D.js → index-t0CToN0S.js} +3 -3
  13. package/.output/public/assets/insights-B0_8xNxr.js +1 -0
  14. package/.output/public/assets/{insights-B-0odqpt.js → insights-BbIzm_QG.js} +2 -2
  15. package/.output/public/assets/insights-BtmYg4vg.js +2 -0
  16. package/.output/public/assets/{insights-search-DghCbEnk.js → insights-search-B5cZsP6C.js} +1 -1
  17. package/.output/public/assets/{insights-usage-rpc-CKQH0pUS.js → insights-usage-rpc-zut_JaSS.js} +1 -1
  18. package/.output/public/assets/insights_.distribution-DLxq-IKU.js +1 -0
  19. package/.output/public/assets/insights_.distribution-izFBYfJL.js +2 -0
  20. package/.output/public/assets/{insights_.distribution-dvk6vYDM.js → insights_.distribution-rdeyNhH2.js} +1 -1
  21. package/.output/public/assets/{installations-B674P5Z5.js → installations-BRS-vuRJ.js} +2 -2
  22. package/.output/public/assets/installations-CWx7vYY5.js +1 -0
  23. package/.output/public/assets/{installations-BWxczZ2t.js → installations-Ce_dTa35.js} +1 -1
  24. package/.output/public/assets/native-builds-Br0onFRc.js +2 -0
  25. package/.output/public/assets/native-builds-CDYL3y0I.js +1 -0
  26. package/.output/public/assets/native-builds-DEWHul-_.js +1 -0
  27. package/.output/public/assets/native-builds_._buildId-D1XEPQ-V.js +1 -0
  28. package/.output/public/assets/native-builds_._buildId-x-uu1Vbr.js +2 -0
  29. package/.output/public/assets/{remote-config-B7ujqhLa.js → remote-config-Bw6sErCV.js} +3 -3
  30. package/.output/public/assets/{remote-config-WjpozBG5.js → remote-config-DQguWTMa.js} +1 -1
  31. package/.output/public/assets/remote-config-S3xj8r3x.js +1 -0
  32. package/.output/public/assets/{routes-CCD33Azv.js → routes-Dw8zgqXz.js} +2 -2
  33. package/.output/public/assets/routes-nKCEKnhh.js +1 -0
  34. package/.output/server/{__23tanstack-start-server-fn-resolver-rwcxgBkE.mjs → __23tanstack-start-server-fn-resolver-DI0OnlQe.mjs} +58 -46
  35. package/.output/server/_libs/_.mjs +2 -0
  36. package/.output/server/_ssr/{-native-builds-search-CwNcoXf4.mjs → -native-builds-search-Cl8EZ0Ud.mjs} +2 -2
  37. package/.output/server/_ssr/{BundleIdDisplay-Ck9PKmwH.mjs → BundleIdDisplay-SAvC-NlE.mjs} +2 -2
  38. package/.output/server/_ssr/{ConsoleFeatureUnavailable-BWB1D2Wi.mjs → ConsoleFeatureUnavailable-BgHEoZ36.mjs} +6 -6
  39. package/.output/server/_ssr/{EventDetails-BHaDqOa9.mjs → EventDetails-VaS25yjE.mjs} +7 -7
  40. package/.output/server/_ssr/{HashValueDisplay-BiDyA9rL.mjs → HashValueDisplay-BGc-x_l8.mjs} +2 -2
  41. package/.output/server/_ssr/{InsightsPageHeader-CF0EsQxx.mjs → InsightsPageHeader-gMuNJt-f.mjs} +7 -7
  42. package/.output/server/_ssr/{NotFoundPage-B9lpP9Tl.mjs → NotFoundPage-DsRI-J4h.mjs} +2 -2
  43. package/.output/server/_ssr/{PlatformIcon-CFLiTjh1.mjs → PlatformIcon-BsU0d0jN.mjs} +1 -1
  44. package/.output/server/_ssr/{RolloutPercentageBadge-zMqf1PpF.mjs → RolloutPercentageBadge-axz7VuIZ.mjs} +3 -3
  45. package/.output/server/_ssr/{StoreSubmission-Q-Bs-WZz.mjs → StoreSubmission-BqXKtpqW.mjs} +5 -5
  46. package/.output/server/_ssr/{alert-dialog-BEim4Utq.mjs → alert-dialog-lury59vV.mjs} +1 -1
  47. package/.output/server/_ssr/{api-DmYUr3JH.mjs → api-BQ8ztUgU.mjs} +99 -22
  48. package/.output/server/_ssr/{api-keys-BeIyFPrN.mjs → api-keys-CHATVpa9.mjs} +2 -2
  49. package/.output/server/_ssr/{api-keys-COYxx0WD.mjs → api-keys-DVChzF3r.mjs} +8 -8
  50. package/.output/server/_ssr/{api-keys-rpc-B3suM06f.mjs → api-keys-rpc-DXPJTfdr.mjs} +4 -4
  51. package/.output/server/_ssr/{api-rpc-WN63B4Fl.mjs → api-rpc-BexxmTM9.mjs} +43 -18
  52. package/.output/server/_ssr/{auth-rpc-DzFn-A4B.mjs → auth-rpc-BgNCvy2L.mjs} +5 -5
  53. package/.output/server/_ssr/{auth.server-CFohc_4Q.mjs → auth.server-43UW34Rd.mjs} +165 -149
  54. package/.output/server/_ssr/{badge-BJLGAEnB.mjs → badge-BYB825vl.mjs} +1 -1
  55. package/.output/server/_ssr/{bundleActivity-MLrjNJCT.mjs → bundleActivity-BGVvqWx7.mjs} +1 -1
  56. package/.output/server/_ssr/{config.server-DD38oozj.mjs → config.server-QRTmD4Hf.mjs} +4 -4
  57. package/.output/server/_ssr/{console-access-D0n051M-.mjs → console-access-E91fYTIB.mjs} +2 -2
  58. package/.output/server/_ssr/{console-features-BTV-XuhQ.mjs → console-features-CgdQJQlX.mjs} +1 -1
  59. package/.output/server/_ssr/{console-features-api-Dydnlqb0.mjs → console-features-api-CLRjxvy2.mjs} +4 -4
  60. package/.output/server/_ssr/{console-features-rpc-ByDxxOoW.mjs → console-features-rpc-C2rJ0u6i.mjs} +4 -4
  61. package/.output/server/_ssr/{createServerRpc-BVvRVOz5.mjs → createServerRpc-DJZel12M.mjs} +1 -1
  62. package/.output/server/_ssr/{databaseConfig-B_Bg7qS5.mjs → databaseConfig-XAvDetmn.mjs} +1 -1
  63. package/.output/server/_ssr/{databaseJsonValue-kS7cvEtz.mjs → databaseJsonValue-DuUoft8j.mjs} +1 -1
  64. package/.output/server/_ssr/{databaseRows-B6H8Cmgq.mjs → databaseRows-BtRVBD0C.mjs} +3 -3
  65. package/.output/server/_ssr/{dialog-Bh8kyYWS.mjs → dialog-CcF1pxfR.mjs} +1 -1
  66. package/.output/server/_ssr/{dist-TEpM_UAD.mjs → dist-B6-irDRA.mjs} +1 -1
  67. package/.output/server/_ssr/{downloadBundle-DCmr7vsj.mjs → downloadBundle-BX8ODCZT.mjs} +1 -1
  68. package/.output/server/_ssr/{empty-DpOPjAFI.mjs → empty-DkiJ7nWt.mjs} +2 -2
  69. package/.output/server/_ssr/{empty-plugin-adapters-zrZ0xs6n.mjs → empty-plugin-adapters-BYBYBaxo.mjs} +1 -1
  70. package/.output/server/_ssr/{failureReports-Cn_zU9S8.mjs → failureReports-C_CmBF4x.mjs} +3 -3
  71. package/.output/server/_ssr/{field-Ql8YHerV.mjs → field-CHlDI06h.mjs} +2 -2
  72. package/.output/server/_ssr/{getBundleChildren-rtkEEJw5.mjs → getBundleChildren-BJTufthT.mjs} +2 -2
  73. package/.output/server/_ssr/{git-CTA8Aqr0.mjs → git-WSg7LY17.mjs} +2 -2
  74. package/.output/server/_ssr/{input-group-Dd_2GFRH.mjs → input-group-BPZ4UtB5.mjs} +1 -1
  75. package/.output/server/_ssr/{insights-cJyup70V.mjs → insights-B3YetvBK.mjs} +5 -5
  76. package/.output/server/_ssr/{insights-BhJl-2pB.mjs → insights-CEABWFk4.mjs} +25 -25
  77. package/.output/server/_ssr/{insights-CqZSyEjz.mjs → insights-Dn32lJ18.mjs} +2 -2
  78. package/.output/server/_ssr/{insights-api-DRYBk0R6.mjs → insights-api-CYPf5853.mjs} +5 -5
  79. package/.output/server/_ssr/{insights-errors-7BCwFybo.mjs → insights-errors-Bz3sWNZm.mjs} +2 -2
  80. package/.output/server/_ssr/{insights-failures-B9VPkzZE.mjs → insights-failures-DNQ9qVVf.mjs} +2 -2
  81. package/.output/server/_ssr/{insights-failures-rpc-D-9CBKdE.mjs → insights-failures-rpc-CxPpBR1K.mjs} +11 -11
  82. package/.output/server/_ssr/{insights-recovery-BtXVU3ro.mjs → insights-recovery-DOkpqnQ8.mjs} +1 -1
  83. package/.output/server/_ssr/{insights-recovery-rpc-DLmf6moc.mjs → insights-recovery-rpc-CwnQMTE3.mjs} +7 -7
  84. package/.output/server/_ssr/{insights-rpc-y2kQKXNp.mjs → insights-rpc-CKd5ATFI.mjs} +4 -4
  85. package/.output/server/_ssr/{insights-search-BNYxloOl.mjs → insights-search-B_92_iEj.mjs} +4 -4
  86. package/.output/server/_ssr/{insights-usage-DiGnuxW8.mjs → insights-usage-4KDIN3Kg.mjs} +1 -1
  87. package/.output/server/_ssr/{insights-usage-rpc-DYu9RF-g.mjs → insights-usage-rpc-D90uHpJJ.mjs} +7 -7
  88. package/.output/server/_ssr/{insights-usage-rpc-kRcZzXgq.mjs → insights-usage-rpc-RIMNhPtj.mjs} +4 -4
  89. package/.output/server/_ssr/{insightsUsage-ClAmoUz8.mjs → insightsUsage-DmQdJZqT.mjs} +3 -3
  90. package/.output/server/_ssr/{insights_.distribution-DNzQrLmx.mjs → insights_.distribution-D42mHSe0.mjs} +13 -13
  91. package/.output/server/_ssr/{insights_.distribution-Bej6b0WB.mjs → insights_.distribution-D4QWsHNo.mjs} +5 -5
  92. package/.output/server/_ssr/{insights_.distribution-B9OZSH_r.mjs → insights_.distribution-DwjIdjQi.mjs} +2 -2
  93. package/.output/server/_ssr/{installations-skInTxKu.mjs → installations-BIu66J6Q.mjs} +2 -2
  94. package/.output/server/_ssr/{installations-CBiH9Wwn.mjs → installations-CfmO_V_R.mjs} +4 -4
  95. package/.output/server/_ssr/{installations-DlSYGvr8.mjs → installations-DyzKzWuv.mjs} +11 -11
  96. package/.output/server/_ssr/{listReleases-D_GY00SQ.mjs → listReleases-CQEceg8j.mjs} +1 -1
  97. package/.output/server/_ssr/{request-guard-CPdRBuGW.mjs → local-console-Dtxlsav0.mjs} +2 -9
  98. package/.output/server/_ssr/native-artifact-H1MDP0Jz.mjs +593 -0
  99. package/.output/server/_ssr/{native-builds-DAB0xa_Q.mjs → native-builds-BCp8ICrn.mjs} +3 -3
  100. package/.output/server/_ssr/{native-builds-CnI8MTbb.mjs → native-builds-CqFeXByK.mjs} +17 -13
  101. package/.output/server/_ssr/{native-builds-DhXL5zf_.mjs → native-builds-qj346atQ.mjs} +49 -12
  102. package/.output/server/_ssr/{native-builds_._buildId-DZDjrHBe.mjs → native-builds_._buildId-BAxkkEFo.mjs} +600 -168
  103. package/.output/server/_ssr/{native-builds_._buildId-DLZ6nB36.mjs → native-builds_._buildId-C8gsW-Rh.mjs} +3 -3
  104. package/.output/server/_ssr/nativeBuildDevice-nU480p5A.mjs +230 -0
  105. package/.output/server/_ssr/nativeBuildDownloadLink-c3tcq3G5.mjs +96 -0
  106. package/.output/server/_ssr/nativeBuildInstall-B-_lHDsS.mjs +203 -0
  107. package/.output/server/_ssr/nativeBuildQr-C5AFtpmE.mjs +115 -0
  108. package/.output/server/_ssr/{nativeBuilds-B_7BPjt_.mjs → nativeBuilds-CbxOJDhO.mjs} +61 -29
  109. package/.output/server/_ssr/{plugins-RIryUNWj.mjs → plugins-CX7wutet.mjs} +6 -6
  110. package/.output/server/_ssr/publicConsoleBase-3IHSHvqd.mjs +27 -0
  111. package/.output/server/_ssr/{qr-code-C7kNRIDX.mjs → qr-code-pENFuyy9.mjs} +1 -1
  112. package/.output/server/_ssr/{release-adoption-DoAtNPED.mjs → release-adoption-C7sUFDwa.mjs} +2 -2
  113. package/.output/server/_ssr/{release-adoption-rpc-zmiN6xmA.mjs → release-adoption-rpc-BBwJO2hu.mjs} +9 -9
  114. package/.output/server/_ssr/{releaseAdoption-a2byXMfz.mjs → releaseAdoption-LLYlRnUB.mjs} +4 -4
  115. package/.output/server/_ssr/{releaseCatalogCompiler-DLcean2k.mjs → releaseCatalogCompiler-D9dAMI17.mjs} +3 -3
  116. package/.output/server/_ssr/{releaseManagement-DHUux2az.mjs → releaseManagement-EPhok_Py.mjs} +1 -1
  117. package/.output/server/_ssr/{releaseReachability-DZOK_dH-.mjs → releaseReachability-DaZ7ifUF.mjs} +2 -2
  118. package/.output/server/_ssr/{remote-config-Dg413xDC.mjs → remote-config-B1g7vrQD.mjs} +2 -2
  119. package/.output/server/_ssr/{remote-config-wIu0mSXk.mjs → remote-config-BDijmvj1.mjs} +2 -2
  120. package/.output/server/_ssr/{remote-config-DARJ7wRc.mjs → remote-config-DjeXVIcr.mjs} +17 -17
  121. package/.output/server/_ssr/{remote-config-rpc-DChi0vbN.mjs → remote-config-rpc-B7bzKw4N.mjs} +5 -5
  122. package/.output/server/_ssr/request-guard-BPLyogIN.mjs +11 -0
  123. package/.output/server/_ssr/{router-PzDqC7iK.mjs → router-DhxgFNWn.mjs} +100 -49
  124. package/.output/server/_ssr/{routes-BJ3Qa9M2.mjs → routes-BC-rBuu_.mjs} +24 -24
  125. package/.output/server/_ssr/{routes-FJf2TN1y.mjs → routes-BDriEBtF.mjs} +11 -11
  126. package/.output/server/_ssr/{runtime.server-BdMY1blX.mjs → runtime.server-BsTTLV-B.mjs} +4 -4
  127. package/.output/server/_ssr/{schema-ChlRtZIo.mjs → schema-3oDJJFWa.mjs} +1 -1
  128. package/.output/server/_ssr/{schema-migration-rpc-BZPnIX5Y.mjs → schema-migration-rpc-CNMqY0RE.mjs} +4 -4
  129. package/.output/server/_ssr/{select-BVFaL5Ut.mjs → select-hFD2e3Bh.mjs} +1 -1
  130. package/.output/server/_ssr/{server-odRE3NM6.mjs → server-D_hG9iIq.mjs} +6 -6
  131. package/.output/server/_ssr/{sidebar-BJdj38Te.mjs → sidebar-Dmq4j1qr.mjs} +2 -2
  132. package/.output/server/_ssr/ssr.mjs +1 -1
  133. package/.output/server/_ssr/{start-BvDsQehg.mjs → start-RjhaPVFE.mjs} +2 -2
  134. package/.output/server/_ssr/{switch-sw0ti4p4.mjs → switch-CkNsEp9k.mjs} +2 -2
  135. package/.output/server/_ssr/{table-D-ou6_wJ.mjs → table-CTtXogFJ.mjs} +1 -1
  136. package/.output/server/_ssr/{tabs-DKuPano8.mjs → tabs-BTKDM4AJ.mjs} +2 -2
  137. package/.output/server/_ssr/{updateFailures-n-tGv90S.mjs → updateFailures-DPYzv9bE.mjs} +3 -3
  138. package/.output/server/_ssr/{uuidv7-BIF4nb_q.mjs → uuidv7-CmHbryZT.mjs} +2 -2
  139. package/.output/server/_ssr/{version-CQ98ZBpL-CWSkTT9J.mjs → version-CQ98ZBpL-NmbU0MD2.mjs} +1 -1
  140. package/.output/server/_tanstack-start-manifest_v-BuGAtKIu.mjs +189 -0
  141. package/.output/server/index.mjs +284 -284
  142. package/package.json +7 -7
  143. package/src/components/features/native-builds/BuiltInBundleCard.tsx +82 -33
  144. package/src/components/features/native-builds/InstallCard.tsx +246 -46
  145. package/src/components/features/native-builds/IosInstall.tsx +300 -0
  146. package/src/components/features/native-builds/NativeBuildsTable.tsx +3 -0
  147. package/src/components/features/native-builds/PatchesCard.tsx +3 -2
  148. package/src/components/features/native-builds/ReleaseNativeBuildLink.tsx +4 -4
  149. package/src/components/features/native-builds/ServedNowCard.tsx +33 -1
  150. package/src/components/features/native-builds/StoreSubmission.tsx +1 -1
  151. package/src/lib/api-rpc.ts +55 -6
  152. package/src/lib/api.ts +85 -12
  153. package/src/lib/native-builds.ts +73 -11
  154. package/src/lib/server/local-console.ts +1 -1
  155. package/src/lib/server/nativeBuildDevice.ts +274 -0
  156. package/src/lib/server/nativeBuildDownloadLink.ts +193 -0
  157. package/src/lib/server/nativeBuildInstall.ts +355 -0
  158. package/src/lib/server/nativeBuildQr.ts +114 -24
  159. package/src/lib/server/nativeBuilds.ts +87 -33
  160. package/src/lib/server/plistText.ts +17 -0
  161. package/src/lib/server/publicConsoleBase.ts +17 -0
  162. package/src/routeTree.gen.ts +114 -0
  163. package/src/routes/[_]hot-updater/native-builds/$buildId/device-response.ts +17 -0
  164. package/src/routes/[_]hot-updater/native-builds/$buildId/device.ts +17 -0
  165. package/src/routes/[_]hot-updater/native-builds/$buildId/device[.]mobileconfig.ts +17 -0
  166. package/src/routes/[_]hot-updater/native-builds/$buildId/manifest[.]plist.ts +22 -0
  167. package/src/routes/[_]hot-updater/native-builds/preview-qr.ts +14 -0
  168. package/src/routes/api/native-builds/$buildId/download.ts +22 -1
  169. package/.output/public/assets/RolloutPercentageBadge-Cxogpi8F.js +0 -1
  170. package/.output/public/assets/api-P2g8dCNg.js +0 -1
  171. package/.output/public/assets/api-keys-DWQC2q6y.js +0 -1
  172. package/.output/public/assets/insights-BSVGfxSL.js +0 -1
  173. package/.output/public/assets/insights-NK5B6ReS.js +0 -2
  174. package/.output/public/assets/insights_.distribution-CJvgwcVZ.js +0 -2
  175. package/.output/public/assets/insights_.distribution-DblZM0mO.js +0 -1
  176. package/.output/public/assets/installations-Dv4kWQYz.js +0 -1
  177. package/.output/public/assets/native-builds-BGgFQTDW.js +0 -2
  178. package/.output/public/assets/native-builds-BOC71grI.js +0 -1
  179. package/.output/public/assets/native-builds-CxomzFqe.js +0 -1
  180. package/.output/public/assets/native-builds_._buildId-DD58_Phd.js +0 -1
  181. package/.output/public/assets/native-builds_._buildId-DvQDKnUQ.js +0 -2
  182. package/.output/public/assets/remote-config-gXeH6PBW.js +0 -1
  183. package/.output/public/assets/routes-BDdBIxYS.js +0 -1
  184. package/.output/server/_ssr/nativeBuildQr-84cnFQPX.mjs +0 -59
  185. package/.output/server/_tanstack-start-manifest_v-uhJWytDm.mjs +0 -184
  186. /package/.output/public/assets/{NotFoundPage-DZ3DxyRA.js → NotFoundPage-fiaucvsO.js} +0 -0
  187. /package/.output/public/assets/{PlatformIcon-BBWQlWm9.js → PlatformIcon-DCTtCP5t.js} +0 -0
  188. /package/.output/public/assets/{alert-dialog-BqYScr9y.js → alert-dialog-Z_RNBrFc.js} +0 -0
  189. /package/.output/public/assets/{badge-DWFcDWho.js → badge-UNnTz4Dl.js} +0 -0
  190. /package/.output/public/assets/{dialog-CNUPxNxH.js → dialog-C2U9bINi.js} +0 -0
  191. /package/.output/public/assets/{dist-CPlO6ko9.js → dist-UQUhRoJi.js} +0 -0
  192. /package/.output/public/assets/{empty-B3Uwdd6k.js → empty-PAp07lsC.js} +0 -0
  193. /package/.output/public/assets/{field-D-2-mnNh.js → field-DhKRWFG5.js} +0 -0
  194. /package/.output/public/assets/{history-DqHlgSuV.js → history-DakJoeSM.js} +0 -0
  195. /package/.output/public/assets/{input-group-D3OUBk4n.js → input-group-BJfBVqeI.js} +0 -0
  196. /package/.output/public/assets/{key-round-DwNKkHhy.js → key-round-DzBe6DHr.js} +0 -0
  197. /package/.output/public/assets/{list--NIee1FZ.js → list-B6GeoQ_b.js} +0 -0
  198. /package/.output/public/assets/{plus-BReVKct-.js → plus-BVhOauU3.js} +0 -0
  199. /package/.output/public/assets/{refresh-cw-B9HHjLej.js → refresh-cw-C6svDMfM.js} +0 -0
  200. /package/.output/public/assets/{relativeTime-YQt84dYr.js → relativeTime-BscR0TsX.js} +0 -0
  201. /package/.output/public/assets/{rotate-cw-Cv2aVbYr.js → rotate-cw-CxFW64IG.js} +0 -0
  202. /package/.output/public/assets/{search-BCel4Oy6.js → search-bIYGuFCt.js} +0 -0
  203. /package/.output/public/assets/{smartphone-CMaSy_ir.js → smartphone-Bn5FtEwt.js} +0 -0
  204. /package/.output/public/assets/{switch-BpdiHL_t.js → switch-DtUu1RCw.js} +0 -0
  205. /package/.output/public/assets/{table-Bpy3SvSo.js → table-B22H8-RL.js} +0 -0
  206. /package/.output/public/assets/{tabs-Xmt7tZeG.js → tabs-Fgz3sA51.js} +0 -0
  207. /package/.output/public/assets/{undo-2-CUX96_BG.js → undo-2-7gOxArtb.js} +0 -0
  208. /package/.output/public/assets/{uuidv7-zXMtwR9Q.js → uuidv7-BLyD3pAM.js} +0 -0
  209. /package/.output/public/assets/{valueToPercent-BLwGy_xK.js → valueToPercent-DRLgSP0P.js} +0 -0
@@ -0,0 +1,300 @@
1
+ import type { NativeBuildRow } from "@hot-updater/plugin-core";
2
+ import dayjs from "dayjs";
3
+ import { AlertTriangle, Smartphone } from "lucide-react";
4
+ import { useEffect, useReducer, useState } from "react";
5
+
6
+ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
7
+ import { Button, buttonVariants } from "@/components/ui/button";
8
+ import { Skeleton } from "@/components/ui/skeleton";
9
+ import { useNativeBuildInstallEligibilityQuery } from "@/lib/api";
10
+ import {
11
+ consolePathOf,
12
+ IOS_UDID_PATTERN,
13
+ IOS_UDID_STORAGE_KEY,
14
+ NATIVE_BUILD_INSTALL_LINK_TTL_MS,
15
+ nativeBuildDeviceAddCommand,
16
+ nativeBuildDeviceProfilePath,
17
+ nativeBuildItmsUrl,
18
+ } from "@/lib/native-builds";
19
+
20
+ import { CopyableText } from "./CopyableText";
21
+
22
+ /**
23
+ * What an install does to the App Store's copy of the app on this iPhone, with
24
+ * the same bundle ID. The one line to change after trying it on a real iPhone.
25
+ */
26
+ export const IOS_STORE_APP_NOTE =
27
+ "With the same bundle ID, this install replaces the App Store's copy of the app on this iPhone.";
28
+
29
+ const ACTION_CLASS =
30
+ "h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit";
31
+
32
+ /** Whether this browser runs on an iPhone or iPad: an iPad says it is a Mac. */
33
+ export const isIosBrowser = (
34
+ browser: Pick<Navigator, "userAgent" | "maxTouchPoints">,
35
+ ) =>
36
+ /iPhone|iPod|iPad/u.test(browser.userAgent) ||
37
+ (/Macintosh/u.test(browser.userAgent) && browser.maxTouchPoints > 1);
38
+
39
+ /**
40
+ * Whether this page is open on an iPhone, and the UDID the phone kept when it
41
+ * checked itself. Read after the page mounts: the server renders it without a
42
+ * browser. Null until then.
43
+ */
44
+ export const useIosDevice = () => {
45
+ const [device, setDevice] = useState<{
46
+ readonly ios: boolean;
47
+ readonly udid: string | null;
48
+ } | null>(null);
49
+ useEffect(() => {
50
+ let udid: string | null = null;
51
+ try {
52
+ udid = window.localStorage.getItem(IOS_UDID_STORAGE_KEY);
53
+ } catch {
54
+ // A browser that keeps nothing: this iPhone checks itself each time.
55
+ }
56
+ setDevice({
57
+ ios: isIosBrowser(navigator),
58
+ udid: udid !== null && IOS_UDID_PATTERN.test(udid) ? udid : null,
59
+ });
60
+ }, []);
61
+ return device;
62
+ };
63
+
64
+ /**
65
+ * How long before its link expires the page stops offering it: the installer
66
+ * fetches the manifest, then the IPA, only after the tester confirms the prompt.
67
+ */
68
+ const INSTALL_LINK_MARGIN_MS = 5 * 60 * 1000;
69
+
70
+ /**
71
+ * Whether a link read at `readAtMs` is past offering, measured on this phone's
72
+ * clock from when it arrived, since the phone's clock may disagree with the
73
+ * server's. A failed refresh leaves `readAtMs` where it was. Timers stop while
74
+ * the phone sleeps, so coming back to the page checks again.
75
+ */
76
+ const useInstallLinkExpired = (readAtMs: number, holdsLink: boolean) => {
77
+ const [, check] = useReducer((count: number) => count + 1, 0);
78
+ const expiresAtMs =
79
+ readAtMs + NATIVE_BUILD_INSTALL_LINK_TTL_MS - INSTALL_LINK_MARGIN_MS;
80
+ useEffect(() => {
81
+ if (!holdsLink) return;
82
+ const timer = setTimeout(check, Math.max(0, expiresAtMs - Date.now()));
83
+ document.addEventListener("visibilitychange", check);
84
+ window.addEventListener("pageshow", check);
85
+ return () => {
86
+ clearTimeout(timer);
87
+ document.removeEventListener("visibilitychange", check);
88
+ window.removeEventListener("pageshow", check);
89
+ };
90
+ }, [expiresAtMs, holdsLink]);
91
+ return holdsLink && Date.now() >= expiresAtMs;
92
+ };
93
+
94
+ /** In place of Install once its link has expired: it never offers a dead link. */
95
+ function RenewInstallLink({
96
+ fetching,
97
+ onRenew,
98
+ }: {
99
+ readonly fetching: boolean;
100
+ readonly onRenew: () => void;
101
+ }) {
102
+ return (
103
+ <div className="flex min-w-0 flex-col gap-2">
104
+ <p className="text-xs text-muted-foreground" role="status">
105
+ This install link has expired.{fetching ? " Getting a new one." : ""}
106
+ </p>
107
+ {fetching ? null : (
108
+ <Button className={ACTION_CLASS} onClick={onRenew} variant="outline">
109
+ Get a new link
110
+ </Button>
111
+ )}
112
+ </div>
113
+ );
114
+ }
115
+
116
+ function InstallButton({
117
+ build,
118
+ token,
119
+ secondary = false,
120
+ }: {
121
+ readonly build: NativeBuildRow;
122
+ readonly token: string;
123
+ readonly secondary?: boolean;
124
+ }) {
125
+ return (
126
+ <a
127
+ className={buttonVariants({
128
+ className: ACTION_CLASS,
129
+ variant: secondary ? "outline" : "default",
130
+ })}
131
+ href={nativeBuildItmsUrl(window.location, build.id, token)}
132
+ >
133
+ {secondary ? "Install anyway" : "Install"}
134
+ </a>
135
+ );
136
+ }
137
+
138
+ /** What a tester reads before Install opens the system's install prompt. */
139
+ function InstallNotes() {
140
+ return (
141
+ <div className="flex min-w-0 flex-col gap-1">
142
+ <p className="text-xs text-muted-foreground">
143
+ On iOS 16 or later, the app opens only with Developer Mode on: Settings,
144
+ Privacy &amp; Security, Developer Mode.
145
+ </p>
146
+ <p className="text-xs text-muted-foreground">{IOS_STORE_APP_NOTE}</p>
147
+ </div>
148
+ );
149
+ }
150
+
151
+ /**
152
+ * The link that hands this iPhone the profile that reads its UDID, under the
153
+ * console's path. A plain link, so iOS offers the profile.
154
+ */
155
+ function CheckThisIphone({
156
+ build,
157
+ outline = false,
158
+ }: {
159
+ readonly build: NativeBuildRow;
160
+ readonly outline?: boolean;
161
+ }) {
162
+ return (
163
+ <a
164
+ className={buttonVariants({
165
+ className: ACTION_CLASS,
166
+ variant: outline ? "outline" : "default",
167
+ })}
168
+ href={`${consolePathOf(window.location, build.id)}${nativeBuildDeviceProfilePath(build.id)}`}
169
+ >
170
+ <Smartphone data-icon="inline-start" />
171
+ Check this iPhone
172
+ </a>
173
+ );
174
+ }
175
+
176
+ /**
177
+ * Installing an IPA from this iPhone: the build's IPA says what it allows, read
178
+ * once when the page opens here, so a phone it doesn't list goes to its UDID
179
+ * rather than a download iOS refuses at the end. App Store Connect isn't asked:
180
+ * a device registered after this IPA was signed still isn't in it.
181
+ */
182
+ export function IosInstall({
183
+ build,
184
+ udid,
185
+ }: {
186
+ readonly build: NativeBuildRow;
187
+ readonly udid: string | null;
188
+ }) {
189
+ const eligibility = useNativeBuildInstallEligibilityQuery(build.id, udid);
190
+ const { refetch } = eligibility;
191
+ const expired = useInstallLinkExpired(
192
+ eligibility.dataUpdatedAt,
193
+ eligibility.data?.status === "installable",
194
+ );
195
+ useEffect(() => {
196
+ if (expired) void refetch();
197
+ }, [expired, refetch]);
198
+ if (eligibility.isPending) {
199
+ return <Skeleton aria-label="Reading this IPA" className="h-11 w-full" />;
200
+ }
201
+ const result = eligibility.data;
202
+ if (result === undefined || result.status === "unavailable") {
203
+ return (
204
+ <Alert>
205
+ <AlertTriangle />
206
+ <AlertTitle>Installation details unavailable</AlertTitle>
207
+ <AlertDescription>
208
+ The Console couldn't read this IPA from storage in parts, which takes
209
+ an HTTPS download link that answers Range requests. Xcode or Apple
210
+ Configurator still installs the download over USB.
211
+ </AlertDescription>
212
+ </Alert>
213
+ );
214
+ }
215
+ if (result.status === "store") {
216
+ return (
217
+ <p className="text-xs text-muted-foreground">
218
+ This IPA is an App Store export, which installs through TestFlight, not
219
+ from this page.
220
+ </p>
221
+ );
222
+ }
223
+ if (result.status === "expired") {
224
+ return (
225
+ <Alert variant="destructive">
226
+ <AlertTriangle />
227
+ <AlertTitle>This build's profile has expired</AlertTitle>
228
+ <AlertDescription>
229
+ It expired on {dayjs(result.expiresAt).format("YYYY-MM-DD")}. A
230
+ maintainer rebuilds it to install again.
231
+ </AlertDescription>
232
+ </Alert>
233
+ );
234
+ }
235
+ const token = result.link.status === "issued" ? result.link.token : null;
236
+ if (result.link.status === "no-secret") {
237
+ return (
238
+ <p className="text-xs text-muted-foreground" role="status">
239
+ Set {result.link.secretName} on the Console to install from this page.
240
+ </p>
241
+ );
242
+ }
243
+ if (token === null) return null;
244
+ const install = ({ secondary = false } = {}) =>
245
+ expired ? (
246
+ <RenewInstallLink
247
+ fetching={eligibility.isFetching}
248
+ onRenew={() => void refetch()}
249
+ />
250
+ ) : (
251
+ <InstallButton build={build} secondary={secondary} token={token} />
252
+ );
253
+ if (result.device === "included") {
254
+ return (
255
+ <div className="flex min-w-0 flex-col gap-3">
256
+ <p className="text-sm font-medium">This iPhone is in this build.</p>
257
+ {install()}
258
+ <InstallNotes />
259
+ </div>
260
+ );
261
+ }
262
+ if (result.device === "not-included") {
263
+ return (
264
+ <div className="flex min-w-0 flex-col gap-3">
265
+ <div className="flex min-w-0 flex-col gap-1">
266
+ <p className="text-sm font-medium">Not in this build</p>
267
+ <p className="text-xs text-muted-foreground">
268
+ This IPA was signed without this iPhone. Send a maintainer this
269
+ command, then open the newer build once they've rebuilt. Send it
270
+ only if this is your iPhone.
271
+ </p>
272
+ </div>
273
+ <CopyableText
274
+ label="the command that registers this iPhone"
275
+ value={nativeBuildDeviceAddCommand(udid ?? "")}
276
+ wrap
277
+ />
278
+ {install({ secondary: true })}
279
+ <InstallNotes />
280
+ </div>
281
+ );
282
+ }
283
+ return (
284
+ <div className="flex min-w-0 flex-col gap-3">
285
+ <div className="flex min-w-0 flex-col gap-1">
286
+ <p className="text-sm font-medium">Is this iPhone in this build?</p>
287
+ <p className="text-xs text-muted-foreground">
288
+ iOS installs this IPA only on the devices it lists. A profile reads
289
+ this iPhone's ID and nothing else: allow the download, then install it
290
+ from Settings, where iOS calls it not signed. Nothing stays installed.
291
+ </p>
292
+ </div>
293
+ <div className="flex flex-col gap-2 sm:flex-row sm:flex-wrap">
294
+ <CheckThisIphone build={build} />
295
+ {install({ secondary: true })}
296
+ </div>
297
+ <InstallNotes />
298
+ </div>
299
+ );
300
+ }
@@ -217,6 +217,9 @@ function BuildRow({
217
217
  {formatByteSize(build.byte_size)}
218
218
  </span>
219
219
  <StoreSubmissionBadge build={build} withTime />
220
+ {build.store_build === true ? (
221
+ <Badge variant="secondary">Store build</Badge>
222
+ ) : null}
220
223
  </div>
221
224
  <div className="flex min-w-0 flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground">
222
225
  <span>{target.label}</span>
@@ -124,8 +124,9 @@ export function PatchesCard({
124
124
  <EmptyTitle>No patches from this build</EmptyTitle>
125
125
  <EmptyDescription>
126
126
  A deploy adds a patch from this build's bundle while it is its
127
- scope's newest build and the deploy config turns patches on,
128
- with <code className="font-mono">patch</code> in{" "}
127
+ scope's store build, or its newest build with none marked, and
128
+ the deploy config turns patches on, with{" "}
129
+ <code className="font-mono">patch</code> in{" "}
129
130
  <code className="font-mono">hot-updater.config.ts</code>.
130
131
  </EmptyDescription>
131
132
  </EmptyHeader>
@@ -12,10 +12,10 @@ import {
12
12
  } from "@/lib/native-builds";
13
13
 
14
14
  /**
15
- * The native build a release's bundle reaches, and whether that bundle has
16
- * a patch from its built-in bundle: the newest build of the release's
17
- * scope, one read. A release of an app version range targets many builds,
18
- * so it shows none and reads nothing.
15
+ * The native build new deploys to a release's scope patch from, and whether
16
+ * this bundle has a patch from its built-in bundle: the scope's store build,
17
+ * or with none its newest, in two reads at most. A release of an app version
18
+ * range targets many builds, so it shows none and reads nothing.
19
19
  */
20
20
  export function ReleaseNativeBuildLink({
21
21
  release,
@@ -25,6 +25,9 @@ import {
25
25
  } from "@/components/ui/table";
26
26
  import { formatByteSize } from "@/lib/native-builds";
27
27
  import type { NativeBuildDetail } from "@/lib/server/nativeBuilds";
28
+ import { shellQuote } from "@/lib/shell";
29
+
30
+ import { CopyableText } from "./CopyableText";
28
31
 
29
32
  /** How the first OTA to a bundle downloads on this build. */
30
33
  export type FirstDownload =
@@ -86,7 +89,27 @@ export function ServedNowCard({
86
89
  }: {
87
90
  readonly detail: NativeBuildDetail;
88
91
  }) {
89
- const { servedNow, patches, catalogScopeKey } = detail;
92
+ const { build, channel, servedNow, patches, catalogScopeKey } = detail;
93
+ // A hosted Console runs no diff, so a marked build whose first OTA has no
94
+ // patch from it gets the command that adds one. The first OTA is the newest
95
+ // release that serves anyone: one at 0% with no cohort serves no install.
96
+ const firstOta = servedNow.find(
97
+ ({ rolloutCohortCount, targetCohorts }) =>
98
+ rolloutCohortCount > 0 || targetCohorts.length > 0,
99
+ )?.bundleId;
100
+ const missingPatch =
101
+ build.store_build === true &&
102
+ firstOta !== undefined &&
103
+ firstOta !== null &&
104
+ firstDownloadOf(patches, firstOta).kind === "full"
105
+ ? [
106
+ "npx hot-updater patch",
107
+ `-p ${build.platform}`,
108
+ `-c ${shellQuote(channel)}`,
109
+ `-b ${shellQuote(firstOta)}`,
110
+ `--base-artifact-id ${shellQuote(build.min_bundle_id)}`,
111
+ ].join(" ")
112
+ : null;
90
113
  const scopeLink = (
91
114
  <Link
92
115
  className="inline-flex items-center gap-0.5 underline-offset-4 hover:underline"
@@ -202,6 +225,15 @@ export function ServedNowCard({
202
225
  })}
203
226
  </TableBody>
204
227
  </Table>
228
+ {missingPatch === null ? null : (
229
+ <div className="flex flex-col gap-2 border-t px-4 py-3 text-xs">
230
+ <p>
231
+ The OTA fresh installs get first has no patch from this store
232
+ build, so they download all of it. Add one from your project:
233
+ </p>
234
+ <CopyableText label="the patch command" value={missingPatch} />
235
+ </div>
236
+ )}
205
237
  <p className="border-t px-4 py-3 text-xs text-muted-foreground">
206
238
  What the update check serves an install of this build now, newest
207
239
  first: not the history. {scopeLink}
@@ -16,7 +16,7 @@ export const storeTrackLabels = {
16
16
  string
17
17
  >;
18
18
 
19
- type Submitted = NativeBuildRow & {
19
+ export type Submitted = NativeBuildRow & {
20
20
  readonly submitted_to: NonNullable<NativeBuildRow["submitted_to"]>;
21
21
  };
22
22
 
@@ -305,9 +305,9 @@ export const getNativeBuildPatches = createServerFn({ method: "GET" })
305
305
  });
306
306
 
307
307
  /**
308
- * The newest native build of a release's scope, which its patches start
309
- * from: one read. A release of an app version range has no one build, and
310
- * reads nothing.
308
+ * The native build new deploys to a release's scope patch from: the scope's
309
+ * store build in one read, or with no mark its newest build in one more. A
310
+ * release of an app version range has no one build, and reads nothing.
311
311
  */
312
312
  export const getReleaseNativeBuild = createServerFn({ method: "GET" })
313
313
  .middleware([consoleAccess])
@@ -322,12 +322,30 @@ export const getReleaseNativeBuild = createServerFn({ method: "GET" })
322
322
  .handler(async ({ data }) => {
323
323
  const scope = releaseNativeBuildScope(data);
324
324
  if (scope === null) return null;
325
- return (await prepare()).core.findNativeBuild(scope);
325
+ const { core } = await prepare();
326
+ return (
327
+ (await core.findNativeBuild(scope, { storeBuild: true })) ??
328
+ core.findNativeBuild(scope)
329
+ );
326
330
  });
327
331
 
328
332
  /**
329
- * The URL a phone downloads a build from without the console's sign-in, or
330
- * null when the storage gives none: the storage's download URL, resolved
333
+ * Marks a build as what the store sells, replacing its scope's mark, or clears
334
+ * its mark: only for a signed-in caller. It creates no patch: a hosted Console
335
+ * doesn't run the diff.
336
+ */
337
+ export const markNativeBuild = createServerFn({ method: "POST" })
338
+ .middleware([consoleAccess])
339
+ .validator((input: { id: string; storeBuild: boolean }) => input)
340
+ .handler(async ({ data }) =>
341
+ (await prepare()).core.markNativeBuild(data.id, {
342
+ storeBuild: data.storeBuild,
343
+ }),
344
+ );
345
+
346
+ /**
347
+ * The URL a phone downloads a build from when the Console can't sign a link,
348
+ * or null when the storage gives none: the storage's download URL, resolved
331
349
  * again each time it is read, since it may expire.
332
350
  */
333
351
  export const getNativeBuildDownloadUrl = createServerFn({ method: "GET" })
@@ -340,3 +358,34 @@ export const getNativeBuildDownloadUrl = createServerFn({ method: "GET" })
340
358
  ]);
341
359
  return { url: await resolveNativeBuildDownloadUrl(data.id, deps) };
342
360
  });
361
+
362
+ /**
363
+ * A new signed link to one build's download, which works without the
364
+ * console's sign-in until it expires: only for a signed-in caller.
365
+ */
366
+ export const createNativeBuildDownloadLink = createServerFn({ method: "POST" })
367
+ .middleware([consoleAccess])
368
+ .validator((input: { id: string }) => input)
369
+ .handler(async ({ data }) => {
370
+ const { issueNativeBuildDownloadLink } =
371
+ await import("./server/nativeBuildDownloadLink");
372
+ return issueNativeBuildDownloadLink(data.id);
373
+ });
374
+
375
+ /**
376
+ * What an iPhone can do with one build: read from the IPA on demand, one row
377
+ * and a few storage requests, with the Install button's link when it can
378
+ * install. A POST, since it signs that link, and only for a signed-in caller.
379
+ */
380
+ export const getNativeBuildInstallEligibility = createServerFn({
381
+ method: "POST",
382
+ })
383
+ .middleware([consoleAccess])
384
+ .validator((input: { id: string; udid?: string }) => input)
385
+ .handler(async ({ data }) => {
386
+ const [deps, { checkNativeBuildInstall }] = await Promise.all([
387
+ prepare(),
388
+ import("./server/nativeBuildInstall"),
389
+ ]);
390
+ return checkNativeBuildInstall(data.id, data.udid, deps);
391
+ });
package/src/lib/api.ts CHANGED
@@ -14,7 +14,10 @@ import {
14
14
  getChannels,
15
15
  getConfig,
16
16
  getNativeBuildDetail,
17
+ markNativeBuild as markNativeBuildApi,
18
+ createNativeBuildDownloadLink,
17
19
  getNativeBuildDownloadUrl,
20
+ getNativeBuildInstallEligibility,
18
21
  getNativeBuildPatches,
19
22
  getNativeBuilds,
20
23
  getRelease,
@@ -54,6 +57,10 @@ export const queryKeys = {
54
57
  ["native-build-patches", minBundleId, page] as const,
55
58
  nativeBuildDownloadUrl: (id: string) =>
56
59
  ["native-build-download-url", id] as const,
60
+ nativeBuildDownloadLink: (id: string) =>
61
+ ["native-build-download-link", id] as const,
62
+ nativeBuildInstallEligibility: (id: string, udid: string | null) =>
63
+ ["native-build-install-eligibility", id, udid] as const,
57
64
  releaseNativeBuild: (release: ReleaseNativeBuildInput) =>
58
65
  ["release-native-build", release] as const,
59
66
  };
@@ -78,11 +85,24 @@ export type ReleaseNativeBuildInput = {
78
85
  };
79
86
 
80
87
  /**
81
- * How often an open install QR reads its download URL again. Storage gives
82
- * no lifetime with the URL, and adapters let it be configured down to
83
- * minutes, so the QR never shows one older than this.
88
+ * How long a storage download URL counts as fresh. Storage gives no lifetime
89
+ * with the URL, and adapters let it be configured down to minutes, so a
90
+ * person coming back to the page after this gets a new one.
84
91
  */
85
- const DOWNLOAD_URL_REFRESH_MS = 30_000;
92
+ const DOWNLOAD_URL_STALE_MS = 60_000;
93
+
94
+ /**
95
+ * How long a build page's signed link counts as fresh: far inside its 30 days,
96
+ * so a page left open never shows an expired one, and it costs one request
97
+ * a day.
98
+ */
99
+ const DOWNLOAD_LINK_STALE_MS = 24 * 60 * 60 * 1000;
100
+
101
+ /**
102
+ * How long an iPhone keeps a build's install details and Install link, which
103
+ * lasts an hour: past this, an open page reads and signs again.
104
+ */
105
+ const INSTALL_ELIGIBILITY_STALE_MS = 30 * 60 * 1000;
86
106
 
87
107
  export type ReleaseFilters = {
88
108
  /** One of the filter sets the release indexes serve; none lists every release. */
@@ -230,18 +250,48 @@ export function useReleaseNativeBuildQuery(
230
250
  }
231
251
 
232
252
  /**
233
- * The storage URL a phone downloads a build from, read while the install
234
- * QR is open and again before it expires.
253
+ * The signed link of a build's page, which its QR code, download button, and
254
+ * copyable link all use: one request when the page opens.
235
255
  */
236
- export function useNativeBuildDownloadUrlQuery(id: string, enabled: boolean) {
256
+ export function useNativeBuildDownloadLinkQuery(id: string) {
257
+ return useQuery({
258
+ queryKey: queryKeys.nativeBuildDownloadLink(id),
259
+ queryFn: () => createNativeBuildDownloadLink({ data: { id } }),
260
+ staleTime: DOWNLOAD_LINK_STALE_MS,
261
+ });
262
+ }
263
+
264
+ /**
265
+ * What this iPhone can do with a build, and the link Install opens: requested
266
+ * only by an iPhone on the page of an IPA, and again before that link, which
267
+ * lasts about an hour, runs out.
268
+ */
269
+ export function useNativeBuildInstallEligibilityQuery(
270
+ id: string,
271
+ udid: string | null,
272
+ ) {
273
+ return useQuery({
274
+ queryKey: queryKeys.nativeBuildInstallEligibility(id, udid),
275
+ queryFn: () =>
276
+ getNativeBuildInstallEligibility({
277
+ data: { id, ...(udid === null ? {} : { udid }) },
278
+ }),
279
+ staleTime: INSTALL_ELIGIBILITY_STALE_MS,
280
+ // A page left open never holds an expired link. It reads nothing while the
281
+ // tab is hidden, and coming back reads again once this has passed.
282
+ refetchInterval: INSTALL_ELIGIBILITY_STALE_MS,
283
+ });
284
+ }
285
+
286
+ /**
287
+ * The storage URL a phone downloads a build from when the Console can't sign
288
+ * a link: read once, and again only when someone comes back to the page.
289
+ */
290
+ export function useNativeBuildDownloadUrlQuery(id: string) {
237
291
  return useQuery({
238
292
  queryKey: queryKeys.nativeBuildDownloadUrl(id),
239
293
  queryFn: () => getNativeBuildDownloadUrl({ data: { id } }),
240
- enabled,
241
- staleTime: DOWNLOAD_URL_REFRESH_MS,
242
- // A storage without download URLs has none to refresh.
243
- refetchInterval: (query) =>
244
- query.state.data?.url === null ? false : DOWNLOAD_URL_REFRESH_MS,
294
+ staleTime: DOWNLOAD_URL_STALE_MS,
245
295
  });
246
296
  }
247
297
 
@@ -270,6 +320,29 @@ export function useDeleteChannelMutation() {
270
320
  });
271
321
  }
272
322
 
323
+ /**
324
+ * Marks a build as its scope's store build, or clears it. The mark it replaced
325
+ * is on another build's page, in the list and in a release sheet's link, so
326
+ * they read again.
327
+ */
328
+ export function useMarkNativeBuildMutation() {
329
+ const queryClient = useQueryClient();
330
+ return useMutation({
331
+ mutationFn: (input: { id: string; storeBuild: boolean }) =>
332
+ markNativeBuildApi({ data: input }),
333
+ onSettled: async () => {
334
+ await Promise.all([
335
+ queryClient.invalidateQueries({ queryKey: ["native-build"] }),
336
+ queryClient.invalidateQueries({
337
+ queryKey: queryKeys.nativeBuilds.all,
338
+ }),
339
+ // A release sheet links the build new deploys patch from.
340
+ queryClient.invalidateQueries({ queryKey: ["release-native-build"] }),
341
+ ]);
342
+ },
343
+ });
344
+ }
345
+
273
346
  export function useUpdateReleaseMutation() {
274
347
  const queryClient = useQueryClient();
275
348
  return useMutation({