@hot-updater/firebase 1.2.0-rc.40 → 1.2.0-rc.41
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/firebase/functions/index.cjs +134 -22
- package/package.json +7 -7
|
@@ -2359,7 +2359,10 @@ const channels = defineTable({
|
|
|
2359
2359
|
/**
|
|
2360
2360
|
* The native builds `native-build android` and `native-build ios` track, newest first
|
|
2361
2361
|
* in each scope: a platform, a channel, and the fingerprint or app version
|
|
2362
|
-
* the build compiled in.
|
|
2362
|
+
* the build compiled in. A sandbox build's scope has no channel: its app ID,
|
|
2363
|
+
* URL scheme, artifact kind and distribution in its place, so pull requests
|
|
2364
|
+
* reuse it across channels, while `channel_id` still names the channel it
|
|
2365
|
+
* embeds. `min_bundle_id` names the build's built-in bundle,
|
|
2363
2366
|
* a `bundles` row no release publishes. Its references keep no counters, so
|
|
2364
2367
|
* adding this table changes no existing one; a channel with builds is
|
|
2365
2368
|
* refused deletion through `byChannel`. `build_key` is the native build key
|
|
@@ -2374,8 +2377,8 @@ const channels = defineTable({
|
|
|
2374
2377
|
* newest build. The engine copies the scope key into `store_build_scope_key`
|
|
2375
2378
|
* for that build alone, so `byStoreBuild` holds one entry per scope at most,
|
|
2376
2379
|
* on every store, while any number of a scope's builds hold none.
|
|
2377
|
-
* `is_sandbox` is true on a sandbox build, set
|
|
2378
|
-
* changed, and `sandbox_url_scheme` is the URL scheme its artifact registers,
|
|
2380
|
+
* `is_sandbox` is true on a sandbox build, set from its artifact when it
|
|
2381
|
+
* registers and never changed, and `sandbox_url_scheme` is the URL scheme its artifact registers,
|
|
2379
2382
|
* which its preview links open; null on any other build, and on a sandbox
|
|
2380
2383
|
* build registered before the column, which registered the derived one.
|
|
2381
2384
|
* `export_method` is how an `.ipa` was exported, read from its profile when
|
|
@@ -4755,7 +4758,7 @@ const createKvAdapter = ({ store, tablePrefix = "" }) => {
|
|
|
4755
4758
|
};
|
|
4756
4759
|
//#endregion
|
|
4757
4760
|
//#region ../../packages/server/dist/version.mjs
|
|
4758
|
-
const HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.
|
|
4761
|
+
const HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.41";
|
|
4759
4762
|
//#endregion
|
|
4760
4763
|
//#region ../../packages/server/dist/handlerVersionRoutes.mjs
|
|
4761
4764
|
/**
|
|
@@ -6093,6 +6096,11 @@ const createIosDeviceApi = (db, { now = Date.now } = {}) => {
|
|
|
6093
6096
|
tx.update("ios_devices", row, { build_id: buildId });
|
|
6094
6097
|
});
|
|
6095
6098
|
},
|
|
6099
|
+
async findIosDeviceAccount() {
|
|
6100
|
+
const existing = await db.findOne("ios_device_account", { id: ACCOUNT_ROW });
|
|
6101
|
+
const issuerId = existing === null ? await accountOfRows() : existing.apple_issuer_id;
|
|
6102
|
+
return issuerId === null ? null : { issuerId };
|
|
6103
|
+
},
|
|
6096
6104
|
async claimIosDeviceAccount(issuerId) {
|
|
6097
6105
|
if (typeof issuerId !== "string" || issuerId.trim().length === 0 || issuerId.length > ISSUER_MAX_LENGTH) throw new IosDeviceInputError(`Invalid iOS device account: issuerId must be an App Store Connect issuer of at most ${ISSUER_MAX_LENGTH} characters.`);
|
|
6098
6106
|
const answer = (held) => ({
|
|
@@ -6272,6 +6280,20 @@ const SANDBOX_URL_SCHEME_MAX_LENGTH = 255;
|
|
|
6272
6280
|
* artifact registers, as `@hot-updater/protocol/native-artifact` reads it.
|
|
6273
6281
|
*/
|
|
6274
6282
|
const URL_SCHEME = new RegExp(`^[a-z][a-z0-9+.-]{0,254}$`);
|
|
6283
|
+
/**
|
|
6284
|
+
* A bundle identifier or application ID, as an artifact reports it: letters,
|
|
6285
|
+
* digits, dots, dashes and underscores, which a scope key holds as they are.
|
|
6286
|
+
*/
|
|
6287
|
+
const APP_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/;
|
|
6288
|
+
/** A fingerprint hash as a Release Catalog scope key holds it. */
|
|
6289
|
+
const FINGERPRINT_HASH = /^[A-Za-z0-9._~-]{1,255}$/;
|
|
6290
|
+
/** How each kind of artifact can install. */
|
|
6291
|
+
const DISTRIBUTIONS = {
|
|
6292
|
+
apk: ["direct"],
|
|
6293
|
+
app: ["direct"],
|
|
6294
|
+
aab: ["store"],
|
|
6295
|
+
ipa: ["direct", "store"]
|
|
6296
|
+
};
|
|
6275
6297
|
/** A native build or scope core cannot store or look up: the caller's input. */
|
|
6276
6298
|
var NativeBuildInputError = class extends TypeError {
|
|
6277
6299
|
name = "NativeBuildInputError";
|
|
@@ -6308,12 +6330,6 @@ const EXPORT_METHODS = /* @__PURE__ */ new Set([
|
|
|
6308
6330
|
"enterprise"
|
|
6309
6331
|
]);
|
|
6310
6332
|
/**
|
|
6311
|
-
* The channels only sandbox builds register on: a registration's `sandbox`
|
|
6312
|
-
* must agree with it. The registry's convention, as
|
|
6313
|
-
* `@hot-updater/protocol/native-artifact` checks it for a build's artifact.
|
|
6314
|
-
*/
|
|
6315
|
-
const SANDBOX_CHANNEL_PREFIX = "sandbox-";
|
|
6316
|
-
/**
|
|
6317
6333
|
* How many older builds of a scope one read takes, looking for one older than
|
|
6318
6334
|
* a bundle when a build made after the bundle is the newest.
|
|
6319
6335
|
*/
|
|
@@ -6324,13 +6340,42 @@ const MARK_ATTEMPTS = 8;
|
|
|
6324
6340
|
const BUILD_NUMBER_MAX_LENGTH = 64;
|
|
6325
6341
|
/** `native_builds.submitted_version`'s bound in core's schema. */
|
|
6326
6342
|
const SUBMITTED_VERSION_MAX_LENGTH = 255;
|
|
6343
|
+
const checkedScopeKey = (scopeKey) => {
|
|
6344
|
+
if (scopeKey.length > SCOPE_KEY_MAX_LENGTH) throw new NativeBuildInputError(`Invalid native build scope: its key is longer than ${SCOPE_KEY_MAX_LENGTH} characters; shorten the channel or app version.`);
|
|
6345
|
+
return scopeKey;
|
|
6346
|
+
};
|
|
6347
|
+
/**
|
|
6348
|
+
* How a registered artifact installs: an `.ipa` by its export method, and
|
|
6349
|
+
* `unknown` for one whose export no profile confirmed, which no lookup asks
|
|
6350
|
+
* for, so it is never reused as either.
|
|
6351
|
+
*/
|
|
6352
|
+
const registeredDistribution = (kind, exportMethod) => kind !== "ipa" ? DISTRIBUTIONS[kind][0] : exportMethod === void 0 || exportMethod === null ? "unknown" : exportMethod === "app-store" ? "store" : "direct";
|
|
6353
|
+
/**
|
|
6354
|
+
* A sandbox build scope's key, which names no channel: the app ID, URL
|
|
6355
|
+
* scheme, artifact kind and distribution in its place, then the fingerprint,
|
|
6356
|
+
* or the app-version strategy and the exact app version. `v1:sandbox:` is no
|
|
6357
|
+
* Release Catalog strategy, so it never meets a normal build's key.
|
|
6358
|
+
*/
|
|
6359
|
+
const sandboxScopeKey = (scope, sandbox) => {
|
|
6360
|
+
const { appId, urlScheme, artifactKind, distribution } = sandbox;
|
|
6361
|
+
const problem = typeof appId !== "string" || !APP_ID.test(appId) ? "its app ID must be a bundle identifier or application ID, up to 255 characters" : typeof urlScheme !== "string" || !URL_SCHEME.test(urlScheme) ? `its URL scheme must be a URL scheme in lower case, up to ${SANDBOX_URL_SCHEME_MAX_LENGTH} characters` : !ARTIFACT_KINDS[scope.platform]?.includes(artifactKind) ? `its artifact kind must be one an ${scope.platform} build makes` : distribution !== "unknown" && !DISTRIBUTIONS[artifactKind].includes(distribution) ? `an .${artifactKind} doesn't install as ${String(distribution)}` : scope.fingerprintHash !== null && !FINGERPRINT_HASH.test(scope.fingerprintHash) ? "its fingerprint hash must be 1-255 URL-safe ASCII characters" : null;
|
|
6362
|
+
if (problem !== null) throw new NativeBuildInputError(`Invalid sandbox build scope: ${problem}.`);
|
|
6363
|
+
const target = scope.fingerprintHash === null ? `app-version:${encodeURIComponent(scope.appVersion)}` : `fingerprint:${scope.fingerprintHash}`;
|
|
6364
|
+
return checkedScopeKey(`v1:sandbox:${scope.platform}:${appId}:${urlScheme}:${artifactKind}:${distribution}:${target}`);
|
|
6365
|
+
};
|
|
6327
6366
|
/**
|
|
6328
6367
|
* A native build scope's key: the Release Catalog scope key of a
|
|
6329
6368
|
* fingerprint, or of the app-version strategy followed by the exact app
|
|
6330
6369
|
* version the build compiled in. One key serves both strategies, so one
|
|
6331
|
-
* index finds the newest build of either.
|
|
6370
|
+
* index finds the newest build of either. A sandbox scope's key names no
|
|
6371
|
+
* channel, so pull requests find a sandbox build on any.
|
|
6332
6372
|
*/
|
|
6333
6373
|
const nativeBuildScopeKey = (scope) => {
|
|
6374
|
+
const { sandbox } = scope;
|
|
6375
|
+
if (sandbox !== void 0 && sandbox !== null) {
|
|
6376
|
+
if (sandbox.distribution !== "direct" && sandbox.distribution !== "store") throw new NativeBuildInputError("Invalid sandbox build scope: its distribution must be direct or store.");
|
|
6377
|
+
return sandboxScopeKey(scope, sandbox);
|
|
6378
|
+
}
|
|
6334
6379
|
let scopeKey;
|
|
6335
6380
|
try {
|
|
6336
6381
|
const channelKey = encodeChannelKey(scope.channel);
|
|
@@ -6347,8 +6392,31 @@ const nativeBuildScopeKey = (scope) => {
|
|
|
6347
6392
|
} catch (error) {
|
|
6348
6393
|
throw new NativeBuildInputError(`Invalid native build scope: ${error instanceof Error ? error.message : String(error)}.`);
|
|
6349
6394
|
}
|
|
6350
|
-
|
|
6351
|
-
|
|
6395
|
+
return checkedScopeKey(scopeKey);
|
|
6396
|
+
};
|
|
6397
|
+
/** The channel row a registration names, or the refusal of its channel. */
|
|
6398
|
+
const channelIdOf = (channel) => {
|
|
6399
|
+
try {
|
|
6400
|
+
return `channel:${encodeChannelKey(channel)}`;
|
|
6401
|
+
} catch (error) {
|
|
6402
|
+
throw new NativeBuildInputError(`Invalid native build scope: ${error instanceof Error ? error.message : String(error)}.`);
|
|
6403
|
+
}
|
|
6404
|
+
};
|
|
6405
|
+
/**
|
|
6406
|
+
* A registration's scope key, from the registration's own facts: a sandbox
|
|
6407
|
+
* build's from what its artifact says, whatever `sandbox` it names.
|
|
6408
|
+
*/
|
|
6409
|
+
const registrationScopeKey = (registration) => {
|
|
6410
|
+
channelIdOf(registration.channel);
|
|
6411
|
+
return registration.isSandbox === true ? sandboxScopeKey(registration, {
|
|
6412
|
+
appId: registration.sandboxAppId,
|
|
6413
|
+
urlScheme: registration.sandboxUrlScheme,
|
|
6414
|
+
artifactKind: registration.artifact.kind,
|
|
6415
|
+
distribution: registeredDistribution(registration.artifact.kind, registration.exportMethod)
|
|
6416
|
+
}) : nativeBuildScopeKey({
|
|
6417
|
+
...registration,
|
|
6418
|
+
sandbox: null
|
|
6419
|
+
});
|
|
6352
6420
|
};
|
|
6353
6421
|
/**
|
|
6354
6422
|
* Refuses a patch from a sandbox build's built-in bundle: no deploy patches
|
|
@@ -6360,19 +6428,24 @@ const refuseSandboxPatchBase = async (db, baseBundleId) => {
|
|
|
6360
6428
|
};
|
|
6361
6429
|
/** Whether `bundleId` is a native build's built-in bundle: one unique read. */
|
|
6362
6430
|
const isBuiltInBundle = async (db, bundleId) => await db.findOne("native_builds", { min_bundle_id: bundleId }) !== null;
|
|
6363
|
-
const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, exportMethod, nativeAppVersion, artifact }) => {
|
|
6431
|
+
const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, sandboxAppId, exportMethod, nativeAppVersion, artifact }) => {
|
|
6364
6432
|
if (!isUUIDv7(id)) return "id must be a UUIDv7";
|
|
6365
6433
|
if (!isUUIDv7(minBundleId)) return "minBundleId must be the UUIDv7 a release build compiles in";
|
|
6366
6434
|
if (platform !== "ios" && platform !== "android") return "platform must be ios or android";
|
|
6367
6435
|
if (channel.trim().length === 0) return "channel is required";
|
|
6368
6436
|
if (isSandbox !== void 0 && typeof isSandbox !== "boolean") return "isSandbox must be true or false";
|
|
6369
|
-
const reserved = channel.startsWith(SANDBOX_CHANNEL_PREFIX);
|
|
6370
|
-
if (isSandbox === true && !reserved) return `a sandbox build registers on a ${SANDBOX_CHANNEL_PREFIX}* channel, not ${channel}`;
|
|
6371
|
-
if (isSandbox !== true && reserved) return `channel ${channel} is reserved for sandbox builds`;
|
|
6372
6437
|
if (sandboxUrlScheme !== void 0 && sandboxUrlScheme !== null) {
|
|
6373
6438
|
if (isSandbox !== true) return "sandboxUrlScheme is a sandbox build's, and this isn't one";
|
|
6374
6439
|
if (typeof sandboxUrlScheme !== "string" || !URL_SCHEME.test(sandboxUrlScheme)) return `sandboxUrlScheme must be a URL scheme in lower case, up to ${SANDBOX_URL_SCHEME_MAX_LENGTH} characters, or null`;
|
|
6375
6440
|
}
|
|
6441
|
+
if (sandboxAppId !== void 0 && sandboxAppId !== null) {
|
|
6442
|
+
if (isSandbox !== true) return "sandboxAppId is a sandbox build's, and this isn't one";
|
|
6443
|
+
if (typeof sandboxAppId !== "string" || !APP_ID.test(sandboxAppId)) return "sandboxAppId must be the artifact's bundle identifier or application ID, up to 255 characters";
|
|
6444
|
+
}
|
|
6445
|
+
if (isSandbox === true) {
|
|
6446
|
+
if (sandboxUrlScheme === void 0 || sandboxUrlScheme === null) return "a sandbox build needs the sandboxUrlScheme its artifact registers";
|
|
6447
|
+
if (sandboxAppId === void 0 || sandboxAppId === null) return "a sandbox build needs the sandboxAppId its artifact reports, which an older hot-updater CLI doesn't send. Upgrade the hot-updater CLI to the version that matches this server, and build again";
|
|
6448
|
+
}
|
|
6376
6449
|
if (gitCommitHash !== null && gitCommitHash.length > GIT_COMMIT_HASH_MAX_LENGTH) return `gitCommitHash must be at most ${GIT_COMMIT_HASH_MAX_LENGTH} characters`;
|
|
6377
6450
|
if (fingerprintHash === null === (appVersion === null)) return "exactly one of fingerprintHash and appVersion is required";
|
|
6378
6451
|
if (buildKey !== null && !BUILD_KEY.test(buildKey)) return "buildKey must be nbk1: and a SHA-256, or null";
|
|
@@ -6392,8 +6465,8 @@ const createNativeBuildApi = (db, { now = Date.now } = {}) => ({
|
|
|
6392
6465
|
async registerNativeBuild(registration) {
|
|
6393
6466
|
const problem = problemOf(registration);
|
|
6394
6467
|
if (problem !== null) throw new NativeBuildInputError(`Invalid native build: ${problem}.`);
|
|
6395
|
-
const scopeKey =
|
|
6396
|
-
const channelId =
|
|
6468
|
+
const scopeKey = registrationScopeKey(registration);
|
|
6469
|
+
const channelId = channelIdOf(registration.channel);
|
|
6397
6470
|
const { embeddedBundle } = registration;
|
|
6398
6471
|
const row = {
|
|
6399
6472
|
id: registration.id,
|
|
@@ -6479,7 +6552,7 @@ const createNativeBuildApi = (db, { now = Date.now } = {}) => ({
|
|
|
6479
6552
|
});
|
|
6480
6553
|
};
|
|
6481
6554
|
const bundleId = options?.builtInOlderThan;
|
|
6482
|
-
if (bundleId !== void 0 && scope.
|
|
6555
|
+
if (bundleId !== void 0 && scope.sandbox !== void 0 && scope.sandbox !== null) return null;
|
|
6483
6556
|
const { rows } = await read(1);
|
|
6484
6557
|
const newest = rows[0];
|
|
6485
6558
|
if (newest === void 0) return null;
|
|
@@ -7492,7 +7565,8 @@ const nativeBuildScopeOf = (url) => {
|
|
|
7492
7565
|
const fingerprintHash = params.get("fingerprintHash");
|
|
7493
7566
|
const appVersion = params.get("appVersion");
|
|
7494
7567
|
if (platform === void 0 || !isText$2(channel) || fingerprintHash === null === (appVersion === null) || fingerprintHash === "" || appVersion === "") throw new HandlerBadRequestError("A native build lookup needs platform, channel, and fingerprintHash or appVersion.");
|
|
7495
|
-
|
|
7568
|
+
const sandbox = sandboxScopeOf(params);
|
|
7569
|
+
const scope = fingerprintHash !== null ? {
|
|
7496
7570
|
platform,
|
|
7497
7571
|
channel,
|
|
7498
7572
|
fingerprintHash,
|
|
@@ -7503,6 +7577,38 @@ const nativeBuildScopeOf = (url) => {
|
|
|
7503
7577
|
fingerprintHash: null,
|
|
7504
7578
|
appVersion
|
|
7505
7579
|
};
|
|
7580
|
+
return sandbox === null ? scope : {
|
|
7581
|
+
...scope,
|
|
7582
|
+
sandbox
|
|
7583
|
+
};
|
|
7584
|
+
};
|
|
7585
|
+
/** The query parameters a sandbox lookup names, all four or none. */
|
|
7586
|
+
const SANDBOX_SCOPE_PARAMS = [
|
|
7587
|
+
"sandboxAppId",
|
|
7588
|
+
"sandboxUrlScheme",
|
|
7589
|
+
"artifactKind",
|
|
7590
|
+
"distribution"
|
|
7591
|
+
];
|
|
7592
|
+
/**
|
|
7593
|
+
* A lookup's sandbox scope: null without one, and a bad request for one
|
|
7594
|
+
* named in part. Core checks each value.
|
|
7595
|
+
*/
|
|
7596
|
+
const sandboxScopeOf = (params) => {
|
|
7597
|
+
const [appId, urlScheme, artifactKind, distribution] = SANDBOX_SCOPE_PARAMS.map((name) => params.get(name));
|
|
7598
|
+
const named = [
|
|
7599
|
+
appId,
|
|
7600
|
+
urlScheme,
|
|
7601
|
+
artifactKind,
|
|
7602
|
+
distribution
|
|
7603
|
+
].filter((value) => value !== null).length;
|
|
7604
|
+
if (named === 0) return null;
|
|
7605
|
+
if (named !== SANDBOX_SCOPE_PARAMS.length) throw new HandlerBadRequestError(`A sandbox build lookup needs ${SANDBOX_SCOPE_PARAMS.join(", ")}.`);
|
|
7606
|
+
return {
|
|
7607
|
+
appId,
|
|
7608
|
+
urlScheme,
|
|
7609
|
+
artifactKind,
|
|
7610
|
+
distribution
|
|
7611
|
+
};
|
|
7506
7612
|
};
|
|
7507
7613
|
/** A native build or scope core refuses: a bad request. */
|
|
7508
7614
|
const refusingInvalid = async (operation) => {
|
|
@@ -7513,7 +7619,7 @@ const refusingInvalid = async (operation) => {
|
|
|
7513
7619
|
throw error;
|
|
7514
7620
|
}
|
|
7515
7621
|
};
|
|
7516
|
-
const isNativeBuildRegistration = (value) => isRecord$5(value) && isText$2(value.id) && isText$2(value.minBundleId) && typeof value.platform === "string" && isPlatform(value.platform) && isText$2(value.channel) && isTextOrNull$1(value.fingerprintHash) && isTextOrNull$1(value.appVersion) && value.fingerprintHash === null !== (value.appVersion === null) && isTextOrNull$1(value.gitCommitHash) && isTextOrNull$1(value.buildKey) && (value.buildNumber === void 0 || isTextOrNull$1(value.buildNumber)) && (value.isSandbox === void 0 || typeof value.isSandbox === "boolean") && (value.sandboxUrlScheme === void 0 || isTextOrNull$1(value.sandboxUrlScheme)) && (value.exportMethod === void 0 || isTextOrNull$1(value.exportMethod)) && (value.nativeAppVersion === void 0 || isTextOrNull$1(value.nativeAppVersion)) && isRecord$5(value.artifact) && typeof value.artifact.kind === "string" && NATIVE_BUILD_ARTIFACT_KINDS.has(value.artifact.kind) && isText$2(value.artifact.storageUri) && Number.isSafeInteger(value.artifact.byteSize) && value.artifact.byteSize >= 0 && isRecord$5(value.embeddedBundle) && isText$2(value.embeddedBundle.manifestStorageUri) && isText$2(value.embeddedBundle.manifestFileHash) && isText$2(value.embeddedBundle.assetBaseStorageUri) && (value.embeddedBundle.metadata === void 0 || isRecord$5(value.embeddedBundle.metadata));
|
|
7622
|
+
const isNativeBuildRegistration = (value) => isRecord$5(value) && isText$2(value.id) && isText$2(value.minBundleId) && typeof value.platform === "string" && isPlatform(value.platform) && isText$2(value.channel) && isTextOrNull$1(value.fingerprintHash) && isTextOrNull$1(value.appVersion) && value.fingerprintHash === null !== (value.appVersion === null) && isTextOrNull$1(value.gitCommitHash) && isTextOrNull$1(value.buildKey) && (value.buildNumber === void 0 || isTextOrNull$1(value.buildNumber)) && (value.isSandbox === void 0 || typeof value.isSandbox === "boolean") && (value.sandboxUrlScheme === void 0 || isTextOrNull$1(value.sandboxUrlScheme)) && (value.sandboxAppId === void 0 || isTextOrNull$1(value.sandboxAppId)) && (value.exportMethod === void 0 || isTextOrNull$1(value.exportMethod)) && (value.nativeAppVersion === void 0 || isTextOrNull$1(value.nativeAppVersion)) && isRecord$5(value.artifact) && typeof value.artifact.kind === "string" && NATIVE_BUILD_ARTIFACT_KINDS.has(value.artifact.kind) && isText$2(value.artifact.storageUri) && Number.isSafeInteger(value.artifact.byteSize) && value.artifact.byteSize >= 0 && isRecord$5(value.embeddedBundle) && isText$2(value.embeddedBundle.manifestStorageUri) && isText$2(value.embeddedBundle.manifestFileHash) && isText$2(value.embeddedBundle.assetBaseStorageUri) && (value.embeddedBundle.metadata === void 0 || isRecord$5(value.embeddedBundle.metadata));
|
|
7517
7623
|
const scopeKeyOf = (params) => decodeMaybe(requireRouteParam(params, "scopeKey")) ?? "";
|
|
7518
7624
|
/** Every admin route's handler, by the name `ADMIN_ROUTES` mounts it under. */
|
|
7519
7625
|
const createAdminRouteHandlers = () => ({
|
|
@@ -7733,6 +7839,7 @@ const createAdminRouteHandlers = () => ({
|
|
|
7733
7839
|
if (!isText$2(issuerId)) throw new HandlerBadRequestError("Claiming the iOS device account needs issuerId.");
|
|
7734
7840
|
return json$2({ data: await refusingInvalid(() => core.claimIosDeviceAccount(issuerId)) });
|
|
7735
7841
|
}),
|
|
7842
|
+
findIosDeviceAccount: onCore(async (core) => json$2({ data: await core.findIosDeviceAccount() })),
|
|
7736
7843
|
markIosDevicesInBuild: onCore(async (core, request) => {
|
|
7737
7844
|
const { buildId, ids } = await body(request);
|
|
7738
7845
|
if (!isText$2(buildId) || !Array.isArray(ids) || !ids.every((id) => isText$2(id))) throw new HandlerBadRequestError("Marking iOS devices in a build needs buildId and ids.");
|
|
@@ -7926,6 +8033,11 @@ const ADMIN_ROUTES = [
|
|
|
7926
8033
|
path: "/ios-devices/in-build",
|
|
7927
8034
|
handler: "markIosDevicesInBuild"
|
|
7928
8035
|
},
|
|
8036
|
+
{
|
|
8037
|
+
method: "GET",
|
|
8038
|
+
path: "/ios-devices/account",
|
|
8039
|
+
handler: "findIosDeviceAccount"
|
|
8040
|
+
},
|
|
7929
8041
|
{
|
|
7930
8042
|
method: "POST",
|
|
7931
8043
|
path: "/ios-devices/account",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/firebase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.0-rc.
|
|
4
|
+
"version": "1.2.0-rc.41",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"types": "dist/index.d.cts",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"hono": "4.12.34",
|
|
40
40
|
"google-auth-library": "10.7.0",
|
|
41
|
-
"@hot-updater/
|
|
42
|
-
"@hot-updater/
|
|
43
|
-
"@hot-updater/
|
|
44
|
-
"@hot-updater/
|
|
41
|
+
"@hot-updater/protocol": "1.2.0-rc.41",
|
|
42
|
+
"@hot-updater/plugin-core": "1.2.0-rc.41",
|
|
43
|
+
"@hot-updater/server": "1.2.0-rc.41",
|
|
44
|
+
"@hot-updater/cli-tools": "1.2.0-rc.41"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"firebase-tools": "15.29.0",
|
|
57
57
|
"fkill": "^9.0.0",
|
|
58
58
|
"mime": "^4.0.4",
|
|
59
|
-
"@hot-updater/mock": "1.2.0-rc.
|
|
60
|
-
"@hot-updater/test-utils": "1.2.0-rc.
|
|
59
|
+
"@hot-updater/mock": "1.2.0-rc.41",
|
|
60
|
+
"@hot-updater/test-utils": "1.2.0-rc.41"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"firebase-admin": ">=11.10.0",
|