@hot-updater/console 1.2.0-rc.12 → 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.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{-native-builds-search-C-TGpFAm.js → -native-builds-search-DC2PutLU.js} +1 -1
- package/.output/public/assets/{ConsoleFeatureUnavailable-CUtcXuY2.js → ConsoleFeatureUnavailable-oMmbaqF6.js} +1 -1
- package/.output/public/assets/{EventDetails-Dl2RvPAk.js → EventDetails-ly7ygfdH.js} +1 -1
- package/.output/public/assets/{HashValueDisplay-6lNRxDJX.js → HashValueDisplay-BNoXZADg.js} +1 -1
- package/.output/public/assets/{InsightsPageHeader-DHhqY3DT.js → InsightsPageHeader-q2FgL8xS.js} +1 -1
- package/.output/public/assets/RolloutPercentageBadge-frllRncE.js +1 -0
- package/.output/public/assets/{StoreSubmission-ViTkW4eJ.js → StoreSubmission-D8BGGGgn.js} +1 -1
- package/.output/public/assets/api-BEEYDSCX.js +1 -0
- package/.output/public/assets/{api-keys-FueRkF9q.js → api-keys-B0N3SixL.js} +1 -1
- package/.output/public/assets/api-keys-DFAOfU4U.js +1 -0
- package/.output/public/assets/{index-DH9-mB8D.js → index-t0CToN0S.js} +3 -3
- package/.output/public/assets/insights-B0_8xNxr.js +1 -0
- package/.output/public/assets/{insights-B-0odqpt.js → insights-BbIzm_QG.js} +2 -2
- package/.output/public/assets/insights-BtmYg4vg.js +2 -0
- package/.output/public/assets/{insights-search-DghCbEnk.js → insights-search-B5cZsP6C.js} +1 -1
- package/.output/public/assets/{insights-usage-rpc-CKQH0pUS.js → insights-usage-rpc-zut_JaSS.js} +1 -1
- package/.output/public/assets/insights_.distribution-DLxq-IKU.js +1 -0
- package/.output/public/assets/insights_.distribution-izFBYfJL.js +2 -0
- package/.output/public/assets/{insights_.distribution-dvk6vYDM.js → insights_.distribution-rdeyNhH2.js} +1 -1
- package/.output/public/assets/{installations-B674P5Z5.js → installations-BRS-vuRJ.js} +2 -2
- package/.output/public/assets/installations-CWx7vYY5.js +1 -0
- package/.output/public/assets/{installations-BWxczZ2t.js → installations-Ce_dTa35.js} +1 -1
- package/.output/public/assets/native-builds-Br0onFRc.js +2 -0
- package/.output/public/assets/native-builds-CDYL3y0I.js +1 -0
- package/.output/public/assets/native-builds-DEWHul-_.js +1 -0
- package/.output/public/assets/native-builds_._buildId-D1XEPQ-V.js +1 -0
- package/.output/public/assets/native-builds_._buildId-x-uu1Vbr.js +2 -0
- package/.output/public/assets/{remote-config-B7ujqhLa.js → remote-config-Bw6sErCV.js} +3 -3
- package/.output/public/assets/{remote-config-WjpozBG5.js → remote-config-DQguWTMa.js} +1 -1
- package/.output/public/assets/remote-config-S3xj8r3x.js +1 -0
- package/.output/public/assets/{routes-CCD33Azv.js → routes-Dw8zgqXz.js} +2 -2
- package/.output/public/assets/routes-nKCEKnhh.js +1 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-C19x6erS.mjs → __23tanstack-start-server-fn-resolver-DI0OnlQe.mjs} +58 -46
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/_.mjs +2 -0
- package/.output/server/_ssr/{-native-builds-search-CwNcoXf4.mjs → -native-builds-search-Cl8EZ0Ud.mjs} +2 -2
- package/.output/server/_ssr/{BundleIdDisplay-Bf-L37zf.mjs → BundleIdDisplay-SAvC-NlE.mjs} +2 -2
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-iNGya64h.mjs → ConsoleFeatureUnavailable-BgHEoZ36.mjs} +6 -6
- package/.output/server/_ssr/{EventDetails-CZofL6Hn.mjs → EventDetails-VaS25yjE.mjs} +7 -7
- package/.output/server/_ssr/{HashValueDisplay-DC1TLS-8.mjs → HashValueDisplay-BGc-x_l8.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-sVotAhl0.mjs → InsightsPageHeader-gMuNJt-f.mjs} +7 -7
- package/.output/server/_ssr/{NotFoundPage-COb0erGp.mjs → NotFoundPage-DsRI-J4h.mjs} +2 -2
- package/.output/server/_ssr/{PlatformIcon-CFLiTjh1.mjs → PlatformIcon-BsU0d0jN.mjs} +1 -1
- package/.output/server/_ssr/{RolloutPercentageBadge-BFBh0QWv.mjs → RolloutPercentageBadge-axz7VuIZ.mjs} +3 -3
- package/.output/server/_ssr/{StoreSubmission-Bvfq8pWk.mjs → StoreSubmission-BqXKtpqW.mjs} +5 -5
- package/.output/server/_ssr/{alert-dialog-C-Mck8_M.mjs → alert-dialog-lury59vV.mjs} +1 -1
- package/.output/server/_ssr/{api-oJajV-DG.mjs → api-BQ8ztUgU.mjs} +99 -22
- package/.output/server/_ssr/{api-keys-CcqDkOcC.mjs → api-keys-CHATVpa9.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-B0L1sj-W.mjs → api-keys-DVChzF3r.mjs} +8 -8
- package/.output/server/_ssr/{api-keys-rpc-Do6Rbl0V.mjs → api-keys-rpc-DXPJTfdr.mjs} +4 -4
- package/.output/server/_ssr/{api-rpc-DE0zy7iY.mjs → api-rpc-BexxmTM9.mjs} +43 -18
- package/.output/server/_ssr/{auth-rpc-0I_10FKy.mjs → auth-rpc-BgNCvy2L.mjs} +5 -5
- package/.output/server/_ssr/{auth.server-cdIC1rxo.mjs → auth.server-43UW34Rd.mjs} +165 -149
- package/.output/server/_ssr/{badge-BZZCX8Wn.mjs → badge-BYB825vl.mjs} +1 -1
- package/.output/server/_ssr/{bundleActivity-MLrjNJCT.mjs → bundleActivity-BGVvqWx7.mjs} +1 -1
- package/.output/server/_ssr/{config.server-CydWUX0c.mjs → config.server-QRTmD4Hf.mjs} +4 -4
- package/.output/server/_ssr/{console-access-y52SJdFn.mjs → console-access-E91fYTIB.mjs} +2 -2
- package/.output/server/_ssr/{console-features-BTV-XuhQ.mjs → console-features-CgdQJQlX.mjs} +1 -1
- package/.output/server/_ssr/{console-features-api-BDrXaElT.mjs → console-features-api-CLRjxvy2.mjs} +5 -5
- package/.output/server/_ssr/{console-features-rpc-C9kKIDeK.mjs → console-features-rpc-C2rJ0u6i.mjs} +4 -4
- package/.output/server/_ssr/{createServerRpc-BVvRVOz5.mjs → createServerRpc-DJZel12M.mjs} +1 -1
- package/.output/server/_ssr/{databaseConfig-B_Bg7qS5.mjs → databaseConfig-XAvDetmn.mjs} +1 -1
- package/.output/server/_ssr/{databaseJsonValue-kS7cvEtz.mjs → databaseJsonValue-DuUoft8j.mjs} +1 -1
- package/.output/server/_ssr/{databaseRows-B6H8Cmgq.mjs → databaseRows-BtRVBD0C.mjs} +3 -3
- package/.output/server/_ssr/{dialog-DKsDLcYQ.mjs → dialog-CcF1pxfR.mjs} +1 -1
- package/.output/server/_ssr/{dist-TEpM_UAD.mjs → dist-B6-irDRA.mjs} +1 -1
- package/.output/server/_ssr/{downloadBundle-DCmr7vsj.mjs → downloadBundle-BX8ODCZT.mjs} +1 -1
- package/.output/server/_ssr/{empty-D-mnqnCP.mjs → empty-DkiJ7nWt.mjs} +2 -2
- package/.output/server/_ssr/{empty-plugin-adapters-zrZ0xs6n.mjs → empty-plugin-adapters-BYBYBaxo.mjs} +1 -1
- package/.output/server/_ssr/{failureReports-Cn_zU9S8.mjs → failureReports-C_CmBF4x.mjs} +3 -3
- package/.output/server/_ssr/{field-Bbw5SS9L.mjs → field-CHlDI06h.mjs} +2 -2
- package/.output/server/_ssr/{getBundleChildren-rtkEEJw5.mjs → getBundleChildren-BJTufthT.mjs} +2 -2
- package/.output/server/_ssr/{git-CTA8Aqr0.mjs → git-WSg7LY17.mjs} +2 -2
- package/.output/server/_ssr/{input-group-DXofNRNJ.mjs → input-group-BPZ4UtB5.mjs} +1 -1
- package/.output/server/_ssr/{insights-Dm2UdEf_.mjs → insights-B3YetvBK.mjs} +5 -5
- package/.output/server/_ssr/{insights-C7rhyg61.mjs → insights-CEABWFk4.mjs} +26 -26
- package/.output/server/_ssr/{insights-D6kIjZuE.mjs → insights-Dn32lJ18.mjs} +2 -2
- package/.output/server/_ssr/{insights-api-DNmt4PWL.mjs → insights-api-CYPf5853.mjs} +5 -5
- package/.output/server/_ssr/{insights-errors-7BCwFybo.mjs → insights-errors-Bz3sWNZm.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-B9VPkzZE.mjs → insights-failures-DNQ9qVVf.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-rpc-DkrdYXJk.mjs → insights-failures-rpc-CxPpBR1K.mjs} +11 -11
- package/.output/server/_ssr/{insights-recovery-BtXVU3ro.mjs → insights-recovery-DOkpqnQ8.mjs} +1 -1
- package/.output/server/_ssr/{insights-recovery-rpc-DWLnLF_s.mjs → insights-recovery-rpc-CwnQMTE3.mjs} +7 -7
- package/.output/server/_ssr/{insights-rpc-CdYYZ7lE.mjs → insights-rpc-CKd5ATFI.mjs} +4 -4
- package/.output/server/_ssr/{insights-search-HVXIz64-.mjs → insights-search-B_92_iEj.mjs} +4 -4
- package/.output/server/_ssr/{insights-usage-DiGnuxW8.mjs → insights-usage-4KDIN3Kg.mjs} +1 -1
- package/.output/server/_ssr/{insights-usage-rpc-CLHS5JhI.mjs → insights-usage-rpc-D90uHpJJ.mjs} +7 -7
- package/.output/server/_ssr/{insights-usage-rpc-BCMRZErp.mjs → insights-usage-rpc-RIMNhPtj.mjs} +4 -4
- package/.output/server/_ssr/{insightsUsage-ClAmoUz8.mjs → insightsUsage-DmQdJZqT.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-zbVsH0TU.mjs → insights_.distribution-D42mHSe0.mjs} +14 -14
- package/.output/server/_ssr/{insights_.distribution-3NzANTBS.mjs → insights_.distribution-D4QWsHNo.mjs} +5 -5
- package/.output/server/_ssr/{insights_.distribution-BTbT0Z4H.mjs → insights_.distribution-DwjIdjQi.mjs} +2 -2
- package/.output/server/_ssr/{installations-BsCupWHx.mjs → installations-BIu66J6Q.mjs} +2 -2
- package/.output/server/_ssr/{installations-3XOT2V1j.mjs → installations-CfmO_V_R.mjs} +4 -4
- package/.output/server/_ssr/{installations-CpjqEYh_.mjs → installations-DyzKzWuv.mjs} +11 -11
- package/.output/server/_ssr/{listReleases-D_GY00SQ.mjs → listReleases-CQEceg8j.mjs} +1 -1
- package/.output/server/_ssr/{request-guard-CPdRBuGW.mjs → local-console-Dtxlsav0.mjs} +2 -9
- package/.output/server/_ssr/native-artifact-H1MDP0Jz.mjs +593 -0
- package/.output/server/_ssr/{native-builds-CehTsEwY.mjs → native-builds-BCp8ICrn.mjs} +3 -3
- package/.output/server/_ssr/{native-builds-vYKOMlhp.mjs → native-builds-CqFeXByK.mjs} +17 -13
- package/.output/server/_ssr/{native-builds-DhXL5zf_.mjs → native-builds-qj346atQ.mjs} +49 -12
- package/.output/server/_ssr/{native-builds_._buildId-BHxp9NcZ.mjs → native-builds_._buildId-BAxkkEFo.mjs} +600 -168
- package/.output/server/_ssr/{native-builds_._buildId-euhJ0EI7.mjs → native-builds_._buildId-C8gsW-Rh.mjs} +3 -3
- package/.output/server/_ssr/nativeBuildDevice-nU480p5A.mjs +230 -0
- package/.output/server/_ssr/nativeBuildDownloadLink-c3tcq3G5.mjs +96 -0
- package/.output/server/_ssr/nativeBuildInstall-B-_lHDsS.mjs +203 -0
- package/.output/server/_ssr/nativeBuildQr-C5AFtpmE.mjs +115 -0
- package/.output/server/_ssr/{nativeBuilds-B_7BPjt_.mjs → nativeBuilds-CbxOJDhO.mjs} +61 -29
- package/.output/server/_ssr/{plugins-RIryUNWj.mjs → plugins-CX7wutet.mjs} +6 -6
- package/.output/server/_ssr/publicConsoleBase-3IHSHvqd.mjs +27 -0
- package/.output/server/_ssr/{qr-code-C7kNRIDX.mjs → qr-code-pENFuyy9.mjs} +1 -1
- package/.output/server/_ssr/{release-adoption-DoAtNPED.mjs → release-adoption-C7sUFDwa.mjs} +2 -2
- package/.output/server/_ssr/{release-adoption-rpc-BF8svHjV.mjs → release-adoption-rpc-BBwJO2hu.mjs} +9 -9
- package/.output/server/_ssr/{releaseAdoption-a2byXMfz.mjs → releaseAdoption-LLYlRnUB.mjs} +4 -4
- package/.output/server/_ssr/{releaseCatalogCompiler-DLcean2k.mjs → releaseCatalogCompiler-D9dAMI17.mjs} +3 -3
- package/.output/server/_ssr/{releaseManagement-DHUux2az.mjs → releaseManagement-EPhok_Py.mjs} +1 -1
- package/.output/server/_ssr/{releaseReachability-DZOK_dH-.mjs → releaseReachability-DaZ7ifUF.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-Bn-BZgDt.mjs → remote-config-B1g7vrQD.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-ofOYh91b.mjs → remote-config-BDijmvj1.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-DdukdePk.mjs → remote-config-DjeXVIcr.mjs} +18 -18
- package/.output/server/_ssr/{remote-config-rpc-CzSU_Gwg.mjs → remote-config-rpc-B7bzKw4N.mjs} +5 -5
- package/.output/server/_ssr/request-guard-BPLyogIN.mjs +11 -0
- package/.output/server/_ssr/{router-BQikCEhb.mjs → router-DhxgFNWn.mjs} +101 -50
- package/.output/server/_ssr/{routes-Brx45XtQ.mjs → routes-BC-rBuu_.mjs} +25 -25
- package/.output/server/_ssr/{routes-CTo-A_dj.mjs → routes-BDriEBtF.mjs} +12 -12
- package/.output/server/_ssr/{runtime.server-BdMY1blX.mjs → runtime.server-BsTTLV-B.mjs} +4 -4
- package/.output/server/_ssr/{schema-ChlRtZIo.mjs → schema-3oDJJFWa.mjs} +1 -1
- package/.output/server/_ssr/{schema-migration-rpc-BcwNAFZJ.mjs → schema-migration-rpc-CNMqY0RE.mjs} +4 -4
- package/.output/server/_ssr/{select-Dk_Yv0IG.mjs → select-hFD2e3Bh.mjs} +1 -1
- package/.output/server/_ssr/{server-b1jUGuT2.mjs → server-D_hG9iIq.mjs} +6 -6
- package/.output/server/_ssr/{sidebar-CsRdKfb2.mjs → sidebar-Dmq4j1qr.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{start-BvDsQehg.mjs → start-RjhaPVFE.mjs} +2 -2
- package/.output/server/_ssr/{switch-DpYvZqIf.mjs → switch-CkNsEp9k.mjs} +2 -2
- package/.output/server/_ssr/{table-BAP-tdNn.mjs → table-CTtXogFJ.mjs} +1 -1
- package/.output/server/_ssr/{tabs-DGN9JEGV.mjs → tabs-BTKDM4AJ.mjs} +2 -2
- package/.output/server/_ssr/{updateFailures-n-tGv90S.mjs → updateFailures-DPYzv9bE.mjs} +3 -3
- package/.output/server/_ssr/{uuidv7-BIF4nb_q.mjs → uuidv7-CmHbryZT.mjs} +2 -2
- package/.output/server/_ssr/{version-CQ98ZBpL-CWSkTT9J.mjs → version-CQ98ZBpL-NmbU0MD2.mjs} +1 -1
- package/.output/server/_tanstack-start-manifest_v-BuGAtKIu.mjs +189 -0
- package/.output/server/index.mjs +275 -275
- package/package.json +7 -7
- package/src/components/features/native-builds/BuiltInBundleCard.tsx +82 -33
- package/src/components/features/native-builds/InstallCard.tsx +246 -46
- package/src/components/features/native-builds/IosInstall.tsx +300 -0
- package/src/components/features/native-builds/NativeBuildsTable.tsx +3 -0
- package/src/components/features/native-builds/PatchesCard.tsx +3 -2
- package/src/components/features/native-builds/ReleaseNativeBuildLink.tsx +4 -4
- package/src/components/features/native-builds/ServedNowCard.tsx +33 -1
- package/src/components/features/native-builds/StoreSubmission.tsx +1 -1
- package/src/lib/api-rpc.ts +55 -6
- package/src/lib/api.ts +85 -12
- package/src/lib/native-builds.ts +73 -11
- package/src/lib/server/local-console.ts +1 -1
- package/src/lib/server/nativeBuildDevice.ts +274 -0
- package/src/lib/server/nativeBuildDownloadLink.ts +193 -0
- package/src/lib/server/nativeBuildInstall.ts +355 -0
- package/src/lib/server/nativeBuildQr.ts +114 -24
- package/src/lib/server/nativeBuilds.ts +87 -33
- package/src/lib/server/plistText.ts +17 -0
- package/src/lib/server/publicConsoleBase.ts +17 -0
- package/src/routeTree.gen.ts +114 -0
- package/src/routes/[_]hot-updater/native-builds/$buildId/device-response.ts +17 -0
- package/src/routes/[_]hot-updater/native-builds/$buildId/device.ts +17 -0
- package/src/routes/[_]hot-updater/native-builds/$buildId/device[.]mobileconfig.ts +17 -0
- package/src/routes/[_]hot-updater/native-builds/$buildId/manifest[.]plist.ts +22 -0
- package/src/routes/[_]hot-updater/native-builds/preview-qr.ts +14 -0
- package/src/routes/api/native-builds/$buildId/download.ts +22 -1
- package/.output/public/assets/RolloutPercentageBadge-Cxogpi8F.js +0 -1
- package/.output/public/assets/api-P2g8dCNg.js +0 -1
- package/.output/public/assets/api-keys-DWQC2q6y.js +0 -1
- package/.output/public/assets/insights-BSVGfxSL.js +0 -1
- package/.output/public/assets/insights-NK5B6ReS.js +0 -2
- package/.output/public/assets/insights_.distribution-CJvgwcVZ.js +0 -2
- package/.output/public/assets/insights_.distribution-DblZM0mO.js +0 -1
- package/.output/public/assets/installations-Dv4kWQYz.js +0 -1
- package/.output/public/assets/native-builds-BGgFQTDW.js +0 -2
- package/.output/public/assets/native-builds-BOC71grI.js +0 -1
- package/.output/public/assets/native-builds-CxomzFqe.js +0 -1
- package/.output/public/assets/native-builds_._buildId-DD58_Phd.js +0 -1
- package/.output/public/assets/native-builds_._buildId-DvQDKnUQ.js +0 -2
- package/.output/public/assets/remote-config-gXeH6PBW.js +0 -1
- package/.output/public/assets/routes-BDdBIxYS.js +0 -1
- package/.output/server/_ssr/nativeBuildQr-84cnFQPX.mjs +0 -59
- package/.output/server/_tanstack-start-manifest_v-uhJWytDm.mjs +0 -184
- /package/.output/public/assets/{NotFoundPage-DZ3DxyRA.js → NotFoundPage-fiaucvsO.js} +0 -0
- /package/.output/public/assets/{PlatformIcon-BBWQlWm9.js → PlatformIcon-DCTtCP5t.js} +0 -0
- /package/.output/public/assets/{alert-dialog-BqYScr9y.js → alert-dialog-Z_RNBrFc.js} +0 -0
- /package/.output/public/assets/{badge-DWFcDWho.js → badge-UNnTz4Dl.js} +0 -0
- /package/.output/public/assets/{dialog-CNUPxNxH.js → dialog-C2U9bINi.js} +0 -0
- /package/.output/public/assets/{dist-CPlO6ko9.js → dist-UQUhRoJi.js} +0 -0
- /package/.output/public/assets/{empty-B3Uwdd6k.js → empty-PAp07lsC.js} +0 -0
- /package/.output/public/assets/{field-D-2-mnNh.js → field-DhKRWFG5.js} +0 -0
- /package/.output/public/assets/{history-DqHlgSuV.js → history-DakJoeSM.js} +0 -0
- /package/.output/public/assets/{input-group-D3OUBk4n.js → input-group-BJfBVqeI.js} +0 -0
- /package/.output/public/assets/{key-round-DwNKkHhy.js → key-round-DzBe6DHr.js} +0 -0
- /package/.output/public/assets/{list--NIee1FZ.js → list-B6GeoQ_b.js} +0 -0
- /package/.output/public/assets/{plus-BReVKct-.js → plus-BVhOauU3.js} +0 -0
- /package/.output/public/assets/{refresh-cw-B9HHjLej.js → refresh-cw-C6svDMfM.js} +0 -0
- /package/.output/public/assets/{relativeTime-YQt84dYr.js → relativeTime-BscR0TsX.js} +0 -0
- /package/.output/public/assets/{rotate-cw-Cv2aVbYr.js → rotate-cw-CxFW64IG.js} +0 -0
- /package/.output/public/assets/{search-BCel4Oy6.js → search-bIYGuFCt.js} +0 -0
- /package/.output/public/assets/{smartphone-CMaSy_ir.js → smartphone-Bn5FtEwt.js} +0 -0
- /package/.output/public/assets/{switch-BpdiHL_t.js → switch-DtUu1RCw.js} +0 -0
- /package/.output/public/assets/{table-Bpy3SvSo.js → table-B22H8-RL.js} +0 -0
- /package/.output/public/assets/{tabs-Xmt7tZeG.js → tabs-Fgz3sA51.js} +0 -0
- /package/.output/public/assets/{undo-2-CUX96_BG.js → undo-2-7gOxArtb.js} +0 -0
- /package/.output/public/assets/{uuidv7-zXMtwR9Q.js → uuidv7-BLyD3pAM.js} +0 -0
- /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 & 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
|
|
128
|
-
|
|
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
|
|
16
|
-
* a patch from its built-in bundle: the
|
|
17
|
-
*
|
|
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}
|
package/src/lib/api-rpc.ts
CHANGED
|
@@ -305,9 +305,9 @@ export const getNativeBuildPatches = createServerFn({ method: "GET" })
|
|
|
305
305
|
});
|
|
306
306
|
|
|
307
307
|
/**
|
|
308
|
-
* The
|
|
309
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
330
|
-
*
|
|
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
|
|
82
|
-
*
|
|
83
|
-
*
|
|
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
|
|
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
|
|
234
|
-
*
|
|
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
|
|
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
|
-
|
|
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({
|