@hot-updater/aws 0.36.8 → 0.36.11

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.
@@ -35,7 +35,7 @@ let _aws_sdk_client_ssm = require("@aws-sdk/client-ssm");
35
35
  let _aws_sdk_cloudfront_signer = require("@aws-sdk/cloudfront-signer");
36
36
  //#endregion
37
37
  //#region ../../packages/server/dist/version.mjs
38
- const HOT_UPDATER_SERVER_VERSION = "0.36.8";
38
+ const HOT_UPDATER_SERVER_VERSION = "0.36.11";
39
39
  //#endregion
40
40
  //#region ../../packages/server/dist/internalRouter.mjs
41
41
  const normalizePath = (path) => {
@@ -2296,21 +2296,20 @@ const COMPRESSION_FORMATS = {
2296
2296
  }
2297
2297
  };
2298
2298
  /**
2299
- * Detects compression format from filename
2300
- * @param filename The filename to detect format from
2301
- * @returns Compression format information
2299
+ * Finds the compression format matching a filename extension
2300
+ * @param filename The filename to match
2301
+ * @returns Compression format information, or undefined when nothing matches
2302
2302
  */
2303
- function detectCompressionFormat(filename) {
2304
- for (const info of Object.values(COMPRESSION_FORMATS)) if (filename.endsWith(info.fileExtension)) return info;
2305
- return COMPRESSION_FORMATS.zip;
2303
+ function findCompressionFormat(filename) {
2304
+ return Object.values(COMPRESSION_FORMATS).find((info) => filename.endsWith(info.fileExtension));
2306
2305
  }
2307
2306
  /**
2308
2307
  * Gets MIME type for a filename
2309
2308
  * @param filename The filename to get MIME type for
2310
- * @returns MIME type string
2309
+ * @returns MIME type string, or undefined when the filename is not an archive
2311
2310
  */
2312
2311
  function getCompressionMimeType(filename) {
2313
- return detectCompressionFormat(filename).mimeType;
2312
+ return findCompressionFormat(filename)?.mimeType;
2314
2313
  }
2315
2314
  /**
2316
2315
  * Gets Content-Type for a bundle file with 3-tier fallback
@@ -3971,7 +3970,7 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
3971
3970
  //#endregion
3972
3971
  //#region ../plugin-core/dist/createStorageKeyBuilder.mjs
3973
3972
  const createStorageKeyBuilder = (basePath) => (...args) => {
3974
- return [basePath || "", ...args].filter(Boolean).join("/");
3973
+ return [basePath?.replace(/^\/+|\/+$/g, "") ?? "", ...args].filter(Boolean).join("/");
3975
3974
  };
3976
3975
  //#endregion
3977
3976
  //#region ../plugin-core/dist/createStoragePlugin.mjs
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/aws",
3
3
  "type": "module",
4
- "version": "0.36.8",
4
+ "version": "0.36.11",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",
@@ -50,10 +50,10 @@
50
50
  "es-toolkit": "^1.32.0",
51
51
  "execa": "9.5.2",
52
52
  "mime": "^4.0.4",
53
- "@hot-updater/core": "0.36.8",
54
- "@hot-updater/js": "0.36.8",
55
- "@hot-updater/test-utils": "0.36.8",
56
- "@hot-updater/mock": "0.36.8"
53
+ "@hot-updater/core": "0.36.11",
54
+ "@hot-updater/js": "0.36.11",
55
+ "@hot-updater/mock": "0.36.11",
56
+ "@hot-updater/test-utils": "0.36.11"
57
57
  },
58
58
  "dependencies": {
59
59
  "@aws-sdk/client-cloudfront": "3.1066.0",
@@ -68,9 +68,9 @@
68
68
  "@aws-sdk/lib-storage": "3.1066.0",
69
69
  "hono": "4.12.34",
70
70
  "aws-lambda": "1.0.7",
71
- "@hot-updater/cli-tools": "0.36.8",
72
- "@hot-updater/plugin-core": "0.36.8",
73
- "@hot-updater/server": "0.36.8"
71
+ "@hot-updater/plugin-core": "0.36.11",
72
+ "@hot-updater/cli-tools": "0.36.11",
73
+ "@hot-updater/server": "0.36.11"
74
74
  },
75
75
  "scripts": {
76
76
  "build": "tsdown",