@hot-updater/aws 0.29.8 → 0.30.0

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.
@@ -117,7 +117,7 @@ function getNumericCohortRolloutPosition(bundleId, cohortValue) {
117
117
  function isCohortEligibleForUpdate(bundleId, cohort, rolloutCohortCount, targetCohorts) {
118
118
  const normalizedCohort = cohort === null || cohort === void 0 ? void 0 : normalizeCohortValue(cohort);
119
119
  const normalizedTargetCohorts = targetCohorts?.map((targetCohort) => normalizeCohortValue(targetCohort)) ?? [];
120
- if (normalizedTargetCohorts.length > 0) return normalizedCohort !== void 0 && normalizedTargetCohorts.includes(normalizedCohort);
120
+ if (normalizedCohort !== void 0 && normalizedTargetCohorts.includes(normalizedCohort)) return true;
121
121
  const normalizedRolloutCount = normalizeRolloutCohortCount(rolloutCohortCount);
122
122
  if (normalizedRolloutCount <= 0) return false;
123
123
  if (normalizedCohort === void 0) return normalizedRolloutCount >= NUMERIC_COHORT_SIZE;
@@ -5685,6 +5685,9 @@ function findRoute(router, method, path) {
5685
5685
  }
5686
5686
  }
5687
5687
  //#endregion
5688
+ //#region ../../packages/server/src/version.ts
5689
+ const HOT_UPDATER_SERVER_VERSION = "0.30.0";
5690
+ //#endregion
5688
5691
  //#region ../../packages/server/src/handler.ts
5689
5692
  var HandlerBadRequestError = class extends Error {
5690
5693
  constructor(message) {
@@ -5693,7 +5696,7 @@ var HandlerBadRequestError = class extends Error {
5693
5696
  }
5694
5697
  };
5695
5698
  const handleVersion = async () => {
5696
- return new Response(JSON.stringify({ version: __VERSION__ }), {
5699
+ return new Response(JSON.stringify({ version: HOT_UPDATER_SERVER_VERSION }), {
5697
5700
  status: 200,
5698
5701
  headers: { "Content-Type": "application/json" }
5699
5702
  });
@@ -5861,8 +5864,10 @@ const routes = {
5861
5864
  function createHandler(api, options = {}) {
5862
5865
  const basePath = options.basePath ?? "/api";
5863
5866
  const updateCheckEnabled = options.routes?.updateCheck ?? true;
5867
+ const versionEnabled = options.routes?.version ?? true;
5864
5868
  const bundlesEnabled = options.routes?.bundles ?? true;
5865
5869
  const router = createRouter();
5870
+ if (versionEnabled) addRoute(router, "GET", "/version", "version");
5866
5871
  if (updateCheckEnabled) {
5867
5872
  addRoute(router, "GET", "/fingerprint/:platform/:fingerprintHash/:channel/:minBundleId/:bundleId", "fingerprintUpdateWithCohort");
5868
5873
  addRoute(router, "GET", "/fingerprint/:platform/:fingerprintHash/:channel/:minBundleId/:bundleId/:cohort", "fingerprintUpdateWithCohort");
@@ -5870,7 +5875,6 @@ function createHandler(api, options = {}) {
5870
5875
  addRoute(router, "GET", "/app-version/:platform/:appVersion/:channel/:minBundleId/:bundleId/:cohort", "appVersionUpdateWithCohort");
5871
5876
  }
5872
5877
  if (bundlesEnabled) {
5873
- addRoute(router, "GET", "/version", "version");
5874
5878
  addRoute(router, "GET", "/api/bundles/channels", "getChannels");
5875
5879
  addRoute(router, "GET", "/api/bundles/:id", "getBundle");
5876
5880
  addRoute(router, "GET", "/api/bundles", "getBundles");
@@ -8127,6 +8131,7 @@ const hotUpdater = createHotUpdater({
8127
8131
  basePath: HOT_UPDATER_BASE_PATH,
8128
8132
  routes: {
8129
8133
  updateCheck: true,
8134
+ version: true,
8130
8135
  bundles: false
8131
8136
  }
8132
8137
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/aws",
3
3
  "type": "module",
4
- "version": "0.29.8",
4
+ "version": "0.30.0",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",
@@ -42,10 +42,10 @@
42
42
  "es-toolkit": "^1.32.0",
43
43
  "execa": "9.5.2",
44
44
  "mime": "^4.0.4",
45
- "@hot-updater/core": "0.29.8",
46
- "@hot-updater/js": "0.29.8",
47
- "@hot-updater/test-utils": "0.29.8",
48
- "@hot-updater/mock": "0.29.8"
45
+ "@hot-updater/core": "0.30.0",
46
+ "@hot-updater/js": "0.30.0",
47
+ "@hot-updater/mock": "0.30.0",
48
+ "@hot-updater/test-utils": "0.30.0"
49
49
  },
50
50
  "dependencies": {
51
51
  "@aws-sdk/client-cloudfront": "3.1008.0",
@@ -60,9 +60,9 @@
60
60
  "@aws-sdk/lib-storage": "3.1008.0",
61
61
  "hono": "4.12.9",
62
62
  "aws-lambda": "1.0.7",
63
- "@hot-updater/plugin-core": "0.29.8",
64
- "@hot-updater/cli-tools": "0.29.8",
65
- "@hot-updater/server": "0.29.8"
63
+ "@hot-updater/cli-tools": "0.30.0",
64
+ "@hot-updater/plugin-core": "0.30.0",
65
+ "@hot-updater/server": "0.30.0"
66
66
  },
67
67
  "scripts": {
68
68
  "build": "tsdown",