@hot-updater/firebase 1.2.0-rc.30 → 1.2.0-rc.32

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.
@@ -2381,6 +2381,12 @@ const channels = defineTable({
2381
2381
  * `export_method` is how an `.ipa` was exported, read from its profile when
2382
2382
  * it registers and never changed; null on any other artifact, on an `.ipa`
2383
2383
  * whose profile couldn't be read, and on one registered before the column.
2384
+ * `native_app_version` is the app version the artifact itself reports, its
2385
+ * `CFBundleShortVersionString` or `versionName`, read from the artifact when
2386
+ * it registers and never changed, whatever the update strategy; `app_version`
2387
+ * stays the version OTAs target, null on a fingerprint build. It is null
2388
+ * when the artifact's can't be read, and on a build registered before the
2389
+ * column.
2384
2390
  * Boolean columns follow one rule: `is_*` for a fact about the row or
2385
2391
  * `should_*` for an instruction to the client, never null; a unique index over
2386
2392
  * the rows where one is true keys a derived slot, not the boolean.
@@ -2473,6 +2479,10 @@ const nativeBuilds = defineTable({
2473
2479
  type: "string",
2474
2480
  maxLength: 16,
2475
2481
  required: false
2482
+ },
2483
+ native_app_version: {
2484
+ type: "string",
2485
+ required: false
2476
2486
  }
2477
2487
  }, {
2478
2488
  key: ["id"],
@@ -4745,7 +4755,7 @@ const createKvAdapter = ({ store, tablePrefix = "" }) => {
4745
4755
  };
4746
4756
  //#endregion
4747
4757
  //#region ../../packages/server/dist/version.mjs
4748
- const HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.30";
4758
+ const HOT_UPDATER_SERVER_VERSION = "1.2.0-rc.32";
4749
4759
  //#endregion
4750
4760
  //#region ../../packages/server/dist/handlerVersionRoutes.mjs
4751
4761
  /**
@@ -6284,7 +6294,8 @@ const pick = (row) => ({
6284
6294
  is_store_build: row.is_store_build === true,
6285
6295
  is_sandbox: row.is_sandbox === true,
6286
6296
  sandbox_url_scheme: row.sandbox_url_scheme ?? null,
6287
- export_method: row.export_method ?? null
6297
+ export_method: row.export_method ?? null,
6298
+ native_app_version: row.native_app_version ?? null
6288
6299
  });
6289
6300
  /** The export methods an `.ipa` registers with. */
6290
6301
  const EXPORT_METHODS = /* @__PURE__ */ new Set([
@@ -6338,7 +6349,7 @@ const nativeBuildScopeKey = (scope) => {
6338
6349
  };
6339
6350
  /** Whether `bundleId` is a native build's built-in bundle: one unique read. */
6340
6351
  const isBuiltInBundle = async (db, bundleId) => await db.findOne("native_builds", { min_bundle_id: bundleId }) !== null;
6341
- const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, exportMethod, artifact }) => {
6352
+ const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, exportMethod, nativeAppVersion, artifact }) => {
6342
6353
  if (!isUUIDv7(id)) return "id must be a UUIDv7";
6343
6354
  if (!isUUIDv7(minBundleId)) return "minBundleId must be the UUIDv7 a release build compiles in";
6344
6355
  if (platform !== "ios" && platform !== "android") return "platform must be ios or android";
@@ -6355,6 +6366,7 @@ const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVer
6355
6366
  if (fingerprintHash === null === (appVersion === null)) return "exactly one of fingerprintHash and appVersion is required";
6356
6367
  if (buildKey !== null && !BUILD_KEY.test(buildKey)) return "buildKey must be nbk1: and a SHA-256, or null";
6357
6368
  if (buildNumber !== void 0 && buildNumber !== null && (buildNumber.trim().length === 0 || buildNumber.length > BUILD_NUMBER_MAX_LENGTH)) return `buildNumber must be the artifact's build number, up to ${BUILD_NUMBER_MAX_LENGTH} characters, or null`;
6369
+ if (nativeAppVersion !== void 0 && nativeAppVersion !== null && (typeof nativeAppVersion !== "string" || nativeAppVersion.trim().length === 0)) return "nativeAppVersion must be the artifact's app version, or null";
6358
6370
  const kinds = ARTIFACT_KINDS[platform];
6359
6371
  if (!kinds.includes(artifact.kind)) return `artifact.kind of an ${platform} build must be ${kinds.join(" or ")}`;
6360
6372
  if (exportMethod !== void 0 && exportMethod !== null) {
@@ -6393,7 +6405,8 @@ const createNativeBuildApi = (db, { now = Date.now } = {}) => ({
6393
6405
  is_store_build: false,
6394
6406
  is_sandbox: registration.isSandbox === true,
6395
6407
  sandbox_url_scheme: registration.sandboxUrlScheme ?? null,
6396
- export_method: registration.exportMethod ?? null
6408
+ export_method: registration.exportMethod ?? null,
6409
+ native_app_version: registration.nativeAppVersion ?? null
6397
6410
  };
6398
6411
  for (let attempt = 1;; attempt += 1) {
6399
6412
  await insertChannel(db, {
@@ -7484,7 +7497,7 @@ const refusingInvalid = async (operation) => {
7484
7497
  throw error;
7485
7498
  }
7486
7499
  };
7487
- 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)) && 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));
7500
+ 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));
7488
7501
  const scopeKeyOf = (params) => decodeMaybe(requireRouteParam(params, "scopeKey")) ?? "";
7489
7502
  /** Every admin route's handler, by the name `ADMIN_ROUTES` mounts it under. */
7490
7503
  const createAdminRouteHandlers = () => ({
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.30",
4
+ "version": "1.2.0-rc.32",
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/cli-tools": "1.2.0-rc.30",
42
- "@hot-updater/protocol": "1.2.0-rc.30",
43
- "@hot-updater/plugin-core": "1.2.0-rc.30",
44
- "@hot-updater/server": "1.2.0-rc.30"
41
+ "@hot-updater/cli-tools": "1.2.0-rc.32",
42
+ "@hot-updater/plugin-core": "1.2.0-rc.32",
43
+ "@hot-updater/server": "1.2.0-rc.32",
44
+ "@hot-updater/protocol": "1.2.0-rc.32"
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.30",
60
- "@hot-updater/test-utils": "1.2.0-rc.30"
59
+ "@hot-updater/mock": "1.2.0-rc.32",
60
+ "@hot-updater/test-utils": "1.2.0-rc.32"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "firebase-admin": ">=11.10.0",