@hot-updater/aws 1.0.0-rc.45 → 1.0.0-rc.46

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.
@@ -241,6 +241,13 @@ const isDatabaseJsonValue = (value) => {
241
241
  const isDatabaseJsonObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && isDatabaseJsonValue(value);
242
242
  const isDatabaseMetadataObject = (value) => isDatabaseJsonObject(value) && (!Object.hasOwn(value, "app_version") || typeof value["app_version"] === "string");
243
243
  //#endregion
244
+ //#region ../plugin-core/dist/databaseMetadata.mjs
245
+ const bundleMetadataToRow = (metadata) => {
246
+ if (metadata === void 0) return {};
247
+ if (!isDatabaseMetadataObject(metadata)) throw new DatabaseAdapterInputError("invalid-data");
248
+ return metadata;
249
+ };
250
+ //#endregion
244
251
  //#region ../../packages/protocol/dist/index.mjs
245
252
  const LETTER_DASH_NUMBER$2 = "[a-zA-Z0-9-]";
246
253
  const NUMERIC_IDENTIFIER$2 = String.raw`0|[1-9]\d*`;
@@ -354,7 +361,6 @@ function canonicalizeAppVersion(appVersion) {
354
361
  const version = coerce$1(appVersion);
355
362
  return version ? normalizeFull(version) : null;
356
363
  }
357
- const stripBundleArtifactMetadata = (metadata) => metadata;
358
364
  const getManifestStorageUri = (bundle) => bundle.manifestStorageUri;
359
365
  const getManifestFileHash = (bundle) => bundle.manifestFileHash;
360
366
  const getAssetBaseStorageUri = (bundle) => bundle.assetBaseStorageUri;
@@ -601,14 +607,6 @@ const NIL_UUID = "00000000-0000-0000-0000-000000000000";
601
607
  const UUID_V7_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
602
608
  const isUUIDv7 = (value) => typeof value === "string" && UUID_V7_PATTERN.test(value);
603
609
  //#endregion
604
- //#region ../plugin-core/dist/databaseMetadata.mjs
605
- const bundleMetadataToRow = (metadata) => {
606
- const value = stripBundleArtifactMetadata(metadata);
607
- if (value === void 0) return {};
608
- if (!isDatabaseMetadataObject(value)) throw new DatabaseAdapterInputError("invalid-data");
609
- return value;
610
- };
611
- //#endregion
612
610
  //#region ../plugin-core/dist/databaseRows.mjs
613
611
  const releaseRowToRelease = (row) => ({
614
612
  id: row.id,
@@ -666,7 +664,7 @@ const rowToBundle = (row, patchRows = []) => {
666
664
  id: row.id,
667
665
  platform: row.platform,
668
666
  gitCommitHash: row.git_commit_hash,
669
- metadata: stripBundleArtifactMetadata(row.metadata),
667
+ metadata: row.metadata,
670
668
  manifestStorageUri: row.manifest_storage_uri,
671
669
  manifestFileHash: row.manifest_file_hash,
672
670
  assetBaseStorageUri: row.asset_base_storage_uri,
@@ -674,6 +672,35 @@ const rowToBundle = (row, patchRows = []) => {
674
672
  };
675
673
  };
676
674
  //#endregion
675
+ //#region ../plugin-core/dist/uuidv7.mjs
676
+ const extractTimestampFromUUIDv7 = (uuid) => {
677
+ if (!isUUIDv7(uuid)) throw new TypeError("Expected a canonical lowercase UUIDv7");
678
+ const timestampHex = uuid.split("-").join("").slice(0, 12);
679
+ return Number.parseInt(timestampHex, 16);
680
+ };
681
+ function createUUIDv7FromTimestampHex(timestampHex) {
682
+ const randomBytes = /* @__PURE__ */ new Uint8Array(10);
683
+ crypto.getRandomValues(randomBytes);
684
+ const randomHex = Array.from(randomBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
685
+ const randA = randomHex.slice(0, 3);
686
+ const randBHex = randomHex.slice(3, 19);
687
+ const versionAndRandA = `7${randA}`;
688
+ const variantAndFirstRandB = (128 | parseInt(randBHex.slice(0, 2), 16) & 63).toString(16).padStart(2, "0");
689
+ return [
690
+ timestampHex.slice(0, 8),
691
+ timestampHex.slice(8, 12),
692
+ versionAndRandA,
693
+ variantAndFirstRandB + randBHex.slice(2, 4),
694
+ randBHex.slice(4, 16)
695
+ ].join("-");
696
+ }
697
+ const createUUIDv7 = () => createUUIDv7FromTimestampHex(Date.now().toString(16).padStart(12, "0"));
698
+ const createUUIDv7After = (floor, nowMs = Date.now()) => {
699
+ const timestamp = Math.max(nowMs, floor === null ? 0 : extractTimestampFromUUIDv7(floor) + 1);
700
+ if (!Number.isSafeInteger(timestamp) || timestamp < 0 || timestamp >= 2 ** 48) throw new RangeError("UUIDv7 timestamp is out of range");
701
+ return createUUIDv7FromTimestampHex(timestamp.toString(16).padStart(12, "0"));
702
+ };
703
+ //#endregion
677
704
  //#region ../plugin-core/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.mjs
678
705
  const LETTER_DASH_NUMBER$1 = "[a-zA-Z0-9-]";
679
706
  const NUMERIC_IDENTIFIER$1 = String.raw`0|[1-9]\d*`;
@@ -1020,42 +1047,6 @@ function coerce(value, options = {}) {
1020
1047
  return tryParse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
1021
1048
  }
1022
1049
  //#endregion
1023
- //#region ../plugin-core/dist/semverSatisfies.mjs
1024
- const semverSatisfies = (targetAppVersion, currentVersion) => {
1025
- const currentCoerce = coerce(currentVersion);
1026
- if (!currentCoerce) return false;
1027
- return satisfies(currentCoerce, targetAppVersion);
1028
- };
1029
- //#endregion
1030
- //#region ../plugin-core/dist/uuidv7.mjs
1031
- const extractTimestampFromUUIDv7 = (uuid) => {
1032
- if (!isUUIDv7(uuid)) throw new TypeError("Expected a canonical lowercase UUIDv7");
1033
- const timestampHex = uuid.split("-").join("").slice(0, 12);
1034
- return Number.parseInt(timestampHex, 16);
1035
- };
1036
- function createUUIDv7FromTimestampHex(timestampHex) {
1037
- const randomBytes = /* @__PURE__ */ new Uint8Array(10);
1038
- crypto.getRandomValues(randomBytes);
1039
- const randomHex = Array.from(randomBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
1040
- const randA = randomHex.slice(0, 3);
1041
- const randBHex = randomHex.slice(3, 19);
1042
- const versionAndRandA = `7${randA}`;
1043
- const variantAndFirstRandB = (128 | parseInt(randBHex.slice(0, 2), 16) & 63).toString(16).padStart(2, "0");
1044
- return [
1045
- timestampHex.slice(0, 8),
1046
- timestampHex.slice(8, 12),
1047
- versionAndRandA,
1048
- variantAndFirstRandB + randBHex.slice(2, 4),
1049
- randBHex.slice(4, 16)
1050
- ].join("-");
1051
- }
1052
- const createUUIDv7 = () => createUUIDv7FromTimestampHex(Date.now().toString(16).padStart(12, "0"));
1053
- const createUUIDv7After = (floor, nowMs = Date.now()) => {
1054
- const timestamp = Math.max(nowMs, floor === null ? 0 : extractTimestampFromUUIDv7(floor) + 1);
1055
- if (!Number.isSafeInteger(timestamp) || timestamp < 0 || timestamp >= 2 ** 48) throw new RangeError("UUIDv7 timestamp is out of range");
1056
- return createUUIDv7FromTimestampHex(timestamp.toString(16).padStart(12, "0"));
1057
- };
1058
- //#endregion
1059
1050
  //#region ../plugin-core/dist/releaseCatalogCompiler.mjs
1060
1051
  var ReleaseCatalogCompilationError = class extends Error {
1061
1052
  code;
@@ -1451,6 +1442,13 @@ var ReleaseCatalogMutationError = class extends Error {
1451
1442
  }
1452
1443
  };
1453
1444
  //#endregion
1445
+ //#region ../plugin-core/dist/semverSatisfies.mjs
1446
+ const semverSatisfies = (targetAppVersion, currentVersion) => {
1447
+ const currentCoerce = coerce(currentVersion);
1448
+ if (!currentCoerce) return false;
1449
+ return satisfies(currentCoerce, targetAppVersion);
1450
+ };
1451
+ //#endregion
1454
1452
  //#region ../plugin-core/dist/serverPlugin/definePlugin.mjs
1455
1453
  /** Declares a plugin; Hot Updater's own plugins and third-party ones use the same contract. */
1456
1454
  const definePlugin = (plugin) => plugin;
@@ -2398,9 +2396,6 @@ const getEmptyMigrationResult = () => ({
2398
2396
  execute: async () => {},
2399
2397
  getSQL: () => ""
2400
2398
  });
2401
- const assertSupportedMigrationMode = (options) => {
2402
- if (options.mode === "from-database") throw new Error("Hot Updater migrations support only mode: 'from-schema'.");
2403
- };
2404
2399
  //#endregion
2405
2400
  //#region ../plugin-core/dist/engine/db/settingsMigrator.mjs
2406
2401
  /** `schema.core`, or a v0 database's `version`. */
@@ -3484,7 +3479,6 @@ const resolveSchema = (modules) => {
3484
3479
  const createEngineMigrator = (options) => {
3485
3480
  const getVersion = async () => storedSchemaVersion(await options.readSettings());
3486
3481
  const makeResult = async (migrate = {}) => {
3487
- assertSupportedMigrationMode(migrate);
3488
3482
  const stored = await options.readSettings();
3489
3483
  refusePreEngineDatabase(options.adapterName, stored);
3490
3484
  if (Object.entries(options.settings).every(([key, value]) => stored.get(key) === value)) return getEmptyMigrationResult();
@@ -4591,7 +4585,7 @@ const createKvAdapter = ({ store, tablePrefix = "" }) => {
4591
4585
  };
4592
4586
  //#endregion
4593
4587
  //#region ../../packages/server/dist/version.mjs
4594
- const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.45";
4588
+ const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.46";
4595
4589
  //#endregion
4596
4590
  //#region ../../packages/server/dist/handlerVersionRoutes.mjs
4597
4591
  /**
@@ -7137,7 +7131,7 @@ const databaseOf = (value) => {
7137
7131
  if (isAdapter(value.adapter)) return value;
7138
7132
  if ("core" in value && "fetchAdmin" in value) throw new HotUpdaterConfigError("standaloneRepository reaches a server's admin API from the CLI and console. createHotUpdater needs the server's own database, such as kyselyAdapter(...).");
7139
7133
  }
7140
- throw new HotUpdaterConfigError("database must be a Hot Updater 1.0 database, such as kyselyAdapter(...) or postgres(...). Upgrade the provider package that created it.");
7134
+ throw new HotUpdaterConfigError("database must be a Hot Updater database adapter, such as kyselyAdapter(...) or postgres(...).");
7141
7135
  };
7142
7136
  /** The configured storage, when it is a storage adapter. */
7143
7137
  const storageOf = (value) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/aws",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.45",
4
+ "version": "1.0.0-rc.46",
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.0.0-rc.45",
49
- "@hot-updater/mock": "1.0.0-rc.45",
50
- "@hot-updater/test-utils": "1.0.0-rc.45"
48
+ "@hot-updater/protocol": "1.0.0-rc.46",
49
+ "@hot-updater/test-utils": "1.0.0-rc.46",
50
+ "@hot-updater/mock": "1.0.0-rc.46"
51
51
  },
52
52
  "dependencies": {
53
53
  "@aws-sdk/client-cloudfront": "3.1066.0",
@@ -63,9 +63,9 @@
63
63
  "@aws-sdk/lib-dynamodb": "3.1066.0",
64
64
  "@aws-sdk/s3-request-presigner": "3.1066.0",
65
65
  "hono": "4.12.34",
66
- "@hot-updater/cli-tools": "1.0.0-rc.45",
67
- "@hot-updater/plugin-core": "1.0.0-rc.45",
68
- "@hot-updater/server": "1.0.0-rc.45"
66
+ "@hot-updater/cli-tools": "1.0.0-rc.46",
67
+ "@hot-updater/plugin-core": "1.0.0-rc.46",
68
+ "@hot-updater/server": "1.0.0-rc.46"
69
69
  },
70
70
  "scripts": {
71
71
  "build": "tsdown",