@hot-updater/aws 1.2.0-rc.40 → 1.2.0-rc.42
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/lambda/index.cjs +134 -22
- package/package.json +8 -8
package/dist/lambda/index.cjs
CHANGED
|
@@ -2388,7 +2388,10 @@ const channels = defineTable({
|
|
|
2388
2388
|
/**
|
|
2389
2389
|
* The native builds `native-build android` and `native-build ios` track, newest first
|
|
2390
2390
|
* in each scope: a platform, a channel, and the fingerprint or app version
|
|
2391
|
-
* the build compiled in.
|
|
2391
|
+
* the build compiled in. A sandbox build's scope has no channel: its app ID,
|
|
2392
|
+
* URL scheme, artifact kind and distribution in its place, so pull requests
|
|
2393
|
+
* reuse it across channels, while `channel_id` still names the channel it
|
|
2394
|
+
* embeds. `min_bundle_id` names the build's built-in bundle,
|
|
2392
2395
|
* a `bundles` row no release publishes. Its references keep no counters, so
|
|
2393
2396
|
* adding this table changes no existing one; a channel with builds is
|
|
2394
2397
|
* refused deletion through `byChannel`. `build_key` is the native build key
|
|
@@ -2403,8 +2406,8 @@ const channels = defineTable({
|
|
|
2403
2406
|
* newest build. The engine copies the scope key into `store_build_scope_key`
|
|
2404
2407
|
* for that build alone, so `byStoreBuild` holds one entry per scope at most,
|
|
2405
2408
|
* on every store, while any number of a scope's builds hold none.
|
|
2406
|
-
* `is_sandbox` is true on a sandbox build, set
|
|
2407
|
-
* changed, and `sandbox_url_scheme` is the URL scheme its artifact registers,
|
|
2409
|
+
* `is_sandbox` is true on a sandbox build, set from its artifact when it
|
|
2410
|
+
* registers and never changed, and `sandbox_url_scheme` is the URL scheme its artifact registers,
|
|
2408
2411
|
* which its preview links open; null on any other build, and on a sandbox
|
|
2409
2412
|
* build registered before the column, which registered the derived one.
|
|
2410
2413
|
* `export_method` is how an `.ipa` was exported, read from its profile when
|
|
@@ -4784,7 +4787,7 @@ const createKvAdapter = ({ store, tablePrefix = "" }) => {
|
|
|
4784
4787
|
};
|
|
4785
4788
|
//#endregion
|
|
4786
4789
|
//#region ../../packages/server/dist/version.mjs
|
|
4787
|
-
const HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.
|
|
4790
|
+
const HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.42";
|
|
4788
4791
|
//#endregion
|
|
4789
4792
|
//#region ../../packages/server/dist/handlerVersionRoutes.mjs
|
|
4790
4793
|
/**
|
|
@@ -6122,6 +6125,11 @@ const createIosDeviceApi = (db, { now = Date.now } = {}) => {
|
|
|
6122
6125
|
tx.update("ios_devices", row, { build_id: buildId });
|
|
6123
6126
|
});
|
|
6124
6127
|
},
|
|
6128
|
+
async findIosDeviceAccount() {
|
|
6129
|
+
const existing = await db.findOne("ios_device_account", { id: ACCOUNT_ROW });
|
|
6130
|
+
const issuerId = existing === null ? await accountOfRows() : existing.apple_issuer_id;
|
|
6131
|
+
return issuerId === null ? null : { issuerId };
|
|
6132
|
+
},
|
|
6125
6133
|
async claimIosDeviceAccount(issuerId) {
|
|
6126
6134
|
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.`);
|
|
6127
6135
|
const answer = (held) => ({
|
|
@@ -6301,6 +6309,20 @@ const SANDBOX_URL_SCHEME_MAX_LENGTH = 255;
|
|
|
6301
6309
|
* artifact registers, as `@hot-updater/protocol/native-artifact` reads it.
|
|
6302
6310
|
*/
|
|
6303
6311
|
const URL_SCHEME = new RegExp(`^[a-z][a-z0-9+.-]{0,254}$`);
|
|
6312
|
+
/**
|
|
6313
|
+
* A bundle identifier or application ID, as an artifact reports it: letters,
|
|
6314
|
+
* digits, dots, dashes and underscores, which a scope key holds as they are.
|
|
6315
|
+
*/
|
|
6316
|
+
const APP_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/;
|
|
6317
|
+
/** A fingerprint hash as a Release Catalog scope key holds it. */
|
|
6318
|
+
const FINGERPRINT_HASH = /^[A-Za-z0-9._~-]{1,255}$/;
|
|
6319
|
+
/** How each kind of artifact can install. */
|
|
6320
|
+
const DISTRIBUTIONS = {
|
|
6321
|
+
apk: ["direct"],
|
|
6322
|
+
app: ["direct"],
|
|
6323
|
+
aab: ["store"],
|
|
6324
|
+
ipa: ["direct", "store"]
|
|
6325
|
+
};
|
|
6304
6326
|
/** A native build or scope core cannot store or look up: the caller's input. */
|
|
6305
6327
|
var NativeBuildInputError = class extends TypeError {
|
|
6306
6328
|
name = "NativeBuildInputError";
|
|
@@ -6337,12 +6359,6 @@ const EXPORT_METHODS = /* @__PURE__ */ new Set([
|
|
|
6337
6359
|
"enterprise"
|
|
6338
6360
|
]);
|
|
6339
6361
|
/**
|
|
6340
|
-
* The channels only sandbox builds register on: a registration's `sandbox`
|
|
6341
|
-
* must agree with it. The registry's convention, as
|
|
6342
|
-
* `@hot-updater/protocol/native-artifact` checks it for a build's artifact.
|
|
6343
|
-
*/
|
|
6344
|
-
const SANDBOX_CHANNEL_PREFIX = "sandbox-";
|
|
6345
|
-
/**
|
|
6346
6362
|
* How many older builds of a scope one read takes, looking for one older than
|
|
6347
6363
|
* a bundle when a build made after the bundle is the newest.
|
|
6348
6364
|
*/
|
|
@@ -6353,13 +6369,42 @@ const MARK_ATTEMPTS = 8;
|
|
|
6353
6369
|
const BUILD_NUMBER_MAX_LENGTH = 64;
|
|
6354
6370
|
/** `native_builds.submitted_version`'s bound in core's schema. */
|
|
6355
6371
|
const SUBMITTED_VERSION_MAX_LENGTH = 255;
|
|
6372
|
+
const checkedScopeKey = (scopeKey) => {
|
|
6373
|
+
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.`);
|
|
6374
|
+
return scopeKey;
|
|
6375
|
+
};
|
|
6376
|
+
/**
|
|
6377
|
+
* How a registered artifact installs: an `.ipa` by its export method, and
|
|
6378
|
+
* `unknown` for one whose export no profile confirmed, which no lookup asks
|
|
6379
|
+
* for, so it is never reused as either.
|
|
6380
|
+
*/
|
|
6381
|
+
const registeredDistribution = (kind, exportMethod) => kind !== "ipa" ? DISTRIBUTIONS[kind][0] : exportMethod === void 0 || exportMethod === null ? "unknown" : exportMethod === "app-store" ? "store" : "direct";
|
|
6382
|
+
/**
|
|
6383
|
+
* A sandbox build scope's key, which names no channel: the app ID, URL
|
|
6384
|
+
* scheme, artifact kind and distribution in its place, then the fingerprint,
|
|
6385
|
+
* or the app-version strategy and the exact app version. `v1:sandbox:` is no
|
|
6386
|
+
* Release Catalog strategy, so it never meets a normal build's key.
|
|
6387
|
+
*/
|
|
6388
|
+
const sandboxScopeKey = (scope, sandbox) => {
|
|
6389
|
+
const { appId, urlScheme, artifactKind, distribution } = sandbox;
|
|
6390
|
+
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;
|
|
6391
|
+
if (problem !== null) throw new NativeBuildInputError(`Invalid sandbox build scope: ${problem}.`);
|
|
6392
|
+
const target = scope.fingerprintHash === null ? `app-version:${encodeURIComponent(scope.appVersion)}` : `fingerprint:${scope.fingerprintHash}`;
|
|
6393
|
+
return checkedScopeKey(`v1:sandbox:${scope.platform}:${appId}:${urlScheme}:${artifactKind}:${distribution}:${target}`);
|
|
6394
|
+
};
|
|
6356
6395
|
/**
|
|
6357
6396
|
* A native build scope's key: the Release Catalog scope key of a
|
|
6358
6397
|
* fingerprint, or of the app-version strategy followed by the exact app
|
|
6359
6398
|
* version the build compiled in. One key serves both strategies, so one
|
|
6360
|
-
* index finds the newest build of either.
|
|
6399
|
+
* index finds the newest build of either. A sandbox scope's key names no
|
|
6400
|
+
* channel, so pull requests find a sandbox build on any.
|
|
6361
6401
|
*/
|
|
6362
6402
|
const nativeBuildScopeKey = (scope) => {
|
|
6403
|
+
const { sandbox } = scope;
|
|
6404
|
+
if (sandbox !== void 0 && sandbox !== null) {
|
|
6405
|
+
if (sandbox.distribution !== "direct" && sandbox.distribution !== "store") throw new NativeBuildInputError("Invalid sandbox build scope: its distribution must be direct or store.");
|
|
6406
|
+
return sandboxScopeKey(scope, sandbox);
|
|
6407
|
+
}
|
|
6363
6408
|
let scopeKey;
|
|
6364
6409
|
try {
|
|
6365
6410
|
const channelKey = encodeChannelKey(scope.channel);
|
|
@@ -6376,8 +6421,31 @@ const nativeBuildScopeKey = (scope) => {
|
|
|
6376
6421
|
} catch (error) {
|
|
6377
6422
|
throw new NativeBuildInputError(`Invalid native build scope: ${error instanceof Error ? error.message : String(error)}.`);
|
|
6378
6423
|
}
|
|
6379
|
-
|
|
6380
|
-
|
|
6424
|
+
return checkedScopeKey(scopeKey);
|
|
6425
|
+
};
|
|
6426
|
+
/** The channel row a registration names, or the refusal of its channel. */
|
|
6427
|
+
const channelIdOf = (channel) => {
|
|
6428
|
+
try {
|
|
6429
|
+
return `channel:${encodeChannelKey(channel)}`;
|
|
6430
|
+
} catch (error) {
|
|
6431
|
+
throw new NativeBuildInputError(`Invalid native build scope: ${error instanceof Error ? error.message : String(error)}.`);
|
|
6432
|
+
}
|
|
6433
|
+
};
|
|
6434
|
+
/**
|
|
6435
|
+
* A registration's scope key, from the registration's own facts: a sandbox
|
|
6436
|
+
* build's from what its artifact says, whatever `sandbox` it names.
|
|
6437
|
+
*/
|
|
6438
|
+
const registrationScopeKey = (registration) => {
|
|
6439
|
+
channelIdOf(registration.channel);
|
|
6440
|
+
return registration.isSandbox === true ? sandboxScopeKey(registration, {
|
|
6441
|
+
appId: registration.sandboxAppId,
|
|
6442
|
+
urlScheme: registration.sandboxUrlScheme,
|
|
6443
|
+
artifactKind: registration.artifact.kind,
|
|
6444
|
+
distribution: registeredDistribution(registration.artifact.kind, registration.exportMethod)
|
|
6445
|
+
}) : nativeBuildScopeKey({
|
|
6446
|
+
...registration,
|
|
6447
|
+
sandbox: null
|
|
6448
|
+
});
|
|
6381
6449
|
};
|
|
6382
6450
|
/**
|
|
6383
6451
|
* Refuses a patch from a sandbox build's built-in bundle: no deploy patches
|
|
@@ -6389,19 +6457,24 @@ const refuseSandboxPatchBase = async (db, baseBundleId) => {
|
|
|
6389
6457
|
};
|
|
6390
6458
|
/** Whether `bundleId` is a native build's built-in bundle: one unique read. */
|
|
6391
6459
|
const isBuiltInBundle = async (db, bundleId) => await db.findOne("native_builds", { min_bundle_id: bundleId }) !== null;
|
|
6392
|
-
const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, exportMethod, nativeAppVersion, artifact }) => {
|
|
6460
|
+
const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, sandboxAppId, exportMethod, nativeAppVersion, artifact }) => {
|
|
6393
6461
|
if (!isUUIDv7(id)) return "id must be a UUIDv7";
|
|
6394
6462
|
if (!isUUIDv7(minBundleId)) return "minBundleId must be the UUIDv7 a release build compiles in";
|
|
6395
6463
|
if (platform !== "ios" && platform !== "android") return "platform must be ios or android";
|
|
6396
6464
|
if (channel.trim().length === 0) return "channel is required";
|
|
6397
6465
|
if (isSandbox !== void 0 && typeof isSandbox !== "boolean") return "isSandbox must be true or false";
|
|
6398
|
-
const reserved = channel.startsWith(SANDBOX_CHANNEL_PREFIX);
|
|
6399
|
-
if (isSandbox === true && !reserved) return `a sandbox build registers on a ${SANDBOX_CHANNEL_PREFIX}* channel, not ${channel}`;
|
|
6400
|
-
if (isSandbox !== true && reserved) return `channel ${channel} is reserved for sandbox builds`;
|
|
6401
6466
|
if (sandboxUrlScheme !== void 0 && sandboxUrlScheme !== null) {
|
|
6402
6467
|
if (isSandbox !== true) return "sandboxUrlScheme is a sandbox build's, and this isn't one";
|
|
6403
6468
|
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`;
|
|
6404
6469
|
}
|
|
6470
|
+
if (sandboxAppId !== void 0 && sandboxAppId !== null) {
|
|
6471
|
+
if (isSandbox !== true) return "sandboxAppId is a sandbox build's, and this isn't one";
|
|
6472
|
+
if (typeof sandboxAppId !== "string" || !APP_ID.test(sandboxAppId)) return "sandboxAppId must be the artifact's bundle identifier or application ID, up to 255 characters";
|
|
6473
|
+
}
|
|
6474
|
+
if (isSandbox === true) {
|
|
6475
|
+
if (sandboxUrlScheme === void 0 || sandboxUrlScheme === null) return "a sandbox build needs the sandboxUrlScheme its artifact registers";
|
|
6476
|
+
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";
|
|
6477
|
+
}
|
|
6405
6478
|
if (gitCommitHash !== null && gitCommitHash.length > GIT_COMMIT_HASH_MAX_LENGTH) return `gitCommitHash must be at most ${GIT_COMMIT_HASH_MAX_LENGTH} characters`;
|
|
6406
6479
|
if (fingerprintHash === null === (appVersion === null)) return "exactly one of fingerprintHash and appVersion is required";
|
|
6407
6480
|
if (buildKey !== null && !BUILD_KEY.test(buildKey)) return "buildKey must be nbk1: and a SHA-256, or null";
|
|
@@ -6421,8 +6494,8 @@ const createNativeBuildApi = (db, { now = Date.now } = {}) => ({
|
|
|
6421
6494
|
async registerNativeBuild(registration) {
|
|
6422
6495
|
const problem = problemOf(registration);
|
|
6423
6496
|
if (problem !== null) throw new NativeBuildInputError(`Invalid native build: ${problem}.`);
|
|
6424
|
-
const scopeKey =
|
|
6425
|
-
const channelId =
|
|
6497
|
+
const scopeKey = registrationScopeKey(registration);
|
|
6498
|
+
const channelId = channelIdOf(registration.channel);
|
|
6426
6499
|
const { embeddedBundle } = registration;
|
|
6427
6500
|
const row = {
|
|
6428
6501
|
id: registration.id,
|
|
@@ -6508,7 +6581,7 @@ const createNativeBuildApi = (db, { now = Date.now } = {}) => ({
|
|
|
6508
6581
|
});
|
|
6509
6582
|
};
|
|
6510
6583
|
const bundleId = options?.builtInOlderThan;
|
|
6511
|
-
if (bundleId !== void 0 && scope.
|
|
6584
|
+
if (bundleId !== void 0 && scope.sandbox !== void 0 && scope.sandbox !== null) return null;
|
|
6512
6585
|
const { rows } = await read(1);
|
|
6513
6586
|
const newest = rows[0];
|
|
6514
6587
|
if (newest === void 0) return null;
|
|
@@ -7521,7 +7594,8 @@ const nativeBuildScopeOf = (url) => {
|
|
|
7521
7594
|
const fingerprintHash = params.get("fingerprintHash");
|
|
7522
7595
|
const appVersion = params.get("appVersion");
|
|
7523
7596
|
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.");
|
|
7524
|
-
|
|
7597
|
+
const sandbox = sandboxScopeOf(params);
|
|
7598
|
+
const scope = fingerprintHash !== null ? {
|
|
7525
7599
|
platform,
|
|
7526
7600
|
channel,
|
|
7527
7601
|
fingerprintHash,
|
|
@@ -7532,6 +7606,38 @@ const nativeBuildScopeOf = (url) => {
|
|
|
7532
7606
|
fingerprintHash: null,
|
|
7533
7607
|
appVersion
|
|
7534
7608
|
};
|
|
7609
|
+
return sandbox === null ? scope : {
|
|
7610
|
+
...scope,
|
|
7611
|
+
sandbox
|
|
7612
|
+
};
|
|
7613
|
+
};
|
|
7614
|
+
/** The query parameters a sandbox lookup names, all four or none. */
|
|
7615
|
+
const SANDBOX_SCOPE_PARAMS = [
|
|
7616
|
+
"sandboxAppId",
|
|
7617
|
+
"sandboxUrlScheme",
|
|
7618
|
+
"artifactKind",
|
|
7619
|
+
"distribution"
|
|
7620
|
+
];
|
|
7621
|
+
/**
|
|
7622
|
+
* A lookup's sandbox scope: null without one, and a bad request for one
|
|
7623
|
+
* named in part. Core checks each value.
|
|
7624
|
+
*/
|
|
7625
|
+
const sandboxScopeOf = (params) => {
|
|
7626
|
+
const [appId, urlScheme, artifactKind, distribution] = SANDBOX_SCOPE_PARAMS.map((name) => params.get(name));
|
|
7627
|
+
const named = [
|
|
7628
|
+
appId,
|
|
7629
|
+
urlScheme,
|
|
7630
|
+
artifactKind,
|
|
7631
|
+
distribution
|
|
7632
|
+
].filter((value) => value !== null).length;
|
|
7633
|
+
if (named === 0) return null;
|
|
7634
|
+
if (named !== SANDBOX_SCOPE_PARAMS.length) throw new HandlerBadRequestError(`A sandbox build lookup needs ${SANDBOX_SCOPE_PARAMS.join(", ")}.`);
|
|
7635
|
+
return {
|
|
7636
|
+
appId,
|
|
7637
|
+
urlScheme,
|
|
7638
|
+
artifactKind,
|
|
7639
|
+
distribution
|
|
7640
|
+
};
|
|
7535
7641
|
};
|
|
7536
7642
|
/** A native build or scope core refuses: a bad request. */
|
|
7537
7643
|
const refusingInvalid = async (operation) => {
|
|
@@ -7542,7 +7648,7 @@ const refusingInvalid = async (operation) => {
|
|
|
7542
7648
|
throw error;
|
|
7543
7649
|
}
|
|
7544
7650
|
};
|
|
7545
|
-
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));
|
|
7651
|
+
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));
|
|
7546
7652
|
const scopeKeyOf = (params) => decodeMaybe(requireRouteParam(params, "scopeKey")) ?? "";
|
|
7547
7653
|
/** Every admin route's handler, by the name `ADMIN_ROUTES` mounts it under. */
|
|
7548
7654
|
const createAdminRouteHandlers = () => ({
|
|
@@ -7762,6 +7868,7 @@ const createAdminRouteHandlers = () => ({
|
|
|
7762
7868
|
if (!isText$2(issuerId)) throw new HandlerBadRequestError("Claiming the iOS device account needs issuerId.");
|
|
7763
7869
|
return json$2({ data: await refusingInvalid(() => core.claimIosDeviceAccount(issuerId)) });
|
|
7764
7870
|
}),
|
|
7871
|
+
findIosDeviceAccount: onCore(async (core) => json$2({ data: await core.findIosDeviceAccount() })),
|
|
7765
7872
|
markIosDevicesInBuild: onCore(async (core, request) => {
|
|
7766
7873
|
const { buildId, ids } = await body(request);
|
|
7767
7874
|
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.");
|
|
@@ -7955,6 +8062,11 @@ const ADMIN_ROUTES = [
|
|
|
7955
8062
|
path: "/ios-devices/in-build",
|
|
7956
8063
|
handler: "markIosDevicesInBuild"
|
|
7957
8064
|
},
|
|
8065
|
+
{
|
|
8066
|
+
method: "GET",
|
|
8067
|
+
path: "/ios-devices/account",
|
|
8068
|
+
handler: "findIosDeviceAccount"
|
|
8069
|
+
},
|
|
7958
8070
|
{
|
|
7959
8071
|
method: "POST",
|
|
7960
8072
|
path: "/ios-devices/account",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/aws",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.0-rc.
|
|
4
|
+
"version": "1.2.0-rc.42",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"es-toolkit": "^1.32.0",
|
|
46
46
|
"execa": "9.5.2",
|
|
47
47
|
"mime": "^4.0.4",
|
|
48
|
-
"@hot-updater/protocol": "1.2.0-rc.
|
|
49
|
-
"@hot-updater/
|
|
50
|
-
"@hot-updater/
|
|
48
|
+
"@hot-updater/protocol": "1.2.0-rc.42",
|
|
49
|
+
"@hot-updater/test-utils": "1.2.0-rc.42",
|
|
50
|
+
"@hot-updater/mock": "1.2.0-rc.42"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@aws-sdk/client-cloudfront": "3.1066.0",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"@aws-sdk/lib-dynamodb": "3.1066.0",
|
|
65
65
|
"@aws-sdk/s3-request-presigner": "3.1066.0",
|
|
66
66
|
"hono": "4.12.34",
|
|
67
|
-
"@hot-updater/cli-tools": "1.2.0-rc.
|
|
68
|
-
"@hot-updater/
|
|
69
|
-
"@hot-updater/
|
|
70
|
-
"@hot-updater/storage-s3": "1.2.0-rc.
|
|
67
|
+
"@hot-updater/cli-tools": "1.2.0-rc.42",
|
|
68
|
+
"@hot-updater/plugin-core": "1.2.0-rc.42",
|
|
69
|
+
"@hot-updater/server": "1.2.0-rc.42",
|
|
70
|
+
"@hot-updater/storage-s3": "1.2.0-rc.42"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "tsdown",
|