@hot-updater/console 1.2.0-rc.27 → 1.2.0-rc.29

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 (298) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{-native-builds-search-OlRj4Jz0.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-DUqlpHCp.js → ConsoleFeatureUnavailable-Be-0iTww.js} +1 -1
  7. package/.output/public/assets/EventDetails-bDOYte1z.js +1 -0
  8. package/.output/public/assets/HashValueDisplay-D2f0HmyU.js +1 -0
  9. package/.output/public/assets/{InsightsPageHeader-2bTrjXln.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-Ckb5GMhh.js → NotFoundPage-CVBtl68B.js} +1 -1
  13. package/.output/public/assets/{PlatformIcon-CJ69KopR.js → PlatformIcon-DVnzzGqM.js} +1 -1
  14. package/.output/public/assets/RelativeTime-B4PK8qDw.js +1 -0
  15. package/.output/public/assets/{RolloutPercentageBadge-G6qt8rVb.js → RolloutPercentageBadge-D_I0Raj2.js} +1 -1
  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-DiRLrFVe.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-D0NFvUY5.js → badge-FZMD5vvS.js} +1 -1
  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-Bf1BPKMs.js → dist-DAM__Tdz.js} +1 -1
  36. package/.output/public/assets/download-B2GjTySo.js +1 -0
  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-BdyQq4-k.js +10 -0
  42. package/.output/public/assets/{input-group-D_NfhUbX.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-CYPrQVUC.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-_dZi1_ay.js → insights_.distribution-CRkGNelG.js} +1 -1
  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-DzBe6DHr.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-B6GeoQ_b.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-B-u7uLLG.js +2 -0
  64. package/.output/public/assets/native-builds_.devices-CVNAQtSy.js +1 -0
  65. package/.output/public/assets/{package-ytYrywZH.js → package-BmfoZ5Zj.js} +1 -1
  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-C-tvoCcE.js → refresh-cw-BHhBYjS8.js} +1 -1
  69. package/.output/public/assets/{relativeTime-DvyxGIsm.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-Clk5xTeE.js → rotate-cw-Ba-slJea.js} +1 -1
  74. package/.output/public/assets/{routes-gQXSzO_n.js → routes-DM3TyTLW.js} +2 -2
  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-Bt0YXG26.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/server/{__23tanstack-start-server-fn-resolver-CIN7Hpjl.mjs → __23tanstack-start-server-fn-resolver-DTuNq7_z.mjs} +85 -49
  90. package/.output/server/_libs/@base-ui/react+[...].mjs +1488 -183
  91. package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
  92. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +2 -2
  93. package/.output/server/_libs/_.mjs +1 -1
  94. package/.output/server/_libs/lucide-react.mjs +22 -2
  95. package/.output/server/_libs/next-themes.mjs +1 -1
  96. package/.output/server/_libs/react-redux+[...].mjs +1 -1
  97. package/.output/server/_libs/recharts+[...].mjs +1 -1
  98. package/.output/server/_libs/sonner.mjs +1 -1
  99. package/.output/server/_libs/tanstack__react-query.mjs +1 -1
  100. package/.output/server/_ssr/{-native-builds-search-M6t7EIt4.mjs → -native-builds-search-Mm_AZoRU.mjs} +8 -2
  101. package/.output/server/_ssr/{BundleIdDisplay-BaFPllhZ.mjs → BundleIdDisplay-BX6DLh1K.mjs} +3 -3
  102. package/.output/server/_ssr/ChannelBadge-D7O95Ack.mjs +23 -0
  103. package/.output/server/_ssr/{ConsoleFeatureUnavailable-C-1Ls1sm.mjs → ConsoleFeatureUnavailable-Dfs3WUZf.mjs} +8 -8
  104. package/.output/server/_ssr/{EventDetails-jVM6sD8m.mjs → EventDetails-C1Q9caVa.mjs} +9 -9
  105. package/.output/server/_ssr/{HashValueDisplay-C7nja_fn.mjs → HashValueDisplay-SIEeZe0O.mjs} +3 -3
  106. package/.output/server/_ssr/{InsightsPageHeader-CDJhClRy.mjs → InsightsPageHeader-CAcbXSFD.mjs} +9 -9
  107. package/.output/server/_ssr/IosInstall-B7yxnQ7o.mjs +615 -0
  108. package/.output/server/_ssr/NativeBuildsNav-BwoEX7xx.mjs +38 -0
  109. package/.output/server/_ssr/{NotFoundPage-DclXpGzY.mjs → NotFoundPage-Cd_nKv04.mjs} +3 -3
  110. package/.output/server/_ssr/{PlatformIcon-CMLs3Wez.mjs → PlatformIcon-BpGOEXjU.mjs} +2 -2
  111. package/.output/server/_ssr/{RelativeTime-DUr_cgha.mjs → RelativeTime-B5txzq94.mjs} +40 -12
  112. package/.output/server/_ssr/{RolloutPercentageBadge-Mg4g25Gf.mjs → RolloutPercentageBadge-BEV8btLv.mjs} +4 -4
  113. package/.output/server/_ssr/RowReason-CEDEk7-N.mjs +186 -0
  114. package/.output/server/_ssr/{StoreSubmission-CUIg6WXQ.mjs → SandboxBadge-wlOMZIUd.mjs} +17 -17
  115. package/.output/server/_ssr/{TargetDisplay-C-C8MKuf.mjs → TargetDisplay-076I9qHx.mjs} +6 -23
  116. package/.output/server/_ssr/{alert-dialog-CiN6BFHg.mjs → alert-dialog-DrD4hAp4.mjs} +2 -2
  117. package/.output/server/_ssr/{api-BeWenjNl.mjs → api-C1plnjZg.mjs} +74 -17
  118. package/.output/server/_ssr/{api-keys-DzWwXpi5.mjs → api-keys-Bzn-P-lX.mjs} +2 -2
  119. package/.output/server/_ssr/{api-keys-Bzaj1vWD.mjs → api-keys-L8_p18pO.mjs} +12 -12
  120. package/.output/server/_ssr/{api-keys-rpc-BRnZWUpw.mjs → api-keys-rpc-Mne2yo8z.mjs} +3 -3
  121. package/.output/server/_ssr/{api-rpc-B87QoJwB.mjs → api-rpc-ChVBmeca.mjs} +56 -33
  122. package/.output/server/_ssr/{auth-rpc-CO1_TL1b.mjs → auth-rpc-Dml8l_eq.mjs} +4 -4
  123. package/.output/server/_ssr/{auth.server-BWTHsAlW.mjs → auth.server-DOShgraQ.mjs} +587 -19
  124. package/.output/server/_ssr/{badge-C7PdVtoH.mjs → badge-BasQflNy.mjs} +2 -2
  125. package/.output/server/_ssr/{bundleActivity-BGVvqWx7.mjs → bundleActivity-BP40zYSt.mjs} +1 -1
  126. package/.output/server/_ssr/{card-BkxhOkGp.mjs → card-BrGGQYC0.mjs} +2 -2
  127. package/.output/server/_ssr/{config.server-Bvqyj9Ec.mjs → config.server-CVOdMDBk.mjs} +4 -4
  128. package/.output/server/_ssr/{console-access-CHD7-b3E.mjs → console-access-Bi-abtY-.mjs} +2 -2
  129. package/.output/server/_ssr/{console-features-api-Btkz_ZEj.mjs → console-features-api-Bjxo5ur3.mjs} +5 -5
  130. package/.output/server/_ssr/{console-features-rpc-DYf3xbak.mjs → console-features-rpc-xzdodg3g.mjs} +3 -3
  131. package/.output/server/_ssr/{console-features-CRP-pfov.mjs → console-features-xaGDhRC9.mjs} +1 -1
  132. package/.output/server/_ssr/deviceProfileToken-CwWb1lPq.mjs +82 -0
  133. package/.output/server/_ssr/{dialog-fnm03nlH.mjs → dialog-7iMkt9l0.mjs} +2 -2
  134. package/.output/server/_ssr/{downloadBundle-BX8ODCZT.mjs → downloadBundle-DnoYpi36.mjs} +1 -1
  135. package/.output/server/_ssr/{empty-BzjaWjuQ.mjs → empty-Chb-YL3R.mjs} +3 -3
  136. package/.output/server/_ssr/{failureReports-C_CmBF4x.mjs → failureReports-BA2eg11O.mjs} +3 -3
  137. package/.output/server/_ssr/{field-C2GZCygB.mjs → field-mL_Aa6ff.mjs} +3 -3
  138. package/.output/server/_ssr/foldedPage-CqpVk31Q.mjs +176 -0
  139. package/.output/server/_ssr/{getBundleChildren-BJTufthT.mjs → getBundleChildren-CdqFonhl.mjs} +1 -1
  140. package/.output/server/_ssr/{input-group-Cu6TtdYb.mjs → input-group-C00_xYka.mjs} +2 -2
  141. package/.output/server/_ssr/{insights-DuQB3_VX.mjs → insights-BcVNQCXf.mjs} +28 -28
  142. package/.output/server/_ssr/{insights-DZZsKfdZ.mjs → insights-BdF3o0Yp.mjs} +2 -2
  143. package/.output/server/_ssr/{insights-D_XXiwXz.mjs → insights-C9sSQPMF.mjs} +5 -5
  144. package/.output/server/_ssr/{insights-api-a8B90BHl.mjs → insights-api-CShlv9dA.mjs} +5 -5
  145. package/.output/server/_ssr/{insights-errors-Bz3sWNZm.mjs → insights-errors-CXHg1lLV.mjs} +2 -2
  146. package/.output/server/_ssr/{insights-failures-DNQ9qVVf.mjs → insights-failures-7zH97WOO.mjs} +2 -2
  147. package/.output/server/_ssr/{insights-failures-rpc-DM5dPfnS.mjs → insights-failures-rpc-C-cv9bId.mjs} +10 -10
  148. package/.output/server/_ssr/{insights-recovery-DOkpqnQ8.mjs → insights-recovery-BhOg6kz2.mjs} +1 -1
  149. package/.output/server/_ssr/{insights-recovery-rpc-C81f-2Xa.mjs → insights-recovery-rpc-Ct-jIQZU.mjs} +6 -6
  150. package/.output/server/_ssr/{insights-rpc-DVbg0dsI.mjs → insights-rpc-Dc0I8O3n.mjs} +3 -3
  151. package/.output/server/_ssr/{insights-search-sCdCd-8P.mjs → insights-search-D_vVwBwW.mjs} +3 -3
  152. package/.output/server/_ssr/{insights-usage-4KDIN3Kg.mjs → insights-usage-h8fipPTv.mjs} +1 -1
  153. package/.output/server/_ssr/{insights-usage-rpc-CKfXb-tc.mjs → insights-usage-rpc-4TR94EHa.mjs} +6 -6
  154. package/.output/server/_ssr/{insights-usage-rpc-DAwc4FE6.mjs → insights-usage-rpc-D60hOhzl.mjs} +5 -5
  155. package/.output/server/_ssr/{insightsUsage-DmQdJZqT.mjs → insightsUsage-BjSiV_X_.mjs} +3 -3
  156. package/.output/server/_ssr/{insights_.distribution-FhZMnsNm.mjs → insights_.distribution-BgnfMzw1.mjs} +17 -17
  157. package/.output/server/_ssr/{insights_.distribution-CvPrNh8j.mjs → insights_.distribution-DkD7uAwA.mjs} +5 -5
  158. package/.output/server/_ssr/{insights_.distribution-Bq52kUtA.mjs → insights_.distribution-wT1mjWsG.mjs} +2 -2
  159. package/.output/server/_ssr/{installations-BjOaol_w.mjs → installations-DtRbzy3N.mjs} +2 -2
  160. package/.output/server/_ssr/{installations-CKe2Srtx.mjs → installations-DvxMRP5u.mjs} +4 -4
  161. package/.output/server/_ssr/{installations-B2anrEwv.mjs → installations-tFsFnxKk.mjs} +13 -13
  162. package/.output/server/_ssr/ios-devices-rpc-CIPuCUQ8.mjs +139 -0
  163. package/.output/server/_ssr/iosDeviceProfile-WyMC1593.mjs +176 -0
  164. package/.output/server/_ssr/iosDevices-B0TjF_sb.mjs +129 -0
  165. package/.output/server/_ssr/listReleases-DYYA5alS.mjs +94 -0
  166. package/.output/server/_ssr/{native-builds-OUdRtp6m.mjs → native-builds-BXBkklfA.mjs} +28 -6
  167. package/.output/server/_ssr/{native-builds-DSOAh1CX.mjs → native-builds-C458T7Ts.mjs} +3 -3
  168. package/.output/server/_ssr/{native-builds-BsfydODe.mjs → native-builds-C5WxR0BT.mjs} +235 -90
  169. package/.output/server/_ssr/{native-builds_._buildId-BOedzqOS.mjs → native-builds_._buildId-CyCGKZ1H.mjs} +165 -323
  170. package/.output/server/_ssr/{native-builds_._buildId-DSfes24H.mjs → native-builds_._buildId-UsgsqKI8.mjs} +3 -3
  171. package/.output/server/_ssr/native-builds_.devices-BcfLIzJs.mjs +10 -0
  172. package/.output/server/_ssr/native-builds_.devices-BpTcIWm0.mjs +689 -0
  173. package/.output/server/_ssr/{nativeBuildDownloadLink-D-yCU-H7.mjs → nativeBuildDownloadLink-CtB2G7qG.mjs} +3 -3
  174. package/.output/server/_ssr/{nativeBuildInstall-szlEt-t_.mjs → nativeBuildInstall-PavEyZtZ.mjs} +56 -8
  175. package/.output/server/_ssr/{nativeBuilds-CRLmvFaO.mjs → nativeBuilds-Cub0EUGN.mjs} +135 -13
  176. package/.output/server/_ssr/{publicConsoleBase-DvHYxDaG.mjs → publicConsoleBase-f67NLLXZ.mjs} +11 -3
  177. package/.output/server/_ssr/{release-adoption-C7sUFDwa.mjs → release-adoption-DeICczY7.mjs} +2 -2
  178. package/.output/server/_ssr/{release-adoption-rpc-DHqnRw73.mjs → release-adoption-rpc-DkT6ui4_.mjs} +8 -8
  179. package/.output/server/_ssr/{releaseAdoption-D6ScSu-W.mjs → releaseAdoption-kHZo8P90.mjs} +3 -3
  180. package/.output/server/_ssr/{remote-config-D2wHSNjm.mjs → remote-config-BKlK0dFP.mjs} +3 -3
  181. package/.output/server/_ssr/{remote-config-Byc4JHkB.mjs → remote-config-D_nQT__6.mjs} +2 -2
  182. package/.output/server/_ssr/{remote-config-rpc-ZOfBMLtE.mjs → remote-config-rpc-BW6lyp9Y.mjs} +3 -3
  183. package/.output/server/_ssr/{remote-config-DkrjdfMC.mjs → remote-config-v1hs050H.mjs} +24 -24
  184. package/.output/server/_ssr/{router-D0GDdWkI.mjs → router-hKO__Vrv.mjs} +74 -77
  185. package/.output/server/_ssr/{routes-C10oCddR.mjs → routes-DKxm5A7X.mjs} +312 -233
  186. package/.output/server/_ssr/{routes-ChnyY2qP.mjs → routes-OhljAvlx.mjs} +15 -14
  187. package/.output/server/_ssr/{runtime.server-wcHT2Cop.mjs → runtime.server-CkSbWaZm.mjs} +2 -2
  188. package/.output/server/_ssr/{schema-migration-rpc-BKRs4MNf.mjs → schema-migration-rpc-DrrYEFqy.mjs} +3 -3
  189. package/.output/server/_ssr/{select-B9du7Z50.mjs → select-M4kWGKJW.mjs} +3 -3
  190. package/.output/server/_ssr/{server-CApi3lVS.mjs → server-4hXySEh0.mjs} +5 -5
  191. package/.output/server/_ssr/{sidebar-BwMkm72O.mjs → sidebar-CFlo6lny.mjs} +3 -3
  192. package/.output/server/_ssr/ssr.mjs +1 -1
  193. package/.output/server/_ssr/{start-By4wHYjG.mjs → start-D3noqqOK.mjs} +1 -1
  194. package/.output/server/_ssr/{switch-DyShvUOF.mjs → switch-xTCGSBdC.mjs} +3 -3
  195. package/.output/server/_ssr/{table-DMj6AnqH.mjs → table-CqdaVMjd.mjs} +2 -2
  196. package/.output/server/_ssr/{tabs-5a_JPYme.mjs → tabs-DtMAFr25.mjs} +4 -4
  197. package/.output/server/_ssr/{updateFailures-DNiv3S_y.mjs → updateFailures-D0bP_Ume.mjs} +3 -3
  198. package/.output/server/_tanstack-start-manifest_v-CYfHRC4i.mjs +225 -0
  199. package/.output/server/index.mjs +452 -375
  200. package/lib/index.d.mts +9 -0
  201. package/package.json +7 -7
  202. package/src/components/DataTable.tsx +47 -3
  203. package/src/components/FoldedRows.tsx +219 -0
  204. package/src/components/RowReason.tsx +56 -0
  205. package/src/components/features/api-keys/ApiKeysPage.tsx +1 -1
  206. package/src/components/features/channels/ChannelManagementDialog.tsx +2 -2
  207. package/src/components/features/native-builds/CommitLink.tsx +2 -1
  208. package/src/components/features/native-builds/InstallCard.tsx +77 -40
  209. package/src/components/features/native-builds/IosDevicesPage.tsx +925 -0
  210. package/src/components/features/native-builds/IosInstall.tsx +375 -73
  211. package/src/components/features/native-builds/IpaDevicesCard.tsx +111 -0
  212. package/src/components/features/native-builds/NativeBuildDetailPage.tsx +7 -0
  213. package/src/components/features/native-builds/NativeBuildsNav.tsx +44 -0
  214. package/src/components/features/native-builds/NativeBuildsPage.tsx +2 -0
  215. package/src/components/features/native-builds/NativeBuildsTable.tsx +220 -32
  216. package/src/components/features/native-builds/OlderBuildLabel.tsx +61 -0
  217. package/src/components/features/native-builds/ShortHash.tsx +5 -2
  218. package/src/components/features/remote-config/PublishDialog.tsx +4 -1
  219. package/src/components/features/remote-config/VersionsCard.tsx +5 -2
  220. package/src/components/ui/sonner.tsx +3 -1
  221. package/src/index.ts +9 -0
  222. package/src/lib/api-rpc.ts +70 -30
  223. package/src/lib/api.ts +65 -2
  224. package/src/lib/ios-devices-api.ts +110 -0
  225. package/src/lib/ios-devices-rpc.ts +183 -0
  226. package/src/lib/native-builds.ts +72 -7
  227. package/src/lib/server/console-runtime.server.ts +9 -2
  228. package/src/lib/server/deviceProfileToken.ts +187 -0
  229. package/src/lib/server/foldedPage.ts +360 -0
  230. package/src/lib/server/iosDeviceProfile.ts +230 -0
  231. package/src/lib/server/iosDevices.ts +223 -0
  232. package/src/lib/server/listReleases.ts +101 -62
  233. package/src/lib/server/nativeBuildInstall.ts +147 -7
  234. package/src/lib/server/nativeBuilds.ts +221 -26
  235. package/src/routeTree.gen.ts +64 -67
  236. package/src/routes/-native-builds-search.ts +20 -0
  237. package/src/routes/[_]hot-updater/devices/device-response.ts +21 -0
  238. package/src/routes/[_]hot-updater/devices/device[.]mobileconfig.ts +17 -0
  239. package/src/routes/index.tsx +447 -299
  240. package/src/routes/native-builds_.devices.tsx +21 -0
  241. package/src/styles.css +2 -2
  242. package/.output/public/assets/BundleIdDisplay-CP6rsdFO.js +0 -1
  243. package/.output/public/assets/EventDetails-DZsRlDHk.js +0 -1
  244. package/.output/public/assets/HashValueDisplay-MoZMmTeP.js +0 -1
  245. package/.output/public/assets/RelativeTime-TCmpOVPg.js +0 -1
  246. package/.output/public/assets/StoreSubmission-CqSg880n.js +0 -1
  247. package/.output/public/assets/TargetDisplay-DwOaMOiI.js +0 -1
  248. package/.output/public/assets/api-LQJH44FU.js +0 -1
  249. package/.output/public/assets/api-keys-4w2-ofii.js +0 -1
  250. package/.output/public/assets/api-keys-uFY8FsN9.js +0 -1
  251. package/.output/public/assets/arrow-left-g9cKqXuC.js +0 -1
  252. package/.output/public/assets/arrow-right-CNII8TYn.js +0 -1
  253. package/.output/public/assets/arrow-up-right-DK8Zdg40.js +0 -1
  254. package/.output/public/assets/card-ulgg5xHn.js +0 -1
  255. package/.output/public/assets/check-CXVR3s3X.js +0 -1
  256. package/.output/public/assets/chevron-right-BoUXo82O.js +0 -1
  257. package/.output/public/assets/dialog-CLIaC82_.js +0 -1
  258. package/.output/public/assets/empty-Bhlj8PEo.js +0 -1
  259. package/.output/public/assets/field-q4sTYzNU.js +0 -1
  260. package/.output/public/assets/history-DakJoeSM.js +0 -1
  261. package/.output/public/assets/index-CJclLsbG.js +0 -10
  262. package/.output/public/assets/insights-0TUItqwh.js +0 -1
  263. package/.output/public/assets/insights-B75txQ_F.js +0 -42
  264. package/.output/public/assets/insights-C17Z0whn.js +0 -2
  265. package/.output/public/assets/insights-api-BVCXJsoV.js +0 -1
  266. package/.output/public/assets/insights-usage-rpc-BbFllvi_.js +0 -1
  267. package/.output/public/assets/insights_.distribution-AZcfvK7x.js +0 -1
  268. package/.output/public/assets/insights_.distribution-gDqNqI5E.js +0 -2
  269. package/.output/public/assets/installations-Ap2G2tDs.js +0 -1
  270. package/.output/public/assets/installations-D0g3xvw8.js +0 -2
  271. package/.output/public/assets/installations-Y_7QW_p8.js +0 -1
  272. package/.output/public/assets/native-builds-Ba6cEZfm.js +0 -2
  273. package/.output/public/assets/native-builds-C3_-21we.js +0 -1
  274. package/.output/public/assets/native-builds_._buildId-BnP31v32.js +0 -1
  275. package/.output/public/assets/native-builds_._buildId-Cp9LJiMP.js +0 -2
  276. package/.output/public/assets/plus-BVhOauU3.js +0 -1
  277. package/.output/public/assets/preload-helper-B44EvKhG.js +0 -1
  278. package/.output/public/assets/remote-config-BRdy8QFR.js +0 -1
  279. package/.output/public/assets/remote-config-C9p5Pcdj.js +0 -6
  280. package/.output/public/assets/remote-config-CIAEArwq.js +0 -1
  281. package/.output/public/assets/routes-BLTF7nwe.js +0 -1
  282. package/.output/public/assets/search-nnvSOTEB.js +0 -1
  283. package/.output/public/assets/select-CBIU0_M1.js +0 -1
  284. package/.output/public/assets/smartphone-r0rRdPas.js +0 -1
  285. package/.output/public/assets/styles-BdlrKlVs.css +0 -2
  286. package/.output/public/assets/switch-CP6GsHmN.js +0 -1
  287. package/.output/public/assets/table-TUtVz-2l.js +0 -1
  288. package/.output/public/assets/tabs-CP3CSmtI.js +0 -1
  289. package/.output/public/assets/useInfiniteQuery-DX4WpBRG.js +0 -1
  290. package/.output/server/_ssr/listReleases-CQEceg8j.mjs +0 -79
  291. package/.output/server/_ssr/nativeBuildDevice-DJUAzAIj.mjs +0 -210
  292. package/.output/server/_tanstack-start-manifest_v-8M7ggCuB.mjs +0 -192
  293. package/src/lib/server/nativeBuildDevice.ts +0 -253
  294. package/src/routes/[_]hot-updater/native-builds/$buildId/device-response.ts +0 -17
  295. package/src/routes/[_]hot-updater/native-builds/$buildId/device.ts +0 -17
  296. package/src/routes/[_]hot-updater/native-builds/$buildId/device[.]mobileconfig.ts +0 -17
  297. /package/.output/public/assets/{uuidv7-cI6C63Fm.js → uuidv7-DAoOOpz9.js} +0 -0
  298. /package/.output/public/assets/{valueToPercent-B6X9rUJM.js → valueToPercent-Bn8p2lng.js} +0 -0
@@ -9,11 +9,13 @@ import { assertCanonicalChannelName } from "@hot-updater/protocol";
9
9
  import { createServerFn } from "@tanstack/react-start";
10
10
 
11
11
  import { consoleAccess } from "./console-access";
12
- import { DEFAULT_PAGE_LIMIT } from "./constants";
13
12
  import { channelIdOf, releaseNativeBuildScope } from "./native-builds";
14
13
  import { withPublicBundleMutationErrors } from "./public-bundle-error";
15
- import { listReleases, readReleaseFilter } from "./server/listReleases";
16
- import { addReleaseReachability } from "./server/releaseReachability";
14
+ import {
15
+ listReleaseFolds,
16
+ readReleaseFilter,
17
+ readReleaseFold,
18
+ } from "./server/listReleases";
17
19
 
18
20
  type GetBundleInput = {
19
21
  bundleId: string;
@@ -34,7 +36,28 @@ type GetReleasesInput = {
34
36
  beforeReleaseId?: string;
35
37
  /** Releases newer than this id: the previous page. */
36
38
  afterReleaseId?: string;
37
- limit?: number;
39
+ /** The selected release, which never folds. */
40
+ releaseId?: string;
41
+ };
42
+
43
+ /** A fold of a list's page, as the page gave it, and where its last chunk ended. */
44
+ type FoldInput = { from?: string; to: string; after?: string };
45
+
46
+ /** The bounds of a fold, checked: IDs as text. */
47
+ const readFoldInput = (input: FoldInput) => {
48
+ const text = (value: unknown) => typeof value === "string" && value !== "";
49
+ if (
50
+ !text(input.to) ||
51
+ (input.from !== undefined && !text(input.from)) ||
52
+ (input.after !== undefined && !text(input.after))
53
+ ) {
54
+ throw new Error("A fold is its to, and optionally from and after.");
55
+ }
56
+ return {
57
+ to: input.to,
58
+ ...(input.from === undefined ? {} : { from: input.from }),
59
+ ...(input.after === undefined ? {} : { after: input.after }),
60
+ };
38
61
  };
39
62
 
40
63
  type ReleaseMutationInput = {
@@ -48,16 +71,6 @@ type DeleteReleaseInput = {
48
71
  releaseId: string;
49
72
  };
50
73
 
51
- const MAX_PAGE_LIMIT = 100;
52
-
53
- const pageLimit = (limit: number | undefined) => {
54
- const value = limit ?? DEFAULT_PAGE_LIMIT;
55
- if (!Number.isSafeInteger(value) || value < 1 || value > MAX_PAGE_LIMIT) {
56
- throw new Error(`limit must be between 1 and ${MAX_PAGE_LIMIT}.`);
57
- }
58
- return value;
59
- };
60
-
61
74
  const prepare = async () => {
62
75
  const { prepareConfig } = await import("./server/config.server");
63
76
  return prepareConfig();
@@ -73,16 +86,18 @@ export const getReleases = createServerFn({ method: "GET" })
73
86
  ...(input?.beforeReleaseId === undefined
74
87
  ? {}
75
88
  : { beforeReleaseId: input.beforeReleaseId }),
76
- limit: pageLimit(input?.limit),
89
+ ...(input?.releaseId === undefined ? {} : { releaseId: input.releaseId }),
77
90
  }))
78
- .handler(async ({ data }) => {
79
- const { core } = await prepare();
80
- const result = await listReleases(core, data);
81
- return {
82
- ...result,
83
- data: await addReleaseReachability(core, result.data),
84
- };
85
- });
91
+ .handler(async ({ data }) => listReleaseFolds((await prepare()).core, data));
92
+
93
+ /** One chunk of a release page's fold. */
94
+ export const getReleaseFold = createServerFn({ method: "GET" })
95
+ .middleware([consoleAccess])
96
+ .validator((input: FoldInput & { filter?: ReleaseFilter }) => ({
97
+ filter: readReleaseFilter(input.filter),
98
+ ...readFoldInput(input),
99
+ }))
100
+ .handler(async ({ data }) => readReleaseFold((await prepare()).core, data));
86
101
 
87
102
  export const getRelease = createServerFn({ method: "GET" })
88
103
  .middleware([consoleAccess])
@@ -257,22 +272,34 @@ export const getNativeBuilds = createServerFn({ method: "GET" })
257
272
  .middleware([consoleAccess])
258
273
  .validator(
259
274
  (
260
- input:
261
- | { before?: string; after?: string; channel?: string; limit?: number }
262
- | undefined,
275
+ input: { before?: string; after?: string; channel?: string } | undefined,
263
276
  ) => ({
264
277
  ...(input?.before === undefined ? {} : { before: input.before }),
265
278
  ...(input?.after === undefined ? {} : { after: input.after }),
266
279
  ...channelIdFilter(input?.channel),
267
- limit: pageLimit(input?.limit),
268
280
  }),
269
281
  )
270
282
  .handler(async ({ data }) => {
271
- const [{ core }, { listNativeBuilds }] = await Promise.all([
283
+ const [{ core }, { listNativeBuildFolds }] = await Promise.all([
272
284
  prepare(),
273
285
  import("./server/nativeBuilds"),
274
286
  ]);
275
- return listNativeBuilds(core, data);
287
+ return listNativeBuildFolds(core, data);
288
+ });
289
+
290
+ /** One chunk of a native build page's fold. */
291
+ export const getNativeBuildFold = createServerFn({ method: "GET" })
292
+ .middleware([consoleAccess])
293
+ .validator((input: FoldInput & { channel?: string }) => ({
294
+ ...channelIdFilter(input.channel),
295
+ ...readFoldInput(input),
296
+ }))
297
+ .handler(async ({ data }) => {
298
+ const [{ core }, { readNativeBuildFold }] = await Promise.all([
299
+ prepare(),
300
+ import("./server/nativeBuilds"),
301
+ ]);
302
+ return readNativeBuildFold(core, data);
276
303
  });
277
304
 
278
305
  /** A native build's page: the build, its built-in bundle, what it is served, and its patches. */
@@ -387,5 +414,18 @@ export const getNativeBuildInstallEligibility = createServerFn({
387
414
  prepare(),
388
415
  import("./server/nativeBuildInstall"),
389
416
  ]);
390
- return checkNativeBuildInstall(data.id, data.udid, deps);
417
+ return checkNativeBuildInstall(data.id, data.udid, deps, {
418
+ // Under Apple's refusal only: an approver gets the iOS devices page.
419
+ canApprove: async () => {
420
+ const [{ getRequest }, { requireConsoleAccess }, { iosDeviceViewer }] =
421
+ await Promise.all([
422
+ import("@tanstack/react-start/server"),
423
+ import("./server/auth.server"),
424
+ import("./server/iosDevices"),
425
+ ]);
426
+ const principal = await requireConsoleAccess(getRequest());
427
+ return (await iosDeviceViewer(principal, deps.config.deviceApprovers))
428
+ .canApprove;
429
+ },
430
+ });
391
431
  });
package/src/lib/api.ts CHANGED
@@ -2,7 +2,12 @@ import type {
2
2
  ReleaseFilter,
3
3
  ReleasePolicyPatch,
4
4
  } from "@hot-updater/plugin-core";
5
- import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
5
+ import {
6
+ useInfiniteQuery,
7
+ useMutation,
8
+ useQuery,
9
+ useQueryClient,
10
+ } from "@tanstack/react-query";
6
11
 
7
12
  import {
8
13
  createChannel as createChannelApi,
@@ -14,6 +19,7 @@ import {
14
19
  getChannels,
15
20
  getConfig,
16
21
  getNativeBuildDetail,
22
+ getNativeBuildFold,
17
23
  markNativeBuild as markNativeBuildApi,
18
24
  createNativeBuildDownloadLink,
19
25
  getNativeBuildDownloadUrl,
@@ -23,6 +29,7 @@ import {
23
29
  getRelease,
24
30
  getReleaseCatalogDiagnostics,
25
31
  getReleaseNativeBuild,
32
+ getReleaseFold,
26
33
  getReleases,
27
34
  preflightRelease as preflightReleaseApi,
28
35
  promoteRelease as promoteReleaseApi,
@@ -38,6 +45,8 @@ export const queryKeys = {
38
45
  all: releaseListQueryKey,
39
46
  list: (filters?: ReleaseFilters) =>
40
47
  [...releaseListQueryKey, filters ?? {}] as const,
48
+ fold: (filter: ReleaseFilter | undefined, fold: FoldBounds) =>
49
+ [...releaseListQueryKey, "fold", filter ?? {}, fold] as const,
41
50
  },
42
51
  release: (releaseId: string) => ["release", releaseId] as const,
43
52
  releaseCatalog: (scopeKey: string) => ["release-catalog", scopeKey] as const,
@@ -51,6 +60,8 @@ export const queryKeys = {
51
60
  nativeBuilds: {
52
61
  all: ["native-builds"] as const,
53
62
  list: (page: NativeBuildPage) => ["native-builds", page] as const,
63
+ fold: (channel: string | undefined, fold: FoldBounds) =>
64
+ ["native-builds", "fold", channel ?? null, fold] as const,
54
65
  },
55
66
  nativeBuild: (id: string) => ["native-build", id] as const,
56
67
  nativeBuildPatches: (minBundleId: string, page: KeysetPage) =>
@@ -104,6 +115,9 @@ const DOWNLOAD_LINK_STALE_MS = 24 * 60 * 60 * 1000;
104
115
  */
105
116
  const INSTALL_ELIGIBILITY_STALE_MS = 30 * 60 * 1000;
106
117
 
118
+ /** Where a fold of a list's page lies: its bounds, as the page gave them. */
119
+ export type FoldBounds = { readonly from?: string; readonly to: string };
120
+
107
121
  export type ReleaseFilters = {
108
122
  /** One of the filter sets the release indexes serve; none lists every release. */
109
123
  filter?: ReleaseFilter;
@@ -111,7 +125,8 @@ export type ReleaseFilters = {
111
125
  beforeReleaseId?: string;
112
126
  /** Releases newer than this id: the previous page. */
113
127
  afterReleaseId?: string;
114
- limit?: number;
128
+ /** The selected release, which the page never folds. */
129
+ releaseId?: string;
115
130
  };
116
131
 
117
132
  // Query Hooks
@@ -139,6 +154,31 @@ export function useReleasesQuery(filters?: ReleaseFilters) {
139
154
  });
140
155
  }
141
156
 
157
+ /**
158
+ * A fold's releases, a chunk at a time, read once it opens: the page that
159
+ * folded them reads nothing more when one opens.
160
+ */
161
+ export function useReleaseFoldQuery(
162
+ filter: ReleaseFilter | undefined,
163
+ fold: FoldBounds,
164
+ enabled: boolean,
165
+ ) {
166
+ return useInfiniteQuery({
167
+ queryKey: queryKeys.releases.fold(filter, fold),
168
+ queryFn: ({ pageParam }) =>
169
+ getReleaseFold({
170
+ data: {
171
+ ...fold,
172
+ ...(filter === undefined ? {} : { filter }),
173
+ ...(pageParam === undefined ? {} : { after: pageParam }),
174
+ },
175
+ }),
176
+ initialPageParam: undefined as string | undefined,
177
+ getNextPageParam: (last) => last.next,
178
+ enabled,
179
+ });
180
+ }
181
+
142
182
  export function useReleaseQuery(releaseId: string) {
143
183
  return useQuery({
144
184
  enabled: releaseId.length > 0,
@@ -187,6 +227,29 @@ export function useBundleChildCountsQuery(bundleIds: string[]) {
187
227
  });
188
228
  }
189
229
 
230
+ /** A fold's native builds, a chunk at a time, read once it opens. */
231
+ export function useNativeBuildFoldQuery(
232
+ channel: string | undefined,
233
+ fold: FoldBounds,
234
+ enabled: boolean,
235
+ ) {
236
+ return useInfiniteQuery({
237
+ queryKey: queryKeys.nativeBuilds.fold(channel, fold),
238
+ queryFn: ({ pageParam }) =>
239
+ getNativeBuildFold({
240
+ data: {
241
+ ...fold,
242
+ ...(channel === undefined ? {} : { channel }),
243
+ ...(pageParam === undefined ? {} : { after: pageParam }),
244
+ },
245
+ }),
246
+ initialPageParam: undefined as string | undefined,
247
+ getNextPageParam: (last) => last.next,
248
+ enabled,
249
+ staleTime: 60_000,
250
+ });
251
+ }
252
+
190
253
  /** One page of native builds, newest first, kept on screen while the next loads. */
191
254
  export function useNativeBuildsQuery(page: NativeBuildPage) {
192
255
  return useQuery({
@@ -0,0 +1,110 @@
1
+ import type { IosDeviceStatus } from "@hot-updater/plugin-core";
2
+ import {
3
+ keepPreviousData,
4
+ useMutation,
5
+ useQuery,
6
+ useQueryClient,
7
+ } from "@tanstack/react-query";
8
+
9
+ import {
10
+ approveIosDevice,
11
+ createIosDeviceProfileLink,
12
+ getIosDevices,
13
+ getNativeBuildIpaDevices,
14
+ removeIosDevice,
15
+ renameIosDevice,
16
+ requestIosDeviceAccess,
17
+ } from "./ios-devices-rpc";
18
+
19
+ export const iosDeviceKeys = {
20
+ all: ["ios-devices"] as const,
21
+ list: (status?: IosDeviceStatus) => ["ios-devices", status ?? "all"] as const,
22
+ ipa: (buildId: string) => ["native-build-ipa-devices", buildId] as const,
23
+ };
24
+
25
+ /**
26
+ * How long a profile link is used before the page signs a new one: its
27
+ * capability works 15 minutes, and a tester may leave the page open.
28
+ */
29
+ export const PROFILE_LINK_REFRESH_MS = 10 * 60 * 1000;
30
+
31
+ /**
32
+ * The registry, one status or all, kept on screen while it reloads, so a
33
+ * filter change never blanks the table.
34
+ */
35
+ export function useIosDevicesQuery(status?: IosDeviceStatus) {
36
+ return useQuery({
37
+ queryKey: iosDeviceKeys.list(status),
38
+ queryFn: () =>
39
+ getIosDevices({ data: status === undefined ? {} : { status } }),
40
+ placeholderData: keepPreviousData,
41
+ });
42
+ }
43
+
44
+ /**
45
+ * A signed link to this iPhone's profile, signed again before it expires:
46
+ * the link stays a plain `<a href>`, so nothing waits on a request when it is
47
+ * tapped. The token signs its input, the name to register or the build to
48
+ * return to, so it has no data while another input's token loads: keeping
49
+ * the previous one would register the old name.
50
+ */
51
+ export function useIosDeviceProfileLinkQuery(
52
+ input:
53
+ | { readonly mode: "register"; readonly name: string }
54
+ | { readonly mode: "identify"; readonly buildId: string },
55
+ enabled = true,
56
+ ) {
57
+ return useQuery({
58
+ queryKey: ["ios-device-profile-link", input] as const,
59
+ queryFn: () => createIosDeviceProfileLink({ data: input }),
60
+ enabled,
61
+ staleTime: PROFILE_LINK_REFRESH_MS,
62
+ refetchInterval: PROFILE_LINK_REFRESH_MS,
63
+ });
64
+ }
65
+
66
+ /** The devices an IPA lists, by registry name where it has one. */
67
+ export function useNativeBuildIpaDevicesQuery(buildId: string) {
68
+ return useQuery({
69
+ queryKey: iosDeviceKeys.ipa(buildId),
70
+ queryFn: () => getNativeBuildIpaDevices({ data: { id: buildId } }),
71
+ });
72
+ }
73
+
74
+ const useInvalidatingMutation = <TInput, TResult>(
75
+ mutationFn: (input: TInput) => Promise<TResult>,
76
+ ) => {
77
+ const queryClient = useQueryClient();
78
+ return useMutation({
79
+ mutationFn,
80
+ onSettled: async () => {
81
+ await Promise.all([
82
+ queryClient.invalidateQueries({ queryKey: iosDeviceKeys.all }),
83
+ // A build page reads the registry row of a device it lacks.
84
+ queryClient.invalidateQueries({
85
+ queryKey: ["native-build-install-eligibility"],
86
+ }),
87
+ ]);
88
+ },
89
+ });
90
+ };
91
+
92
+ export const useApproveIosDeviceMutation = () =>
93
+ useInvalidatingMutation((input: { id: string; name: string }) =>
94
+ approveIosDevice({ data: input }),
95
+ );
96
+
97
+ export const useRenameIosDeviceMutation = () =>
98
+ useInvalidatingMutation((input: { id: string; name: string }) =>
99
+ renameIosDevice({ data: input }),
100
+ );
101
+
102
+ export const useRemoveIosDeviceMutation = () =>
103
+ useInvalidatingMutation((input: { udid: string }) =>
104
+ removeIosDevice({ data: input }),
105
+ );
106
+
107
+ export const useRequestIosDeviceAccessMutation = () =>
108
+ useInvalidatingMutation((input: { receipt: string; name: string }) =>
109
+ requestIosDeviceAccess({ data: input }),
110
+ );
@@ -0,0 +1,183 @@
1
+ import type { IosDeviceRow, IosDeviceStatus } from "@hot-updater/plugin-core";
2
+ import { createServerFn } from "@tanstack/react-start";
3
+
4
+ import { consoleAccess } from "./console-access";
5
+
6
+ const STATUSES: readonly IosDeviceStatus[] = [
7
+ "pending",
8
+ "approved",
9
+ "registered",
10
+ ];
11
+
12
+ const record = (input: unknown): Record<string, unknown> => {
13
+ if (typeof input !== "object" || input === null) {
14
+ throw new TypeError("Invalid input.");
15
+ }
16
+ return input as Record<string, unknown>;
17
+ };
18
+
19
+ const text = (input: unknown, field: string, max = 2048): string => {
20
+ const value = record(input)[field];
21
+ if (typeof value !== "string" || value.length === 0 || value.length > max) {
22
+ throw new TypeError(`Invalid ${field}.`);
23
+ }
24
+ return value;
25
+ };
26
+
27
+ /**
28
+ * The registry over the Console's own assembly, with the signed-in viewer's
29
+ * rights: the access check runs first, in the middleware and again here.
30
+ */
31
+ const registry = async () => {
32
+ const [{ getRequest }, { prepareConfig }, { requireConsoleAccess }, devices] =
33
+ await Promise.all([
34
+ import("@tanstack/react-start/server"),
35
+ import("./server/config.server"),
36
+ import("./server/auth.server"),
37
+ import("./server/iosDevices"),
38
+ ]);
39
+ const request = getRequest();
40
+ const [{ core, config }, principal] = await Promise.all([
41
+ prepareConfig(request),
42
+ requireConsoleAccess(request),
43
+ ]);
44
+ const viewer = await devices.iosDeviceViewer(
45
+ principal,
46
+ config.deviceApprovers,
47
+ );
48
+ return { request, core, principal, viewer, devices };
49
+ };
50
+
51
+ export interface IosDevicesView {
52
+ readonly devices: IosDeviceRow[];
53
+ readonly viewer: {
54
+ readonly email: string;
55
+ readonly canApprove: boolean;
56
+ readonly approversConfigured: boolean;
57
+ };
58
+ /** The name a new iPhone gets until its owner types one. */
59
+ readonly defaultName: string;
60
+ /** Whether iPhones can register through this Console. */
61
+ readonly registration: "ready" | "local-console" | "no-secret";
62
+ /** The secret that signs iPhone links, which `no-secret` asks to set. */
63
+ readonly secretName: string;
64
+ }
65
+
66
+ /** The registry, or one status of it, with what the viewer may do. */
67
+ export const getIosDevices = createServerFn({ method: "GET" })
68
+ .middleware([consoleAccess])
69
+ .validator((input: { status?: IosDeviceStatus } | undefined) => {
70
+ const status = input?.status;
71
+ if (status !== undefined && !STATUSES.includes(status)) {
72
+ throw new TypeError("Invalid status.");
73
+ }
74
+ return status === undefined ? {} : { status };
75
+ })
76
+ .handler(async ({ data }): Promise<IosDevicesView> => {
77
+ const [
78
+ { request, core, principal, viewer, devices },
79
+ { CONSOLE_SECRET_ENV },
80
+ ] = await Promise.all([
81
+ registry(),
82
+ import("./server/nativeBuildDownloadLink"),
83
+ ]);
84
+ return {
85
+ devices: await devices.listIosDevices(core, data.status),
86
+ viewer,
87
+ defaultName: devices.defaultDeviceName(principal),
88
+ registration: await devices.deviceRegistration(request),
89
+ secretName: CONSOLE_SECRET_ENV,
90
+ };
91
+ });
92
+
93
+ /**
94
+ * A new link to the profile that reads this iPhone's UDID: `register` saves
95
+ * it as requested under `name`, `identify` tells build `buildId`'s page which
96
+ * iPhone it is. A POST, since it signs the link.
97
+ */
98
+ export const createIosDeviceProfileLink = createServerFn({ method: "POST" })
99
+ .middleware([consoleAccess])
100
+ .validator((input: unknown) => {
101
+ const mode = record(input).mode;
102
+ if (mode === "register") {
103
+ return { mode, name: text(input, "name", 100) } as const;
104
+ }
105
+ if (mode === "identify") {
106
+ return { mode, buildId: text(input, "buildId", 36) } as const;
107
+ }
108
+ throw new TypeError("Invalid mode.");
109
+ })
110
+ .handler(async ({ data }) => {
111
+ const { request, viewer, devices } = await registry();
112
+ return devices.issueDeviceProfileLink(request, viewer, data);
113
+ });
114
+
115
+ /** Requests the iPhone this person's receipt names, for the next ad hoc build. */
116
+ export const requestIosDeviceAccess = createServerFn({ method: "POST" })
117
+ .middleware([consoleAccess])
118
+ .validator((input: unknown) => ({
119
+ receipt: text(input, "receipt"),
120
+ name: text(input, "name", 100),
121
+ }))
122
+ .handler(async ({ data }) => {
123
+ const { request, core, viewer, devices } = await registry();
124
+ return devices.requestIosDeviceAccess(request, core, viewer, data);
125
+ });
126
+
127
+ /** Approves a requested device, with its name: approvers only. */
128
+ export const approveIosDevice = createServerFn({ method: "POST" })
129
+ .middleware([consoleAccess])
130
+ .validator((input: unknown) => ({
131
+ id: text(input, "id", 36),
132
+ name: text(input, "name", 100),
133
+ }))
134
+ .handler(async ({ data }) => {
135
+ const { core, viewer, devices } = await registry();
136
+ devices.requireDeviceApprover(viewer);
137
+ return core.approveIosDevice(data.id, {
138
+ name: devices.deviceName(data.name),
139
+ approvedBy: viewer.email,
140
+ });
141
+ });
142
+
143
+ /** Renames a device in the registry: approvers only. */
144
+ export const renameIosDevice = createServerFn({ method: "POST" })
145
+ .middleware([consoleAccess])
146
+ .validator((input: unknown) => ({
147
+ id: text(input, "id", 36),
148
+ name: text(input, "name", 100),
149
+ }))
150
+ .handler(async ({ data }) => {
151
+ const { core, viewer, devices } = await registry();
152
+ devices.requireDeviceApprover(viewer);
153
+ return core.renameIosDevice(data.id, devices.deviceName(data.name));
154
+ });
155
+
156
+ /**
157
+ * Removes a device from the registry: an approver any, the person who asked
158
+ * their own requested one. Apple keeps it.
159
+ */
160
+ export const removeIosDevice = createServerFn({ method: "POST" })
161
+ .middleware([consoleAccess])
162
+ .validator((input: unknown) => ({ udid: text(input, "udid", 40) }))
163
+ .handler(async ({ data }) => {
164
+ const { core, viewer, devices } = await registry();
165
+ return devices.removeIosDevice(core, viewer, data.udid);
166
+ });
167
+
168
+ /**
169
+ * The devices an ad hoc build's IPA lists, read from its profile in storage,
170
+ * each with its registry name when the registry knows it: one row read, the
171
+ * IPA's few parts, and one page of the registry.
172
+ */
173
+ export const getNativeBuildIpaDevices = createServerFn({ method: "GET" })
174
+ .middleware([consoleAccess])
175
+ .validator((input: { id: string }) => ({ id: text(input, "id", 36) }))
176
+ .handler(async ({ data }) => {
177
+ const [{ prepareConfig }, { readNativeBuildIpaDevices }] =
178
+ await Promise.all([
179
+ import("./server/config.server"),
180
+ import("./server/nativeBuildInstall"),
181
+ ]);
182
+ return readNativeBuildIpaDevices(data.id, await prepareConfig());
183
+ });
@@ -23,6 +23,49 @@ export const nativeBuildArtifacts: Record<
23
23
  ipa: { label: "IPA", installs: "registered iOS devices" },
24
24
  };
25
25
 
26
+ /**
27
+ * How a native build reaches people: the store track it was submitted to,
28
+ * else its artifact, an `.ipa` by its export method when the registry has
29
+ * it. Builds of one channel, platform and sandbox flag with one
30
+ * distribution form a distribution path; a newer build on it is the one
31
+ * people get there.
32
+ */
33
+ export type NativeBuildDistribution =
34
+ | NonNullable<NativeBuildRow["submitted_to"]>
35
+ | NativeBuildArtifactKind
36
+ | `ipa-${NonNullable<NativeBuildRow["export_method"]>}`;
37
+
38
+ /** A build's distribution, from its row. */
39
+ export const nativeBuildDistribution = (
40
+ build: Pick<
41
+ NativeBuildRow,
42
+ "submitted_to" | "artifact_kind" | "export_method"
43
+ >,
44
+ ): NativeBuildDistribution =>
45
+ build.submitted_to ??
46
+ (build.artifact_kind === "ipa" && build.export_method !== null
47
+ ? `ipa-${build.export_method}`
48
+ : build.artifact_kind);
49
+
50
+ /** The distribution path a build is on, as one key. */
51
+ export const nativeBuildPathKey = (
52
+ build: Pick<
53
+ NativeBuildRow,
54
+ | "channel_id"
55
+ | "platform"
56
+ | "is_sandbox"
57
+ | "submitted_to"
58
+ | "artifact_kind"
59
+ | "export_method"
60
+ >,
61
+ ): string =>
62
+ JSON.stringify([
63
+ build.channel_id,
64
+ build.platform,
65
+ build.is_sandbox,
66
+ nativeBuildDistribution(build),
67
+ ]);
68
+
26
69
  /** A platform's name as the console shows it. */
27
70
  export const platformLabel = (platform: "ios" | "android") =>
28
71
  platform === "ios" ? "iOS" : "Android";
@@ -94,24 +137,46 @@ export const nativeBuildDetailPath = (id: string) =>
94
137
  */
95
138
  export const NATIVE_BUILD_INSTALL_LINK_TTL_MS = 60 * 60 * 1000;
96
139
 
97
- /** The phone's own copy of its UDID, which the Console's server never keeps. */
140
+ /** This iPhone's own copy of its UDID, as its profile reported it. */
98
141
  export const IOS_UDID_STORAGE_KEY = "hot-updater-ios-udid";
99
142
 
143
+ /**
144
+ * This iPhone's receipt of its UDID: what its profile's answer signed for the
145
+ * signed-in person, which Request access takes.
146
+ */
147
+ export const IOS_DEVICE_RECEIPT_STORAGE_KEY = "hot-updater-ios-device-receipt";
148
+
100
149
  /** A device's UDID: 40 hex digits, or 8 and 16 joined by a hyphen. */
101
150
  export const IOS_UDID_PATTERN = /^(?:[0-9a-f]{40}|[0-9a-f]{8}-[0-9a-f]{16})$/iu;
102
151
 
152
+ /** The Console page of the iOS device registry, inside Native builds. */
153
+ export const IOS_DEVICES_PATH = "/native-builds/devices";
154
+
103
155
  /** The route that hands an iPhone the profile that reads its UDID. */
104
- export const nativeBuildDeviceProfilePath = (id: string) =>
105
- `/_hot-updater/native-builds/${encodeURIComponent(id)}/device.mobileconfig`;
156
+ export const IOS_DEVICE_PROFILE_PATH =
157
+ "/_hot-updater/devices/device.mobileconfig";
158
+
159
+ /** Where iOS posts the profile's answer. */
160
+ export const IOS_DEVICE_RESPONSE_PATH = "/_hot-updater/devices/device-response";
161
+
162
+ /** The query parameter of the profile routes: the capability that signs them. */
163
+ export const IOS_DEVICE_TOKEN_PARAM = "t";
164
+
165
+ /** A device profile's link, under the Console's path on the page's own address. */
166
+ export const iosDeviceProfileUrl = (consolePath: string, token: string) =>
167
+ `${consolePath}${IOS_DEVICE_PROFILE_PATH}?${IOS_DEVICE_TOKEN_PARAM}=${encodeURIComponent(token)}`;
168
+
169
+ /** The command that registers requested iPhones from a terminal. */
170
+ export const IOS_DEVICES_ADD_COMMAND =
171
+ "npx hot-updater native-build devices add";
172
+
173
+ /** The UDID as the iOS devices page shows it: its last six characters. */
174
+ export const maskIosUdid = (udid: string) => `…${udid.slice(-6)}`;
106
175
 
107
176
  /** The route of a build's install manifest, as `itms-services` opens it. */
108
177
  export const nativeBuildManifestPath = (id: string) =>
109
178
  `/_hot-updater/native-builds/${encodeURIComponent(id)}/manifest.plist`;
110
179
 
111
- /** The command a maintainer runs to register an iPhone. */
112
- export const nativeBuildDeviceAddCommand = (udid: string) =>
113
- `npx hot-updater native-build devices add --udid ${udid} --name "Teammate's iPhone"`;
114
-
115
180
  /**
116
181
  * What an iPhone opens to install a build: the manifest's URL, signed with a
117
182
  * token that also lets the installer download the IPA.