@hot-updater/server 1.2.0-rc.30 → 1.2.0-rc.31

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.
@@ -51,7 +51,8 @@ const pick = (row) => ({
51
51
  is_store_build: row.is_store_build === true,
52
52
  is_sandbox: row.is_sandbox === true,
53
53
  sandbox_url_scheme: row.sandbox_url_scheme ?? null,
54
- export_method: row.export_method ?? null
54
+ export_method: row.export_method ?? null,
55
+ native_app_version: row.native_app_version ?? null
55
56
  });
56
57
  /** The export methods an `.ipa` registers with. */
57
58
  const EXPORT_METHODS = /* @__PURE__ */ new Set([
@@ -105,7 +106,7 @@ const nativeBuildScopeKey = (scope) => {
105
106
  };
106
107
  /** Whether `bundleId` is a native build's built-in bundle: one unique read. */
107
108
  const isBuiltInBundle = async (db, bundleId) => await db.findOne("native_builds", { min_bundle_id: bundleId }) !== null;
108
- const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, exportMethod, artifact }) => {
109
+ const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, exportMethod, nativeAppVersion, artifact }) => {
109
110
  if (!(0, _hot_updater_plugin_core.isUUIDv7)(id)) return "id must be a UUIDv7";
110
111
  if (!(0, _hot_updater_plugin_core.isUUIDv7)(minBundleId)) return "minBundleId must be the UUIDv7 a release build compiles in";
111
112
  if (platform !== "ios" && platform !== "android") return "platform must be ios or android";
@@ -122,6 +123,7 @@ const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVer
122
123
  if (fingerprintHash === null === (appVersion === null)) return "exactly one of fingerprintHash and appVersion is required";
123
124
  if (buildKey !== null && !BUILD_KEY.test(buildKey)) return "buildKey must be nbk1: and a SHA-256, or null";
124
125
  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`;
126
+ if (nativeAppVersion !== void 0 && nativeAppVersion !== null && (typeof nativeAppVersion !== "string" || nativeAppVersion.trim().length === 0)) return "nativeAppVersion must be the artifact's app version, or null";
125
127
  const kinds = ARTIFACT_KINDS[platform];
126
128
  if (!kinds.includes(artifact.kind)) return `artifact.kind of an ${platform} build must be ${kinds.join(" or ")}`;
127
129
  if (exportMethod !== void 0 && exportMethod !== null) {
@@ -160,7 +162,8 @@ const createNativeBuildApi = (db, { now = Date.now } = {}) => ({
160
162
  is_store_build: false,
161
163
  is_sandbox: registration.isSandbox === true,
162
164
  sandbox_url_scheme: registration.sandboxUrlScheme ?? null,
163
- export_method: registration.exportMethod ?? null
165
+ export_method: registration.exportMethod ?? null,
166
+ native_app_version: registration.nativeAppVersion ?? null
164
167
  };
165
168
  for (let attempt = 1;; attempt += 1) {
166
169
  await require_writes.insertChannel(db, {
@@ -51,7 +51,8 @@ const pick = (row) => ({
51
51
  is_store_build: row.is_store_build === true,
52
52
  is_sandbox: row.is_sandbox === true,
53
53
  sandbox_url_scheme: row.sandbox_url_scheme ?? null,
54
- export_method: row.export_method ?? null
54
+ export_method: row.export_method ?? null,
55
+ native_app_version: row.native_app_version ?? null
55
56
  });
56
57
  /** The export methods an `.ipa` registers with. */
57
58
  const EXPORT_METHODS = /* @__PURE__ */ new Set([
@@ -105,7 +106,7 @@ const nativeBuildScopeKey = (scope) => {
105
106
  };
106
107
  /** Whether `bundleId` is a native build's built-in bundle: one unique read. */
107
108
  const isBuiltInBundle = async (db, bundleId) => await db.findOne("native_builds", { min_bundle_id: bundleId }) !== null;
108
- const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, exportMethod, artifact }) => {
109
+ const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVersion, gitCommitHash, buildKey, buildNumber, isSandbox, sandboxUrlScheme, exportMethod, nativeAppVersion, artifact }) => {
109
110
  if (!isUUIDv7(id)) return "id must be a UUIDv7";
110
111
  if (!isUUIDv7(minBundleId)) return "minBundleId must be the UUIDv7 a release build compiles in";
111
112
  if (platform !== "ios" && platform !== "android") return "platform must be ios or android";
@@ -122,6 +123,7 @@ const problemOf = ({ id, minBundleId, platform, channel, fingerprintHash, appVer
122
123
  if (fingerprintHash === null === (appVersion === null)) return "exactly one of fingerprintHash and appVersion is required";
123
124
  if (buildKey !== null && !BUILD_KEY.test(buildKey)) return "buildKey must be nbk1: and a SHA-256, or null";
124
125
  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`;
126
+ if (nativeAppVersion !== void 0 && nativeAppVersion !== null && (typeof nativeAppVersion !== "string" || nativeAppVersion.trim().length === 0)) return "nativeAppVersion must be the artifact's app version, or null";
125
127
  const kinds = ARTIFACT_KINDS[platform];
126
128
  if (!kinds.includes(artifact.kind)) return `artifact.kind of an ${platform} build must be ${kinds.join(" or ")}`;
127
129
  if (exportMethod !== void 0 && exportMethod !== null) {
@@ -160,7 +162,8 @@ const createNativeBuildApi = (db, { now = Date.now } = {}) => ({
160
162
  is_store_build: false,
161
163
  is_sandbox: registration.isSandbox === true,
162
164
  sandbox_url_scheme: registration.sandboxUrlScheme ?? null,
163
- export_method: registration.exportMethod ?? null
165
+ export_method: registration.exportMethod ?? null,
166
+ native_app_version: registration.nativeAppVersion ?? null
164
167
  };
165
168
  for (let attempt = 1;; attempt += 1) {
166
169
  await insertChannel(db, {
@@ -173,7 +173,7 @@ const refusingInvalid = async (operation) => {
173
173
  throw error;
174
174
  }
175
175
  };
176
- const isNativeBuildRegistration = (value) => isRecord(value) && isText(value.id) && isText(value.minBundleId) && typeof value.platform === "string" && require_handlerParameters.isPlatform(value.platform) && isText(value.channel) && isTextOrNull(value.fingerprintHash) && isTextOrNull(value.appVersion) && value.fingerprintHash === null !== (value.appVersion === null) && isTextOrNull(value.gitCommitHash) && isTextOrNull(value.buildKey) && (value.buildNumber === void 0 || isTextOrNull(value.buildNumber)) && (value.isSandbox === void 0 || typeof value.isSandbox === "boolean") && (value.sandboxUrlScheme === void 0 || isTextOrNull(value.sandboxUrlScheme)) && (value.exportMethod === void 0 || isTextOrNull(value.exportMethod)) && isRecord(value.artifact) && typeof value.artifact.kind === "string" && NATIVE_BUILD_ARTIFACT_KINDS.has(value.artifact.kind) && isText(value.artifact.storageUri) && Number.isSafeInteger(value.artifact.byteSize) && value.artifact.byteSize >= 0 && isRecord(value.embeddedBundle) && isText(value.embeddedBundle.manifestStorageUri) && isText(value.embeddedBundle.manifestFileHash) && isText(value.embeddedBundle.assetBaseStorageUri) && (value.embeddedBundle.metadata === void 0 || isRecord(value.embeddedBundle.metadata));
176
+ const isNativeBuildRegistration = (value) => isRecord(value) && isText(value.id) && isText(value.minBundleId) && typeof value.platform === "string" && require_handlerParameters.isPlatform(value.platform) && isText(value.channel) && isTextOrNull(value.fingerprintHash) && isTextOrNull(value.appVersion) && value.fingerprintHash === null !== (value.appVersion === null) && isTextOrNull(value.gitCommitHash) && isTextOrNull(value.buildKey) && (value.buildNumber === void 0 || isTextOrNull(value.buildNumber)) && (value.isSandbox === void 0 || typeof value.isSandbox === "boolean") && (value.sandboxUrlScheme === void 0 || isTextOrNull(value.sandboxUrlScheme)) && (value.exportMethod === void 0 || isTextOrNull(value.exportMethod)) && (value.nativeAppVersion === void 0 || isTextOrNull(value.nativeAppVersion)) && isRecord(value.artifact) && typeof value.artifact.kind === "string" && NATIVE_BUILD_ARTIFACT_KINDS.has(value.artifact.kind) && isText(value.artifact.storageUri) && Number.isSafeInteger(value.artifact.byteSize) && value.artifact.byteSize >= 0 && isRecord(value.embeddedBundle) && isText(value.embeddedBundle.manifestStorageUri) && isText(value.embeddedBundle.manifestFileHash) && isText(value.embeddedBundle.assetBaseStorageUri) && (value.embeddedBundle.metadata === void 0 || isRecord(value.embeddedBundle.metadata));
177
177
  const scopeKeyOf = (params) => require_handlerParameters.decodeMaybe(require_handlerParameters.requireRouteParam(params, "scopeKey")) ?? "";
178
178
  /** Every admin route's handler, by the name `ADMIN_ROUTES` mounts it under. */
179
179
  const createAdminRouteHandlers = () => ({
@@ -173,7 +173,7 @@ const refusingInvalid = async (operation) => {
173
173
  throw error;
174
174
  }
175
175
  };
176
- const isNativeBuildRegistration = (value) => isRecord(value) && isText(value.id) && isText(value.minBundleId) && typeof value.platform === "string" && isPlatform(value.platform) && isText(value.channel) && isTextOrNull(value.fingerprintHash) && isTextOrNull(value.appVersion) && value.fingerprintHash === null !== (value.appVersion === null) && isTextOrNull(value.gitCommitHash) && isTextOrNull(value.buildKey) && (value.buildNumber === void 0 || isTextOrNull(value.buildNumber)) && (value.isSandbox === void 0 || typeof value.isSandbox === "boolean") && (value.sandboxUrlScheme === void 0 || isTextOrNull(value.sandboxUrlScheme)) && (value.exportMethod === void 0 || isTextOrNull(value.exportMethod)) && isRecord(value.artifact) && typeof value.artifact.kind === "string" && NATIVE_BUILD_ARTIFACT_KINDS.has(value.artifact.kind) && isText(value.artifact.storageUri) && Number.isSafeInteger(value.artifact.byteSize) && value.artifact.byteSize >= 0 && isRecord(value.embeddedBundle) && isText(value.embeddedBundle.manifestStorageUri) && isText(value.embeddedBundle.manifestFileHash) && isText(value.embeddedBundle.assetBaseStorageUri) && (value.embeddedBundle.metadata === void 0 || isRecord(value.embeddedBundle.metadata));
176
+ const isNativeBuildRegistration = (value) => isRecord(value) && isText(value.id) && isText(value.minBundleId) && typeof value.platform === "string" && isPlatform(value.platform) && isText(value.channel) && isTextOrNull(value.fingerprintHash) && isTextOrNull(value.appVersion) && value.fingerprintHash === null !== (value.appVersion === null) && isTextOrNull(value.gitCommitHash) && isTextOrNull(value.buildKey) && (value.buildNumber === void 0 || isTextOrNull(value.buildNumber)) && (value.isSandbox === void 0 || typeof value.isSandbox === "boolean") && (value.sandboxUrlScheme === void 0 || isTextOrNull(value.sandboxUrlScheme)) && (value.exportMethod === void 0 || isTextOrNull(value.exportMethod)) && (value.nativeAppVersion === void 0 || isTextOrNull(value.nativeAppVersion)) && isRecord(value.artifact) && typeof value.artifact.kind === "string" && NATIVE_BUILD_ARTIFACT_KINDS.has(value.artifact.kind) && isText(value.artifact.storageUri) && Number.isSafeInteger(value.artifact.byteSize) && value.artifact.byteSize >= 0 && isRecord(value.embeddedBundle) && isText(value.embeddedBundle.manifestStorageUri) && isText(value.embeddedBundle.manifestFileHash) && isText(value.embeddedBundle.assetBaseStorageUri) && (value.embeddedBundle.metadata === void 0 || isRecord(value.embeddedBundle.metadata));
177
177
  const scopeKeyOf = (params) => decodeMaybe(requireRouteParam(params, "scopeKey")) ?? "";
178
178
  /** Every admin route's handler, by the name `ADMIN_ROUTES` mounts it under. */
179
179
  const createAdminRouteHandlers = () => ({
package/dist/package.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "1.2.0-rc.30";
2
+ var version = "1.2.0-rc.31";
3
3
  //#endregion
4
4
  Object.defineProperty(exports, "version", {
5
5
  enumerable: true,
package/dist/package.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "1.2.0-rc.30";
2
+ var version = "1.2.0-rc.31";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/server",
3
- "version": "1.2.0-rc.30",
3
+ "version": "1.2.0-rc.31",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -50,11 +50,11 @@
50
50
  "dependencies": {
51
51
  "rou3": "0.7.9",
52
52
  "verkit": "0.4.0",
53
- "@hot-updater/plugin-core": "1.2.0-rc.30",
54
- "@hot-updater/protocol": "1.2.0-rc.30",
55
- "@hot-updater/plugin-api-keys": "1.2.0-rc.30",
56
- "@hot-updater/plugin-insights": "1.2.0-rc.30",
57
- "@hot-updater/plugin-remote-config": "1.2.0-rc.30"
53
+ "@hot-updater/protocol": "1.2.0-rc.31",
54
+ "@hot-updater/plugin-api-keys": "1.2.0-rc.31",
55
+ "@hot-updater/plugin-core": "1.2.0-rc.31",
56
+ "@hot-updater/plugin-insights": "1.2.0-rc.31",
57
+ "@hot-updater/plugin-remote-config": "1.2.0-rc.31"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@prisma/client": "*",