@hot-updater/console 1.2.0-rc.49 → 1.2.0-rc.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{-native-builds-search-BFcW2mlI.js → -native-builds-search-6aptbS4G.js} +1 -1
- package/.output/public/assets/{ChannelPicker-Ck8vBdjI.js → ChannelPicker-DPR-7lqV.js} +1 -1
- package/.output/public/assets/{EventDetails-BGglj3Ap.js → EventDetails-LQ8ejbsd.js} +1 -1
- package/.output/public/assets/FoldedRows-1NvB9gAS.js +1 -0
- package/.output/public/assets/HashValueDisplay-DTSMSH9O.js +1 -0
- package/.output/public/assets/IosInstall-BRuSakxm.js +1 -0
- package/.output/public/assets/{RelativeTime-5ZP9WlQ6.js → RelativeTime-m-FKh1Jb.js} +1 -1
- package/.output/public/assets/{RolloutPercentageBadge-DCtG7c1o.js → RolloutPercentageBadge-DF4EeZIJ.js} +1 -1
- package/.output/public/assets/RowReason-BvIxbpPP.js +1 -0
- package/.output/public/assets/{SandboxBadge-PM92jCk6.js → SandboxBadge-DPmJn40v.js} +1 -1
- package/.output/public/assets/{TargetDisplay-DG_I3qln.js → TargetDisplay-Ctuz3qIp.js} +1 -1
- package/.output/public/assets/api-znPyglTl.js +1 -0
- package/.output/public/assets/{constants-C5gi7fdZ.js → constants-yj-e3ahf.js} +1 -1
- package/.output/public/assets/{index-BHt1lVdq.js → index-oTXLdUR-.js} +2 -2
- package/.output/public/assets/{insights-nnyldFdS.js → insights-BL6Z8zFv.js} +2 -2
- package/.output/public/assets/{insights-CSHfYaU4.js → insights-BMjBMtJU.js} +2 -2
- package/.output/public/assets/{insights-search-CfbhmuFL.js → insights-search-B4NkHGeC.js} +1 -1
- package/.output/public/assets/{insights_.distribution-CzuSRyqb.js → insights_.distribution-Br_CW9s9.js} +2 -2
- package/.output/public/assets/{insights_.distribution-7l1cAZVo.js → insights_.distribution-C4E-JuVI.js} +1 -1
- package/.output/public/assets/{installations-BHWbfpbI.js → installations-Cjx0648C.js} +1 -1
- package/.output/public/assets/{installations-DlTdbNgY.js → installations-m1v6oE-2.js} +2 -2
- package/.output/public/assets/native-builds-B0zJ4wjg.js +1 -0
- package/.output/public/assets/native-builds-BC0sjxPC.js +2 -0
- package/.output/public/assets/{native-builds-zwqucwx2.js → native-builds-B_pQ4D5H.js} +1 -1
- package/.output/public/assets/native-builds_._buildId-CSyC7YAA.js +1 -0
- package/.output/public/assets/native-builds_._buildId-GPlkI_2m.js +2 -0
- package/.output/public/assets/{native-builds_.devices-Bet7RN0x.js → native-builds_.devices-Cox001IR.js} +2 -2
- package/.output/public/assets/native-builds_.devices-DAW19hcQ.js +1 -0
- package/.output/public/assets/{remote-config-C7grLPjp.js → remote-config-BCQHNGRY.js} +1 -1
- package/.output/public/assets/{remote-config-DfUXmtPZ.js → remote-config-CDlB7JK8.js} +3 -3
- package/.output/public/assets/routes-C7Pv3Cfg.js +1 -0
- package/.output/public/assets/{routes-C047Z4F3.js → routes-JJGRGqsf.js} +2 -2
- package/.output/public/assets/styles-D5kpHu-Z.css +2 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-Bf0cbPMx.mjs → __23tanstack-start-server-fn-resolver-DY-niJR4.mjs} +58 -58
- package/.output/server/_libs/_.mjs +1 -1
- package/.output/server/_libs/lucide-react.mjs +17 -1
- package/.output/server/_ssr/{-native-builds-search-Bwt8tQzp.mjs → -native-builds-search-D10dMZzL.mjs} +10 -3
- package/.output/server/_ssr/{BundleIdDisplay-4XylLb5Q.mjs → BundleIdDisplay-CGdSiouM.mjs} +2 -2
- package/.output/server/_ssr/{ChannelPicker-CqXiOROk.mjs → ChannelPicker-J5HfKxSS.mjs} +6 -6
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-DVFHeS3i.mjs → ConsoleFeatureUnavailable-C52o4oew.mjs} +6 -6
- package/.output/server/_ssr/{EventDetails-LgY08-Qa.mjs → EventDetails-CDLSkVNA.mjs} +7 -7
- package/.output/server/_ssr/{RowReason-BPvZzTjP.mjs → FoldedRows-CrRYEVkd.mjs} +6 -40
- package/.output/server/_ssr/HashValueDisplay-BrT2wgxk.mjs +65 -0
- package/.output/server/_ssr/{InsightsPageHeader-DO-fpFxk.mjs → InsightsPageHeader-DVrudLMJ.mjs} +6 -6
- package/.output/server/_ssr/{IosInstall-DlaWL-KQ.mjs → IosInstall-DcKlZU_q.mjs} +30 -14
- package/.output/server/_ssr/{NativeBuildsNav-DqYfoHCs.mjs → NativeBuildsNav-BC1WIQ1W.mjs} +3 -3
- package/.output/server/_ssr/{NotFoundPage-CwzO3kTD.mjs → NotFoundPage-CEhZtcst.mjs} +2 -2
- package/.output/server/_ssr/{QrCode-DdxxNZ2I.mjs → QrCode-Dj9BKV3l.mjs} +2 -2
- package/.output/server/_ssr/{RelativeTime-UNp6jyTX.mjs → RelativeTime-Dgbh4UPb.mjs} +4 -4
- package/.output/server/_ssr/{RolloutPercentageBadge-DoDPCp5t.mjs → RolloutPercentageBadge-BYEDUW1d.mjs} +3 -3
- package/.output/server/_ssr/RowReason-BweNBWkA.mjs +59 -0
- package/.output/server/_ssr/{SandboxBadge-BhyoXSA9.mjs → SandboxBadge-O8-kbXAw.mjs} +2 -2
- package/.output/server/_ssr/{TargetDisplay-DIO6xo6c.mjs → TargetDisplay-D3JAXwcF.mjs} +3 -3
- package/.output/server/_ssr/{alert-dialog-CNTK3_5o.mjs → alert-dialog-CxEcyUb6.mjs} +1 -1
- package/.output/server/_ssr/{api-DlOLh3f5.mjs → api-IIqxWeDx.mjs} +16 -6
- package/.output/server/_ssr/{api-keys-BnxQYO4V.mjs → api-keys-CYefExfc.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-rpc-OKrIM3PZ.mjs → api-keys-rpc-qkGQ3Sp3.mjs} +3 -3
- package/.output/server/_ssr/{api-keys-DrEgzgio.mjs → api-keys-wFak2vKN.mjs} +10 -10
- package/.output/server/_ssr/{api-rpc-Bm9iTKOj.mjs → api-rpc-3NKc545A.mjs} +12 -12
- package/.output/server/_ssr/{auth-rpc-BNnd4K7W.mjs → auth-rpc-PCSJzNJf.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-D92eE7EP.mjs → auth.server-NGj7G3bq.mjs} +227 -91
- package/.output/server/_ssr/{badge-D8uuNsMF.mjs → badge-CxSJ-pjU.mjs} +1 -1
- package/.output/server/_ssr/{card-BBnWNRdd.mjs → card-BDXDcrk_.mjs} +1 -1
- package/.output/server/_ssr/{config.server-Cwk-r0zt.mjs → config.server-CwUGPk-F.mjs} +3 -3
- package/.output/server/_ssr/{console-access-CZzatEz1.mjs → console-access-BOt-Xxd7.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-B2p2oFYe.mjs → console-features-api-Dw_Tktev.mjs} +3 -3
- package/.output/server/_ssr/{console-features-rpc-CbPZspBL.mjs → console-features-rpc-D8VFHwYj.mjs} +3 -3
- package/.output/server/_ssr/{constants-BjsJZqaU.mjs → constants-D-2jpCiJ.mjs} +3 -2
- package/.output/server/_ssr/{dialog-BZKA7-zO.mjs → dialog-CJ4zMagm.mjs} +1 -1
- package/.output/server/_ssr/{empty-BT-jlLF9.mjs → empty-DYy36pwa.mjs} +2 -2
- package/.output/server/_ssr/{field-ChzggDmB.mjs → field-MI8oNc5n.mjs} +2 -2
- package/.output/server/_ssr/{input-group-DquNSLZ7.mjs → input-group-Bf7wHa21.mjs} +1 -1
- package/.output/server/_ssr/{insights-DmfaQfHu.mjs → insights-CKTR62Ox.mjs} +5 -5
- package/.output/server/_ssr/{insights-B7n8qIG0.mjs → insights-CbGG5htV.mjs} +2 -2
- package/.output/server/_ssr/{insights-api-0ET8QzxE.mjs → insights-api-CqjIxe1A.mjs} +3 -3
- package/.output/server/_ssr/{insights-BoNBNA6O.mjs → insights-b3XeQlzF.mjs} +38 -33
- package/.output/server/_ssr/{insights-failures-rpc-ClPcZpm7.mjs → insights-failures-rpc-fmWHkLhL.mjs} +5 -5
- package/.output/server/_ssr/{insights-recovery-rpc-B5Kji_LQ.mjs → insights-recovery-rpc-BpwoS9XL.mjs} +3 -3
- package/.output/server/_ssr/{insights-rpc-CuXt4Iry.mjs → insights-rpc-qwXzuBUQ.mjs} +3 -3
- package/.output/server/_ssr/{insights-search-CFhH0iTR.mjs → insights-search-B_8PizlM.mjs} +2 -2
- package/.output/server/_ssr/{insights-usage-rpc-Hug5SC2U.mjs → insights-usage-rpc-Cbg82l2g.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-BlSD38zW.mjs → insights-usage-rpc-D8lgk1Sk.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-_6B2Vl-V.mjs → insights_.distribution--XTBM-oT.mjs} +14 -14
- package/.output/server/_ssr/{insights_.distribution-D5pVQCzq.mjs → insights_.distribution-DTaKryjw.mjs} +2 -2
- package/.output/server/_ssr/{insights_.distribution-CAUDvrPR.mjs → insights_.distribution-Ed2vqrwP.mjs} +5 -5
- package/.output/server/_ssr/{installations-oWB7DHX_.mjs → installations-Ce_9dNq0.mjs} +2 -2
- package/.output/server/_ssr/{installations-DYi3XG0X.mjs → installations-DyfuFp3L.mjs} +12 -12
- package/.output/server/_ssr/{installations-B6i9chek.mjs → installations-W8W7AYwn.mjs} +4 -4
- package/.output/server/_ssr/{ios-devices-rpc-DSnkNF0c.mjs → ios-devices-rpc-5kZM1bgU.mjs} +22 -10
- package/.output/server/_ssr/{iosDeviceCookie-EZE63jbQ.mjs → iosDeviceCookie-BTfPOUhS.mjs} +4 -4
- package/.output/server/_ssr/{iosDeviceProfile-Dot9sOca.mjs → iosDeviceProfile-BAoo32s_.mjs} +5 -5
- package/.output/server/_ssr/{iosDevices-BxINvCep.mjs → iosDevices-DuNmS3td.mjs} +23 -4
- package/.output/server/_ssr/{native-artifact-D4ZISXRZ.mjs → native-artifact-0tXDLTsd.mjs} +1 -1
- package/.output/server/_ssr/{native-builds-_Idh0Vht.mjs → native-builds-1s5DIHa2.mjs} +3 -3
- package/.output/server/_ssr/{native-builds-CGlRqH0W.mjs → native-builds-DEyFHKDa.mjs} +16 -16
- package/.output/server/_ssr/{native-builds_._buildId-BopDAnUl.mjs → native-builds_._buildId-ElCXKaXI.mjs} +33 -21
- package/.output/server/_ssr/{native-builds_._buildId-DUIgNSbF.mjs → native-builds_._buildId-mJ8i0pL8.mjs} +3 -3
- package/.output/server/_ssr/{native-builds_.devices-CT0T4ZEH.mjs → native-builds_.devices-DNWZLCra.mjs} +56 -18
- package/.output/server/_ssr/{native-builds_.devices-CJYmhOte.mjs → native-builds_.devices-Dz8b48Fo.mjs} +3 -3
- package/.output/server/_ssr/{nativeBuildDownloadLink-BlSWR9Ly.mjs → nativeBuildDownloadLink-D8Se_CCi.mjs} +2 -2
- package/.output/server/_ssr/{nativeBuildInstall-CzTNaHHA.mjs → nativeBuildInstall-DemC_4Zc.mjs} +7 -7
- package/.output/server/_ssr/{nativeBuilds-S1_ZcH6M.mjs → nativeBuilds-BFSeuC75.mjs} +21 -5
- package/.output/server/_ssr/{plistText-DkzlCfPI.mjs → plistText-BORUpyEb.mjs} +1 -1
- package/.output/server/_ssr/{publicConsoleBase-wTKw3_iB.mjs → publicConsoleBase-C3sNbafy.mjs} +1 -1
- package/.output/server/_ssr/{release-adoption-rpc-BZekkMVs.mjs → release-adoption-rpc-1mKibOdV.mjs} +5 -5
- package/.output/server/_ssr/{releaseCatalogCompiler-CJ2Shida.mjs → releaseCatalogCompiler-CuL3ptgg.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-DzGJ47fS.mjs → remote-config-C_HNYPZ_.mjs} +18 -18
- package/.output/server/_ssr/{remote-config-qQiWc9F0.mjs → remote-config-D2Cohnwn.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-BJQyrUEJ.mjs → remote-config-q9fegj-G.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-rpc-krZrX9D0.mjs → remote-config-rpc-6hfHFrO6.mjs} +3 -3
- package/.output/server/_ssr/{router-BObHTWLX.mjs → router-DODxASKG.mjs} +35 -35
- package/.output/server/_ssr/{routes-BcrSXX1Y.mjs → routes-BJjTUNSe.mjs} +42 -23
- package/.output/server/_ssr/{routes-xU4hQEnz.mjs → routes-C-nYThl0.mjs} +10 -10
- package/.output/server/_ssr/{schema-migration-rpc-BiIhD-p1.mjs → schema-migration-rpc-C31JquTn.mjs} +4 -4
- package/.output/server/_ssr/{select-TmlKL8E0.mjs → select-CjACvu9s.mjs} +2 -2
- package/.output/server/_ssr/{server-CNUDX2vc.mjs → server-Dyw2qgSR.mjs} +3 -3
- package/.output/server/_ssr/{sidebar-rpA5D4b1.mjs → sidebar-DQkRAO_e.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{switch-CBNhbz-3.mjs → switch-DZJSRVl3.mjs} +2 -2
- package/.output/server/_ssr/{table-CrXl2hfM.mjs → table-BA-6GQFs.mjs} +1 -1
- package/.output/server/_ssr/{tabs-C9cbWq4e.mjs → tabs-CtB3PIts.mjs} +2 -2
- package/.output/server/_ssr/{updateFailures-BwDwIoNu.mjs → updateFailures-DcCONz23.mjs} +6 -3
- package/.output/server/{_tanstack-start-manifest_v-Dm__dcXw.mjs → _tanstack-start-manifest_v-Bfv6fYk6.mjs} +59 -59
- package/.output/server/index.mjs +240 -240
- package/package.json +7 -7
- package/src/components/HashValueDisplay.tsx +21 -5
- package/src/components/RowReason.tsx +8 -1
- package/src/components/features/bundles/BundleMetadata.tsx +21 -0
- package/src/components/features/insights/UpdateFailures.tsx +35 -10
- package/src/components/features/native-builds/IosDevicesPage.tsx +47 -2
- package/src/components/features/native-builds/IpaDevicesCard.tsx +22 -10
- package/src/lib/api.ts +11 -0
- package/src/lib/constants.ts +3 -0
- package/src/lib/ios-devices-api.ts +21 -7
- package/src/lib/ios-devices-rpc.ts +37 -10
- package/src/lib/schema-migration-rpc.ts +1 -1
- package/src/lib/server/iosDevices.ts +40 -1
- package/src/lib/server/nativeBuilds.ts +1 -1
- package/src/lib/server/updateFailures.ts +6 -1
- package/src/routes/-native-builds-search.ts +18 -9
- package/.output/public/assets/ChannelBadge-BgVCJfJs.js +0 -1
- package/.output/public/assets/HashValueDisplay-DvwvQchI.js +0 -1
- package/.output/public/assets/IosInstall-DvV3pRKv.js +0 -1
- package/.output/public/assets/RowReason-CXMCJ-Jc.js +0 -1
- package/.output/public/assets/api-B-1SpJeB.js +0 -1
- package/.output/public/assets/native-builds-DDTZlyLe.js +0 -1
- package/.output/public/assets/native-builds-DhwYkLmx.js +0 -2
- package/.output/public/assets/native-builds_._buildId-2cLz1YM1.js +0 -2
- package/.output/public/assets/native-builds_._buildId-C4ZAkDN_.js +0 -1
- package/.output/public/assets/native-builds_.devices-C0ebsrcu.js +0 -1
- package/.output/public/assets/routes-BHP1sMv1.js +0 -1
- package/.output/public/assets/styles-CiSUsSSk.css +0 -2
- package/.output/server/_ssr/ChannelBadge-CNu_3ciH.mjs +0 -23
- package/.output/server/_ssr/HashValueDisplay-DJ4KApnA.mjs +0 -55
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as DatabaseBundleNotFoundError, r as DatabaseRowReferencedError } from "./databaseJsonValue-DuUoft8j.mjs";
|
|
2
|
-
import { a as getAssetBaseStorageUri, c as getManifestFileHash, i as RELEASE_CATALOG_FALLBACK_POLICY, l as getManifestStorageUri, o as getBundlePatch } from "./dist-CiOq3ygH.mjs";
|
|
2
|
+
import { a as getAssetBaseStorageUri, c as getManifestFileHash, i as RELEASE_CATALOG_FALLBACK_POLICY, l as getManifestStorageUri, n as MAX_COMPILED_CATALOG_BYTES, o as getBundlePatch } from "./dist-CiOq3ygH.mjs";
|
|
3
3
|
import { i as rowToBundle, n as bundleToRow, r as releaseRowToRelease, t as bundleToPatchRows } from "./databaseRows-BZMFl5QV.mjs";
|
|
4
4
|
import { a as decodeChannelKey, c as parseReleaseCatalogScopeKey, i as createReleaseCatalogScopeKey, o as encodeChannelKey, r as canonicalizeAppVersion, s as isUUIDv7, t as NIL_UUID } from "./uuid-kZvLA0Ly-DNL0qBSj.mjs";
|
|
5
5
|
import { t as ReleaseManagementError } from "./releaseManagement-CqIc-SDE.mjs";
|
|
6
6
|
import { n as createUUIDv7After, t as createUUIDv7 } from "./uuidv7-C0jNe2Om.mjs";
|
|
7
7
|
import { i as normalizeRange } from "./version-CQ98ZBpL-zW2fpHOZ.mjs";
|
|
8
|
-
import { n as
|
|
8
|
+
import { i as projectCompiledRollbackCatalog, n as compileReleaseCatalog, r as projectCompiledCatalog, t as ReleaseCatalogCompilationError } from "./releaseCatalogCompiler-CuL3ptgg.mjs";
|
|
9
9
|
import { t as isRemoteDatabase } from "./databaseConfig-B56IJxlu.mjs";
|
|
10
10
|
import { n as defineTable, t as defineAggregate } from "./schema-CaIuQCXb.mjs";
|
|
11
11
|
import { r as rangesIntersect } from "../_libs/verkit.mjs";
|
|
12
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/auth.server-
|
|
12
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/auth.server-NGj7G3bq.js
|
|
13
13
|
var SHA256_FILE_HASH_RE = /^[0-9a-f]{64}$/;
|
|
14
14
|
var isContentAddressedAssetFileHash = (value) => {
|
|
15
15
|
return typeof value === "string" && SHA256_FILE_HASH_RE.test(value);
|
|
@@ -926,6 +926,10 @@ var releases = defineTable({
|
|
|
926
926
|
all: {
|
|
927
927
|
eq: [],
|
|
928
928
|
sort: ["id"]
|
|
929
|
+
},
|
|
930
|
+
scopes: {
|
|
931
|
+
eq: [],
|
|
932
|
+
sort: ["scope_key"]
|
|
929
933
|
}
|
|
930
934
|
}
|
|
931
935
|
});
|
|
@@ -2319,6 +2323,12 @@ var pluginModule = ({ id, schema, namespace }) => ({
|
|
|
2319
2323
|
/** A row this attempt read changed while it ran; the attempt reruns. */
|
|
2320
2324
|
var StaleReadError = class extends Error {};
|
|
2321
2325
|
var idOf = (table, key) => JSON.stringify([table, key]);
|
|
2326
|
+
/** The aggregate rows a write changes, at the versions it read them. */
|
|
2327
|
+
var versionsOf = (ops) => JSON.stringify(ops.map((op) => op.type === "insert" ? [op.table.name, rowKey(op.table, op.row)] : [
|
|
2328
|
+
op.table.name,
|
|
2329
|
+
op.key,
|
|
2330
|
+
"guard" in op ? op.guard?.v : void 0
|
|
2331
|
+
]));
|
|
2322
2332
|
var versionOf = (row) => Number(row["_v"]);
|
|
2323
2333
|
var isKeyed = (value) => value !== null && value !== void 0;
|
|
2324
2334
|
var misuse = (table, message) => new DatabaseTransactionError(`${table}: ${message}`);
|
|
@@ -2661,7 +2671,9 @@ var createTransactions = ({ adapter, schema, reads, retry = {} }) => {
|
|
|
2661
2671
|
assertOutsideTransaction();
|
|
2662
2672
|
let run;
|
|
2663
2673
|
let negative;
|
|
2664
|
-
|
|
2674
|
+
let failures = 0;
|
|
2675
|
+
let lost;
|
|
2676
|
+
for (let round = 0;; round += 1) {
|
|
2665
2677
|
const delay = round && Math.min(maxDelayMs, baseDelayMs * 2 ** (round - 1));
|
|
2666
2678
|
if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay / 2 + Math.random() * (delay / 2)));
|
|
2667
2679
|
run ??= await attempt(fn).catch((error) => {
|
|
@@ -2670,6 +2682,8 @@ var createTransactions = ({ adapter, schema, reads, retry = {} }) => {
|
|
|
2670
2682
|
});
|
|
2671
2683
|
if (run === void 0) {
|
|
2672
2684
|
onRetry?.("rerun", round + 1);
|
|
2685
|
+
lost = void 0;
|
|
2686
|
+
if ((failures += 1) >= attempts) break;
|
|
2673
2687
|
continue;
|
|
2674
2688
|
}
|
|
2675
2689
|
let aggregates;
|
|
@@ -2680,8 +2694,14 @@ var createTransactions = ({ adapter, schema, reads, retry = {} }) => {
|
|
|
2680
2694
|
negative = error;
|
|
2681
2695
|
onRetry?.("rerun", round + 1);
|
|
2682
2696
|
run = void 0;
|
|
2697
|
+
lost = void 0;
|
|
2698
|
+
if ((failures += 1) >= attempts) break;
|
|
2683
2699
|
continue;
|
|
2684
2700
|
}
|
|
2701
|
+
const versions = versionsOf(aggregates);
|
|
2702
|
+
if (lost !== void 0 && versions !== lost) failures -= 1;
|
|
2703
|
+
lost = void 0;
|
|
2704
|
+
if (failures >= attempts) break;
|
|
2685
2705
|
const ops = [...run.ops, ...aggregates];
|
|
2686
2706
|
if (ops.length <= 1 && ops.every(({ type }) => type === "check")) return run.result;
|
|
2687
2707
|
if (!adapter.fits(ops)) throw new DatabaseConstraintError("too_large", ops[0].table.name);
|
|
@@ -2695,12 +2715,16 @@ var createTransactions = ({ adapter, schema, reads, retry = {} }) => {
|
|
|
2695
2715
|
const failed = "failedOp" in outcome ? outcome.failedOp : void 0;
|
|
2696
2716
|
if (failed === void 0 || failed >= run.ops.length) {
|
|
2697
2717
|
onRetry?.("resend", round + 1);
|
|
2718
|
+
failures += 1;
|
|
2719
|
+
if (failed !== void 0) lost = versions;
|
|
2720
|
+
else if (failures >= attempts) break;
|
|
2698
2721
|
continue;
|
|
2699
2722
|
}
|
|
2700
2723
|
const reason = await classify(ops[failed], run.read);
|
|
2701
2724
|
if (reason) throw new DatabaseConstraintError(reason, ops[failed].table.name);
|
|
2702
2725
|
onRetry?.("rerun", round + 1);
|
|
2703
2726
|
run = void 0;
|
|
2727
|
+
if ((failures += 1) >= attempts) break;
|
|
2704
2728
|
}
|
|
2705
2729
|
throw negative ?? new DatabaseConflictError(`The transaction conflicted ${attempts} times.`);
|
|
2706
2730
|
} };
|
|
@@ -3015,7 +3039,7 @@ var createEngine = (database, { plugins = [], now = Date.now } = {}) => {
|
|
|
3015
3039
|
flush: () => engine.flush()
|
|
3016
3040
|
};
|
|
3017
3041
|
};
|
|
3018
|
-
var HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.
|
|
3042
|
+
var HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.50";
|
|
3019
3043
|
/**
|
|
3020
3044
|
* `/version` on both mounts. The admin mount also lists the ids of the
|
|
3021
3045
|
* plugins the server runs, sorted; apps never learn which plugins a server
|
|
@@ -3167,10 +3191,15 @@ var releaseCatalogScopeKeyOf = (input) => input.strategy === "APP_VERSION" ? cre
|
|
|
3167
3191
|
platform: input.platform,
|
|
3168
3192
|
strategy: "FINGERPRINT"
|
|
3169
3193
|
});
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3194
|
+
var parseReleaseCatalogRow = ({ payload, ...row }) => ({
|
|
3195
|
+
row,
|
|
3196
|
+
compiled: parseCompiledCatalog(payload, row.strategy)
|
|
3197
|
+
});
|
|
3198
|
+
/** Projects a parsed catalog row for one update check; null when the row is not this scope's. */
|
|
3199
|
+
var projectParsedReleaseCatalogRow = (parsed, input, scopeKey = releaseCatalogScopeKeyOf(input)) => {
|
|
3200
|
+
if (parsed === null) return null;
|
|
3201
|
+
const { row, compiled } = parsed;
|
|
3202
|
+
if (row.platform !== input.platform || row.strategy !== input.strategy || row.channel_key !== input.channelKey || row.scope_key !== scopeKey || row.fingerprint_hash !== (input.strategy === "FINGERPRINT" ? input.fingerprintHash : null)) return null;
|
|
3174
3203
|
const appVersion = input.strategy === "APP_VERSION" ? input.appVersion : void 0;
|
|
3175
3204
|
return {
|
|
3176
3205
|
catalogId: row.catalog_id,
|
|
@@ -3183,6 +3212,8 @@ var projectReleaseCatalogRow = (row, input, scopeKey = releaseCatalogScopeKeyOf(
|
|
|
3183
3212
|
scopeKey
|
|
3184
3213
|
};
|
|
3185
3214
|
};
|
|
3215
|
+
/** Projects a stored catalog row for one update check; null when the row is not this scope's. */
|
|
3216
|
+
var projectReleaseCatalogRow = (row, input, scopeKey = releaseCatalogScopeKeyOf(input)) => projectParsedReleaseCatalogRow(row === null ? null : parseReleaseCatalogRow(row), input, scopeKey);
|
|
3186
3217
|
var HBC_ASSET_PATH_RE = /\.bundle$/;
|
|
3187
3218
|
var asByteSize = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : null;
|
|
3188
3219
|
var resolveUniqueHbcAssetPath = (manifest) => {
|
|
@@ -3528,7 +3559,7 @@ var after = (input) => {
|
|
|
3528
3559
|
};
|
|
3529
3560
|
return Object.keys(range).length === 0 ? {} : { range };
|
|
3530
3561
|
};
|
|
3531
|
-
/** Core's reads, each through one declared index or key
|
|
3562
|
+
/** Core's reads, each through one declared index or key; plugins get `CoreReads`. */
|
|
3532
3563
|
var createCoreReads = (db, storage) => {
|
|
3533
3564
|
/** A bundle row's patches, exactly as many as its reference counter holds. */
|
|
3534
3565
|
const detail = async (row) => {
|
|
@@ -3705,7 +3736,29 @@ var createCoreReads = (db, storage) => {
|
|
|
3705
3736
|
...after(input)
|
|
3706
3737
|
})).rows.map(toCatalogRow);
|
|
3707
3738
|
},
|
|
3708
|
-
async
|
|
3739
|
+
async listReleaseScopeKeys(input) {
|
|
3740
|
+
const scopeKeys = [];
|
|
3741
|
+
for (let last = input.after ?? ""; scopeKeys.length < input.limit;) {
|
|
3742
|
+
const { rows } = await db.findMany("releases", {
|
|
3743
|
+
index: "scopes",
|
|
3744
|
+
where: {},
|
|
3745
|
+
limit: 1,
|
|
3746
|
+
range: { gt: last }
|
|
3747
|
+
});
|
|
3748
|
+
if (rows[0] === void 0) break;
|
|
3749
|
+
last = rows[0].scope_key;
|
|
3750
|
+
scopeKeys.push(last);
|
|
3751
|
+
}
|
|
3752
|
+
return scopeKeys;
|
|
3753
|
+
},
|
|
3754
|
+
async listChannels(input) {
|
|
3755
|
+
if (input !== void 0) return (await db.findMany("channels", {
|
|
3756
|
+
index: "all",
|
|
3757
|
+
where: {},
|
|
3758
|
+
order: input.order ?? "asc",
|
|
3759
|
+
limit: input.limit,
|
|
3760
|
+
...after(input)
|
|
3761
|
+
})).rows.map(toChannelRow);
|
|
3709
3762
|
return (await drain((page) => db.findMany("channels", {
|
|
3710
3763
|
index: "all",
|
|
3711
3764
|
where: {},
|
|
@@ -3713,6 +3766,11 @@ var createCoreReads = (db, storage) => {
|
|
|
3713
3766
|
...page
|
|
3714
3767
|
}))).map(toChannelRow);
|
|
3715
3768
|
},
|
|
3769
|
+
async getChannels(ids) {
|
|
3770
|
+
const unique = [...new Set(ids)];
|
|
3771
|
+
if (unique.length === 0) return [];
|
|
3772
|
+
return (await db.findByKeys("channels", unique.map((id) => ({ id })))).flatMap((row) => row ? [toChannelRow(row)] : []);
|
|
3773
|
+
},
|
|
3716
3774
|
async findChannelByName(name) {
|
|
3717
3775
|
const row = await db.findOne("channels", { name });
|
|
3718
3776
|
return row === null ? null : toChannelRow(row);
|
|
@@ -4636,25 +4694,28 @@ var checkScope = (scope) => {
|
|
|
4636
4694
|
});
|
|
4637
4695
|
if (scope.strategy === "FINGERPRINT" !== (scope.fingerprintHash !== null) || scope.scopeKey !== expected) fail$1("INVALID_SCOPE", "Release catalog scope metadata is inconsistent");
|
|
4638
4696
|
};
|
|
4639
|
-
/**
|
|
4640
|
-
var
|
|
4697
|
+
/** Every row of a paged read, as release rows. */
|
|
4698
|
+
var drainReleases = async (page) => {
|
|
4641
4699
|
const rows = [];
|
|
4642
4700
|
let cursor;
|
|
4643
4701
|
do {
|
|
4644
|
-
const
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
scope_key: scopeKey,
|
|
4648
|
-
enabled: true
|
|
4649
|
-
},
|
|
4650
|
-
limit: PAGE,
|
|
4651
|
-
...cursor === void 0 ? {} : { cursor }
|
|
4652
|
-
});
|
|
4653
|
-
rows.push(...page.rows.map(toReleaseRow));
|
|
4654
|
-
cursor = page.next;
|
|
4702
|
+
const found = await page(cursor);
|
|
4703
|
+
rows.push(...found.rows.map((row) => toReleaseRow(row)));
|
|
4704
|
+
cursor = found.next;
|
|
4655
4705
|
} while (cursor !== void 0);
|
|
4656
4706
|
return rows;
|
|
4657
4707
|
};
|
|
4708
|
+
var enabledIn = (scopeKey, cursor) => ({
|
|
4709
|
+
index: "byScopeEnabled",
|
|
4710
|
+
where: {
|
|
4711
|
+
scope_key: scopeKey,
|
|
4712
|
+
enabled: true
|
|
4713
|
+
},
|
|
4714
|
+
limit: PAGE,
|
|
4715
|
+
...cursor === void 0 ? {} : { cursor }
|
|
4716
|
+
});
|
|
4717
|
+
/** A scope's enabled releases, all of them, under the catalog's guard. */
|
|
4718
|
+
var enabledReleases = (tx, scopeKey) => drainReleases((cursor) => tx.findMany("releases", enabledIn(scopeKey, cursor)));
|
|
4658
4719
|
/** The scope's newest release id: `byScope` descending, limit 1. */
|
|
4659
4720
|
var latestReleaseId = async (tx, scopeKey) => {
|
|
4660
4721
|
const { rows } = await tx.findMany("releases", {
|
|
@@ -4665,15 +4726,11 @@ var latestReleaseId = async (tx, scopeKey) => {
|
|
|
4665
4726
|
});
|
|
4666
4727
|
return rows[0]?.id ?? null;
|
|
4667
4728
|
};
|
|
4668
|
-
/**
|
|
4669
|
-
var
|
|
4670
|
-
const
|
|
4671
|
-
strategy: scope.strategy,
|
|
4672
|
-
releases: enabled.map(releaseRowToRelease)
|
|
4673
|
-
});
|
|
4674
|
-
const generation = (stored.generation ?? 0) + 1;
|
|
4729
|
+
/** The scope's next catalog generation, compiled as `compilation`. */
|
|
4730
|
+
var nextCatalog = (scope, stored, compilation, updatedAtMs) => {
|
|
4731
|
+
const generation = (stored.catalog?.generation ?? 0) + 1;
|
|
4675
4732
|
if (!Number.isSafeInteger(generation)) fail$1("CATALOG_GENERATION_EXHAUSTED", `Catalog "${scope.scopeKey}" exhausted its generation counter`);
|
|
4676
|
-
|
|
4733
|
+
return {
|
|
4677
4734
|
scope_key: scope.scopeKey,
|
|
4678
4735
|
catalog_id: stored.catalog?.catalog_id ?? createUUIDv7(),
|
|
4679
4736
|
strategy: scope.strategy,
|
|
@@ -4688,6 +4745,26 @@ var writeCatalog = async (tx, scope, stored, enabled, updatedAtMs) => {
|
|
|
4688
4745
|
is_tombstone: compilation.payload.releaseDescriptors.length === 0,
|
|
4689
4746
|
updated_at_ms: updatedAtMs
|
|
4690
4747
|
};
|
|
4748
|
+
};
|
|
4749
|
+
/**
|
|
4750
|
+
* Compiles a scope's enabled releases. A catalog over the size limit is
|
|
4751
|
+
* refused naming its channel and platform, and what frees room in it.
|
|
4752
|
+
*/
|
|
4753
|
+
var compileScope = async (scope, enabled) => {
|
|
4754
|
+
try {
|
|
4755
|
+
return await compileReleaseCatalog({
|
|
4756
|
+
strategy: scope.strategy,
|
|
4757
|
+
releases: enabled.map(releaseRowToRelease)
|
|
4758
|
+
});
|
|
4759
|
+
} catch (error) {
|
|
4760
|
+
if (!(error instanceof ReleaseCatalogCompilationError) || error.code !== "CATALOG_OVERSIZE") throw error;
|
|
4761
|
+
throw new ReleaseCatalogCompilationError("CATALOG_OVERSIZE", `The ${scope.platform} release catalog of channel "${scope.channelName}" would be over its ${MAX_COMPILED_CATALOG_BYTES / 1024} KiB limit.\nDisable or delete old bundles on that channel, then try again.`);
|
|
4762
|
+
}
|
|
4763
|
+
};
|
|
4764
|
+
/** Compiles `enabled` and writes it as the scope's next catalog generation. */
|
|
4765
|
+
var writeCatalog = async (tx, scope, stored, enabled, updatedAtMs) => {
|
|
4766
|
+
const compilation = await compileScope(scope, enabled);
|
|
4767
|
+
const catalog = nextCatalog(scope, stored, compilation, updatedAtMs);
|
|
4691
4768
|
const { scope_key: _scopeKey, ...set } = catalog;
|
|
4692
4769
|
if (stored.row === null) tx.create("release_catalogs", catalog);
|
|
4693
4770
|
else tx.update("release_catalogs", stored.row, set);
|
|
@@ -4775,18 +4852,48 @@ var changeReleases = (db, inputs) => {
|
|
|
4775
4852
|
return results;
|
|
4776
4853
|
});
|
|
4777
4854
|
};
|
|
4855
|
+
/** Whether `current` is what the scope's enabled releases compile to. */
|
|
4856
|
+
var isCurrent = (scope, current, compilation) => current.strategy === scope.strategy && current.channel_id === scope.channelId && current.channel_key === encodeChannelKey(scope.channelName) && current.platform === scope.platform && current.fingerprint_hash === scope.fingerprintHash && current.catalog_hash === compilation.catalogHash;
|
|
4857
|
+
/** The scope a catalog row names. */
|
|
4858
|
+
var catalogRowScope = (row) => ({
|
|
4859
|
+
channelId: row.channel_id,
|
|
4860
|
+
channelName: decodeChannelKey(row.channel_key),
|
|
4861
|
+
fingerprintHash: row.fingerprint_hash,
|
|
4862
|
+
platform: row.platform,
|
|
4863
|
+
scopeKey: row.scope_key,
|
|
4864
|
+
strategy: row.strategy
|
|
4865
|
+
});
|
|
4866
|
+
/**
|
|
4867
|
+
* What a rebuild of the scope's catalog would write, without writing: one
|
|
4868
|
+
* read of the catalog row and one of the scope's enabled releases. It needs
|
|
4869
|
+
* no transaction, whose guards would read the catalog again for each read
|
|
4870
|
+
* beneath it, nor the scope's newest release, which matters only to a scope
|
|
4871
|
+
* without a catalog row; that one is not found.
|
|
4872
|
+
*/
|
|
4873
|
+
var preflightRebuild = async (db, scopeKey, updatedAtMs) => {
|
|
4874
|
+
const row = await db.findOne("release_catalogs", { scope_key: scopeKey });
|
|
4875
|
+
if (row === null) throw new Error(`Release catalog "${scopeKey}" was not found.`);
|
|
4876
|
+
const current = toCatalogRow(row);
|
|
4877
|
+
const scope = catalogRowScope(current);
|
|
4878
|
+
checkScope(scope);
|
|
4879
|
+
const compilation = await compileScope(scope, await drainReleases((cursor) => db.findMany("releases", enabledIn(scopeKey, cursor))));
|
|
4880
|
+
const changed = !isCurrent(scope, current, compilation);
|
|
4881
|
+
return {
|
|
4882
|
+
changed,
|
|
4883
|
+
currentCatalog: current,
|
|
4884
|
+
diagnostics: compilation.diagnostics,
|
|
4885
|
+
projectedCatalog: changed ? nextCatalog(scope, { catalog: current }, compilation, updatedAtMs) : current
|
|
4886
|
+
};
|
|
4887
|
+
};
|
|
4778
4888
|
/** Recompiles a scope's catalog from its enabled releases inside `tx`; an unchanged catalog is not rewritten. */
|
|
4779
4889
|
var rebuildScope = async (tx, scope, updatedAtMs) => {
|
|
4780
4890
|
checkScope(scope);
|
|
4781
4891
|
const stored = await readCatalog(tx, scope.scopeKey);
|
|
4782
4892
|
assertHistory(stored, await latestReleaseId(tx, scope.scopeKey) !== null);
|
|
4783
4893
|
const enabled = await enabledReleases(tx, scope.scopeKey);
|
|
4784
|
-
const compilation = await
|
|
4785
|
-
strategy: scope.strategy,
|
|
4786
|
-
releases: enabled.map(releaseRowToRelease)
|
|
4787
|
-
});
|
|
4894
|
+
const compilation = await compileScope(scope, enabled);
|
|
4788
4895
|
const current = stored.catalog;
|
|
4789
|
-
if (current !== null &&
|
|
4896
|
+
if (current !== null && isCurrent(scope, current, compilation)) return {
|
|
4790
4897
|
catalog: current,
|
|
4791
4898
|
current,
|
|
4792
4899
|
changed: false,
|
|
@@ -4888,14 +4995,7 @@ var mutationResult = ({ catalog, release }) => ({
|
|
|
4888
4995
|
var catalogScope = async (tx, scopeKey) => {
|
|
4889
4996
|
const row = await tx.findOne("release_catalogs", { scope_key: scopeKey });
|
|
4890
4997
|
if (row === null) throw new Error(`Release catalog "${scopeKey}" was not found.`);
|
|
4891
|
-
return
|
|
4892
|
-
channelId: row.channel_id,
|
|
4893
|
-
channelName: decodeChannelKey(row.channel_key),
|
|
4894
|
-
fingerprintHash: row.fingerprint_hash,
|
|
4895
|
-
platform: row.platform,
|
|
4896
|
-
scopeKey: row.scope_key,
|
|
4897
|
-
strategy: row.strategy
|
|
4898
|
-
};
|
|
4998
|
+
return catalogRowScope(toCatalogRow(row));
|
|
4899
4999
|
};
|
|
4900
5000
|
/**
|
|
4901
5001
|
* Core's typed writes: each runs in one engine transaction rooted at the
|
|
@@ -5103,18 +5203,7 @@ var createCoreOperations = (db, { now = Date.now } = {}) => {
|
|
|
5103
5203
|
};
|
|
5104
5204
|
});
|
|
5105
5205
|
},
|
|
5106
|
-
preflightReleaseCatalogRebuild: (scopeKey) =>
|
|
5107
|
-
const updatedAtMs = now();
|
|
5108
|
-
return dryRun(db, async (tx) => {
|
|
5109
|
-
const rebuilt = await rebuildScope(tx, await catalogScope(tx, scopeKey), updatedAtMs);
|
|
5110
|
-
return {
|
|
5111
|
-
changed: rebuilt.changed,
|
|
5112
|
-
currentCatalog: rebuilt.current,
|
|
5113
|
-
diagnostics: rebuilt.diagnostics,
|
|
5114
|
-
projectedCatalog: rebuilt.catalog
|
|
5115
|
-
};
|
|
5116
|
-
});
|
|
5117
|
-
},
|
|
5206
|
+
preflightReleaseCatalogRebuild: (scopeKey) => preflightRebuild(db, scopeKey, now()),
|
|
5118
5207
|
ensureChannel,
|
|
5119
5208
|
deleteChannel: (id) => deleteChannel(db, id),
|
|
5120
5209
|
updateBundle: (id, update) => db.transaction(async (tx) => {
|
|
@@ -5375,6 +5464,10 @@ var answer = async (operation) => {
|
|
|
5375
5464
|
error: error.message
|
|
5376
5465
|
}, status);
|
|
5377
5466
|
}
|
|
5467
|
+
if (error instanceof ReleaseCatalogCompilationError && error.code === "CATALOG_OVERSIZE") return json({
|
|
5468
|
+
code: error.code,
|
|
5469
|
+
error: error.message
|
|
5470
|
+
}, 400);
|
|
5378
5471
|
if (error instanceof DatabaseBundleNotFoundError) return json({
|
|
5379
5472
|
code: "BUNDLE_NOT_FOUND",
|
|
5380
5473
|
error: error.message
|
|
@@ -5394,9 +5487,11 @@ var LIMITS = {
|
|
|
5394
5487
|
defaultValue: 50,
|
|
5395
5488
|
maxValue: 500
|
|
5396
5489
|
};
|
|
5490
|
+
/** The most IDs one request names: a lookup's, or a write's. */
|
|
5491
|
+
var MAX_IDS = 100;
|
|
5397
5492
|
/** `order`, `cursor`, and `limit`: one keyset page. */
|
|
5398
|
-
var keyset = (url, maxValue = LIMITS.maxValue) => {
|
|
5399
|
-
const order = url.searchParams.get("order") ??
|
|
5493
|
+
var keyset = (url, maxValue = LIMITS.maxValue, defaultOrder = "desc") => {
|
|
5494
|
+
const order = url.searchParams.get("order") ?? defaultOrder;
|
|
5400
5495
|
if (order !== "asc" && order !== "desc") throw new HandlerBadRequestError("order must be 'asc' or 'desc'.");
|
|
5401
5496
|
const limitParam = url.searchParams.get("limit");
|
|
5402
5497
|
const limit = limitParam === null ? Math.min(LIMITS.defaultValue, maxValue) : Number(limitParam);
|
|
@@ -5590,11 +5685,32 @@ var createAdminRouteHandlers = () => ({
|
|
|
5590
5685
|
const input = keyset(new URL(request.url));
|
|
5591
5686
|
return page(await core.listReleaseCatalogs(input), input, (row) => row.scope_key);
|
|
5592
5687
|
}),
|
|
5688
|
+
listReleaseScopeKeys: onCore(async (core, request) => {
|
|
5689
|
+
const input = keyset(new URL(request.url), 100, "asc");
|
|
5690
|
+
if (input.order !== "asc" || input.through !== void 0) throw new HandlerBadRequestError("Release scopes are listed ascending, by limit and cursor only.");
|
|
5691
|
+
return page(await core.listReleaseScopeKeys({
|
|
5692
|
+
limit: input.limit,
|
|
5693
|
+
...input.after === void 0 ? {} : { after: input.after }
|
|
5694
|
+
}), input, (scopeKey) => scopeKey);
|
|
5695
|
+
}),
|
|
5593
5696
|
getChannels: onCore(async (core, request) => {
|
|
5594
|
-
const
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5697
|
+
const url = new URL(request.url);
|
|
5698
|
+
const name = url.searchParams.get("name");
|
|
5699
|
+
if (name !== null) {
|
|
5700
|
+
const channel = await core.findChannelByName(name);
|
|
5701
|
+
return channel === null ? notFound() : json({ data: channel });
|
|
5702
|
+
}
|
|
5703
|
+
const ids = url.searchParams.get("ids");
|
|
5704
|
+
if (ids !== null) {
|
|
5705
|
+
const list = ids.split(",").filter((id) => id.length > 0);
|
|
5706
|
+
if (list.length === 0 || list.length > MAX_IDS) throw new HandlerBadRequestError(`Channels by ID take ids=<channel id>,... with 1 to ${MAX_IDS} ids.`);
|
|
5707
|
+
return json({ data: await core.getChannels(list) });
|
|
5708
|
+
}
|
|
5709
|
+
if (url.searchParams.has("limit") || url.searchParams.has("cursor")) {
|
|
5710
|
+
const input = keyset(url, LIMITS.maxValue, "asc");
|
|
5711
|
+
return page(await core.listChannels(input), input, (row) => row.name);
|
|
5712
|
+
}
|
|
5713
|
+
return json({ data: await core.listChannels() });
|
|
5598
5714
|
}),
|
|
5599
5715
|
createChannel: onCore(async (core, request) => {
|
|
5600
5716
|
const { name } = await body(request);
|
|
@@ -5642,7 +5758,7 @@ var createAdminRouteHandlers = () => ({
|
|
|
5642
5758
|
countBundles: onCore(async (core, request) => json({ data: await core.countBundles(platformOf(new URL(request.url))) })),
|
|
5643
5759
|
countBundleChildren: onCore(async (core, request) => {
|
|
5644
5760
|
const ids = (new URL(request.url).searchParams.get("ids") ?? "").split(",").filter((id) => id.length > 0);
|
|
5645
|
-
if (ids.length === 0 || ids.length >
|
|
5761
|
+
if (ids.length === 0 || ids.length > MAX_IDS) throw new HandlerBadRequestError(`Bundle child counts take ids=<bundle id>,... with 1 to ${MAX_IDS} ids.`);
|
|
5646
5762
|
return json({ data: await core.countBundleChildren(ids) });
|
|
5647
5763
|
}),
|
|
5648
5764
|
listBundleChildren: onCore(async (core, request, params) => {
|
|
@@ -5783,6 +5899,7 @@ var createAdminRouteHandlers = () => ({
|
|
|
5783
5899
|
markIosDevicesInBuild: onCore(async (core, request) => {
|
|
5784
5900
|
const { buildId, ids } = await body(request);
|
|
5785
5901
|
if (!isText(buildId) || !Array.isArray(ids) || !ids.every((id) => isText(id))) throw new HandlerBadRequestError("Marking iOS devices in a build needs buildId and ids.");
|
|
5902
|
+
if (ids.length > MAX_IDS) throw new HandlerBadRequestError(`Marking iOS devices in a build takes at most ${MAX_IDS} ids a request.`);
|
|
5786
5903
|
await core.markIosDevicesInBuild({
|
|
5787
5904
|
buildId,
|
|
5788
5905
|
ids
|
|
@@ -5853,6 +5970,11 @@ var ADMIN_ROUTES = [
|
|
|
5853
5970
|
path: "/release-catalogs",
|
|
5854
5971
|
handler: "listReleaseCatalogs"
|
|
5855
5972
|
},
|
|
5973
|
+
{
|
|
5974
|
+
method: "GET",
|
|
5975
|
+
path: "/release-scopes",
|
|
5976
|
+
handler: "listReleaseScopeKeys"
|
|
5977
|
+
},
|
|
5856
5978
|
{
|
|
5857
5979
|
method: "POST",
|
|
5858
5980
|
path: "/release-catalogs/:scopeKey/rebuild",
|
|
@@ -6032,9 +6154,9 @@ var CATALOG_CACHE_CONTROL = "public, max-age=0, s-maxage=5";
|
|
|
6032
6154
|
* background. `stale-if-error=0` keeps origin errors visible: without it,
|
|
6033
6155
|
* Cloudflare serves a stale copy on error indefinitely.
|
|
6034
6156
|
*
|
|
6035
|
-
* A device can see a catalog
|
|
6036
|
-
* replaced it: the origin's 5-second catalog
|
|
6037
|
-
* 5 stale at the CDN. A revoked API key can read a cached catalog up to
|
|
6157
|
+
* A device can see a catalog, or a scope's lack of one, up to 15 seconds
|
|
6158
|
+
* after a deploy or a Roll back replaced it: the origin's 5-second catalog
|
|
6159
|
+
* memo, then 5 seconds fresh and 5 stale at the CDN. A revoked API key can read a cached catalog up to
|
|
6038
6160
|
* 10 seconds. Devices and caches that don't read the header keep
|
|
6039
6161
|
* `Cache-Control`.
|
|
6040
6162
|
*/
|
|
@@ -6113,38 +6235,52 @@ var catalogResponse = async (catalog, request) => {
|
|
|
6113
6235
|
};
|
|
6114
6236
|
var createReleaseCatalogRouteHandlers = () => {
|
|
6115
6237
|
const cache = /* @__PURE__ */ new Map();
|
|
6238
|
+
const evict = (insertedHit) => {
|
|
6239
|
+
const now = Date.now();
|
|
6240
|
+
let oldestMiss;
|
|
6241
|
+
let oldest;
|
|
6242
|
+
for (const [key, entry] of cache) if (entry.expiresAt <= now) cache.delete(key);
|
|
6243
|
+
else {
|
|
6244
|
+
if (entry.row === null) oldestMiss ??= key;
|
|
6245
|
+
oldest ??= key;
|
|
6246
|
+
}
|
|
6247
|
+
if (cache.size <= ORIGIN_CACHE_MAX_ENTRIES) return;
|
|
6248
|
+
const victim = oldestMiss ?? (insertedHit ? oldest : void 0);
|
|
6249
|
+
if (victim !== void 0) cache.delete(victim);
|
|
6250
|
+
};
|
|
6116
6251
|
const inFlight = /* @__PURE__ */ new Map();
|
|
6117
|
-
const
|
|
6118
|
-
const cached = cache.get(
|
|
6252
|
+
const loadRow = async (scopeKey, load) => {
|
|
6253
|
+
const cached = cache.get(scopeKey);
|
|
6119
6254
|
if (cached !== void 0 && cached.expiresAt > Date.now()) {
|
|
6120
|
-
cache.delete(
|
|
6121
|
-
cache.set(
|
|
6122
|
-
return cached.
|
|
6255
|
+
cache.delete(scopeKey);
|
|
6256
|
+
cache.set(scopeKey, cached);
|
|
6257
|
+
return cached.row;
|
|
6123
6258
|
}
|
|
6124
|
-
if (cached !== void 0) cache.delete(
|
|
6125
|
-
const pending = inFlight.get(
|
|
6259
|
+
if (cached !== void 0) cache.delete(scopeKey);
|
|
6260
|
+
const pending = inFlight.get(scopeKey);
|
|
6126
6261
|
if (pending !== void 0) return pending;
|
|
6127
|
-
const next = load().then((
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
const oldestKey = cache.keys().next().value;
|
|
6135
|
-
if (oldestKey === void 0) break;
|
|
6136
|
-
cache.delete(oldestKey);
|
|
6137
|
-
}
|
|
6138
|
-
}
|
|
6139
|
-
return catalog;
|
|
6262
|
+
const next = load().then((row) => {
|
|
6263
|
+
cache.set(scopeKey, {
|
|
6264
|
+
row,
|
|
6265
|
+
expiresAt: Date.now() + ORIGIN_CACHE_TTL_MS
|
|
6266
|
+
});
|
|
6267
|
+
if (cache.size > ORIGIN_CACHE_MAX_ENTRIES) evict(row !== null);
|
|
6268
|
+
return row;
|
|
6140
6269
|
});
|
|
6141
|
-
inFlight.set(
|
|
6270
|
+
inFlight.set(scopeKey, next);
|
|
6142
6271
|
try {
|
|
6143
6272
|
return await next;
|
|
6144
6273
|
} finally {
|
|
6145
|
-
inFlight.delete(
|
|
6274
|
+
inFlight.delete(scopeKey);
|
|
6146
6275
|
}
|
|
6147
6276
|
};
|
|
6277
|
+
const loadCatalog = async (core, input) => {
|
|
6278
|
+
const scopeKey = releaseCatalogScopeKeyOf(input);
|
|
6279
|
+
return projectParsedReleaseCatalogRow(await loadRow(scopeKey, async () => {
|
|
6280
|
+
const row = await core.getReleaseCatalogRow(scopeKey);
|
|
6281
|
+
return row === null ? null : parseReleaseCatalogRow(row);
|
|
6282
|
+
}), input, scopeKey);
|
|
6283
|
+
};
|
|
6148
6284
|
return {
|
|
6149
6285
|
appVersionReleaseCatalog: async (params, request, { core }) => {
|
|
6150
6286
|
const rawAppVersion = requireRouteParam(params, "appVersion");
|
|
@@ -6158,7 +6294,7 @@ var createReleaseCatalogRouteHandlers = () => {
|
|
|
6158
6294
|
};
|
|
6159
6295
|
const invalid = invalidScope(input);
|
|
6160
6296
|
if (invalid) return invalid;
|
|
6161
|
-
return catalogResponse(await loadCatalog(
|
|
6297
|
+
return catalogResponse(await loadCatalog(core, input), request);
|
|
6162
6298
|
},
|
|
6163
6299
|
fingerprintReleaseCatalog: async (params, request, { core }) => {
|
|
6164
6300
|
const input = {
|
|
@@ -6169,7 +6305,7 @@ var createReleaseCatalogRouteHandlers = () => {
|
|
|
6169
6305
|
};
|
|
6170
6306
|
const invalid = invalidScope(input);
|
|
6171
6307
|
if (invalid) return invalid;
|
|
6172
|
-
return catalogResponse(await loadCatalog(
|
|
6308
|
+
return catalogResponse(await loadCatalog(core, input), request);
|
|
6173
6309
|
},
|
|
6174
6310
|
artifactV2: async (params, _request, { core }) => {
|
|
6175
6311
|
const info = await core.getArtifactInfo(requireRouteParam(params, "targetBundleId"), requireRouteParam(params, "currentBundleId"), 2);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../_runtime.mjs";
|
|
2
2
|
import { Et as require_react, Tt as require_jsx_runtime, ft as useRender, wt as mergeProps } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
3
|
import { t as cva } from "../_libs/class-variance-authority+clsx.mjs";
|
|
4
|
-
import { k as cn } from "./sidebar-
|
|
4
|
+
import { k as cn } from "./sidebar-DQkRAO_e.mjs";
|
|
5
5
|
require_react();
|
|
6
6
|
var import_jsx_runtime = require_jsx_runtime();
|
|
7
7
|
var alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-lg border px-2 py-1.5 text-left text-xs/relaxed has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-1.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-3.5", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../_runtime.mjs";
|
|
2
2
|
import { Et as require_react, Tt as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
|
-
import { k as cn } from "./sidebar-
|
|
3
|
+
import { k as cn } from "./sidebar-DQkRAO_e.mjs";
|
|
4
4
|
require_react();
|
|
5
5
|
var import_jsx_runtime = require_jsx_runtime();
|
|
6
6
|
function Card({ className, ...props }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getRequest } from "./server-
|
|
2
|
-
import { requireConsoleAccess, t as resolveConsoleConfig } from "./auth.server-
|
|
3
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/config.server-
|
|
1
|
+
import { i as getRequest } from "./server-Dyw2qgSR.mjs";
|
|
2
|
+
import { requireConsoleAccess, t as resolveConsoleConfig } from "./auth.server-NGj7G3bq.mjs";
|
|
3
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/config.server-CwUGPk-F.js
|
|
4
4
|
var configPromise = null;
|
|
5
5
|
var core = null;
|
|
6
6
|
var runtime = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as createMiddleware } from "./createMiddleware-C3ACsfuG.mjs";
|
|
2
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/console-access-
|
|
2
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/console-access-BOt-Xxd7.js
|
|
3
3
|
/**
|
|
4
4
|
* Refuses a caller the console does not authorize before a server function
|
|
5
5
|
* reads its input. TanStack Start runs a function's middleware before the
|
|
@@ -9,7 +9,7 @@ import { t as createMiddleware } from "./createMiddleware-C3ACsfuG.mjs";
|
|
|
9
9
|
* `console-access.spec.ts` checks that.
|
|
10
10
|
*/
|
|
11
11
|
var consoleAccess = createMiddleware({ type: "function" }).server(async ({ next }) => {
|
|
12
|
-
const [{ getRequest }, { requireConsoleAccess }] = await Promise.all([import("../_libs/_.mjs").then((n) => n.t), import("./auth.server-
|
|
12
|
+
const [{ getRequest }, { requireConsoleAccess }] = await Promise.all([import("../_libs/_.mjs").then((n) => n.t), import("./auth.server-NGj7G3bq.mjs")]);
|
|
13
13
|
await requireConsoleAccess(getRequest());
|
|
14
14
|
return next();
|
|
15
15
|
});
|
package/.output/server/_ssr/{console-features-api-B2p2oFYe.mjs → console-features-api-Dw_Tktev.mjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as consoleFeatures } from "./console-features-DTYyXrWO.mjs";
|
|
2
2
|
import { l as createServerFn } from "./createServerFn-AQvBMBjJ.mjs";
|
|
3
|
-
import { A as createSsrRpc } from "./sidebar-
|
|
4
|
-
import { t as consoleAccess } from "./console-access-
|
|
3
|
+
import { A as createSsrRpc } from "./sidebar-DQkRAO_e.mjs";
|
|
4
|
+
import { t as consoleAccess } from "./console-access-BOt-Xxd7.mjs";
|
|
5
5
|
import { v as notFound } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
6
6
|
import { i as useQuery, r as queryOptions } from "../_libs/tanstack__react-query.mjs";
|
|
7
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/console-features-api-
|
|
7
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/console-features-api-Dw_Tktev.js
|
|
8
8
|
/** The features this console serves, for navigation and route guards. */
|
|
9
9
|
var getConsoleFeaturesRpc = createServerFn({ method: "GET" }).middleware([consoleAccess]).handler(createSsrRpc("82ec3500e57f9e81dac6d3f3a7bd9e34915da3121429beec87b7ad153dc6eafe"));
|
|
10
10
|
var consoleFeaturesQueryKey = ["console", "features"];
|
package/.output/server/_ssr/{console-features-rpc-CbPZspBL.mjs → console-features-rpc-D8VFHwYj.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { l as createServerFn } from "./createServerFn-AQvBMBjJ.mjs";
|
|
2
|
-
import { t as consoleAccess } from "./console-access-
|
|
2
|
+
import { t as consoleAccess } from "./console-access-BOt-Xxd7.mjs";
|
|
3
3
|
import { t as createServerRpc } from "./createServerRpc-DJZel12M.mjs";
|
|
4
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/console-features-rpc-
|
|
4
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/console-features-rpc-D8VFHwYj.js
|
|
5
5
|
var getConsoleFeaturesRpc_createServerFn_handler = createServerRpc({
|
|
6
6
|
id: "82ec3500e57f9e81dac6d3f3a7bd9e34915da3121429beec87b7ad153dc6eafe",
|
|
7
7
|
name: "getConsoleFeaturesRpc",
|
|
8
8
|
filename: "src/lib/console-features-rpc.ts"
|
|
9
9
|
}, (opts) => getConsoleFeaturesRpc.__executeServer(opts));
|
|
10
10
|
var getConsoleFeaturesRpc = createServerFn({ method: "GET" }).middleware([consoleAccess]).handler(getConsoleFeaturesRpc_createServerFn_handler, async () => {
|
|
11
|
-
const { prepareConfig } = await import("./config.server-
|
|
11
|
+
const { prepareConfig } = await import("./config.server-CwUGPk-F.mjs");
|
|
12
12
|
const { runtime } = await prepareConfig();
|
|
13
13
|
return {
|
|
14
14
|
features: await runtime.features(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/constants-
|
|
1
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/constants-D-2jpCiJ.js
|
|
2
2
|
/**
|
|
3
3
|
* The channel the SDK and the CLI use when none is chosen. Insights, Bundles,
|
|
4
4
|
* and Native builds open on it when the URL names no channel.
|
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
var DEFAULT_CHANNEL = "production";
|
|
7
7
|
/** The channel filter's choice that lists every channel, on every page. */
|
|
8
8
|
var ALL_CHANNELS_LABEL = "All channels";
|
|
9
|
+
var CONSOLE_GIT_URL_GUIDE_URL = "https://hot-updater.dev/docs/guides/console#git-url";
|
|
9
10
|
//#endregion
|
|
10
|
-
export {
|
|
11
|
+
export { CONSOLE_GIT_URL_GUIDE_URL as n, DEFAULT_CHANNEL as r, ALL_CHANNELS_LABEL as t };
|