@hot-updater/aws 0.36.0 → 0.36.2

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.
@@ -7951,7 +7951,7 @@ const SOURCE_TEMPLATE = `// Add this to your App.tsx
7951
7951
  import { HotUpdater } from "@hot-updater/react-native";
7952
7952
 
7953
7953
  function App() {
7954
- return ...;
7954
+ return null; // Replace with your app root
7955
7955
  }
7956
7956
 
7957
7957
  export default HotUpdater.wrap({
@@ -7946,7 +7946,7 @@ const SOURCE_TEMPLATE = `// Add this to your App.tsx
7946
7946
  import { HotUpdater } from "@hot-updater/react-native";
7947
7947
 
7948
7948
  function App() {
7949
- return ...;
7949
+ return null; // Replace with your app root
7950
7950
  }
7951
7951
 
7952
7952
  export default HotUpdater.wrap({
package/dist/index.cjs CHANGED
@@ -1826,10 +1826,7 @@ const s3Storage = (0, _hot_updater_plugin_core.createUniversalStoragePlugin)({
1826
1826
  }
1827
1827
  },
1828
1828
  async getDownloadUrl(storageUri) {
1829
- const u = new URL(storageUri);
1830
- if (u.protocol.replace(":", "") !== "s3") throw new Error("Invalid S3 storage URI protocol");
1831
- const bucket = u.host;
1832
- const key = u.pathname.slice(1);
1829
+ const { bucket, key } = (0, _hot_updater_plugin_core.parseStorageUri)(storageUri, "s3");
1833
1830
  if (!bucket || !key) throw new Error("Invalid S3 storage URI: missing bucket or key");
1834
1831
  try {
1835
1832
  const signedUrl = await (0, _aws_sdk_s3_request_presigner.getSignedUrl)(client, new _aws_sdk_client_s3.GetObjectCommand({
package/dist/index.mjs CHANGED
@@ -1801,10 +1801,7 @@ const s3Storage = createUniversalStoragePlugin({
1801
1801
  }
1802
1802
  },
1803
1803
  async getDownloadUrl(storageUri) {
1804
- const u = new URL(storageUri);
1805
- if (u.protocol.replace(":", "") !== "s3") throw new Error("Invalid S3 storage URI protocol");
1806
- const bucket = u.host;
1807
- const key = u.pathname.slice(1);
1804
+ const { bucket, key } = parseStorageUri(storageUri, "s3");
1808
1805
  if (!bucket || !key) throw new Error("Invalid S3 storage URI: missing bucket or key");
1809
1806
  try {
1810
1807
  const signedUrl = await getSignedUrl(client, new GetObjectCommand({
@@ -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.0";
38
+ const HOT_UPDATER_SERVER_VERSION = "0.36.2";
39
39
  //#endregion
40
40
  //#region ../../packages/server/dist/internalRouter.mjs
41
41
  const normalizePath = (path) => {
@@ -4087,6 +4087,13 @@ const createUniversalStoragePlugin = (options) => {
4087
4087
  };
4088
4088
  //#endregion
4089
4089
  //#region ../plugin-core/dist/parseStorageUri.mjs
4090
+ const decodeStorageObjectKey = (key) => {
4091
+ try {
4092
+ return decodeURIComponent(key);
4093
+ } catch {
4094
+ return key;
4095
+ }
4096
+ };
4090
4097
  /**
4091
4098
  * Parses a storage URI and validates the protocol.
4092
4099
  *
@@ -4110,7 +4117,7 @@ function parseStorageUri(storageUri, expectedProtocol) {
4110
4117
  return {
4111
4118
  protocol,
4112
4119
  bucket: url.hostname,
4113
- key: url.pathname.slice(1)
4120
+ key: decodeStorageObjectKey(url.pathname.slice(1))
4114
4121
  };
4115
4122
  } catch (error) {
4116
4123
  if (error instanceof TypeError) throw new Error(`Invalid storage URI format: ${storageUri}`);
@@ -6868,10 +6875,7 @@ const s3Storage = createUniversalStoragePlugin({
6868
6875
  }
6869
6876
  },
6870
6877
  async getDownloadUrl(storageUri) {
6871
- const u = new URL(storageUri);
6872
- if (u.protocol.replace(":", "") !== "s3") throw new Error("Invalid S3 storage URI protocol");
6873
- const bucket = u.host;
6874
- const key = u.pathname.slice(1);
6878
+ const { bucket, key } = parseStorageUri(storageUri, "s3");
6875
6879
  if (!bucket || !key) throw new Error("Invalid S3 storage URI: missing bucket or key");
6876
6880
  try {
6877
6881
  const signedUrl = await (0, _aws_sdk_s3_request_presigner.getSignedUrl)(client, new _aws_sdk_client_s3.GetObjectCommand({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/aws",
3
3
  "type": "module",
4
- "version": "0.36.0",
4
+ "version": "0.36.2",
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.0",
54
- "@hot-updater/js": "0.36.0",
55
- "@hot-updater/mock": "0.36.0",
56
- "@hot-updater/test-utils": "0.36.0"
53
+ "@hot-updater/core": "0.36.2",
54
+ "@hot-updater/js": "0.36.2",
55
+ "@hot-updater/mock": "0.36.2",
56
+ "@hot-updater/test-utils": "0.36.2"
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.9",
70
70
  "aws-lambda": "1.0.7",
71
- "@hot-updater/cli-tools": "0.36.0",
72
- "@hot-updater/plugin-core": "0.36.0",
73
- "@hot-updater/server": "0.36.0"
71
+ "@hot-updater/cli-tools": "0.36.2",
72
+ "@hot-updater/plugin-core": "0.36.2",
73
+ "@hot-updater/server": "0.36.2"
74
74
  },
75
75
  "scripts": {
76
76
  "build": "tsdown",