@hot-updater/aws 0.36.1 → 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.
- package/dist/index.cjs +1 -4
- package/dist/index.mjs +1 -4
- package/dist/lambda/index.cjs +10 -6
- package/package.json +8 -8
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
|
|
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
|
|
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({
|
package/dist/lambda/index.cjs
CHANGED
|
@@ -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.
|
|
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
|
|
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.
|
|
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.
|
|
54
|
-
"@hot-updater/js": "0.36.
|
|
55
|
-
"@hot-updater/mock": "0.36.
|
|
56
|
-
"@hot-updater/test-utils": "0.36.
|
|
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.
|
|
72
|
-
"@hot-updater/plugin-core": "0.36.
|
|
73
|
-
"@hot-updater/server": "0.36.
|
|
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",
|