@hot-updater/vercel 1.2.0-rc.50 → 1.2.0-rc.52
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/dist/function/index.mjs +661 -67
- package/dist/index.cjs +15 -9
- package/dist/index.mjs +15 -9
- package/dist/init/index.cjs +1 -0
- package/dist/init/index.mjs +2 -1
- package/package.json +7 -7
package/dist/function/index.mjs
CHANGED
|
@@ -615,7 +615,8 @@ const releaseRowToRelease = (row) => ({
|
|
|
615
615
|
operation: row.operation,
|
|
616
616
|
sourceReleaseId: row.source_release_id,
|
|
617
617
|
createdAtMs: row.created_at_ms,
|
|
618
|
-
updatedAtMs: row.updated_at_ms
|
|
618
|
+
updatedAtMs: row.updated_at_ms,
|
|
619
|
+
label: row.label ?? null
|
|
619
620
|
});
|
|
620
621
|
const bundleToRow = (bundle) => {
|
|
621
622
|
const metadata = bundleMetadataToRow(bundle.metadata);
|
|
@@ -1124,7 +1125,7 @@ function rangeToIntervals(range) {
|
|
|
1124
1125
|
throw new ReleaseCatalogCompilationError("INVALID_TARGET_RANGE", `Invalid target app-version range: ${range}`);
|
|
1125
1126
|
}
|
|
1126
1127
|
}
|
|
1127
|
-
function releaseDescriptor(release) {
|
|
1128
|
+
function releaseDescriptor(release, labels) {
|
|
1128
1129
|
return {
|
|
1129
1130
|
releaseId: release.id,
|
|
1130
1131
|
kind: release.kind,
|
|
@@ -1132,7 +1133,8 @@ function releaseDescriptor(release) {
|
|
|
1132
1133
|
rolloutCohortCount: release.rolloutCohortCount,
|
|
1133
1134
|
targetCohorts: [...new Set(release.targetCohorts)].sort(),
|
|
1134
1135
|
shouldForceUpdate: release.shouldForceUpdate,
|
|
1135
|
-
message: release.message
|
|
1136
|
+
message: release.message,
|
|
1137
|
+
...labels && typeof release.label === "number" ? { label: release.label } : {}
|
|
1136
1138
|
};
|
|
1137
1139
|
}
|
|
1138
1140
|
function validateReleases(releases, strategy) {
|
|
@@ -1340,17 +1342,84 @@ function canonicalStringify(value) {
|
|
|
1340
1342
|
const record = value;
|
|
1341
1343
|
return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${canonicalStringify(record[key])}`).join(",")}}`;
|
|
1342
1344
|
}
|
|
1345
|
+
const BOUND_SHAPE = {
|
|
1346
|
+
inclusive: null,
|
|
1347
|
+
version: null
|
|
1348
|
+
};
|
|
1349
|
+
const COMPILED_CATALOG_SHAPE = {
|
|
1350
|
+
fallbackPolicy: null,
|
|
1351
|
+
schemaVersion: null,
|
|
1352
|
+
strategy: null,
|
|
1353
|
+
releaseIndexes: null,
|
|
1354
|
+
rollbackReleaseIndexes: null,
|
|
1355
|
+
segments: {
|
|
1356
|
+
lower: BOUND_SHAPE,
|
|
1357
|
+
upper: BOUND_SHAPE,
|
|
1358
|
+
releaseIndexes: null,
|
|
1359
|
+
rollbackReleaseIndexes: null
|
|
1360
|
+
},
|
|
1361
|
+
releaseDescriptors: {
|
|
1362
|
+
releaseId: null,
|
|
1363
|
+
kind: null,
|
|
1364
|
+
bundleId: null,
|
|
1365
|
+
rolloutCohortCount: null,
|
|
1366
|
+
targetCohorts: null,
|
|
1367
|
+
shouldForceUpdate: null,
|
|
1368
|
+
message: null,
|
|
1369
|
+
label: null
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
function readCompiledCatalogPayload(payload) {
|
|
1373
|
+
let fromLaterRelease = false;
|
|
1374
|
+
const known = (value, shape) => {
|
|
1375
|
+
if (Array.isArray(value)) return value.map((item) => known(item, shape));
|
|
1376
|
+
if (value === null || typeof value !== "object") return value;
|
|
1377
|
+
const entries = Object.entries(value).filter(([key]) => {
|
|
1378
|
+
if (Object.hasOwn(shape, key)) return true;
|
|
1379
|
+
fromLaterRelease = true;
|
|
1380
|
+
return false;
|
|
1381
|
+
});
|
|
1382
|
+
return Object.fromEntries(entries.map(([key, entry]) => {
|
|
1383
|
+
const inner = shape[key];
|
|
1384
|
+
return [key, inner === null ? entry : known(entry, inner)];
|
|
1385
|
+
}));
|
|
1386
|
+
};
|
|
1387
|
+
let parsed;
|
|
1388
|
+
try {
|
|
1389
|
+
parsed = JSON.parse(payload);
|
|
1390
|
+
} catch {
|
|
1391
|
+
parsed = null;
|
|
1392
|
+
}
|
|
1393
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return {
|
|
1394
|
+
canonicalPayload: payload,
|
|
1395
|
+
fromLaterRelease: false
|
|
1396
|
+
};
|
|
1397
|
+
if ("schemaVersion" in parsed && typeof parsed.schemaVersion === "number" && parsed.schemaVersion > 1) fromLaterRelease = true;
|
|
1398
|
+
return {
|
|
1399
|
+
canonicalPayload: canonicalStringify(known(parsed, COMPILED_CATALOG_SHAPE)),
|
|
1400
|
+
fromLaterRelease
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1343
1403
|
async function compileReleaseCatalog(input) {
|
|
1344
1404
|
const releases = validateReleases(input.releases, input.strategy);
|
|
1345
1405
|
const targetCohorts = new Set(releases.flatMap((release) => release.targetCohorts));
|
|
1346
1406
|
if (targetCohorts.size > 512) throw new ReleaseCatalogCompilationError("DISTINCT_TARGET_COHORT_LIMIT", `Scope exceeds 512 distinct target cohorts`);
|
|
1347
1407
|
const { envelope, retainedReleases } = input.strategy === "APP_VERSION" ? compileAppVersion(releases) : compileFingerprint(releases);
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1350
|
-
|
|
1408
|
+
const compile = (labels) => {
|
|
1409
|
+
const payload = {
|
|
1410
|
+
...envelope,
|
|
1411
|
+
releaseDescriptors: retainedReleases.map((release) => releaseDescriptor(release, labels))
|
|
1412
|
+
};
|
|
1413
|
+
const canonicalPayload = canonicalStringify(payload);
|
|
1414
|
+
return {
|
|
1415
|
+
payload,
|
|
1416
|
+
canonicalPayload,
|
|
1417
|
+
byteSize: new TextEncoder().encode(canonicalPayload).byteLength
|
|
1418
|
+
};
|
|
1351
1419
|
};
|
|
1352
|
-
|
|
1353
|
-
|
|
1420
|
+
let compiled = compile(true);
|
|
1421
|
+
if (compiled.byteSize > 262144 && retainedReleases.some((release) => typeof release.label === "number")) compiled = compile(false);
|
|
1422
|
+
const { payload, canonicalPayload, byteSize } = compiled;
|
|
1354
1423
|
if (byteSize > 262144) throw new ReleaseCatalogCompilationError("CATALOG_OVERSIZE", `Compiled Release catalog is ${byteSize} bytes; maximum is ${MAX_COMPILED_CATALOG_BYTES}`);
|
|
1355
1424
|
return {
|
|
1356
1425
|
byteSize,
|
|
@@ -1863,6 +1932,18 @@ const SETTINGS_TABLE = {
|
|
|
1863
1932
|
};
|
|
1864
1933
|
const ENGINE_SCHEMA_KEY = "schema.engine";
|
|
1865
1934
|
const CORE_SCHEMA_KEY = "schema.core";
|
|
1935
|
+
const compareVersions = (left, right) => {
|
|
1936
|
+
const parse = (version) => /^\d+(?:\.\d+)*$/u.test(version) ? version.split(".").map(Number) : [NaN];
|
|
1937
|
+
const [a, b] = [parse(left), parse(right)];
|
|
1938
|
+
if ([...a, ...b].some(Number.isNaN)) return NaN;
|
|
1939
|
+
for (let index = 0; index < Math.max(a.length, b.length); index += 1) {
|
|
1940
|
+
const difference = (a[index] ?? 0) - (b[index] ?? 0);
|
|
1941
|
+
if (difference !== 0) return difference;
|
|
1942
|
+
}
|
|
1943
|
+
return 0;
|
|
1944
|
+
};
|
|
1945
|
+
const newerCore = (settings) => settings.find(({ key, expected, found }) => key === CORE_SCHEMA_KEY && found !== null && compareVersions(found, expected) > 0);
|
|
1946
|
+
const newerMessage = (adapterName, { key, expected, found }) => `Hot Updater schema setting "${key}" for ${adapterName} is "${found}"; expected "${expected}". The database was migrated by Hot Updater ${found}: upgrade hot-updater and the @hot-updater packages to ${found} or later.`;
|
|
1866
1947
|
const stored = ({ key, expected, found }) => `"${key}" is ${found === null ? "missing" : `"${found}"`}; expected "${expected}"`;
|
|
1867
1948
|
const MIGRATE_SCHEMA_FIX = "Run `npx hot-updater doctor` in the project whose hot-updater.config.ts names this database: it names the command that migrates it. In a server project, `hot-updater db migrate` migrates the database its server file names.";
|
|
1868
1949
|
const settingMessage = (adapterName, { key, expected, found }) => `Hot Updater schema setting "${key}" for ${adapterName} is ${found === null ? "missing" : `"${found}"`}; expected "${expected}". ${MIGRATE_SCHEMA_FIX}`;
|
|
@@ -1879,7 +1960,8 @@ var HotUpdaterSchemaMigrationRequiredError = class extends Error {
|
|
|
1879
1960
|
constructor(adapterName, currentVersion, setting, options) {
|
|
1880
1961
|
const settings = options?.settings ?? (setting === void 0 ? [] : [setting]);
|
|
1881
1962
|
const plugins = settings.flatMap((mismatch) => pluginOf(mismatch) ?? []);
|
|
1882
|
-
|
|
1963
|
+
const newer = newerCore(settings);
|
|
1964
|
+
super(newer !== void 0 ? newerMessage(adapterName, newer) : setting === void 0 ? currentVersion === void 0 ? `Hot Updater database schema is not initialized for ${adapterName}. ${MIGRATE_SCHEMA_FIX}` : `Hot Updater v1 cannot migrate schema ${currentVersion} in place. Create a new empty database and run \`hot-updater db migrate\`.` : plugins.length > 0 && plugins.length === settings.length ? pluginsMessage(adapterName, plugins, settings, options?.fix ?? MIGRATE_SCHEMA_FIX) : settings.length > 1 && !(setting.key === "schema.engine" && setting.found === null) ? settingsMessage(adapterName, settings) : settingMessage(adapterName, setting), options?.cause === void 0 ? void 0 : { cause: options.cause });
|
|
1883
1965
|
this.adapterName = adapterName;
|
|
1884
1966
|
this.currentVersion = currentVersion;
|
|
1885
1967
|
this.setting = setting;
|
|
@@ -2274,7 +2356,11 @@ const releases = defineTable({
|
|
|
2274
2356
|
}
|
|
2275
2357
|
},
|
|
2276
2358
|
created_at_ms: { type: "integer" },
|
|
2277
|
-
updated_at_ms: { type: "integer" }
|
|
2359
|
+
updated_at_ms: { type: "integer" },
|
|
2360
|
+
label: {
|
|
2361
|
+
type: "integer",
|
|
2362
|
+
required: false
|
|
2363
|
+
}
|
|
2278
2364
|
}, {
|
|
2279
2365
|
key: ["id"],
|
|
2280
2366
|
indexes: {
|
|
@@ -2311,6 +2397,15 @@ const releases = defineTable({
|
|
|
2311
2397
|
scopes: {
|
|
2312
2398
|
eq: [],
|
|
2313
2399
|
sort: ["scope_key"]
|
|
2400
|
+
},
|
|
2401
|
+
byLabel: {
|
|
2402
|
+
eq: [
|
|
2403
|
+
"channel_id",
|
|
2404
|
+
"platform",
|
|
2405
|
+
"label"
|
|
2406
|
+
],
|
|
2407
|
+
sort: [],
|
|
2408
|
+
unique: true
|
|
2314
2409
|
}
|
|
2315
2410
|
}
|
|
2316
2411
|
});
|
|
@@ -2318,6 +2413,25 @@ const LATE_INDEXES = [{
|
|
|
2318
2413
|
table: "releases",
|
|
2319
2414
|
index: "scopes"
|
|
2320
2415
|
}];
|
|
2416
|
+
const LATE_COLUMNS = [{
|
|
2417
|
+
table: "releases",
|
|
2418
|
+
column: "label"
|
|
2419
|
+
}];
|
|
2420
|
+
const labelSequences = defineTable({
|
|
2421
|
+
id: {
|
|
2422
|
+
type: "string",
|
|
2423
|
+
maxLength: 1440,
|
|
2424
|
+
ascii: true
|
|
2425
|
+
},
|
|
2426
|
+
last_label: { type: "integer" },
|
|
2427
|
+
is_filled: { type: "boolean" }
|
|
2428
|
+
}, {
|
|
2429
|
+
key: ["id"],
|
|
2430
|
+
indexes: { all: {
|
|
2431
|
+
eq: [],
|
|
2432
|
+
sort: ["id"]
|
|
2433
|
+
} }
|
|
2434
|
+
});
|
|
2321
2435
|
const releaseCatalogs = defineTable({
|
|
2322
2436
|
scope_key: {
|
|
2323
2437
|
type: "string",
|
|
@@ -2624,7 +2738,8 @@ const coreModule = {
|
|
|
2624
2738
|
}),
|
|
2625
2739
|
native_builds: nativeBuilds,
|
|
2626
2740
|
ios_devices: iosDevices,
|
|
2627
|
-
ios_device_account: iosDeviceAccount
|
|
2741
|
+
ios_device_account: iosDeviceAccount,
|
|
2742
|
+
label_sequences: labelSequences
|
|
2628
2743
|
}
|
|
2629
2744
|
};
|
|
2630
2745
|
//#endregion
|
|
@@ -2635,6 +2750,58 @@ const getEmptyMigrationResult = () => ({
|
|
|
2635
2750
|
getSQL: () => ""
|
|
2636
2751
|
});
|
|
2637
2752
|
//#endregion
|
|
2753
|
+
//#region ../plugin-core/dist/engine/db/sqlSchemaState.mjs
|
|
2754
|
+
const POSTGRES_NAME_BYTES = 63;
|
|
2755
|
+
const postgresName = (name) => {
|
|
2756
|
+
const encoder = new TextEncoder();
|
|
2757
|
+
let bytes = 0;
|
|
2758
|
+
let cut = "";
|
|
2759
|
+
for (const character of name) {
|
|
2760
|
+
bytes += encoder.encode(character).length;
|
|
2761
|
+
if (bytes > POSTGRES_NAME_BYTES) break;
|
|
2762
|
+
cut += character;
|
|
2763
|
+
}
|
|
2764
|
+
return cut;
|
|
2765
|
+
};
|
|
2766
|
+
const fold = (dialect, name) => dialect === "mysql" ? String(name).toLowerCase() : dialect === "postgresql" ? postgresName(String(name)) : String(name);
|
|
2767
|
+
const CATALOG = {
|
|
2768
|
+
postgresql: {
|
|
2769
|
+
tables: "SELECT c.relname AS t FROM pg_class c WHERE c.relkind IN ('r', 'p') AND pg_table_is_visible(c.oid)",
|
|
2770
|
+
indexes: "SELECT t.relname AS t, c.relname AS i FROM pg_index x JOIN pg_class c ON c.oid = x.indexrelid JOIN pg_class t ON t.oid = x.indrelid WHERE pg_table_is_visible(t.oid)",
|
|
2771
|
+
columns: "SELECT c.relname AS t, a.attname AS c FROM pg_attribute a JOIN pg_class c ON c.oid = a.attrelid WHERE c.relkind IN ('r', 'p') AND a.attnum > 0 AND NOT a.attisdropped AND pg_table_is_visible(c.oid)"
|
|
2772
|
+
},
|
|
2773
|
+
mysql: {
|
|
2774
|
+
tables: "SELECT TABLE_NAME AS t FROM information_schema.tables WHERE TABLE_SCHEMA = DATABASE()",
|
|
2775
|
+
indexes: "SELECT DISTINCT TABLE_NAME AS t, INDEX_NAME AS i FROM information_schema.statistics WHERE TABLE_SCHEMA = DATABASE()",
|
|
2776
|
+
columns: "SELECT TABLE_NAME AS t, COLUMN_NAME AS c FROM information_schema.columns WHERE TABLE_SCHEMA = DATABASE()"
|
|
2777
|
+
},
|
|
2778
|
+
sqlite: {
|
|
2779
|
+
tables: "SELECT name AS t FROM sqlite_master WHERE type = 'table'",
|
|
2780
|
+
indexes: "SELECT tbl_name AS t, name AS i FROM sqlite_master WHERE type = 'index'",
|
|
2781
|
+
columns: "SELECT m.name AS t, p.name AS c FROM sqlite_master m JOIN pragma_table_info(m.name) p WHERE m.type = 'table'"
|
|
2782
|
+
}
|
|
2783
|
+
};
|
|
2784
|
+
const readSqlSchemaState = async (executor) => {
|
|
2785
|
+
const { dialect } = executor;
|
|
2786
|
+
const read = (sql) => executor.execute({
|
|
2787
|
+
sql,
|
|
2788
|
+
params: []
|
|
2789
|
+
});
|
|
2790
|
+
const [tables, indexes, columns] = await Promise.all([
|
|
2791
|
+
read(CATALOG[dialect].tables),
|
|
2792
|
+
read(CATALOG[dialect].indexes),
|
|
2793
|
+
read(CATALOG[dialect].columns)
|
|
2794
|
+
]);
|
|
2795
|
+
const columnNames = new Set(columns.rows.map(({ t, c }) => JSON.stringify([fold(dialect, t), fold(dialect, c)])));
|
|
2796
|
+
const tableNames = new Set(tables.rows.map(({ t }) => fold(dialect, t)));
|
|
2797
|
+
const indexNames = new Set(indexes.rows.map(({ t, i }) => JSON.stringify([fold(dialect, t), fold(dialect, i)])));
|
|
2798
|
+
return {
|
|
2799
|
+
hasTable: (table) => tableNames.has(fold(dialect, table)),
|
|
2800
|
+
hasIndex: (table, index) => indexNames.has(JSON.stringify([fold(dialect, table), fold(dialect, index)])),
|
|
2801
|
+
hasColumn: (table, column) => columnNames.has(JSON.stringify([fold(dialect, table), fold(dialect, column)]))
|
|
2802
|
+
};
|
|
2803
|
+
};
|
|
2804
|
+
//#endregion
|
|
2638
2805
|
//#region ../plugin-core/dist/engine/db/settingsMigrator.mjs
|
|
2639
2806
|
const storedSchemaVersion = (stored) => {
|
|
2640
2807
|
const version = stored?.get("schema.core") ?? stored?.get("version");
|
|
@@ -2645,16 +2812,6 @@ const refuseV0Database = (adapterName, stored) => {
|
|
|
2645
2812
|
if (typeof version !== "string" || stored.has("schema.engine")) return;
|
|
2646
2813
|
throw new HotUpdaterSchemaMigrationRequiredError(adapterName, version);
|
|
2647
2814
|
};
|
|
2648
|
-
const compareVersions = (left, right) => {
|
|
2649
|
-
const parse = (version) => /^\d+(?:\.\d+)*$/u.test(version) ? version.split(".").map(Number) : [NaN];
|
|
2650
|
-
const [a, b] = [parse(left), parse(right)];
|
|
2651
|
-
if ([...a, ...b].some(Number.isNaN)) return NaN;
|
|
2652
|
-
for (let index = 0; index < Math.max(a.length, b.length); index += 1) {
|
|
2653
|
-
const difference = (a[index] ?? 0) - (b[index] ?? 0);
|
|
2654
|
-
if (difference !== 0) return difference;
|
|
2655
|
-
}
|
|
2656
|
-
return 0;
|
|
2657
|
-
};
|
|
2658
2815
|
const DEFAULT_ORDERED_SETTINGS = ["schema.core"];
|
|
2659
2816
|
const refuseNewerSchema = (adapterName, stored, settings, ordered = DEFAULT_ORDERED_SETTINGS) => {
|
|
2660
2817
|
const newer = ordered.flatMap((key) => {
|
|
@@ -2721,10 +2878,23 @@ const fillLateIndexes = async (adapter, tables, { dryRun = false } = {}) => {
|
|
|
2721
2878
|
}
|
|
2722
2879
|
return lacking;
|
|
2723
2880
|
};
|
|
2881
|
+
const addLateColumns = async (adapter, tables, { dryRun = false } = {}) => {
|
|
2882
|
+
const addColumns = adapter.migrations?.addColumns;
|
|
2883
|
+
if (addColumns === void 0) return [];
|
|
2884
|
+
const lacking = [];
|
|
2885
|
+
for (const table of tables) {
|
|
2886
|
+
const columns = LATE_COLUMNS.filter(({ table: name }) => name === table.name).map(({ column }) => column);
|
|
2887
|
+
if (columns.length === 0) continue;
|
|
2888
|
+
const added = await addColumns(table, columns, { dryRun });
|
|
2889
|
+
lacking.push(...added.map((column) => `${table.name}.${column}`));
|
|
2890
|
+
}
|
|
2891
|
+
return lacking;
|
|
2892
|
+
};
|
|
2724
2893
|
const migrateSchema = async (adapter, adapterName, tables, settings, ordered) => {
|
|
2725
2894
|
if (adapter.migrations === void 0) throw new Error(`${adapterName} creates its tables with its own tooling; write only the settings rows.`);
|
|
2726
2895
|
const stored = await storedSettings(adapter, Object.keys(settings)).catch(() => void 0);
|
|
2727
2896
|
if (stored !== void 0) refuseNewerSchema(adapterName, new Map([...stored].map(([key, row]) => [key, row?.value])), settings, ordered);
|
|
2897
|
+
await addLateColumns(adapter, tables);
|
|
2728
2898
|
await adapter.migrations.apply([...tables, SETTINGS_TABLE]);
|
|
2729
2899
|
await fillLateIndexes(adapter, tables);
|
|
2730
2900
|
await writeSchemaSettings(adapter, adapterName, settings, ordered);
|
|
@@ -3616,23 +3786,45 @@ const createEngineMigrator = (options) => {
|
|
|
3616
3786
|
refuseNewerSchema(options.adapterName, stored, options.settings, options.ordered);
|
|
3617
3787
|
const changed = Object.entries(options.settings).filter(([key, value]) => stored.get(key) !== value);
|
|
3618
3788
|
if (changed.length === 0) {
|
|
3789
|
+
const columns = await addLateColumns(options.adapter, options.schema.tables, { dryRun: true });
|
|
3619
3790
|
const lacking = await fillLateIndexes(options.adapter, options.schema.tables, { dryRun: true });
|
|
3620
|
-
if (lacking.length === 0) return getEmptyMigrationResult();
|
|
3791
|
+
if (columns.length === 0 && lacking.length === 0) return getEmptyMigrationResult();
|
|
3621
3792
|
return {
|
|
3622
|
-
operations: [
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3793
|
+
operations: [
|
|
3794
|
+
...columns.map((column) => ({
|
|
3795
|
+
type: "custom",
|
|
3796
|
+
description: `Add column: ${column}`
|
|
3797
|
+
})),
|
|
3798
|
+
...columns.length === 0 ? [] : [{
|
|
3799
|
+
type: "custom",
|
|
3800
|
+
description: "Create the tables and indexes the database lacks"
|
|
3801
|
+
}],
|
|
3802
|
+
...lacking.length === 0 ? [] : [{
|
|
3803
|
+
type: "custom",
|
|
3804
|
+
description: `Write the index items rows lack: ${lacking.join(", ")}`
|
|
3805
|
+
}]
|
|
3806
|
+
],
|
|
3626
3807
|
execute: async () => {
|
|
3808
|
+
if (columns.length > 0) {
|
|
3809
|
+
await addLateColumns(options.adapter, options.schema.tables);
|
|
3810
|
+
await options.adapter.migrations.apply([...options.schema.tables, SETTINGS_TABLE]);
|
|
3811
|
+
}
|
|
3627
3812
|
await fillLateIndexes(options.adapter, options.schema.tables);
|
|
3628
3813
|
}
|
|
3629
3814
|
};
|
|
3630
3815
|
}
|
|
3631
3816
|
return {
|
|
3632
|
-
operations: [
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3817
|
+
operations: [
|
|
3818
|
+
...(await addLateColumns(options.adapter, options.schema.tables, { dryRun: true }).catch(() => [])).map((column) => ({
|
|
3819
|
+
type: "custom",
|
|
3820
|
+
description: `Add column: ${column}`
|
|
3821
|
+
})),
|
|
3822
|
+
{
|
|
3823
|
+
type: "custom",
|
|
3824
|
+
description: "Create the tables and indexes the database lacks"
|
|
3825
|
+
},
|
|
3826
|
+
...migrate.updateSettings === false ? [] : [settingsOperation(stored, changed)]
|
|
3827
|
+
],
|
|
3636
3828
|
execute: () => migrateSchema(options.adapter, options.adapterName, options.schema.tables, options.settings, options.ordered)
|
|
3637
3829
|
};
|
|
3638
3830
|
};
|
|
@@ -4635,14 +4827,32 @@ const createSqlAdapter = ({ executor, tablePrefix = "", maxOps = 1e3, maxParams
|
|
|
4635
4827
|
return done;
|
|
4636
4828
|
})).at(-1)?.changes ?? 0;
|
|
4637
4829
|
},
|
|
4638
|
-
migrations: {
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4830
|
+
migrations: {
|
|
4831
|
+
async apply(tables) {
|
|
4832
|
+
const created = executor.batch && !tables.includes(WRITE_GUARD_TABLE) ? [...tables, WRITE_GUARD_TABLE] : tables;
|
|
4833
|
+
const statements = createTableStatements(dialect, created, tablePrefix);
|
|
4834
|
+
for (const text of statements) await executor.execute({
|
|
4835
|
+
sql: text,
|
|
4836
|
+
params: []
|
|
4837
|
+
});
|
|
4838
|
+
},
|
|
4839
|
+
async addColumns(table, columns, { dryRun = false } = {}) {
|
|
4840
|
+
const [shape] = sqlTableShapes(dialect, [table], tablePrefix);
|
|
4841
|
+
const state = await readSqlSchemaState(executor);
|
|
4842
|
+
if (shape === void 0 || !state.hasTable(shape.name)) return [];
|
|
4843
|
+
const missing = columns.filter((column) => !state.hasColumn(shape.name, column));
|
|
4844
|
+
if (dryRun) return missing;
|
|
4845
|
+
for (const name of missing) {
|
|
4846
|
+
const column = shape.columns.find((candidate) => candidate.name === name);
|
|
4847
|
+
if (column === void 0 || column.notNull) throw new Error(`${table.name}.${name} can't be added to an existing table: only an optional column can.`);
|
|
4848
|
+
await executor.execute({
|
|
4849
|
+
sql: `ALTER TABLE ${quoteSql(dialect, shape.name)} ADD COLUMN ${quoteSql(dialect, name)} ${column.type}`,
|
|
4850
|
+
params: []
|
|
4851
|
+
});
|
|
4852
|
+
}
|
|
4853
|
+
return missing;
|
|
4854
|
+
}
|
|
4855
|
+
}
|
|
4646
4856
|
};
|
|
4647
4857
|
};
|
|
4648
4858
|
//#endregion
|
|
@@ -17873,7 +18083,7 @@ const postgres = (config) => {
|
|
|
17873
18083
|
};
|
|
17874
18084
|
//#endregion
|
|
17875
18085
|
//#region ../../packages/server/dist/version.mjs
|
|
17876
|
-
const HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.
|
|
18086
|
+
const HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.52";
|
|
17877
18087
|
//#endregion
|
|
17878
18088
|
//#region ../../packages/server/dist/handlerVersionRoutes.mjs
|
|
17879
18089
|
const createVersionRouteHandlers = (plugins = []) => {
|
|
@@ -18611,7 +18821,7 @@ const baseBundleIdsOf = (row, range, bundleId, limit) => {
|
|
|
18611
18821
|
};
|
|
18612
18822
|
//#endregion
|
|
18613
18823
|
//#region ../../packages/server/dist/core/reads.mjs
|
|
18614
|
-
const PAGE$
|
|
18824
|
+
const PAGE$4 = 500;
|
|
18615
18825
|
const pick$2 = (fields) => (row) => Object.fromEntries(fields.map((field) => [field, row[field]]));
|
|
18616
18826
|
const toBundleRow = pick$2([
|
|
18617
18827
|
"id",
|
|
@@ -18632,7 +18842,7 @@ const toPatchRow = pick$2([
|
|
|
18632
18842
|
"byte_size",
|
|
18633
18843
|
"order_index"
|
|
18634
18844
|
]);
|
|
18635
|
-
const
|
|
18845
|
+
const pickReleaseRow = pick$2([
|
|
18636
18846
|
"id",
|
|
18637
18847
|
"revision",
|
|
18638
18848
|
"scope_key",
|
|
@@ -18653,6 +18863,12 @@ const toReleaseRow = pick$2([
|
|
|
18653
18863
|
"created_at_ms",
|
|
18654
18864
|
"updated_at_ms"
|
|
18655
18865
|
]);
|
|
18866
|
+
const toReleaseRow = (row) => {
|
|
18867
|
+
return {
|
|
18868
|
+
...pickReleaseRow(row),
|
|
18869
|
+
label: typeof row.label === "number" ? row.label : null
|
|
18870
|
+
};
|
|
18871
|
+
};
|
|
18656
18872
|
const toCatalogRow = pick$2([
|
|
18657
18873
|
"scope_key",
|
|
18658
18874
|
"catalog_id",
|
|
@@ -18696,7 +18912,7 @@ const createCoreReads = (db, storage) => {
|
|
|
18696
18912
|
const page = await db.findMany("bundle_patches", {
|
|
18697
18913
|
index: "byBundle",
|
|
18698
18914
|
where: { bundle_id: row.id },
|
|
18699
|
-
limit: Math.min(count - patches.length, PAGE$
|
|
18915
|
+
limit: Math.min(count - patches.length, PAGE$4),
|
|
18700
18916
|
...cursor === void 0 ? {} : { cursor }
|
|
18701
18917
|
});
|
|
18702
18918
|
patches.push(...page.rows.map(toPatchRow));
|
|
@@ -18797,6 +19013,18 @@ const createCoreReads = (db, storage) => {
|
|
|
18797
19013
|
const row = await db.findOne("releases", { id });
|
|
18798
19014
|
return row === null ? null : toReleaseRow(row);
|
|
18799
19015
|
},
|
|
19016
|
+
async getReleaseByLabel({ channel, platform, label }) {
|
|
19017
|
+
const found = await db.findOne("releases", {
|
|
19018
|
+
channel_id: `channel:${encodeChannelKey(channel)}`,
|
|
19019
|
+
platform,
|
|
19020
|
+
label
|
|
19021
|
+
});
|
|
19022
|
+
if (found === null) return null;
|
|
19023
|
+
const row = await db.findOne("releases", { id: found.id });
|
|
19024
|
+
if (row === null) return null;
|
|
19025
|
+
const release = toReleaseRow(row);
|
|
19026
|
+
return release.label === label && release.platform === platform ? release : null;
|
|
19027
|
+
},
|
|
18800
19028
|
async listReleases(input) {
|
|
18801
19029
|
const { filter } = input;
|
|
18802
19030
|
const options = {
|
|
@@ -18888,7 +19116,7 @@ const createCoreReads = (db, storage) => {
|
|
|
18888
19116
|
return (await drain$1((page) => db.findMany("channels", {
|
|
18889
19117
|
index: "all",
|
|
18890
19118
|
where: {},
|
|
18891
|
-
limit: PAGE$
|
|
19119
|
+
limit: PAGE$4,
|
|
18892
19120
|
...page
|
|
18893
19121
|
}))).map(toChannelRow);
|
|
18894
19122
|
},
|
|
@@ -19187,6 +19415,269 @@ const NATIVE_BUILD_SUBMISSION_DESTINATIONS = {
|
|
|
19187
19415
|
ios: ["testflight"]
|
|
19188
19416
|
};
|
|
19189
19417
|
//#endregion
|
|
19418
|
+
//#region ../../packages/server/dist/core/labels.mjs
|
|
19419
|
+
const labelSequenceId = (channelId, platform) => `releases/${platform}/${channelId}`;
|
|
19420
|
+
const LABEL_PLATFORMS = ["ios", "android"];
|
|
19421
|
+
var NeedsLabelFill = class extends Error {
|
|
19422
|
+
channelId;
|
|
19423
|
+
platform;
|
|
19424
|
+
constructor(channelId, platform) {
|
|
19425
|
+
super(`Release labels of ${platform} ${channelId} need a fill first.`);
|
|
19426
|
+
this.channelId = channelId;
|
|
19427
|
+
this.platform = platform;
|
|
19428
|
+
}
|
|
19429
|
+
};
|
|
19430
|
+
const createLabelAllocator = (tx, used, caughtUp) => {
|
|
19431
|
+
const sequences = /* @__PURE__ */ new Map();
|
|
19432
|
+
return {
|
|
19433
|
+
async next(channelId, platform) {
|
|
19434
|
+
const id = labelSequenceId(channelId, platform);
|
|
19435
|
+
let sequence = sequences.get(id);
|
|
19436
|
+
if (sequence === void 0) {
|
|
19437
|
+
const row = await tx.findOne("label_sequences", { id });
|
|
19438
|
+
if (row === null || !row.is_filled) {
|
|
19439
|
+
const channel = row === null ? await tx.findOne("channels", { id: channelId }) : null;
|
|
19440
|
+
if (channel === null || (channel._refs_releases_channel_id ?? 0) > 0) throw new NeedsLabelFill(channelId, platform);
|
|
19441
|
+
}
|
|
19442
|
+
const read = row?.last_label ?? 0;
|
|
19443
|
+
sequence = {
|
|
19444
|
+
row,
|
|
19445
|
+
read,
|
|
19446
|
+
last: read
|
|
19447
|
+
};
|
|
19448
|
+
sequences.set(id, sequence);
|
|
19449
|
+
used.set(id, {
|
|
19450
|
+
channelId,
|
|
19451
|
+
platform,
|
|
19452
|
+
read
|
|
19453
|
+
});
|
|
19454
|
+
}
|
|
19455
|
+
sequence.last += 1;
|
|
19456
|
+
return sequence.last;
|
|
19457
|
+
},
|
|
19458
|
+
caughtUp(channelId, platform) {
|
|
19459
|
+
caughtUp.set(labelSequenceId(channelId, platform), {
|
|
19460
|
+
channelId,
|
|
19461
|
+
platform
|
|
19462
|
+
});
|
|
19463
|
+
},
|
|
19464
|
+
flush() {
|
|
19465
|
+
for (const [id, { row, read, last }] of sequences) if (row === null) tx.create("label_sequences", {
|
|
19466
|
+
id,
|
|
19467
|
+
last_label: last,
|
|
19468
|
+
is_filled: true
|
|
19469
|
+
});
|
|
19470
|
+
else if (last !== read) tx.update("label_sequences", row, { last_label: last });
|
|
19471
|
+
}
|
|
19472
|
+
};
|
|
19473
|
+
};
|
|
19474
|
+
const FILL_BATCH = 25;
|
|
19475
|
+
const PAGE$3 = 500;
|
|
19476
|
+
const fillLabels = async (db, { channelId, platform }, { dryRun = false } = {}) => {
|
|
19477
|
+
const id = labelSequenceId(channelId, platform);
|
|
19478
|
+
let labeled = 0;
|
|
19479
|
+
let batchSize = FILL_BATCH;
|
|
19480
|
+
const label = async (ids) => {
|
|
19481
|
+
for (let at = 0; at < ids.length;) {
|
|
19482
|
+
const batch = ids.slice(at, at + batchSize);
|
|
19483
|
+
try {
|
|
19484
|
+
labeled += await db.transaction(async (tx) => {
|
|
19485
|
+
const counter = await tx.findOne("label_sequences", { id });
|
|
19486
|
+
let last = counter?.last_label ?? 0;
|
|
19487
|
+
let count = 0;
|
|
19488
|
+
for (const releaseId of batch) {
|
|
19489
|
+
const row = await tx.findOne("releases", { id: releaseId });
|
|
19490
|
+
if (row === null || typeof row.label === "number") continue;
|
|
19491
|
+
last += 1;
|
|
19492
|
+
count += 1;
|
|
19493
|
+
tx.update("releases", row, { label: last });
|
|
19494
|
+
}
|
|
19495
|
+
if (counter === null) tx.create("label_sequences", {
|
|
19496
|
+
id,
|
|
19497
|
+
last_label: last,
|
|
19498
|
+
is_filled: false
|
|
19499
|
+
});
|
|
19500
|
+
else if (last !== counter.last_label) tx.update("label_sequences", counter, { last_label: last });
|
|
19501
|
+
return count;
|
|
19502
|
+
});
|
|
19503
|
+
at += batch.length;
|
|
19504
|
+
} catch (error) {
|
|
19505
|
+
if (batchSize > 1 && error instanceof DatabaseConstraintError && error.reason === "too_large") {
|
|
19506
|
+
batchSize = Math.max(1, Math.floor(batchSize / 2));
|
|
19507
|
+
continue;
|
|
19508
|
+
}
|
|
19509
|
+
throw error;
|
|
19510
|
+
}
|
|
19511
|
+
}
|
|
19512
|
+
};
|
|
19513
|
+
let cursor;
|
|
19514
|
+
do {
|
|
19515
|
+
const page = await db.findMany("releases", {
|
|
19516
|
+
index: "byChannelPlatform",
|
|
19517
|
+
where: {
|
|
19518
|
+
channel_id: channelId,
|
|
19519
|
+
platform
|
|
19520
|
+
},
|
|
19521
|
+
limit: PAGE$3,
|
|
19522
|
+
...cursor === void 0 ? {} : { cursor }
|
|
19523
|
+
});
|
|
19524
|
+
const unlabeled = page.rows.filter((row) => typeof row.label !== "number").map((row) => row.id);
|
|
19525
|
+
if (dryRun) labeled += unlabeled.length;
|
|
19526
|
+
else await label(unlabeled);
|
|
19527
|
+
cursor = page.next;
|
|
19528
|
+
} while (cursor !== void 0);
|
|
19529
|
+
if (dryRun) return labeled;
|
|
19530
|
+
await db.transaction(async (tx) => {
|
|
19531
|
+
const counter = await tx.findOne("label_sequences", { id });
|
|
19532
|
+
if (counter === null) tx.create("label_sequences", {
|
|
19533
|
+
id,
|
|
19534
|
+
last_label: 0,
|
|
19535
|
+
is_filled: true
|
|
19536
|
+
});
|
|
19537
|
+
else if (!counter.is_filled) tx.update("label_sequences", counter, { is_filled: true });
|
|
19538
|
+
});
|
|
19539
|
+
return labeled;
|
|
19540
|
+
};
|
|
19541
|
+
const probeLabelSchema = async (db, { channelId, platform }) => {
|
|
19542
|
+
await db.findOne("label_sequences", { id: labelSequenceId(channelId, platform) });
|
|
19543
|
+
await db.findMany("releases", {
|
|
19544
|
+
index: "byLabel",
|
|
19545
|
+
where: {
|
|
19546
|
+
channel_id: channelId,
|
|
19547
|
+
platform,
|
|
19548
|
+
label: 0
|
|
19549
|
+
},
|
|
19550
|
+
limit: 1
|
|
19551
|
+
});
|
|
19552
|
+
};
|
|
19553
|
+
const REPAIRS = 4;
|
|
19554
|
+
const RACES = 32;
|
|
19555
|
+
const writeWithLabels = async (db, write) => {
|
|
19556
|
+
const filled = /* @__PURE__ */ new Set();
|
|
19557
|
+
const fill = async (pairs) => {
|
|
19558
|
+
for (const pair of pairs) {
|
|
19559
|
+
filled.add(labelSequenceId(pair.channelId, pair.platform));
|
|
19560
|
+
await fillLabels(db, pair);
|
|
19561
|
+
}
|
|
19562
|
+
};
|
|
19563
|
+
for (let repairs = 0, races = 0;;) {
|
|
19564
|
+
const used = /* @__PURE__ */ new Map();
|
|
19565
|
+
const caughtUp = /* @__PURE__ */ new Map();
|
|
19566
|
+
try {
|
|
19567
|
+
return await db.transaction(async (tx) => {
|
|
19568
|
+
used.clear();
|
|
19569
|
+
caughtUp.clear();
|
|
19570
|
+
const labels = createLabelAllocator(tx, used, caughtUp);
|
|
19571
|
+
const result = await write(tx, labels);
|
|
19572
|
+
labels.flush();
|
|
19573
|
+
return result;
|
|
19574
|
+
});
|
|
19575
|
+
} catch (error) {
|
|
19576
|
+
const needs = error instanceof NeedsLabelFill ? [error] : error instanceof DatabaseConstraintError && error.reason === "too_large" ? [...caughtUp.values()] : [];
|
|
19577
|
+
if (needs.length > 0) {
|
|
19578
|
+
const fresh = needs.some(({ channelId, platform }) => !filled.has(labelSequenceId(channelId, platform)));
|
|
19579
|
+
if (fresh || repairs < REPAIRS) {
|
|
19580
|
+
if (!fresh) repairs += 1;
|
|
19581
|
+
await fill(needs);
|
|
19582
|
+
continue;
|
|
19583
|
+
}
|
|
19584
|
+
}
|
|
19585
|
+
if (error instanceof DatabaseConstraintError && error.reason === "unique" && error.model === "releases" && used.size > 0) {
|
|
19586
|
+
if (await db.transaction(async (tx) => {
|
|
19587
|
+
const moves = [];
|
|
19588
|
+
for (const [id, { channelId, read }] of used) {
|
|
19589
|
+
const counter = await tx.findOne("label_sequences", { id });
|
|
19590
|
+
if (counter !== null) {
|
|
19591
|
+
if (counter.last_label !== read) return false;
|
|
19592
|
+
moves.push(() => tx.update("label_sequences", counter, { last_label: read + 1 }));
|
|
19593
|
+
continue;
|
|
19594
|
+
}
|
|
19595
|
+
const channel = await tx.findOne("channels", { id: channelId });
|
|
19596
|
+
if (channel === null || (channel._refs_releases_channel_id ?? 0) > 0) return false;
|
|
19597
|
+
moves.push(() => tx.create("label_sequences", {
|
|
19598
|
+
id,
|
|
19599
|
+
last_label: read + 1,
|
|
19600
|
+
is_filled: true
|
|
19601
|
+
}));
|
|
19602
|
+
}
|
|
19603
|
+
for (const move of moves) move();
|
|
19604
|
+
return true;
|
|
19605
|
+
}) ? (repairs += 1) <= REPAIRS : (races += 1) <= RACES) continue;
|
|
19606
|
+
}
|
|
19607
|
+
throw error;
|
|
19608
|
+
}
|
|
19609
|
+
}
|
|
19610
|
+
};
|
|
19611
|
+
const catchUpLabels = async (tx, labels, latest) => {
|
|
19612
|
+
const given = /* @__PURE__ */ new Map();
|
|
19613
|
+
if (latest === null || typeof latest.label === "number") return given;
|
|
19614
|
+
const unlabeled = [];
|
|
19615
|
+
let cursor;
|
|
19616
|
+
scan: do {
|
|
19617
|
+
const page = await tx.findMany("releases", {
|
|
19618
|
+
index: "byScope",
|
|
19619
|
+
where: { scope_key: latest.scope_key },
|
|
19620
|
+
order: "desc",
|
|
19621
|
+
limit: FILL_BATCH,
|
|
19622
|
+
...cursor === void 0 ? {} : { cursor }
|
|
19623
|
+
});
|
|
19624
|
+
for (const row of page.rows) {
|
|
19625
|
+
if (typeof row.label === "number") break scan;
|
|
19626
|
+
unlabeled.push(row);
|
|
19627
|
+
}
|
|
19628
|
+
cursor = page.next;
|
|
19629
|
+
} while (cursor !== void 0);
|
|
19630
|
+
labels.caughtUp(latest.channel_id, latest.platform);
|
|
19631
|
+
for (const row of unlabeled.reverse()) {
|
|
19632
|
+
const { id, channel_id, platform } = toReleaseRow(row);
|
|
19633
|
+
const label = await labels.next(channel_id, platform);
|
|
19634
|
+
tx.update("releases", row, { label });
|
|
19635
|
+
given.set(id, label);
|
|
19636
|
+
}
|
|
19637
|
+
return given;
|
|
19638
|
+
};
|
|
19639
|
+
const pendingLabelPairs = async (db) => {
|
|
19640
|
+
const pairs = /* @__PURE__ */ new Map();
|
|
19641
|
+
for (let last = "";;) {
|
|
19642
|
+
const { rows } = await db.findMany("releases", {
|
|
19643
|
+
index: "scopes",
|
|
19644
|
+
where: {},
|
|
19645
|
+
limit: 1,
|
|
19646
|
+
range: { gt: last }
|
|
19647
|
+
});
|
|
19648
|
+
if (rows[0] === void 0) break;
|
|
19649
|
+
last = rows[0].scope_key;
|
|
19650
|
+
const { rows: newest } = await db.findMany("releases", {
|
|
19651
|
+
index: "byScope",
|
|
19652
|
+
where: { scope_key: last },
|
|
19653
|
+
order: "desc",
|
|
19654
|
+
limit: 1
|
|
19655
|
+
});
|
|
19656
|
+
if (newest[0] === void 0) continue;
|
|
19657
|
+
const { channel_id: channelId, platform, label } = toReleaseRow(newest[0]);
|
|
19658
|
+
const id = labelSequenceId(channelId, platform);
|
|
19659
|
+
const pair = pairs.get(id) ?? {
|
|
19660
|
+
channelId,
|
|
19661
|
+
platform,
|
|
19662
|
+
pending: false
|
|
19663
|
+
};
|
|
19664
|
+
pair.pending ||= label === null;
|
|
19665
|
+
pairs.set(id, pair);
|
|
19666
|
+
}
|
|
19667
|
+
const pending = [];
|
|
19668
|
+
for (const [id, { channelId, platform, pending: unlabeled }] of pairs) {
|
|
19669
|
+
if (!unlabeled) {
|
|
19670
|
+
const counter = await db.findOne("label_sequences", { id });
|
|
19671
|
+
if (counter !== null && counter.is_filled) continue;
|
|
19672
|
+
}
|
|
19673
|
+
pending.push({
|
|
19674
|
+
channelId,
|
|
19675
|
+
platform
|
|
19676
|
+
});
|
|
19677
|
+
}
|
|
19678
|
+
return pending;
|
|
19679
|
+
};
|
|
19680
|
+
//#endregion
|
|
19190
19681
|
//#region ../../packages/server/dist/core/writes.mjs
|
|
19191
19682
|
const PAGE$2 = 500;
|
|
19192
19683
|
const countBundle = (tx, platform, delta) => {
|
|
@@ -19273,6 +19764,10 @@ const deleteChannel = (db, id) => db.transaction(async (tx) => {
|
|
|
19273
19764
|
deleted: false,
|
|
19274
19765
|
reason: "not_empty"
|
|
19275
19766
|
};
|
|
19767
|
+
for (const platform of LABEL_PLATFORMS) {
|
|
19768
|
+
const counter = await tx.findOne("label_sequences", { id: labelSequenceId(id, platform) });
|
|
19769
|
+
if (counter !== null) await tx.delete("label_sequences", counter);
|
|
19770
|
+
}
|
|
19276
19771
|
await tx.delete("channels", row);
|
|
19277
19772
|
return { deleted: true };
|
|
19278
19773
|
});
|
|
@@ -19732,14 +20227,14 @@ const enabledIn = (scopeKey, cursor) => ({
|
|
|
19732
20227
|
...cursor === void 0 ? {} : { cursor }
|
|
19733
20228
|
});
|
|
19734
20229
|
const enabledReleases = (tx, scopeKey) => drainReleases((cursor) => tx.findMany("releases", enabledIn(scopeKey, cursor)));
|
|
19735
|
-
const
|
|
20230
|
+
const latestRelease = async (tx, scopeKey) => {
|
|
19736
20231
|
const { rows } = await tx.findMany("releases", {
|
|
19737
20232
|
index: "byScope",
|
|
19738
20233
|
where: { scope_key: scopeKey },
|
|
19739
20234
|
order: "desc",
|
|
19740
20235
|
limit: 1
|
|
19741
20236
|
});
|
|
19742
|
-
return rows[0]
|
|
20237
|
+
return rows[0] === void 0 ? null : toReleaseRow(rows[0]);
|
|
19743
20238
|
};
|
|
19744
20239
|
const nextCatalog = (scope, stored, compilation, updatedAtMs) => {
|
|
19745
20240
|
const generation = (stored.catalog?.generation ?? 0) + 1;
|
|
@@ -19790,13 +20285,17 @@ const readCatalog = async (tx, scopeKey) => {
|
|
|
19790
20285
|
catalog: row === null ? null : toCatalogRow(row)
|
|
19791
20286
|
};
|
|
19792
20287
|
};
|
|
20288
|
+
const refuseLaterCatalog = (scope, catalog) => {
|
|
20289
|
+
if (catalog !== null && readCompiledCatalogPayload(catalog.payload).fromLaterRelease) fail$1("CATALOG_FROM_LATER_RELEASE", `The ${scope.platform} release catalog of channel "${scope.channelName}" was written by a later Hot Updater.\nUpgrade hot-updater, then try again.`);
|
|
20290
|
+
};
|
|
19793
20291
|
const assertHistory = (stored, hasReleases) => {
|
|
19794
20292
|
if (stored.catalog === null && hasReleases) fail$1("CATALOG_IDENTITY_MISSING", "Catalog history is missing. Restore its catalog row from backup before rebuilding or deploying.");
|
|
19795
20293
|
};
|
|
19796
|
-
const changeRelease = async (tx, { scope, change, bundle, updatedAtMs }) => {
|
|
20294
|
+
const changeRelease = async (tx, { scope, change, bundle, updatedAtMs }, labels) => {
|
|
19797
20295
|
checkScope(scope);
|
|
19798
20296
|
const stored = await readCatalog(tx, scope.scopeKey);
|
|
19799
|
-
|
|
20297
|
+
refuseLaterCatalog(scope, stored.catalog);
|
|
20298
|
+
let enabled = await enabledReleases(tx, scope.scopeKey);
|
|
19800
20299
|
if (bundle !== void 0) {
|
|
19801
20300
|
insertBundle(tx, bundle.row);
|
|
19802
20301
|
for (const patch of bundle.patches) tx.create("bundle_patches", patch);
|
|
@@ -19804,14 +20303,22 @@ const changeRelease = async (tx, { scope, change, bundle, updatedAtMs }) => {
|
|
|
19804
20303
|
let before = null;
|
|
19805
20304
|
let release;
|
|
19806
20305
|
if (change.operation === "insert") {
|
|
19807
|
-
|
|
20306
|
+
if (labels === void 0) throw new Error("A release insert takes its label from an allocator.");
|
|
20307
|
+
const newest = await latestRelease(tx, scope.scopeKey);
|
|
20308
|
+
const latest = newest?.id ?? null;
|
|
19808
20309
|
assertHistory(stored, latest !== null);
|
|
19809
20310
|
const floor = [latest, bundle && isUUIDv7(bundle.row.id) ? bundle.row.id : null].filter((id) => id !== null).sort().at(-1);
|
|
19810
20311
|
const id = change.row.id ?? createUUIDv7After(floor ?? null);
|
|
19811
20312
|
if (latest !== null && id <= latest) fail$1("NON_MONOTONIC_RELEASE_ID", `Release "${id}" must sort after "${latest}"`);
|
|
20313
|
+
const given = await catchUpLabels(tx, labels, newest);
|
|
20314
|
+
if (given.size > 0) enabled = enabled.map((row) => given.has(row.id) ? {
|
|
20315
|
+
...row,
|
|
20316
|
+
label: given.get(row.id)
|
|
20317
|
+
} : row);
|
|
19812
20318
|
release = {
|
|
19813
20319
|
...change.row,
|
|
19814
|
-
id
|
|
20320
|
+
id,
|
|
20321
|
+
label: await labels.next(scope.channelId, scope.platform)
|
|
19815
20322
|
};
|
|
19816
20323
|
if (release.scope_key !== scope.scopeKey || release.channel_id !== scope.channelId || release.platform !== scope.platform || release.strategy !== scope.strategy || release.fingerprint_hash !== scope.fingerprintHash || release.revision !== 1) fail$1("INVALID_SCOPE", "Inserted Release does not match its catalog scope");
|
|
19817
20324
|
tx.create("releases", release);
|
|
@@ -19824,8 +20331,9 @@ const changeRelease = async (tx, { scope, change, bundle, updatedAtMs }) => {
|
|
|
19824
20331
|
await tx.delete("releases", row);
|
|
19825
20332
|
release = null;
|
|
19826
20333
|
} else {
|
|
20334
|
+
const { label: _label, ...update } = change.update;
|
|
19827
20335
|
const set = {
|
|
19828
|
-
...
|
|
20336
|
+
...update,
|
|
19829
20337
|
revision: before.revision + 1
|
|
19830
20338
|
};
|
|
19831
20339
|
tx.update("releases", row, set);
|
|
@@ -19846,13 +20354,26 @@ const changeRelease = async (tx, { scope, change, bundle, updatedAtMs }) => {
|
|
|
19846
20354
|
};
|
|
19847
20355
|
const changeReleases = (db, inputs) => {
|
|
19848
20356
|
if (new Set(inputs.map(({ scope }) => scope.scopeKey)).size !== inputs.length) fail$1("INVALID_SCOPE", "A batch cannot change one catalog scope twice");
|
|
19849
|
-
return db
|
|
20357
|
+
return writeWithLabels(db, async (tx, labels) => {
|
|
19850
20358
|
const results = [];
|
|
19851
|
-
for (const input of inputs) results.push(await changeRelease(tx, input));
|
|
20359
|
+
for (const input of inputs) results.push(await changeRelease(tx, input, labels));
|
|
19852
20360
|
return results;
|
|
19853
20361
|
});
|
|
19854
20362
|
};
|
|
19855
|
-
const isCurrent = (scope, current, compilation) =>
|
|
20363
|
+
const isCurrent = (scope, current, compilation) => {
|
|
20364
|
+
if (current.strategy !== scope.strategy || current.channel_id !== scope.channelId || current.channel_key !== encodeChannelKey(scope.channelName) || current.platform !== scope.platform || current.fingerprint_hash !== scope.fingerprintHash) return false;
|
|
20365
|
+
if (current.catalog_hash === compilation.catalogHash) return true;
|
|
20366
|
+
const read = readCompiledCatalogPayload(current.payload);
|
|
20367
|
+
return read.fromLaterRelease && read.canonicalPayload === compilation.canonicalPayload;
|
|
20368
|
+
};
|
|
20369
|
+
const withoutLabels = (payload) => {
|
|
20370
|
+
const parsed = JSON.parse(payload);
|
|
20371
|
+
return JSON.stringify({
|
|
20372
|
+
...parsed,
|
|
20373
|
+
releaseDescriptors: (parsed.releaseDescriptors ?? []).map(({ label: _label, ...descriptor }) => descriptor)
|
|
20374
|
+
});
|
|
20375
|
+
};
|
|
20376
|
+
const differsInLabelsOnly = (current, projected) => current.payload !== projected.payload && current.strategy === projected.strategy && current.channel_id === projected.channel_id && current.channel_key === projected.channel_key && current.platform === projected.platform && current.fingerprint_hash === projected.fingerprint_hash && withoutLabels(current.payload) === withoutLabels(projected.payload);
|
|
19856
20377
|
const catalogRowScope = (row) => ({
|
|
19857
20378
|
channelId: row.channel_id,
|
|
19858
20379
|
channelName: decodeChannelKey(row.channel_key),
|
|
@@ -19870,17 +20391,19 @@ const preflightRebuild = async (db, scopeKey, updatedAtMs) => {
|
|
|
19870
20391
|
const enabled = await drainReleases((cursor) => db.findMany("releases", enabledIn(scopeKey, cursor)));
|
|
19871
20392
|
const compilation = await compileScope(scope, enabled);
|
|
19872
20393
|
const changed = !isCurrent(scope, current, compilation);
|
|
20394
|
+
const projectedCatalog = changed ? nextCatalog(scope, { catalog: current }, compilation, updatedAtMs) : current;
|
|
19873
20395
|
return {
|
|
19874
20396
|
changed,
|
|
20397
|
+
labelsOnly: changed && differsInLabelsOnly(current, projectedCatalog),
|
|
19875
20398
|
currentCatalog: current,
|
|
19876
20399
|
diagnostics: compilation.diagnostics,
|
|
19877
|
-
projectedCatalog
|
|
20400
|
+
projectedCatalog
|
|
19878
20401
|
};
|
|
19879
20402
|
};
|
|
19880
20403
|
const rebuildScope = async (tx, scope, updatedAtMs) => {
|
|
19881
20404
|
checkScope(scope);
|
|
19882
20405
|
const stored = await readCatalog(tx, scope.scopeKey);
|
|
19883
|
-
assertHistory(stored, await
|
|
20406
|
+
assertHistory(stored, await latestRelease(tx, scope.scopeKey) !== null);
|
|
19884
20407
|
const enabled = await enabledReleases(tx, scope.scopeKey);
|
|
19885
20408
|
const compilation = await compileScope(scope, enabled);
|
|
19886
20409
|
const current = stored.catalog;
|
|
@@ -19890,6 +20413,7 @@ const rebuildScope = async (tx, scope, updatedAtMs) => {
|
|
|
19890
20413
|
changed: false,
|
|
19891
20414
|
diagnostics: compilation.diagnostics
|
|
19892
20415
|
};
|
|
20416
|
+
refuseLaterCatalog(scope, current);
|
|
19893
20417
|
const written = await writeCatalog(tx, scope, stored, enabled, updatedAtMs);
|
|
19894
20418
|
return {
|
|
19895
20419
|
catalog: written.catalog,
|
|
@@ -19900,6 +20424,7 @@ const rebuildScope = async (tx, scope, updatedAtMs) => {
|
|
|
19900
20424
|
};
|
|
19901
20425
|
//#endregion
|
|
19902
20426
|
//#region ../../packages/server/dist/core/operations.mjs
|
|
20427
|
+
const CATALOG_PAGE = 100;
|
|
19903
20428
|
var Preflight = class extends Error {
|
|
19904
20429
|
result;
|
|
19905
20430
|
constructor(result) {
|
|
@@ -20118,7 +20643,7 @@ const createCoreOperations = (db, { now = Date.now } = {}) => {
|
|
|
20118
20643
|
if (targetChannel.length === 0) throw new ReleaseManagementError("TARGET_RELEASE_INVALID", "Promotion requires a target channel.");
|
|
20119
20644
|
const channel = await ensureChannel(targetChannel);
|
|
20120
20645
|
const updatedAtMs = now();
|
|
20121
|
-
return db
|
|
20646
|
+
return writeWithLabels(db, async (tx, labels) => {
|
|
20122
20647
|
const { release: source, scope: sourceScope } = await loadTarget(tx, input);
|
|
20123
20648
|
checkSource(source);
|
|
20124
20649
|
const targetScope = scopeOf$1(channel, source.platform, source.fingerprint_hash);
|
|
@@ -20146,12 +20671,13 @@ const createCoreOperations = (db, { now = Date.now } = {}) => {
|
|
|
20146
20671
|
},
|
|
20147
20672
|
updatedAtMs
|
|
20148
20673
|
}) : null;
|
|
20674
|
+
const { label: _label, ...copied } = source;
|
|
20149
20675
|
const target = await changeRelease(tx, {
|
|
20150
20676
|
scope: targetScope,
|
|
20151
20677
|
change: {
|
|
20152
20678
|
operation: "insert",
|
|
20153
20679
|
row: {
|
|
20154
|
-
...
|
|
20680
|
+
...copied,
|
|
20155
20681
|
id: createUUIDv7After(floor ?? null, updatedAtMs),
|
|
20156
20682
|
revision: 1,
|
|
20157
20683
|
scope_key: targetScope.scopeKey,
|
|
@@ -20166,7 +20692,7 @@ const createCoreOperations = (db, { now = Date.now } = {}) => {
|
|
|
20166
20692
|
}
|
|
20167
20693
|
},
|
|
20168
20694
|
updatedAtMs
|
|
20169
|
-
});
|
|
20695
|
+
}, labels);
|
|
20170
20696
|
return {
|
|
20171
20697
|
source: moved === null ? null : mutationResult(moved),
|
|
20172
20698
|
target: mutationResult(target)
|
|
@@ -20184,6 +20710,38 @@ const createCoreOperations = (db, { now = Date.now } = {}) => {
|
|
|
20184
20710
|
});
|
|
20185
20711
|
},
|
|
20186
20712
|
preflightReleaseCatalogRebuild: (scopeKey) => preflightRebuild(db, scopeKey, now()),
|
|
20713
|
+
fillReleaseLabels: async ({ dryRun = false, catalogs = true } = {}) => {
|
|
20714
|
+
let releases = 0;
|
|
20715
|
+
const pairs = await pendingLabelPairs(db);
|
|
20716
|
+
if (dryRun && pairs[0] !== void 0) await probeLabelSchema(db, pairs[0]);
|
|
20717
|
+
for (const pair of pairs) releases += await fillLabels(db, pair, { dryRun });
|
|
20718
|
+
let rebuilt = 0;
|
|
20719
|
+
if (catalogs) {
|
|
20720
|
+
let cursor;
|
|
20721
|
+
do {
|
|
20722
|
+
const page = await db.findMany("release_catalogs", {
|
|
20723
|
+
index: "all",
|
|
20724
|
+
where: {},
|
|
20725
|
+
limit: CATALOG_PAGE,
|
|
20726
|
+
...cursor === void 0 ? {} : { cursor }
|
|
20727
|
+
});
|
|
20728
|
+
for (const row of page.rows) {
|
|
20729
|
+
if (row.is_tombstone) continue;
|
|
20730
|
+
const preflight = await preflightRebuild(db, row.scope_key, now()).catch(() => null);
|
|
20731
|
+
if (preflight === null || !preflight.labelsOnly) continue;
|
|
20732
|
+
rebuilt += 1;
|
|
20733
|
+
if (dryRun) continue;
|
|
20734
|
+
const updatedAtMs = now();
|
|
20735
|
+
await db.transaction((tx) => rebuildScope(tx, catalogRowScope(toCatalogRow(row)), updatedAtMs));
|
|
20736
|
+
}
|
|
20737
|
+
cursor = page.next;
|
|
20738
|
+
} while (cursor !== void 0);
|
|
20739
|
+
}
|
|
20740
|
+
return {
|
|
20741
|
+
releases,
|
|
20742
|
+
catalogs: rebuilt
|
|
20743
|
+
};
|
|
20744
|
+
},
|
|
20187
20745
|
ensureChannel,
|
|
20188
20746
|
deleteChannel: (id) => deleteChannel(db, id),
|
|
20189
20747
|
updateBundle: (id, update) => db.transaction(async (tx) => {
|
|
@@ -20714,6 +21272,26 @@ const createAdminRouteHandlers = () => ({
|
|
|
20714
21272
|
return row === null ? notFound() : json$2({ data: row });
|
|
20715
21273
|
}),
|
|
20716
21274
|
rebuildReleaseCatalog: onCore(async (core, _request, params) => json$2({ data: await core.rebuildReleaseCatalog(scopeKeyOf(params)) })),
|
|
21275
|
+
getReleaseByLabel: onCore(async (core, request) => {
|
|
21276
|
+
const url = new URL(request.url);
|
|
21277
|
+
const channel = url.searchParams.get("channel");
|
|
21278
|
+
const platform = platformOf(url);
|
|
21279
|
+
const label = Number(url.searchParams.get("label"));
|
|
21280
|
+
if (channel === null || channel.length === 0 || platform === void 0 || !Number.isSafeInteger(label) || label < 1) throw new HandlerBadRequestError("A release label lookup takes channel, platform, and a label of 1 or more.");
|
|
21281
|
+
return json$2({ data: await core.getReleaseByLabel({
|
|
21282
|
+
channel,
|
|
21283
|
+
platform,
|
|
21284
|
+
label
|
|
21285
|
+
}) });
|
|
21286
|
+
}),
|
|
21287
|
+
fillReleaseLabels: onCore(async (core, request) => {
|
|
21288
|
+
const body = await request.json().catch(() => ({}));
|
|
21289
|
+
const input = body !== null && typeof body === "object" ? body : {};
|
|
21290
|
+
return json$2({ data: await core.fillReleaseLabels({
|
|
21291
|
+
dryRun: input.dryRun === true,
|
|
21292
|
+
catalogs: input.catalogs !== false
|
|
21293
|
+
}) });
|
|
21294
|
+
}),
|
|
20717
21295
|
updateBundle: onCore(async (core, request, params) => {
|
|
20718
21296
|
const bundleId = requireRouteParam(params, "id");
|
|
20719
21297
|
const update = bundleUpdateOf(await request.json(), bundleId);
|
|
@@ -20940,6 +21518,16 @@ const ADMIN_ROUTES = [
|
|
|
20940
21518
|
path: "/release-scopes",
|
|
20941
21519
|
handler: "listReleaseScopeKeys"
|
|
20942
21520
|
},
|
|
21521
|
+
{
|
|
21522
|
+
method: "GET",
|
|
21523
|
+
path: "/release-labels",
|
|
21524
|
+
handler: "getReleaseByLabel"
|
|
21525
|
+
},
|
|
21526
|
+
{
|
|
21527
|
+
method: "POST",
|
|
21528
|
+
path: "/release-labels/fill",
|
|
21529
|
+
handler: "fillReleaseLabels"
|
|
21530
|
+
},
|
|
20943
21531
|
{
|
|
20944
21532
|
method: "POST",
|
|
20945
21533
|
path: "/release-catalogs/:scopeKey/rebuild",
|
|
@@ -55064,15 +55652,21 @@ const vercelBlobStorage = (config) => {
|
|
|
55064
55652
|
bucket: storeId,
|
|
55065
55653
|
key: storageKey
|
|
55066
55654
|
});
|
|
55067
|
-
|
|
55068
|
-
|
|
55069
|
-
|
|
55070
|
-
|
|
55071
|
-
|
|
55072
|
-
|
|
55073
|
-
|
|
55074
|
-
|
|
55075
|
-
|
|
55655
|
+
const multipart = contentLength === void 0 || contentLength > MULTIPART_THRESHOLD_BYTES;
|
|
55656
|
+
try {
|
|
55657
|
+
await put(toPathname(storageKey), body, {
|
|
55658
|
+
access,
|
|
55659
|
+
token,
|
|
55660
|
+
addRandomSuffix: false,
|
|
55661
|
+
allowOverwrite: true,
|
|
55662
|
+
cacheControlMaxAge: ONE_YEAR_IN_SECONDS,
|
|
55663
|
+
contentType,
|
|
55664
|
+
multipart
|
|
55665
|
+
});
|
|
55666
|
+
} catch (error) {
|
|
55667
|
+
if (!multipart && error instanceof TypeError && body.locked) throw new Error(`Vercel Blob failed while uploading ${storageKey}: it answered an error or the connection dropped`, { cause: error });
|
|
55668
|
+
throw error;
|
|
55669
|
+
}
|
|
55076
55670
|
return { storageUri };
|
|
55077
55671
|
},
|
|
55078
55672
|
async get({ storageUri }) {
|
package/dist/index.cjs
CHANGED
|
@@ -128,15 +128,21 @@ const vercelBlobStorage = (config) => {
|
|
|
128
128
|
bucket: storeId,
|
|
129
129
|
key: storageKey
|
|
130
130
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
const multipart = contentLength === void 0 || contentLength > MULTIPART_THRESHOLD_BYTES;
|
|
132
|
+
try {
|
|
133
|
+
await (0, _vercel_blob.put)(toPathname(storageKey), body, {
|
|
134
|
+
access,
|
|
135
|
+
token,
|
|
136
|
+
addRandomSuffix: false,
|
|
137
|
+
allowOverwrite: true,
|
|
138
|
+
cacheControlMaxAge: ONE_YEAR_IN_SECONDS,
|
|
139
|
+
contentType,
|
|
140
|
+
multipart
|
|
141
|
+
});
|
|
142
|
+
} catch (error) {
|
|
143
|
+
if (!multipart && error instanceof TypeError && body.locked) throw new Error(`Vercel Blob failed while uploading ${storageKey}: it answered an error or the connection dropped`, { cause: error });
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
140
146
|
return { storageUri };
|
|
141
147
|
},
|
|
142
148
|
async get({ storageUri }) {
|
package/dist/index.mjs
CHANGED
|
@@ -127,15 +127,21 @@ const vercelBlobStorage = (config) => {
|
|
|
127
127
|
bucket: storeId,
|
|
128
128
|
key: storageKey
|
|
129
129
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
const multipart = contentLength === void 0 || contentLength > MULTIPART_THRESHOLD_BYTES;
|
|
131
|
+
try {
|
|
132
|
+
await put(toPathname(storageKey), body, {
|
|
133
|
+
access,
|
|
134
|
+
token,
|
|
135
|
+
addRandomSuffix: false,
|
|
136
|
+
allowOverwrite: true,
|
|
137
|
+
cacheControlMaxAge: ONE_YEAR_IN_SECONDS,
|
|
138
|
+
contentType,
|
|
139
|
+
multipart
|
|
140
|
+
});
|
|
141
|
+
} catch (error) {
|
|
142
|
+
if (!multipart && error instanceof TypeError && body.locked) throw new Error(`Vercel Blob failed while uploading ${storageKey}: it answered an error or the connection dropped`, { cause: error });
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
139
145
|
return { storageUri };
|
|
140
146
|
},
|
|
141
147
|
async get({ storageUri }) {
|
package/dist/init/index.cjs
CHANGED
|
@@ -7135,6 +7135,7 @@ const runInit = async ({ build, envFile, secretsEnv }) => {
|
|
|
7135
7135
|
});
|
|
7136
7136
|
let credential;
|
|
7137
7137
|
try {
|
|
7138
|
+
await (0, _hot_updater_cli_tools.fillReleaseLabels)(server);
|
|
7138
7139
|
credential = await (0, _hot_updater_cli_tools.provisionClientCredential)(server, {
|
|
7139
7140
|
env: initInputEnv,
|
|
7140
7141
|
name: "Vercel init"
|
package/dist/init/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import fs from "fs/promises";
|
|
3
3
|
import os from "os";
|
|
4
4
|
import path from "path";
|
|
5
|
-
import { ConfigBuilder, InitError, LegacyInfrastructureError, assembleServer, assertInfrastructureGenerationPayload, confirmInitInputPersistence, createHotUpdaterConfigScaffoldFromBuilder, createMigrator, getCwd, getHotUpdaterInitInputEnv, getInitProviderEnvVars, getInitProviderTextPromptValues, link, makeEnv, p, printAppSetup, provisionClientCredential, readHotUpdaterInitEnv, resolveInitProviderInputs, shouldAutoSelectOnlyInitResource, writeHotUpdaterFiles } from "@hot-updater/cli-tools";
|
|
5
|
+
import { ConfigBuilder, InitError, LegacyInfrastructureError, assembleServer, assertInfrastructureGenerationPayload, confirmInitInputPersistence, createHotUpdaterConfigScaffoldFromBuilder, createMigrator, fillReleaseLabels, getCwd, getHotUpdaterInitInputEnv, getInitProviderEnvVars, getInitProviderTextPromptValues, link, makeEnv, p, printAppSetup, provisionClientCredential, readHotUpdaterInitEnv, resolveInitProviderInputs, shouldAutoSelectOnlyInitResource, writeHotUpdaterFiles } from "@hot-updater/cli-tools";
|
|
6
6
|
import { postgres } from "@hot-updater/postgres";
|
|
7
7
|
import { apiKeys, insights, remoteConfig } from "@hot-updater/server/plugins";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
@@ -7129,6 +7129,7 @@ const runInit = async ({ build, envFile, secretsEnv }) => {
|
|
|
7129
7129
|
});
|
|
7130
7130
|
let credential;
|
|
7131
7131
|
try {
|
|
7132
|
+
await fillReleaseLabels(server);
|
|
7132
7133
|
credential = await provisionClientCredential(server, {
|
|
7133
7134
|
env: initInputEnv,
|
|
7134
7135
|
name: "Vercel init"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/vercel",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.0-rc.
|
|
4
|
+
"version": "1.2.0-rc.52",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"@vercel/cli-auth": "0.3.10",
|
|
42
42
|
"@vercel/cli-config": "0.3.1",
|
|
43
43
|
"pg": "8.13.1",
|
|
44
|
-
"@hot-updater/cli-tools": "1.2.0-rc.
|
|
45
|
-
"@hot-updater/
|
|
46
|
-
"@hot-updater/postgres": "1.2.0-rc.
|
|
47
|
-
"@hot-updater/
|
|
48
|
-
"@hot-updater/
|
|
44
|
+
"@hot-updater/cli-tools": "1.2.0-rc.52",
|
|
45
|
+
"@hot-updater/server": "1.2.0-rc.52",
|
|
46
|
+
"@hot-updater/postgres": "1.2.0-rc.52",
|
|
47
|
+
"@hot-updater/plugin-core": "1.2.0-rc.52",
|
|
48
|
+
"@hot-updater/protocol": "1.2.0-rc.52"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^20",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"execa": "9.5.2",
|
|
55
55
|
"kysely": "0.28.17",
|
|
56
56
|
"vitest": "4.1.4",
|
|
57
|
-
"@hot-updater/test-utils": "1.2.0-rc.
|
|
57
|
+
"@hot-updater/test-utils": "1.2.0-rc.52"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "tsdown",
|