@hot-updater/cloudflare 0.36.4 → 0.36.6
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/package.json +8 -8
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +82 -28
- package/worker/dist/index.js.map +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/cloudflare",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.36.
|
|
4
|
+
"version": "0.36.6",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"@aws-sdk/lib-storage": "3.1008.0",
|
|
60
60
|
"@aws-sdk/s3-request-presigner": "3.1008.0",
|
|
61
61
|
"cloudflare": "4.2.0",
|
|
62
|
-
"hono": "4.12.
|
|
62
|
+
"hono": "4.12.34",
|
|
63
63
|
"uuidv7": "^1.0.2",
|
|
64
|
-
"@hot-updater/cli-tools": "0.36.
|
|
65
|
-
"@hot-updater/core": "0.36.
|
|
66
|
-
"@hot-updater/
|
|
67
|
-
"@hot-updater/
|
|
68
|
-
"@hot-updater/
|
|
64
|
+
"@hot-updater/cli-tools": "0.36.6",
|
|
65
|
+
"@hot-updater/plugin-core": "0.36.6",
|
|
66
|
+
"@hot-updater/server": "0.36.6",
|
|
67
|
+
"@hot-updater/js": "0.36.6",
|
|
68
|
+
"@hot-updater/core": "0.36.6"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@cloudflare/vitest-pool-workers": "0.13.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"vitest": "4.1.4",
|
|
83
83
|
"wrangler": "^4.5.0",
|
|
84
84
|
"xdg-app-paths": "^8.3.0",
|
|
85
|
-
"@hot-updater/test-utils": "0.36.
|
|
85
|
+
"@hot-updater/test-utils": "0.36.6"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"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 2026-08-
|
|
1
|
+
This folder contains the built output assets for the worker "hot-updater" generated at 2026-08-30T03:59:50.247Z.
|
package/worker/dist/index.js
CHANGED
|
@@ -3870,7 +3870,7 @@ function assertRuntimeStoragePlugin(plugin) {
|
|
|
3870
3870
|
__name(assertRuntimeStoragePlugin, "assertRuntimeStoragePlugin");
|
|
3871
3871
|
|
|
3872
3872
|
// ../../packages/server/dist/package.mjs
|
|
3873
|
-
var version2 = "0.36.
|
|
3873
|
+
var version2 = "0.36.6";
|
|
3874
3874
|
|
|
3875
3875
|
// ../../packages/server/dist/version.mjs
|
|
3876
3876
|
var HOT_UPDATER_SERVER_VERSION = version2;
|
|
@@ -4737,7 +4737,7 @@ function createHotUpdater(options) {
|
|
|
4737
4737
|
}
|
|
4738
4738
|
__name(createHotUpdater, "createHotUpdater");
|
|
4739
4739
|
|
|
4740
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
4740
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/compose.js
|
|
4741
4741
|
var compose = /* @__PURE__ */ __name((middleware, onError, onNotFound) => {
|
|
4742
4742
|
return (context2, next) => {
|
|
4743
4743
|
let index = -1;
|
|
@@ -4782,21 +4782,46 @@ var compose = /* @__PURE__ */ __name((middleware, onError, onNotFound) => {
|
|
|
4782
4782
|
};
|
|
4783
4783
|
}, "compose");
|
|
4784
4784
|
|
|
4785
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
4785
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/request/constants.js
|
|
4786
4786
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
4787
4787
|
|
|
4788
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
4788
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/utils/buffer.js
|
|
4789
|
+
var bufferToFormData = /* @__PURE__ */ __name((arrayBuffer, contentType) => {
|
|
4790
|
+
const response = new Response(arrayBuffer, {
|
|
4791
|
+
headers: {
|
|
4792
|
+
// Normalize the media type (case-insensitive) while keeping parameters like the boundary
|
|
4793
|
+
"Content-Type": contentType.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase())
|
|
4794
|
+
}
|
|
4795
|
+
});
|
|
4796
|
+
return response.formData();
|
|
4797
|
+
}, "bufferToFormData");
|
|
4798
|
+
|
|
4799
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/utils/body.js
|
|
4800
|
+
var isRawRequest = /* @__PURE__ */ __name((request) => "headers" in request, "isRawRequest");
|
|
4789
4801
|
var parseBody = /* @__PURE__ */ __name(async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
4790
4802
|
const { all = false, dot = false } = options;
|
|
4791
|
-
const headers = request
|
|
4803
|
+
const headers = isRawRequest(request) ? request.headers : request.raw.headers;
|
|
4792
4804
|
const contentType = headers.get("Content-Type");
|
|
4793
|
-
|
|
4805
|
+
const mediaType = contentType?.split(";")[0].trim().toLowerCase();
|
|
4806
|
+
if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") {
|
|
4794
4807
|
return parseFormData(request, { all, dot });
|
|
4795
4808
|
}
|
|
4796
4809
|
return {};
|
|
4797
4810
|
}, "parseBody");
|
|
4798
4811
|
async function parseFormData(request, options) {
|
|
4799
|
-
|
|
4812
|
+
if (!isRawRequest(request) && request.bodyCache.formData) {
|
|
4813
|
+
return convertFormDataToBodyData(
|
|
4814
|
+
await request.bodyCache.formData,
|
|
4815
|
+
options
|
|
4816
|
+
);
|
|
4817
|
+
}
|
|
4818
|
+
const headers = isRawRequest(request) ? request.headers : request.raw.headers;
|
|
4819
|
+
const arrayBuffer = await request.arrayBuffer();
|
|
4820
|
+
const formDataPromise = bufferToFormData(arrayBuffer, headers.get("Content-Type") || "");
|
|
4821
|
+
if (!isRawRequest(request)) {
|
|
4822
|
+
request.bodyCache.formData = formDataPromise;
|
|
4823
|
+
}
|
|
4824
|
+
const formData = await formDataPromise;
|
|
4800
4825
|
if (formData) {
|
|
4801
4826
|
return convertFormDataToBodyData(formData, options);
|
|
4802
4827
|
}
|
|
@@ -4859,7 +4884,7 @@ var handleParsingNestedValues = /* @__PURE__ */ __name((form, key, value) => {
|
|
|
4859
4884
|
});
|
|
4860
4885
|
}, "handleParsingNestedValues");
|
|
4861
4886
|
|
|
4862
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
4887
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/utils/url.js
|
|
4863
4888
|
var splitPath = /* @__PURE__ */ __name((path) => {
|
|
4864
4889
|
const paths = path.split("/");
|
|
4865
4890
|
if (paths[0] === "") {
|
|
@@ -5016,7 +5041,7 @@ var _getQueryParam = /* @__PURE__ */ __name((url, key, multiple) => {
|
|
|
5016
5041
|
return void 0;
|
|
5017
5042
|
}
|
|
5018
5043
|
}
|
|
5019
|
-
const results =
|
|
5044
|
+
const results = /* @__PURE__ */ Object.create(null);
|
|
5020
5045
|
encoded ??= /[%+]/.test(url);
|
|
5021
5046
|
let keyIndex = url.indexOf("?", 8);
|
|
5022
5047
|
while (keyIndex !== -1) {
|
|
@@ -5063,7 +5088,7 @@ var getQueryParams = /* @__PURE__ */ __name((url, key) => {
|
|
|
5063
5088
|
}, "getQueryParams");
|
|
5064
5089
|
var decodeURIComponent_ = decodeURIComponent;
|
|
5065
5090
|
|
|
5066
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
5091
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/request.js
|
|
5067
5092
|
var tryDecodeURIComponent = /* @__PURE__ */ __name((str) => tryDecode(str, decodeURIComponent_), "tryDecodeURIComponent");
|
|
5068
5093
|
var HonoRequest = class {
|
|
5069
5094
|
static {
|
|
@@ -5140,7 +5165,7 @@ var HonoRequest = class {
|
|
|
5140
5165
|
if (name) {
|
|
5141
5166
|
return this.raw.headers.get(name) ?? void 0;
|
|
5142
5167
|
}
|
|
5143
|
-
const headerData =
|
|
5168
|
+
const headerData = /* @__PURE__ */ Object.create(null);
|
|
5144
5169
|
this.raw.headers.forEach((value, key) => {
|
|
5145
5170
|
headerData[key] = value;
|
|
5146
5171
|
});
|
|
@@ -5211,6 +5236,21 @@ var HonoRequest = class {
|
|
|
5211
5236
|
arrayBuffer() {
|
|
5212
5237
|
return this.#cachedBody("arrayBuffer");
|
|
5213
5238
|
}
|
|
5239
|
+
/**
|
|
5240
|
+
* `.bytes()` parses the request body as a `Uint8Array`.
|
|
5241
|
+
*
|
|
5242
|
+
* @see {@link https://hono.dev/docs/api/request#bytes}
|
|
5243
|
+
*
|
|
5244
|
+
* @example
|
|
5245
|
+
* ```ts
|
|
5246
|
+
* app.post('/entry', async (c) => {
|
|
5247
|
+
* const body = await c.req.bytes()
|
|
5248
|
+
* })
|
|
5249
|
+
* ```
|
|
5250
|
+
*/
|
|
5251
|
+
bytes() {
|
|
5252
|
+
return this.#cachedBody("arrayBuffer").then((buffer) => new Uint8Array(buffer));
|
|
5253
|
+
}
|
|
5214
5254
|
/**
|
|
5215
5255
|
* Parses the request body as a `Blob`.
|
|
5216
5256
|
* @example
|
|
@@ -5334,7 +5374,7 @@ var HonoRequest = class {
|
|
|
5334
5374
|
}
|
|
5335
5375
|
};
|
|
5336
5376
|
|
|
5337
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
5377
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/utils/html.js
|
|
5338
5378
|
var HtmlEscapedCallbackPhase = {
|
|
5339
5379
|
Stringify: 1,
|
|
5340
5380
|
BeforeStream: 2,
|
|
@@ -5376,7 +5416,7 @@ var resolveCallback = /* @__PURE__ */ __name(async (str, phase, preserveCallback
|
|
|
5376
5416
|
}
|
|
5377
5417
|
}, "resolveCallback");
|
|
5378
5418
|
|
|
5379
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
5419
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/context.js
|
|
5380
5420
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
5381
5421
|
var setDefaultContentType = /* @__PURE__ */ __name((contentType, headers) => {
|
|
5382
5422
|
return {
|
|
@@ -5786,7 +5826,7 @@ var Context = class {
|
|
|
5786
5826
|
}, "notFound");
|
|
5787
5827
|
};
|
|
5788
5828
|
|
|
5789
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
5829
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/router.js
|
|
5790
5830
|
var METHOD_NAME_ALL = "ALL";
|
|
5791
5831
|
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
5792
5832
|
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
@@ -5797,10 +5837,10 @@ var UnsupportedPathError = class extends Error {
|
|
|
5797
5837
|
}
|
|
5798
5838
|
};
|
|
5799
5839
|
|
|
5800
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
5840
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/utils/constants.js
|
|
5801
5841
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
5802
5842
|
|
|
5803
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
5843
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/hono-base.js
|
|
5804
5844
|
var notFoundHandler = /* @__PURE__ */ __name((c) => {
|
|
5805
5845
|
return c.text("404 Not Found", 404);
|
|
5806
5846
|
}, "notFoundHandler");
|
|
@@ -5918,7 +5958,7 @@ var Hono = class _Hono {
|
|
|
5918
5958
|
handler = /* @__PURE__ */ __name(async (c, next) => (await compose([], app2.errorHandler)(c, () => r.handler(c, next))).res, "handler");
|
|
5919
5959
|
handler[COMPOSED_HANDLER] = r.handler;
|
|
5920
5960
|
}
|
|
5921
|
-
subApp.#addRoute(r.method, r.path, handler);
|
|
5961
|
+
subApp.#addRoute(r.method, r.path, handler, r.basePath);
|
|
5922
5962
|
});
|
|
5923
5963
|
return this;
|
|
5924
5964
|
}
|
|
@@ -6042,7 +6082,7 @@ var Hono = class _Hono {
|
|
|
6042
6082
|
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
6043
6083
|
return (request) => {
|
|
6044
6084
|
const url = new URL(request.url);
|
|
6045
|
-
url.pathname =
|
|
6085
|
+
url.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
|
|
6046
6086
|
return new Request(url, request);
|
|
6047
6087
|
};
|
|
6048
6088
|
})();
|
|
@@ -6056,10 +6096,15 @@ var Hono = class _Hono {
|
|
|
6056
6096
|
this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler);
|
|
6057
6097
|
return this;
|
|
6058
6098
|
}
|
|
6059
|
-
#addRoute(method, path, handler) {
|
|
6099
|
+
#addRoute(method, path, handler, baseRoutePath) {
|
|
6060
6100
|
method = method.toUpperCase();
|
|
6061
6101
|
path = mergePath(this._basePath, path);
|
|
6062
|
-
const r = {
|
|
6102
|
+
const r = {
|
|
6103
|
+
basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,
|
|
6104
|
+
path,
|
|
6105
|
+
method,
|
|
6106
|
+
handler
|
|
6107
|
+
};
|
|
6063
6108
|
this.router.add(method, path, [handler, r]);
|
|
6064
6109
|
this.routes.push(r);
|
|
6065
6110
|
}
|
|
@@ -6174,7 +6219,7 @@ var Hono = class _Hono {
|
|
|
6174
6219
|
}, "fire");
|
|
6175
6220
|
};
|
|
6176
6221
|
|
|
6177
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
6222
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
6178
6223
|
var emptyParam = [];
|
|
6179
6224
|
function match(method, path) {
|
|
6180
6225
|
const matchers = this.buildAllMatchers();
|
|
@@ -6196,7 +6241,7 @@ function match(method, path) {
|
|
|
6196
6241
|
}
|
|
6197
6242
|
__name(match, "match");
|
|
6198
6243
|
|
|
6199
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
6244
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
6200
6245
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
6201
6246
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
6202
6247
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -6308,7 +6353,7 @@ var Node = class _Node {
|
|
|
6308
6353
|
}
|
|
6309
6354
|
};
|
|
6310
6355
|
|
|
6311
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
6356
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
6312
6357
|
var Trie = class {
|
|
6313
6358
|
static {
|
|
6314
6359
|
__name(this, "Trie");
|
|
@@ -6367,7 +6412,7 @@ var Trie = class {
|
|
|
6367
6412
|
}
|
|
6368
6413
|
};
|
|
6369
6414
|
|
|
6370
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
6415
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
6371
6416
|
var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
|
|
6372
6417
|
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
6373
6418
|
function buildWildcardRegExp(path) {
|
|
@@ -6553,7 +6598,7 @@ var RegExpRouter = class {
|
|
|
6553
6598
|
}
|
|
6554
6599
|
};
|
|
6555
6600
|
|
|
6556
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
6601
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/router/smart-router/router.js
|
|
6557
6602
|
var SmartRouter = class {
|
|
6558
6603
|
static {
|
|
6559
6604
|
__name(this, "SmartRouter");
|
|
@@ -6611,7 +6656,7 @@ var SmartRouter = class {
|
|
|
6611
6656
|
}
|
|
6612
6657
|
};
|
|
6613
6658
|
|
|
6614
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
6659
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/router/trie-router/node.js
|
|
6615
6660
|
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
6616
6661
|
var hasChildren = /* @__PURE__ */ __name((children) => {
|
|
6617
6662
|
for (const _ in children) {
|
|
@@ -6748,6 +6793,15 @@ var Node2 = class _Node2 {
|
|
|
6748
6793
|
if (m) {
|
|
6749
6794
|
params[name] = m[0];
|
|
6750
6795
|
this.#pushHandlerSets(handlerSets, child, method, node.#params, params);
|
|
6796
|
+
if (m[0].length === restPathString.length && child.#children["*"]) {
|
|
6797
|
+
this.#pushHandlerSets(
|
|
6798
|
+
handlerSets,
|
|
6799
|
+
child.#children["*"],
|
|
6800
|
+
method,
|
|
6801
|
+
node.#params,
|
|
6802
|
+
params
|
|
6803
|
+
);
|
|
6804
|
+
}
|
|
6751
6805
|
if (hasChildren(child.#children)) {
|
|
6752
6806
|
child.#params = params;
|
|
6753
6807
|
const componentCount = m[0].match(/\//)?.length ?? 0;
|
|
@@ -6789,7 +6843,7 @@ var Node2 = class _Node2 {
|
|
|
6789
6843
|
}
|
|
6790
6844
|
};
|
|
6791
6845
|
|
|
6792
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
6846
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/router/trie-router/router.js
|
|
6793
6847
|
var TrieRouter = class {
|
|
6794
6848
|
static {
|
|
6795
6849
|
__name(this, "TrieRouter");
|
|
@@ -6814,7 +6868,7 @@ var TrieRouter = class {
|
|
|
6814
6868
|
}
|
|
6815
6869
|
};
|
|
6816
6870
|
|
|
6817
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
6871
|
+
// ../../node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/hono.js
|
|
6818
6872
|
var Hono2 = class extends Hono {
|
|
6819
6873
|
static {
|
|
6820
6874
|
__name(this, "Hono");
|