@hot-updater/cloudflare 0.20.14 → 0.21.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.
- package/dist/index.cjs +17 -1346
- package/dist/index.js +18 -1347
- package/package.json +8 -6
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +28 -20
- package/worker/dist/index.js.map +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/cloudflare",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.21.0",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"types": "./dist/iac/index.d.ts",
|
|
19
19
|
"import": "./dist/iac/index.js",
|
|
20
20
|
"require": "./dist/iac/index.cjs"
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
22
23
|
},
|
|
23
24
|
"license": "MIT",
|
|
24
25
|
"repository": "https://github.com/gronxb/hot-updater",
|
|
@@ -40,9 +41,9 @@
|
|
|
40
41
|
],
|
|
41
42
|
"dependencies": {
|
|
42
43
|
"cloudflare": "4.2.0",
|
|
43
|
-
"@hot-updater/core": "0.
|
|
44
|
-
"@hot-updater/js": "0.
|
|
45
|
-
"@hot-updater/plugin-core": "0.
|
|
44
|
+
"@hot-updater/core": "0.21.0",
|
|
45
|
+
"@hot-updater/js": "0.21.0",
|
|
46
|
+
"@hot-updater/plugin-core": "0.21.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@clack/prompts": "0.10.0",
|
|
@@ -61,7 +62,8 @@
|
|
|
61
62
|
"typescript": "^5.5.2",
|
|
62
63
|
"vitest": "2.1.8",
|
|
63
64
|
"wrangler": "^4.5.0",
|
|
64
|
-
"xdg-app-paths": "^8.3.0"
|
|
65
|
+
"xdg-app-paths": "^8.3.0",
|
|
66
|
+
"@hot-updater/test-utils": "0.21.0"
|
|
65
67
|
},
|
|
66
68
|
"scripts": {
|
|
67
69
|
"build": "tsdown && pnpm build:worker",
|
package/worker/dist/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
This folder contains the built output assets for the worker "hot-updater" generated at 2025-10-
|
|
1
|
+
This folder contains the built output assets for the worker "hot-updater" generated at 2025-10-26T17:16:20.967Z.
|
package/worker/dist/index.js
CHANGED
|
@@ -5026,7 +5026,7 @@ var appVersionStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5026
5026
|
/* sql */
|
|
5027
5027
|
`
|
|
5028
5028
|
WITH input AS (
|
|
5029
|
-
SELECT
|
|
5029
|
+
SELECT
|
|
5030
5030
|
? AS app_platform,
|
|
5031
5031
|
? AS app_version,
|
|
5032
5032
|
? AS bundle_id,
|
|
@@ -5035,11 +5035,12 @@ var appVersionStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5035
5035
|
'00000000-0000-0000-0000-000000000000' AS nil_uuid
|
|
5036
5036
|
),
|
|
5037
5037
|
update_candidate AS (
|
|
5038
|
-
SELECT
|
|
5038
|
+
SELECT
|
|
5039
5039
|
b.id,
|
|
5040
5040
|
b.should_force_update,
|
|
5041
5041
|
b.message,
|
|
5042
5042
|
b.storage_uri,
|
|
5043
|
+
b.file_hash,
|
|
5043
5044
|
'UPDATE' AS status
|
|
5044
5045
|
FROM bundles b, input
|
|
5045
5046
|
WHERE b.enabled = 1
|
|
@@ -5048,15 +5049,16 @@ var appVersionStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5048
5049
|
AND b.id >= input.min_bundle_id
|
|
5049
5050
|
AND b.channel = input.channel
|
|
5050
5051
|
AND b.target_app_version IN (${targetAppVersionList.map((version2) => `'${version2}'`).join(",")})
|
|
5051
|
-
ORDER BY b.id DESC
|
|
5052
|
+
ORDER BY b.id DESC
|
|
5052
5053
|
LIMIT 1
|
|
5053
5054
|
),
|
|
5054
5055
|
rollback_candidate AS (
|
|
5055
|
-
SELECT
|
|
5056
|
+
SELECT
|
|
5056
5057
|
b.id,
|
|
5057
5058
|
1 AS should_force_update,
|
|
5058
5059
|
b.message,
|
|
5059
5060
|
b.storage_uri,
|
|
5061
|
+
b.file_hash,
|
|
5060
5062
|
'ROLLBACK' AS status
|
|
5061
5063
|
FROM bundles b, input
|
|
5062
5064
|
WHERE b.enabled = 1
|
|
@@ -5072,18 +5074,19 @@ var appVersionStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5072
5074
|
SELECT * FROM rollback_candidate
|
|
5073
5075
|
WHERE NOT EXISTS (SELECT 1 FROM update_candidate)
|
|
5074
5076
|
)
|
|
5075
|
-
SELECT id, should_force_update, message, status, storage_uri
|
|
5077
|
+
SELECT id, should_force_update, message, status, storage_uri, file_hash
|
|
5076
5078
|
FROM final_result, input
|
|
5077
5079
|
WHERE id <> bundle_id
|
|
5078
|
-
|
|
5080
|
+
|
|
5079
5081
|
UNION ALL
|
|
5080
|
-
|
|
5081
|
-
SELECT
|
|
5082
|
+
|
|
5083
|
+
SELECT
|
|
5082
5084
|
nil_uuid AS id,
|
|
5083
5085
|
1 AS should_force_update,
|
|
5084
5086
|
NULL AS message,
|
|
5085
5087
|
'ROLLBACK' AS status,
|
|
5086
|
-
NULL AS storage_uri
|
|
5088
|
+
NULL AS storage_uri,
|
|
5089
|
+
NULL AS file_hash
|
|
5087
5090
|
FROM input
|
|
5088
5091
|
WHERE (SELECT COUNT(*) FROM final_result) = 0
|
|
5089
5092
|
AND bundle_id > min_bundle_id;
|
|
@@ -5098,7 +5101,8 @@ var appVersionStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5098
5101
|
shouldForceUpdate: Boolean(result.should_force_update),
|
|
5099
5102
|
status: result.status,
|
|
5100
5103
|
message: result.message,
|
|
5101
|
-
storageUri: result.storage_uri
|
|
5104
|
+
storageUri: result.storage_uri,
|
|
5105
|
+
fileHash: result.file_hash
|
|
5102
5106
|
};
|
|
5103
5107
|
}, "appVersionStrategy");
|
|
5104
5108
|
var fingerprintStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
@@ -5112,7 +5116,7 @@ var fingerprintStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5112
5116
|
/* sql */
|
|
5113
5117
|
`
|
|
5114
5118
|
WITH input AS (
|
|
5115
|
-
SELECT
|
|
5119
|
+
SELECT
|
|
5116
5120
|
? AS app_platform,
|
|
5117
5121
|
? AS bundle_id,
|
|
5118
5122
|
? AS min_bundle_id,
|
|
@@ -5121,11 +5125,12 @@ var fingerprintStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5121
5125
|
'00000000-0000-0000-0000-000000000000' AS nil_uuid
|
|
5122
5126
|
),
|
|
5123
5127
|
update_candidate AS (
|
|
5124
|
-
SELECT
|
|
5128
|
+
SELECT
|
|
5125
5129
|
b.id,
|
|
5126
5130
|
b.should_force_update,
|
|
5127
5131
|
b.message,
|
|
5128
5132
|
b.storage_uri,
|
|
5133
|
+
b.file_hash,
|
|
5129
5134
|
'UPDATE' AS status
|
|
5130
5135
|
FROM bundles b, input
|
|
5131
5136
|
WHERE b.enabled = 1
|
|
@@ -5134,15 +5139,16 @@ var fingerprintStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5134
5139
|
AND b.id >= input.min_bundle_id
|
|
5135
5140
|
AND b.channel = input.channel
|
|
5136
5141
|
AND b.fingerprint_hash = input.fingerprint_hash
|
|
5137
|
-
ORDER BY b.id DESC
|
|
5142
|
+
ORDER BY b.id DESC
|
|
5138
5143
|
LIMIT 1
|
|
5139
5144
|
),
|
|
5140
5145
|
rollback_candidate AS (
|
|
5141
|
-
SELECT
|
|
5146
|
+
SELECT
|
|
5142
5147
|
b.id,
|
|
5143
5148
|
1 AS should_force_update,
|
|
5144
5149
|
b.message,
|
|
5145
5150
|
b.storage_uri,
|
|
5151
|
+
b.file_hash,
|
|
5146
5152
|
'ROLLBACK' AS status
|
|
5147
5153
|
FROM bundles b, input
|
|
5148
5154
|
WHERE b.enabled = 1
|
|
@@ -5160,18 +5166,19 @@ var fingerprintStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5160
5166
|
SELECT * FROM rollback_candidate
|
|
5161
5167
|
WHERE NOT EXISTS (SELECT 1 FROM update_candidate)
|
|
5162
5168
|
)
|
|
5163
|
-
SELECT id, should_force_update, message, status, storage_uri
|
|
5169
|
+
SELECT id, should_force_update, message, status, storage_uri, file_hash
|
|
5164
5170
|
FROM final_result, input
|
|
5165
5171
|
WHERE id <> bundle_id
|
|
5166
|
-
|
|
5172
|
+
|
|
5167
5173
|
UNION ALL
|
|
5168
|
-
|
|
5169
|
-
SELECT
|
|
5174
|
+
|
|
5175
|
+
SELECT
|
|
5170
5176
|
nil_uuid AS id,
|
|
5171
5177
|
1 AS should_force_update,
|
|
5172
5178
|
NULL AS message,
|
|
5173
5179
|
'ROLLBACK' AS status,
|
|
5174
|
-
NULL AS storage_uri
|
|
5180
|
+
NULL AS storage_uri,
|
|
5181
|
+
NULL AS file_hash
|
|
5175
5182
|
FROM input
|
|
5176
5183
|
WHERE (SELECT COUNT(*) FROM final_result) = 0
|
|
5177
5184
|
AND bundle_id > min_bundle_id;
|
|
@@ -5186,7 +5193,8 @@ var fingerprintStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
|
5186
5193
|
shouldForceUpdate: Boolean(result.should_force_update),
|
|
5187
5194
|
status: result.status,
|
|
5188
5195
|
message: result.message,
|
|
5189
|
-
storageUri: result.storage_uri
|
|
5196
|
+
storageUri: result.storage_uri,
|
|
5197
|
+
fileHash: result.file_hash
|
|
5190
5198
|
};
|
|
5191
5199
|
}, "fingerprintStrategy");
|
|
5192
5200
|
var getUpdateInfo = /* @__PURE__ */ __name((DB, args) => {
|