@hot-updater/console 0.36.7 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/BundleIdDisplay-D4ErdU5_.js +1 -0
  3. package/.output/public/assets/InsightsCapabilityContext-B42VqvP6.js +1 -0
  4. package/.output/public/assets/api-keys-api-DGVTTvTJ.js +1 -0
  5. package/.output/public/assets/api-keys-z16OZIP4.js +1 -0
  6. package/.output/public/assets/badge-Br_KDO0J.js +1 -0
  7. package/.output/public/assets/card-DzuEXvyJ.js +1 -0
  8. package/.output/public/assets/chart-no-axes-combined-FaYMGmQS.js +1 -0
  9. package/.output/public/assets/createServerFn-gM2-LFBy.js +3 -0
  10. package/.output/public/assets/dialog-BeAENgez.js +1 -0
  11. package/.output/public/assets/dist-Bssh_cv0.js +1 -0
  12. package/.output/public/assets/field-Buq148-A.js +1 -0
  13. package/.output/public/assets/index-uOpQAIC4.js +10 -0
  14. package/.output/public/assets/input-group-B3p5UpyW.js +1 -0
  15. package/.output/public/assets/insights-DJTr7Ozn.js +1 -0
  16. package/.output/public/assets/insights-api-DVMOoRMS.js +1 -0
  17. package/.output/public/assets/installations-BY64iIAK.js +2 -0
  18. package/.output/public/assets/installations-D5v9i3AL.js +1 -0
  19. package/.output/public/assets/lazyRouteComponent-DKYu5cZJ.js +1 -0
  20. package/.output/public/assets/preload-helper-CQ36nxok.js +1 -0
  21. package/.output/public/assets/refresh-cw-BkbfZ62O.js +1 -0
  22. package/.output/public/assets/routes-BuoI5-Cr.js +2 -0
  23. package/.output/public/assets/routes-C8fvgETO.js +1 -0
  24. package/.output/public/assets/search-qsIDvS2I.js +1 -0
  25. package/.output/public/assets/shield-check-DE_hVuHu.js +1 -0
  26. package/.output/public/assets/signing-mJD88Y4C.js +1 -0
  27. package/.output/public/assets/styles-BZIG7t42.css +2 -0
  28. package/.output/public/assets/table-RamFEclP.js +1 -0
  29. package/.output/public/assets/useCompositeListItem-ChzDqdpc.js +42 -0
  30. package/.output/public/assets/useMutation-JsGVjQMY.js +1 -0
  31. package/.output/public/assets/useOpenInteractionType-Dwfy-SpA.js +1 -0
  32. package/.output/server/__23tanstack-start-server-fn-resolver-Dftxlm2E.mjs +146 -0
  33. package/.output/server/_libs/@base-ui/react+[...].mjs +16124 -0
  34. package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
  35. package/.output/server/_libs/@tanstack/react-router+[...].mjs +41 -10
  36. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +132 -0
  37. package/.output/server/_libs/d3-array.mjs +231 -0
  38. package/.output/server/_libs/d3-color.mjs +330 -0
  39. package/.output/server/_libs/d3-format.mjs +252 -0
  40. package/.output/server/_libs/d3-interpolate.mjs +207 -0
  41. package/.output/server/_libs/d3-path.mjs +77 -0
  42. package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
  43. package/.output/server/_libs/d3-shape.mjs +818 -0
  44. package/.output/server/_libs/decimal.js-light.mjs +884 -0
  45. package/.output/server/_libs/es-toolkit.mjs +1134 -0
  46. package/.output/server/_libs/eventemitter3.mjs +236 -0
  47. package/.output/server/_libs/immer.mjs +532 -0
  48. package/.output/server/_libs/lucide-react.mjs +141 -13
  49. package/.output/server/_libs/next-themes.mjs +2 -2
  50. package/.output/server/_libs/react-redux+[...].mjs +205 -0
  51. package/.output/server/_libs/recharts+[...].mjs +14117 -0
  52. package/.output/server/_libs/sonner.mjs +2 -2
  53. package/.output/server/_libs/tanstack__query-core.mjs +114 -1
  54. package/.output/server/_libs/tanstack__react-query.mjs +3 -4
  55. package/.output/server/_runtime.mjs +10 -1
  56. package/.output/server/_ssr/BundleActivityChart-CWcdPuUn.mjs +288 -0
  57. package/.output/server/_ssr/BundleIdDisplay-BEvB3MvA.mjs +13 -0
  58. package/.output/server/_ssr/InsightsCapabilityContext-Cx8fjm2s.mjs +15 -0
  59. package/.output/server/_ssr/api-keys-CpBqHpuC.mjs +300 -0
  60. package/.output/server/_ssr/api-keys-api-Czkp57UV.mjs +60 -0
  61. package/.output/server/_ssr/api-keys-rpc-BTtMDSoR.mjs +136 -0
  62. package/.output/server/_ssr/api-rpc-BEX8ISai.mjs +1468 -0
  63. package/.output/server/_ssr/auth-BF8mbAgF.mjs +21 -0
  64. package/.output/server/_ssr/auth-rpc-BFMEC-TT.mjs +24 -0
  65. package/.output/server/_ssr/auth.server-DW71WzsD.mjs +47 -0
  66. package/.output/server/_ssr/badge-CpWXQwyF.mjs +26 -0
  67. package/.output/server/_ssr/bundle-signing-rpc-BbCFUQSu.mjs +16 -0
  68. package/.output/server/_ssr/bundle-signing.server-C4NW5mWx.mjs +12 -0
  69. package/.output/server/_ssr/card-Bsc8mRis.mjs +86 -0
  70. package/.output/server/_ssr/config-Dv8qLDZ0.mjs +13 -0
  71. package/.output/server/_ssr/config.server-DQYEr_5X.mjs +361 -0
  72. package/.output/server/_ssr/{createServerFn-DzU0k62V.mjs → createServerFn-B2hcXoPM.mjs} +1 -1
  73. package/.output/server/_ssr/createServerRpc-DB29C_5p.mjs +12 -0
  74. package/.output/server/_ssr/{sidebar-Cv_H0_Jv.mjs → createSsrRpc-DhfrxEjg.mjs} +68 -50
  75. package/.output/server/_ssr/databaseRows-QlCYLi0H.mjs +166 -0
  76. package/.output/server/_ssr/deleteBundle-Cu_XOMt0.mjs +66 -0
  77. package/.output/server/_ssr/dialog-C0vKUp8R.mjs +170 -0
  78. package/.output/server/_ssr/dist-BVSLTpoP.mjs +250 -0
  79. package/.output/server/_ssr/downloadBundle-CNnYxYO2.mjs +24 -0
  80. package/.output/server/_ssr/{empty-plugin-adapters-B4HCzgmM.mjs → empty-plugin-adapters-B5QvGpEl.mjs} +1 -1
  81. package/.output/server/_ssr/field-DASCh-5d.mjs +74 -0
  82. package/.output/server/_ssr/{getBundleChildren-CVtSiH5t.mjs → getBundleChildren-BcRMFoDF.mjs} +10 -18
  83. package/.output/server/_ssr/input-group-etIsBUqv.mjs +288 -0
  84. package/.output/server/_ssr/insights-api-C1F7UreR.mjs +71 -0
  85. package/.output/server/_ssr/insights-input-9fEJF-ZG.mjs +96 -0
  86. package/.output/server/_ssr/insights-rpc-C-8R6kED.mjs +155 -0
  87. package/.output/server/_ssr/insights-ygT_aIfo.mjs +858 -0
  88. package/.output/server/_ssr/installations-DqRT1QTd.mjs +535 -0
  89. package/.output/server/_ssr/installations-K8TCYTYh.mjs +19 -0
  90. package/.output/server/_ssr/router-BxBEvtF1.mjs +513 -0
  91. package/.output/server/_ssr/routes-BC7rn-tf.mjs +37 -0
  92. package/.output/server/_ssr/routes-CM5KAwpB.mjs +2285 -0
  93. package/.output/server/_ssr/runtime.server-la7TRAH_.mjs +527 -0
  94. package/.output/server/_ssr/server-CpzW--lT.mjs +7468 -0
  95. package/.output/server/_ssr/signing-jk4HANnl.mjs +134 -0
  96. package/.output/server/_ssr/ssr.mjs +4 -5740
  97. package/.output/server/_ssr/start-DpViQGnt.mjs +4 -0
  98. package/.output/server/_ssr/table-CU58HeI7.mjs +53 -0
  99. package/.output/server/_ssr/uuidv7-CaKuKXrV.mjs +31 -0
  100. package/.output/server/_tanstack-start-manifest_v-Mz9MmSlD.mjs +103 -0
  101. package/.output/server/index.mjs +229 -47
  102. package/README.md +29 -8
  103. package/lib/index.d.mts +35 -0
  104. package/lib/index.mjs +4 -0
  105. package/lib/vite-internal.mjs +127 -0
  106. package/lib/vite.d.mts +10 -0
  107. package/lib/vite.mjs +5 -0
  108. package/package.json +51 -29
  109. package/public/apple-touch-icon.png +0 -0
  110. package/public/favicon-16x16.png +0 -0
  111. package/public/favicon-32x32.png +0 -0
  112. package/public/favicon.ico +0 -0
  113. package/public/logo.svg +1 -0
  114. package/public/manifest.json +30 -0
  115. package/public/robots.txt +3 -0
  116. package/src/components/AppSidebar.tsx +159 -0
  117. package/src/components/BundleIdDisplay.tsx +18 -0
  118. package/src/components/ChannelBadge.tsx +31 -0
  119. package/src/components/ConsoleAccessPage.tsx +122 -0
  120. package/src/components/EnabledStatusIcon.tsx +54 -0
  121. package/src/components/HashValueDisplay.tsx +85 -0
  122. package/src/components/HotUpdaterLogo.tsx +30 -0
  123. package/src/components/NotFoundPage.tsx +33 -0
  124. package/src/components/PlatformIcon.tsx +39 -0
  125. package/src/components/RolloutPercentageBadge.tsx +28 -0
  126. package/src/components/ThemeProvider.tsx +116 -0
  127. package/src/components/TimestampDisplay.tsx +41 -0
  128. package/src/components/features/api-keys/ApiKeysPage.tsx +377 -0
  129. package/src/components/features/bundles/BundleActivityChart.tsx +193 -0
  130. package/src/components/features/bundles/BundleChildrenPanel.tsx +201 -0
  131. package/src/components/features/bundles/BundleInsightsSummary.tsx +123 -0
  132. package/src/components/features/bundles/BundleMetadata.tsx +136 -0
  133. package/src/components/features/bundles/RolloutCohortsDialog.tsx +201 -0
  134. package/src/components/features/channels/ChannelManagementDialog.tsx +228 -0
  135. package/src/components/features/insights/ActivityChart.tsx +150 -0
  136. package/src/components/features/insights/BundleDistribution.tsx +133 -0
  137. package/src/components/features/insights/BundleSelector.tsx +114 -0
  138. package/src/components/features/insights/InsightsCapabilityContext.tsx +24 -0
  139. package/src/components/features/insights/InsightsControls.tsx +115 -0
  140. package/src/components/features/insights/InsightsErrorAlert.tsx +21 -0
  141. package/src/components/features/insights/InsightsOverview.tsx +208 -0
  142. package/src/components/features/insights/InstallationHistoryCard.tsx +248 -0
  143. package/src/components/features/insights/InstallationMatchesCard.tsx +132 -0
  144. package/src/components/features/insights/InstallationPageHeader.tsx +138 -0
  145. package/src/components/features/insights/InstallationPagination.tsx +48 -0
  146. package/src/components/features/insights/InstallationSearch.tsx +230 -0
  147. package/src/components/features/insights/UpdateOutcomes.tsx +147 -0
  148. package/src/components/features/releases/ReleaseEditorSheet.tsx +879 -0
  149. package/src/components/features/releases/ReleaseStateBadge.tsx +20 -0
  150. package/src/components/features/signing/BundleSigningPage.tsx +139 -0
  151. package/src/components/ui/alert-dialog.tsx +185 -0
  152. package/src/components/ui/alert.tsx +76 -0
  153. package/src/components/ui/badge.tsx +49 -0
  154. package/src/components/ui/button.tsx +58 -0
  155. package/src/components/ui/card.tsx +89 -0
  156. package/src/components/ui/chart.tsx +371 -0
  157. package/src/components/ui/combobox.tsx +303 -0
  158. package/src/components/ui/dialog.tsx +156 -0
  159. package/src/components/ui/dropdown-menu.tsx +270 -0
  160. package/src/components/ui/field.tsx +235 -0
  161. package/src/components/ui/input-group.tsx +147 -0
  162. package/src/components/ui/input.tsx +19 -0
  163. package/src/components/ui/label.tsx +25 -0
  164. package/src/components/ui/progress.tsx +84 -0
  165. package/src/components/ui/select.tsx +205 -0
  166. package/src/components/ui/separator.tsx +23 -0
  167. package/src/components/ui/sheet.tsx +132 -0
  168. package/src/components/ui/sidebar.tsx +779 -0
  169. package/src/components/ui/skeleton.tsx +13 -0
  170. package/src/components/ui/slider.tsx +56 -0
  171. package/src/components/ui/sonner.tsx +45 -0
  172. package/src/components/ui/switch.tsx +25 -0
  173. package/src/components/ui/table.tsx +114 -0
  174. package/src/components/ui/textarea.tsx +18 -0
  175. package/src/components/ui/toggle-group.tsx +89 -0
  176. package/src/components/ui/toggle.tsx +43 -0
  177. package/src/components/ui/tooltip.tsx +66 -0
  178. package/src/hooks/use-mobile.ts +30 -0
  179. package/src/index.ts +47 -0
  180. package/src/lib/api-keys-api.ts +69 -0
  181. package/src/lib/api-keys-rpc.ts +87 -0
  182. package/src/lib/api-rpc.ts +478 -0
  183. package/src/lib/api.ts +444 -0
  184. package/src/lib/auth-rpc.ts +16 -0
  185. package/src/lib/bundle-signing-api.ts +14 -0
  186. package/src/lib/bundle-signing-rpc.ts +16 -0
  187. package/src/lib/constants.ts +1 -0
  188. package/src/lib/git.ts +51 -0
  189. package/src/lib/insights-api.ts +144 -0
  190. package/src/lib/insights-error.ts +19 -0
  191. package/src/lib/insights-input.ts +187 -0
  192. package/src/lib/insights-overview.ts +170 -0
  193. package/src/lib/insights-rpc.ts +218 -0
  194. package/src/lib/server/auth.server.ts +43 -0
  195. package/src/lib/server/bundle-signing.server.ts +23 -0
  196. package/src/lib/server/config.server.ts +109 -0
  197. package/src/lib/server/console-runtime.server.ts +61 -0
  198. package/src/lib/server/deleteBundle.ts +145 -0
  199. package/src/lib/server/downloadBundle.ts +46 -0
  200. package/src/lib/server/getBundleChildren.ts +130 -0
  201. package/src/lib/server/listReleases.ts +61 -0
  202. package/src/lib/server/releaseActivity.ts +27 -0
  203. package/src/lib/server/releaseReachability.ts +95 -0
  204. package/src/lib/server/runtime.server.ts +172 -0
  205. package/src/lib/utils.ts +9 -0
  206. package/src/logo.svg +1 -0
  207. package/src/routeTree.gen.ts +199 -0
  208. package/src/router.tsx +21 -0
  209. package/src/routes/-installations-search.ts +19 -0
  210. package/src/routes/-releases-search.ts +74 -0
  211. package/src/routes/__root.tsx +174 -0
  212. package/src/routes/api/auth/$.ts +19 -0
  213. package/src/routes/api/bundles/$bundleId/download.ts +17 -0
  214. package/src/routes/api-keys.tsx +37 -0
  215. package/src/routes/index.tsx +982 -0
  216. package/src/routes/insights.tsx +139 -0
  217. package/src/routes/installations.tsx +194 -0
  218. package/src/routes/signing.tsx +37 -0
  219. package/src/styles.css +152 -0
  220. package/src/virtual-modules.d.ts +21 -0
  221. package/src/vite-env.d.ts +1 -0
  222. package/src/vite-internal.ts +195 -0
  223. package/src/vite.ts +12 -0
  224. package/.output/public/assets/dist-DJX53faP.js +0 -3
  225. package/.output/public/assets/index-Iylis5kY.js +0 -10
  226. package/.output/public/assets/routes-HT21hs0C.js +0 -54
  227. package/.output/public/assets/styles-C0Re4quB.css +0 -2
  228. package/.output/server/__23tanstack-start-server-fn-resolver-CgwgZ0-i.mjs +0 -66
  229. package/.output/server/_libs/@floating-ui/core+[...].mjs +0 -698
  230. package/.output/server/_libs/@floating-ui/dom+[...].mjs +0 -644
  231. package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +0 -839
  232. package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +0 -2138
  233. package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +0 -308
  234. package/.output/server/_libs/@radix-ui/react-select+[...].mjs +0 -1038
  235. package/.output/server/_libs/@tanstack/devtools-event-client+[...].mjs +0 -196
  236. package/.output/server/_libs/@tanstack/form-core+[...].mjs +0 -3228
  237. package/.output/server/_libs/@tanstack/react-form+[...].mjs +0 -430
  238. package/.output/server/_libs/@tanstack/react-table+[...].mjs +0 -2382
  239. package/.output/server/_libs/radix-ui__number.mjs +0 -6
  240. package/.output/server/_libs/radix-ui__primitive.mjs +0 -9
  241. package/.output/server/_libs/radix-ui__react-arrow.mjs +0 -23
  242. package/.output/server/_libs/radix-ui__react-collection.mjs +0 -78
  243. package/.output/server/_libs/radix-ui__react-direction.mjs +0 -13
  244. package/.output/server/_libs/radix-ui__react-label.mjs +0 -22
  245. package/.output/server/_libs/radix-ui__react-separator.mjs +0 -30
  246. package/.output/server/_libs/radix-ui__react-slider.mjs +0 -510
  247. package/.output/server/_libs/radix-ui__react-switch.mjs +0 -157
  248. package/.output/server/_libs/radix-ui__react-tooltip.mjs +0 -493
  249. package/.output/server/_ssr/api-rpc-BIbDUKSz.mjs +0 -292
  250. package/.output/server/_ssr/config.server-BSS366KT.mjs +0 -41
  251. package/.output/server/_ssr/deleteBundle-BgbZTtpW.mjs +0 -141
  252. package/.output/server/_ssr/dist-KboydRVk.mjs +0 -120
  253. package/.output/server/_ssr/router-C3hqEy3k.mjs +0 -307
  254. package/.output/server/_ssr/routes-B0lQvvlC.mjs +0 -3048
  255. package/.output/server/_ssr/start-02sLteYG.mjs +0 -4
  256. package/.output/server/_ssr/storageProfile-FVkjPoGb.mjs +0 -9
  257. package/.output/server/_tanstack-start-manifest_v-Bpx52WOU.mjs +0 -20
  258. package/.output/server/node_modules/tslib/modules/index.js +0 -70
  259. package/.output/server/node_modules/tslib/modules/package.json +0 -3
  260. package/.output/server/node_modules/tslib/package.json +0 -47
  261. package/.output/server/node_modules/tslib/tslib.js +0 -484
  262. package/.output/server/package.json +0 -9
@@ -0,0 +1,288 @@
1
+ import "../_runtime.mjs";
2
+ import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
3
+ import { at as require_react, it as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
4
+ import { t as cva } from "../_libs/class-variance-authority+clsx.mjs";
5
+ import { C as cn, n as Input, t as Button$1, w as createSsrRpc } from "./createSsrRpc-DhfrxEjg.mjs";
6
+ import { i as useQueryClient, n as useQuery, t as useMutation } from "../_libs/tanstack__react-query.mjs";
7
+ import { a as parseSearchInstallationsInput, i as parseInstallationHistoryInput, n as parseBundleEventInsightsInput, r as parseBundleEventSummaryInput } from "./insights-input-9fEJF-ZG.mjs";
8
+ require_react();
9
+ var import_jsx_runtime = require_jsx_runtime();
10
+ var getReleases = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("206547cb1526f961070a989818ca7b9e34f6b2b0e4ab851698c3807fe9fb5e0c"));
11
+ var getRelease = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("a6f23116eeaf76166d405e28a95213123025613c6603030894e519015bf48032"));
12
+ var updateRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("7ea0186f19f9f2bc2ca4b26e3c59636891cf046957f84287b6783f8d88bd8cb7"));
13
+ var preflightRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("b46c95dba95a6a3e8fa5c9d100e3622fa5ae7af4f38e10fb1ed2fa48289a3a8f"));
14
+ var deleteRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("d5b58722ce514e3b63a377f736b4823c2011782495442ae4870ed547e392c70b"));
15
+ var promoteRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("956539a300d79a7efa191c1cc2d529d62fc4bfd940442548fdbc1404e0d53078"));
16
+ var getReleaseCatalogDiagnostics = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("e8c24b7247936f045a145ffd5c177fd0e3df3b52769d67dfbd8d1de491d66396"));
17
+ var getConfig = createServerFn().handler(createSsrRpc("51a34c05479a893c7d320bd4cd1604427289d667698c48b9f30a01aabf8a5e68"));
18
+ var getChannels = createServerFn().handler(createSsrRpc("79ada05964de8f2123bfcd62b10097d59bf8fd689ef5c7161031e5871d8396c5"));
19
+ var createChannel = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("2b9b8d1f49f79a511589617d8d4bfc6094a3acf5264f33651b9569ba66d3f321"));
20
+ var deleteChannel = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("52756dde414919a906bfe83d1ab6d29910c63bcafdb47653d6f1df562d958920"));
21
+ createServerFn().handler(createSsrRpc("f8bdca3d0579adb812d6404f55d9261a89cdb025e920b1fcad82883646a5fe9e"));
22
+ createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("00ccacb4a0212c83ec29f4d11719046ad91ea8291cfc557d514dbf00d3bd7f5f"));
23
+ var getBundle = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("1bd85c2a50e24785cb6abb023a247a9f048f37ddfa85cbb1c57e579563bad013"));
24
+ createServerFn({ method: "GET" }).inputValidator(parseBundleEventSummaryInput).handler(createSsrRpc("d4320e02be8e5c6ae7ec70a17604c835fde4686756031277b09d96b7f3de5f14"));
25
+ var getBundleEventInsights = createServerFn({ method: "GET" }).inputValidator(parseBundleEventInsightsInput).handler(createSsrRpc("49ae6512305a083b6aff68bc430bd8bb1bf4d3a5f528d38865c97830b5481e0e"));
26
+ var searchInstallations = createServerFn({ method: "GET" }).inputValidator(parseSearchInstallationsInput).handler(createSsrRpc("57cc4fac8359876a1d5c4b04615ba6d39bcc4b76768bb5395309ec350bd61a51"));
27
+ var getInstallationHistory = createServerFn({ method: "GET" }).inputValidator(parseInstallationHistoryInput).handler(createSsrRpc("9a9d750535dcdd25b01cb1c4b9439dd1ef5b719f3f835b9aee7889191ef6ec81"));
28
+ var getBundleChildren = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("4370f1bf70b91f1168d85379d3008449a1bedb915e9878ca4ef89d5f3a80fa7f"));
29
+ var getBundleChildCounts = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("4ca367070b00f58179a572f0bb8196a4ccdd3881e9b1dbfe33deee0cb6e1f549"));
30
+ createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("16cc7c2f080ea5b73e0c6bba815b110dbd7727796036d248ba0d8ae819ddef08"));
31
+ createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("3a27ff5679228b86a346b3fe42142e7a5bf0264f73173c0dbe5f07fb37c43cf7"));
32
+ createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("61de3b69779c5ce2a5f5d3c27e2cfaca8fba8f14c8803559b9cd733c456494fa"));
33
+ var INSIGHTS_STALE_TIME_MS = 3e4;
34
+ var bundleListQueryKey = ["bundles"];
35
+ var releaseListQueryKey = ["releases"];
36
+ var queryKeys = {
37
+ config: ["config"],
38
+ channels: ["channels"],
39
+ configLoaded: ["config-loaded"],
40
+ bundles: {
41
+ all: bundleListQueryKey,
42
+ list: (filters) => [...bundleListQueryKey, filters ?? {}]
43
+ },
44
+ releases: {
45
+ all: releaseListQueryKey,
46
+ list: (filters) => [...releaseListQueryKey, filters ?? {}]
47
+ },
48
+ release: (releaseId) => ["release", releaseId],
49
+ releaseCatalog: (scopeKey) => ["release-catalog", scopeKey],
50
+ bundleChildren: {
51
+ all: ["bundle-children"],
52
+ list: (baseBundleId) => ["bundle-children", baseBundleId],
53
+ counts: (bundleIds) => [
54
+ "bundle-children",
55
+ "counts",
56
+ ...bundleIds
57
+ ]
58
+ },
59
+ bundle: (bundleId) => ["bundle", bundleId],
60
+ bundleEventSummary: (bundleId) => ["bundle-event-summary", bundleId],
61
+ bundleEventInsights: (input) => ["bundle-event-insights", input],
62
+ installations: {
63
+ search: (input) => [
64
+ "installations",
65
+ "search",
66
+ input
67
+ ],
68
+ history: (input) => [
69
+ "installations",
70
+ "history",
71
+ input
72
+ ]
73
+ }
74
+ };
75
+ function useConfigQuery() {
76
+ return useQuery({
77
+ queryKey: queryKeys.config,
78
+ queryFn: () => getConfig(),
79
+ staleTime: Infinity
80
+ });
81
+ }
82
+ function useChannelsQuery() {
83
+ return useQuery({
84
+ queryKey: queryKeys.channels,
85
+ queryFn: () => getChannels(),
86
+ staleTime: Infinity
87
+ });
88
+ }
89
+ function useReleasesQuery(filters) {
90
+ return useQuery({
91
+ queryKey: queryKeys.releases.list(filters),
92
+ queryFn: () => getReleases({ data: filters }),
93
+ placeholderData: (previousData) => previousData
94
+ });
95
+ }
96
+ function useReleaseQuery(releaseId) {
97
+ return useQuery({
98
+ enabled: releaseId.length > 0,
99
+ queryFn: () => getRelease({ data: { releaseId } }),
100
+ queryKey: queryKeys.release(releaseId)
101
+ });
102
+ }
103
+ function useReleaseCatalogDiagnosticsQuery(scopeKey) {
104
+ return useQuery({
105
+ enabled: scopeKey.length > 0,
106
+ queryFn: () => getReleaseCatalogDiagnostics({ data: { scopeKey } }),
107
+ queryKey: queryKeys.releaseCatalog(scopeKey)
108
+ });
109
+ }
110
+ function useBundleQuery(bundleId) {
111
+ return useQuery({
112
+ queryKey: queryKeys.bundle(bundleId),
113
+ queryFn: () => getBundle({ data: { bundleId } }),
114
+ staleTime: Infinity,
115
+ enabled: !!bundleId
116
+ });
117
+ }
118
+ function useBundleEventInsightsQuery(input, enabled) {
119
+ return useQuery({
120
+ queryKey: queryKeys.bundleEventInsights(input),
121
+ queryFn: () => getBundleEventInsights({ data: input }),
122
+ staleTime: INSIGHTS_STALE_TIME_MS,
123
+ refetchOnWindowFocus: true,
124
+ enabled: enabled && input.bundleId.length > 0
125
+ });
126
+ }
127
+ function useInstallationSearchQuery(input, enabled) {
128
+ return useQuery({
129
+ queryKey: queryKeys.installations.search(input),
130
+ queryFn: () => searchInstallations({ data: input }),
131
+ staleTime: INSIGHTS_STALE_TIME_MS,
132
+ refetchOnWindowFocus: true,
133
+ enabled: enabled && input.query.trim().length > 0
134
+ });
135
+ }
136
+ function useInstallationHistoryQuery(input, enabled) {
137
+ return useQuery({
138
+ queryKey: queryKeys.installations.history(input),
139
+ queryFn: () => getInstallationHistory({ data: input }),
140
+ staleTime: INSIGHTS_STALE_TIME_MS,
141
+ refetchOnWindowFocus: true,
142
+ enabled: enabled && input.installId.length > 0
143
+ });
144
+ }
145
+ function useBundleChildrenQuery(baseBundleId) {
146
+ return useQuery({
147
+ queryKey: queryKeys.bundleChildren.list(baseBundleId),
148
+ queryFn: () => getBundleChildren({ data: { baseBundleId } }),
149
+ staleTime: Infinity,
150
+ enabled: !!baseBundleId
151
+ });
152
+ }
153
+ function useBundleChildCountsQuery(bundleIds) {
154
+ const normalizedBundleIds = [...bundleIds].sort((left, right) => left.localeCompare(right));
155
+ return useQuery({
156
+ queryKey: queryKeys.bundleChildren.counts(normalizedBundleIds),
157
+ queryFn: () => getBundleChildCounts({ data: { bundleIds: normalizedBundleIds } }),
158
+ staleTime: Infinity,
159
+ enabled: normalizedBundleIds.length > 0
160
+ });
161
+ }
162
+ function useCreateChannelMutation() {
163
+ const queryClient = useQueryClient();
164
+ return useMutation({
165
+ mutationFn: (input) => createChannel({ data: input }).then((response) => response.data),
166
+ onSuccess: async () => {
167
+ await queryClient.invalidateQueries({ queryKey: queryKeys.channels });
168
+ }
169
+ });
170
+ }
171
+ function useDeleteChannelMutation() {
172
+ const queryClient = useQueryClient();
173
+ return useMutation({
174
+ mutationFn: (input) => deleteChannel({ data: input }).then((response) => response.data),
175
+ onSettled: async () => {
176
+ await queryClient.invalidateQueries({ queryKey: queryKeys.channels });
177
+ }
178
+ });
179
+ }
180
+ function useUpdateReleaseMutation() {
181
+ const queryClient = useQueryClient();
182
+ return useMutation({
183
+ mutationFn: (input) => updateRelease({ data: input }),
184
+ onSuccess: async (_, input) => {
185
+ await Promise.all([
186
+ queryClient.invalidateQueries({ queryKey: queryKeys.releases.all }),
187
+ queryClient.invalidateQueries({ queryKey: queryKeys.release(input.releaseId) }),
188
+ queryClient.invalidateQueries({ queryKey: ["release-catalog"] }),
189
+ queryClient.invalidateQueries({ queryKey: queryKeys.channels })
190
+ ]);
191
+ }
192
+ });
193
+ }
194
+ function usePreflightReleaseMutation() {
195
+ return useMutation({ mutationFn: (input) => preflightRelease({ data: input }) });
196
+ }
197
+ function useDeleteReleaseMutation() {
198
+ const queryClient = useQueryClient();
199
+ return useMutation({
200
+ mutationFn: (input) => deleteRelease({ data: input }),
201
+ onSuccess: async (_, input) => {
202
+ queryClient.removeQueries({ queryKey: queryKeys.release(input.releaseId) });
203
+ await Promise.all([
204
+ queryClient.invalidateQueries({ queryKey: queryKeys.releases.all }),
205
+ queryClient.invalidateQueries({ queryKey: ["release-catalog"] }),
206
+ queryClient.invalidateQueries({ queryKey: queryKeys.channels })
207
+ ]);
208
+ }
209
+ });
210
+ }
211
+ function usePromoteReleaseMutation() {
212
+ const queryClient = useQueryClient();
213
+ return useMutation({
214
+ mutationFn: (input) => promoteRelease({ data: input }),
215
+ onSuccess: async () => {
216
+ await Promise.all([
217
+ queryClient.invalidateQueries({ queryKey: queryKeys.releases.all }),
218
+ queryClient.invalidateQueries({ queryKey: ["release"] }),
219
+ queryClient.invalidateQueries({ queryKey: ["release-catalog"] }),
220
+ queryClient.invalidateQueries({ queryKey: queryKeys.channels })
221
+ ]);
222
+ }
223
+ });
224
+ }
225
+ function Textarea({ className, ...props }) {
226
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", {
227
+ "data-slot": "textarea",
228
+ className: cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className),
229
+ ...props
230
+ });
231
+ }
232
+ function InputGroup({ className, ...props }) {
233
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
234
+ "data-slot": "input-group",
235
+ className: cn("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto", className),
236
+ ...props
237
+ });
238
+ }
239
+ var inputGroupAddonVariants = cva("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none", {
240
+ variants: { align: {
241
+ "inline-start": "pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first",
242
+ "inline-end": "pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last",
243
+ "block-start": "px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start",
244
+ "block-end": "px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"
245
+ } },
246
+ defaultVariants: { align: "inline-start" }
247
+ });
248
+ function InputGroupAddon({ className, align = "inline-start", ...props }) {
249
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
250
+ "data-slot": "input-group-addon",
251
+ "data-align": align,
252
+ className: cn(inputGroupAddonVariants({ align }), className),
253
+ ...props
254
+ });
255
+ }
256
+ var inputGroupButtonVariants = cva("gap-2 rounded-md text-xs/relaxed shadow-none flex items-center", {
257
+ variants: { size: {
258
+ xs: "h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",
259
+ sm: "",
260
+ "icon-xs": "size-6 p-0 has-[>svg]:p-0",
261
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0"
262
+ } },
263
+ defaultVariants: { size: "xs" }
264
+ });
265
+ function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
266
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
267
+ type,
268
+ "data-size": size,
269
+ variant,
270
+ className: cn(inputGroupButtonVariants({ size }), className),
271
+ ...props
272
+ });
273
+ }
274
+ function InputGroupText({ className, ...props }) {
275
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
276
+ className: cn("text-muted-foreground gap-2 text-xs/relaxed [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none", className),
277
+ ...props
278
+ });
279
+ }
280
+ function InputGroupInput({ className, ...props }) {
281
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
282
+ "data-slot": "input-group-control",
283
+ className: cn("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1", className),
284
+ ...props
285
+ });
286
+ }
287
+ //#endregion
288
+ export { useUpdateReleaseMutation as C, useReleasesQuery as S, useInstallationSearchQuery as _, InputGroupText as a, useReleaseCatalogDiagnosticsQuery as b, useBundleChildrenQuery as c, useChannelsQuery as d, useConfigQuery as f, useInstallationHistoryQuery as g, useDeleteReleaseMutation as h, InputGroupInput as i, useBundleEventInsightsQuery as l, useDeleteChannelMutation as m, InputGroupAddon as n, Textarea as o, useCreateChannelMutation as p, InputGroupButton as r, useBundleChildCountsQuery as s, InputGroup as t, useBundleQuery as u, usePreflightReleaseMutation as v, useReleaseQuery as x, usePromoteReleaseMutation as y };
@@ -0,0 +1,71 @@
1
+ import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
2
+ import { w as createSsrRpc } from "./createSsrRpc-DhfrxEjg.mjs";
3
+ import { g as redirect } from "../_libs/@tanstack/react-router+[...].mjs";
4
+ import { n as useQuery } from "../_libs/tanstack__react-query.mjs";
5
+ import { t as parseActiveInstallationInput } from "./insights-input-9fEJF-ZG.mjs";
6
+ //#region node_modules/.nitro/vite/services/ssr/assets/insights-api-C1F7UreR.js
7
+ var getInsightsCapabilitiesRpc = createServerFn({ method: "GET" }).handler(createSsrRpc("8101c1b67ac0488033e72bd608b71b9f1357fbcb18f704aefda7ff781f2d174b"));
8
+ var getInsightsOverviewRpc = createServerFn({ method: "GET" }).handler(createSsrRpc("9a9239f6c3fe4a5b4c3f9f3dfe4902d99d1109e69c3b7f8394b97383aedb343c"));
9
+ var getActiveInstallationOverviewRpc = createServerFn({ method: "GET" }).validator(parseActiveInstallationInput).handler(createSsrRpc("11380734886ea712b34e5d8dbe3c5ecb3c1873c58435c87d41dfecfb0b75829c"));
10
+ var insightsQueryKeys = {
11
+ capabilities: ["insights", "capabilities"],
12
+ overview: ["insights", "overview"],
13
+ activeInstallations: (input) => [
14
+ "insights",
15
+ "active-installations",
16
+ input.window,
17
+ input.userId ?? null
18
+ ]
19
+ };
20
+ var INSIGHTS_STALE_TIME_MS = 3e4;
21
+ var getInsightsCapabilityState = (query) => {
22
+ switch (query.status) {
23
+ case "pending": return { status: "unresolved" };
24
+ case "error": return {
25
+ status: "error",
26
+ error: query.error
27
+ };
28
+ case "success":
29
+ if (!query.data.capabilities.insights) return { status: "unsupported" };
30
+ return {
31
+ status: "supported",
32
+ mode: "bounded",
33
+ maxMatchingRows: query.data.capabilities.maxMatchingRows
34
+ };
35
+ }
36
+ };
37
+ var isInsightsQueryEnabled = (capability) => capability.status === "supported";
38
+ var getInsightsCapabilitiesQueryOptions = () => ({
39
+ queryKey: insightsQueryKeys.capabilities,
40
+ queryFn: () => getInsightsCapabilitiesRpc(),
41
+ staleTime: Infinity
42
+ });
43
+ var useInsightsCapabilitiesQuery = () => useQuery(getInsightsCapabilitiesQueryOptions());
44
+ var ensureInsightsRouteAccess = async (queryClient) => {
45
+ if (!(await queryClient.ensureQueryData(getInsightsCapabilitiesQueryOptions())).capabilities.insights) throw redirect({
46
+ to: "/",
47
+ search: {},
48
+ replace: true
49
+ });
50
+ };
51
+ var getInsightsOverviewQueryOptions = (capability) => ({
52
+ queryKey: insightsQueryKeys.overview,
53
+ queryFn: () => getInsightsOverviewRpc(),
54
+ staleTime: INSIGHTS_STALE_TIME_MS,
55
+ refetchOnWindowFocus: true,
56
+ enabled: isInsightsQueryEnabled(capability)
57
+ });
58
+ var useInsightsOverviewQuery = (capability) => useQuery(getInsightsOverviewQueryOptions(capability));
59
+ var getActiveInstallationQueryOptions = (capability, input) => {
60
+ const normalized = parseActiveInstallationInput(input);
61
+ return {
62
+ queryKey: insightsQueryKeys.activeInstallations(normalized),
63
+ queryFn: () => getActiveInstallationOverviewRpc({ data: normalized }),
64
+ staleTime: INSIGHTS_STALE_TIME_MS,
65
+ refetchOnWindowFocus: true,
66
+ enabled: isInsightsQueryEnabled(capability)
67
+ };
68
+ };
69
+ var useActiveInstallationQuery = (capability, input) => useQuery(getActiveInstallationQueryOptions(capability, input));
70
+ //#endregion
71
+ export { useInsightsCapabilitiesQuery as a, useActiveInstallationQuery as i, getInsightsCapabilityState as n, useInsightsOverviewQuery as o, isInsightsQueryEnabled as r, ensureInsightsRouteAccess as t };
@@ -0,0 +1,96 @@
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/insights-input-9fEJF-ZG.js
2
+ var MAX_INSIGHTS_STRING_LENGTH = 1024;
3
+ var MAX_INSIGHTS_LIMIT = 100;
4
+ var InsightsInputValidationError = class extends Error {
5
+ name = "InsightsInputValidationError";
6
+ constructor(field) {
7
+ super(`Invalid insights input: ${field}`);
8
+ this.field = field;
9
+ }
10
+ };
11
+ var isRecord = (input) => typeof input === "object" && input !== null && !Array.isArray(input);
12
+ var parseRecord = (input) => {
13
+ if (!isRecord(input)) throw new InsightsInputValidationError("input");
14
+ return input;
15
+ };
16
+ var parseString = (input, field) => {
17
+ const value = input[field];
18
+ if (typeof value !== "string") throw new InsightsInputValidationError(field);
19
+ const trimmed = value.trim();
20
+ if (trimmed.length === 0 || trimmed.length > MAX_INSIGHTS_STRING_LENGTH) throw new InsightsInputValidationError(field);
21
+ return trimmed;
22
+ };
23
+ var parseLimit = (input) => {
24
+ const value = input.limit;
25
+ if (value === void 0) return;
26
+ if (typeof value !== "number" || !Number.isInteger(value) || value < 1 || value > MAX_INSIGHTS_LIMIT) throw new InsightsInputValidationError("limit");
27
+ return value;
28
+ };
29
+ var parseOffset = (input) => {
30
+ const value = input.offset;
31
+ if (value === void 0) return;
32
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) throw new InsightsInputValidationError("offset");
33
+ return value;
34
+ };
35
+ var parsePagination = (input) => {
36
+ const limit = parseLimit(input);
37
+ const offset = parseOffset(input);
38
+ return {
39
+ ...limit === void 0 ? {} : { limit },
40
+ ...offset === void 0 ? {} : { offset }
41
+ };
42
+ };
43
+ var parseWindow = (input) => {
44
+ const value = input.window;
45
+ if (value === "24h" || value === "7d" || value === "30d" || value === "all") return value;
46
+ throw new InsightsInputValidationError("window");
47
+ };
48
+ var parseActiveWindow = (input) => {
49
+ const value = input.window;
50
+ if (value === "24h" || value === "7d" || value === "30d") return value;
51
+ throw new InsightsInputValidationError("window");
52
+ };
53
+ var parseOptionalUserId = (input) => {
54
+ if (input.userId === void 0) return void 0;
55
+ if (typeof input.userId !== "string") throw new InsightsInputValidationError("userId");
56
+ const userId = input.userId.trim();
57
+ if (userId.length === 0) return void 0;
58
+ if (userId.length > MAX_INSIGHTS_STRING_LENGTH) throw new InsightsInputValidationError("userId");
59
+ return userId;
60
+ };
61
+ var parseActiveInstallationInput = (input) => {
62
+ const record = parseRecord(input);
63
+ const window = parseActiveWindow(record);
64
+ const userId = parseOptionalUserId(record);
65
+ return userId === void 0 ? { window } : {
66
+ window,
67
+ userId
68
+ };
69
+ };
70
+ var parseBundleEventSummaryInput = (input) => {
71
+ return { bundleId: parseString(parseRecord(input), "bundleId") };
72
+ };
73
+ var parseBundleEventInsightsInput = (input) => {
74
+ const record = parseRecord(input);
75
+ return {
76
+ bundleId: parseString(record, "bundleId"),
77
+ window: parseWindow(record),
78
+ ...parsePagination(record)
79
+ };
80
+ };
81
+ var parseSearchInstallationsInput = (input) => {
82
+ const record = parseRecord(input);
83
+ return {
84
+ query: parseString(record, "query"),
85
+ ...parsePagination(record)
86
+ };
87
+ };
88
+ var parseInstallationHistoryInput = (input) => {
89
+ const record = parseRecord(input);
90
+ return {
91
+ installId: parseString(record, "installId"),
92
+ ...parsePagination(record)
93
+ };
94
+ };
95
+ //#endregion
96
+ export { parseSearchInstallationsInput as a, parseInstallationHistoryInput as i, parseBundleEventInsightsInput as n, parseBundleEventSummaryInput as r, parseActiveInstallationInput as t };
@@ -0,0 +1,155 @@
1
+ import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
2
+ import { t as createServerRpc } from "./createServerRpc-DB29C_5p.mjs";
3
+ import { w as normalizeRolloutCohortCount } from "./dist-BVSLTpoP.mjs";
4
+ import { t as parseActiveInstallationInput } from "./insights-input-9fEJF-ZG.mjs";
5
+ //#region node_modules/.nitro/vite/services/ssr/assets/insights-overview-mnrbzD0I.js
6
+ var toBundleMetadata = (bundle, release, channelById) => ({
7
+ platform: bundle.platform,
8
+ channel: release ? channelById.get(release.channel_id) ?? null : null,
9
+ targetAppVersion: release?.target_app_version ?? null,
10
+ fingerprintHash: release?.fingerprint_hash ?? null
11
+ });
12
+ var compareCodePoints = (left, right) => left < right ? -1 : left > right ? 1 : 0;
13
+ var createOverview = (bundles, releases, channels, trackedInstallations, latestReportedCounts) => {
14
+ const bundleById = new Map(bundles.map((bundle) => [bundle.id, bundle]));
15
+ const channelById = new Map(channels.map((channel) => [channel.id, channel.name]));
16
+ const bundleReleases = releases.filter((release) => release.kind === "BUNDLE" && release.bundle_id !== null).sort((left, right) => compareCodePoints(right.id, left.id));
17
+ const latestReleaseByBundleId = /* @__PURE__ */ new Map();
18
+ for (const release of bundleReleases) if (!latestReleaseByBundleId.has(release.bundle_id)) latestReleaseByBundleId.set(release.bundle_id, release);
19
+ const latestReportedBundles = [...latestReportedCounts].map(([bundleId, count]) => {
20
+ const bundle = bundleById.get(bundleId);
21
+ return {
22
+ bundleId,
23
+ trackedInstallations: count,
24
+ observedShare: trackedInstallations === 0 ? 0 : count / trackedInstallations,
25
+ bundle: bundle ? toBundleMetadata(bundle, latestReleaseByBundleId.get(bundle.id), channelById) : null
26
+ };
27
+ }).sort((left, right) => right.trackedInstallations - left.trackedInstallations || compareCodePoints(left.bundleId, right.bundleId));
28
+ const configuredRollouts = bundleReleases.filter((release) => bundleById.has(release.bundle_id)).map((release) => ({
29
+ releaseId: release.id,
30
+ bundleId: release.bundle_id,
31
+ configuredPercentage: normalizeRolloutCohortCount(release.rollout_cohort_count) / 10,
32
+ trackedInstallations: latestReportedCounts.get(release.bundle_id) ?? 0,
33
+ bundle: toBundleMetadata(bundleById.get(release.bundle_id), release, channelById)
34
+ })).sort((left, right) => compareCodePoints(left.releaseId, right.releaseId));
35
+ return {
36
+ trackedInstallations,
37
+ mostCommonLatestReportedBundle: latestReportedBundles[0] ?? null,
38
+ latestReportedBundles,
39
+ configuredRollouts
40
+ };
41
+ };
42
+ var createInsightsOverviewFromCounts = (bundles, releases, channels, trackedInstallations, counts) => createOverview(bundles, releases, channels, trackedInstallations, new Map(counts.map(({ bundleId, installations }) => [bundleId, installations])));
43
+ //#endregion
44
+ //#region node_modules/.nitro/vite/services/ssr/assets/insights-rpc-C-8R6kED.js
45
+ var DEFAULT_INSIGHTS_PAGE_SIZE = 100;
46
+ var InsightsNotSupportedError = class extends Error {
47
+ constructor() {
48
+ super("Insights are not supported by the configured database plugin.");
49
+ this.name = "InsightsNotSupportedError";
50
+ }
51
+ };
52
+ var InsightsBundlePaginationError = class extends Error {
53
+ name = "InsightsBundlePaginationError";
54
+ constructor(requestedPage, reason) {
55
+ super(`Invalid bundle pagination for page ${requestedPage}: ${reason}`);
56
+ this.requestedPage = requestedPage;
57
+ this.reason = reason;
58
+ }
59
+ };
60
+ var getInsightsCapabilities = async (runtime) => {
61
+ const { getInsightsCapability } = await import("./runtime.server-la7TRAH_.mjs");
62
+ const capability = await getInsightsCapability(runtime);
63
+ if (!capability.insights || !capability.insightsQueries) return { capabilities: { insights: false } };
64
+ return { capabilities: {
65
+ insights: true,
66
+ mode: "bounded",
67
+ maxMatchingRows: capability.maxMatchingRows
68
+ } };
69
+ };
70
+ var collectBundles = async (getBundles, pageSize) => {
71
+ const bundles = [];
72
+ let page = 1;
73
+ while (true) {
74
+ const result = await getBundles({
75
+ limit: pageSize,
76
+ page
77
+ });
78
+ const { currentPage, hasNextPage, totalPages } = result.pagination;
79
+ const isEmptyFirstPage = page === 1 && currentPage === 1 && totalPages === 0 && result.data.length === 0 && hasNextPage === false;
80
+ if (currentPage !== page) throw new InsightsBundlePaginationError(page, `currentPage must equal ${page}, received ${currentPage}`);
81
+ if (!Number.isFinite(totalPages) || !Number.isInteger(totalPages)) throw new InsightsBundlePaginationError(page, `totalPages must be a finite integer, received ${totalPages}`);
82
+ if (totalPages < 0) throw new InsightsBundlePaginationError(page, `totalPages must be nonnegative, received ${totalPages}`);
83
+ if (!isEmptyFirstPage && totalPages < currentPage) throw new InsightsBundlePaginationError(page, `totalPages ${totalPages} is lower than currentPage ${currentPage}`);
84
+ if (!isEmptyFirstPage && hasNextPage !== currentPage < totalPages) throw new InsightsBundlePaginationError(page, "hasNextPage contradicts currentPage and totalPages");
85
+ bundles.push(...result.data);
86
+ if (!hasNextPage) return bundles;
87
+ page += 1;
88
+ }
89
+ };
90
+ var collectReleases = async (getReleases, pageSize) => {
91
+ const releases = [];
92
+ const cursors = /* @__PURE__ */ new Set();
93
+ let beforeReleaseId;
94
+ while (true) {
95
+ const page = await getReleases({
96
+ beforeReleaseId,
97
+ limit: pageSize
98
+ });
99
+ releases.push(...page);
100
+ if (page.length < pageSize) return releases;
101
+ const nextCursor = page.at(-1)?.id;
102
+ if (!nextCursor || cursors.has(nextCursor)) throw new InsightsBundlePaginationError(releases.length, "release cursor did not advance");
103
+ cursors.add(nextCursor);
104
+ beforeReleaseId = nextCursor;
105
+ }
106
+ };
107
+ var collectInsightsOverview = async ({ runtime, getBundles, getReleases, getChannels, pageSize = DEFAULT_INSIGHTS_PAGE_SIZE }) => {
108
+ const { capabilities } = await getInsightsCapabilities(runtime);
109
+ if (!capabilities.insights) throw new InsightsNotSupportedError();
110
+ const [bundles, releases, channels] = await Promise.all([
111
+ collectBundles(getBundles, pageSize),
112
+ collectReleases(getReleases, pageSize),
113
+ getChannels()
114
+ ]);
115
+ const overview = await runtime.getBundleEventOverview();
116
+ return createInsightsOverviewFromCounts(bundles, releases, channels, overview.trackedInstallations, overview.bundles);
117
+ };
118
+ var getInsightsCapabilitiesRpc_createServerFn_handler = createServerRpc({
119
+ id: "8101c1b67ac0488033e72bd608b71b9f1357fbcb18f704aefda7ff781f2d174b",
120
+ name: "getInsightsCapabilitiesRpc",
121
+ filename: "src/lib/insights-rpc.ts"
122
+ }, (opts) => getInsightsCapabilitiesRpc.__executeServer(opts));
123
+ var getInsightsCapabilitiesRpc = createServerFn({ method: "GET" }).handler(getInsightsCapabilitiesRpc_createServerFn_handler, async () => {
124
+ const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
125
+ const { hotUpdater } = await prepareConfig();
126
+ return getInsightsCapabilities(hotUpdater);
127
+ });
128
+ var getInsightsOverviewRpc_createServerFn_handler = createServerRpc({
129
+ id: "9a9239f6c3fe4a5b4c3f9f3dfe4902d99d1109e69c3b7f8394b97383aedb343c",
130
+ name: "getInsightsOverviewRpc",
131
+ filename: "src/lib/insights-rpc.ts"
132
+ }, (opts) => getInsightsOverviewRpc.__executeServer(opts));
133
+ var getInsightsOverviewRpc = createServerFn({ method: "GET" }).handler(getInsightsOverviewRpc_createServerFn_handler, async () => {
134
+ const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
135
+ const { config, databaseClient, hotUpdater } = await prepareConfig();
136
+ return collectInsightsOverview({
137
+ runtime: hotUpdater,
138
+ getBundles: (options) => databaseClient.getBundles(options),
139
+ getReleases: (options) => config.database.models.releases.findMany(options),
140
+ getChannels: () => config.database.models.channels.list({}).then(({ channels }) => channels)
141
+ });
142
+ });
143
+ var getActiveInstallationOverviewRpc_createServerFn_handler = createServerRpc({
144
+ id: "11380734886ea712b34e5d8dbe3c5ecb3c1873c58435c87d41dfecfb0b75829c",
145
+ name: "getActiveInstallationOverviewRpc",
146
+ filename: "src/lib/insights-rpc.ts"
147
+ }, (opts) => getActiveInstallationOverviewRpc.__executeServer(opts));
148
+ var getActiveInstallationOverviewRpc = createServerFn({ method: "GET" }).validator(parseActiveInstallationInput).handler(getActiveInstallationOverviewRpc_createServerFn_handler, async ({ data }) => {
149
+ const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
150
+ const { getActiveInstallationOverview } = await import("./runtime.server-la7TRAH_.mjs");
151
+ const { hotUpdater } = await prepareConfig();
152
+ return getActiveInstallationOverview(hotUpdater, data);
153
+ });
154
+ //#endregion
155
+ export { getActiveInstallationOverviewRpc_createServerFn_handler, getInsightsCapabilitiesRpc_createServerFn_handler, getInsightsOverviewRpc_createServerFn_handler };