@hot-updater/console 0.36.6 → 1.0.0-rc.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/AnalyticsCapabilityContext-BCke57-7.js +1 -0
- package/.output/public/assets/BundleActivityChart-CnsBe_1J.js +42 -0
- package/.output/public/assets/BundleIdDisplay-Dky75zLU.js +1 -0
- package/.output/public/assets/alert-C-1KvDW8.js +1 -0
- package/.output/public/assets/analytics-Bqz0c-BT.js +1 -0
- package/.output/public/assets/analytics-api-CJdrTLLO.js +1 -0
- package/.output/public/assets/api-B_Rh-uzC.js +1 -0
- package/.output/public/assets/api-keys-BurCFhzH.js +1 -0
- package/.output/public/assets/api-keys-api-BEDJdQg3.js +1 -0
- package/.output/public/assets/badge-Bf0fZ-Gx.js +1 -0
- package/.output/public/assets/chart-no-axes-combined-FaYMGmQS.js +1 -0
- package/.output/public/assets/createServerFn-gM2-LFBy.js +3 -0
- package/.output/public/assets/dialog-BS60BRr2.js +1 -0
- package/.output/public/assets/dist-DspNKfMj.js +1 -0
- package/.output/public/assets/download-O-yNBc9H.js +1 -0
- package/.output/public/assets/field-Buq148-A.js +1 -0
- package/.output/public/assets/index-kFhd2S78.js +10 -0
- package/.output/public/assets/installations-BrQ-od41.js +2 -0
- package/.output/public/assets/installations-CGlZ3ROz.js +1 -0
- package/.output/public/assets/lazyRouteComponent-rPzgA7S-.js +1 -0
- package/.output/public/assets/loader-circle-DCYF-wJl.js +1 -0
- package/.output/public/assets/preload-helper-TKOBYGYD.js +1 -0
- package/.output/public/assets/refresh-cw-n8XYbPPj.js +1 -0
- package/.output/public/assets/routes-CrdokJ80.js +1 -0
- package/.output/public/assets/routes-DcQnVajO.js +2 -0
- package/.output/public/assets/search-DLhbWw3W.js +1 -0
- package/.output/public/assets/shield-check-DE_hVuHu.js +1 -0
- package/.output/public/assets/signing-HRexfjsH.js +1 -0
- package/.output/public/assets/styles-eB4EtvFS.css +2 -0
- package/.output/public/assets/table-D8CLieHX.js +1 -0
- package/.output/public/assets/textarea-YJLTVAoq.js +1 -0
- package/.output/public/assets/useMutation-JsGVjQMY.js +1 -0
- package/.output/public/assets/useOpenInteractionType-4cRD5xO0.js +1 -0
- package/.output/server/__23tanstack-start-server-fn-resolver-DBP9TQ7K.mjs +146 -0
- package/.output/server/_libs/@base-ui/react+[...].mjs +16124 -0
- package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +41 -10
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +132 -0
- package/.output/server/_libs/d3-array.mjs +231 -0
- package/.output/server/_libs/d3-color.mjs +330 -0
- package/.output/server/_libs/d3-format.mjs +252 -0
- package/.output/server/_libs/d3-interpolate.mjs +207 -0
- package/.output/server/_libs/d3-path.mjs +77 -0
- package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
- package/.output/server/_libs/d3-shape.mjs +818 -0
- package/.output/server/_libs/decimal.js-light.mjs +884 -0
- package/.output/server/_libs/es-toolkit.mjs +1134 -0
- package/.output/server/_libs/eventemitter3.mjs +236 -0
- package/.output/server/_libs/immer.mjs +532 -0
- package/.output/server/_libs/lucide-react.mjs +141 -13
- package/.output/server/_libs/next-themes.mjs +2 -2
- package/.output/server/_libs/react-redux+[...].mjs +205 -0
- package/.output/server/_libs/recharts+[...].mjs +14117 -0
- package/.output/server/_libs/sonner.mjs +2 -2
- package/.output/server/_libs/tanstack__query-core.mjs +114 -1
- package/.output/server/_libs/tanstack__react-query.mjs +3 -4
- package/.output/server/_runtime.mjs +10 -1
- package/.output/server/_ssr/AnalyticsCapabilityContext-ui4DX8GO.mjs +15 -0
- package/.output/server/_ssr/BundleActivityChart-BiB9ZORH.mjs +288 -0
- package/.output/server/_ssr/BundleIdDisplay-Czk6iR6p.mjs +13 -0
- package/.output/server/_ssr/alert-Dim3MGY5.mjs +86 -0
- package/.output/server/_ssr/analytics-DtMTn8fn.mjs +858 -0
- package/.output/server/_ssr/analytics-api-Cg1M5v_H.mjs +71 -0
- package/.output/server/_ssr/analytics-input-fRRRn0uA.mjs +96 -0
- package/.output/server/_ssr/analytics-rpc-DY5uXvHT.mjs +155 -0
- package/.output/server/_ssr/api-BTSv1tZb.mjs +282 -0
- package/.output/server/_ssr/api-keys-BnM_o2nS.mjs +300 -0
- package/.output/server/_ssr/api-keys-api-CIywsSF5.mjs +60 -0
- package/.output/server/_ssr/api-keys-rpc-BSp1wkIV.mjs +136 -0
- package/.output/server/_ssr/api-rpc-cG5wd_tO.mjs +1468 -0
- package/.output/server/_ssr/auth-BF8mbAgF.mjs +21 -0
- package/.output/server/_ssr/auth-rpc-BrJ6obHJ.mjs +24 -0
- package/.output/server/_ssr/auth.server-DwKoZoQM.mjs +50 -0
- package/.output/server/_ssr/badge-DCxbEeof.mjs +26 -0
- package/.output/server/_ssr/bundle-signing-rpc-COoQhW8E.mjs +16 -0
- package/.output/server/_ssr/bundle-signing.server-D5u8KkMp.mjs +51 -0
- package/.output/server/_ssr/config-Dv8qLDZ0.mjs +13 -0
- package/.output/server/_ssr/config.server-DEiLhKmy.mjs +361 -0
- package/.output/server/_ssr/{createServerFn-DzU0k62V.mjs → createServerFn-B2hcXoPM.mjs} +1 -1
- package/.output/server/_ssr/createServerRpc-DB29C_5p.mjs +12 -0
- package/.output/server/_ssr/{sidebar-Cv_H0_Jv.mjs → createSsrRpc-9P0S0lJ3.mjs} +68 -50
- package/.output/server/_ssr/databaseRows-CwbNwYSl.mjs +166 -0
- package/.output/server/_ssr/deleteBundle-Cu_XOMt0.mjs +66 -0
- package/.output/server/_ssr/dialog-CQuRMNZ4.mjs +170 -0
- package/.output/server/_ssr/dist-BVSLTpoP.mjs +250 -0
- package/.output/server/_ssr/downloadBundle-CNnYxYO2.mjs +24 -0
- package/.output/server/_ssr/{empty-plugin-adapters-B4HCzgmM.mjs → empty-plugin-adapters-B5QvGpEl.mjs} +1 -1
- package/.output/server/_ssr/field-DRIXKjZG.mjs +74 -0
- package/.output/server/_ssr/{getBundleChildren-CVtSiH5t.mjs → getBundleChildren-BcRMFoDF.mjs} +10 -18
- package/.output/server/_ssr/installations-B-azgAvX.mjs +19 -0
- package/.output/server/_ssr/installations-Ctvzp2JH.mjs +535 -0
- package/.output/server/_ssr/router-C-KUBfOi.mjs +513 -0
- package/.output/server/_ssr/routes-BM4ht9jb.mjs +2286 -0
- package/.output/server/_ssr/routes-Z7TwC6nC.mjs +37 -0
- package/.output/server/_ssr/runtime.server-awTLiiXW.mjs +527 -0
- package/.output/server/_ssr/server-BjzmvXnO.mjs +7468 -0
- package/.output/server/_ssr/signing-k8GxyBDF.mjs +202 -0
- package/.output/server/_ssr/ssr.mjs +4 -5740
- package/.output/server/_ssr/start-DpViQGnt.mjs +4 -0
- package/.output/server/_ssr/table-v1yCvYo7.mjs +53 -0
- package/.output/server/_ssr/textarea-DYHnskhb.mjs +14 -0
- package/.output/server/_ssr/uuidv7-BbJ-9D_I.mjs +31 -0
- package/.output/server/_tanstack-start-manifest_v-CH4StzJu.mjs +108 -0
- package/.output/server/index.mjs +249 -46
- package/README.md +29 -8
- package/lib/index.d.mts +36 -0
- package/lib/index.mjs +4 -0
- package/lib/vite-internal.mjs +127 -0
- package/lib/vite.d.mts +10 -0
- package/lib/vite.mjs +5 -0
- package/package.json +51 -29
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/logo.svg +1 -0
- package/public/manifest.json +30 -0
- package/public/robots.txt +3 -0
- package/src/components/AppSidebar.tsx +159 -0
- package/src/components/BundleIdDisplay.tsx +18 -0
- package/src/components/ChannelBadge.tsx +31 -0
- package/src/components/ConsoleAccessPage.tsx +122 -0
- package/src/components/EnabledStatusIcon.tsx +54 -0
- package/src/components/HashValueDisplay.tsx +85 -0
- package/src/components/HotUpdaterLogo.tsx +30 -0
- package/src/components/NotFoundPage.tsx +33 -0
- package/src/components/PlatformIcon.tsx +39 -0
- package/src/components/RolloutPercentageBadge.tsx +28 -0
- package/src/components/ThemeProvider.tsx +116 -0
- package/src/components/TimestampDisplay.tsx +41 -0
- package/src/components/features/analytics/ActivityChart.tsx +150 -0
- package/src/components/features/analytics/AnalyticsCapabilityContext.tsx +24 -0
- package/src/components/features/analytics/AnalyticsControls.tsx +115 -0
- package/src/components/features/analytics/AnalyticsErrorAlert.tsx +21 -0
- package/src/components/features/analytics/AnalyticsOverview.tsx +208 -0
- package/src/components/features/analytics/BundleDistribution.tsx +133 -0
- package/src/components/features/analytics/BundleSelector.tsx +114 -0
- package/src/components/features/analytics/InstallationHistoryCard.tsx +248 -0
- package/src/components/features/analytics/InstallationMatchesCard.tsx +132 -0
- package/src/components/features/analytics/InstallationPageHeader.tsx +138 -0
- package/src/components/features/analytics/InstallationPagination.tsx +48 -0
- package/src/components/features/analytics/InstallationSearch.tsx +230 -0
- package/src/components/features/analytics/UpdateOutcomes.tsx +147 -0
- package/src/components/features/api-keys/ApiKeysPage.tsx +377 -0
- package/src/components/features/bundles/BundleActivityChart.tsx +193 -0
- package/src/components/features/bundles/BundleAnalyticsSummary.tsx +123 -0
- package/src/components/features/bundles/BundleChildrenPanel.tsx +201 -0
- package/src/components/features/bundles/BundleMetadata.tsx +136 -0
- package/src/components/features/bundles/RolloutCohortsDialog.tsx +201 -0
- package/src/components/features/channels/ChannelManagementDialog.tsx +228 -0
- package/src/components/features/releases/ReleaseEditorSheet.tsx +879 -0
- package/src/components/features/releases/ReleaseStateBadge.tsx +20 -0
- package/src/components/features/signing/BundleSigningPage.tsx +247 -0
- package/src/components/ui/alert-dialog.tsx +185 -0
- package/src/components/ui/alert.tsx +76 -0
- package/src/components/ui/badge.tsx +49 -0
- package/src/components/ui/button.tsx +58 -0
- package/src/components/ui/card.tsx +89 -0
- package/src/components/ui/chart.tsx +371 -0
- package/src/components/ui/combobox.tsx +303 -0
- package/src/components/ui/dialog.tsx +156 -0
- package/src/components/ui/dropdown-menu.tsx +270 -0
- package/src/components/ui/field.tsx +235 -0
- package/src/components/ui/input-group.tsx +147 -0
- package/src/components/ui/input.tsx +19 -0
- package/src/components/ui/label.tsx +25 -0
- package/src/components/ui/progress.tsx +84 -0
- package/src/components/ui/select.tsx +205 -0
- package/src/components/ui/separator.tsx +23 -0
- package/src/components/ui/sheet.tsx +132 -0
- package/src/components/ui/sidebar.tsx +779 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +56 -0
- package/src/components/ui/sonner.tsx +45 -0
- package/src/components/ui/switch.tsx +25 -0
- package/src/components/ui/table.tsx +114 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/toggle-group.tsx +89 -0
- package/src/components/ui/toggle.tsx +43 -0
- package/src/components/ui/tooltip.tsx +66 -0
- package/src/hooks/use-mobile.ts +30 -0
- package/src/index.ts +48 -0
- package/src/lib/analytics-api.ts +145 -0
- package/src/lib/analytics-error.ts +19 -0
- package/src/lib/analytics-input.ts +187 -0
- package/src/lib/analytics-overview.ts +170 -0
- package/src/lib/analytics-rpc.ts +218 -0
- package/src/lib/api-keys-api.ts +69 -0
- package/src/lib/api-keys-rpc.ts +87 -0
- package/src/lib/api-rpc.ts +478 -0
- package/src/lib/api.ts +444 -0
- package/src/lib/auth-rpc.ts +16 -0
- package/src/lib/bundle-signing-api.ts +14 -0
- package/src/lib/bundle-signing-rpc.ts +16 -0
- package/src/lib/constants.ts +1 -0
- package/src/lib/git.ts +51 -0
- package/src/lib/server/auth.server.ts +43 -0
- package/src/lib/server/bundle-signing.server.ts +100 -0
- package/src/lib/server/config.server.ts +109 -0
- package/src/lib/server/console-runtime.server.ts +70 -0
- package/src/lib/server/deleteBundle.ts +145 -0
- package/src/lib/server/downloadBundle.ts +46 -0
- package/src/lib/server/getBundleChildren.ts +130 -0
- package/src/lib/server/listReleases.ts +61 -0
- package/src/lib/server/releaseActivity.ts +27 -0
- package/src/lib/server/releaseReachability.ts +95 -0
- package/src/lib/server/runtime.server.ts +172 -0
- package/src/lib/utils.ts +9 -0
- package/src/logo.svg +1 -0
- package/src/routeTree.gen.ts +199 -0
- package/src/router.tsx +21 -0
- package/src/routes/-installations-search.ts +19 -0
- package/src/routes/-releases-search.ts +74 -0
- package/src/routes/__root.tsx +174 -0
- package/src/routes/analytics.tsx +139 -0
- package/src/routes/api/auth/$.ts +19 -0
- package/src/routes/api/bundles/$bundleId/download.ts +17 -0
- package/src/routes/api-keys.tsx +37 -0
- package/src/routes/index.tsx +982 -0
- package/src/routes/installations.tsx +194 -0
- package/src/routes/signing.tsx +37 -0
- package/src/styles.css +152 -0
- package/src/virtual-modules.d.ts +21 -0
- package/src/vite-env.d.ts +1 -0
- package/src/vite-internal.ts +195 -0
- package/src/vite.ts +12 -0
- package/.output/public/assets/dist-DJX53faP.js +0 -3
- package/.output/public/assets/index-Iylis5kY.js +0 -10
- package/.output/public/assets/routes-HT21hs0C.js +0 -54
- package/.output/public/assets/styles-C0Re4quB.css +0 -2
- package/.output/server/__23tanstack-start-server-fn-resolver-CgwgZ0-i.mjs +0 -66
- package/.output/server/_libs/@floating-ui/core+[...].mjs +0 -698
- package/.output/server/_libs/@floating-ui/dom+[...].mjs +0 -644
- package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +0 -839
- package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +0 -2138
- package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +0 -308
- package/.output/server/_libs/@radix-ui/react-select+[...].mjs +0 -1038
- package/.output/server/_libs/@tanstack/devtools-event-client+[...].mjs +0 -196
- package/.output/server/_libs/@tanstack/form-core+[...].mjs +0 -3228
- package/.output/server/_libs/@tanstack/react-form+[...].mjs +0 -430
- package/.output/server/_libs/@tanstack/react-table+[...].mjs +0 -2382
- package/.output/server/_libs/radix-ui__number.mjs +0 -6
- package/.output/server/_libs/radix-ui__primitive.mjs +0 -9
- package/.output/server/_libs/radix-ui__react-arrow.mjs +0 -23
- package/.output/server/_libs/radix-ui__react-collection.mjs +0 -78
- package/.output/server/_libs/radix-ui__react-direction.mjs +0 -13
- package/.output/server/_libs/radix-ui__react-label.mjs +0 -22
- package/.output/server/_libs/radix-ui__react-separator.mjs +0 -30
- package/.output/server/_libs/radix-ui__react-slider.mjs +0 -510
- package/.output/server/_libs/radix-ui__react-switch.mjs +0 -157
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +0 -493
- package/.output/server/_ssr/api-rpc-BIbDUKSz.mjs +0 -292
- package/.output/server/_ssr/config.server-BSS366KT.mjs +0 -41
- package/.output/server/_ssr/deleteBundle-BgbZTtpW.mjs +0 -141
- package/.output/server/_ssr/dist-KboydRVk.mjs +0 -120
- package/.output/server/_ssr/router-C3hqEy3k.mjs +0 -307
- package/.output/server/_ssr/routes-B0lQvvlC.mjs +0 -3048
- package/.output/server/_ssr/start-02sLteYG.mjs +0 -4
- package/.output/server/_ssr/storageProfile-FVkjPoGb.mjs +0 -9
- package/.output/server/_tanstack-start-manifest_v-Bpx52WOU.mjs +0 -20
- package/.output/server/node_modules/tslib/modules/index.js +0 -70
- package/.output/server/node_modules/tslib/modules/package.json +0 -3
- package/.output/server/node_modules/tslib/package.json +0 -47
- package/.output/server/node_modules/tslib/tslib.js +0 -484
- package/.output/server/package.json +0 -9
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
|
|
2
|
+
import { w as createSsrRpc } from "./createSsrRpc-9P0S0lJ3.mjs";
|
|
3
|
+
import { t as parseActiveInstallationInput } from "./analytics-input-fRRRn0uA.mjs";
|
|
4
|
+
import { g as redirect } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
5
|
+
import { n as useQuery } from "../_libs/tanstack__react-query.mjs";
|
|
6
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/analytics-api-Cg1M5v_H.js
|
|
7
|
+
var getAnalyticsCapabilitiesRpc = createServerFn({ method: "GET" }).handler(createSsrRpc("fc80930d0e0358e13c0de3c271902bdd0a83980829d158e4e2244bd41cfd77f7"));
|
|
8
|
+
var getAnalyticsOverviewRpc = createServerFn({ method: "GET" }).handler(createSsrRpc("78aaee61b7e088d695642fea56049c431373da7f1aad0cf8c6a5e966e8eafe01"));
|
|
9
|
+
var getActiveInstallationOverviewRpc = createServerFn({ method: "GET" }).validator(parseActiveInstallationInput).handler(createSsrRpc("18949edfef6eee282f0d97fa2a9ea158798c5fa6c528597182036af6dc7185a5"));
|
|
10
|
+
var analyticsQueryKeys = {
|
|
11
|
+
capabilities: ["analytics", "capabilities"],
|
|
12
|
+
overview: ["analytics", "overview"],
|
|
13
|
+
activeInstallations: (input) => [
|
|
14
|
+
"analytics",
|
|
15
|
+
"active-installations",
|
|
16
|
+
input.window,
|
|
17
|
+
input.userId ?? null
|
|
18
|
+
]
|
|
19
|
+
};
|
|
20
|
+
var ANALYTICS_STALE_TIME_MS = 3e4;
|
|
21
|
+
var getAnalyticsCapabilityState = (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.analytics) return { status: "unsupported" };
|
|
30
|
+
return {
|
|
31
|
+
status: "supported",
|
|
32
|
+
mode: "bounded",
|
|
33
|
+
maxMatchingRows: query.data.capabilities.maxMatchingRows
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var isAnalyticsQueryEnabled = (capability) => capability.status === "supported";
|
|
38
|
+
var getAnalyticsCapabilitiesQueryOptions = () => ({
|
|
39
|
+
queryKey: analyticsQueryKeys.capabilities,
|
|
40
|
+
queryFn: () => getAnalyticsCapabilitiesRpc(),
|
|
41
|
+
staleTime: Infinity
|
|
42
|
+
});
|
|
43
|
+
var useAnalyticsCapabilitiesQuery = () => useQuery(getAnalyticsCapabilitiesQueryOptions());
|
|
44
|
+
var ensureAnalyticsRouteAccess = async (queryClient) => {
|
|
45
|
+
if (!(await queryClient.ensureQueryData(getAnalyticsCapabilitiesQueryOptions())).capabilities.analytics) throw redirect({
|
|
46
|
+
to: "/",
|
|
47
|
+
search: {},
|
|
48
|
+
replace: true
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
var getAnalyticsOverviewQueryOptions = (capability) => ({
|
|
52
|
+
queryKey: analyticsQueryKeys.overview,
|
|
53
|
+
queryFn: () => getAnalyticsOverviewRpc(),
|
|
54
|
+
staleTime: ANALYTICS_STALE_TIME_MS,
|
|
55
|
+
refetchOnWindowFocus: true,
|
|
56
|
+
enabled: isAnalyticsQueryEnabled(capability)
|
|
57
|
+
});
|
|
58
|
+
var useAnalyticsOverviewQuery = (capability) => useQuery(getAnalyticsOverviewQueryOptions(capability));
|
|
59
|
+
var getActiveInstallationQueryOptions = (capability, input) => {
|
|
60
|
+
const normalized = parseActiveInstallationInput(input);
|
|
61
|
+
return {
|
|
62
|
+
queryKey: analyticsQueryKeys.activeInstallations(normalized),
|
|
63
|
+
queryFn: () => getActiveInstallationOverviewRpc({ data: normalized }),
|
|
64
|
+
staleTime: ANALYTICS_STALE_TIME_MS,
|
|
65
|
+
refetchOnWindowFocus: true,
|
|
66
|
+
enabled: isAnalyticsQueryEnabled(capability)
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
var useActiveInstallationQuery = (capability, input) => useQuery(getActiveInstallationQueryOptions(capability, input));
|
|
70
|
+
//#endregion
|
|
71
|
+
export { useAnalyticsCapabilitiesQuery as a, useActiveInstallationQuery as i, getAnalyticsCapabilityState as n, useAnalyticsOverviewQuery as o, isAnalyticsQueryEnabled as r, ensureAnalyticsRouteAccess as t };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/analytics-input-fRRRn0uA.js
|
|
2
|
+
var MAX_ANALYTICS_STRING_LENGTH = 1024;
|
|
3
|
+
var MAX_ANALYTICS_LIMIT = 100;
|
|
4
|
+
var AnalyticsInputValidationError = class extends Error {
|
|
5
|
+
name = "AnalyticsInputValidationError";
|
|
6
|
+
constructor(field) {
|
|
7
|
+
super(`Invalid analytics 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 AnalyticsInputValidationError("input");
|
|
14
|
+
return input;
|
|
15
|
+
};
|
|
16
|
+
var parseString = (input, field) => {
|
|
17
|
+
const value = input[field];
|
|
18
|
+
if (typeof value !== "string") throw new AnalyticsInputValidationError(field);
|
|
19
|
+
const trimmed = value.trim();
|
|
20
|
+
if (trimmed.length === 0 || trimmed.length > MAX_ANALYTICS_STRING_LENGTH) throw new AnalyticsInputValidationError(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_ANALYTICS_LIMIT) throw new AnalyticsInputValidationError("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 AnalyticsInputValidationError("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 AnalyticsInputValidationError("window");
|
|
47
|
+
};
|
|
48
|
+
var parseActiveWindow = (input) => {
|
|
49
|
+
const value = input.window;
|
|
50
|
+
if (value === "24h" || value === "7d" || value === "30d") return value;
|
|
51
|
+
throw new AnalyticsInputValidationError("window");
|
|
52
|
+
};
|
|
53
|
+
var parseOptionalUserId = (input) => {
|
|
54
|
+
if (input.userId === void 0) return void 0;
|
|
55
|
+
if (typeof input.userId !== "string") throw new AnalyticsInputValidationError("userId");
|
|
56
|
+
const userId = input.userId.trim();
|
|
57
|
+
if (userId.length === 0) return void 0;
|
|
58
|
+
if (userId.length > MAX_ANALYTICS_STRING_LENGTH) throw new AnalyticsInputValidationError("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 parseBundleEventAnalyticsInput = (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, parseBundleEventAnalyticsInput 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 parseActiveInstallationInput } from "./analytics-input-fRRRn0uA.mjs";
|
|
3
|
+
import { t as createServerRpc } from "./createServerRpc-DB29C_5p.mjs";
|
|
4
|
+
import { w as normalizeRolloutCohortCount } from "./dist-BVSLTpoP.mjs";
|
|
5
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/analytics-overview-CowJmr9I.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 createAnalyticsOverviewFromCounts = (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/analytics-rpc-DY5uXvHT.js
|
|
45
|
+
var DEFAULT_ANALYTICS_PAGE_SIZE = 100;
|
|
46
|
+
var AnalyticsNotSupportedError = class extends Error {
|
|
47
|
+
constructor() {
|
|
48
|
+
super("Analytics are not supported by the configured database plugin.");
|
|
49
|
+
this.name = "AnalyticsNotSupportedError";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var AnalyticsBundlePaginationError = class extends Error {
|
|
53
|
+
name = "AnalyticsBundlePaginationError";
|
|
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 getAnalyticsCapabilities = async (runtime) => {
|
|
61
|
+
const { getAnalyticsCapability } = await import("./runtime.server-awTLiiXW.mjs");
|
|
62
|
+
const capability = await getAnalyticsCapability(runtime);
|
|
63
|
+
if (!capability.analytics || !capability.analyticsQueries) return { capabilities: { analytics: false } };
|
|
64
|
+
return { capabilities: {
|
|
65
|
+
analytics: 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 AnalyticsBundlePaginationError(page, `currentPage must equal ${page}, received ${currentPage}`);
|
|
81
|
+
if (!Number.isFinite(totalPages) || !Number.isInteger(totalPages)) throw new AnalyticsBundlePaginationError(page, `totalPages must be a finite integer, received ${totalPages}`);
|
|
82
|
+
if (totalPages < 0) throw new AnalyticsBundlePaginationError(page, `totalPages must be nonnegative, received ${totalPages}`);
|
|
83
|
+
if (!isEmptyFirstPage && totalPages < currentPage) throw new AnalyticsBundlePaginationError(page, `totalPages ${totalPages} is lower than currentPage ${currentPage}`);
|
|
84
|
+
if (!isEmptyFirstPage && hasNextPage !== currentPage < totalPages) throw new AnalyticsBundlePaginationError(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 AnalyticsBundlePaginationError(releases.length, "release cursor did not advance");
|
|
103
|
+
cursors.add(nextCursor);
|
|
104
|
+
beforeReleaseId = nextCursor;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var collectAnalyticsOverview = async ({ runtime, getBundles, getReleases, getChannels, pageSize = DEFAULT_ANALYTICS_PAGE_SIZE }) => {
|
|
108
|
+
const { capabilities } = await getAnalyticsCapabilities(runtime);
|
|
109
|
+
if (!capabilities.analytics) throw new AnalyticsNotSupportedError();
|
|
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 createAnalyticsOverviewFromCounts(bundles, releases, channels, overview.trackedInstallations, overview.bundles);
|
|
117
|
+
};
|
|
118
|
+
var getAnalyticsCapabilitiesRpc_createServerFn_handler = createServerRpc({
|
|
119
|
+
id: "fc80930d0e0358e13c0de3c271902bdd0a83980829d158e4e2244bd41cfd77f7",
|
|
120
|
+
name: "getAnalyticsCapabilitiesRpc",
|
|
121
|
+
filename: "src/lib/analytics-rpc.ts"
|
|
122
|
+
}, (opts) => getAnalyticsCapabilitiesRpc.__executeServer(opts));
|
|
123
|
+
var getAnalyticsCapabilitiesRpc = createServerFn({ method: "GET" }).handler(getAnalyticsCapabilitiesRpc_createServerFn_handler, async () => {
|
|
124
|
+
const { prepareConfig } = await import("./config.server-DEiLhKmy.mjs");
|
|
125
|
+
const { hotUpdater } = await prepareConfig();
|
|
126
|
+
return getAnalyticsCapabilities(hotUpdater);
|
|
127
|
+
});
|
|
128
|
+
var getAnalyticsOverviewRpc_createServerFn_handler = createServerRpc({
|
|
129
|
+
id: "78aaee61b7e088d695642fea56049c431373da7f1aad0cf8c6a5e966e8eafe01",
|
|
130
|
+
name: "getAnalyticsOverviewRpc",
|
|
131
|
+
filename: "src/lib/analytics-rpc.ts"
|
|
132
|
+
}, (opts) => getAnalyticsOverviewRpc.__executeServer(opts));
|
|
133
|
+
var getAnalyticsOverviewRpc = createServerFn({ method: "GET" }).handler(getAnalyticsOverviewRpc_createServerFn_handler, async () => {
|
|
134
|
+
const { prepareConfig } = await import("./config.server-DEiLhKmy.mjs");
|
|
135
|
+
const { config, databaseClient, hotUpdater } = await prepareConfig();
|
|
136
|
+
return collectAnalyticsOverview({
|
|
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: "18949edfef6eee282f0d97fa2a9ea158798c5fa6c528597182036af6dc7185a5",
|
|
145
|
+
name: "getActiveInstallationOverviewRpc",
|
|
146
|
+
filename: "src/lib/analytics-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-DEiLhKmy.mjs");
|
|
150
|
+
const { getActiveInstallationOverview } = await import("./runtime.server-awTLiiXW.mjs");
|
|
151
|
+
const { hotUpdater } = await prepareConfig();
|
|
152
|
+
return getActiveInstallationOverview(hotUpdater, data);
|
|
153
|
+
});
|
|
154
|
+
//#endregion
|
|
155
|
+
export { getActiveInstallationOverviewRpc_createServerFn_handler, getAnalyticsCapabilitiesRpc_createServerFn_handler, getAnalyticsOverviewRpc_createServerFn_handler };
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import "../_runtime.mjs";
|
|
2
|
+
import { at as require_react, it as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
|
+
import { c as createServerFn } from "./createServerFn-B2hcXoPM.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-9P0S0lJ3.mjs";
|
|
6
|
+
import { a as parseSearchInstallationsInput, i as parseInstallationHistoryInput, n as parseBundleEventAnalyticsInput, r as parseBundleEventSummaryInput } from "./analytics-input-fRRRn0uA.mjs";
|
|
7
|
+
import { i as useQueryClient, n as useQuery, t as useMutation } from "../_libs/tanstack__react-query.mjs";
|
|
8
|
+
import "./textarea-DYHnskhb.mjs";
|
|
9
|
+
require_react();
|
|
10
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
11
|
+
function InputGroup({ className, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13
|
+
"data-slot": "input-group",
|
|
14
|
+
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),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
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", {
|
|
19
|
+
variants: { align: {
|
|
20
|
+
"inline-start": "pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first",
|
|
21
|
+
"inline-end": "pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last",
|
|
22
|
+
"block-start": "px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start",
|
|
23
|
+
"block-end": "px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"
|
|
24
|
+
} },
|
|
25
|
+
defaultVariants: { align: "inline-start" }
|
|
26
|
+
});
|
|
27
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
28
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
29
|
+
"data-slot": "input-group-addon",
|
|
30
|
+
"data-align": align,
|
|
31
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
var inputGroupButtonVariants = cva("gap-2 rounded-md text-xs/relaxed shadow-none flex items-center", {
|
|
36
|
+
variants: { size: {
|
|
37
|
+
xs: "h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",
|
|
38
|
+
sm: "",
|
|
39
|
+
"icon-xs": "size-6 p-0 has-[>svg]:p-0",
|
|
40
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
41
|
+
} },
|
|
42
|
+
defaultVariants: { size: "xs" }
|
|
43
|
+
});
|
|
44
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
46
|
+
type,
|
|
47
|
+
"data-size": size,
|
|
48
|
+
variant,
|
|
49
|
+
className: cn(inputGroupButtonVariants({ size }), className),
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function InputGroupText({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
55
|
+
className: cn("text-muted-foreground gap-2 text-xs/relaxed [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none", className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function InputGroupInput({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
|
|
61
|
+
"data-slot": "input-group-control",
|
|
62
|
+
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),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
var getReleases = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("206547cb1526f961070a989818ca7b9e34f6b2b0e4ab851698c3807fe9fb5e0c"));
|
|
67
|
+
var getRelease = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("a6f23116eeaf76166d405e28a95213123025613c6603030894e519015bf48032"));
|
|
68
|
+
var updateRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("7ea0186f19f9f2bc2ca4b26e3c59636891cf046957f84287b6783f8d88bd8cb7"));
|
|
69
|
+
var preflightRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("b46c95dba95a6a3e8fa5c9d100e3622fa5ae7af4f38e10fb1ed2fa48289a3a8f"));
|
|
70
|
+
var deleteRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("d5b58722ce514e3b63a377f736b4823c2011782495442ae4870ed547e392c70b"));
|
|
71
|
+
var promoteRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("956539a300d79a7efa191c1cc2d529d62fc4bfd940442548fdbc1404e0d53078"));
|
|
72
|
+
var getReleaseCatalogDiagnostics = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("e8c24b7247936f045a145ffd5c177fd0e3df3b52769d67dfbd8d1de491d66396"));
|
|
73
|
+
var getConfig = createServerFn().handler(createSsrRpc("51a34c05479a893c7d320bd4cd1604427289d667698c48b9f30a01aabf8a5e68"));
|
|
74
|
+
var getChannels = createServerFn().handler(createSsrRpc("79ada05964de8f2123bfcd62b10097d59bf8fd689ef5c7161031e5871d8396c5"));
|
|
75
|
+
var createChannel = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("2b9b8d1f49f79a511589617d8d4bfc6094a3acf5264f33651b9569ba66d3f321"));
|
|
76
|
+
var deleteChannel = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("52756dde414919a906bfe83d1ab6d29910c63bcafdb47653d6f1df562d958920"));
|
|
77
|
+
createServerFn().handler(createSsrRpc("f8bdca3d0579adb812d6404f55d9261a89cdb025e920b1fcad82883646a5fe9e"));
|
|
78
|
+
createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("00ccacb4a0212c83ec29f4d11719046ad91ea8291cfc557d514dbf00d3bd7f5f"));
|
|
79
|
+
var getBundle = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("1bd85c2a50e24785cb6abb023a247a9f048f37ddfa85cbb1c57e579563bad013"));
|
|
80
|
+
createServerFn({ method: "GET" }).inputValidator(parseBundleEventSummaryInput).handler(createSsrRpc("d4320e02be8e5c6ae7ec70a17604c835fde4686756031277b09d96b7f3de5f14"));
|
|
81
|
+
var getBundleEventAnalytics = createServerFn({ method: "GET" }).inputValidator(parseBundleEventAnalyticsInput).handler(createSsrRpc("4eaa296cec4c5d145557e4ae657ddd2d17a9fa253e33ee270e360957333bedbb"));
|
|
82
|
+
var searchInstallations = createServerFn({ method: "GET" }).inputValidator(parseSearchInstallationsInput).handler(createSsrRpc("57cc4fac8359876a1d5c4b04615ba6d39bcc4b76768bb5395309ec350bd61a51"));
|
|
83
|
+
var getInstallationHistory = createServerFn({ method: "GET" }).inputValidator(parseInstallationHistoryInput).handler(createSsrRpc("9a9d750535dcdd25b01cb1c4b9439dd1ef5b719f3f835b9aee7889191ef6ec81"));
|
|
84
|
+
var getBundleChildren = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("4370f1bf70b91f1168d85379d3008449a1bedb915e9878ca4ef89d5f3a80fa7f"));
|
|
85
|
+
var getBundleChildCounts = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(createSsrRpc("4ca367070b00f58179a572f0bb8196a4ccdd3881e9b1dbfe33deee0cb6e1f549"));
|
|
86
|
+
createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("16cc7c2f080ea5b73e0c6bba815b110dbd7727796036d248ba0d8ae819ddef08"));
|
|
87
|
+
createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("3a27ff5679228b86a346b3fe42142e7a5bf0264f73173c0dbe5f07fb37c43cf7"));
|
|
88
|
+
createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createSsrRpc("61de3b69779c5ce2a5f5d3c27e2cfaca8fba8f14c8803559b9cd733c456494fa"));
|
|
89
|
+
var ANALYTICS_STALE_TIME_MS = 3e4;
|
|
90
|
+
var bundleListQueryKey = ["bundles"];
|
|
91
|
+
var releaseListQueryKey = ["releases"];
|
|
92
|
+
var queryKeys = {
|
|
93
|
+
config: ["config"],
|
|
94
|
+
channels: ["channels"],
|
|
95
|
+
configLoaded: ["config-loaded"],
|
|
96
|
+
bundles: {
|
|
97
|
+
all: bundleListQueryKey,
|
|
98
|
+
list: (filters) => [...bundleListQueryKey, filters ?? {}]
|
|
99
|
+
},
|
|
100
|
+
releases: {
|
|
101
|
+
all: releaseListQueryKey,
|
|
102
|
+
list: (filters) => [...releaseListQueryKey, filters ?? {}]
|
|
103
|
+
},
|
|
104
|
+
release: (releaseId) => ["release", releaseId],
|
|
105
|
+
releaseCatalog: (scopeKey) => ["release-catalog", scopeKey],
|
|
106
|
+
bundleChildren: {
|
|
107
|
+
all: ["bundle-children"],
|
|
108
|
+
list: (baseBundleId) => ["bundle-children", baseBundleId],
|
|
109
|
+
counts: (bundleIds) => [
|
|
110
|
+
"bundle-children",
|
|
111
|
+
"counts",
|
|
112
|
+
...bundleIds
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
bundle: (bundleId) => ["bundle", bundleId],
|
|
116
|
+
bundleEventSummary: (bundleId) => ["bundle-event-summary", bundleId],
|
|
117
|
+
bundleEventAnalytics: (input) => ["bundle-event-analytics", input],
|
|
118
|
+
installations: {
|
|
119
|
+
search: (input) => [
|
|
120
|
+
"installations",
|
|
121
|
+
"search",
|
|
122
|
+
input
|
|
123
|
+
],
|
|
124
|
+
history: (input) => [
|
|
125
|
+
"installations",
|
|
126
|
+
"history",
|
|
127
|
+
input
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
function useConfigQuery() {
|
|
132
|
+
return useQuery({
|
|
133
|
+
queryKey: queryKeys.config,
|
|
134
|
+
queryFn: () => getConfig(),
|
|
135
|
+
staleTime: Infinity
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function useChannelsQuery() {
|
|
139
|
+
return useQuery({
|
|
140
|
+
queryKey: queryKeys.channels,
|
|
141
|
+
queryFn: () => getChannels(),
|
|
142
|
+
staleTime: Infinity
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function useReleasesQuery(filters) {
|
|
146
|
+
return useQuery({
|
|
147
|
+
queryKey: queryKeys.releases.list(filters),
|
|
148
|
+
queryFn: () => getReleases({ data: filters }),
|
|
149
|
+
placeholderData: (previousData) => previousData
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function useReleaseQuery(releaseId) {
|
|
153
|
+
return useQuery({
|
|
154
|
+
enabled: releaseId.length > 0,
|
|
155
|
+
queryFn: () => getRelease({ data: { releaseId } }),
|
|
156
|
+
queryKey: queryKeys.release(releaseId)
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function useReleaseCatalogDiagnosticsQuery(scopeKey) {
|
|
160
|
+
return useQuery({
|
|
161
|
+
enabled: scopeKey.length > 0,
|
|
162
|
+
queryFn: () => getReleaseCatalogDiagnostics({ data: { scopeKey } }),
|
|
163
|
+
queryKey: queryKeys.releaseCatalog(scopeKey)
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function useBundleQuery(bundleId) {
|
|
167
|
+
return useQuery({
|
|
168
|
+
queryKey: queryKeys.bundle(bundleId),
|
|
169
|
+
queryFn: () => getBundle({ data: { bundleId } }),
|
|
170
|
+
staleTime: Infinity,
|
|
171
|
+
enabled: !!bundleId
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function useBundleEventAnalyticsQuery(input, enabled) {
|
|
175
|
+
return useQuery({
|
|
176
|
+
queryKey: queryKeys.bundleEventAnalytics(input),
|
|
177
|
+
queryFn: () => getBundleEventAnalytics({ data: input }),
|
|
178
|
+
staleTime: ANALYTICS_STALE_TIME_MS,
|
|
179
|
+
refetchOnWindowFocus: true,
|
|
180
|
+
enabled: enabled && input.bundleId.length > 0
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
function useInstallationSearchQuery(input, enabled) {
|
|
184
|
+
return useQuery({
|
|
185
|
+
queryKey: queryKeys.installations.search(input),
|
|
186
|
+
queryFn: () => searchInstallations({ data: input }),
|
|
187
|
+
staleTime: ANALYTICS_STALE_TIME_MS,
|
|
188
|
+
refetchOnWindowFocus: true,
|
|
189
|
+
enabled: enabled && input.query.trim().length > 0
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function useInstallationHistoryQuery(input, enabled) {
|
|
193
|
+
return useQuery({
|
|
194
|
+
queryKey: queryKeys.installations.history(input),
|
|
195
|
+
queryFn: () => getInstallationHistory({ data: input }),
|
|
196
|
+
staleTime: ANALYTICS_STALE_TIME_MS,
|
|
197
|
+
refetchOnWindowFocus: true,
|
|
198
|
+
enabled: enabled && input.installId.length > 0
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function useBundleChildrenQuery(baseBundleId) {
|
|
202
|
+
return useQuery({
|
|
203
|
+
queryKey: queryKeys.bundleChildren.list(baseBundleId),
|
|
204
|
+
queryFn: () => getBundleChildren({ data: { baseBundleId } }),
|
|
205
|
+
staleTime: Infinity,
|
|
206
|
+
enabled: !!baseBundleId
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
function useBundleChildCountsQuery(bundleIds) {
|
|
210
|
+
const normalizedBundleIds = [...bundleIds].sort((left, right) => left.localeCompare(right));
|
|
211
|
+
return useQuery({
|
|
212
|
+
queryKey: queryKeys.bundleChildren.counts(normalizedBundleIds),
|
|
213
|
+
queryFn: () => getBundleChildCounts({ data: { bundleIds: normalizedBundleIds } }),
|
|
214
|
+
staleTime: Infinity,
|
|
215
|
+
enabled: normalizedBundleIds.length > 0
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
function useCreateChannelMutation() {
|
|
219
|
+
const queryClient = useQueryClient();
|
|
220
|
+
return useMutation({
|
|
221
|
+
mutationFn: (input) => createChannel({ data: input }).then((response) => response.data),
|
|
222
|
+
onSuccess: async () => {
|
|
223
|
+
await queryClient.invalidateQueries({ queryKey: queryKeys.channels });
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function useDeleteChannelMutation() {
|
|
228
|
+
const queryClient = useQueryClient();
|
|
229
|
+
return useMutation({
|
|
230
|
+
mutationFn: (input) => deleteChannel({ data: input }).then((response) => response.data),
|
|
231
|
+
onSettled: async () => {
|
|
232
|
+
await queryClient.invalidateQueries({ queryKey: queryKeys.channels });
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function useUpdateReleaseMutation() {
|
|
237
|
+
const queryClient = useQueryClient();
|
|
238
|
+
return useMutation({
|
|
239
|
+
mutationFn: (input) => updateRelease({ data: input }),
|
|
240
|
+
onSuccess: async (_, input) => {
|
|
241
|
+
await Promise.all([
|
|
242
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.releases.all }),
|
|
243
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.release(input.releaseId) }),
|
|
244
|
+
queryClient.invalidateQueries({ queryKey: ["release-catalog"] }),
|
|
245
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.channels })
|
|
246
|
+
]);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
function usePreflightReleaseMutation() {
|
|
251
|
+
return useMutation({ mutationFn: (input) => preflightRelease({ data: input }) });
|
|
252
|
+
}
|
|
253
|
+
function useDeleteReleaseMutation() {
|
|
254
|
+
const queryClient = useQueryClient();
|
|
255
|
+
return useMutation({
|
|
256
|
+
mutationFn: (input) => deleteRelease({ data: input }),
|
|
257
|
+
onSuccess: async (_, input) => {
|
|
258
|
+
queryClient.removeQueries({ queryKey: queryKeys.release(input.releaseId) });
|
|
259
|
+
await Promise.all([
|
|
260
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.releases.all }),
|
|
261
|
+
queryClient.invalidateQueries({ queryKey: ["release-catalog"] }),
|
|
262
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.channels })
|
|
263
|
+
]);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function usePromoteReleaseMutation() {
|
|
268
|
+
const queryClient = useQueryClient();
|
|
269
|
+
return useMutation({
|
|
270
|
+
mutationFn: (input) => promoteRelease({ data: input }),
|
|
271
|
+
onSuccess: async () => {
|
|
272
|
+
await Promise.all([
|
|
273
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.releases.all }),
|
|
274
|
+
queryClient.invalidateQueries({ queryKey: ["release"] }),
|
|
275
|
+
queryClient.invalidateQueries({ queryKey: ["release-catalog"] }),
|
|
276
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.channels })
|
|
277
|
+
]);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
//#endregion
|
|
282
|
+
export { useUpdateReleaseMutation as S, usePreflightReleaseMutation as _, InputGroupText as a, useReleaseQuery as b, useBundleEventAnalyticsQuery as c, useConfigQuery as d, useCreateChannelMutation as f, useInstallationSearchQuery as g, useInstallationHistoryQuery as h, InputGroupInput as i, useBundleQuery as l, useDeleteReleaseMutation as m, InputGroupAddon as n, useBundleChildCountsQuery as o, useDeleteChannelMutation as p, InputGroupButton as r, useBundleChildrenQuery as s, InputGroup as t, useChannelsQuery as u, usePromoteReleaseMutation as v, useReleasesQuery as x, useReleaseCatalogDiagnosticsQuery as y };
|