@hot-updater/console 1.2.0-rc.35 → 1.2.0-rc.37
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-BJPSRi4t.js +1 -0
- package/.output/public/assets/{CompositeItem-CyQoQkYs.js → CompositeItem-CcgQyrSU.js} +1 -1
- package/.output/public/assets/{ConsoleFeatureUnavailable-C0iDIboF.js → ConsoleFeatureUnavailable-P2up1IkX.js} +1 -1
- package/.output/public/assets/{EventDetails-DFWS-HcW.js → EventDetails-BYZUOYsT.js} +1 -1
- package/.output/public/assets/{HashValueDisplay-DKziWjEg.js → HashValueDisplay-N89T2mVj.js} +1 -1
- package/.output/public/assets/{InsightsPageHeader-BATHTZWn.js → InsightsPageHeader-DhOT-Tmn.js} +1 -1
- package/.output/public/assets/IosInstall-ChFnQISV.js +1 -0
- package/.output/public/assets/{NativeBuildsNav-D3FIlSu0.js → NativeBuildsNav-CivF1UpI.js} +1 -1
- package/.output/public/assets/{RelativeTime-BvgGWfXM.js → RelativeTime-CAwDWRiM.js} +1 -1
- package/.output/public/assets/RolloutPercentageBadge-DlaDqnOs.js +1 -0
- package/.output/public/assets/{RowReason-7dIWPxhy.js → RowReason-CRPq0CHS.js} +1 -1
- package/.output/public/assets/{SandboxBadge-BPf2uve4.js → SandboxBadge-BpJoP3BG.js} +1 -1
- package/.output/public/assets/{TargetDisplay-CiU6ZsDl.js → TargetDisplay-C6ofsnLc.js} +1 -1
- package/.output/public/assets/api-USY_IWMu.js +1 -0
- package/.output/public/assets/api-keys-Bjv4olzj.js +1 -0
- package/.output/public/assets/api-keys-CrrBMw2x.js +1 -0
- package/.output/public/assets/{uuidv7-DgXZ1zRR.js → constants-C5gi7fdZ.js} +1 -1
- package/.output/public/assets/dist-BDfiL2Qz.js +1 -0
- package/.output/public/assets/{index-CQDGK7Fg.js → index-BTfZoenj.js} +3 -3
- package/.output/public/assets/insights-B87auoZU.js +2 -0
- package/.output/public/assets/{insights-Bm4Kua5R.js → insights-BYOdNi7w.js} +2 -2
- package/.output/public/assets/insights-QaHXTgmd.js +1 -0
- package/.output/public/assets/insights-search-DmxDGWAA.js +1 -0
- package/.output/public/assets/{insights-usage-rpc-DdmD1Nuy.js → insights-usage-rpc-BG7EOn2n.js} +1 -1
- package/.output/public/assets/insights_.distribution-CzUUV067.js +1 -0
- package/.output/public/assets/insights_.distribution-D4CopMfD.js +2 -0
- package/.output/public/assets/insights_.distribution-gCONJgiU.js +1 -0
- package/.output/public/assets/installations-BKAdFmTM.js +1 -0
- package/.output/public/assets/{installations-DYT2mSjX.js → installations-BfbwP-Ub.js} +2 -2
- package/.output/public/assets/installations-D5bvOxlY.js +1 -0
- package/.output/public/assets/native-builds-BE-d-vLT.js +2 -0
- package/.output/public/assets/native-builds-Bo5b3l5H.js +1 -0
- package/.output/public/assets/native-builds-DYvuFp4w.js +1 -0
- package/.output/public/assets/native-builds_._buildId-Cy_v6FQF.js +1 -0
- package/.output/public/assets/native-builds_._buildId-EnQK17U1.js +2 -0
- package/.output/public/assets/native-builds_.devices-CuY0AWQs.js +1 -0
- package/.output/public/assets/native-builds_.devices-TidkuG6Q.js +2 -0
- package/.output/public/assets/remote-config-9h5s5yCy.js +1 -0
- package/.output/public/assets/remote-config-BnyIK6Ty.js +6 -0
- package/.output/public/assets/{remote-config-D1EMK2er.js → remote-config-MY091ahb.js} +1 -1
- package/.output/public/assets/routes-Bgad16DN.js +1 -0
- package/.output/public/assets/routes-C449P2E2.js +2 -0
- package/.output/public/assets/{select-BAd2hAoW.js → select-DKrHQL0P.js} +1 -1
- package/.output/public/assets/styles-CyLzruUt.css +2 -0
- package/.output/public/assets/{switch-DNa3Cz9K.js → switch-CG0ceFSo.js} +1 -1
- package/.output/server/{__23tanstack-start-server-fn-resolver-BkmGm73S.mjs → __23tanstack-start-server-fn-resolver-BFQ_ymzi.mjs} +58 -58
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/_.mjs +1 -1
- package/.output/server/_ssr/{-native-builds-search-OJ8XmaBa.mjs → -native-builds-search-Bwt8tQzp.mjs} +19 -7
- package/.output/server/_ssr/{BundleIdDisplay-B90reloJ.mjs → BundleIdDisplay-oRrThcpb.mjs} +2 -2
- package/.output/server/_ssr/{ChannelBadge-Dbmjpe-k.mjs → ChannelBadge-Dbh3dltM.mjs} +3 -3
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-BX6uKVMH.mjs → ConsoleFeatureUnavailable-Doz_fDu6.mjs} +6 -6
- package/.output/server/_ssr/{EventDetails-DiO0Njqj.mjs → EventDetails-WUb3ECMe.mjs} +6 -6
- package/.output/server/_ssr/{HashValueDisplay-CicukMPP.mjs → HashValueDisplay-C1p0Ha7c.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-Bu88jQMD.mjs → InsightsPageHeader-D0YoPKff.mjs} +6 -6
- package/.output/server/_ssr/{IosInstall-qOwrZE2v.mjs → IosInstall-CikIinZ9.mjs} +7 -7
- package/.output/server/_ssr/{NativeBuildsNav-D20VrrNx.mjs → NativeBuildsNav-CZm3xCG4.mjs} +3 -3
- package/.output/server/_ssr/{NotFoundPage-_rXA1M7U.mjs → NotFoundPage-BOTgaHgp.mjs} +2 -2
- package/.output/server/_ssr/{PlatformIcon-X18AN8Yp.mjs → PlatformIcon-C22qEcwo.mjs} +1 -1
- package/.output/server/_ssr/{QrCode-DmEsrduv.mjs → QrCode-CcLFV0Y5.mjs} +2 -2
- package/.output/server/_ssr/{RelativeTime-nw54zYAf.mjs → RelativeTime-J6ZohekD.mjs} +3 -3
- package/.output/server/_ssr/{RolloutPercentageBadge-DlRrxKdg.mjs → RolloutPercentageBadge-CzR93Z1h.mjs} +3 -3
- package/.output/server/_ssr/{RowReason-D46cFeQO.mjs → RowReason-BEJN6VYX.mjs} +4 -4
- package/.output/server/_ssr/{SandboxBadge-DXM9RKlS.mjs → SandboxBadge-BvH77G2y.mjs} +2 -2
- package/.output/server/_ssr/{TargetDisplay-CIU-9UqJ.mjs → TargetDisplay-B4kPBarK.mjs} +3 -3
- package/.output/server/_ssr/{alert-dialog-CAb_7ZLL.mjs → alert-dialog-Dq0MrXYr.mjs} +1 -1
- package/.output/server/_ssr/{api-v-mDt0z9.mjs → api-CyBb_myQ.mjs} +9 -7
- package/.output/server/_ssr/{api-keys-DY3XY8gz.mjs → api-keys-0tbG1BAn.mjs} +9 -9
- package/.output/server/_ssr/{api-keys-CebW6Olm.mjs → api-keys-DnI6bU0-.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-rpc-D0rQ5vvV.mjs → api-keys-rpc-B5V0nPee.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-OTsF60lZ.mjs → api-rpc-Bki_LLpu.mjs} +7 -7
- package/.output/server/_ssr/{auth-rpc-Cga9IGo3.mjs → auth-rpc-DbCI8_0x.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-BVqW4FSJ.mjs → auth.server-DHNHPeT2.mjs} +2 -2
- package/.output/server/_ssr/{badge-Cy4z0pH1.mjs → badge-CipE3hKU.mjs} +1 -1
- package/.output/server/_ssr/{card-UaEWfeRI.mjs → card-Ddy7b39R.mjs} +1 -1
- package/.output/server/_ssr/{config.server-OJdvjs7r.mjs → config.server-DSxn3Ysu.mjs} +3 -3
- package/.output/server/_ssr/{console-access-BM4TLI4g.mjs → console-access-rWJNPuyL.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-BmiP0aaD.mjs → console-features-api-BkgX9cAs.mjs} +5 -5
- package/.output/server/_ssr/{console-features-rpc-DPcZcHSW.mjs → console-features-rpc-BWQ_sfeK.mjs} +3 -3
- package/.output/server/_ssr/constants-BjsJZqaU.mjs +10 -0
- package/.output/server/_ssr/{dialog-DWlZVg5y.mjs → dialog-BzgDSd4O.mjs} +1 -1
- package/.output/server/_ssr/{empty-BPB71w6i.mjs → empty-D-_RLQLe.mjs} +2 -2
- package/.output/server/_ssr/{field-Bx8FKYuu.mjs → field-dgxldFcJ.mjs} +2 -2
- package/.output/server/_ssr/{input-group-BzfbjZEj.mjs → input-group-BIVV3OmZ.mjs} +1 -1
- package/.output/server/_ssr/{insights-DaGJDccC.mjs → insights-C3xgmVP5.mjs} +23 -22
- package/.output/server/_ssr/{insights-CFbpYpMy.mjs → insights-P7VdVc2X.mjs} +2 -2
- package/.output/server/_ssr/{insights-api-b2wrxjFK.mjs → insights-api-B9dFh5pY.mjs} +3 -3
- package/.output/server/_ssr/{insights-failures-rpc-DLo_DEAi.mjs → insights-failures-rpc-Djr6J1Xm.mjs} +4 -4
- package/.output/server/_ssr/{insights-CBOTZToQ.mjs → insights-h0GWIrsK.mjs} +5 -5
- package/.output/server/_ssr/{insights-recovery-rpc-rpNu1Y8O.mjs → insights-recovery-rpc-CwsV5jCp.mjs} +3 -3
- package/.output/server/_ssr/{insights-rpc-C2u-cHw2.mjs → insights-rpc-lLr4qvQA.mjs} +3 -3
- package/.output/server/_ssr/{insights-search-BBOEGM68.mjs → insights-search-C94zOeed.mjs} +3 -5
- package/.output/server/_ssr/{insights-usage-rpc-BOfXGKaq.mjs → insights-usage-rpc-BMoDtME6.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-6VNQ-ZVG.mjs → insights-usage-rpc-DfzHEGlX.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-DrY2XK92.mjs → insights_.distribution-5GlDwjgh.mjs} +15 -15
- package/.output/server/_ssr/{insights_.distribution-kX-VlU6s.mjs → insights_.distribution-BQYtsQpN.mjs} +5 -5
- package/.output/server/_ssr/{insights_.distribution-a1c7v5MP.mjs → insights_.distribution-DKHbAqrw.mjs} +2 -2
- package/.output/server/_ssr/{installations-BG3Mf569.mjs → installations--bKePFE3.mjs} +2 -2
- package/.output/server/_ssr/{installations-uML6v5Uo.mjs → installations-9kZoRkhZ.mjs} +11 -11
- package/.output/server/_ssr/{installations-B5-uJU9A.mjs → installations-DeZqcfwL.mjs} +4 -4
- package/.output/server/_ssr/{ios-devices-rpc-DqTNHbdN.mjs → ios-devices-rpc-ChQt1lEa.mjs} +7 -7
- package/.output/server/_ssr/{iosDeviceCookie-DNXjIPeF.mjs → iosDeviceCookie-BOJzV-1T.mjs} +3 -3
- package/.output/server/_ssr/{iosDeviceProfile-Cl32eCmk.mjs → iosDeviceProfile-DRxqDIRN.mjs} +2 -2
- package/.output/server/_ssr/{iosDevices-BQ0RaNWs.mjs → iosDevices-foAF3rIL.mjs} +2 -2
- package/.output/server/_ssr/{native-builds-BuYIAi2p.mjs → native-builds-16TY7UkU.mjs} +3 -3
- package/.output/server/_ssr/{native-builds-BBOmHVsH.mjs → native-builds-CJij2DCH.mjs} +64 -32
- package/.output/server/_ssr/{native-builds_._buildId-DZSLPTef.mjs → native-builds_._buildId-BT6XN4Y9.mjs} +19 -17
- package/.output/server/_ssr/{native-builds_._buildId-BUdWhQaH.mjs → native-builds_._buildId-D7Xhgq1D.mjs} +3 -3
- package/.output/server/_ssr/{native-builds_.devices-QK5Z4ACD.mjs → native-builds_.devices-CBhVMdxB.mjs} +3 -3
- package/.output/server/_ssr/{native-builds_.devices-phkJgI1w.mjs → native-builds_.devices-DaDcZ7My.mjs} +16 -16
- package/.output/server/_ssr/{nativeBuildDownloadLink-BVtopV-4.mjs → nativeBuildDownloadLink-wyrdOdGY.mjs} +2 -2
- package/.output/server/_ssr/{nativeBuildInstall-CVQLkYrX.mjs → nativeBuildInstall-BYrSOrnL.mjs} +3 -3
- package/.output/server/_ssr/{release-adoption-rpc-DSlOL5v7.mjs → release-adoption-rpc-CjBTAOp3.mjs} +5 -5
- package/.output/server/_ssr/{remote-config-C4PKU5_z.mjs → remote-config-7iYGDQDg.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-9VJWDosm.mjs → remote-config-DB_bwu9l.mjs} +19 -19
- package/.output/server/_ssr/{remote-config-DPHJyAHV.mjs → remote-config-mXE6SgzT.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-rpc-DxQ0jW52.mjs → remote-config-rpc-DyTDyXqc.mjs} +3 -3
- package/.output/server/_ssr/{router-C1FV3SPc.mjs → router-D0Czwiot.mjs} +34 -34
- package/.output/server/_ssr/{routes-Dg1cG9-d.mjs → routes-BpyORQr9.mjs} +45 -11
- package/.output/server/_ssr/{routes-DDzrfaZr.mjs → routes-C4PCsk54.mjs} +98 -45
- package/.output/server/_ssr/{schema-migration-rpc-DdijfSjx.mjs → schema-migration-rpc-vpFM7iXp.mjs} +3 -3
- package/.output/server/_ssr/{select-CQvxbdec.mjs → select-GzLdXnOE.mjs} +4 -4
- package/.output/server/_ssr/{server-CGStUbwn.mjs → server-CL-3qcc8.mjs} +4 -4
- package/.output/server/_ssr/{sidebar-zjbq02-o.mjs → sidebar-DAbmmzxn.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{start-BaUpXI0L.mjs → start-BXlykDIg.mjs} +1 -1
- package/.output/server/_ssr/{switch-_XoBaA1s.mjs → switch-hif-H-Pq.mjs} +2 -2
- package/.output/server/_ssr/{table-FoAc6s3r.mjs → table-D5ewLtFP.mjs} +1 -1
- package/.output/server/_ssr/{tabs-BgUZHny1.mjs → tabs-9bTsyo84.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-wLJ-tAN0.mjs → _tanstack-start-manifest_v-Cpy3P0dQ.mjs} +96 -97
- package/.output/server/index.mjs +299 -306
- package/package.json +7 -7
- package/src/components/features/insights/AppUsage.tsx +3 -5
- package/src/components/features/insights/InsightsControls.tsx +2 -2
- package/src/components/features/native-builds/NativeBuildDetailPage.tsx +8 -0
- package/src/components/features/native-builds/NativeBuildsPage.tsx +83 -23
- package/src/components/features/native-builds/NativeBuildsTable.tsx +8 -6
- package/src/components/ui/select.tsx +4 -3
- package/src/lib/api.ts +10 -2
- package/src/lib/constants.ts +15 -0
- package/src/lib/insights-search.ts +0 -3
- package/src/routes/-native-builds-search.ts +32 -4
- package/src/routes/-releases-search.ts +63 -2
- package/src/routes/index.tsx +115 -31
- package/src/routes/insights.tsx +3 -5
- package/src/routes/insights_.distribution.tsx +2 -2
- package/.output/public/assets/-native-builds-search-BvCftqF2.js +0 -1
- package/.output/public/assets/IosInstall-CyBFeLGv.js +0 -1
- package/.output/public/assets/RolloutPercentageBadge-DnmU8XbU.js +0 -1
- package/.output/public/assets/api-B1z_XXrQ.js +0 -1
- package/.output/public/assets/api-keys-C_u_ZmPS.js +0 -1
- package/.output/public/assets/api-keys-DPuPM7ag.js +0 -1
- package/.output/public/assets/dist-BEIz5ojx.js +0 -1
- package/.output/public/assets/insights-CpnFoyo5.js +0 -2
- package/.output/public/assets/insights-MQrx_wbP.js +0 -1
- package/.output/public/assets/insights-search-CtEcj6lz.js +0 -1
- package/.output/public/assets/insights_.distribution-Bjo0aQE4.js +0 -1
- package/.output/public/assets/insights_.distribution-Dd2mYz8D.js +0 -2
- package/.output/public/assets/insights_.distribution-REbBAqgL.js +0 -1
- package/.output/public/assets/installations-Di02gX_V.js +0 -1
- package/.output/public/assets/installations-iqDa8KPW.js +0 -1
- package/.output/public/assets/native-builds-CkaoQZVh.js +0 -2
- package/.output/public/assets/native-builds-CtqBGw8a.js +0 -1
- package/.output/public/assets/native-builds-hOC_V15R.js +0 -1
- package/.output/public/assets/native-builds_._buildId-CAnF7xPa.js +0 -2
- package/.output/public/assets/native-builds_._buildId-DSbzVVI5.js +0 -1
- package/.output/public/assets/native-builds_.devices-CCmLAkXG.js +0 -1
- package/.output/public/assets/native-builds_.devices-D-8DVNRB.js +0 -2
- package/.output/public/assets/refresh-cw-CpCxPYma.js +0 -1
- package/.output/public/assets/remote-config-CD50k2u7.js +0 -6
- package/.output/public/assets/remote-config-Dmuqm9xx.js +0 -1
- package/.output/public/assets/routes-BMbT1Qdm.js +0 -2
- package/.output/public/assets/routes-D8reVBSx.js +0 -1
- package/.output/public/assets/styles-B8MKzxw2.css +0 -2
- /package/.output/public/assets/{BundleIdDisplay-D8oR8mcP.js → BundleIdDisplay-Bm85NZma.js} +0 -0
- /package/.output/public/assets/{ChannelBadge-Do-lWsLM.js → ChannelBadge-B04sTjw5.js} +0 -0
- /package/.output/public/assets/{NotFoundPage-CijSy63W.js → NotFoundPage-DUWkihqx.js} +0 -0
- /package/.output/public/assets/{PlatformIcon-Kq3q98tU.js → PlatformIcon-CZjIJt0C.js} +0 -0
- /package/.output/public/assets/{QrCode-D3-Vuudy.js → QrCode-DJ5leikY.js} +0 -0
- /package/.output/public/assets/{alert-dialog-Dihztkem.js → alert-dialog-ndHfUqUh.js} +0 -0
- /package/.output/public/assets/{card-BfeRlTvj.js → card-VtWYErXu.js} +0 -0
- /package/.output/public/assets/{dialog-e9AF5T6h.js → dialog-Dx9gstou.js} +0 -0
- /package/.output/public/assets/{empty-DpSPWLc2.js → empty-Cdfs8tuN.js} +0 -0
- /package/.output/public/assets/{field-PkdRPD3A.js → field-CubHQ_EM.js} +0 -0
- /package/.output/public/assets/{relativeTime-D_aYJRc7.js → relativeTime-Wk64dka-.js} +0 -0
- /package/.output/public/assets/{table-r_sYqKTQ.js → table-DtcLx8yw.js} +0 -0
- /package/.output/public/assets/{tabs-BBfg-c0h.js → tabs-DYlO8l4M.js} +0 -0
- /package/.output/public/assets/{valueToPercent-Bn8p2lng.js → valueToPercent-Db73Kirz.js} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/console",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.0-rc.
|
|
4
|
+
"version": "1.2.0-rc.37",
|
|
5
5
|
"files": [
|
|
6
6
|
".output",
|
|
7
7
|
"lib",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"tw-animate-css": "^1.4.0",
|
|
60
60
|
"uqr": "^0.1.3",
|
|
61
61
|
"verkit": "0.4.0",
|
|
62
|
-
"@hot-updater/
|
|
63
|
-
"@hot-updater/plugin-core": "1.2.0-rc.
|
|
64
|
-
"@hot-updater/
|
|
65
|
-
"@hot-updater/protocol": "1.2.0-rc.
|
|
62
|
+
"@hot-updater/bsdiff": "1.2.0-rc.37",
|
|
63
|
+
"@hot-updater/plugin-core": "1.2.0-rc.37",
|
|
64
|
+
"@hot-updater/server": "1.2.0-rc.37",
|
|
65
|
+
"@hot-updater/protocol": "1.2.0-rc.37"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@tanstack/devtools-vite": "^0.6.0",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"vite-tsconfig-paths": "^6.1.1",
|
|
87
87
|
"vitest": "4.1.4",
|
|
88
88
|
"web-vitals": "^5.1.0",
|
|
89
|
-
"@hot-updater/
|
|
90
|
-
"@hot-updater/
|
|
89
|
+
"@hot-updater/mock": "1.2.0-rc.37",
|
|
90
|
+
"@hot-updater/cli-tools": "1.2.0-rc.37"
|
|
91
91
|
},
|
|
92
92
|
"description": "React Native OTA solution for self-hosted",
|
|
93
93
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -37,15 +37,13 @@ import {
|
|
|
37
37
|
TableHeader,
|
|
38
38
|
TableRow,
|
|
39
39
|
} from "@/components/ui/table";
|
|
40
|
+
import { DEFAULT_CHANNEL } from "@/lib/constants";
|
|
40
41
|
import {
|
|
41
42
|
DEFAULT_INSIGHTS_RETENTION,
|
|
42
43
|
type InsightsRetentionDays,
|
|
43
44
|
keepsTwelveMonths,
|
|
44
45
|
} from "@/lib/insights-retention";
|
|
45
|
-
import {
|
|
46
|
-
DEFAULT_INSIGHTS_CHANNEL,
|
|
47
|
-
type InsightsSearch,
|
|
48
|
-
} from "@/lib/insights-search";
|
|
46
|
+
import type { InsightsSearch } from "@/lib/insights-search";
|
|
49
47
|
import type { AppUsageReport, UsageWindow } from "@/lib/insights-usage";
|
|
50
48
|
|
|
51
49
|
import { EstimatedCount } from "./EstimatedCount";
|
|
@@ -105,7 +103,7 @@ export function AppUsage({
|
|
|
105
103
|
<div className="flex min-w-0 flex-col gap-1">
|
|
106
104
|
<CardTitle>App usage</CardTitle>
|
|
107
105
|
<InsightsScope
|
|
108
|
-
channel={search.channel ??
|
|
106
|
+
channel={search.channel ?? DEFAULT_CHANNEL}
|
|
109
107
|
platform={search.platform ?? "all"}
|
|
110
108
|
narrower={
|
|
111
109
|
search.appVersion ? [`App version ${search.appVersion}`] : []
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
SelectValue,
|
|
22
22
|
} from "@/components/ui/select";
|
|
23
23
|
import { useChannelsQuery } from "@/lib/api";
|
|
24
|
-
import {
|
|
24
|
+
import { DEFAULT_CHANNEL } from "@/lib/constants";
|
|
25
25
|
import type { AdoptionRelease, HealthPlatform } from "@/lib/release-adoption";
|
|
26
26
|
|
|
27
27
|
import { platformLabel } from "./InsightsScope";
|
|
@@ -36,7 +36,7 @@ export type InsightsFilters = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
const DEFAULT_FILTERS = {
|
|
39
|
-
channel:
|
|
39
|
+
channel: DEFAULT_CHANNEL,
|
|
40
40
|
platform: "all",
|
|
41
41
|
appVersion: undefined,
|
|
42
42
|
releaseId: undefined,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import { SidebarTrigger } from "@/components/ui/sidebar";
|
|
21
21
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
22
22
|
import { type KeysetPage, useNativeBuildDetailQuery } from "@/lib/api";
|
|
23
|
+
import { ALL_CHANNELS } from "@/lib/constants";
|
|
23
24
|
import {
|
|
24
25
|
formatByteSize,
|
|
25
26
|
nativeBuildArtifacts,
|
|
@@ -76,6 +77,12 @@ export function NativeBuildDetailPage({
|
|
|
76
77
|
size: "sm",
|
|
77
78
|
variant: "ghost",
|
|
78
79
|
})}
|
|
80
|
+
// The build's own channel lists it, wherever the page was opened
|
|
81
|
+
// from: a list, a link, or a QR code. Until the build is known,
|
|
82
|
+
// every channel's list holds it, whatever its channel.
|
|
83
|
+
search={
|
|
84
|
+
detail ? { channel: detail.channel } : { channels: ALL_CHANNELS }
|
|
85
|
+
}
|
|
79
86
|
to="/native-builds"
|
|
80
87
|
>
|
|
81
88
|
<ChevronLeft data-icon="inline-start" />
|
|
@@ -152,6 +159,7 @@ export function NativeBuildDetailPage({
|
|
|
152
159
|
className: "min-h-11 sm:min-h-8",
|
|
153
160
|
variant: "outline",
|
|
154
161
|
})}
|
|
162
|
+
search={{ channels: ALL_CHANNELS }}
|
|
155
163
|
to="/native-builds"
|
|
156
164
|
>
|
|
157
165
|
Show all native builds
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { HardDrive, RefreshCw } from "lucide-react";
|
|
1
|
+
import { AlertTriangle, HardDrive, RefreshCw } from "lucide-react";
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
Alert,
|
|
5
|
+
AlertAction,
|
|
6
|
+
AlertDescription,
|
|
7
|
+
AlertTitle,
|
|
8
|
+
} from "@/components/ui/alert";
|
|
3
9
|
import { Button } from "@/components/ui/button";
|
|
4
10
|
import {
|
|
5
11
|
Select,
|
|
@@ -10,11 +16,12 @@ import {
|
|
|
10
16
|
SelectValue,
|
|
11
17
|
} from "@/components/ui/select";
|
|
12
18
|
import { SidebarTrigger } from "@/components/ui/sidebar";
|
|
19
|
+
import { useChannelsQuery, useNativeBuildsQuery } from "@/lib/api";
|
|
20
|
+
import { ALL_CHANNELS, ALL_CHANNELS_LABEL } from "@/lib/constants";
|
|
13
21
|
import {
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "@/lib/api";
|
|
22
|
+
type NativeBuildsSearch,
|
|
23
|
+
resolveNativeBuildsSearch,
|
|
24
|
+
} from "@/routes/-native-builds-search";
|
|
18
25
|
|
|
19
26
|
import { ImportBuildDialog } from "./ImportBuild";
|
|
20
27
|
import { NativeBuildsNav } from "./NativeBuildsNav";
|
|
@@ -24,34 +31,57 @@ import { NativeBuildsTable } from "./NativeBuildsTable";
|
|
|
24
31
|
* The filter's values: a channel's is its name behind a prefix, so no channel
|
|
25
32
|
* name, `all` included, can be taken for "All channels".
|
|
26
33
|
*/
|
|
27
|
-
const ALL_CHANNELS = "all";
|
|
28
34
|
const CHANNEL_VALUE_PREFIX = "channel:";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The list while its channel is unknown: loading, whatever the cache holds,
|
|
38
|
+
* and nothing to refresh. A disabled query still reads when refetched.
|
|
39
|
+
*/
|
|
40
|
+
const PENDING_BUILDS = {
|
|
41
|
+
data: undefined,
|
|
42
|
+
isError: false,
|
|
43
|
+
isPending: true,
|
|
44
|
+
isPlaceholderData: false,
|
|
45
|
+
refetch: () => undefined,
|
|
46
|
+
} as const;
|
|
29
47
|
const channelValue = (name: string) => `${CHANNEL_VALUE_PREFIX}${name}`;
|
|
30
48
|
|
|
31
49
|
/**
|
|
32
50
|
* The native builds Hot Updater tracks: one page at a time, newest first,
|
|
33
|
-
*
|
|
34
|
-
* are in the URL, so a pull
|
|
51
|
+
* those that embed one channel, the default one unless the URL names another
|
|
52
|
+
* or every channel. The page and the channel are in the URL, so a pull
|
|
53
|
+
* request links to its channel's builds.
|
|
35
54
|
*/
|
|
36
55
|
export function NativeBuildsPage({
|
|
37
56
|
search,
|
|
38
57
|
onSearchChange,
|
|
39
58
|
}: {
|
|
40
|
-
readonly search:
|
|
41
|
-
readonly onSearchChange: (search:
|
|
59
|
+
readonly search: NativeBuildsSearch;
|
|
60
|
+
readonly onSearchChange: (search: NativeBuildsSearch) => void;
|
|
42
61
|
}) {
|
|
43
|
-
const { channel, before, after } = search;
|
|
44
|
-
const builds = useNativeBuildsQuery(search);
|
|
45
62
|
// The filter's choices; the rows decode their channel from its ID.
|
|
46
63
|
const channels = useChannelsQuery();
|
|
47
64
|
const channelNames = channels.data?.map(({ name }) => name) ?? [];
|
|
65
|
+
// The page the list shows: a URL without a channel opens on the default
|
|
66
|
+
// one, known once the channel list arrives. A loaded list outlives a failed
|
|
67
|
+
// refresh; without one, the default page waits, and nothing reads every
|
|
68
|
+
// channel in its place.
|
|
69
|
+
const page = resolveNativeBuildsSearch(search, channels.data && channelNames);
|
|
70
|
+
const pending = page === undefined;
|
|
71
|
+
const channelsFailed = pending && channels.isError;
|
|
72
|
+
const { channel, before, after } = page ?? search;
|
|
73
|
+
// Nothing reads every channel's builds on the way to the default channel's.
|
|
74
|
+
const query = useNativeBuildsQuery(page ?? {}, { enabled: !pending });
|
|
75
|
+
const builds = pending ? PENDING_BUILDS : query;
|
|
48
76
|
// A filtered channel may be gone, or not loaded yet: it stays a choice.
|
|
49
77
|
const choices =
|
|
50
78
|
channel === undefined || channelNames.includes(channel)
|
|
51
79
|
? channelNames
|
|
52
80
|
: [channel, ...channelNames];
|
|
53
81
|
const filterBy = (next: string | undefined) =>
|
|
54
|
-
onSearchChange(
|
|
82
|
+
onSearchChange(
|
|
83
|
+
next === undefined ? { channels: ALL_CHANNELS } : { channel: next },
|
|
84
|
+
);
|
|
55
85
|
|
|
56
86
|
return (
|
|
57
87
|
<div className="flex h-svh min-h-0 min-w-0 flex-col">
|
|
@@ -73,8 +103,9 @@ export function NativeBuildsPage({
|
|
|
73
103
|
<NativeBuildsNav current="builds" />
|
|
74
104
|
<div className="flex items-center gap-2">
|
|
75
105
|
<Select
|
|
106
|
+
disabled={pending}
|
|
76
107
|
items={[
|
|
77
|
-
{ label:
|
|
108
|
+
{ label: ALL_CHANNELS_LABEL, value: ALL_CHANNELS },
|
|
78
109
|
...choices.map((name) => ({
|
|
79
110
|
label: name,
|
|
80
111
|
value: channelValue(name),
|
|
@@ -91,7 +122,13 @@ export function NativeBuildsPage({
|
|
|
91
122
|
: undefined,
|
|
92
123
|
)
|
|
93
124
|
}
|
|
94
|
-
value={
|
|
125
|
+
value={
|
|
126
|
+
pending
|
|
127
|
+
? null
|
|
128
|
+
: channel === undefined
|
|
129
|
+
? ALL_CHANNELS
|
|
130
|
+
: channelValue(channel)
|
|
131
|
+
}
|
|
95
132
|
>
|
|
96
133
|
<SelectTrigger
|
|
97
134
|
aria-label="Channel"
|
|
@@ -101,7 +138,9 @@ export function NativeBuildsPage({
|
|
|
101
138
|
</SelectTrigger>
|
|
102
139
|
<SelectContent>
|
|
103
140
|
<SelectGroup>
|
|
104
|
-
<SelectItem value={ALL_CHANNELS}>
|
|
141
|
+
<SelectItem value={ALL_CHANNELS}>
|
|
142
|
+
{ALL_CHANNELS_LABEL}
|
|
143
|
+
</SelectItem>
|
|
105
144
|
{choices.map((name) => (
|
|
106
145
|
<SelectItem
|
|
107
146
|
key={name}
|
|
@@ -120,7 +159,7 @@ export function NativeBuildsPage({
|
|
|
120
159
|
<Button
|
|
121
160
|
aria-label="Refresh native builds"
|
|
122
161
|
className="size-11 sm:size-7"
|
|
123
|
-
disabled={builds.
|
|
162
|
+
disabled={builds.isPending}
|
|
124
163
|
onClick={() => void builds.refetch()}
|
|
125
164
|
size="icon-sm"
|
|
126
165
|
variant="ghost"
|
|
@@ -128,12 +167,33 @@ export function NativeBuildsPage({
|
|
|
128
167
|
<RefreshCw aria-hidden="true" />
|
|
129
168
|
</Button>
|
|
130
169
|
</div>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
170
|
+
{channelsFailed ? (
|
|
171
|
+
<Alert variant="destructive">
|
|
172
|
+
<AlertTriangle />
|
|
173
|
+
<AlertTitle>Channels couldn't be loaded</AlertTitle>
|
|
174
|
+
<AlertDescription>
|
|
175
|
+
Native builds show once the channels load.
|
|
176
|
+
</AlertDescription>
|
|
177
|
+
<AlertAction>
|
|
178
|
+
<Button
|
|
179
|
+
className="min-h-11 sm:min-h-7"
|
|
180
|
+
onClick={() => void channels.refetch()}
|
|
181
|
+
size="xs"
|
|
182
|
+
variant="outline"
|
|
183
|
+
>
|
|
184
|
+
<RefreshCw data-icon="inline-start" />
|
|
185
|
+
Retry
|
|
186
|
+
</Button>
|
|
187
|
+
</AlertAction>
|
|
188
|
+
</Alert>
|
|
189
|
+
) : (
|
|
190
|
+
<NativeBuildsTable
|
|
191
|
+
builds={builds}
|
|
192
|
+
channel={channel}
|
|
193
|
+
onChannel={filterBy}
|
|
194
|
+
paged={before !== undefined || after !== undefined}
|
|
195
|
+
/>
|
|
196
|
+
)}
|
|
137
197
|
</div>
|
|
138
198
|
</div>
|
|
139
199
|
);
|
|
@@ -54,6 +54,7 @@ import { Button, buttonVariants } from "@/components/ui/button";
|
|
|
54
54
|
import { TableCell, TableHead } from "@/components/ui/table";
|
|
55
55
|
import { useIsMobile } from "@/hooks/use-mobile";
|
|
56
56
|
import { useNativeBuildFoldQuery } from "@/lib/api";
|
|
57
|
+
import { ALL_CHANNELS } from "@/lib/constants";
|
|
57
58
|
import {
|
|
58
59
|
formatByteSize,
|
|
59
60
|
nativeBuildArtifacts,
|
|
@@ -64,6 +65,7 @@ import {
|
|
|
64
65
|
} from "@/lib/native-builds";
|
|
65
66
|
import type { Fold } from "@/lib/server/foldedPage";
|
|
66
67
|
import type { NativeBuildFoldedPage } from "@/lib/server/nativeBuilds";
|
|
68
|
+
import type { NativeBuildsSearch } from "@/routes/-native-builds-search";
|
|
67
69
|
|
|
68
70
|
import { CopyableText } from "./CopyableText";
|
|
69
71
|
import { IMPORT_COMMAND, IMPORT_GUIDE_URL } from "./ImportBuild";
|
|
@@ -77,8 +79,8 @@ export const NATIVE_BUILD_GUIDE_URL =
|
|
|
77
79
|
const COLUMNS = 10;
|
|
78
80
|
|
|
79
81
|
/** The page of the list that shows `channel`'s builds, or every build. */
|
|
80
|
-
const channelSearch = (channel: string | undefined) =>
|
|
81
|
-
channel === undefined ? {} : { channel };
|
|
82
|
+
const channelSearch = (channel: string | undefined): NativeBuildsSearch =>
|
|
83
|
+
channel === undefined ? { channels: ALL_CHANNELS } : { channel };
|
|
82
84
|
|
|
83
85
|
/** A fold of older builds: "1 older build", "12 older builds". */
|
|
84
86
|
const OLDER_BUILDS = { one: "older build", other: "older builds" } as const;
|
|
@@ -594,7 +596,7 @@ export function NativeBuildsTable({
|
|
|
594
596
|
readonly builds: {
|
|
595
597
|
readonly data: NativeBuildFoldedPage | undefined;
|
|
596
598
|
readonly isError: boolean;
|
|
597
|
-
readonly
|
|
599
|
+
readonly isPending: boolean;
|
|
598
600
|
readonly isPlaceholderData: boolean;
|
|
599
601
|
readonly refetch: () => unknown;
|
|
600
602
|
};
|
|
@@ -662,7 +664,7 @@ export function NativeBuildsTable({
|
|
|
662
664
|
className="h-full overflow-y-auto aria-busy:opacity-60"
|
|
663
665
|
role="list"
|
|
664
666
|
>
|
|
665
|
-
{builds.
|
|
667
|
+
{builds.isPending ? (
|
|
666
668
|
<DataCardSkeletons label="Loading native builds" />
|
|
667
669
|
) : (
|
|
668
670
|
<>
|
|
@@ -707,7 +709,7 @@ export function NativeBuildsTable({
|
|
|
707
709
|
}
|
|
708
710
|
rowGroups
|
|
709
711
|
>
|
|
710
|
-
{builds.
|
|
712
|
+
{builds.isPending ? (
|
|
711
713
|
<DataTableBody>
|
|
712
714
|
<DataTableSkeletonRows
|
|
713
715
|
columns={COLUMNS}
|
|
@@ -743,7 +745,7 @@ export function NativeBuildsTable({
|
|
|
743
745
|
</DataTable>
|
|
744
746
|
)}
|
|
745
747
|
</DataTableFrame>
|
|
746
|
-
{builds.
|
|
748
|
+
{builds.isPending || entries === undefined ? null : (
|
|
747
749
|
<DataTablePagination
|
|
748
750
|
count={count}
|
|
749
751
|
folded={{ ...foldedTotal(entries), label: "older" }}
|
|
@@ -84,7 +84,7 @@ function SelectContent({
|
|
|
84
84
|
data-slot="select-content"
|
|
85
85
|
data-align-trigger={alignItemWithTrigger}
|
|
86
86
|
className={cn(
|
|
87
|
-
"dark relative isolate z-50 max-h-(--available-height) w-(--
|
|
87
|
+
"dark relative isolate z-50 max-h-(--available-height) w-max max-w-(--available-width) min-w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
88
88
|
className,
|
|
89
89
|
)}
|
|
90
90
|
{...props}
|
|
@@ -120,12 +120,13 @@ function SelectItem({
|
|
|
120
120
|
<SelectPrimitive.Item
|
|
121
121
|
data-slot="select-item"
|
|
122
122
|
className={cn(
|
|
123
|
-
"relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md
|
|
123
|
+
"relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-2 text-xs/relaxed max-md:min-h-11 outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
124
124
|
className,
|
|
125
125
|
)}
|
|
126
126
|
{...props}
|
|
127
127
|
>
|
|
128
|
-
|
|
128
|
+
{/* A name wider than the screen wraps whole rather than clipping. */}
|
|
129
|
+
<SelectPrimitive.ItemText className="flex min-w-0 flex-1 gap-2 [overflow-wrap:anywhere]">
|
|
129
130
|
{children}
|
|
130
131
|
</SelectPrimitive.ItemText>
|
|
131
132
|
<SelectPrimitive.ItemIndicator
|
package/src/lib/api.ts
CHANGED
|
@@ -146,11 +146,15 @@ export function useChannelsQuery() {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export function useReleasesQuery(
|
|
149
|
+
export function useReleasesQuery(
|
|
150
|
+
filters?: ReleaseFilters,
|
|
151
|
+
{ enabled = true }: { readonly enabled?: boolean } = {},
|
|
152
|
+
) {
|
|
150
153
|
return useQuery({
|
|
151
154
|
queryKey: queryKeys.releases.list(filters),
|
|
152
155
|
queryFn: () => getReleases({ data: filters }),
|
|
153
156
|
placeholderData: (previousData) => previousData,
|
|
157
|
+
enabled,
|
|
154
158
|
});
|
|
155
159
|
}
|
|
156
160
|
|
|
@@ -251,12 +255,16 @@ export function useNativeBuildFoldQuery(
|
|
|
251
255
|
}
|
|
252
256
|
|
|
253
257
|
/** One page of native builds, newest first, kept on screen while the next loads. */
|
|
254
|
-
export function useNativeBuildsQuery(
|
|
258
|
+
export function useNativeBuildsQuery(
|
|
259
|
+
page: NativeBuildPage,
|
|
260
|
+
{ enabled = true }: { readonly enabled?: boolean } = {},
|
|
261
|
+
) {
|
|
255
262
|
return useQuery({
|
|
256
263
|
queryKey: queryKeys.nativeBuilds.list(page),
|
|
257
264
|
queryFn: () => getNativeBuilds({ data: page }),
|
|
258
265
|
placeholderData: (previousData) => previousData,
|
|
259
266
|
staleTime: 60_000,
|
|
267
|
+
enabled,
|
|
260
268
|
});
|
|
261
269
|
}
|
|
262
270
|
|
package/src/lib/constants.ts
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
1
|
export const DEFAULT_PAGE_LIMIT = 20;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The channel the SDK and the CLI use when none is chosen. Insights, Bundles,
|
|
5
|
+
* and Native builds open on it when the URL names no channel.
|
|
6
|
+
*/
|
|
7
|
+
export const DEFAULT_CHANNEL = "production";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The URL's `channels` value that lists every channel. It has a key of its
|
|
11
|
+
* own because any name, `all` included, can be a channel's.
|
|
12
|
+
*/
|
|
13
|
+
export const ALL_CHANNELS = "all";
|
|
14
|
+
|
|
15
|
+
/** The channel filter's choice that lists every channel, on every page. */
|
|
16
|
+
export const ALL_CHANNELS_LABEL = "All channels";
|
|
@@ -17,9 +17,6 @@ const readHealthChart = (value: unknown): HealthChart | undefined =>
|
|
|
17
17
|
const readUsageWindow = (value: unknown): UsageWindow | undefined =>
|
|
18
18
|
value === "12m" ? value : readWindow(value);
|
|
19
19
|
|
|
20
|
-
/** The channel Insights reads when none is chosen: the SDK's and the CLI's default. */
|
|
21
|
-
export const DEFAULT_INSIGHTS_CHANNEL = "production";
|
|
22
|
-
|
|
23
20
|
export type InsightsSearch = {
|
|
24
21
|
/** Every report's platform; both when omitted. */
|
|
25
22
|
platform?: AppUsageScope["platform"];
|
|
@@ -3,6 +3,7 @@ import { assertCanonicalChannelName } from "@hot-updater/protocol";
|
|
|
3
3
|
|
|
4
4
|
import type { NativeBuildDetailSearch } from "@/components/features/native-builds/NativeBuildDetailPage";
|
|
5
5
|
import type { NativeBuildPage } from "@/lib/api";
|
|
6
|
+
import { ALL_CHANNELS, DEFAULT_CHANNEL } from "@/lib/constants";
|
|
6
7
|
|
|
7
8
|
const text = (value: unknown) =>
|
|
8
9
|
typeof value === "string" && value.length > 0 ? value : undefined;
|
|
@@ -25,20 +26,47 @@ const defined = <T extends object>(values: T): T =>
|
|
|
25
26
|
) as T;
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
|
-
* The native build list's URL: a channel the builds embed,
|
|
29
|
-
* page. A page has one direction, so `before` wins over
|
|
29
|
+
* The native build list's URL: a channel the builds embed, or every channel,
|
|
30
|
+
* and one keyset page. A page has one direction, so `before` wins over
|
|
31
|
+
* `after`.
|
|
30
32
|
*/
|
|
33
|
+
export type NativeBuildsSearch = NativeBuildPage & {
|
|
34
|
+
/** Every channel, where the list would open on the default one. */
|
|
35
|
+
readonly channels?: typeof ALL_CHANNELS;
|
|
36
|
+
};
|
|
37
|
+
|
|
31
38
|
export const validateNativeBuildsSearch = (
|
|
32
39
|
search: Record<string, unknown>,
|
|
33
|
-
):
|
|
40
|
+
): NativeBuildsSearch => {
|
|
34
41
|
const before = text(search.before);
|
|
42
|
+
const channel = channelName(search.channel);
|
|
35
43
|
return defined({
|
|
36
|
-
channel
|
|
44
|
+
channel,
|
|
45
|
+
channels:
|
|
46
|
+
channel === undefined && search.channels === ALL_CHANNELS
|
|
47
|
+
? ALL_CHANNELS
|
|
48
|
+
: undefined,
|
|
37
49
|
before,
|
|
38
50
|
after: before === undefined ? text(search.after) : undefined,
|
|
39
51
|
});
|
|
40
52
|
};
|
|
41
53
|
|
|
54
|
+
/**
|
|
55
|
+
* The page the list reads. A URL that names no channel opens on the default
|
|
56
|
+
* channel, or on every channel when the project has no such channel;
|
|
57
|
+
* undefined until the channel names, which the page reads anyway, arrive.
|
|
58
|
+
*/
|
|
59
|
+
export const resolveNativeBuildsSearch = (
|
|
60
|
+
{ channels, ...page }: NativeBuildsSearch,
|
|
61
|
+
channelNames: readonly string[] | undefined,
|
|
62
|
+
): NativeBuildPage | undefined => {
|
|
63
|
+
if (page.channel !== undefined || channels === ALL_CHANNELS) return page;
|
|
64
|
+
if (channelNames === undefined) return undefined;
|
|
65
|
+
return channelNames.includes(DEFAULT_CHANNEL)
|
|
66
|
+
? { channel: DEFAULT_CHANNEL, ...page }
|
|
67
|
+
: page;
|
|
68
|
+
};
|
|
69
|
+
|
|
42
70
|
/** A native build page's URL: one page of the patches from it. */
|
|
43
71
|
export const validateNativeBuildDetailSearch = (
|
|
44
72
|
search: Record<string, unknown>,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { ReleaseFilter } from "@hot-updater/plugin-core";
|
|
1
|
+
import type { ChannelRow, ReleaseFilter } from "@hot-updater/plugin-core";
|
|
2
|
+
|
|
3
|
+
import { ALL_CHANNELS, DEFAULT_CHANNEL } from "@/lib/constants";
|
|
2
4
|
|
|
3
5
|
export interface ReleaseSearch {
|
|
4
6
|
/** Releases newer than this id: the previous page. */
|
|
@@ -7,6 +9,8 @@ export interface ReleaseSearch {
|
|
|
7
9
|
beforeReleaseId?: string;
|
|
8
10
|
bundleId?: string;
|
|
9
11
|
channelId?: string;
|
|
12
|
+
/** Every channel, where the list would open on the default one. */
|
|
13
|
+
channels?: typeof ALL_CHANNELS;
|
|
10
14
|
enabled?: boolean;
|
|
11
15
|
platform?: "ios" | "android";
|
|
12
16
|
releaseId?: string;
|
|
@@ -47,12 +51,17 @@ export function validateReleaseSearch(
|
|
|
47
51
|
: search.platform === "android"
|
|
48
52
|
? "android"
|
|
49
53
|
: "ios";
|
|
54
|
+
const channels =
|
|
55
|
+
!bundleId && !scopeKey && !channelId && search.channels === ALL_CHANNELS
|
|
56
|
+
? ALL_CHANNELS
|
|
57
|
+
: undefined;
|
|
50
58
|
|
|
51
59
|
return {
|
|
52
60
|
afterReleaseId,
|
|
53
61
|
beforeReleaseId,
|
|
54
62
|
bundleId,
|
|
55
63
|
channelId,
|
|
64
|
+
channels,
|
|
56
65
|
enabled: scopeKey || channelId ? enabled : undefined,
|
|
57
66
|
platform,
|
|
58
67
|
releaseId: optionalString(search.releaseId),
|
|
@@ -82,6 +91,33 @@ export function hasReleaseFilters(search: ReleaseSearch): boolean {
|
|
|
82
91
|
return releaseFilterOf(search).kind !== "all";
|
|
83
92
|
}
|
|
84
93
|
|
|
94
|
+
/**
|
|
95
|
+
* The search the list shows. A URL that names no channel, bundle, or scope
|
|
96
|
+
* opens on the default channel's iOS releases, or on every channel when the
|
|
97
|
+
* project has no such channel; undefined until the channel list, which the
|
|
98
|
+
* page reads anyway, arrives. A link to one release that names no channel
|
|
99
|
+
* shows every channel, so its row shows wherever it is.
|
|
100
|
+
*/
|
|
101
|
+
export function resolveReleaseSearch(
|
|
102
|
+
search: ReleaseSearch,
|
|
103
|
+
channels: readonly Pick<ChannelRow, "id" | "name">[] | undefined,
|
|
104
|
+
): ReleaseSearch | undefined {
|
|
105
|
+
if (
|
|
106
|
+
search.bundleId ||
|
|
107
|
+
search.scopeKey ||
|
|
108
|
+
search.channelId ||
|
|
109
|
+
search.channels === ALL_CHANNELS
|
|
110
|
+
) {
|
|
111
|
+
return search;
|
|
112
|
+
}
|
|
113
|
+
if (search.releaseId) return { ...search, channels: ALL_CHANNELS };
|
|
114
|
+
if (channels === undefined) return undefined;
|
|
115
|
+
const defaultChannel = channels.find(({ name }) => name === DEFAULT_CHANNEL);
|
|
116
|
+
return defaultChannel
|
|
117
|
+
? validateReleaseSearch({ ...search, channelId: defaultChannel.id })
|
|
118
|
+
: search;
|
|
119
|
+
}
|
|
120
|
+
|
|
85
121
|
/**
|
|
86
122
|
* A new filter starts from the first page. A bundle or scope filter replaces
|
|
87
123
|
* the others, and choosing a channel or platform clears them.
|
|
@@ -91,7 +127,12 @@ export function updateReleaseFilters(
|
|
|
91
127
|
filters: Partial<
|
|
92
128
|
Pick<
|
|
93
129
|
ReleaseSearch,
|
|
94
|
-
|
|
130
|
+
| "bundleId"
|
|
131
|
+
| "channelId"
|
|
132
|
+
| "channels"
|
|
133
|
+
| "enabled"
|
|
134
|
+
| "platform"
|
|
135
|
+
| "scopeKey"
|
|
95
136
|
>
|
|
96
137
|
>,
|
|
97
138
|
): ReleaseSearch {
|
|
@@ -107,6 +148,7 @@ export function updateReleaseFilters(
|
|
|
107
148
|
if ("channelId" in filters || "platform" in filters) {
|
|
108
149
|
return validateReleaseSearch({
|
|
109
150
|
channelId: next.channelId,
|
|
151
|
+
channels: next.channels,
|
|
110
152
|
enabled: next.enabled,
|
|
111
153
|
platform: next.platform,
|
|
112
154
|
});
|
|
@@ -114,8 +156,27 @@ export function updateReleaseFilters(
|
|
|
114
156
|
return validateReleaseSearch({
|
|
115
157
|
bundleId: next.bundleId,
|
|
116
158
|
channelId: next.channelId,
|
|
159
|
+
channels: next.channels,
|
|
117
160
|
enabled: next.enabled,
|
|
118
161
|
platform: next.platform,
|
|
119
162
|
scopeKey: next.scopeKey,
|
|
120
163
|
});
|
|
121
164
|
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Whether the list shows what it opens on, so Clear has nothing to clear;
|
|
168
|
+
* true until the channel list arrives.
|
|
169
|
+
*/
|
|
170
|
+
export function showsDefaultReleases(
|
|
171
|
+
search: ReleaseSearch,
|
|
172
|
+
channels: readonly Pick<ChannelRow, "id" | "name">[] | undefined,
|
|
173
|
+
): boolean {
|
|
174
|
+
const view = resolveReleaseSearch(search, channels);
|
|
175
|
+
const opening = resolveReleaseSearch({}, channels);
|
|
176
|
+
return (
|
|
177
|
+
view === undefined ||
|
|
178
|
+
opening === undefined ||
|
|
179
|
+
JSON.stringify(releaseFilterOf(view)) ===
|
|
180
|
+
JSON.stringify(releaseFilterOf(opening))
|
|
181
|
+
);
|
|
182
|
+
}
|