@hot-updater/console 1.0.0-rc.9 → 1.0.0
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/ConsoleFeatureUnavailable-jB4Loglh.js +1 -0
- package/.output/public/assets/EventDetails-B6yUsyNA.js +1 -0
- package/.output/public/assets/HashValueDisplay-BFX_kY3-.js +1 -0
- package/.output/public/assets/InsightsInfo-BNO0WznZ.js +1 -0
- package/.output/public/assets/InsightsPageHeader-B892oVml.js +1 -0
- package/.output/public/assets/NotFoundPage-DIqCpWa3.js +1 -0
- package/.output/public/assets/alert-dialog-Bbk_4-WJ.js +1 -0
- package/.output/public/assets/api-DCM0wr6O.js +1 -0
- package/.output/public/assets/api-keys-CIO9L_wu.js +1 -0
- package/.output/public/assets/api-keys-DVTL_--f.js +1 -0
- package/.output/public/assets/arrow-left-CnMYpqB7.js +1 -0
- package/.output/public/assets/arrow-up-right-BtffZA6e.js +1 -0
- package/.output/public/assets/chevron-right-BqD5wtFb.js +1 -0
- package/.output/public/assets/clipboard-DS9ucUQL.js +1 -0
- package/.output/public/assets/console-features-api-BH5m_PtQ.js +1 -0
- package/.output/public/assets/dialog-Bqbb7B0N.js +1 -0
- package/.output/public/assets/dist-LxKJB-Vu.js +1 -0
- package/.output/public/assets/empty-CuT2UhFp.js +1 -0
- package/.output/public/assets/field-BBDpjIqu.js +1 -0
- package/.output/public/assets/index-6o51GkFe.js +11 -0
- package/.output/public/assets/input-group-ja_30qaF.js +1 -0
- package/.output/public/assets/insights-CmraDzQh.js +1 -0
- package/.output/public/assets/insights-CxZ2GCYV.js +2 -0
- package/.output/public/assets/insights-api-BigAU9sZ.js +1 -0
- package/.output/public/assets/insights-usage-rpc-DYEhsCKT.js +1 -0
- package/.output/public/assets/insights-vNRCrfnS.js +42 -0
- package/.output/public/assets/insights_.distribution-ChOerfJt.js +1 -0
- package/.output/public/assets/insights_.distribution-D-e4iga8.js +1 -0
- package/.output/public/assets/insights_.distribution-DZtkibX1.js +2 -0
- package/.output/public/assets/installations-BazSJXE0.js +2 -0
- package/.output/public/assets/installations-ClHTqdAO.js +1 -0
- package/.output/public/assets/installations-DpKsBuHi.js +1 -0
- package/.output/public/assets/key-round-wS_SIZ6b.js +1 -0
- package/.output/public/assets/list-CgrYiadM.js +1 -0
- package/.output/public/assets/refresh-cw-BYgoNCco.js +1 -0
- package/.output/public/assets/remote-config-BWwHOkCK.js +1 -0
- package/.output/public/assets/remote-config-Br56BODb.js +6 -0
- package/.output/public/assets/remote-config-CXOi0LRu.js +1 -0
- package/.output/public/assets/routes-B88Erkpk.js +2 -0
- package/.output/public/assets/routes-CfzsAleC.js +1 -0
- package/.output/public/assets/search-DaTDPW25.js +1 -0
- package/.output/public/assets/select-BZZBXMkr.js +1 -0
- package/.output/public/assets/sidebar-DNVyJPfX.js +3 -0
- package/.output/public/assets/smartphone-DpTFgtKf.js +1 -0
- package/.output/public/assets/styles-DTGEAJFv.css +2 -0
- package/.output/public/assets/switch-DZ1TPwx-.js +1 -0
- package/.output/public/assets/table-Gm4qRWwE.js +1 -0
- package/.output/public/assets/tabs-C7FOEjFC.js +1 -0
- package/.output/public/assets/undo-2-CmrHjwFc.js +1 -0
- package/.output/public/assets/useCompositeListItem-9E4pj_CH.js +1 -0
- package/.output/public/assets/valueToPercent-CH8GCHaL.js +1 -0
- package/.output/server/__23tanstack-start-server-fn-resolver-BpRlos5Q.mjs +170 -0
- package/.output/server/_libs/@base-ui/react+[...].mjs +4389 -4207
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +3802 -4022
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +140 -97
- package/.output/server/_libs/lucide-react.mjs +221 -9
- package/.output/server/_libs/next-themes.mjs +1 -1
- package/.output/server/_libs/react-redux+[...].mjs +1 -1
- package/.output/server/_libs/recharts+[...].mjs +483 -901
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_libs/tanstack__history.mjs +68 -41
- package/.output/server/_libs/tanstack__query-core.mjs +2010 -309
- package/.output/server/_libs/tanstack__react-query.mjs +448 -21
- package/.output/server/_libs/verkit.mjs +102 -1
- package/.output/server/_ssr/BundleIdDisplay-x94o9rlU.mjs +13 -0
- package/.output/server/_ssr/ConsoleFeatureUnavailable-ldW8v8-q.mjs +58 -0
- package/.output/server/_ssr/EventDetails-Q8kfj9Nr.mjs +344 -0
- package/.output/server/_ssr/{HashValueDisplay-CyMmr0O9.mjs → HashValueDisplay-n1GholGS.mjs} +3 -3
- package/.output/server/_ssr/InsightsInfo-DuJFatQO.mjs +75 -0
- package/.output/server/_ssr/InsightsPageHeader-BSUX3Ye9.mjs +145 -0
- package/.output/server/_ssr/NotFoundPage-DZzOOzS3.mjs +37 -0
- package/.output/server/_ssr/{dialog-CKvQ4VIE.mjs → alert-dialog-C43Doa0I.mjs} +6 -83
- package/.output/server/_ssr/{api-keys-CzZ7Ont4.mjs → api-keys-B4sYm8dM.mjs} +48 -9
- package/.output/server/_ssr/api-keys-CEnM9fqG.mjs +5 -0
- package/.output/server/_ssr/api-keys-rpc-BIFuUgMt.mjs +52 -0
- package/.output/server/_ssr/api-oZjRn9tP.mjs +186 -0
- package/.output/server/_ssr/api-rpc-BNiFRRK8.mjs +240 -0
- package/.output/server/_ssr/{auth-BF8mbAgF.mjs → auth-UP0wXs4i.mjs} +1 -1
- package/.output/server/_ssr/{auth-rpc-DH6Bhwcz.mjs → auth-rpc-DnZqYxyq.mjs} +6 -6
- package/.output/server/_ssr/auth.server-DFpyxRDd.mjs +5374 -0
- package/.output/server/_ssr/bundleActivity-M5gzBFNg.mjs +18 -0
- package/.output/server/_ssr/config-WVX4IxSR.mjs +15 -0
- package/.output/server/_ssr/config.server-DskXCAyI.mjs +35 -0
- package/.output/server/_ssr/console-access-BJfAXknd.mjs +17 -0
- package/.output/server/_ssr/console-features-Oz0q20jJ.mjs +61 -0
- package/.output/server/_ssr/console-features-api-C9kiKvaV.mjs +43 -0
- package/.output/server/_ssr/console-features-rpc-P0GL7Z-R.mjs +19 -0
- package/.output/server/_ssr/{createServerFn-B2hcXoPM.mjs → createMiddleware-Cm6Tn0_Y.mjs} +67 -56
- package/.output/server/_ssr/{createServerRpc-DB29C_5p.mjs → createServerRpc-RLR4H-Fn.mjs} +2 -2
- package/.output/server/_ssr/databaseConfig-C5SkAyUy.mjs +5 -0
- package/.output/server/_ssr/{databaseJsonValue-d6I3nAS4.mjs → databaseJsonValue-Csbuzc9Q.mjs} +28 -5
- package/.output/server/_ssr/databaseRows-CPphvbag.mjs +73 -0
- package/.output/server/_ssr/dialog-BbYDMjdC.mjs +84 -0
- package/.output/server/_ssr/{dist-CyzPaI5v.mjs → dist-CbQbBIw-.mjs} +140 -7
- package/.output/server/_ssr/{downloadBundle-CI7JUKvC.mjs → downloadBundle-CZysjmNW.mjs} +10 -10
- package/.output/server/_ssr/empty-CVLGfxuu.mjs +60 -0
- package/.output/server/_ssr/{empty-plugin-adapters-B5QvGpEl.mjs → empty-plugin-adapters-CPtwX8a7.mjs} +1 -1
- package/.output/server/_ssr/failureReports-DKDhVsXA.mjs +33 -0
- package/.output/server/_ssr/field-asw83X0v.mjs +189 -0
- package/.output/server/_ssr/getBundleChildren-Cv9iz1As.mjs +22 -0
- package/.output/server/_ssr/{input-group-BrGSjz4S.mjs → input-group-CuYJHosb.mjs} +2 -2
- package/.output/server/_ssr/insights-B55FG5fm.mjs +14 -0
- package/.output/server/_ssr/insights-CWnHIFUV.mjs +5 -0
- package/.output/server/_ssr/insights-CpLpedFZ.mjs +2315 -0
- package/.output/server/_ssr/insights-api-sjws23WF.mjs +122 -0
- package/.output/server/_ssr/insights-errors-BjnFUyZj.mjs +34 -0
- package/.output/server/_ssr/insights-failures-rpc-BvbWvqNf.mjs +36 -0
- package/.output/server/_ssr/insights-failures-xaa41Buf.mjs +46 -0
- package/.output/server/_ssr/insights-recovery-BWQhiZaF.mjs +28 -0
- package/.output/server/_ssr/insights-recovery-rpc-GiYXdkaY.mjs +32 -0
- package/.output/server/_ssr/{insights-rpc-DDKmIrpV.mjs → insights-rpc-DP_8Rmz4.mjs} +22 -14
- package/.output/server/_ssr/insights-usage-BpBM0U0c.mjs +29 -0
- package/.output/server/_ssr/insights-usage-rpc-BiolgB8e.mjs +29 -0
- package/.output/server/_ssr/insights-usage-rpc-KStL0zOx.mjs +41 -0
- package/.output/server/_ssr/insightsUsage-CzhVjsc8.mjs +56 -0
- package/.output/server/_ssr/insights_.distribution-CVrnbP3R.mjs +7 -0
- package/.output/server/_ssr/insights_.distribution-D2HaNTAA.mjs +16 -0
- package/.output/server/_ssr/{insights_.distribution-cIsU-kHG.mjs → insights_.distribution-DN9pR422.mjs} +50 -22
- package/.output/server/_ssr/installations-BHmbbnH8.mjs +5 -0
- package/.output/server/_ssr/{installations-C5anhyP0.mjs → installations-BSCmFq8Q.mjs} +279 -367
- package/.output/server/_ssr/installations-DD1g__Nc.mjs +69 -0
- package/.output/server/_ssr/listReleases-BfUBlCHo.mjs +79 -0
- package/.output/server/_ssr/plugins-BaD1slHx.mjs +2086 -0
- package/.output/server/_ssr/release-adoption-005tQRpo.mjs +55 -0
- package/.output/server/_ssr/release-adoption-rpc-BsstqxUp.mjs +41 -0
- package/.output/server/_ssr/releaseAdoption-CtOFkwli.mjs +114 -0
- package/.output/server/_ssr/releaseManagement-DFMUnDF5.mjs +11 -0
- package/.output/server/_ssr/remote-config-C2Ee8lXO.mjs +5 -0
- package/.output/server/_ssr/remote-config-Dv1ccMo-.mjs +17 -0
- package/.output/server/_ssr/remote-config-of0lGQH8.mjs +2648 -0
- package/.output/server/_ssr/remote-config-rpc-BzX31mUS.mjs +115 -0
- package/.output/server/_ssr/rolldown-runtime-rSIU-vHC.mjs +13 -0
- package/.output/server/_ssr/{router-BuanSsRI.mjs → router-D8NuoJ_I.mjs} +107 -134
- package/.output/server/_ssr/{routes-DY-vqU6R.mjs → routes-DgvnFqDy.mjs} +195 -429
- package/.output/server/_ssr/routes-V8sDybGf.mjs +409 -0
- package/.output/server/_ssr/runtime.server-De0QVWc9.mjs +104 -0
- package/.output/server/_ssr/schema-BiAVyEj2.mjs +361 -0
- package/.output/server/_ssr/{select-DD2szs3Y.mjs → select-t3iXRwc9.mjs} +3 -3
- package/.output/server/_ssr/server-h4VxnExB.mjs +8325 -0
- package/.output/server/_ssr/{createSsrRpc-CdlfejmI.mjs → sidebar-DJcErBMo.mjs} +107 -47
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/start-BfFbHKMK.mjs +4 -0
- package/.output/server/_ssr/switch-E-btwMGt.mjs +43 -0
- package/.output/server/_ssr/{table-CTj6n-4F.mjs → table-37Dd23TN.mjs} +2 -2
- package/.output/server/_ssr/tabs-DEFnTm95.mjs +45 -0
- package/.output/server/_ssr/updateFailures-H6pnnYK4.mjs +40 -0
- package/.output/server/_ssr/{uuidv7-D0QFkPL_.mjs → uuidv7-C88s9jWF.mjs} +2 -2
- package/.output/server/_tanstack-start-manifest_v-55AGsehh.mjs +139 -0
- package/.output/server/index.mjs +309 -211
- package/LICENSE +13 -14
- package/README.md +80 -71
- package/lib/index.d.mts +23 -11
- package/lib/vite-internal.mjs +13 -3
- package/lib/vite.d.mts +2 -0
- package/package.json +14 -14
- package/src/components/AppSidebar.tsx +69 -74
- package/src/components/ConsoleFeatureUnavailable.tsx +80 -0
- package/src/components/NotFoundPage.tsx +7 -7
- package/src/components/features/FeatureSlots.tsx +103 -0
- package/src/components/features/api-keys/apiKeysFeatureUi.tsx +15 -0
- package/src/components/features/bundles/BundleMetadata.tsx +8 -5
- package/src/components/features/bundles/RolloutCohortsDialog.tsx +1 -1
- package/src/components/features/channels/ChannelManagementDialog.tsx +8 -6
- package/src/components/features/insights/AppUsage.tsx +41 -14
- package/src/components/features/insights/BuiltinBundle.tsx +36 -0
- package/src/components/features/insights/ComparedBundlesChart.tsx +310 -0
- package/src/components/features/insights/EstimatedCount.tsx +18 -0
- package/src/components/features/insights/EventDetails.tsx +390 -26
- package/src/components/features/insights/EventHistoryCard.tsx +111 -25
- package/src/components/features/insights/EventHistoryList.tsx +1 -1
- package/src/components/features/insights/FailureReports.tsx +407 -0
- package/src/components/features/insights/InsightsControls.tsx +240 -142
- package/src/components/features/insights/InsightsErrorAlert.tsx +14 -1
- package/src/components/features/insights/InsightsOverview.tsx +601 -403
- package/src/components/features/insights/InsightsPageHeader.tsx +19 -14
- package/src/components/features/insights/InsightsPeriodSelector.tsx +67 -12
- package/src/components/features/insights/InstallationHistoryCard.tsx +65 -10
- package/src/components/features/insights/InstallationMatchesCard.tsx +1 -1
- package/src/components/features/insights/ReleaseActivity.tsx +308 -0
- package/src/components/features/insights/ReportingDevicesSummary.tsx +13 -13
- package/src/components/features/insights/RollbackButton.tsx +118 -0
- package/src/components/features/insights/UpdateFailures.tsx +382 -0
- package/src/components/features/insights/insightsFeatureUi.tsx +35 -0
- package/src/components/features/releases/ReleaseEditorSheet.tsx +27 -13
- package/src/components/features/remote-config/ConditionDialog.tsx +592 -0
- package/src/components/features/remote-config/ConditionsCard.tsx +247 -0
- package/src/components/features/remote-config/ParameterDialog.tsx +426 -0
- package/src/components/features/remote-config/ParametersCard.tsx +254 -0
- package/src/components/features/remote-config/PreviewCard.tsx +284 -0
- package/src/components/features/remote-config/PublishDialog.tsx +325 -0
- package/src/components/features/remote-config/RemoteConfigPage.tsx +353 -0
- package/src/components/features/remote-config/RuleSummary.tsx +21 -0
- package/src/components/features/remote-config/ValueInput.tsx +151 -0
- package/src/components/features/remote-config/VersionsCard.tsx +384 -0
- package/src/components/features/remote-config/remoteConfigFeatureUi.tsx +15 -0
- package/src/components/features/remote-config/useDateTimeText.ts +16 -0
- package/src/components/ui/sidebar.tsx +22 -29
- package/src/index.ts +26 -19
- package/src/lib/api-keys-api.ts +0 -28
- package/src/lib/api-keys-rpc.ts +27 -38
- package/src/lib/api-rpc.ts +125 -288
- package/src/lib/api.ts +15 -134
- package/src/lib/bundle-activity.ts +24 -4
- package/src/lib/console-access.ts +20 -0
- package/src/lib/console-features-api.ts +68 -0
- package/src/lib/console-features-rpc.ts +13 -0
- package/src/lib/console-features.ts +98 -0
- package/src/lib/insights-api.ts +56 -2
- package/src/lib/insights-errors.ts +64 -0
- package/src/lib/insights-failures-rpc.ts +36 -0
- package/src/lib/insights-failures.ts +130 -0
- package/src/lib/insights-recovery-rpc.ts +13 -17
- package/src/lib/insights-recovery.ts +12 -36
- package/src/lib/insights-retention.ts +21 -0
- package/src/lib/insights-rpc.ts +30 -12
- package/src/lib/insights-search.ts +50 -4
- package/src/lib/insights-usage-rpc.ts +15 -9
- package/src/lib/insights-usage.ts +41 -3
- package/src/lib/insights-view.ts +34 -5
- package/src/lib/release-adoption-api.ts +214 -0
- package/src/lib/release-adoption-rpc.ts +49 -0
- package/src/lib/release-adoption.ts +164 -0
- package/src/lib/remote-config-api.ts +119 -0
- package/src/lib/remote-config-draft.ts +666 -0
- package/src/lib/remote-config-rpc.ts +196 -0
- package/src/lib/scroll-restoration.ts +21 -0
- package/src/lib/server/auth.server.ts +13 -5
- package/src/lib/server/bundleActivity.ts +27 -28
- package/src/lib/server/config.server.ts +21 -76
- package/src/lib/server/console-feature-apis.ts +70 -0
- package/src/lib/server/console-runtime.server.ts +82 -38
- package/src/lib/server/downloadBundle.ts +14 -15
- package/src/lib/server/failureReports.ts +50 -0
- package/src/lib/server/getBundleChildren.ts +31 -122
- package/src/lib/server/insightsUsage.ts +52 -113
- package/src/lib/server/listReleases.ts +109 -44
- package/src/lib/server/releaseAdoption.ts +151 -0
- package/src/lib/server/releaseReachability.ts +8 -8
- package/src/lib/server/remoteConfig.ts +75 -0
- package/src/lib/server/runtime.server.ts +120 -31
- package/src/lib/server/updateFailures.ts +66 -0
- package/src/lib/use-dialog-target.ts +27 -0
- package/src/routeTree.gen.ts +44 -44
- package/src/router.tsx +3 -2
- package/src/routes/-installations-search.ts +32 -8
- package/src/routes/-releases-search.ts +76 -29
- package/src/routes/__root.tsx +7 -1
- package/src/routes/api/bundles/$bundleId/download.ts +2 -5
- package/src/routes/api-keys.tsx +5 -2
- package/src/routes/index.tsx +210 -152
- package/src/routes/insights.tsx +91 -23
- package/src/routes/insights_.distribution.tsx +50 -9
- package/src/routes/installations.tsx +97 -40
- package/src/routes/remote-config.tsx +42 -0
- package/src/styles.css +9 -0
- package/src/vite-internal.ts +15 -3
- package/src/vite.ts +2 -0
- package/.output/public/assets/HashValueDisplay-BpTc3Oyg.js +0 -1
- package/.output/public/assets/InsightsPageHeader-DC2eEst8.js +0 -1
- package/.output/public/assets/api-CdUyUqzR.js +0 -42
- package/.output/public/assets/api-keys-64PM9PwW.js +0 -1
- package/.output/public/assets/api-keys-api-BeaJnvY5.js +0 -1
- package/.output/public/assets/arrow-left-04Rh8Zgp.js +0 -1
- package/.output/public/assets/card-CYHs5FZv.js +0 -1
- package/.output/public/assets/chart-no-axes-combined-DwyMsVFW.js +0 -1
- package/.output/public/assets/createServerFn-DU71xucx.js +0 -3
- package/.output/public/assets/dialog-IVMkBRCq.js +0 -1
- package/.output/public/assets/dist-BR4GzeEu.js +0 -1
- package/.output/public/assets/field-B3CYDpjg.js +0 -1
- package/.output/public/assets/index-Cb_D1D6N.js +0 -10
- package/.output/public/assets/info-C3y9HNoU.js +0 -1
- package/.output/public/assets/input-group-nLZylhWF.js +0 -1
- package/.output/public/assets/insights-Bm9v8uO3.js +0 -2
- package/.output/public/assets/insights-DS3iO7Up.js +0 -1
- package/.output/public/assets/insights-search-Byj3g3Mp.js +0 -1
- package/.output/public/assets/insights-usage-rpc-BaGR3lgq.js +0 -1
- package/.output/public/assets/insights_.distribution-B1i6cjlQ.js +0 -1
- package/.output/public/assets/insights_.distribution-C1Wf27eB.js +0 -2
- package/.output/public/assets/installations-CkFW4fV9.js +0 -2
- package/.output/public/assets/installations-DxTaIcHD.js +0 -1
- package/.output/public/assets/lazyRouteComponent-BapzjYnb.js +0 -1
- package/.output/public/assets/list-Dqt53fWZ.js +0 -1
- package/.output/public/assets/loader-circle-CUKfUqow.js +0 -1
- package/.output/public/assets/preload-helper-ClBMtM1g.js +0 -1
- package/.output/public/assets/refresh-cw-CNE_2PnD.js +0 -1
- package/.output/public/assets/routes-Cgtvspjg.js +0 -2
- package/.output/public/assets/routes-O2r2UUN8.js +0 -1
- package/.output/public/assets/shield-check-BFcJ46kz.js +0 -1
- package/.output/public/assets/signing-BgspC-xP.js +0 -1
- package/.output/public/assets/styles-DnrWuBwd.css +0 -2
- package/.output/public/assets/table-BuWQgxJJ.js +0 -1
- package/.output/public/assets/useMutation-CSV9NCUl.js +0 -1
- package/.output/public/assets/useOpenInteractionType-D5kduCTD.js +0 -1
- package/.output/public/assets/valueToPercent-BAtcbSLk.js +0 -1
- package/.output/server/__23tanstack-start-server-fn-resolver-DBRojHaG.mjs +0 -150
- package/.output/server/_ssr/InsightsPageHeader-mtxVuZKK.mjs +0 -64
- package/.output/server/_ssr/api-BfCgYlj5.mjs +0 -332
- package/.output/server/_ssr/api-keys-api-C3oeq01R.mjs +0 -60
- package/.output/server/_ssr/api-keys-rpc-CdPFdGOx.mjs +0 -136
- package/.output/server/_ssr/api-rpc-B2E1ZIG5.mjs +0 -1399
- package/.output/server/_ssr/auth.server-CmicHh0J.mjs +0 -47
- package/.output/server/_ssr/bundle-signing-rpc-Di7-I6fE.mjs +0 -16
- package/.output/server/_ssr/bundle-signing.server-Uqt1OF49.mjs +0 -12
- package/.output/server/_ssr/bundleActivity-pBrPSG01.mjs +0 -28
- package/.output/server/_ssr/card-Bemj0dpY.mjs +0 -108
- package/.output/server/_ssr/config-Dv8qLDZ0.mjs +0 -13
- package/.output/server/_ssr/config.server-B8WsT3s0.mjs +0 -368
- package/.output/server/_ssr/databaseRows-5bCRTxm-.mjs +0 -126
- package/.output/server/_ssr/deleteBundle-8X-jq7Z7.mjs +0 -66
- package/.output/server/_ssr/field-BrQ2u0fT.mjs +0 -74
- package/.output/server/_ssr/getBundleChildren-DoL8l_AS.mjs +0 -50
- package/.output/server/_ssr/insights-BwQ-wF2a.mjs +0 -10
- package/.output/server/_ssr/insights-gr1I_dJU.mjs +0 -938
- package/.output/server/_ssr/insights-recovery-Cv6RSyeR.mjs +0 -21
- package/.output/server/_ssr/insights-recovery-rpc-DOzxfYfv.mjs +0 -37
- package/.output/server/_ssr/insights-search-1czJMZgk.mjs +0 -21
- package/.output/server/_ssr/insights-usage-rpc-4ImOq_0p.mjs +0 -184
- package/.output/server/_ssr/insights-usage-rpc-BUruODjE.mjs +0 -24
- package/.output/server/_ssr/insightsContract-B09K_Px1.mjs +0 -303
- package/.output/server/_ssr/insightsHistory-Ci4rYAgl.mjs +0 -41
- package/.output/server/_ssr/insightsRecovery-CaghWL2t.mjs +0 -113
- package/.output/server/_ssr/insightsUsage-DNIj6jxF.mjs +0 -71
- package/.output/server/_ssr/insights_.distribution-VmHuikRE.mjs +0 -10
- package/.output/server/_ssr/installations-HXMF_kKf.mjs +0 -29
- package/.output/server/_ssr/routes-Dru3IRj0.mjs +0 -37
- package/.output/server/_ssr/runtime.server-CsiKFp_Z.mjs +0 -436
- package/.output/server/_ssr/server-DJm72Kj-.mjs +0 -7468
- package/.output/server/_ssr/signing-H8Lg4lPe.mjs +0 -133
- package/.output/server/_ssr/start-DpViQGnt.mjs +0 -4
- package/.output/server/_tanstack-start-manifest_v-DsFcTLw_.mjs +0 -125
- package/src/components/features/bundles/BundleActivityChart.tsx +0 -97
- package/src/components/features/bundles/BundleInsightsSummary.tsx +0 -126
- package/src/components/features/signing/BundleSigningPage.tsx +0 -139
- package/src/lib/bundle-signing-api.ts +0 -14
- package/src/lib/bundle-signing-rpc.ts +0 -16
- package/src/lib/server/bundle-signing.server.ts +0 -23
- package/src/lib/server/deleteBundle.ts +0 -145
- package/src/lib/server/insightsHistory.ts +0 -52
- package/src/lib/server/insightsRecovery.ts +0 -187
- package/src/routes/signing.tsx +0 -37
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
import { x as isUUIDv7 } from "./dist-CyzPaI5v.mjs";
|
|
2
|
-
import { t as createUUIDv7 } from "./uuidv7-D0QFkPL_.mjs";
|
|
3
|
-
import { i as toInsightsInstallationRow, n as isInsightsMovementEvent, t as compareInsightsText } from "./insightsContract-B09K_Px1.mjs";
|
|
4
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/runtime.server-CsiKFp_Z.js
|
|
5
|
-
var InsightsBadRequestError = class extends Error {
|
|
6
|
-
name = "InsightsBadRequestError";
|
|
7
|
-
};
|
|
8
|
-
var MAX_EVENT_STRING_LENGTH = 1024;
|
|
9
|
-
var MAX_IDENTITY_LENGTH$1 = 255;
|
|
10
|
-
var eventKeys = /* @__PURE__ */ new Set([
|
|
11
|
-
"type",
|
|
12
|
-
"installId",
|
|
13
|
-
"toBundleId",
|
|
14
|
-
"userId",
|
|
15
|
-
"username",
|
|
16
|
-
"platform",
|
|
17
|
-
"appVersion",
|
|
18
|
-
"channel",
|
|
19
|
-
"cohort",
|
|
20
|
-
"fingerprintHash",
|
|
21
|
-
"fromBundleId",
|
|
22
|
-
"fromReleaseId",
|
|
23
|
-
"toReleaseId",
|
|
24
|
-
"updateStrategy",
|
|
25
|
-
"sdkVersion"
|
|
26
|
-
]);
|
|
27
|
-
function isRecord$1(value) {
|
|
28
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29
|
-
}
|
|
30
|
-
function requireStringField(payload, key) {
|
|
31
|
-
const value = payload[key];
|
|
32
|
-
if (typeof value !== "string" || value.length === 0 || value.length > MAX_EVENT_STRING_LENGTH || new TextDecoder("utf-8", { ignoreBOM: true }).decode(new TextEncoder().encode(value)) !== value) throw new InsightsBadRequestError(`Invalid event field: ${key}`);
|
|
33
|
-
return value;
|
|
34
|
-
}
|
|
35
|
-
function requireNullableStringField(payload, key) {
|
|
36
|
-
if (payload[key] === null) return null;
|
|
37
|
-
return requireStringField(payload, key);
|
|
38
|
-
}
|
|
39
|
-
function requireIdentityField(payload, key) {
|
|
40
|
-
const value = requireStringField(payload, key);
|
|
41
|
-
if (value.length > MAX_IDENTITY_LENGTH$1) throw new InsightsBadRequestError(`Invalid event field: ${key}`);
|
|
42
|
-
return value;
|
|
43
|
-
}
|
|
44
|
-
function requireEvent(payload) {
|
|
45
|
-
if (!isRecord$1(payload) || Object.keys(payload).some((key) => !eventKeys.has(key))) throw new InsightsBadRequestError("Invalid event payload");
|
|
46
|
-
const platform = requireStringField(payload, "platform");
|
|
47
|
-
if (platform !== "ios" && platform !== "android") throw new InsightsBadRequestError("Invalid event field: platform");
|
|
48
|
-
const base = {
|
|
49
|
-
installId: requireIdentityField(payload, "installId"),
|
|
50
|
-
toBundleId: requireStringField(payload, "toBundleId"),
|
|
51
|
-
...payload.userId === void 0 ? {} : { userId: requireIdentityField(payload, "userId") },
|
|
52
|
-
...payload.username === void 0 ? {} : { username: requireStringField(payload, "username") },
|
|
53
|
-
platform,
|
|
54
|
-
appVersion: requireStringField(payload, "appVersion"),
|
|
55
|
-
channel: requireStringField(payload, "channel"),
|
|
56
|
-
cohort: requireStringField(payload, "cohort"),
|
|
57
|
-
fingerprintHash: requireNullableStringField(payload, "fingerprintHash"),
|
|
58
|
-
sdkVersion: payload.sdkVersion === void 0 ? null : requireNullableStringField(payload, "sdkVersion"),
|
|
59
|
-
fromReleaseId: requireNullableStringField(payload, "fromReleaseId"),
|
|
60
|
-
toReleaseId: requireNullableStringField(payload, "toReleaseId")
|
|
61
|
-
};
|
|
62
|
-
const type = requireStringField(payload, "type");
|
|
63
|
-
switch (type) {
|
|
64
|
-
case "UPDATE_APPLIED":
|
|
65
|
-
case "RECOVERED": {
|
|
66
|
-
const updateStrategy = requireStringField(payload, "updateStrategy");
|
|
67
|
-
if (updateStrategy !== "fingerprint" && updateStrategy !== "appVersion") throw new InsightsBadRequestError("Invalid event field: updateStrategy");
|
|
68
|
-
return {
|
|
69
|
-
...base,
|
|
70
|
-
type,
|
|
71
|
-
fromBundleId: requireStringField(payload, "fromBundleId"),
|
|
72
|
-
updateStrategy
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
case "UNCHANGED":
|
|
76
|
-
if (payload.fromBundleId !== null || payload.updateStrategy !== null) throw new InsightsBadRequestError("Invalid unchanged event shape");
|
|
77
|
-
return {
|
|
78
|
-
...base,
|
|
79
|
-
type,
|
|
80
|
-
fromBundleId: null,
|
|
81
|
-
updateStrategy: null
|
|
82
|
-
};
|
|
83
|
-
default: throw new InsightsBadRequestError("Invalid event field: type");
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function createBundleEventRow(input) {
|
|
87
|
-
input = requireEvent(input);
|
|
88
|
-
const base = {
|
|
89
|
-
app_version: input.appVersion,
|
|
90
|
-
channel: input.channel,
|
|
91
|
-
cohort: input.cohort,
|
|
92
|
-
fingerprint_hash: input.fingerprintHash,
|
|
93
|
-
from_release_id: input.fromReleaseId,
|
|
94
|
-
id: createUUIDv7(),
|
|
95
|
-
install_id: input.installId,
|
|
96
|
-
platform: input.platform,
|
|
97
|
-
received_at_ms: Date.now(),
|
|
98
|
-
sdk_version: input.sdkVersion ?? null,
|
|
99
|
-
to_bundle_id: input.toBundleId,
|
|
100
|
-
to_release_id: input.toReleaseId,
|
|
101
|
-
user_id: input.userId ?? null,
|
|
102
|
-
username: input.username ?? null
|
|
103
|
-
};
|
|
104
|
-
switch (input.type) {
|
|
105
|
-
case "UPDATE_APPLIED":
|
|
106
|
-
case "RECOVERED": return {
|
|
107
|
-
...base,
|
|
108
|
-
from_bundle_id: input.fromBundleId,
|
|
109
|
-
type: input.type,
|
|
110
|
-
update_strategy: input.updateStrategy
|
|
111
|
-
};
|
|
112
|
-
case "UNCHANGED": return {
|
|
113
|
-
...base,
|
|
114
|
-
from_bundle_id: null,
|
|
115
|
-
type: input.type,
|
|
116
|
-
update_strategy: null
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
var DEFAULT_PAGE_LIMIT = 50;
|
|
121
|
-
var MAX_PAGE_LIMIT = 100;
|
|
122
|
-
var MAX_EVENT_ID_LENGTH = 1024;
|
|
123
|
-
var MAX_IDENTITY_LENGTH = 255;
|
|
124
|
-
var MAX_CURSOR_LENGTH = 8192;
|
|
125
|
-
var WINDOW_MS = {
|
|
126
|
-
"24h": 864e5,
|
|
127
|
-
"7d": 6048e5,
|
|
128
|
-
"30d": 2592e6
|
|
129
|
-
};
|
|
130
|
-
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
131
|
-
var requireString = (value, label, maximumLength) => {
|
|
132
|
-
if (typeof value !== "string" || value.length === 0 || value.length > maximumLength || new TextDecoder("utf-8", { ignoreBOM: true }).decode(new TextEncoder().encode(value)) !== value) throw new InsightsBadRequestError(`Invalid ${label}.`);
|
|
133
|
-
return value;
|
|
134
|
-
};
|
|
135
|
-
var requireTimestamp = (value, label) => {
|
|
136
|
-
if (!Number.isSafeInteger(value) || Number(value) < 0) throw new InsightsBadRequestError(`Invalid ${label}.`);
|
|
137
|
-
return Number(value);
|
|
138
|
-
};
|
|
139
|
-
var readLimit = (value) => {
|
|
140
|
-
const limit = value ?? DEFAULT_PAGE_LIMIT;
|
|
141
|
-
if (!Number.isSafeInteger(limit) || limit < 1 || limit > MAX_PAGE_LIMIT) throw new InsightsBadRequestError("Invalid page limit.");
|
|
142
|
-
return limit;
|
|
143
|
-
};
|
|
144
|
-
var encodeBase64Url = (value) => {
|
|
145
|
-
const bytes = new TextEncoder().encode(value);
|
|
146
|
-
let binary = "";
|
|
147
|
-
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
148
|
-
return btoa(binary).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/u, "");
|
|
149
|
-
};
|
|
150
|
-
var decodeBase64Url = (value) => {
|
|
151
|
-
if (value.length === 0 || value.length > MAX_CURSOR_LENGTH) throw new InsightsBadRequestError("Invalid Insights cursor.");
|
|
152
|
-
try {
|
|
153
|
-
const base64 = value.replaceAll("-", "+").replaceAll("_", "/");
|
|
154
|
-
const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
|
|
155
|
-
const binary = atob(padded);
|
|
156
|
-
const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));
|
|
157
|
-
return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
158
|
-
} catch {
|
|
159
|
-
throw new InsightsBadRequestError("Invalid Insights cursor.");
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
var encodeCursor = (value) => encodeBase64Url(JSON.stringify(value));
|
|
163
|
-
var decodeCursor = (value) => {
|
|
164
|
-
try {
|
|
165
|
-
return JSON.parse(decodeBase64Url(value));
|
|
166
|
-
} catch (error) {
|
|
167
|
-
if (error instanceof InsightsBadRequestError) throw error;
|
|
168
|
-
throw new InsightsBadRequestError("Invalid Insights cursor.");
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
var readScope = (input) => {
|
|
172
|
-
if (input.platform !== "ios" && input.platform !== "android") throw new InsightsBadRequestError("Invalid Insights platform.");
|
|
173
|
-
return {
|
|
174
|
-
platform: input.platform,
|
|
175
|
-
channel: requireString(input.channel, "channel", MAX_EVENT_ID_LENGTH)
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
var bundleFilter = (input) => {
|
|
179
|
-
const scope = readScope(input);
|
|
180
|
-
const bundleId = requireString(input.bundleId, "bundle ID", MAX_EVENT_ID_LENGTH);
|
|
181
|
-
switch (input.outcome) {
|
|
182
|
-
case "applied": return {
|
|
183
|
-
...scope,
|
|
184
|
-
type: "UPDATE_APPLIED",
|
|
185
|
-
toBundleId: bundleId
|
|
186
|
-
};
|
|
187
|
-
case "recovered": return {
|
|
188
|
-
...scope,
|
|
189
|
-
type: "RECOVERED",
|
|
190
|
-
fromBundleId: bundleId
|
|
191
|
-
};
|
|
192
|
-
case "unchanged": return {
|
|
193
|
-
...scope,
|
|
194
|
-
type: "UNCHANGED",
|
|
195
|
-
toBundleId: bundleId
|
|
196
|
-
};
|
|
197
|
-
default: throw new InsightsBadRequestError("Invalid Insights outcome.");
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
var sameFilter = (left, right) => {
|
|
201
|
-
if (!isRecord(left) || left.kind !== right.kind) return false;
|
|
202
|
-
switch (right.kind) {
|
|
203
|
-
case "all": return true;
|
|
204
|
-
case "installationMovement": return left.installId === right.installId;
|
|
205
|
-
case "bundle": return left.platform === right.platform && left.channel === right.channel && left.type === right.type && (right.type === "RECOVERED" ? left.fromBundleId === right.fromBundleId : left.toBundleId === right.toBundleId);
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
var readEventCursor = (value, filter) => {
|
|
209
|
-
const cursor = decodeCursor(value);
|
|
210
|
-
if (!isRecord(cursor) || cursor.version !== 2 || cursor.kind !== "events" || !isRecord(cursor.filter) || !isRecord(cursor.after)) throw new InsightsBadRequestError("Invalid Insights cursor.");
|
|
211
|
-
if (!sameFilter(cursor.filter, filter)) throw new InsightsBadRequestError("Insights cursor does not match the requested events.");
|
|
212
|
-
if (typeof cursor.after.id !== "string" || !isUUIDv7(cursor.after.id)) throw new InsightsBadRequestError("Invalid Insights event cursor ID.");
|
|
213
|
-
return {
|
|
214
|
-
after: {
|
|
215
|
-
id: cursor.after.id,
|
|
216
|
-
receivedAtMs: requireTimestamp(cursor.after.receivedAtMs, "event cursor")
|
|
217
|
-
},
|
|
218
|
-
beforeReceivedAtMs: requireTimestamp(cursor.beforeReceivedAtMs, "event cutoff"),
|
|
219
|
-
kind: "events",
|
|
220
|
-
sinceMs: requireTimestamp(cursor.sinceMs, "event start"),
|
|
221
|
-
filter,
|
|
222
|
-
version: 2
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
var readUserInstallationCursor = (value, userId) => {
|
|
226
|
-
const cursor = decodeCursor(value);
|
|
227
|
-
if (!isRecord(cursor) || cursor.version !== 1 || cursor.kind !== "user-installations" || cursor.userId !== userId) throw new InsightsBadRequestError("Insights cursor does not match the requested user ID.");
|
|
228
|
-
return {
|
|
229
|
-
afterInstallId: requireString(cursor.afterInstallId, "installation cursor", MAX_IDENTITY_LENGTH),
|
|
230
|
-
kind: "user-installations",
|
|
231
|
-
userId,
|
|
232
|
-
version: 1
|
|
233
|
-
};
|
|
234
|
-
};
|
|
235
|
-
var compareEventNewest = (left, right) => right.received_at_ms - left.received_at_ms || compareInsightsText(right.id, left.id);
|
|
236
|
-
var isAfterEventCursor = (row, after) => row.received_at_ms < after.receivedAtMs || row.received_at_ms === after.receivedAtMs && compareInsightsText(row.id, after.id) < 0;
|
|
237
|
-
var assertEventRows = (rows, input) => {
|
|
238
|
-
if (rows.length > input.limit) throw new Error("Insights database returned too many event rows.");
|
|
239
|
-
for (let index = 0; index < rows.length; index += 1) {
|
|
240
|
-
const row = rows[index];
|
|
241
|
-
const previous = rows[index - 1];
|
|
242
|
-
if (!row || typeof row.id !== "string" || !isUUIDv7(row.id) || !Number.isSafeInteger(row.received_at_ms) || row.received_at_ms >= input.beforeReceivedAtMs || row.received_at_ms < input.sinceMs || previous !== void 0 && compareEventNewest(previous, row) >= 0 || input.after !== void 0 && !isAfterEventCursor(row, input.after) || input.filter.kind === "installationMovement" && (row.install_id !== input.filter.installId || !isInsightsMovementEvent(row)) || input.filter.kind === "bundle" && (row.platform !== input.filter.platform || row.channel !== input.filter.channel || row.type !== input.filter.type || (input.filter.type === "RECOVERED" ? row.from_bundle_id !== input.filter.fromBundleId : row.to_bundle_id !== input.filter.toBundleId))) throw new Error("Insights database returned invalid event rows.");
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
var toEventHistoryRow = (row) => ({
|
|
246
|
-
appVersion: row.app_version,
|
|
247
|
-
channel: row.channel,
|
|
248
|
-
cohort: row.cohort,
|
|
249
|
-
fromBundleId: row.from_bundle_id,
|
|
250
|
-
id: row.id,
|
|
251
|
-
installId: row.install_id,
|
|
252
|
-
platform: row.platform,
|
|
253
|
-
receivedAtMs: row.received_at_ms,
|
|
254
|
-
toBundleId: row.to_bundle_id,
|
|
255
|
-
type: row.type,
|
|
256
|
-
userId: row.user_id,
|
|
257
|
-
username: row.username
|
|
258
|
-
});
|
|
259
|
-
var toInstallationRow = (row) => ({
|
|
260
|
-
appVersion: row.app_version,
|
|
261
|
-
channel: row.channel,
|
|
262
|
-
cohort: row.cohort,
|
|
263
|
-
installId: row.install_id,
|
|
264
|
-
lastKnownBundleId: row.to_bundle_id,
|
|
265
|
-
latestStatus: row.type,
|
|
266
|
-
platform: row.platform,
|
|
267
|
-
receivedAtMs: row.received_at_ms,
|
|
268
|
-
userId: row.user_id,
|
|
269
|
-
username: row.username
|
|
270
|
-
});
|
|
271
|
-
var pageEventRows = async (model, input, filter, map) => {
|
|
272
|
-
const limit = readLimit(input.limit);
|
|
273
|
-
const cursor = input.cursor === void 0 ? void 0 : readEventCursor(input.cursor, filter);
|
|
274
|
-
const beforeReceivedAtMs = cursor?.beforeReceivedAtMs ?? (input.beforeReceivedAtMs === void 0 ? Date.now() : requireTimestamp(input.beforeReceivedAtMs, "event cutoff"));
|
|
275
|
-
if (cursor !== void 0 && input.beforeReceivedAtMs !== void 0 && input.beforeReceivedAtMs !== beforeReceivedAtMs) throw new InsightsBadRequestError("Insights cursor does not match the requested event cutoff.");
|
|
276
|
-
const sinceMs = cursor?.sinceMs ?? (input.sinceMs === void 0 ? 0 : requireTimestamp(input.sinceMs, "event start"));
|
|
277
|
-
if (sinceMs > beforeReceivedAtMs || input.sinceMs !== void 0 && input.sinceMs !== sinceMs || cursor !== void 0 && (cursor.after.receivedAtMs < sinceMs || cursor.after.receivedAtMs >= beforeReceivedAtMs)) throw new InsightsBadRequestError("Insights cursor or range does not match the requested event start.");
|
|
278
|
-
const databaseInput = {
|
|
279
|
-
filter,
|
|
280
|
-
sinceMs,
|
|
281
|
-
beforeReceivedAtMs,
|
|
282
|
-
...cursor === void 0 ? {} : { after: cursor.after },
|
|
283
|
-
limit: limit + 1
|
|
284
|
-
};
|
|
285
|
-
const rows = await model.listEvents(databaseInput);
|
|
286
|
-
assertEventRows(rows, databaseInput);
|
|
287
|
-
const pageRows = rows.slice(0, limit);
|
|
288
|
-
const last = pageRows.at(-1);
|
|
289
|
-
return {
|
|
290
|
-
beforeReceivedAtMs,
|
|
291
|
-
data: pageRows.map(map),
|
|
292
|
-
nextCursor: rows.length > limit && last ? encodeCursor({
|
|
293
|
-
after: {
|
|
294
|
-
id: last.id,
|
|
295
|
-
receivedAtMs: last.received_at_ms
|
|
296
|
-
},
|
|
297
|
-
beforeReceivedAtMs,
|
|
298
|
-
kind: "events",
|
|
299
|
-
filter,
|
|
300
|
-
sinceMs,
|
|
301
|
-
version: 2
|
|
302
|
-
}) : null
|
|
303
|
-
};
|
|
304
|
-
};
|
|
305
|
-
var assertInstallationRows = (rows, input) => {
|
|
306
|
-
if (rows.length > input.limit) throw new Error("Insights database returned too many installation rows.");
|
|
307
|
-
for (let index = 0; index < rows.length; index += 1) {
|
|
308
|
-
const row = rows[index];
|
|
309
|
-
const previous = rows[index - 1];
|
|
310
|
-
if (!row || row.user_id !== input.userId || input.afterInstallId !== void 0 && compareInsightsText(row.install_id, input.afterInstallId) <= 0 || previous !== void 0 && compareInsightsText(previous.install_id, row.install_id) >= 0) throw new Error("Insights database returned invalid installation rows.");
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
var createInsightsProvider = (model) => Object.freeze({
|
|
314
|
-
async appendBundleEvent(input) {
|
|
315
|
-
const event = createBundleEventRow(input);
|
|
316
|
-
await model.record({
|
|
317
|
-
event,
|
|
318
|
-
installation: toInsightsInstallationRow(event)
|
|
319
|
-
});
|
|
320
|
-
},
|
|
321
|
-
listEvents(input) {
|
|
322
|
-
return pageEventRows(model, input, input.bundle === void 0 ? { kind: "all" } : {
|
|
323
|
-
kind: "bundle",
|
|
324
|
-
...bundleFilter(input.bundle)
|
|
325
|
-
}, toEventHistoryRow);
|
|
326
|
-
},
|
|
327
|
-
async listInstallationEvents(input) {
|
|
328
|
-
if ("bundle" in input && input.bundle !== void 0) throw new InsightsBadRequestError("Installation movement queries cannot include a bundle filter.");
|
|
329
|
-
return pageEventRows(model, input, {
|
|
330
|
-
kind: "installationMovement",
|
|
331
|
-
installId: requireString(input.installId, "install ID", MAX_IDENTITY_LENGTH)
|
|
332
|
-
}, (row) => toEventHistoryRow(row));
|
|
333
|
-
},
|
|
334
|
-
async getInstallation({ installId }) {
|
|
335
|
-
const normalizedInstallId = requireString(installId, "install ID", MAX_IDENTITY_LENGTH);
|
|
336
|
-
const rows = await model.findInstallations({ installId: normalizedInstallId });
|
|
337
|
-
const row = rows[0] ?? null;
|
|
338
|
-
if (rows.length > 1 || row !== null && row.install_id !== normalizedInstallId) throw new Error("Insights database returned an invalid installation.");
|
|
339
|
-
return row === null ? null : toInstallationRow(row);
|
|
340
|
-
},
|
|
341
|
-
async pageInstallationsByCurrentUserId(input) {
|
|
342
|
-
const userId = requireString(input.userId, "user ID", MAX_IDENTITY_LENGTH);
|
|
343
|
-
const limit = readLimit(input.limit);
|
|
344
|
-
const cursor = input.cursor === void 0 ? void 0 : readUserInstallationCursor(input.cursor, userId);
|
|
345
|
-
const databaseInput = {
|
|
346
|
-
userId,
|
|
347
|
-
...cursor === void 0 ? {} : { afterInstallId: cursor.afterInstallId },
|
|
348
|
-
limit: limit + 1
|
|
349
|
-
};
|
|
350
|
-
const rows = await model.findInstallations(databaseInput);
|
|
351
|
-
assertInstallationRows(rows, databaseInput);
|
|
352
|
-
const pageRows = rows.slice(0, limit);
|
|
353
|
-
const last = pageRows.at(-1);
|
|
354
|
-
return {
|
|
355
|
-
data: pageRows.map(toInstallationRow),
|
|
356
|
-
nextCursor: rows.length > limit && last ? encodeCursor({
|
|
357
|
-
afterInstallId: last.install_id,
|
|
358
|
-
kind: "user-installations",
|
|
359
|
-
userId,
|
|
360
|
-
version: 1
|
|
361
|
-
}) : null
|
|
362
|
-
};
|
|
363
|
-
},
|
|
364
|
-
async getReportingOverview(input) {
|
|
365
|
-
const scope = readScope(input);
|
|
366
|
-
const { window } = input;
|
|
367
|
-
if (!Object.hasOwn(WINDOW_MS, window)) throw new InsightsBadRequestError("Invalid reporting installation window.");
|
|
368
|
-
const beforeReceivedAtMs = Date.now();
|
|
369
|
-
const sinceMs = Math.max(0, beforeReceivedAtMs - WINDOW_MS[window]);
|
|
370
|
-
const measure = async (count) => {
|
|
371
|
-
const value = await count;
|
|
372
|
-
if (!Number.isSafeInteger(value) || value < 0) throw new Error("Insights database returned an invalid count.");
|
|
373
|
-
return {
|
|
374
|
-
count: value,
|
|
375
|
-
measuredAtMs: Date.now()
|
|
376
|
-
};
|
|
377
|
-
};
|
|
378
|
-
const bundleId = input.bundleId === void 0 ? void 0 : requireString(input.bundleId, "bundle ID", MAX_EVENT_ID_LENGTH);
|
|
379
|
-
const reporting = measure(model.countInstallations({
|
|
380
|
-
...scope,
|
|
381
|
-
sinceMs
|
|
382
|
-
}));
|
|
383
|
-
if (bundleId === void 0) return {
|
|
384
|
-
...scope,
|
|
385
|
-
window,
|
|
386
|
-
sinceMs,
|
|
387
|
-
beforeReceivedAtMs,
|
|
388
|
-
reportingInstallations: await reporting
|
|
389
|
-
};
|
|
390
|
-
const countOutcome = (outcome) => measure(model.countEvents({
|
|
391
|
-
filter: bundleFilter({
|
|
392
|
-
...scope,
|
|
393
|
-
bundleId,
|
|
394
|
-
outcome
|
|
395
|
-
}),
|
|
396
|
-
sinceMs,
|
|
397
|
-
beforeReceivedAtMs
|
|
398
|
-
}));
|
|
399
|
-
const [reportingInstallations, bundleInstallations, appliedReports, recoveredReports, unchangedReports] = await Promise.all([
|
|
400
|
-
reporting,
|
|
401
|
-
measure(model.countInstallations({
|
|
402
|
-
...scope,
|
|
403
|
-
sinceMs,
|
|
404
|
-
bundleId
|
|
405
|
-
})),
|
|
406
|
-
countOutcome("applied"),
|
|
407
|
-
countOutcome("recovered"),
|
|
408
|
-
countOutcome("unchanged")
|
|
409
|
-
]);
|
|
410
|
-
return {
|
|
411
|
-
...scope,
|
|
412
|
-
window,
|
|
413
|
-
sinceMs,
|
|
414
|
-
beforeReceivedAtMs,
|
|
415
|
-
reportingInstallations,
|
|
416
|
-
bundle: {
|
|
417
|
-
bundleId,
|
|
418
|
-
reportingInstallations: bundleInstallations,
|
|
419
|
-
appliedReports,
|
|
420
|
-
recoveredReports,
|
|
421
|
-
unchangedReports
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
function createRuntimeHotUpdater(config) {
|
|
427
|
-
return createInsightsProvider(config.database.models.insights);
|
|
428
|
-
}
|
|
429
|
-
function createApiKeyStore(config) {
|
|
430
|
-
const models = Reflect.get(config.database, "models");
|
|
431
|
-
const apiKeys = typeof models === "object" && models !== null ? Reflect.get(models, "apiKeys") : void 0;
|
|
432
|
-
if (typeof apiKeys !== "object" || apiKeys === null || typeof Reflect.get(apiKeys, "create") !== "function" || typeof Reflect.get(apiKeys, "findByHash") !== "function" || typeof Reflect.get(apiKeys, "list") !== "function" || typeof Reflect.get(apiKeys, "revoke") !== "function") return null;
|
|
433
|
-
return apiKeys;
|
|
434
|
-
}
|
|
435
|
-
//#endregion
|
|
436
|
-
export { createApiKeyStore, createRuntimeHotUpdater };
|