@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.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/BundleIdDisplay-D4ErdU5_.js +1 -0
- package/.output/public/assets/InsightsCapabilityContext-B42VqvP6.js +1 -0
- package/.output/public/assets/api-keys-api-DGVTTvTJ.js +1 -0
- package/.output/public/assets/api-keys-z16OZIP4.js +1 -0
- package/.output/public/assets/badge-Br_KDO0J.js +1 -0
- package/.output/public/assets/card-DzuEXvyJ.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-BeAENgez.js +1 -0
- package/.output/public/assets/dist-Bssh_cv0.js +1 -0
- package/.output/public/assets/field-Buq148-A.js +1 -0
- package/.output/public/assets/index-uOpQAIC4.js +10 -0
- package/.output/public/assets/input-group-B3p5UpyW.js +1 -0
- package/.output/public/assets/insights-DJTr7Ozn.js +1 -0
- package/.output/public/assets/insights-api-DVMOoRMS.js +1 -0
- package/.output/public/assets/installations-BY64iIAK.js +2 -0
- package/.output/public/assets/installations-D5v9i3AL.js +1 -0
- package/.output/public/assets/lazyRouteComponent-DKYu5cZJ.js +1 -0
- package/.output/public/assets/preload-helper-CQ36nxok.js +1 -0
- package/.output/public/assets/refresh-cw-BkbfZ62O.js +1 -0
- package/.output/public/assets/routes-BuoI5-Cr.js +2 -0
- package/.output/public/assets/routes-C8fvgETO.js +1 -0
- package/.output/public/assets/search-qsIDvS2I.js +1 -0
- package/.output/public/assets/shield-check-DE_hVuHu.js +1 -0
- package/.output/public/assets/signing-mJD88Y4C.js +1 -0
- package/.output/public/assets/styles-BZIG7t42.css +2 -0
- package/.output/public/assets/table-RamFEclP.js +1 -0
- package/.output/public/assets/useCompositeListItem-ChzDqdpc.js +42 -0
- package/.output/public/assets/useMutation-JsGVjQMY.js +1 -0
- package/.output/public/assets/useOpenInteractionType-Dwfy-SpA.js +1 -0
- package/.output/server/__23tanstack-start-server-fn-resolver-Dftxlm2E.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/BundleActivityChart-CWcdPuUn.mjs +288 -0
- package/.output/server/_ssr/BundleIdDisplay-BEvB3MvA.mjs +13 -0
- package/.output/server/_ssr/InsightsCapabilityContext-Cx8fjm2s.mjs +15 -0
- package/.output/server/_ssr/api-keys-CpBqHpuC.mjs +300 -0
- package/.output/server/_ssr/api-keys-api-Czkp57UV.mjs +60 -0
- package/.output/server/_ssr/api-keys-rpc-BTtMDSoR.mjs +136 -0
- package/.output/server/_ssr/api-rpc-BEX8ISai.mjs +1468 -0
- package/.output/server/_ssr/auth-BF8mbAgF.mjs +21 -0
- package/.output/server/_ssr/auth-rpc-BFMEC-TT.mjs +24 -0
- package/.output/server/_ssr/auth.server-DW71WzsD.mjs +47 -0
- package/.output/server/_ssr/badge-CpWXQwyF.mjs +26 -0
- package/.output/server/_ssr/bundle-signing-rpc-BbCFUQSu.mjs +16 -0
- package/.output/server/_ssr/bundle-signing.server-C4NW5mWx.mjs +12 -0
- package/.output/server/_ssr/card-Bsc8mRis.mjs +86 -0
- package/.output/server/_ssr/config-Dv8qLDZ0.mjs +13 -0
- package/.output/server/_ssr/config.server-DQYEr_5X.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-DhfrxEjg.mjs} +68 -50
- package/.output/server/_ssr/databaseRows-QlCYLi0H.mjs +166 -0
- package/.output/server/_ssr/deleteBundle-Cu_XOMt0.mjs +66 -0
- package/.output/server/_ssr/dialog-C0vKUp8R.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-DASCh-5d.mjs +74 -0
- package/.output/server/_ssr/{getBundleChildren-CVtSiH5t.mjs → getBundleChildren-BcRMFoDF.mjs} +10 -18
- package/.output/server/_ssr/input-group-etIsBUqv.mjs +288 -0
- package/.output/server/_ssr/insights-api-C1F7UreR.mjs +71 -0
- package/.output/server/_ssr/insights-input-9fEJF-ZG.mjs +96 -0
- package/.output/server/_ssr/insights-rpc-C-8R6kED.mjs +155 -0
- package/.output/server/_ssr/insights-ygT_aIfo.mjs +858 -0
- package/.output/server/_ssr/installations-DqRT1QTd.mjs +535 -0
- package/.output/server/_ssr/installations-K8TCYTYh.mjs +19 -0
- package/.output/server/_ssr/router-BxBEvtF1.mjs +513 -0
- package/.output/server/_ssr/routes-BC7rn-tf.mjs +37 -0
- package/.output/server/_ssr/routes-CM5KAwpB.mjs +2285 -0
- package/.output/server/_ssr/runtime.server-la7TRAH_.mjs +527 -0
- package/.output/server/_ssr/server-CpzW--lT.mjs +7468 -0
- package/.output/server/_ssr/signing-jk4HANnl.mjs +134 -0
- package/.output/server/_ssr/ssr.mjs +4 -5740
- package/.output/server/_ssr/start-DpViQGnt.mjs +4 -0
- package/.output/server/_ssr/table-CU58HeI7.mjs +53 -0
- package/.output/server/_ssr/uuidv7-CaKuKXrV.mjs +31 -0
- package/.output/server/_tanstack-start-manifest_v-Mz9MmSlD.mjs +103 -0
- package/.output/server/index.mjs +229 -47
- package/README.md +29 -8
- package/lib/index.d.mts +35 -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/api-keys/ApiKeysPage.tsx +377 -0
- package/src/components/features/bundles/BundleActivityChart.tsx +193 -0
- package/src/components/features/bundles/BundleChildrenPanel.tsx +201 -0
- package/src/components/features/bundles/BundleInsightsSummary.tsx +123 -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/insights/ActivityChart.tsx +150 -0
- package/src/components/features/insights/BundleDistribution.tsx +133 -0
- package/src/components/features/insights/BundleSelector.tsx +114 -0
- package/src/components/features/insights/InsightsCapabilityContext.tsx +24 -0
- package/src/components/features/insights/InsightsControls.tsx +115 -0
- package/src/components/features/insights/InsightsErrorAlert.tsx +21 -0
- package/src/components/features/insights/InsightsOverview.tsx +208 -0
- package/src/components/features/insights/InstallationHistoryCard.tsx +248 -0
- package/src/components/features/insights/InstallationMatchesCard.tsx +132 -0
- package/src/components/features/insights/InstallationPageHeader.tsx +138 -0
- package/src/components/features/insights/InstallationPagination.tsx +48 -0
- package/src/components/features/insights/InstallationSearch.tsx +230 -0
- package/src/components/features/insights/UpdateOutcomes.tsx +147 -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 +139 -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 +47 -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/insights-api.ts +144 -0
- package/src/lib/insights-error.ts +19 -0
- package/src/lib/insights-input.ts +187 -0
- package/src/lib/insights-overview.ts +170 -0
- package/src/lib/insights-rpc.ts +218 -0
- package/src/lib/server/auth.server.ts +43 -0
- package/src/lib/server/bundle-signing.server.ts +23 -0
- package/src/lib/server/config.server.ts +109 -0
- package/src/lib/server/console-runtime.server.ts +61 -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/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/insights.tsx +139 -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,1468 @@
|
|
|
1
|
+
import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
|
|
2
|
+
import { t as createServerRpc } from "./createServerRpc-DB29C_5p.mjs";
|
|
3
|
+
import { C as normalizeCohortValue, a as createReleaseCatalogScopeKey, b as isReleaseEligibleForCohort, i as RELEASE_CATALOG_FALLBACK_POLICY, n as MAX_COMPILED_CATALOG_BYTES, o as decodeChannelKey, p as getNumericCohortValue, r as NUMERIC_COHORT_SIZE, s as encodeChannelKey, v as getRolledOutNumericCohorts, w as normalizeRolloutCohortCount, x as isUUIDv7, y as isCustomCohort } from "./dist-BVSLTpoP.mjs";
|
|
4
|
+
import { a as releaseRowToRelease, t as DatabasePluginInputError } from "./databaseRows-QlCYLi0H.mjs";
|
|
5
|
+
import { n as createUUIDv7After, t as createUUIDv7 } from "./uuidv7-CaKuKXrV.mjs";
|
|
6
|
+
import { a as parseSearchInstallationsInput, i as parseInstallationHistoryInput, n as parseBundleEventInsightsInput, r as parseBundleEventSummaryInput } from "./insights-input-9fEJF-ZG.mjs";
|
|
7
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/api-rpc-BEX8ISai.js
|
|
8
|
+
var LETTER_DASH_NUMBER = "[a-zA-Z0-9-]";
|
|
9
|
+
var NUMERIC_IDENTIFIER = String.raw`0|[1-9]\d*`;
|
|
10
|
+
var NUMERIC_IDENTIFIER_LOOSE = String.raw`\d+`;
|
|
11
|
+
var NON_NUMERIC_IDENTIFIER = String.raw`\d*[a-zA-Z-]${LETTER_DASH_NUMBER}*`;
|
|
12
|
+
var MAIN_VERSION = String.raw`(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})`;
|
|
13
|
+
var MAIN_VERSION_LOOSE = String.raw`(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
14
|
+
var PRERELEASE_IDENTIFIER = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER})`;
|
|
15
|
+
var PRERELEASE_IDENTIFIER_LOOSE = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
16
|
+
var PRERELEASE = String.raw`(?:-(${PRERELEASE_IDENTIFIER}(?:\.${PRERELEASE_IDENTIFIER})*))`;
|
|
17
|
+
var PRERELEASE_LOOSE = String.raw`(?:-?(${PRERELEASE_IDENTIFIER_LOOSE}(?:\.${PRERELEASE_IDENTIFIER_LOOSE})*))`;
|
|
18
|
+
var BUILD_IDENTIFIER = `${LETTER_DASH_NUMBER}+`;
|
|
19
|
+
var BUILD = String.raw`(?:\+(${BUILD_IDENTIFIER}(?:\.${BUILD_IDENTIFIER})*))`;
|
|
20
|
+
var FULL_PLAIN = `v?${MAIN_VERSION}${PRERELEASE}?${BUILD}?`;
|
|
21
|
+
var LOOSE_PLAIN = String.raw`[v=\s]*${MAIN_VERSION_LOOSE}${PRERELEASE_LOOSE}?${BUILD}?`;
|
|
22
|
+
var GREATER_LESS_THAN = "((?:<|>)?=?)";
|
|
23
|
+
var XRANGE_IDENTIFIER = String.raw`${NUMERIC_IDENTIFIER}|x|X|\*`;
|
|
24
|
+
var XRANGE_IDENTIFIER_LOOSE = String.raw`${NUMERIC_IDENTIFIER_LOOSE}|x|X|\*`;
|
|
25
|
+
var XRANGE_PLAIN = String.raw`[v=\s]*(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:${PRERELEASE})?${BUILD}?)?)?`;
|
|
26
|
+
var XRANGE_PLAIN_LOOSE = String.raw`[v=\s]*(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:${PRERELEASE_LOOSE})?${BUILD}?)?)?`;
|
|
27
|
+
var LONE_TILDE = "(?:~>?)";
|
|
28
|
+
var LONE_CARET = String.raw`(?:\^)`;
|
|
29
|
+
var COERCE_PLAIN = String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;
|
|
30
|
+
var COERCE = String.raw`${COERCE_PLAIN}(?:$|[^\d])`;
|
|
31
|
+
var COERCE_FULL = String.raw`${COERCE_PLAIN}(?:${PRERELEASE})?(?:${BUILD})?(?:$|[^\d])`;
|
|
32
|
+
function makeSafeRegexSource(source) {
|
|
33
|
+
const replacements = [
|
|
34
|
+
[String.raw`\s`, 1],
|
|
35
|
+
[String.raw`\d`, 256],
|
|
36
|
+
[LETTER_DASH_NUMBER, 250]
|
|
37
|
+
];
|
|
38
|
+
for (const [token, maximum] of replacements) source = source.split(`${token}*`).join(`${token}{0,${maximum}}`).split(`${token}+`).join(`${token}{1,${maximum}}`);
|
|
39
|
+
return source;
|
|
40
|
+
}
|
|
41
|
+
function safeRegex(source, flags) {
|
|
42
|
+
return new RegExp(makeSafeRegexSource(source), flags);
|
|
43
|
+
}
|
|
44
|
+
var NUMERIC$1 = /^\d+$/;
|
|
45
|
+
function compareIdentifiers(left, right) {
|
|
46
|
+
if (typeof left === "number" && typeof right === "number") return left === right ? 0 : left < right ? -1 : 1;
|
|
47
|
+
const leftNumeric = NUMERIC$1.test(String(left));
|
|
48
|
+
const rightNumeric = NUMERIC$1.test(String(right));
|
|
49
|
+
const normalizedLeft = leftNumeric ? Number(left) : left;
|
|
50
|
+
const normalizedRight = rightNumeric ? Number(right) : right;
|
|
51
|
+
return normalizedLeft === normalizedRight ? 0 : leftNumeric && !rightNumeric ? -1 : rightNumeric && !leftNumeric ? 1 : normalizedLeft < normalizedRight ? -1 : 1;
|
|
52
|
+
}
|
|
53
|
+
var FULL = safeRegex(`^${FULL_PLAIN}$`);
|
|
54
|
+
var LOOSE = safeRegex(`^${LOOSE_PLAIN}$`);
|
|
55
|
+
safeRegex(`^${PRERELEASE}$`);
|
|
56
|
+
safeRegex(`^${PRERELEASE_LOOSE}$`);
|
|
57
|
+
safeRegex(COERCE);
|
|
58
|
+
safeRegex(COERCE_FULL);
|
|
59
|
+
var NUMERIC = /^\d+$/;
|
|
60
|
+
function formatComparableVersion(version) {
|
|
61
|
+
const base = `${version.major}.${version.minor}.${version.patch}`;
|
|
62
|
+
return version.prerelease?.length ? `${base}-${version.prerelease.join(".")}` : base;
|
|
63
|
+
}
|
|
64
|
+
function parse(version, options = {}) {
|
|
65
|
+
if (typeof version !== "string") return version;
|
|
66
|
+
if (version.length > 256) throw new TypeError(`Version exceeds the maximum length of 256 characters`);
|
|
67
|
+
const match = version.trim().match(options.loose ? LOOSE : FULL);
|
|
68
|
+
if (!match) throw new TypeError(`Invalid version syntax: ${version}`);
|
|
69
|
+
const major = Number(match[1]);
|
|
70
|
+
const minor = Number(match[2]);
|
|
71
|
+
const patch = Number(match[3]);
|
|
72
|
+
if (major > Number.MAX_SAFE_INTEGER || major < 0) throw new TypeError(`Invalid major version: ${match[1]}`);
|
|
73
|
+
if (minor > Number.MAX_SAFE_INTEGER || minor < 0) throw new TypeError(`Invalid minor version: ${match[2]}`);
|
|
74
|
+
if (patch > Number.MAX_SAFE_INTEGER || patch < 0) throw new TypeError(`Invalid patch version: ${match[3]}`);
|
|
75
|
+
const prerelease = match[4] ? match[4].split(".").map((identifier) => {
|
|
76
|
+
if (NUMERIC.test(identifier)) {
|
|
77
|
+
const numeric = Number(identifier);
|
|
78
|
+
if (numeric >= 0 && numeric < Number.MAX_SAFE_INTEGER) return numeric;
|
|
79
|
+
}
|
|
80
|
+
return identifier;
|
|
81
|
+
}) : void 0;
|
|
82
|
+
return {
|
|
83
|
+
build: match[5]?.split("."),
|
|
84
|
+
major,
|
|
85
|
+
minor,
|
|
86
|
+
patch,
|
|
87
|
+
prerelease
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function tryParse(version, options = {}) {
|
|
91
|
+
try {
|
|
92
|
+
return parse(version, options);
|
|
93
|
+
} catch {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function compareMainParsed(left, right) {
|
|
98
|
+
return left.major === right.major ? left.minor === right.minor ? left.patch === right.patch ? 0 : left.patch < right.patch ? -1 : 1 : left.minor < right.minor ? -1 : 1 : left.major < right.major ? -1 : 1;
|
|
99
|
+
}
|
|
100
|
+
function comparePrereleaseParsed(left, right) {
|
|
101
|
+
const leftPrerelease = left.prerelease;
|
|
102
|
+
const rightPrerelease = right.prerelease;
|
|
103
|
+
if (leftPrerelease?.length && !rightPrerelease?.length) return -1;
|
|
104
|
+
if (!leftPrerelease?.length && rightPrerelease?.length) return 1;
|
|
105
|
+
if (!leftPrerelease?.length && !rightPrerelease?.length) return 0;
|
|
106
|
+
for (let index = 0;; index++) {
|
|
107
|
+
const leftIdentifier = leftPrerelease?.[index];
|
|
108
|
+
const rightIdentifier = rightPrerelease?.[index];
|
|
109
|
+
if (leftIdentifier === void 0 && rightIdentifier === void 0) return 0;
|
|
110
|
+
if (rightIdentifier === void 0) return 1;
|
|
111
|
+
if (leftIdentifier === void 0) return -1;
|
|
112
|
+
if (leftIdentifier !== rightIdentifier) return compareIdentifiers(leftIdentifier, rightIdentifier);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function compareParsed(left, right) {
|
|
116
|
+
return compareMainParsed(left, right) || comparePrereleaseParsed(left, right);
|
|
117
|
+
}
|
|
118
|
+
var STRICT_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${FULL_PLAIN})$|^$`);
|
|
119
|
+
var LOOSE_COMPARATOR$1 = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
120
|
+
function parseComparator(comparator, options = {}) {
|
|
121
|
+
const normalized = comparator.trim().replaceAll(/\s+/g, " ");
|
|
122
|
+
const match = normalized.match(options.loose ? LOOSE_COMPARATOR$1 : STRICT_COMPARATOR);
|
|
123
|
+
if (!match) throw new TypeError(`Invalid comparator: ${normalized}`);
|
|
124
|
+
const operator = match[1] === "=" ? "" : match[1] || "";
|
|
125
|
+
const version = match[2] ? parse(match[2], options) : null;
|
|
126
|
+
return {
|
|
127
|
+
operator,
|
|
128
|
+
options,
|
|
129
|
+
value: version ? `${operator}${formatComparableVersion(version)}` : "",
|
|
130
|
+
version
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function compare(left, right, options = {}) {
|
|
134
|
+
return compareParsed(parse(left, options), parse(right, options));
|
|
135
|
+
}
|
|
136
|
+
var BUILD_STRIP = new RegExp(BUILD, "g");
|
|
137
|
+
var BUILD_SAFE = safeRegex(BUILD);
|
|
138
|
+
var STRICT_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN})\s+-\s+(${XRANGE_PLAIN})\s*$`);
|
|
139
|
+
var LOOSE_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN_LOOSE})\s+-\s+(${XRANGE_PLAIN_LOOSE})\s*$`);
|
|
140
|
+
var COMPARATOR_TRIM = safeRegex(String.raw`(\s*)${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN}|${XRANGE_PLAIN})`, "g");
|
|
141
|
+
var TILDE_TRIM = safeRegex(String.raw`(\s*)${LONE_TILDE}\s+`, "g");
|
|
142
|
+
var CARET_TRIM = safeRegex(String.raw`(\s*)${LONE_CARET}\s+`, "g");
|
|
143
|
+
var STRICT_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN}$`);
|
|
144
|
+
var LOOSE_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN_LOOSE}$`);
|
|
145
|
+
var STRICT_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN}$`);
|
|
146
|
+
var LOOSE_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN_LOOSE}$`);
|
|
147
|
+
var STRICT_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN}$`);
|
|
148
|
+
var LOOSE_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN_LOOSE}$`);
|
|
149
|
+
var STAR = safeRegex(String.raw`(<|>)?=?\s*\*`);
|
|
150
|
+
var GTE_ZERO = /^\s*>=\s*0\.0\.0\s*$/;
|
|
151
|
+
var GTE_ZERO_PRERELEASE = /^\s*>=\s*0\.0\.0-0\s*$/;
|
|
152
|
+
var LOOSE_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
153
|
+
function isWildcard(value) {
|
|
154
|
+
return !value || String(value).toLowerCase() === "x" || String(value) === "*";
|
|
155
|
+
}
|
|
156
|
+
function hasInvalidWildcardOrder(major, minor, patch) {
|
|
157
|
+
return isWildcard(major) && !isWildcard(minor) || isWildcard(minor) && Boolean(patch) && !isWildcard(patch);
|
|
158
|
+
}
|
|
159
|
+
function replaceTilde(comparator, options) {
|
|
160
|
+
const expression = options.loose ? LOOSE_TILDE : STRICT_TILDE;
|
|
161
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
162
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
163
|
+
if (isWildcard(major)) return "";
|
|
164
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
165
|
+
if (isWildcard(patch)) return `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
166
|
+
return prerelease ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function replaceTildes(comparator, options) {
|
|
170
|
+
return comparator.trim().split(/\s+/).map((part) => replaceTilde(part, options)).join(" ");
|
|
171
|
+
}
|
|
172
|
+
function replaceCaret(comparator, options) {
|
|
173
|
+
const expression = options.loose ? LOOSE_CARET : STRICT_CARET;
|
|
174
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
175
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
176
|
+
if (isWildcard(major)) return "";
|
|
177
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
178
|
+
if (isWildcard(patch)) return major === "0" ? `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
179
|
+
if (prerelease) return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch}-${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
180
|
+
return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${Number(major) + 1}.0.0-0`;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
function replaceCarets(comparator, options) {
|
|
184
|
+
return comparator.trim().split(/\s+/).map((part) => replaceCaret(part, options)).join(" ");
|
|
185
|
+
}
|
|
186
|
+
function replaceXRange(comparator, options) {
|
|
187
|
+
const expression = options.loose ? LOOSE_XRANGE : STRICT_XRANGE;
|
|
188
|
+
return comparator.trim().replace(expression, (match, rawOperator, rawMajor, rawMinor, rawPatch) => {
|
|
189
|
+
let operator = rawOperator;
|
|
190
|
+
let major = rawMajor;
|
|
191
|
+
let minor = rawMinor;
|
|
192
|
+
let patch = rawPatch;
|
|
193
|
+
if (hasInvalidWildcardOrder(String(major), minor === void 0 ? void 0 : String(minor), patch === void 0 ? void 0 : String(patch))) return comparator;
|
|
194
|
+
const wildcardMajor = isWildcard(major);
|
|
195
|
+
const wildcardMinor = wildcardMajor || isWildcard(minor);
|
|
196
|
+
const wildcardPatch = wildcardMinor || isWildcard(patch);
|
|
197
|
+
if (operator === "=" && wildcardPatch) operator = "";
|
|
198
|
+
if (wildcardMajor) return operator === ">" || operator === "<" ? "<0.0.0-0" : "*";
|
|
199
|
+
let prerelease = options.includePrerelease ? "-0" : "";
|
|
200
|
+
if (operator && wildcardPatch) {
|
|
201
|
+
if (wildcardMinor) minor = 0;
|
|
202
|
+
patch = 0;
|
|
203
|
+
if (operator === ">") {
|
|
204
|
+
operator = ">=";
|
|
205
|
+
if (wildcardMinor) {
|
|
206
|
+
major = Number(major) + 1;
|
|
207
|
+
minor = 0;
|
|
208
|
+
} else minor = Number(minor) + 1;
|
|
209
|
+
} else if (operator === "<=") {
|
|
210
|
+
operator = "<";
|
|
211
|
+
if (wildcardMinor) major = Number(major) + 1;
|
|
212
|
+
else minor = Number(minor) + 1;
|
|
213
|
+
}
|
|
214
|
+
if (operator === "<") prerelease = "-0";
|
|
215
|
+
return `${operator}${major}.${minor}.${patch}${prerelease}`;
|
|
216
|
+
}
|
|
217
|
+
if (wildcardMinor) return `>=${major}.0.0${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
218
|
+
if (wildcardPatch) return `>=${major}.${minor}.0${prerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
219
|
+
return match;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function replaceXRanges(comparator, options) {
|
|
223
|
+
return comparator.split(/\s+/).map((part) => replaceXRange(part, options)).join(" ");
|
|
224
|
+
}
|
|
225
|
+
function replaceHyphenRange(range, options) {
|
|
226
|
+
const expression = options.loose ? LOOSE_HYPHEN : STRICT_HYPHEN;
|
|
227
|
+
return range.replace(expression, (_match, rawFrom, fromMajor, fromMinor, fromPatch, fromPrerelease, _fromBuild, rawTo, toMajor, toMinor, toPatch, toPrerelease) => {
|
|
228
|
+
let from = rawFrom;
|
|
229
|
+
let to = rawTo;
|
|
230
|
+
if (isWildcard(fromMajor)) from = "";
|
|
231
|
+
else if (isWildcard(fromMinor)) from = `>=${fromMajor}.0.0${options.includePrerelease ? "-0" : ""}`;
|
|
232
|
+
else if (isWildcard(fromPatch)) from = `>=${fromMajor}.${fromMinor}.0${options.includePrerelease ? "-0" : ""}`;
|
|
233
|
+
else if (fromPrerelease) from = `>=${from}`;
|
|
234
|
+
else from = `>=${from}${options.includePrerelease ? "-0" : ""}`;
|
|
235
|
+
if (isWildcard(toMajor)) to = "";
|
|
236
|
+
else if (isWildcard(toMinor)) to = `<${Number(toMajor) + 1}.0.0-0`;
|
|
237
|
+
else if (isWildcard(toPatch)) to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
|
|
238
|
+
else if (toPrerelease) to = `<=${toMajor}.${toMinor}.${toPatch}-${toPrerelease}`;
|
|
239
|
+
else if (options.includePrerelease) to = `<${toMajor}.${toMinor}.${Number(toPatch) + 1}-0`;
|
|
240
|
+
else to = `<=${to}`;
|
|
241
|
+
return `${from} ${to}`.trim();
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
function expandComparator(comparator, options) {
|
|
245
|
+
return replaceXRanges(replaceTildes(replaceCarets(comparator.replace(BUILD_SAFE, ""), options), options), options).trim().replace(STAR, "");
|
|
246
|
+
}
|
|
247
|
+
function parseSimpleRange(input, options) {
|
|
248
|
+
let parts = replaceHyphenRange(input.replace(BUILD_STRIP, ""), options).replace(COMPARATOR_TRIM, "$1$2$3").replace(TILDE_TRIM, "$1~").replace(CARET_TRIM, "$1^").split(" ").map((part) => expandComparator(part, options)).join(" ").split(/\s+/).map((part) => part.trim().replace(options.includePrerelease ? GTE_ZERO_PRERELEASE : GTE_ZERO, ""));
|
|
249
|
+
if (options.loose) parts = parts.filter((part) => LOOSE_COMPARATOR.test(part));
|
|
250
|
+
const unique = /* @__PURE__ */ new Map();
|
|
251
|
+
for (const comparator of parts.map((part) => parseComparator(part, options))) {
|
|
252
|
+
if (comparator.value === "<0.0.0-0") return [comparator];
|
|
253
|
+
unique.set(comparator.value, comparator);
|
|
254
|
+
}
|
|
255
|
+
if (unique.size > 1) unique.delete("");
|
|
256
|
+
return [...unique.values()];
|
|
257
|
+
}
|
|
258
|
+
function parseRange(range, options = {}) {
|
|
259
|
+
if (typeof range !== "string") return range;
|
|
260
|
+
const parsedOptions = { ...options };
|
|
261
|
+
const raw = range.trim().replaceAll(/\s+/g, " ");
|
|
262
|
+
let sets = raw.split("||").map((part) => parseSimpleRange(part.trim(), parsedOptions)).filter((set) => set.length);
|
|
263
|
+
if (!sets.length) throw new TypeError(`Range contains no valid comparator sets: ${raw}`);
|
|
264
|
+
if (sets.length > 1) {
|
|
265
|
+
const first = sets[0];
|
|
266
|
+
sets = sets.filter((set) => set[0]?.value !== "<0.0.0-0");
|
|
267
|
+
if (!sets.length) sets = [first];
|
|
268
|
+
else if (sets.length > 1) {
|
|
269
|
+
const any = sets.find((set) => set.length === 1 && set[0]?.value === "");
|
|
270
|
+
if (any) sets = [any];
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return {
|
|
274
|
+
normalized: sets.map((set) => set.map((comparator) => comparator.value).join(" ")).join("||"),
|
|
275
|
+
options: parsedOptions,
|
|
276
|
+
raw,
|
|
277
|
+
sets
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
function normalize(version, options = {}) {
|
|
281
|
+
const parsed = tryParse(version, options);
|
|
282
|
+
return parsed ? formatComparableVersion(parsed) : null;
|
|
283
|
+
}
|
|
284
|
+
var ReleaseCatalogCompilationError = class extends Error {
|
|
285
|
+
code;
|
|
286
|
+
constructor(code, message) {
|
|
287
|
+
super(message);
|
|
288
|
+
this.name = "ReleaseCatalogCompilationError";
|
|
289
|
+
this.code = code;
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
function compareBounds(left, right) {
|
|
293
|
+
return compare(left, right);
|
|
294
|
+
}
|
|
295
|
+
function strongerLower(current, candidate) {
|
|
296
|
+
if (current === null) return candidate;
|
|
297
|
+
const compared = compareBounds(candidate.version, current.version);
|
|
298
|
+
if (compared > 0) return candidate;
|
|
299
|
+
if (compared < 0) return current;
|
|
300
|
+
return {
|
|
301
|
+
version: current.version,
|
|
302
|
+
inclusive: current.inclusive && candidate.inclusive
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function strongerUpper(current, candidate) {
|
|
306
|
+
if (current === null) return candidate;
|
|
307
|
+
const compared = compareBounds(candidate.version, current.version);
|
|
308
|
+
if (compared < 0) return candidate;
|
|
309
|
+
if (compared > 0) return current;
|
|
310
|
+
return {
|
|
311
|
+
version: current.version,
|
|
312
|
+
inclusive: current.inclusive && candidate.inclusive
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
function comparatorVersion(comparator) {
|
|
316
|
+
const version = comparator.version && normalize(comparator.version);
|
|
317
|
+
if (version === null) throw new ReleaseCatalogCompilationError("INVALID_TARGET_RANGE", `Invalid comparator: ${comparator.value}`);
|
|
318
|
+
return version;
|
|
319
|
+
}
|
|
320
|
+
function comparatorSetToInterval(comparators) {
|
|
321
|
+
let lower = null;
|
|
322
|
+
let upper = null;
|
|
323
|
+
for (const comparator of comparators) {
|
|
324
|
+
if (comparator.version === null) continue;
|
|
325
|
+
const version = comparatorVersion(comparator);
|
|
326
|
+
if (comparator.operator === "") {
|
|
327
|
+
lower = strongerLower(lower, {
|
|
328
|
+
inclusive: true,
|
|
329
|
+
version
|
|
330
|
+
});
|
|
331
|
+
upper = strongerUpper(upper, {
|
|
332
|
+
inclusive: true,
|
|
333
|
+
version
|
|
334
|
+
});
|
|
335
|
+
} else if (comparator.operator === ">") lower = strongerLower(lower, {
|
|
336
|
+
inclusive: false,
|
|
337
|
+
version
|
|
338
|
+
});
|
|
339
|
+
else if (comparator.operator === ">=") lower = strongerLower(lower, {
|
|
340
|
+
inclusive: true,
|
|
341
|
+
version
|
|
342
|
+
});
|
|
343
|
+
else if (comparator.operator === "<") upper = strongerUpper(upper, {
|
|
344
|
+
inclusive: false,
|
|
345
|
+
version
|
|
346
|
+
});
|
|
347
|
+
else if (comparator.operator === "<=") upper = strongerUpper(upper, {
|
|
348
|
+
inclusive: true,
|
|
349
|
+
version
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
if (lower !== null && upper !== null) {
|
|
353
|
+
const compared = compareBounds(lower.version, upper.version);
|
|
354
|
+
if (compared > 0 || compared === 0 && (!lower.inclusive || !upper.inclusive)) return null;
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
lower,
|
|
358
|
+
upper
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function rangeToIntervals(range) {
|
|
362
|
+
try {
|
|
363
|
+
return parseRange(range).sets.flatMap((comparators) => {
|
|
364
|
+
const interval = comparatorSetToInterval(comparators);
|
|
365
|
+
return interval === null ? [] : [interval];
|
|
366
|
+
});
|
|
367
|
+
} catch {
|
|
368
|
+
throw new ReleaseCatalogCompilationError("INVALID_TARGET_RANGE", `Invalid target app-version range: ${range}`);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function releaseDescriptor(release) {
|
|
372
|
+
return {
|
|
373
|
+
releaseId: release.id,
|
|
374
|
+
kind: release.kind,
|
|
375
|
+
bundleId: release.bundleId,
|
|
376
|
+
rolloutCohortCount: release.rolloutCohortCount,
|
|
377
|
+
targetCohorts: [...new Set(release.targetCohorts)].sort(),
|
|
378
|
+
shouldForceUpdate: release.shouldForceUpdate,
|
|
379
|
+
message: release.message
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
function validateReleases(releases, strategy) {
|
|
383
|
+
const enabled = releases.filter((release) => release.enabled).sort((left, right) => right.id.localeCompare(left.id));
|
|
384
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
385
|
+
for (const release of enabled) {
|
|
386
|
+
if (!isUUIDv7(release.id)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} must use a canonical lowercase UUIDv7 ID`);
|
|
387
|
+
if (seenIds.has(release.id)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Duplicate Release ID: ${release.id}`);
|
|
388
|
+
seenIds.add(release.id);
|
|
389
|
+
if (release.strategy !== strategy) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has the wrong strategy`);
|
|
390
|
+
if (release.kind === "BUNDLE" && release.bundleId === null || release.kind === "EMBEDDED" && release.bundleId !== null) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has an invalid kind/Bundle combination`);
|
|
391
|
+
if (release.targetCohorts.length > 100) throw new ReleaseCatalogCompilationError("TARGET_COHORT_LIMIT", `Release ${release.id} exceeds 100 target cohorts`);
|
|
392
|
+
if (strategy === "APP_VERSION" && (release.targetAppVersion === null || release.fingerprintHash !== null)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has an invalid app-version target`);
|
|
393
|
+
if (strategy === "FINGERPRINT" && (release.fingerprintHash === null || release.targetAppVersion !== null)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has an invalid fingerprint target`);
|
|
394
|
+
}
|
|
395
|
+
return enabled.filter((release) => release.kind === "BUNDLE");
|
|
396
|
+
}
|
|
397
|
+
function collectFrontierReleaseIds(releases) {
|
|
398
|
+
if (releases.every((release) => normalizeRolloutCohortCount(release.rolloutCohortCount) >= 1e3)) {
|
|
399
|
+
const retained = /* @__PURE__ */ new Set();
|
|
400
|
+
const bundleIds = /* @__PURE__ */ new Set();
|
|
401
|
+
let embedded = false;
|
|
402
|
+
for (const release of releases) {
|
|
403
|
+
if (release.kind === "EMBEDDED") {
|
|
404
|
+
if (!embedded) {
|
|
405
|
+
embedded = true;
|
|
406
|
+
retained.add(release.id);
|
|
407
|
+
}
|
|
408
|
+
} else if (release.bundleId !== null && bundleIds.size < 11 && !bundleIds.has(release.bundleId)) {
|
|
409
|
+
bundleIds.add(release.bundleId);
|
|
410
|
+
retained.add(release.id);
|
|
411
|
+
}
|
|
412
|
+
if (embedded && bundleIds.size >= 11) break;
|
|
413
|
+
}
|
|
414
|
+
return retained;
|
|
415
|
+
}
|
|
416
|
+
const explicitTargetCohorts = new Set(releases.flatMap((release) => release.targetCohorts));
|
|
417
|
+
const cohortStates = [
|
|
418
|
+
void 0,
|
|
419
|
+
...Array.from({ length: 1e3 }, (_, index) => String(index + 1)),
|
|
420
|
+
...[...explicitTargetCohorts].sort(),
|
|
421
|
+
"release-catalog-non-targeted-cohort"
|
|
422
|
+
].map((cohort) => {
|
|
423
|
+
const normalized = cohort === void 0 ? void 0 : normalizeCohortValue(cohort);
|
|
424
|
+
return {
|
|
425
|
+
isCustom: normalized !== void 0 && isCustomCohort(normalized),
|
|
426
|
+
normalized,
|
|
427
|
+
numeric: normalized === void 0 ? null : getNumericCohortValue(normalized),
|
|
428
|
+
bundleIds: /* @__PURE__ */ new Set(),
|
|
429
|
+
embedded: false,
|
|
430
|
+
complete: false
|
|
431
|
+
};
|
|
432
|
+
});
|
|
433
|
+
const stateIndexesByCohort = /* @__PURE__ */ new Map();
|
|
434
|
+
const fullRolloutStateIndexes = [];
|
|
435
|
+
for (const [index, state] of cohortStates.entries()) {
|
|
436
|
+
if (state.normalized !== void 0) {
|
|
437
|
+
const indexes = stateIndexesByCohort.get(state.normalized) ?? [];
|
|
438
|
+
indexes.push(index);
|
|
439
|
+
stateIndexesByCohort.set(state.normalized, indexes);
|
|
440
|
+
}
|
|
441
|
+
if (state.normalized === void 0 || state.numeric !== null || state.isCustom) fullRolloutStateIndexes.push(index);
|
|
442
|
+
}
|
|
443
|
+
const retained = /* @__PURE__ */ new Set();
|
|
444
|
+
let incompleteStateCount = cohortStates.length;
|
|
445
|
+
for (const release of releases) {
|
|
446
|
+
const rolloutCohortCount = normalizeRolloutCohortCount(release.rolloutCohortCount);
|
|
447
|
+
const eligibleStateIndexes = /* @__PURE__ */ new Set();
|
|
448
|
+
if (rolloutCohortCount >= 1e3) for (const index of fullRolloutStateIndexes) eligibleStateIndexes.add(index);
|
|
449
|
+
else if (rolloutCohortCount > 0) for (const numericCohort of getRolledOutNumericCohorts(release.id, rolloutCohortCount)) for (const index of stateIndexesByCohort.get(String(numericCohort)) ?? []) eligibleStateIndexes.add(index);
|
|
450
|
+
for (const targetCohort of new Set(release.targetCohorts.map(normalizeCohortValue))) for (const index of stateIndexesByCohort.get(targetCohort) ?? []) eligibleStateIndexes.add(index);
|
|
451
|
+
for (const index of eligibleStateIndexes) {
|
|
452
|
+
const state = cohortStates[index];
|
|
453
|
+
if (state.complete) continue;
|
|
454
|
+
if (release.kind === "EMBEDDED") {
|
|
455
|
+
if (!state.embedded) {
|
|
456
|
+
state.embedded = true;
|
|
457
|
+
retained.add(release.id);
|
|
458
|
+
}
|
|
459
|
+
} else if (release.bundleId !== null && state.bundleIds.size < 11 && !state.bundleIds.has(release.bundleId)) {
|
|
460
|
+
state.bundleIds.add(release.bundleId);
|
|
461
|
+
retained.add(release.id);
|
|
462
|
+
}
|
|
463
|
+
if (state.embedded && state.bundleIds.size >= 11) {
|
|
464
|
+
state.complete = true;
|
|
465
|
+
incompleteStateCount -= 1;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
if (incompleteStateCount === 0) break;
|
|
469
|
+
}
|
|
470
|
+
return retained;
|
|
471
|
+
}
|
|
472
|
+
function intervalContainsSegment(interval, segment) {
|
|
473
|
+
if (interval.lower !== null) {
|
|
474
|
+
if (segment.lower === null) return false;
|
|
475
|
+
const compared = compareBounds(segment.lower.version, interval.lower.version);
|
|
476
|
+
if (compared < 0 || compared === 0 && segment.lower.inclusive && !interval.lower.inclusive) return false;
|
|
477
|
+
}
|
|
478
|
+
if (interval.upper !== null) {
|
|
479
|
+
if (segment.upper === null) return false;
|
|
480
|
+
const compared = compareBounds(segment.upper.version, interval.upper.version);
|
|
481
|
+
if (compared > 0 || compared === 0 && segment.upper.inclusive && !interval.upper.inclusive) return false;
|
|
482
|
+
}
|
|
483
|
+
return true;
|
|
484
|
+
}
|
|
485
|
+
function atomicVersionSegments(intervals) {
|
|
486
|
+
const endpoints = [...new Set(intervals.flatMap((interval) => [interval.lower?.version, interval.upper?.version].filter((version) => version !== void 0)))].sort(compareBounds);
|
|
487
|
+
if (endpoints.length === 0) return [{
|
|
488
|
+
lower: null,
|
|
489
|
+
upper: null
|
|
490
|
+
}];
|
|
491
|
+
const segments = [{
|
|
492
|
+
lower: null,
|
|
493
|
+
upper: {
|
|
494
|
+
inclusive: false,
|
|
495
|
+
version: endpoints[0]
|
|
496
|
+
}
|
|
497
|
+
}];
|
|
498
|
+
for (let index = 0; index < endpoints.length; index += 1) {
|
|
499
|
+
const endpoint = endpoints[index];
|
|
500
|
+
segments.push({
|
|
501
|
+
lower: {
|
|
502
|
+
inclusive: true,
|
|
503
|
+
version: endpoint
|
|
504
|
+
},
|
|
505
|
+
upper: {
|
|
506
|
+
inclusive: true,
|
|
507
|
+
version: endpoint
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
const next = endpoints[index + 1];
|
|
511
|
+
if (next !== void 0) segments.push({
|
|
512
|
+
lower: {
|
|
513
|
+
inclusive: false,
|
|
514
|
+
version: endpoint
|
|
515
|
+
},
|
|
516
|
+
upper: {
|
|
517
|
+
inclusive: false,
|
|
518
|
+
version: next
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
segments.push({
|
|
523
|
+
lower: {
|
|
524
|
+
inclusive: false,
|
|
525
|
+
version: endpoints.at(-1)
|
|
526
|
+
},
|
|
527
|
+
upper: null
|
|
528
|
+
});
|
|
529
|
+
return segments;
|
|
530
|
+
}
|
|
531
|
+
function sameIndexes(left, right) {
|
|
532
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
533
|
+
}
|
|
534
|
+
function mergeSegments(segments) {
|
|
535
|
+
const merged = [];
|
|
536
|
+
for (const segment of segments) {
|
|
537
|
+
const previous = merged.at(-1);
|
|
538
|
+
if (previous && sameIndexes(previous.releaseIndexes, segment.releaseIndexes) && sameIndexes(previous.rollbackReleaseIndexes, segment.rollbackReleaseIndexes)) merged[merged.length - 1] = {
|
|
539
|
+
...previous,
|
|
540
|
+
upper: segment.upper
|
|
541
|
+
};
|
|
542
|
+
else merged.push(segment);
|
|
543
|
+
}
|
|
544
|
+
return merged;
|
|
545
|
+
}
|
|
546
|
+
function compileAppVersion(releases) {
|
|
547
|
+
const ranges = /* @__PURE__ */ new Map();
|
|
548
|
+
for (const release of releases) ranges.set(release.id, rangeToIntervals(release.targetAppVersion));
|
|
549
|
+
const segmentReleases = atomicVersionSegments([...ranges.values()].flat()).map((segment) => {
|
|
550
|
+
const applicable = releases.filter((release) => ranges.get(release.id).some((range) => intervalContainsSegment(range, segment)));
|
|
551
|
+
return {
|
|
552
|
+
rollbackIds: new Set(applicable.map(({ id }) => id)),
|
|
553
|
+
segment,
|
|
554
|
+
retainedIds: collectFrontierReleaseIds(applicable)
|
|
555
|
+
};
|
|
556
|
+
});
|
|
557
|
+
const retainedIds = new Set(segmentReleases.flatMap(({ retainedIds, rollbackIds }) => [...retainedIds, ...rollbackIds]));
|
|
558
|
+
const retainedReleases = releases.filter((release) => retainedIds.has(release.id));
|
|
559
|
+
const descriptorIndex = new Map(retainedReleases.map((release, index) => [release.id, index]));
|
|
560
|
+
return {
|
|
561
|
+
envelope: {
|
|
562
|
+
fallbackPolicy: RELEASE_CATALOG_FALLBACK_POLICY,
|
|
563
|
+
schemaVersion: 1,
|
|
564
|
+
segments: mergeSegments(segmentReleases.map(({ segment, retainedIds, rollbackIds }) => ({
|
|
565
|
+
...segment,
|
|
566
|
+
releaseIndexes: releases.filter((release) => retainedIds.has(release.id)).map((release) => descriptorIndex.get(release.id)).filter((index) => index !== void 0),
|
|
567
|
+
rollbackReleaseIndexes: releases.filter((release) => rollbackIds.has(release.id)).map((release) => descriptorIndex.get(release.id)).filter((index) => index !== void 0)
|
|
568
|
+
})).filter((segment) => segment.releaseIndexes.length > 0 || segment.rollbackReleaseIndexes.length > 0)),
|
|
569
|
+
strategy: "APP_VERSION"
|
|
570
|
+
},
|
|
571
|
+
retainedReleases
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
function compileFingerprint(releases) {
|
|
575
|
+
const retainedIds = collectFrontierReleaseIds(releases);
|
|
576
|
+
const retainedReleases = releases;
|
|
577
|
+
return {
|
|
578
|
+
envelope: {
|
|
579
|
+
fallbackPolicy: RELEASE_CATALOG_FALLBACK_POLICY,
|
|
580
|
+
releaseIndexes: retainedReleases.map((release, index) => retainedIds.has(release.id) ? index : -1).filter((index) => index >= 0),
|
|
581
|
+
rollbackReleaseIndexes: retainedReleases.map((_, index) => index),
|
|
582
|
+
schemaVersion: 1,
|
|
583
|
+
strategy: "FINGERPRINT"
|
|
584
|
+
},
|
|
585
|
+
retainedReleases
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
async function sha256(value) {
|
|
589
|
+
const digest = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(value));
|
|
590
|
+
return `sha256:${[...new Uint8Array(digest)].map((byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
591
|
+
}
|
|
592
|
+
function canonicalStringify(value) {
|
|
593
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
594
|
+
if (Array.isArray(value)) return `[${value.map(canonicalStringify).join(",")}]`;
|
|
595
|
+
const record = value;
|
|
596
|
+
return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${canonicalStringify(record[key])}`).join(",")}}`;
|
|
597
|
+
}
|
|
598
|
+
async function compileReleaseCatalog(input) {
|
|
599
|
+
const releases = validateReleases(input.releases, input.strategy);
|
|
600
|
+
const targetCohorts = new Set(releases.flatMap((release) => release.targetCohorts));
|
|
601
|
+
if (targetCohorts.size > 512) throw new ReleaseCatalogCompilationError("DISTINCT_TARGET_COHORT_LIMIT", `Scope exceeds 512 distinct target cohorts`);
|
|
602
|
+
const { envelope, retainedReleases } = input.strategy === "APP_VERSION" ? compileAppVersion(releases) : compileFingerprint(releases);
|
|
603
|
+
const payload = {
|
|
604
|
+
...envelope,
|
|
605
|
+
releaseDescriptors: retainedReleases.map(releaseDescriptor)
|
|
606
|
+
};
|
|
607
|
+
const canonicalPayload = canonicalStringify(payload);
|
|
608
|
+
const byteSize = new TextEncoder().encode(canonicalPayload).byteLength;
|
|
609
|
+
if (byteSize > 262144) throw new ReleaseCatalogCompilationError("CATALOG_OVERSIZE", `Compiled Release catalog is ${byteSize} bytes; maximum is ${MAX_COMPILED_CATALOG_BYTES}`);
|
|
610
|
+
return {
|
|
611
|
+
byteSize,
|
|
612
|
+
canonicalPayload,
|
|
613
|
+
catalogHash: await sha256(canonicalPayload),
|
|
614
|
+
diagnostics: {
|
|
615
|
+
byteSize,
|
|
616
|
+
descriptorCount: payload.releaseDescriptors.length,
|
|
617
|
+
distinctTargetCohortCount: targetCohorts.size,
|
|
618
|
+
releaseCount: releases.length,
|
|
619
|
+
segmentCount: payload.strategy === "APP_VERSION" ? payload.segments.length : 1
|
|
620
|
+
},
|
|
621
|
+
payload
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
var RELEASE_PAGE_SIZE$1 = 1e3;
|
|
625
|
+
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
626
|
+
var ReleaseCatalogMutationError = class extends Error {
|
|
627
|
+
name = "ReleaseCatalogMutationError";
|
|
628
|
+
constructor(code, message) {
|
|
629
|
+
super(message);
|
|
630
|
+
this.code = code;
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
var readScopeReleases = async (database, scopeKey) => {
|
|
634
|
+
const releases = [];
|
|
635
|
+
let afterReleaseId;
|
|
636
|
+
for (;;) {
|
|
637
|
+
const page = await database.models.releases.findManyByScope({
|
|
638
|
+
scopeKey,
|
|
639
|
+
...afterReleaseId === void 0 ? {} : { afterReleaseId },
|
|
640
|
+
limit: RELEASE_PAGE_SIZE$1,
|
|
641
|
+
consistency: "strong"
|
|
642
|
+
});
|
|
643
|
+
for (const row of page) {
|
|
644
|
+
if (row.scope_key !== scopeKey) throw new ReleaseCatalogMutationError("INVALID_SCOPE", `Release "${row.id}" was returned for the wrong catalog scope`);
|
|
645
|
+
if (releases.at(-1)?.id === row.id) throw new ReleaseCatalogMutationError("INVALID_SCOPE", `Release "${row.id}" was returned more than once`);
|
|
646
|
+
releases.push(row);
|
|
647
|
+
}
|
|
648
|
+
if (page.length < RELEASE_PAGE_SIZE$1) return releases;
|
|
649
|
+
const next = page.at(-1)?.id;
|
|
650
|
+
if (next === void 0 || next === afterReleaseId) throw new ReleaseCatalogMutationError("INVALID_SCOPE", "Release scope paging did not advance");
|
|
651
|
+
afterReleaseId = next;
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
var validateScope = (scope) => {
|
|
655
|
+
const channelKey = encodeChannelKey(scope.channelName);
|
|
656
|
+
if (scope.strategy === "FINGERPRINT" !== (scope.fingerprintHash !== null)) throw new ReleaseCatalogMutationError("INVALID_SCOPE", "Release catalog strategy and fingerprint are inconsistent");
|
|
657
|
+
const expectedScopeKey = scope.strategy === "APP_VERSION" ? createReleaseCatalogScopeKey({
|
|
658
|
+
channelKey,
|
|
659
|
+
platform: scope.platform,
|
|
660
|
+
strategy: "APP_VERSION"
|
|
661
|
+
}) : createReleaseCatalogScopeKey({
|
|
662
|
+
channelKey,
|
|
663
|
+
fingerprintHash: scope.fingerprintHash ?? "",
|
|
664
|
+
platform: scope.platform,
|
|
665
|
+
strategy: "FINGERPRINT"
|
|
666
|
+
});
|
|
667
|
+
if (scope.scopeKey !== expectedScopeKey) throw new ReleaseCatalogMutationError("INVALID_SCOPE", "Release catalog scope metadata is inconsistent");
|
|
668
|
+
};
|
|
669
|
+
var applyMutation = (rows, scope, mutation) => {
|
|
670
|
+
const currentIndex = mutation.operation === "insert" ? -1 : rows.findIndex(({ id }) => id === mutation.id);
|
|
671
|
+
const current = currentIndex < 0 ? void 0 : rows[currentIndex];
|
|
672
|
+
if (mutation.operation === "insert") {
|
|
673
|
+
const latestId = rows.at(-1)?.id;
|
|
674
|
+
if (mutation.row.scope_key !== scope.scopeKey || mutation.row.channel_id !== scope.channelId || mutation.row.platform !== scope.platform || mutation.row.strategy !== scope.strategy || mutation.row.fingerprint_hash !== scope.fingerprintHash || mutation.row.revision !== 1) throw new ReleaseCatalogMutationError("INVALID_SCOPE", "Inserted Release does not match its catalog scope");
|
|
675
|
+
if (latestId !== void 0 && mutation.row.id <= latestId) throw new ReleaseCatalogMutationError("NON_MONOTONIC_RELEASE_ID", `Release "${mutation.row.id}" must sort after "${latestId}"`);
|
|
676
|
+
return {
|
|
677
|
+
change: {
|
|
678
|
+
model: "releases",
|
|
679
|
+
operation: "insert",
|
|
680
|
+
row: mutation.row
|
|
681
|
+
},
|
|
682
|
+
expectedRevision: null,
|
|
683
|
+
nextRows: [...rows, mutation.row],
|
|
684
|
+
release: mutation.row
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
if (current === void 0) throw new ReleaseCatalogMutationError("RELEASE_NOT_FOUND", `Release "${mutation.id}" was not found in scope "${scope.scopeKey}"`);
|
|
688
|
+
if (mutation.operation === "delete") return {
|
|
689
|
+
change: {
|
|
690
|
+
model: "releases",
|
|
691
|
+
operation: "delete",
|
|
692
|
+
where: { id: mutation.id }
|
|
693
|
+
},
|
|
694
|
+
expectedRevision: current.revision,
|
|
695
|
+
nextRows: rows.filter(({ id }) => id !== mutation.id),
|
|
696
|
+
release: null
|
|
697
|
+
};
|
|
698
|
+
const release = {
|
|
699
|
+
...current,
|
|
700
|
+
...mutation.update,
|
|
701
|
+
revision: current.revision + 1
|
|
702
|
+
};
|
|
703
|
+
return {
|
|
704
|
+
change: {
|
|
705
|
+
model: "releases",
|
|
706
|
+
operation: "update",
|
|
707
|
+
where: { id: mutation.id },
|
|
708
|
+
update: {
|
|
709
|
+
...mutation.update,
|
|
710
|
+
revision: release.revision
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
expectedRevision: current.revision,
|
|
714
|
+
nextRows: rows.map((row) => row.id === release.id ? release : row),
|
|
715
|
+
release
|
|
716
|
+
};
|
|
717
|
+
};
|
|
718
|
+
var catalogIdentity = (current, rows) => {
|
|
719
|
+
if (current !== null) return current.catalog_id;
|
|
720
|
+
if (rows.length > 0) throw new ReleaseCatalogMutationError("CATALOG_IDENTITY_MISSING", "Catalog history is missing. Restore its catalog row from backup before rebuilding or deploying.");
|
|
721
|
+
return createUUIDv7();
|
|
722
|
+
};
|
|
723
|
+
var readCatalogScope = async (database, scopeKey) => {
|
|
724
|
+
let currentCatalog = await database.models.releaseCatalogs.findByScopeKey(scopeKey);
|
|
725
|
+
let rows = await readScopeReleases(database, scopeKey);
|
|
726
|
+
if (currentCatalog === null && rows.length > 0) {
|
|
727
|
+
currentCatalog = await database.models.releaseCatalogs.findByScopeKey(scopeKey);
|
|
728
|
+
if (currentCatalog !== null) rows = await readScopeReleases(database, scopeKey);
|
|
729
|
+
}
|
|
730
|
+
return {
|
|
731
|
+
currentCatalog,
|
|
732
|
+
rows
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
var prepareReleaseCatalogMutation = async (database, mutationInput) => {
|
|
736
|
+
const { rows, currentCatalog } = await readCatalogScope(database, mutationInput.scope.scopeKey);
|
|
737
|
+
const applied = applyMutation(rows, mutationInput.scope, mutationInput.mutation);
|
|
738
|
+
const compilation = await compileReleaseCatalog({
|
|
739
|
+
strategy: mutationInput.scope.strategy,
|
|
740
|
+
releases: applied.nextRows.map(releaseRowToRelease)
|
|
741
|
+
});
|
|
742
|
+
const generation = (currentCatalog?.generation ?? 0) + 1;
|
|
743
|
+
if (!Number.isSafeInteger(generation)) throw new ReleaseCatalogMutationError("CATALOG_GENERATION_EXHAUSTED", `Catalog "${mutationInput.scope.scopeKey}" exhausted its generation counter`);
|
|
744
|
+
return {
|
|
745
|
+
applied,
|
|
746
|
+
catalog: {
|
|
747
|
+
scope_key: mutationInput.scope.scopeKey,
|
|
748
|
+
catalog_id: catalogIdentity(currentCatalog, rows),
|
|
749
|
+
strategy: mutationInput.scope.strategy,
|
|
750
|
+
channel_id: mutationInput.scope.channelId,
|
|
751
|
+
channel_key: encodeChannelKey(mutationInput.scope.channelName),
|
|
752
|
+
platform: mutationInput.scope.platform,
|
|
753
|
+
fingerprint_hash: mutationInput.scope.fingerprintHash,
|
|
754
|
+
generation,
|
|
755
|
+
payload: compilation.canonicalPayload,
|
|
756
|
+
catalog_hash: compilation.catalogHash,
|
|
757
|
+
byte_size: compilation.byteSize,
|
|
758
|
+
is_tombstone: compilation.payload.releaseDescriptors.length === 0,
|
|
759
|
+
updated_at_ms: mutationInput.updatedAtMs ?? Date.now()
|
|
760
|
+
},
|
|
761
|
+
compilation,
|
|
762
|
+
currentCatalog,
|
|
763
|
+
mutationInput
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
async function preflightReleaseCatalogMutation(input) {
|
|
767
|
+
validateScope(input.scope);
|
|
768
|
+
const prepared = await prepareReleaseCatalogMutation(input.database, input);
|
|
769
|
+
return {
|
|
770
|
+
catalog: prepared.catalog,
|
|
771
|
+
currentCatalog: prepared.currentCatalog,
|
|
772
|
+
diagnostics: prepared.compilation.diagnostics,
|
|
773
|
+
expectedReleaseRevision: prepared.applied.expectedRevision,
|
|
774
|
+
release: prepared.applied.release
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
async function commitReleaseCatalogMutations(input) {
|
|
778
|
+
if (input.mutations.length === 0) return [];
|
|
779
|
+
const scopeKeys = /* @__PURE__ */ new Set();
|
|
780
|
+
for (const mutation of input.mutations) {
|
|
781
|
+
validateScope(mutation.scope);
|
|
782
|
+
if (scopeKeys.has(mutation.scope.scopeKey)) throw new ReleaseCatalogMutationError("INVALID_SCOPE", `A batch cannot mutate catalog scope "${mutation.scope.scopeKey}" more than once`);
|
|
783
|
+
scopeKeys.add(mutation.scope.scopeKey);
|
|
784
|
+
}
|
|
785
|
+
const maxAttempts = input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
|
|
786
|
+
if (!Number.isSafeInteger(maxAttempts) || maxAttempts <= 0) throw new RangeError("maxAttempts must be a positive safe integer");
|
|
787
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
788
|
+
const prepared = await Promise.all(input.mutations.map((mutationInput) => prepareReleaseCatalogMutation(input.database, mutationInput)));
|
|
789
|
+
const result = await input.database.commit({
|
|
790
|
+
expectations: prepared.flatMap(({ applied, currentCatalog, mutationInput }) => [{
|
|
791
|
+
model: "releases",
|
|
792
|
+
id: mutationInput.mutation.operation === "insert" ? mutationInput.mutation.row.id : mutationInput.mutation.id,
|
|
793
|
+
revision: applied.expectedRevision
|
|
794
|
+
}, {
|
|
795
|
+
model: "releaseCatalogs",
|
|
796
|
+
scopeKey: mutationInput.scope.scopeKey,
|
|
797
|
+
generation: currentCatalog?.generation ?? null
|
|
798
|
+
}]),
|
|
799
|
+
changes: prepared.flatMap(({ applied, catalog, mutationInput }) => [
|
|
800
|
+
...mutationInput.companionChanges ?? [],
|
|
801
|
+
applied.change,
|
|
802
|
+
{
|
|
803
|
+
model: "releaseCatalogs",
|
|
804
|
+
operation: "put",
|
|
805
|
+
row: catalog
|
|
806
|
+
},
|
|
807
|
+
...mutationInput.trailingChanges ?? []
|
|
808
|
+
])
|
|
809
|
+
});
|
|
810
|
+
if (result.committed) return prepared.map(({ applied, catalog }) => ({
|
|
811
|
+
attempts: attempt,
|
|
812
|
+
catalog,
|
|
813
|
+
release: applied.release
|
|
814
|
+
}));
|
|
815
|
+
if (result.conflict.reason !== "version_conflict") throw new ReleaseCatalogMutationError("INVALID_SCOPE", `Release mutation failed: ${result.conflict.reason}`);
|
|
816
|
+
}
|
|
817
|
+
throw new ReleaseCatalogMutationError("VERSION_CONFLICT", `Release catalog mutation batch conflicted ${maxAttempts} times`);
|
|
818
|
+
}
|
|
819
|
+
async function commitReleaseCatalogMutation(input) {
|
|
820
|
+
const [result] = await commitReleaseCatalogMutations({
|
|
821
|
+
database: input.database,
|
|
822
|
+
maxAttempts: input.maxAttempts,
|
|
823
|
+
mutations: [input]
|
|
824
|
+
});
|
|
825
|
+
return result;
|
|
826
|
+
}
|
|
827
|
+
var RELEASE_PAGE_SIZE = 1e3;
|
|
828
|
+
var ReleaseManagementError = class extends Error {
|
|
829
|
+
name = "ReleaseManagementError";
|
|
830
|
+
constructor(code, message) {
|
|
831
|
+
super(message);
|
|
832
|
+
this.code = code;
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
var readReleaseScope = async (database, scopeKey) => {
|
|
836
|
+
const rows = [];
|
|
837
|
+
let afterReleaseId;
|
|
838
|
+
for (;;) {
|
|
839
|
+
const page = await database.models.releases.findManyByScope({
|
|
840
|
+
scopeKey,
|
|
841
|
+
...afterReleaseId === void 0 ? {} : { afterReleaseId },
|
|
842
|
+
consistency: "strong",
|
|
843
|
+
limit: RELEASE_PAGE_SIZE
|
|
844
|
+
});
|
|
845
|
+
rows.push(...page);
|
|
846
|
+
if (page.length < RELEASE_PAGE_SIZE) return rows;
|
|
847
|
+
const nextCursor = page.at(-1)?.id;
|
|
848
|
+
if (nextCursor === void 0 || nextCursor === afterReleaseId) throw new ReleaseCatalogMutationError("INVALID_SCOPE", `Release paging did not advance for scope "${scopeKey}".`);
|
|
849
|
+
afterReleaseId = nextCursor;
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
var createForwardReleaseId = (rows, candidates, nowMs) => {
|
|
853
|
+
return createUUIDv7After([...candidates, rows.at(-1)?.id ?? null].filter((value) => value !== null && isUUIDv7(value)).sort().at(-1) ?? null, nowMs);
|
|
854
|
+
};
|
|
855
|
+
var prepareTargetScope = async ({ channelName, database, fingerprintHash, platform, strategy }) => {
|
|
856
|
+
const channelKey = encodeChannelKey(channelName);
|
|
857
|
+
const channel = (await database.models.channels.list({})).channels.find(({ name }) => name === channelName) ?? (await database.models.channels.insert({
|
|
858
|
+
row: {
|
|
859
|
+
id: `channel:${channelKey}`,
|
|
860
|
+
name: channelName
|
|
861
|
+
},
|
|
862
|
+
onConflict: "returnExisting"
|
|
863
|
+
})).row;
|
|
864
|
+
const scopeKey = strategy === "APP_VERSION" ? createReleaseCatalogScopeKey({
|
|
865
|
+
channelKey,
|
|
866
|
+
platform,
|
|
867
|
+
strategy
|
|
868
|
+
}) : createReleaseCatalogScopeKey({
|
|
869
|
+
channelKey,
|
|
870
|
+
fingerprintHash: fingerprintHash ?? "",
|
|
871
|
+
platform,
|
|
872
|
+
strategy
|
|
873
|
+
});
|
|
874
|
+
return { scope: {
|
|
875
|
+
channelId: channel.id,
|
|
876
|
+
channelName,
|
|
877
|
+
fingerprintHash,
|
|
878
|
+
platform,
|
|
879
|
+
scopeKey,
|
|
880
|
+
strategy
|
|
881
|
+
} };
|
|
882
|
+
};
|
|
883
|
+
var loadReleaseTarget = async (input) => {
|
|
884
|
+
const release = await input.database.models.releases.findById(input.releaseId);
|
|
885
|
+
if (release === null) throw new ReleaseManagementError("RELEASE_NOT_FOUND", `Release "${input.releaseId}" was not found.`);
|
|
886
|
+
if (input.expectedRevision !== void 0 && input.expectedRevision !== release.revision) throw new ReleaseManagementError("VERSION_CONFLICT", `Release "${release.id}" is revision ${release.revision}; expected ${input.expectedRevision}.`);
|
|
887
|
+
const catalog = await input.database.models.releaseCatalogs.findByScopeKey(release.scope_key);
|
|
888
|
+
if (catalog === null) throw new ReleaseCatalogMutationError("INVALID_SCOPE", `Release "${release.id}" has no catalog projection.`);
|
|
889
|
+
return {
|
|
890
|
+
release,
|
|
891
|
+
scope: {
|
|
892
|
+
channelId: release.channel_id,
|
|
893
|
+
channelName: decodeChannelKey(catalog.channel_key),
|
|
894
|
+
fingerprintHash: release.fingerprint_hash,
|
|
895
|
+
platform: release.platform,
|
|
896
|
+
scopeKey: release.scope_key,
|
|
897
|
+
strategy: release.strategy
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
};
|
|
901
|
+
var releasePolicyUpdate = (release, patch, updatedAtMs) => {
|
|
902
|
+
if (patch.fingerprintHash !== void 0 && patch.fingerprintHash !== release.fingerprint_hash) throw new ReleaseManagementError("SCOPE_MOVE_UNSUPPORTED", "Changing a fingerprint target requires an atomic Release scope move.");
|
|
903
|
+
return {
|
|
904
|
+
...patch.enabled === void 0 ? {} : { enabled: patch.enabled },
|
|
905
|
+
...patch.message === void 0 ? {} : { message: patch.message },
|
|
906
|
+
...patch.rolloutCohortCount === void 0 ? {} : { rollout_cohort_count: patch.rolloutCohortCount },
|
|
907
|
+
...patch.shouldForceUpdate === void 0 ? {} : { should_force_update: patch.shouldForceUpdate },
|
|
908
|
+
...patch.targetAppVersion === void 0 ? {} : { target_app_version: patch.targetAppVersion },
|
|
909
|
+
...patch.targetCohorts === void 0 ? {} : { target_cohorts: [...patch.targetCohorts] },
|
|
910
|
+
updated_at_ms: updatedAtMs
|
|
911
|
+
};
|
|
912
|
+
};
|
|
913
|
+
async function updateReleasePolicy(input) {
|
|
914
|
+
const { release, scope } = await loadReleaseTarget(input);
|
|
915
|
+
const updatedAtMs = input.updatedAtMs ?? Date.now();
|
|
916
|
+
return commitReleaseCatalogMutation({
|
|
917
|
+
database: input.database,
|
|
918
|
+
mutation: {
|
|
919
|
+
id: release.id,
|
|
920
|
+
operation: "update",
|
|
921
|
+
update: releasePolicyUpdate(release, input.patch, updatedAtMs)
|
|
922
|
+
},
|
|
923
|
+
scope,
|
|
924
|
+
updatedAtMs
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
async function preflightReleasePolicy(input) {
|
|
928
|
+
const { release, scope } = await loadReleaseTarget(input);
|
|
929
|
+
const updatedAtMs = input.updatedAtMs ?? Date.now();
|
|
930
|
+
return preflightReleaseCatalogMutation({
|
|
931
|
+
database: input.database,
|
|
932
|
+
mutation: {
|
|
933
|
+
id: release.id,
|
|
934
|
+
operation: "update",
|
|
935
|
+
update: releasePolicyUpdate(release, input.patch, updatedAtMs)
|
|
936
|
+
},
|
|
937
|
+
scope,
|
|
938
|
+
updatedAtMs
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
async function deleteRelease$1(input) {
|
|
942
|
+
const { release, scope } = await loadReleaseTarget(input);
|
|
943
|
+
if (release.enabled) throw new ReleaseManagementError("ENABLED_RELEASE", `Disable Release "${release.id}" before hard deletion.`);
|
|
944
|
+
return commitReleaseCatalogMutation({
|
|
945
|
+
database: input.database,
|
|
946
|
+
mutation: {
|
|
947
|
+
id: release.id,
|
|
948
|
+
operation: "delete"
|
|
949
|
+
},
|
|
950
|
+
scope,
|
|
951
|
+
updatedAtMs: input.updatedAtMs
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
async function promoteRelease$1(input) {
|
|
955
|
+
const { release: source, scope: sourceScope } = await loadReleaseTarget(input);
|
|
956
|
+
if (source.kind !== "BUNDLE" || source.bundle_id === null) throw new ReleaseManagementError("TARGET_RELEASE_INVALID", "Only a Bundle Release can be promoted.");
|
|
957
|
+
const targetChannel = input.targetChannel.trim();
|
|
958
|
+
if (targetChannel.length === 0) throw new ReleaseManagementError("TARGET_RELEASE_INVALID", "Promotion requires a target channel.");
|
|
959
|
+
const { scope: targetScope } = await prepareTargetScope({
|
|
960
|
+
channelName: targetChannel,
|
|
961
|
+
database: input.database,
|
|
962
|
+
fingerprintHash: source.fingerprint_hash,
|
|
963
|
+
platform: source.platform,
|
|
964
|
+
strategy: source.strategy
|
|
965
|
+
});
|
|
966
|
+
if (targetScope.scopeKey === sourceScope.scopeKey) throw new ReleaseManagementError("TARGET_RELEASE_INVALID", "Source and target Release scopes are the same.");
|
|
967
|
+
const targetRows = await readReleaseScope(input.database, targetScope.scopeKey);
|
|
968
|
+
const updatedAtMs = input.updatedAtMs ?? Date.now();
|
|
969
|
+
const targetMutation = {
|
|
970
|
+
mutation: {
|
|
971
|
+
operation: "insert",
|
|
972
|
+
row: {
|
|
973
|
+
...source,
|
|
974
|
+
id: createForwardReleaseId(targetRows, [source.id, source.bundle_id], updatedAtMs),
|
|
975
|
+
revision: 1,
|
|
976
|
+
scope_key: targetScope.scopeKey,
|
|
977
|
+
channel_id: targetScope.channelId,
|
|
978
|
+
enabled: true,
|
|
979
|
+
rollout_cohort_count: 1e3,
|
|
980
|
+
target_cohorts: [],
|
|
981
|
+
operation: "PROMOTE",
|
|
982
|
+
source_release_id: source.id,
|
|
983
|
+
created_at_ms: updatedAtMs,
|
|
984
|
+
updated_at_ms: updatedAtMs
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
scope: targetScope,
|
|
988
|
+
updatedAtMs
|
|
989
|
+
};
|
|
990
|
+
const sourceMutation = input.action === "move" ? {
|
|
991
|
+
mutation: {
|
|
992
|
+
id: source.id,
|
|
993
|
+
operation: "update",
|
|
994
|
+
update: {
|
|
995
|
+
enabled: false,
|
|
996
|
+
updated_at_ms: updatedAtMs
|
|
997
|
+
}
|
|
998
|
+
},
|
|
999
|
+
scope: sourceScope,
|
|
1000
|
+
updatedAtMs
|
|
1001
|
+
} : null;
|
|
1002
|
+
const results = await commitReleaseCatalogMutations({
|
|
1003
|
+
database: input.database,
|
|
1004
|
+
mutations: sourceMutation === null ? [targetMutation] : [sourceMutation, targetMutation]
|
|
1005
|
+
});
|
|
1006
|
+
return {
|
|
1007
|
+
source: sourceMutation === null ? null : results[0],
|
|
1008
|
+
target: results.at(-1)
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
async function listReleases(releases, input) {
|
|
1012
|
+
const page = input.page ?? 1;
|
|
1013
|
+
const rows = await releases.findMany({
|
|
1014
|
+
...input.afterReleaseId === void 0 ? {} : { afterReleaseId: input.afterReleaseId },
|
|
1015
|
+
...input.beforeReleaseId === void 0 ? {} : { beforeReleaseId: input.beforeReleaseId },
|
|
1016
|
+
...input.bundleId === void 0 ? {} : { bundleId: input.bundleId },
|
|
1017
|
+
...input.channelId === void 0 ? {} : { channelId: input.channelId },
|
|
1018
|
+
...input.enabled === void 0 ? {} : { enabled: input.enabled },
|
|
1019
|
+
...input.platform === void 0 ? {} : { platform: input.platform },
|
|
1020
|
+
...input.targetAppVersion === void 0 ? {} : { targetAppVersion: input.targetAppVersion },
|
|
1021
|
+
limit: input.limit + 1
|
|
1022
|
+
});
|
|
1023
|
+
const isPreviousRequest = input.afterReleaseId !== void 0;
|
|
1024
|
+
const hasExtraRow = rows.length > input.limit;
|
|
1025
|
+
return {
|
|
1026
|
+
data: isPreviousRequest ? hasExtraRow ? rows.slice(1) : rows : rows.slice(0, input.limit),
|
|
1027
|
+
pagination: {
|
|
1028
|
+
currentPage: page,
|
|
1029
|
+
hasNextPage: isPreviousRequest || hasExtraRow,
|
|
1030
|
+
hasPreviousPage: page > 1
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
async function getReleaseActivity30d(insights, releases) {
|
|
1035
|
+
const bundleIds = [...new Set(releases.flatMap(({ bundle_id }) => bundle_id === null ? [] : [bundle_id]))];
|
|
1036
|
+
if (insights === null || bundleIds.length === 0) return /* @__PURE__ */ new Map();
|
|
1037
|
+
try {
|
|
1038
|
+
const summaries = await insights.getBundleEventSummaries(bundleIds, "30d");
|
|
1039
|
+
return new Map(summaries.map((summary) => [summary.bundleId, summary]));
|
|
1040
|
+
} catch (error) {
|
|
1041
|
+
console.error("Error during Release list activity retrieval:", error);
|
|
1042
|
+
return /* @__PURE__ */ new Map();
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
var NON_TARGETED_COHORT = "release-catalog-non-targeted-cohort";
|
|
1046
|
+
function collectReachableFromIndexes(catalog, indexes, reachableReleaseIds) {
|
|
1047
|
+
const descriptors = indexes.flatMap((index) => {
|
|
1048
|
+
const descriptor = catalog.releaseDescriptors[index];
|
|
1049
|
+
return descriptor === void 0 ? [] : [descriptor];
|
|
1050
|
+
});
|
|
1051
|
+
const cohorts = new Set([
|
|
1052
|
+
void 0,
|
|
1053
|
+
...Array.from({ length: NUMERIC_COHORT_SIZE }, (_, index) => String(index + 1)),
|
|
1054
|
+
...descriptors.flatMap(({ targetCohorts }) => targetCohorts),
|
|
1055
|
+
NON_TARGETED_COHORT
|
|
1056
|
+
]);
|
|
1057
|
+
for (const cohort of cohorts) {
|
|
1058
|
+
const selected = descriptors.find((descriptor) => descriptor.kind === "BUNDLE" && descriptor.bundleId !== null && isReleaseEligibleForCohort(descriptor, cohort));
|
|
1059
|
+
if (selected !== void 0) reachableReleaseIds.add(selected.releaseId);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
function collectCurrentlyReachableReleaseIds(catalog) {
|
|
1063
|
+
const reachableReleaseIds = /* @__PURE__ */ new Set();
|
|
1064
|
+
const indexGroups = catalog.strategy === "APP_VERSION" ? catalog.segments.map(({ releaseIndexes }) => releaseIndexes) : [catalog.releaseIndexes];
|
|
1065
|
+
for (const indexes of indexGroups) collectReachableFromIndexes(catalog, indexes, reachableReleaseIds);
|
|
1066
|
+
return reachableReleaseIds;
|
|
1067
|
+
}
|
|
1068
|
+
async function addReleaseReachability(releaseCatalogs, releases) {
|
|
1069
|
+
const scopeKeys = [...new Set(releases.map(({ scope_key }) => scope_key))];
|
|
1070
|
+
const reachableByScope = new Map(await Promise.all(scopeKeys.map(async (scopeKey) => {
|
|
1071
|
+
const row = await releaseCatalogs.findByScopeKey(scopeKey);
|
|
1072
|
+
return [scopeKey, row === null ? /* @__PURE__ */ new Set() : collectCurrentlyReachableReleaseIds(JSON.parse(row.payload))];
|
|
1073
|
+
})));
|
|
1074
|
+
return releases.map((release) => ({
|
|
1075
|
+
...release,
|
|
1076
|
+
currentlyUnreachable: !reachableByScope.get(release.scope_key)?.has(release.id)
|
|
1077
|
+
}));
|
|
1078
|
+
}
|
|
1079
|
+
var getReleases_createServerFn_handler = createServerRpc({
|
|
1080
|
+
id: "206547cb1526f961070a989818ca7b9e34f6b2b0e4ab851698c3807fe9fb5e0c",
|
|
1081
|
+
name: "getReleases",
|
|
1082
|
+
filename: "src/lib/api-rpc.ts"
|
|
1083
|
+
}, (opts) => getReleases.__executeServer(opts));
|
|
1084
|
+
var getReleases = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(getReleases_createServerFn_handler, async ({ data }) => {
|
|
1085
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1086
|
+
const { config, hotUpdater } = await prepareConfig();
|
|
1087
|
+
const result = await listReleases(config.database.models.releases, {
|
|
1088
|
+
...data?.afterReleaseId === void 0 ? {} : { afterReleaseId: data.afterReleaseId },
|
|
1089
|
+
...data?.beforeReleaseId === void 0 ? {} : { beforeReleaseId: data.beforeReleaseId },
|
|
1090
|
+
...data?.bundleId === void 0 ? {} : { bundleId: data.bundleId },
|
|
1091
|
+
...data?.channelId === void 0 ? {} : { channelId: data.channelId },
|
|
1092
|
+
...data?.enabled === void 0 ? {} : { enabled: data.enabled },
|
|
1093
|
+
...data?.page === void 0 ? {} : { page: data.page },
|
|
1094
|
+
...data?.platform === void 0 ? {} : { platform: data.platform },
|
|
1095
|
+
...data?.targetAppVersion === void 0 ? {} : { targetAppVersion: data.targetAppVersion },
|
|
1096
|
+
limit: data?.limit ?? 20
|
|
1097
|
+
});
|
|
1098
|
+
const [releases, activityByBundleId] = await Promise.all([addReleaseReachability(config.database.models.releaseCatalogs, result.data), getReleaseActivity30d(hotUpdater, result.data)]);
|
|
1099
|
+
return {
|
|
1100
|
+
...result,
|
|
1101
|
+
data: releases.map((release) => ({
|
|
1102
|
+
...release,
|
|
1103
|
+
activity30d: release.bundle_id === null ? null : activityByBundleId.get(release.bundle_id) ?? null
|
|
1104
|
+
}))
|
|
1105
|
+
};
|
|
1106
|
+
});
|
|
1107
|
+
var getRelease_createServerFn_handler = createServerRpc({
|
|
1108
|
+
id: "a6f23116eeaf76166d405e28a95213123025613c6603030894e519015bf48032",
|
|
1109
|
+
name: "getRelease",
|
|
1110
|
+
filename: "src/lib/api-rpc.ts"
|
|
1111
|
+
}, (opts) => getRelease.__executeServer(opts));
|
|
1112
|
+
var getRelease = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(getRelease_createServerFn_handler, async ({ data }) => {
|
|
1113
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1114
|
+
const { config } = await prepareConfig();
|
|
1115
|
+
return config.database.models.releases.findById(data.releaseId);
|
|
1116
|
+
});
|
|
1117
|
+
var updateRelease_createServerFn_handler = createServerRpc({
|
|
1118
|
+
id: "7ea0186f19f9f2bc2ca4b26e3c59636891cf046957f84287b6783f8d88bd8cb7",
|
|
1119
|
+
name: "updateRelease",
|
|
1120
|
+
filename: "src/lib/api-rpc.ts"
|
|
1121
|
+
}, (opts) => updateRelease.__executeServer(opts));
|
|
1122
|
+
var updateRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(updateRelease_createServerFn_handler, async ({ data }) => {
|
|
1123
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1124
|
+
const { config } = await prepareConfig();
|
|
1125
|
+
return updateReleasePolicy({
|
|
1126
|
+
database: config.database,
|
|
1127
|
+
...data
|
|
1128
|
+
});
|
|
1129
|
+
});
|
|
1130
|
+
var preflightRelease_createServerFn_handler = createServerRpc({
|
|
1131
|
+
id: "b46c95dba95a6a3e8fa5c9d100e3622fa5ae7af4f38e10fb1ed2fa48289a3a8f",
|
|
1132
|
+
name: "preflightRelease",
|
|
1133
|
+
filename: "src/lib/api-rpc.ts"
|
|
1134
|
+
}, (opts) => preflightRelease.__executeServer(opts));
|
|
1135
|
+
var preflightRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(preflightRelease_createServerFn_handler, async ({ data }) => {
|
|
1136
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1137
|
+
const { config } = await prepareConfig();
|
|
1138
|
+
return preflightReleasePolicy({
|
|
1139
|
+
database: config.database,
|
|
1140
|
+
...data
|
|
1141
|
+
});
|
|
1142
|
+
});
|
|
1143
|
+
var deleteRelease_createServerFn_handler = createServerRpc({
|
|
1144
|
+
id: "d5b58722ce514e3b63a377f736b4823c2011782495442ae4870ed547e392c70b",
|
|
1145
|
+
name: "deleteRelease",
|
|
1146
|
+
filename: "src/lib/api-rpc.ts"
|
|
1147
|
+
}, (opts) => deleteRelease.__executeServer(opts));
|
|
1148
|
+
var deleteRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(deleteRelease_createServerFn_handler, async ({ data }) => {
|
|
1149
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1150
|
+
const { config } = await prepareConfig();
|
|
1151
|
+
return deleteRelease$1({
|
|
1152
|
+
database: config.database,
|
|
1153
|
+
...data
|
|
1154
|
+
});
|
|
1155
|
+
});
|
|
1156
|
+
var promoteRelease_createServerFn_handler = createServerRpc({
|
|
1157
|
+
id: "956539a300d79a7efa191c1cc2d529d62fc4bfd940442548fdbc1404e0d53078",
|
|
1158
|
+
name: "promoteRelease",
|
|
1159
|
+
filename: "src/lib/api-rpc.ts"
|
|
1160
|
+
}, (opts) => promoteRelease.__executeServer(opts));
|
|
1161
|
+
var promoteRelease = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(promoteRelease_createServerFn_handler, async ({ data }) => {
|
|
1162
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1163
|
+
const { config } = await prepareConfig();
|
|
1164
|
+
return promoteRelease$1({
|
|
1165
|
+
database: config.database,
|
|
1166
|
+
...data
|
|
1167
|
+
});
|
|
1168
|
+
});
|
|
1169
|
+
var getReleaseCatalogDiagnostics_createServerFn_handler = createServerRpc({
|
|
1170
|
+
id: "e8c24b7247936f045a145ffd5c177fd0e3df3b52769d67dfbd8d1de491d66396",
|
|
1171
|
+
name: "getReleaseCatalogDiagnostics",
|
|
1172
|
+
filename: "src/lib/api-rpc.ts"
|
|
1173
|
+
}, (opts) => getReleaseCatalogDiagnostics.__executeServer(opts));
|
|
1174
|
+
var getReleaseCatalogDiagnostics = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(getReleaseCatalogDiagnostics_createServerFn_handler, async ({ data }) => {
|
|
1175
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1176
|
+
const { config } = await prepareConfig();
|
|
1177
|
+
return config.database.models.releaseCatalogs.findByScopeKey(data.scopeKey);
|
|
1178
|
+
});
|
|
1179
|
+
var getConfig_createServerFn_handler = createServerRpc({
|
|
1180
|
+
id: "51a34c05479a893c7d320bd4cd1604427289d667698c48b9f30a01aabf8a5e68",
|
|
1181
|
+
name: "getConfig",
|
|
1182
|
+
filename: "src/lib/api-rpc.ts"
|
|
1183
|
+
}, (opts) => getConfig.__executeServer(opts));
|
|
1184
|
+
var getConfig = createServerFn().handler(getConfig_createServerFn_handler, async () => {
|
|
1185
|
+
try {
|
|
1186
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1187
|
+
const { config } = await prepareConfig();
|
|
1188
|
+
return { console: config.console };
|
|
1189
|
+
} catch (error) {
|
|
1190
|
+
console.error("Error during config retrieval:", error);
|
|
1191
|
+
throw error;
|
|
1192
|
+
}
|
|
1193
|
+
});
|
|
1194
|
+
var getChannels_createServerFn_handler = createServerRpc({
|
|
1195
|
+
id: "79ada05964de8f2123bfcd62b10097d59bf8fd689ef5c7161031e5871d8396c5",
|
|
1196
|
+
name: "getChannels",
|
|
1197
|
+
filename: "src/lib/api-rpc.ts"
|
|
1198
|
+
}, (opts) => getChannels.__executeServer(opts));
|
|
1199
|
+
var getChannels = createServerFn().handler(getChannels_createServerFn_handler, async () => {
|
|
1200
|
+
try {
|
|
1201
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1202
|
+
const { databaseClient } = await prepareConfig();
|
|
1203
|
+
return await databaseClient.getChannels() ?? [];
|
|
1204
|
+
} catch (error) {
|
|
1205
|
+
console.error("Error during channel retrieval:", error);
|
|
1206
|
+
throw error;
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1209
|
+
var createChannel_createServerFn_handler = createServerRpc({
|
|
1210
|
+
id: "2b9b8d1f49f79a511589617d8d4bfc6094a3acf5264f33651b9569ba66d3f321",
|
|
1211
|
+
name: "createChannel",
|
|
1212
|
+
filename: "src/lib/api-rpc.ts"
|
|
1213
|
+
}, (opts) => createChannel.__executeServer(opts));
|
|
1214
|
+
var createChannel = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createChannel_createServerFn_handler, async ({ data }) => {
|
|
1215
|
+
try {
|
|
1216
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1217
|
+
const { databaseClient } = await prepareConfig();
|
|
1218
|
+
return { data: await databaseClient.insertChannel(data) };
|
|
1219
|
+
} catch (error) {
|
|
1220
|
+
console.error("Error during channel creation:", error);
|
|
1221
|
+
throw error;
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
var deleteChannel_createServerFn_handler = createServerRpc({
|
|
1225
|
+
id: "52756dde414919a906bfe83d1ab6d29910c63bcafdb47653d6f1df562d958920",
|
|
1226
|
+
name: "deleteChannel",
|
|
1227
|
+
filename: "src/lib/api-rpc.ts"
|
|
1228
|
+
}, (opts) => deleteChannel.__executeServer(opts));
|
|
1229
|
+
var deleteChannel = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(deleteChannel_createServerFn_handler, async ({ data }) => {
|
|
1230
|
+
try {
|
|
1231
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1232
|
+
const { databaseClient } = await prepareConfig();
|
|
1233
|
+
return { data: await databaseClient.deleteChannel(data) };
|
|
1234
|
+
} catch (error) {
|
|
1235
|
+
console.error("Error during channel deletion:", error);
|
|
1236
|
+
throw error;
|
|
1237
|
+
}
|
|
1238
|
+
});
|
|
1239
|
+
var getConfigLoaded_createServerFn_handler = createServerRpc({
|
|
1240
|
+
id: "f8bdca3d0579adb812d6404f55d9261a89cdb025e920b1fcad82883646a5fe9e",
|
|
1241
|
+
name: "getConfigLoaded",
|
|
1242
|
+
filename: "src/lib/api-rpc.ts"
|
|
1243
|
+
}, (opts) => getConfigLoaded.__executeServer(opts));
|
|
1244
|
+
var getConfigLoaded = createServerFn().handler(getConfigLoaded_createServerFn_handler, async () => {
|
|
1245
|
+
try {
|
|
1246
|
+
const [{ getRequest }, { requireConsoleAccess }] = await Promise.all([import("./server-CpzW--lT.mjs").then((n) => n.t), import("./auth.server-DW71WzsD.mjs")]);
|
|
1247
|
+
await requireConsoleAccess(getRequest());
|
|
1248
|
+
const { isConfigLoaded } = await import("./config.server-DQYEr_5X.mjs");
|
|
1249
|
+
return { configLoaded: isConfigLoaded() };
|
|
1250
|
+
} catch (error) {
|
|
1251
|
+
console.error("Error during config loaded retrieval:", error);
|
|
1252
|
+
throw error;
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
var getBundles_createServerFn_handler = createServerRpc({
|
|
1256
|
+
id: "00ccacb4a0212c83ec29f4d11719046ad91ea8291cfc557d514dbf00d3bd7f5f",
|
|
1257
|
+
name: "getBundles",
|
|
1258
|
+
filename: "src/lib/api-rpc.ts"
|
|
1259
|
+
}, (opts) => getBundles.__executeServer(opts));
|
|
1260
|
+
var getBundles = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(getBundles_createServerFn_handler, async ({ data }) => {
|
|
1261
|
+
try {
|
|
1262
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1263
|
+
const query = {
|
|
1264
|
+
platform: data?.platform ?? void 0,
|
|
1265
|
+
page: typeof data?.page === "number" && Number.isInteger(data.page) && data.page > 1 ? data.page : void 0,
|
|
1266
|
+
limit: data?.limit ? Number(data.limit) : 20,
|
|
1267
|
+
after: data?.after ?? void 0,
|
|
1268
|
+
before: data?.before ?? void 0
|
|
1269
|
+
};
|
|
1270
|
+
if (query.after !== void 0 && query.before !== void 0 || query.page !== void 0 && (query.after !== void 0 || query.before !== void 0)) throw new DatabasePluginInputError("invalid-pagination");
|
|
1271
|
+
const pagination = query.page !== void 0 ? { page: query.page } : query.after !== void 0 ? { cursor: { after: query.after } } : query.before !== void 0 ? { cursor: { before: query.before } } : {};
|
|
1272
|
+
const { databaseClient } = await prepareConfig();
|
|
1273
|
+
const bundleQueryOptions = {
|
|
1274
|
+
where: { platform: query.platform },
|
|
1275
|
+
limit: query.limit,
|
|
1276
|
+
...pagination
|
|
1277
|
+
};
|
|
1278
|
+
return await databaseClient.getBundles(bundleQueryOptions) ?? {
|
|
1279
|
+
data: [],
|
|
1280
|
+
pagination: {
|
|
1281
|
+
total: 0,
|
|
1282
|
+
hasNextPage: false,
|
|
1283
|
+
hasPreviousPage: false,
|
|
1284
|
+
currentPage: 1,
|
|
1285
|
+
totalPages: 0
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
} catch (error) {
|
|
1289
|
+
console.error("Error during bundle retrieval:", error);
|
|
1290
|
+
throw error;
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
var getBundle_createServerFn_handler = createServerRpc({
|
|
1294
|
+
id: "1bd85c2a50e24785cb6abb023a247a9f048f37ddfa85cbb1c57e579563bad013",
|
|
1295
|
+
name: "getBundle",
|
|
1296
|
+
filename: "src/lib/api-rpc.ts"
|
|
1297
|
+
}, (opts) => getBundle.__executeServer(opts));
|
|
1298
|
+
var getBundle = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(getBundle_createServerFn_handler, async ({ data }) => {
|
|
1299
|
+
try {
|
|
1300
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1301
|
+
const { databaseClient } = await prepareConfig();
|
|
1302
|
+
return await databaseClient.getBundleById(data.bundleId) ?? null;
|
|
1303
|
+
} catch (error) {
|
|
1304
|
+
console.error("Error during bundle retrieval:", error);
|
|
1305
|
+
throw error;
|
|
1306
|
+
}
|
|
1307
|
+
});
|
|
1308
|
+
var getBundleEventSummary_createServerFn_handler = createServerRpc({
|
|
1309
|
+
id: "d4320e02be8e5c6ae7ec70a17604c835fde4686756031277b09d96b7f3de5f14",
|
|
1310
|
+
name: "getBundleEventSummary",
|
|
1311
|
+
filename: "src/lib/api-rpc.ts"
|
|
1312
|
+
}, (opts) => getBundleEventSummary.__executeServer(opts));
|
|
1313
|
+
var getBundleEventSummary = createServerFn({ method: "GET" }).inputValidator(parseBundleEventSummaryInput).handler(getBundleEventSummary_createServerFn_handler, async ({ data }) => {
|
|
1314
|
+
try {
|
|
1315
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1316
|
+
const { getBundleEventSummary: getBundleEventSummaryWithRuntime } = await import("./runtime.server-la7TRAH_.mjs");
|
|
1317
|
+
const { hotUpdater } = await prepareConfig();
|
|
1318
|
+
return await getBundleEventSummaryWithRuntime(hotUpdater, data);
|
|
1319
|
+
} catch (error) {
|
|
1320
|
+
console.error("Error during bundle event summary retrieval:", error);
|
|
1321
|
+
throw error;
|
|
1322
|
+
}
|
|
1323
|
+
});
|
|
1324
|
+
var getBundleEventInsights_createServerFn_handler = createServerRpc({
|
|
1325
|
+
id: "49ae6512305a083b6aff68bc430bd8bb1bf4d3a5f528d38865c97830b5481e0e",
|
|
1326
|
+
name: "getBundleEventInsights",
|
|
1327
|
+
filename: "src/lib/api-rpc.ts"
|
|
1328
|
+
}, (opts) => getBundleEventInsights.__executeServer(opts));
|
|
1329
|
+
var getBundleEventInsights = createServerFn({ method: "GET" }).inputValidator(parseBundleEventInsightsInput).handler(getBundleEventInsights_createServerFn_handler, async ({ data }) => {
|
|
1330
|
+
try {
|
|
1331
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1332
|
+
const { getBundleEventInsights: getBundleEventInsightsWithRuntime } = await import("./runtime.server-la7TRAH_.mjs");
|
|
1333
|
+
const { hotUpdater } = await prepareConfig();
|
|
1334
|
+
return await getBundleEventInsightsWithRuntime(hotUpdater, data);
|
|
1335
|
+
} catch (error) {
|
|
1336
|
+
console.error("Error during bundle event insights retrieval:", error);
|
|
1337
|
+
throw error;
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
var searchInstallations_createServerFn_handler = createServerRpc({
|
|
1341
|
+
id: "57cc4fac8359876a1d5c4b04615ba6d39bcc4b76768bb5395309ec350bd61a51",
|
|
1342
|
+
name: "searchInstallations",
|
|
1343
|
+
filename: "src/lib/api-rpc.ts"
|
|
1344
|
+
}, (opts) => searchInstallations.__executeServer(opts));
|
|
1345
|
+
var searchInstallations = createServerFn({ method: "GET" }).inputValidator(parseSearchInstallationsInput).handler(searchInstallations_createServerFn_handler, async ({ data }) => {
|
|
1346
|
+
try {
|
|
1347
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1348
|
+
const { searchInstallations: searchInstallationsWithRuntime } = await import("./runtime.server-la7TRAH_.mjs");
|
|
1349
|
+
const { hotUpdater } = await prepareConfig();
|
|
1350
|
+
return await searchInstallationsWithRuntime(hotUpdater, data);
|
|
1351
|
+
} catch (error) {
|
|
1352
|
+
console.error("Error during installation search:", error);
|
|
1353
|
+
throw error;
|
|
1354
|
+
}
|
|
1355
|
+
});
|
|
1356
|
+
var getInstallationHistory_createServerFn_handler = createServerRpc({
|
|
1357
|
+
id: "9a9d750535dcdd25b01cb1c4b9439dd1ef5b719f3f835b9aee7889191ef6ec81",
|
|
1358
|
+
name: "getInstallationHistory",
|
|
1359
|
+
filename: "src/lib/api-rpc.ts"
|
|
1360
|
+
}, (opts) => getInstallationHistory.__executeServer(opts));
|
|
1361
|
+
var getInstallationHistory = createServerFn({ method: "GET" }).inputValidator(parseInstallationHistoryInput).handler(getInstallationHistory_createServerFn_handler, async ({ data }) => {
|
|
1362
|
+
try {
|
|
1363
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1364
|
+
const { getInstallationHistory: getInstallationHistoryWithRuntime } = await import("./runtime.server-la7TRAH_.mjs");
|
|
1365
|
+
const { hotUpdater } = await prepareConfig();
|
|
1366
|
+
return await getInstallationHistoryWithRuntime(hotUpdater, data);
|
|
1367
|
+
} catch (error) {
|
|
1368
|
+
console.error("Error during installation history retrieval:", error);
|
|
1369
|
+
throw error;
|
|
1370
|
+
}
|
|
1371
|
+
});
|
|
1372
|
+
var getBundleChildren_createServerFn_handler = createServerRpc({
|
|
1373
|
+
id: "4370f1bf70b91f1168d85379d3008449a1bedb915e9878ca4ef89d5f3a80fa7f",
|
|
1374
|
+
name: "getBundleChildren",
|
|
1375
|
+
filename: "src/lib/api-rpc.ts"
|
|
1376
|
+
}, (opts) => getBundleChildren.__executeServer(opts));
|
|
1377
|
+
var getBundleChildren = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(getBundleChildren_createServerFn_handler, async ({ data }) => {
|
|
1378
|
+
try {
|
|
1379
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1380
|
+
const { getBundleChildren: getBundleChildrenWithConfig } = await import("./getBundleChildren-BcRMFoDF.mjs");
|
|
1381
|
+
const { databaseClient } = await prepareConfig();
|
|
1382
|
+
return await getBundleChildrenWithConfig(data, { databaseClient });
|
|
1383
|
+
} catch (error) {
|
|
1384
|
+
console.error("Error during bundle children retrieval:", error);
|
|
1385
|
+
throw error;
|
|
1386
|
+
}
|
|
1387
|
+
});
|
|
1388
|
+
var getBundleChildCounts_createServerFn_handler = createServerRpc({
|
|
1389
|
+
id: "4ca367070b00f58179a572f0bb8196a4ccdd3881e9b1dbfe33deee0cb6e1f549",
|
|
1390
|
+
name: "getBundleChildCounts",
|
|
1391
|
+
filename: "src/lib/api-rpc.ts"
|
|
1392
|
+
}, (opts) => getBundleChildCounts.__executeServer(opts));
|
|
1393
|
+
var getBundleChildCounts = createServerFn({ method: "GET" }).inputValidator((input) => input).handler(getBundleChildCounts_createServerFn_handler, async ({ data }) => {
|
|
1394
|
+
try {
|
|
1395
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1396
|
+
const { getBundleChildCounts: getBundleChildCountsWithConfig } = await import("./getBundleChildren-BcRMFoDF.mjs");
|
|
1397
|
+
const { databaseClient } = await prepareConfig();
|
|
1398
|
+
return await getBundleChildCountsWithConfig(data.bundleIds, { databaseClient });
|
|
1399
|
+
} catch (error) {
|
|
1400
|
+
console.error("Error during bundle child count retrieval:", error);
|
|
1401
|
+
throw error;
|
|
1402
|
+
}
|
|
1403
|
+
});
|
|
1404
|
+
var createBundle_createServerFn_handler = createServerRpc({
|
|
1405
|
+
id: "16cc7c2f080ea5b73e0c6bba815b110dbd7727796036d248ba0d8ae819ddef08",
|
|
1406
|
+
name: "createBundle",
|
|
1407
|
+
filename: "src/lib/api-rpc.ts"
|
|
1408
|
+
}, (opts) => createBundle.__executeServer(opts));
|
|
1409
|
+
var createBundle = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(createBundle_createServerFn_handler, async ({ data }) => {
|
|
1410
|
+
try {
|
|
1411
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1412
|
+
const { databaseClient } = await prepareConfig();
|
|
1413
|
+
await databaseClient.insertBundle(data);
|
|
1414
|
+
return {
|
|
1415
|
+
success: true,
|
|
1416
|
+
bundleId: data.id
|
|
1417
|
+
};
|
|
1418
|
+
} catch (error) {
|
|
1419
|
+
console.error("Error during bundle creation:", error);
|
|
1420
|
+
throw error;
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
var deleteBundle_createServerFn_handler = createServerRpc({
|
|
1424
|
+
id: "3a27ff5679228b86a346b3fe42142e7a5bf0264f73173c0dbe5f07fb37c43cf7",
|
|
1425
|
+
name: "deleteBundle",
|
|
1426
|
+
filename: "src/lib/api-rpc.ts"
|
|
1427
|
+
}, (opts) => deleteBundle.__executeServer(opts));
|
|
1428
|
+
var deleteBundle = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(deleteBundle_createServerFn_handler, async ({ data }) => {
|
|
1429
|
+
try {
|
|
1430
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1431
|
+
const { deleteBundle: deleteBundleWithStorage } = await import("./deleteBundle-Cu_XOMt0.mjs");
|
|
1432
|
+
const { databaseClient, storagePlugin } = await prepareConfig();
|
|
1433
|
+
await deleteBundleWithStorage(data, {
|
|
1434
|
+
databaseClient,
|
|
1435
|
+
storagePlugin,
|
|
1436
|
+
waitForStorageCleanup: false
|
|
1437
|
+
});
|
|
1438
|
+
return { success: true };
|
|
1439
|
+
} catch (error) {
|
|
1440
|
+
console.error("Error during bundle deletion:", error);
|
|
1441
|
+
throw error;
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
var deleteBundles_createServerFn_handler = createServerRpc({
|
|
1445
|
+
id: "61de3b69779c5ce2a5f5d3c27e2cfaca8fba8f14c8803559b9cd733c456494fa",
|
|
1446
|
+
name: "deleteBundles",
|
|
1447
|
+
filename: "src/lib/api-rpc.ts"
|
|
1448
|
+
}, (opts) => deleteBundles.__executeServer(opts));
|
|
1449
|
+
var deleteBundles = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(deleteBundles_createServerFn_handler, async ({ data }) => {
|
|
1450
|
+
try {
|
|
1451
|
+
const { prepareConfig } = await import("./config.server-DQYEr_5X.mjs");
|
|
1452
|
+
const { deleteBundles: deleteBundlesWithStorage } = await import("./deleteBundle-Cu_XOMt0.mjs");
|
|
1453
|
+
const { databaseClient, storagePlugin } = await prepareConfig();
|
|
1454
|
+
return {
|
|
1455
|
+
success: true,
|
|
1456
|
+
...await deleteBundlesWithStorage(data, {
|
|
1457
|
+
databaseClient,
|
|
1458
|
+
storagePlugin,
|
|
1459
|
+
waitForStorageCleanup: false
|
|
1460
|
+
})
|
|
1461
|
+
};
|
|
1462
|
+
} catch (error) {
|
|
1463
|
+
console.error("Error during bundle deletion:", error);
|
|
1464
|
+
throw error;
|
|
1465
|
+
}
|
|
1466
|
+
});
|
|
1467
|
+
//#endregion
|
|
1468
|
+
export { createBundle_createServerFn_handler, createChannel_createServerFn_handler, deleteBundle_createServerFn_handler, deleteBundles_createServerFn_handler, deleteChannel_createServerFn_handler, deleteRelease_createServerFn_handler, getBundleChildCounts_createServerFn_handler, getBundleChildren_createServerFn_handler, getBundleEventInsights_createServerFn_handler, getBundleEventSummary_createServerFn_handler, getBundle_createServerFn_handler, getBundles_createServerFn_handler, getChannels_createServerFn_handler, getConfigLoaded_createServerFn_handler, getConfig_createServerFn_handler, getInstallationHistory_createServerFn_handler, getReleaseCatalogDiagnostics_createServerFn_handler, getRelease_createServerFn_handler, getReleases_createServerFn_handler, preflightRelease_createServerFn_handler, promoteRelease_createServerFn_handler, searchInstallations_createServerFn_handler, updateRelease_createServerFn_handler };
|