@hot-updater/console 0.28.0 → 0.29.1

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.
Files changed (93) hide show
  1. package/.output/nitro.json +17 -0
  2. package/.output/public/apple-touch-icon.png +0 -0
  3. package/.output/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  4. package/.output/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  5. package/.output/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  6. package/.output/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  7. package/.output/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  8. package/.output/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  9. package/.output/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  10. package/.output/public/assets/main-Dlx8-qN-.js +61 -0
  11. package/.output/public/assets/routes-DB0tWmiJ.js +10 -0
  12. package/.output/public/assets/styles-Bfxg4M1x.css +2 -0
  13. package/.output/public/favicon-16x16.png +0 -0
  14. package/.output/public/favicon-32x32.png +0 -0
  15. package/.output/public/favicon.ico +0 -0
  16. package/.output/public/logo.svg +1 -0
  17. package/.output/public/manifest.json +30 -0
  18. package/.output/public/robots.txt +3 -0
  19. package/.output/server/_chunks/ssr-renderer.mjs +15 -0
  20. package/.output/server/_libs/@floating-ui/core+[...].mjs +698 -0
  21. package/.output/server/_libs/@floating-ui/dom+[...].mjs +644 -0
  22. package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +839 -0
  23. package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +2093 -0
  24. package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +287 -0
  25. package/.output/server/_libs/@radix-ui/react-select+[...].mjs +1003 -0
  26. package/.output/server/_libs/@tanstack/devtools-event-client+[...].mjs +196 -0
  27. package/.output/server/_libs/@tanstack/form-core+[...].mjs +2396 -0
  28. package/.output/server/_libs/@tanstack/react-form+[...].mjs +298 -0
  29. package/.output/server/_libs/@tanstack/react-router+[...].mjs +13068 -0
  30. package/.output/server/_libs/@tanstack/react-table+[...].mjs +2372 -0
  31. package/.output/server/_libs/chownr.mjs +60 -0
  32. package/.output/server/_libs/class-variance-authority+clsx.mjs +69 -0
  33. package/.output/server/_libs/core-util-is.mjs +67 -0
  34. package/.output/server/_libs/dayjs.mjs +408 -0
  35. package/.output/server/_libs/h3+rou3+srvx.mjs +1158 -0
  36. package/.output/server/_libs/hookable.mjs +41 -0
  37. package/.output/server/_libs/immediate.mjs +57 -0
  38. package/.output/server/_libs/inherits.mjs +39 -0
  39. package/.output/server/_libs/isaacs__fs-minipass+minipass.mjs +1120 -0
  40. package/.output/server/_libs/isarray.mjs +10 -0
  41. package/.output/server/_libs/jszip+[...].mjs +8311 -0
  42. package/.output/server/_libs/lucide-react.mjs +371 -0
  43. package/.output/server/_libs/minizlib.mjs +345 -0
  44. package/.output/server/_libs/next-themes.mjs +49 -0
  45. package/.output/server/_libs/radix-ui__number.mjs +6 -0
  46. package/.output/server/_libs/radix-ui__primitive.mjs +9 -0
  47. package/.output/server/_libs/radix-ui__react-arrow.mjs +23 -0
  48. package/.output/server/_libs/radix-ui__react-collection.mjs +78 -0
  49. package/.output/server/_libs/radix-ui__react-direction.mjs +11 -0
  50. package/.output/server/_libs/radix-ui__react-label.mjs +22 -0
  51. package/.output/server/_libs/radix-ui__react-separator.mjs +31 -0
  52. package/.output/server/_libs/radix-ui__react-slider.mjs +451 -0
  53. package/.output/server/_libs/radix-ui__react-switch.mjs +118 -0
  54. package/.output/server/_libs/radix-ui__react-tooltip.mjs +491 -0
  55. package/.output/server/_libs/semver.mjs +1339 -0
  56. package/.output/server/_libs/sonner.mjs +908 -0
  57. package/.output/server/_libs/tailwind-merge.mjs +1962 -0
  58. package/.output/server/_libs/tanstack__history.mjs +322 -0
  59. package/.output/server/_libs/tanstack__query-core.mjs +2073 -0
  60. package/.output/server/_libs/tanstack__react-query.mjs +146 -0
  61. package/.output/server/_libs/tanstack__router-core.mjs +6 -0
  62. package/.output/server/_libs/tar.mjs +1996 -0
  63. package/.output/server/_libs/ufo.mjs +64 -0
  64. package/.output/server/_runtime.mjs +26 -0
  65. package/.output/server/_ssr/api-rpc-D3ZehMIN.mjs +217 -0
  66. package/.output/server/_ssr/config.server-JUYQ7UbI.mjs +26 -0
  67. package/.output/server/_ssr/deleteBundle-DWUxu9-K.mjs +22 -0
  68. package/.output/server/_ssr/extract-timestamp-from-uuidv7-B90UBADU.mjs +24 -0
  69. package/.output/server/_ssr/promoteBundle-DtMHuubR.mjs +1571 -0
  70. package/.output/server/_ssr/router-pgc7NX76.mjs +250 -0
  71. package/.output/server/_ssr/routes-PqTTQSoI.mjs +1833 -0
  72. package/.output/server/_ssr/sidebar-DXng0IOP.mjs +439 -0
  73. package/.output/server/_ssr/ssr.mjs +5050 -0
  74. package/.output/server/_ssr/start-DQK0r85G.mjs +4 -0
  75. package/.output/server/_tanstack-start-manifest_v-DTbQVOpU.mjs +17 -0
  76. package/.output/server/index.mjs +417 -0
  77. package/.output/server/node_modules/tslib/modules/index.js +70 -0
  78. package/.output/server/node_modules/tslib/modules/package.json +3 -0
  79. package/.output/server/node_modules/tslib/package.json +47 -0
  80. package/.output/server/node_modules/tslib/tslib.js +484 -0
  81. package/.output/server/package.json +9 -0
  82. package/README.md +191 -2
  83. package/package.json +77 -50
  84. package/dist/.gitkeep +0 -0
  85. package/dist/assets/favicon-BkwcEHsj.ico +0 -0
  86. package/dist/assets/index-DUlKsori.css +0 -1
  87. package/dist/assets/index-ijmIcyn1.js +0 -27
  88. package/dist/assets/logo-BYNFyja1.png +0 -0
  89. package/dist/index.cjs +0 -2129
  90. package/dist/index.d.cts +0 -218
  91. package/dist/index.d.ts +0 -218
  92. package/dist/index.html +0 -14
  93. package/dist/index.js +0 -2125
package/dist/index.js DELETED
@@ -1,2125 +0,0 @@
1
- import { createReadStream, lstatSync } from "fs";
2
- import path from "path";
3
- import { fileURLToPath } from "url";
4
- import { loadConfig } from "@hot-updater/cli-tools";
5
-
6
- //#region rolldown:runtime
7
- var __create = Object.create;
8
- var __defProp = Object.defineProperty;
9
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
- var __getOwnPropNames = Object.getOwnPropertyNames;
11
- var __getProtoOf = Object.getPrototypeOf;
12
- var __hasOwnProp = Object.prototype.hasOwnProperty;
13
- var __commonJS = (cb, mod) => function() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
18
- key = keys[i];
19
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
20
- get: ((k) => from[k]).bind(null, key),
21
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
22
- });
23
- }
24
- return to;
25
- };
26
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
27
- value: mod,
28
- enumerable: true
29
- }) : target, mod));
30
-
31
- //#endregion
32
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/filepath.js
33
- var getFilePath = (options) => {
34
- let filename = options.filename;
35
- const defaultDocument = options.defaultDocument || "index.html";
36
- if (filename.endsWith("/")) filename = filename.concat(defaultDocument);
37
- else if (!filename.match(/\.[a-zA-Z0-9_-]+$/)) filename = filename.concat("/" + defaultDocument);
38
- return getFilePathWithoutDefaultDocument({
39
- root: options.root,
40
- filename
41
- });
42
- };
43
- var getFilePathWithoutDefaultDocument = (options) => {
44
- let root = options.root || "";
45
- let filename = options.filename;
46
- if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) return;
47
- filename = filename.replace(/^\.?[\/\\]/, "");
48
- filename = filename.replace(/\\/, "/");
49
- root = root.replace(/\/$/, "");
50
- let path$1 = root ? root + "/" + filename : filename;
51
- path$1 = path$1.replace(/^\.?\//, "");
52
- if (root[0] !== "/" && path$1[0] === "/") return;
53
- return path$1;
54
- };
55
-
56
- //#endregion
57
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/mime.js
58
- var getMimeType = (filename, mimes = baseMimes) => {
59
- const match = filename.match(/\.([a-zA-Z0-9]+?)$/);
60
- if (!match) return;
61
- let mimeType = mimes[match[1]];
62
- if (mimeType && mimeType.startsWith("text") || mimeType === "application/json") mimeType += "; charset=utf-8";
63
- return mimeType;
64
- };
65
- var baseMimes = {
66
- aac: "audio/aac",
67
- avi: "video/x-msvideo",
68
- avif: "image/avif",
69
- av1: "video/av1",
70
- bin: "application/octet-stream",
71
- bmp: "image/bmp",
72
- css: "text/css",
73
- csv: "text/csv",
74
- eot: "application/vnd.ms-fontobject",
75
- epub: "application/epub+zip",
76
- gif: "image/gif",
77
- gz: "application/gzip",
78
- htm: "text/html",
79
- html: "text/html",
80
- ico: "image/x-icon",
81
- ics: "text/calendar",
82
- jpeg: "image/jpeg",
83
- jpg: "image/jpeg",
84
- js: "text/javascript",
85
- json: "application/json",
86
- jsonld: "application/ld+json",
87
- map: "application/json",
88
- mid: "audio/x-midi",
89
- midi: "audio/x-midi",
90
- mjs: "text/javascript",
91
- mp3: "audio/mpeg",
92
- mp4: "video/mp4",
93
- mpeg: "video/mpeg",
94
- oga: "audio/ogg",
95
- ogv: "video/ogg",
96
- ogx: "application/ogg",
97
- opus: "audio/opus",
98
- otf: "font/otf",
99
- pdf: "application/pdf",
100
- png: "image/png",
101
- rtf: "application/rtf",
102
- svg: "image/svg+xml",
103
- tif: "image/tiff",
104
- tiff: "image/tiff",
105
- ts: "video/mp2t",
106
- ttf: "font/ttf",
107
- txt: "text/plain",
108
- wasm: "application/wasm",
109
- webm: "video/webm",
110
- weba: "audio/webm",
111
- webp: "image/webp",
112
- woff: "font/woff",
113
- woff2: "font/woff2",
114
- xhtml: "application/xhtml+xml",
115
- xml: "application/xml",
116
- zip: "application/zip",
117
- "3gp": "video/3gpp",
118
- "3g2": "video/3gpp2",
119
- gltf: "model/gltf+json",
120
- glb: "model/gltf-binary"
121
- };
122
-
123
- //#endregion
124
- //#region ../../node_modules/.pnpm/@hono+node-server@1.13.4_hono@4.6.3/node_modules/@hono/node-server/dist/serve-static.mjs
125
- var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i;
126
- var ENCODINGS = {
127
- br: ".br",
128
- zstd: ".zst",
129
- gzip: ".gz"
130
- };
131
- var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS);
132
- var createStreamBody = (stream) => {
133
- return new ReadableStream({
134
- start(controller) {
135
- stream.on("data", (chunk) => {
136
- controller.enqueue(chunk);
137
- });
138
- stream.on("end", () => {
139
- controller.close();
140
- });
141
- },
142
- cancel() {
143
- stream.destroy();
144
- }
145
- });
146
- };
147
- var addCurrentDirPrefix = (path$1) => {
148
- return `./${path$1}`;
149
- };
150
- var getStats = (path$1) => {
151
- let stats;
152
- try {
153
- stats = lstatSync(path$1);
154
- } catch {}
155
- return stats;
156
- };
157
- var serveStatic = (options = { root: "" }) => {
158
- return async (c, next) => {
159
- if (c.finalized) return next();
160
- let filename;
161
- try {
162
- filename = options.path ?? decodeURIComponent(c.req.path);
163
- } catch {
164
- await options.onNotFound?.(c.req.path, c);
165
- return next();
166
- }
167
- let path$1 = getFilePathWithoutDefaultDocument({
168
- filename: options.rewriteRequestPath ? options.rewriteRequestPath(filename) : filename,
169
- root: options.root
170
- });
171
- if (path$1) path$1 = addCurrentDirPrefix(path$1);
172
- else return next();
173
- let stats = getStats(path$1);
174
- if (stats && stats.isDirectory()) {
175
- path$1 = getFilePath({
176
- filename: options.rewriteRequestPath ? options.rewriteRequestPath(filename) : filename,
177
- root: options.root,
178
- defaultDocument: options.index ?? "index.html"
179
- });
180
- if (path$1) path$1 = addCurrentDirPrefix(path$1);
181
- else return next();
182
- stats = getStats(path$1);
183
- }
184
- if (!stats) {
185
- await options.onNotFound?.(path$1, c);
186
- return next();
187
- }
188
- await options.onFound?.(path$1, c);
189
- const mimeType = getMimeType(path$1);
190
- c.header("Content-Type", mimeType || "application/octet-stream");
191
- if (options.precompressed && (!mimeType || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
192
- const acceptEncodingSet = new Set(c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()));
193
- for (const encoding of ENCODINGS_ORDERED_KEYS) {
194
- if (!acceptEncodingSet.has(encoding)) continue;
195
- const precompressedStats = getStats(path$1 + ENCODINGS[encoding]);
196
- if (precompressedStats) {
197
- c.header("Content-Encoding", encoding);
198
- c.header("Vary", "Accept-Encoding", { append: true });
199
- stats = precompressedStats;
200
- path$1 = path$1 + ENCODINGS[encoding];
201
- break;
202
- }
203
- }
204
- }
205
- const size = stats.size;
206
- if (c.req.method == "HEAD" || c.req.method == "OPTIONS") {
207
- c.header("Content-Length", size.toString());
208
- c.status(200);
209
- return c.body(null);
210
- }
211
- const range = c.req.header("range") || "";
212
- if (!range) {
213
- c.header("Content-Length", size.toString());
214
- return c.body(createStreamBody(createReadStream(path$1)), 200);
215
- }
216
- c.header("Accept-Ranges", "bytes");
217
- c.header("Date", stats.birthtime.toUTCString());
218
- const parts = range.replace(/bytes=/, "").split("-", 2);
219
- const start = parts[0] ? parseInt(parts[0], 10) : 0;
220
- let end = parts[1] ? parseInt(parts[1], 10) : stats.size - 1;
221
- if (size < end - start + 1) end = size - 1;
222
- const chunksize = end - start + 1;
223
- const stream = createReadStream(path$1, {
224
- start,
225
- end
226
- });
227
- c.header("Content-Length", chunksize.toString());
228
- c.header("Content-Range", `bytes ${start}-${end}/${stats.size}`);
229
- return c.body(createStreamBody(stream), 206);
230
- };
231
- };
232
-
233
- //#endregion
234
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/body.js
235
- var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
236
- const { all = false, dot = false } = options;
237
- const contentType = (request instanceof HonoRequest ? request.raw.headers : request.headers).get("Content-Type");
238
- if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) return parseFormData(request, {
239
- all,
240
- dot
241
- });
242
- return {};
243
- };
244
- async function parseFormData(request, options) {
245
- const formData = await request.formData();
246
- if (formData) return convertFormDataToBodyData(formData, options);
247
- return {};
248
- }
249
- function convertFormDataToBodyData(formData, options) {
250
- const form = /* @__PURE__ */ Object.create(null);
251
- formData.forEach((value, key) => {
252
- if (!(options.all || key.endsWith("[]"))) form[key] = value;
253
- else handleParsingAllValues(form, key, value);
254
- });
255
- if (options.dot) Object.entries(form).forEach(([key, value]) => {
256
- if (key.includes(".")) {
257
- handleParsingNestedValues(form, key, value);
258
- delete form[key];
259
- }
260
- });
261
- return form;
262
- }
263
- var handleParsingAllValues = (form, key, value) => {
264
- if (form[key] !== void 0) if (Array.isArray(form[key])) form[key].push(value);
265
- else form[key] = [form[key], value];
266
- else form[key] = value;
267
- };
268
- var handleParsingNestedValues = (form, key, value) => {
269
- let nestedForm = form;
270
- const keys = key.split(".");
271
- keys.forEach((key2, index) => {
272
- if (index === keys.length - 1) nestedForm[key2] = value;
273
- else {
274
- if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) nestedForm[key2] = /* @__PURE__ */ Object.create(null);
275
- nestedForm = nestedForm[key2];
276
- }
277
- });
278
- };
279
-
280
- //#endregion
281
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/url.js
282
- var splitPath = (path$1) => {
283
- const paths = path$1.split("/");
284
- if (paths[0] === "") paths.shift();
285
- return paths;
286
- };
287
- var splitRoutingPath = (routePath) => {
288
- const { groups, path: path$1 } = extractGroupsFromPath(routePath);
289
- return replaceGroupMarks(splitPath(path$1), groups);
290
- };
291
- var extractGroupsFromPath = (path$1) => {
292
- const groups = [];
293
- path$1 = path$1.replace(/\{[^}]+\}/g, (match, index) => {
294
- const mark = `@${index}`;
295
- groups.push([mark, match]);
296
- return mark;
297
- });
298
- return {
299
- groups,
300
- path: path$1
301
- };
302
- };
303
- var replaceGroupMarks = (paths, groups) => {
304
- for (let i = groups.length - 1; i >= 0; i--) {
305
- const [mark] = groups[i];
306
- for (let j = paths.length - 1; j >= 0; j--) if (paths[j].includes(mark)) {
307
- paths[j] = paths[j].replace(mark, groups[i][1]);
308
- break;
309
- }
310
- }
311
- return paths;
312
- };
313
- var patternCache = {};
314
- var getPattern = (label) => {
315
- if (label === "*") return "*";
316
- const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
317
- if (match) {
318
- if (!patternCache[label]) if (match[2]) patternCache[label] = [
319
- label,
320
- match[1],
321
- /* @__PURE__ */ new RegExp("^" + match[2] + "$")
322
- ];
323
- else patternCache[label] = [
324
- label,
325
- match[1],
326
- true
327
- ];
328
- return patternCache[label];
329
- }
330
- return null;
331
- };
332
- var tryDecodeURI = (str) => {
333
- try {
334
- return decodeURI(str);
335
- } catch {
336
- return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => {
337
- try {
338
- return decodeURI(match);
339
- } catch {
340
- return match;
341
- }
342
- });
343
- }
344
- };
345
- var getPath = (request) => {
346
- const url = request.url;
347
- const start = url.indexOf("/", 8);
348
- let i = start;
349
- for (; i < url.length; i++) {
350
- const charCode = url.charCodeAt(i);
351
- if (charCode === 37) {
352
- const queryIndex = url.indexOf("?", i);
353
- const path$1 = url.slice(start, queryIndex === -1 ? void 0 : queryIndex);
354
- return tryDecodeURI(path$1.includes("%25") ? path$1.replace(/%25/g, "%2525") : path$1);
355
- } else if (charCode === 63) break;
356
- }
357
- return url.slice(start, i);
358
- };
359
- var getPathNoStrict = (request) => {
360
- const result = getPath(request);
361
- return result.length > 1 && result[result.length - 1] === "/" ? result.slice(0, -1) : result;
362
- };
363
- var mergePath = (...paths) => {
364
- let p = "";
365
- let endsWithSlash = false;
366
- for (let path$1 of paths) {
367
- if (p[p.length - 1] === "/") {
368
- p = p.slice(0, -1);
369
- endsWithSlash = true;
370
- }
371
- if (path$1[0] !== "/") path$1 = `/${path$1}`;
372
- if (path$1 === "/" && endsWithSlash) p = `${p}/`;
373
- else if (path$1 !== "/") p = `${p}${path$1}`;
374
- if (path$1 === "/" && p === "") p = "/";
375
- }
376
- return p;
377
- };
378
- var checkOptionalParameter = (path$1) => {
379
- if (!path$1.match(/\:.+\?$/)) return null;
380
- const segments = path$1.split("/");
381
- const results = [];
382
- let basePath = "";
383
- segments.forEach((segment) => {
384
- if (segment !== "" && !/\:/.test(segment)) basePath += "/" + segment;
385
- else if (/\:/.test(segment)) if (/\?/.test(segment)) {
386
- if (results.length === 0 && basePath === "") results.push("/");
387
- else results.push(basePath);
388
- const optionalSegment = segment.replace("?", "");
389
- basePath += "/" + optionalSegment;
390
- results.push(basePath);
391
- } else basePath += "/" + segment;
392
- });
393
- return results.filter((v, i, a) => a.indexOf(v) === i);
394
- };
395
- var _decodeURI = (value) => {
396
- if (!/[%+]/.test(value)) return value;
397
- if (value.indexOf("+") !== -1) value = value.replace(/\+/g, " ");
398
- return /%/.test(value) ? decodeURIComponent_(value) : value;
399
- };
400
- var _getQueryParam = (url, key, multiple) => {
401
- let encoded;
402
- if (!multiple && key && !/[%+]/.test(key)) {
403
- let keyIndex2 = url.indexOf(`?${key}`, 8);
404
- if (keyIndex2 === -1) keyIndex2 = url.indexOf(`&${key}`, 8);
405
- while (keyIndex2 !== -1) {
406
- const trailingKeyCode = url.charCodeAt(keyIndex2 + key.length + 1);
407
- if (trailingKeyCode === 61) {
408
- const valueIndex = keyIndex2 + key.length + 2;
409
- const endIndex = url.indexOf("&", valueIndex);
410
- return _decodeURI(url.slice(valueIndex, endIndex === -1 ? void 0 : endIndex));
411
- } else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) return "";
412
- keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1);
413
- }
414
- encoded = /[%+]/.test(url);
415
- if (!encoded) return;
416
- }
417
- const results = {};
418
- encoded ??= /[%+]/.test(url);
419
- let keyIndex = url.indexOf("?", 8);
420
- while (keyIndex !== -1) {
421
- const nextKeyIndex = url.indexOf("&", keyIndex + 1);
422
- let valueIndex = url.indexOf("=", keyIndex);
423
- if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) valueIndex = -1;
424
- let name = url.slice(keyIndex + 1, valueIndex === -1 ? nextKeyIndex === -1 ? void 0 : nextKeyIndex : valueIndex);
425
- if (encoded) name = _decodeURI(name);
426
- keyIndex = nextKeyIndex;
427
- if (name === "") continue;
428
- let value;
429
- if (valueIndex === -1) value = "";
430
- else {
431
- value = url.slice(valueIndex + 1, nextKeyIndex === -1 ? void 0 : nextKeyIndex);
432
- if (encoded) value = _decodeURI(value);
433
- }
434
- if (multiple) {
435
- if (!(results[name] && Array.isArray(results[name]))) results[name] = [];
436
- results[name].push(value);
437
- } else results[name] ??= value;
438
- }
439
- return key ? results[key] : results;
440
- };
441
- var getQueryParam = _getQueryParam;
442
- var getQueryParams = (url, key) => {
443
- return _getQueryParam(url, key, true);
444
- };
445
- var decodeURIComponent_ = decodeURIComponent;
446
-
447
- //#endregion
448
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/request.js
449
- var HonoRequest = class {
450
- raw;
451
- #validatedData;
452
- #matchResult;
453
- routeIndex = 0;
454
- path;
455
- bodyCache = {};
456
- constructor(request, path$1 = "/", matchResult = [[]]) {
457
- this.raw = request;
458
- this.path = path$1;
459
- this.#matchResult = matchResult;
460
- this.#validatedData = {};
461
- }
462
- param(key) {
463
- return key ? this.getDecodedParam(key) : this.getAllDecodedParams();
464
- }
465
- getDecodedParam(key) {
466
- const paramKey = this.#matchResult[0][this.routeIndex][1][key];
467
- const param = this.getParamValue(paramKey);
468
- return param ? /\%/.test(param) ? decodeURIComponent_(param) : param : void 0;
469
- }
470
- getAllDecodedParams() {
471
- const decoded = {};
472
- const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]);
473
- for (const key of keys) {
474
- const value = this.getParamValue(this.#matchResult[0][this.routeIndex][1][key]);
475
- if (value && typeof value === "string") decoded[key] = /\%/.test(value) ? decodeURIComponent_(value) : value;
476
- }
477
- return decoded;
478
- }
479
- getParamValue(paramKey) {
480
- return this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey;
481
- }
482
- query(key) {
483
- return getQueryParam(this.url, key);
484
- }
485
- queries(key) {
486
- return getQueryParams(this.url, key);
487
- }
488
- header(name) {
489
- if (name) return this.raw.headers.get(name.toLowerCase()) ?? void 0;
490
- const headerData = {};
491
- this.raw.headers.forEach((value, key) => {
492
- headerData[key] = value;
493
- });
494
- return headerData;
495
- }
496
- async parseBody(options) {
497
- return this.bodyCache.parsedBody ??= await parseBody(this, options);
498
- }
499
- cachedBody = (key) => {
500
- const { bodyCache, raw: raw$1 } = this;
501
- const cachedBody = bodyCache[key];
502
- if (cachedBody) return cachedBody;
503
- const anyCachedKey = Object.keys(bodyCache)[0];
504
- if (anyCachedKey) return bodyCache[anyCachedKey].then((body) => {
505
- if (anyCachedKey === "json") body = JSON.stringify(body);
506
- return new Response(body)[key]();
507
- });
508
- return bodyCache[key] = raw$1[key]();
509
- };
510
- json() {
511
- return this.cachedBody("json");
512
- }
513
- text() {
514
- return this.cachedBody("text");
515
- }
516
- arrayBuffer() {
517
- return this.cachedBody("arrayBuffer");
518
- }
519
- blob() {
520
- return this.cachedBody("blob");
521
- }
522
- formData() {
523
- return this.cachedBody("formData");
524
- }
525
- addValidatedData(target, data) {
526
- this.#validatedData[target] = data;
527
- }
528
- valid(target) {
529
- return this.#validatedData[target];
530
- }
531
- get url() {
532
- return this.raw.url;
533
- }
534
- get method() {
535
- return this.raw.method;
536
- }
537
- get matchedRoutes() {
538
- return this.#matchResult[0].map(([[, route]]) => route);
539
- }
540
- get routePath() {
541
- return this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path;
542
- }
543
- };
544
-
545
- //#endregion
546
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/html.js
547
- var HtmlEscapedCallbackPhase = {
548
- Stringify: 1,
549
- BeforeStream: 2,
550
- Stream: 3
551
- };
552
- var raw = (value, callbacks) => {
553
- const escapedString = new String(value);
554
- escapedString.isEscaped = true;
555
- escapedString.callbacks = callbacks;
556
- return escapedString;
557
- };
558
- var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
559
- if (typeof str === "object" && !(str instanceof String)) {
560
- if (!(str instanceof Promise)) str = str.toString();
561
- if (str instanceof Promise) str = await str;
562
- }
563
- const callbacks = str.callbacks;
564
- if (!callbacks?.length) return Promise.resolve(str);
565
- if (buffer) buffer[0] += str;
566
- else buffer = [str];
567
- const resStr = Promise.all(callbacks.map((c) => c({
568
- phase,
569
- buffer,
570
- context
571
- }))).then((res) => Promise.all(res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer))).then(() => buffer[0]));
572
- if (preserveCallbacks) return raw(await resStr, callbacks);
573
- else return resStr;
574
- };
575
-
576
- //#endregion
577
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/context.js
578
- var TEXT_PLAIN = "text/plain; charset=UTF-8";
579
- var setHeaders = (headers, map = {}) => {
580
- Object.entries(map).forEach(([key, value]) => headers.set(key, value));
581
- return headers;
582
- };
583
- var Context = class {
584
- #rawRequest;
585
- #req;
586
- env = {};
587
- #var;
588
- finalized = false;
589
- error;
590
- #status = 200;
591
- #executionCtx;
592
- #headers;
593
- #preparedHeaders;
594
- #res;
595
- #isFresh = true;
596
- #layout;
597
- #renderer;
598
- #notFoundHandler;
599
- #matchResult;
600
- #path;
601
- constructor(req, options) {
602
- this.#rawRequest = req;
603
- if (options) {
604
- this.#executionCtx = options.executionCtx;
605
- this.env = options.env;
606
- this.#notFoundHandler = options.notFoundHandler;
607
- this.#path = options.path;
608
- this.#matchResult = options.matchResult;
609
- }
610
- }
611
- get req() {
612
- this.#req ??= new HonoRequest(this.#rawRequest, this.#path, this.#matchResult);
613
- return this.#req;
614
- }
615
- get event() {
616
- if (this.#executionCtx && "respondWith" in this.#executionCtx) return this.#executionCtx;
617
- else throw Error("This context has no FetchEvent");
618
- }
619
- get executionCtx() {
620
- if (this.#executionCtx) return this.#executionCtx;
621
- else throw Error("This context has no ExecutionContext");
622
- }
623
- get res() {
624
- this.#isFresh = false;
625
- return this.#res ||= new Response("404 Not Found", { status: 404 });
626
- }
627
- set res(_res) {
628
- this.#isFresh = false;
629
- if (this.#res && _res) try {
630
- for (const [k, v] of this.#res.headers.entries()) {
631
- if (k === "content-type") continue;
632
- if (k === "set-cookie") {
633
- const cookies = this.#res.headers.getSetCookie();
634
- _res.headers.delete("set-cookie");
635
- for (const cookie of cookies) _res.headers.append("set-cookie", cookie);
636
- } else _res.headers.set(k, v);
637
- }
638
- } catch (e) {
639
- if (e instanceof TypeError && e.message.includes("immutable")) {
640
- this.res = new Response(_res.body, {
641
- headers: _res.headers,
642
- status: _res.status
643
- });
644
- return;
645
- } else throw e;
646
- }
647
- this.#res = _res;
648
- this.finalized = true;
649
- }
650
- render = (...args) => {
651
- this.#renderer ??= (content) => this.html(content);
652
- return this.#renderer(...args);
653
- };
654
- setLayout = (layout) => this.#layout = layout;
655
- getLayout = () => this.#layout;
656
- setRenderer = (renderer) => {
657
- this.#renderer = renderer;
658
- };
659
- header = (name, value, options) => {
660
- if (value === void 0) {
661
- if (this.#headers) this.#headers.delete(name);
662
- else if (this.#preparedHeaders) delete this.#preparedHeaders[name.toLocaleLowerCase()];
663
- if (this.finalized) this.res.headers.delete(name);
664
- return;
665
- }
666
- if (options?.append) {
667
- if (!this.#headers) {
668
- this.#isFresh = false;
669
- this.#headers = new Headers(this.#preparedHeaders);
670
- this.#preparedHeaders = {};
671
- }
672
- this.#headers.append(name, value);
673
- } else if (this.#headers) this.#headers.set(name, value);
674
- else {
675
- this.#preparedHeaders ??= {};
676
- this.#preparedHeaders[name.toLowerCase()] = value;
677
- }
678
- if (this.finalized) if (options?.append) this.res.headers.append(name, value);
679
- else this.res.headers.set(name, value);
680
- };
681
- status = (status) => {
682
- this.#isFresh = false;
683
- this.#status = status;
684
- };
685
- set = (key, value) => {
686
- this.#var ??= /* @__PURE__ */ new Map();
687
- this.#var.set(key, value);
688
- };
689
- get = (key) => {
690
- return this.#var ? this.#var.get(key) : void 0;
691
- };
692
- get var() {
693
- if (!this.#var) return {};
694
- return Object.fromEntries(this.#var);
695
- }
696
- newResponse = (data, arg, headers) => {
697
- if (this.#isFresh && !headers && !arg && this.#status === 200) return new Response(data, { headers: this.#preparedHeaders });
698
- if (arg && typeof arg !== "number") {
699
- const header = new Headers(arg.headers);
700
- if (this.#headers) this.#headers.forEach((v, k) => {
701
- if (k === "set-cookie") header.append(k, v);
702
- else header.set(k, v);
703
- });
704
- const headers2 = setHeaders(header, this.#preparedHeaders);
705
- return new Response(data, {
706
- headers: headers2,
707
- status: arg.status ?? this.#status
708
- });
709
- }
710
- const status = typeof arg === "number" ? arg : this.#status;
711
- this.#preparedHeaders ??= {};
712
- this.#headers ??= new Headers();
713
- setHeaders(this.#headers, this.#preparedHeaders);
714
- if (this.#res) {
715
- this.#res.headers.forEach((v, k) => {
716
- if (k === "set-cookie") this.#headers?.append(k, v);
717
- else this.#headers?.set(k, v);
718
- });
719
- setHeaders(this.#headers, this.#preparedHeaders);
720
- }
721
- headers ??= {};
722
- for (const [k, v] of Object.entries(headers)) if (typeof v === "string") this.#headers.set(k, v);
723
- else {
724
- this.#headers.delete(k);
725
- for (const v2 of v) this.#headers.append(k, v2);
726
- }
727
- return new Response(data, {
728
- status,
729
- headers: this.#headers
730
- });
731
- };
732
- body = (data, arg, headers) => {
733
- return typeof arg === "number" ? this.newResponse(data, arg, headers) : this.newResponse(data, arg);
734
- };
735
- text = (text, arg, headers) => {
736
- if (!this.#preparedHeaders) {
737
- if (this.#isFresh && !headers && !arg) return new Response(text);
738
- this.#preparedHeaders = {};
739
- }
740
- this.#preparedHeaders["content-type"] = TEXT_PLAIN;
741
- return typeof arg === "number" ? this.newResponse(text, arg, headers) : this.newResponse(text, arg);
742
- };
743
- json = (object, arg, headers) => {
744
- const body = JSON.stringify(object);
745
- this.#preparedHeaders ??= {};
746
- this.#preparedHeaders["content-type"] = "application/json; charset=UTF-8";
747
- return typeof arg === "number" ? this.newResponse(body, arg, headers) : this.newResponse(body, arg);
748
- };
749
- html = (html, arg, headers) => {
750
- this.#preparedHeaders ??= {};
751
- this.#preparedHeaders["content-type"] = "text/html; charset=UTF-8";
752
- if (typeof html === "object") return resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then((html2) => {
753
- return typeof arg === "number" ? this.newResponse(html2, arg, headers) : this.newResponse(html2, arg);
754
- });
755
- return typeof arg === "number" ? this.newResponse(html, arg, headers) : this.newResponse(html, arg);
756
- };
757
- redirect = (location, status) => {
758
- this.#headers ??= new Headers();
759
- this.#headers.set("Location", location);
760
- return this.newResponse(null, status ?? 302);
761
- };
762
- notFound = () => {
763
- this.#notFoundHandler ??= () => new Response();
764
- return this.#notFoundHandler(this);
765
- };
766
- };
767
-
768
- //#endregion
769
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/compose.js
770
- var compose = (middleware, onError, onNotFound) => {
771
- return (context, next) => {
772
- let index = -1;
773
- return dispatch(0);
774
- async function dispatch(i) {
775
- if (i <= index) throw new Error("next() called multiple times");
776
- index = i;
777
- let res;
778
- let isError = false;
779
- let handler;
780
- if (middleware[i]) {
781
- handler = middleware[i][0][0];
782
- if (context instanceof Context) context.req.routeIndex = i;
783
- } else handler = i === middleware.length && next || void 0;
784
- if (!handler) {
785
- if (context instanceof Context && context.finalized === false && onNotFound) res = await onNotFound(context);
786
- } else try {
787
- res = await handler(context, () => {
788
- return dispatch(i + 1);
789
- });
790
- } catch (err) {
791
- if (err instanceof Error && context instanceof Context && onError) {
792
- context.error = err;
793
- res = await onError(err, context);
794
- isError = true;
795
- } else throw err;
796
- }
797
- if (res && (context.finalized === false || isError)) context.res = res;
798
- return context;
799
- }
800
- };
801
- };
802
-
803
- //#endregion
804
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router.js
805
- var METHOD_NAME_ALL = "ALL";
806
- var METHOD_NAME_ALL_LOWERCASE = "all";
807
- var METHODS = [
808
- "get",
809
- "post",
810
- "put",
811
- "delete",
812
- "options",
813
- "patch"
814
- ];
815
- var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
816
- var UnsupportedPathError = class extends Error {};
817
-
818
- //#endregion
819
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/hono-base.js
820
- var COMPOSED_HANDLER = Symbol("composedHandler");
821
- var notFoundHandler = (c) => {
822
- return c.text("404 Not Found", 404);
823
- };
824
- var errorHandler = (err, c) => {
825
- if ("getResponse" in err) return err.getResponse();
826
- console.error(err);
827
- return c.text("Internal Server Error", 500);
828
- };
829
- var Hono$1 = class {
830
- get;
831
- post;
832
- put;
833
- delete;
834
- options;
835
- patch;
836
- all;
837
- on;
838
- use;
839
- router;
840
- getPath;
841
- _basePath = "/";
842
- #path = "/";
843
- routes = [];
844
- constructor(options = {}) {
845
- [...METHODS, METHOD_NAME_ALL_LOWERCASE].forEach((method) => {
846
- this[method] = (args1, ...args) => {
847
- if (typeof args1 === "string") this.#path = args1;
848
- else this.addRoute(method, this.#path, args1);
849
- args.forEach((handler) => {
850
- if (typeof handler !== "string") this.addRoute(method, this.#path, handler);
851
- });
852
- return this;
853
- };
854
- });
855
- this.on = (method, path$1, ...handlers) => {
856
- for (const p of [path$1].flat()) {
857
- this.#path = p;
858
- for (const m of [method].flat()) handlers.map((handler) => {
859
- this.addRoute(m.toUpperCase(), this.#path, handler);
860
- });
861
- }
862
- return this;
863
- };
864
- this.use = (arg1, ...handlers) => {
865
- if (typeof arg1 === "string") this.#path = arg1;
866
- else {
867
- this.#path = "*";
868
- handlers.unshift(arg1);
869
- }
870
- handlers.forEach((handler) => {
871
- this.addRoute(METHOD_NAME_ALL, this.#path, handler);
872
- });
873
- return this;
874
- };
875
- const strict = options.strict ?? true;
876
- delete options.strict;
877
- Object.assign(this, options);
878
- this.getPath = strict ? options.getPath ?? getPath : getPathNoStrict;
879
- }
880
- clone() {
881
- const clone = new Hono$1({
882
- router: this.router,
883
- getPath: this.getPath
884
- });
885
- clone.routes = this.routes;
886
- return clone;
887
- }
888
- notFoundHandler = notFoundHandler;
889
- errorHandler = errorHandler;
890
- route(path$1, app$1) {
891
- const subApp = this.basePath(path$1);
892
- app$1.routes.map((r) => {
893
- let handler;
894
- if (app$1.errorHandler === errorHandler) handler = r.handler;
895
- else {
896
- handler = async (c, next) => (await compose([], app$1.errorHandler)(c, () => r.handler(c, next))).res;
897
- handler[COMPOSED_HANDLER] = r.handler;
898
- }
899
- subApp.addRoute(r.method, r.path, handler);
900
- });
901
- return this;
902
- }
903
- basePath(path$1) {
904
- const subApp = this.clone();
905
- subApp._basePath = mergePath(this._basePath, path$1);
906
- return subApp;
907
- }
908
- onError = (handler) => {
909
- this.errorHandler = handler;
910
- return this;
911
- };
912
- notFound = (handler) => {
913
- this.notFoundHandler = handler;
914
- return this;
915
- };
916
- mount(path$1, applicationHandler, options) {
917
- let replaceRequest;
918
- let optionHandler;
919
- if (options) if (typeof options === "function") optionHandler = options;
920
- else {
921
- optionHandler = options.optionHandler;
922
- replaceRequest = options.replaceRequest;
923
- }
924
- const getOptions = optionHandler ? (c) => {
925
- const options2 = optionHandler(c);
926
- return Array.isArray(options2) ? options2 : [options2];
927
- } : (c) => {
928
- let executionContext = void 0;
929
- try {
930
- executionContext = c.executionCtx;
931
- } catch {}
932
- return [c.env, executionContext];
933
- };
934
- replaceRequest ||= (() => {
935
- const mergedPath = mergePath(this._basePath, path$1);
936
- const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
937
- return (request) => {
938
- const url = new URL(request.url);
939
- url.pathname = url.pathname.slice(pathPrefixLength) || "/";
940
- return new Request(url, request);
941
- };
942
- })();
943
- const handler = async (c, next) => {
944
- const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c));
945
- if (res) return res;
946
- await next();
947
- };
948
- this.addRoute(METHOD_NAME_ALL, mergePath(path$1, "*"), handler);
949
- return this;
950
- }
951
- addRoute(method, path$1, handler) {
952
- method = method.toUpperCase();
953
- path$1 = mergePath(this._basePath, path$1);
954
- const r = {
955
- path: path$1,
956
- method,
957
- handler
958
- };
959
- this.router.add(method, path$1, [handler, r]);
960
- this.routes.push(r);
961
- }
962
- matchRoute(method, path$1) {
963
- return this.router.match(method, path$1);
964
- }
965
- handleError(err, c) {
966
- if (err instanceof Error) return this.errorHandler(err, c);
967
- throw err;
968
- }
969
- dispatch(request, executionCtx, env, method) {
970
- if (method === "HEAD") return (async () => new Response(null, await this.dispatch(request, executionCtx, env, "GET")))();
971
- const path$1 = this.getPath(request, { env });
972
- const matchResult = this.matchRoute(method, path$1);
973
- const c = new Context(request, {
974
- path: path$1,
975
- matchResult,
976
- env,
977
- executionCtx,
978
- notFoundHandler: this.notFoundHandler
979
- });
980
- if (matchResult[0].length === 1) {
981
- let res;
982
- try {
983
- res = matchResult[0][0][0][0](c, async () => {
984
- c.res = await this.notFoundHandler(c);
985
- });
986
- } catch (err) {
987
- return this.handleError(err, c);
988
- }
989
- return res instanceof Promise ? res.then((resolved) => resolved || (c.finalized ? c.res : this.notFoundHandler(c))).catch((err) => this.handleError(err, c)) : res ?? this.notFoundHandler(c);
990
- }
991
- const composed = compose(matchResult[0], this.errorHandler, this.notFoundHandler);
992
- return (async () => {
993
- try {
994
- const context = await composed(c);
995
- if (!context.finalized) throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");
996
- return context.res;
997
- } catch (err) {
998
- return this.handleError(err, c);
999
- }
1000
- })();
1001
- }
1002
- fetch = (request, ...rest) => {
1003
- return this.dispatch(request, rest[1], rest[0], request.method);
1004
- };
1005
- request = (input, requestInit, Env, executionCtx) => {
1006
- if (input instanceof Request) {
1007
- if (requestInit !== void 0) input = new Request(input, requestInit);
1008
- return this.fetch(input, Env, executionCtx);
1009
- }
1010
- input = input.toString();
1011
- const path$1 = /^https?:\/\//.test(input) ? input : `http://localhost${mergePath("/", input)}`;
1012
- const req = new Request(path$1, requestInit);
1013
- return this.fetch(req, Env, executionCtx);
1014
- };
1015
- fire = () => {
1016
- addEventListener("fetch", (event) => {
1017
- event.respondWith(this.dispatch(event.request, event, void 0, event.request.method));
1018
- });
1019
- };
1020
- };
1021
-
1022
- //#endregion
1023
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/reg-exp-router/node.js
1024
- var LABEL_REG_EXP_STR = "[^/]+";
1025
- var ONLY_WILDCARD_REG_EXP_STR = ".*";
1026
- var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
1027
- var PATH_ERROR = Symbol();
1028
- var regExpMetaChars = /* @__PURE__ */ new Set(".\\+*[^]$()");
1029
- function compareKey(a, b) {
1030
- if (a.length === 1) return b.length === 1 ? a < b ? -1 : 1 : -1;
1031
- if (b.length === 1) return 1;
1032
- if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) return 1;
1033
- else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) return -1;
1034
- if (a === LABEL_REG_EXP_STR) return 1;
1035
- else if (b === LABEL_REG_EXP_STR) return -1;
1036
- return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length;
1037
- }
1038
- var Node$1 = class {
1039
- index;
1040
- varIndex;
1041
- children = /* @__PURE__ */ Object.create(null);
1042
- insert(tokens, index, paramMap, context, pathErrorCheckOnly) {
1043
- if (tokens.length === 0) {
1044
- if (this.index !== void 0) throw PATH_ERROR;
1045
- if (pathErrorCheckOnly) return;
1046
- this.index = index;
1047
- return;
1048
- }
1049
- const [token, ...restTokens] = tokens;
1050
- const pattern = token === "*" ? restTokens.length === 0 ? [
1051
- "",
1052
- "",
1053
- ONLY_WILDCARD_REG_EXP_STR
1054
- ] : [
1055
- "",
1056
- "",
1057
- LABEL_REG_EXP_STR
1058
- ] : token === "/*" ? [
1059
- "",
1060
- "",
1061
- TAIL_WILDCARD_REG_EXP_STR
1062
- ] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
1063
- let node;
1064
- if (pattern) {
1065
- const name = pattern[1];
1066
- let regexpStr = pattern[2] || LABEL_REG_EXP_STR;
1067
- if (name && pattern[2]) {
1068
- regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
1069
- if (/\((?!\?:)/.test(regexpStr)) throw PATH_ERROR;
1070
- }
1071
- node = this.children[regexpStr];
1072
- if (!node) {
1073
- if (Object.keys(this.children).some((k) => k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR)) throw PATH_ERROR;
1074
- if (pathErrorCheckOnly) return;
1075
- node = this.children[regexpStr] = new Node$1();
1076
- if (name !== "") node.varIndex = context.varIndex++;
1077
- }
1078
- if (!pathErrorCheckOnly && name !== "") paramMap.push([name, node.varIndex]);
1079
- } else {
1080
- node = this.children[token];
1081
- if (!node) {
1082
- if (Object.keys(this.children).some((k) => k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR)) throw PATH_ERROR;
1083
- if (pathErrorCheckOnly) return;
1084
- node = this.children[token] = new Node$1();
1085
- }
1086
- }
1087
- node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly);
1088
- }
1089
- buildRegExpStr() {
1090
- const strList = Object.keys(this.children).sort(compareKey).map((k) => {
1091
- const c = this.children[k];
1092
- return (typeof c.varIndex === "number" ? `(${k})@${c.varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr();
1093
- });
1094
- if (typeof this.index === "number") strList.unshift(`#${this.index}`);
1095
- if (strList.length === 0) return "";
1096
- if (strList.length === 1) return strList[0];
1097
- return "(?:" + strList.join("|") + ")";
1098
- }
1099
- };
1100
-
1101
- //#endregion
1102
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/reg-exp-router/trie.js
1103
- var Trie = class {
1104
- context = { varIndex: 0 };
1105
- root = new Node$1();
1106
- insert(path$1, index, pathErrorCheckOnly) {
1107
- const paramAssoc = [];
1108
- const groups = [];
1109
- for (let i = 0;;) {
1110
- let replaced = false;
1111
- path$1 = path$1.replace(/\{[^}]+\}/g, (m) => {
1112
- const mark = `@\\${i}`;
1113
- groups[i] = [mark, m];
1114
- i++;
1115
- replaced = true;
1116
- return mark;
1117
- });
1118
- if (!replaced) break;
1119
- }
1120
- const tokens = path$1.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
1121
- for (let i = groups.length - 1; i >= 0; i--) {
1122
- const [mark] = groups[i];
1123
- for (let j = tokens.length - 1; j >= 0; j--) if (tokens[j].indexOf(mark) !== -1) {
1124
- tokens[j] = tokens[j].replace(mark, groups[i][1]);
1125
- break;
1126
- }
1127
- }
1128
- this.root.insert(tokens, index, paramAssoc, this.context, pathErrorCheckOnly);
1129
- return paramAssoc;
1130
- }
1131
- buildRegExp() {
1132
- let regexp = this.root.buildRegExpStr();
1133
- if (regexp === "") return [
1134
- /^$/,
1135
- [],
1136
- []
1137
- ];
1138
- let captureIndex = 0;
1139
- const indexReplacementMap = [];
1140
- const paramReplacementMap = [];
1141
- regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => {
1142
- if (typeof handlerIndex !== "undefined") {
1143
- indexReplacementMap[++captureIndex] = Number(handlerIndex);
1144
- return "$()";
1145
- }
1146
- if (typeof paramIndex !== "undefined") {
1147
- paramReplacementMap[Number(paramIndex)] = ++captureIndex;
1148
- return "";
1149
- }
1150
- return "";
1151
- });
1152
- return [
1153
- /* @__PURE__ */ new RegExp(`^${regexp}`),
1154
- indexReplacementMap,
1155
- paramReplacementMap
1156
- ];
1157
- }
1158
- };
1159
-
1160
- //#endregion
1161
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/reg-exp-router/router.js
1162
- var emptyParam = [];
1163
- var nullMatcher = [
1164
- /^$/,
1165
- [],
1166
- /* @__PURE__ */ Object.create(null)
1167
- ];
1168
- var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
1169
- function buildWildcardRegExp(path$1) {
1170
- return wildcardRegExpCache[path$1] ??= /* @__PURE__ */ new RegExp(path$1 === "*" ? "" : `^${path$1.replace(/\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)")}$`);
1171
- }
1172
- function clearWildcardRegExpCache() {
1173
- wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
1174
- }
1175
- function buildMatcherFromPreprocessedRoutes(routes) {
1176
- const trie = new Trie();
1177
- const handlerData = [];
1178
- if (routes.length === 0) return nullMatcher;
1179
- const routesWithStaticPathFlag = routes.map((route) => [!/\*|\/:/.test(route[0]), ...route]).sort(([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length);
1180
- const staticMap = /* @__PURE__ */ Object.create(null);
1181
- for (let i = 0, j = -1, len = routesWithStaticPathFlag.length; i < len; i++) {
1182
- const [pathErrorCheckOnly, path$1, handlers] = routesWithStaticPathFlag[i];
1183
- if (pathErrorCheckOnly) staticMap[path$1] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
1184
- else j++;
1185
- let paramAssoc;
1186
- try {
1187
- paramAssoc = trie.insert(path$1, j, pathErrorCheckOnly);
1188
- } catch (e) {
1189
- throw e === PATH_ERROR ? new UnsupportedPathError(path$1) : e;
1190
- }
1191
- if (pathErrorCheckOnly) continue;
1192
- handlerData[j] = handlers.map(([h, paramCount]) => {
1193
- const paramIndexMap = /* @__PURE__ */ Object.create(null);
1194
- paramCount -= 1;
1195
- for (; paramCount >= 0; paramCount--) {
1196
- const [key, value] = paramAssoc[paramCount];
1197
- paramIndexMap[key] = value;
1198
- }
1199
- return [h, paramIndexMap];
1200
- });
1201
- }
1202
- const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
1203
- for (let i = 0, len = handlerData.length; i < len; i++) for (let j = 0, len2 = handlerData[i].length; j < len2; j++) {
1204
- const map = handlerData[i][j]?.[1];
1205
- if (!map) continue;
1206
- const keys = Object.keys(map);
1207
- for (let k = 0, len3 = keys.length; k < len3; k++) map[keys[k]] = paramReplacementMap[map[keys[k]]];
1208
- }
1209
- const handlerMap = [];
1210
- for (const i in indexReplacementMap) handlerMap[i] = handlerData[indexReplacementMap[i]];
1211
- return [
1212
- regexp,
1213
- handlerMap,
1214
- staticMap
1215
- ];
1216
- }
1217
- function findMiddleware(middleware, path$1) {
1218
- if (!middleware) return;
1219
- for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) if (buildWildcardRegExp(k).test(path$1)) return [...middleware[k]];
1220
- }
1221
- var RegExpRouter = class {
1222
- name = "RegExpRouter";
1223
- middleware;
1224
- routes;
1225
- constructor() {
1226
- this.middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
1227
- this.routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
1228
- }
1229
- add(method, path$1, handler) {
1230
- const { middleware, routes } = this;
1231
- if (!middleware || !routes) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
1232
- if (!middleware[method]) [middleware, routes].forEach((handlerMap) => {
1233
- handlerMap[method] = /* @__PURE__ */ Object.create(null);
1234
- Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => {
1235
- handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]];
1236
- });
1237
- });
1238
- if (path$1 === "/*") path$1 = "*";
1239
- const paramCount = (path$1.match(/\/:/g) || []).length;
1240
- if (/\*$/.test(path$1)) {
1241
- const re = buildWildcardRegExp(path$1);
1242
- if (method === METHOD_NAME_ALL) Object.keys(middleware).forEach((m) => {
1243
- middleware[m][path$1] ||= findMiddleware(middleware[m], path$1) || findMiddleware(middleware[METHOD_NAME_ALL], path$1) || [];
1244
- });
1245
- else middleware[method][path$1] ||= findMiddleware(middleware[method], path$1) || findMiddleware(middleware[METHOD_NAME_ALL], path$1) || [];
1246
- Object.keys(middleware).forEach((m) => {
1247
- if (method === METHOD_NAME_ALL || method === m) Object.keys(middleware[m]).forEach((p) => {
1248
- re.test(p) && middleware[m][p].push([handler, paramCount]);
1249
- });
1250
- });
1251
- Object.keys(routes).forEach((m) => {
1252
- if (method === METHOD_NAME_ALL || method === m) Object.keys(routes[m]).forEach((p) => re.test(p) && routes[m][p].push([handler, paramCount]));
1253
- });
1254
- return;
1255
- }
1256
- const paths = checkOptionalParameter(path$1) || [path$1];
1257
- for (let i = 0, len = paths.length; i < len; i++) {
1258
- const path2 = paths[i];
1259
- Object.keys(routes).forEach((m) => {
1260
- if (method === METHOD_NAME_ALL || method === m) {
1261
- routes[m][path2] ||= [...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || []];
1262
- routes[m][path2].push([handler, paramCount - len + i + 1]);
1263
- }
1264
- });
1265
- }
1266
- }
1267
- match(method, path$1) {
1268
- clearWildcardRegExpCache();
1269
- const matchers = this.buildAllMatchers();
1270
- this.match = (method2, path2) => {
1271
- const matcher = matchers[method2] || matchers[METHOD_NAME_ALL];
1272
- const staticMatch = matcher[2][path2];
1273
- if (staticMatch) return staticMatch;
1274
- const match = path2.match(matcher[0]);
1275
- if (!match) return [[], emptyParam];
1276
- const index = match.indexOf("", 1);
1277
- return [matcher[1][index], match];
1278
- };
1279
- return this.match(method, path$1);
1280
- }
1281
- buildAllMatchers() {
1282
- const matchers = /* @__PURE__ */ Object.create(null);
1283
- [...Object.keys(this.routes), ...Object.keys(this.middleware)].forEach((method) => {
1284
- matchers[method] ||= this.buildMatcher(method);
1285
- });
1286
- this.middleware = this.routes = void 0;
1287
- return matchers;
1288
- }
1289
- buildMatcher(method) {
1290
- const routes = [];
1291
- let hasOwnRoute = method === METHOD_NAME_ALL;
1292
- [this.middleware, this.routes].forEach((r) => {
1293
- const ownRoute = r[method] ? Object.keys(r[method]).map((path$1) => [path$1, r[method][path$1]]) : [];
1294
- if (ownRoute.length !== 0) {
1295
- hasOwnRoute ||= true;
1296
- routes.push(...ownRoute);
1297
- } else if (method !== METHOD_NAME_ALL) routes.push(...Object.keys(r[METHOD_NAME_ALL]).map((path$1) => [path$1, r[METHOD_NAME_ALL][path$1]]));
1298
- });
1299
- if (!hasOwnRoute) return null;
1300
- else return buildMatcherFromPreprocessedRoutes(routes);
1301
- }
1302
- };
1303
-
1304
- //#endregion
1305
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/smart-router/router.js
1306
- var SmartRouter = class {
1307
- name = "SmartRouter";
1308
- routers = [];
1309
- routes = [];
1310
- constructor(init) {
1311
- Object.assign(this, init);
1312
- }
1313
- add(method, path$1, handler) {
1314
- if (!this.routes) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
1315
- this.routes.push([
1316
- method,
1317
- path$1,
1318
- handler
1319
- ]);
1320
- }
1321
- match(method, path$1) {
1322
- if (!this.routes) throw new Error("Fatal error");
1323
- const { routers, routes } = this;
1324
- const len = routers.length;
1325
- let i = 0;
1326
- let res;
1327
- for (; i < len; i++) {
1328
- const router = routers[i];
1329
- try {
1330
- routes.forEach((args) => {
1331
- router.add(...args);
1332
- });
1333
- res = router.match(method, path$1);
1334
- } catch (e) {
1335
- if (e instanceof UnsupportedPathError) continue;
1336
- throw e;
1337
- }
1338
- this.match = router.match.bind(router);
1339
- this.routers = [router];
1340
- this.routes = void 0;
1341
- break;
1342
- }
1343
- if (i === len) throw new Error("Fatal error");
1344
- this.name = `SmartRouter + ${this.activeRouter.name}`;
1345
- return res;
1346
- }
1347
- get activeRouter() {
1348
- if (this.routes || this.routers.length !== 1) throw new Error("No active router has been determined yet.");
1349
- return this.routers[0];
1350
- }
1351
- };
1352
-
1353
- //#endregion
1354
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/trie-router/node.js
1355
- var Node = class {
1356
- methods;
1357
- children;
1358
- patterns;
1359
- order = 0;
1360
- name;
1361
- params = /* @__PURE__ */ Object.create(null);
1362
- constructor(method, handler, children) {
1363
- this.children = children || /* @__PURE__ */ Object.create(null);
1364
- this.methods = [];
1365
- this.name = "";
1366
- if (method && handler) {
1367
- const m = /* @__PURE__ */ Object.create(null);
1368
- m[method] = {
1369
- handler,
1370
- possibleKeys: [],
1371
- score: 0,
1372
- name: this.name
1373
- };
1374
- this.methods = [m];
1375
- }
1376
- this.patterns = [];
1377
- }
1378
- insert(method, path$1, handler) {
1379
- this.name = `${method} ${path$1}`;
1380
- this.order = ++this.order;
1381
- let curNode = this;
1382
- const parts = splitRoutingPath(path$1);
1383
- const possibleKeys = [];
1384
- for (let i = 0, len = parts.length; i < len; i++) {
1385
- const p = parts[i];
1386
- if (Object.keys(curNode.children).includes(p)) {
1387
- curNode = curNode.children[p];
1388
- const pattern2 = getPattern(p);
1389
- if (pattern2) possibleKeys.push(pattern2[1]);
1390
- continue;
1391
- }
1392
- curNode.children[p] = new Node();
1393
- const pattern = getPattern(p);
1394
- if (pattern) {
1395
- curNode.patterns.push(pattern);
1396
- possibleKeys.push(pattern[1]);
1397
- }
1398
- curNode = curNode.children[p];
1399
- }
1400
- if (!curNode.methods.length) curNode.methods = [];
1401
- const m = /* @__PURE__ */ Object.create(null);
1402
- m[method] = {
1403
- handler,
1404
- possibleKeys: possibleKeys.filter((v, i, a) => a.indexOf(v) === i),
1405
- name: this.name,
1406
- score: this.order
1407
- };
1408
- curNode.methods.push(m);
1409
- return curNode;
1410
- }
1411
- gHSets(node, method, nodeParams, params) {
1412
- const handlerSets = [];
1413
- for (let i = 0, len = node.methods.length; i < len; i++) {
1414
- const m = node.methods[i];
1415
- const handlerSet = m[method] || m[METHOD_NAME_ALL];
1416
- const processedSet = /* @__PURE__ */ Object.create(null);
1417
- if (handlerSet !== void 0) {
1418
- handlerSet.params = /* @__PURE__ */ Object.create(null);
1419
- handlerSet.possibleKeys.forEach((key) => {
1420
- const processed = processedSet[handlerSet.name];
1421
- handlerSet.params[key] = params[key] && !processed ? params[key] : nodeParams[key] ?? params[key];
1422
- processedSet[handlerSet.name] = true;
1423
- });
1424
- handlerSets.push(handlerSet);
1425
- }
1426
- }
1427
- return handlerSets;
1428
- }
1429
- search(method, path$1) {
1430
- const handlerSets = [];
1431
- this.params = /* @__PURE__ */ Object.create(null);
1432
- let curNodes = [this];
1433
- const parts = splitPath(path$1);
1434
- for (let i = 0, len = parts.length; i < len; i++) {
1435
- const part = parts[i];
1436
- const isLast = i === len - 1;
1437
- const tempNodes = [];
1438
- for (let j = 0, len2 = curNodes.length; j < len2; j++) {
1439
- const node = curNodes[j];
1440
- const nextNode = node.children[part];
1441
- if (nextNode) {
1442
- nextNode.params = node.params;
1443
- if (isLast === true) {
1444
- if (nextNode.children["*"]) handlerSets.push(...this.gHSets(nextNode.children["*"], method, node.params, /* @__PURE__ */ Object.create(null)));
1445
- handlerSets.push(...this.gHSets(nextNode, method, node.params, /* @__PURE__ */ Object.create(null)));
1446
- } else tempNodes.push(nextNode);
1447
- }
1448
- for (let k = 0, len3 = node.patterns.length; k < len3; k++) {
1449
- const pattern = node.patterns[k];
1450
- const params = { ...node.params };
1451
- if (pattern === "*") {
1452
- const astNode = node.children["*"];
1453
- if (astNode) {
1454
- handlerSets.push(...this.gHSets(astNode, method, node.params, /* @__PURE__ */ Object.create(null)));
1455
- tempNodes.push(astNode);
1456
- }
1457
- continue;
1458
- }
1459
- if (part === "") continue;
1460
- const [key, name, matcher] = pattern;
1461
- const child = node.children[key];
1462
- const restPathString = parts.slice(i).join("/");
1463
- if (matcher instanceof RegExp && matcher.test(restPathString)) {
1464
- params[name] = restPathString;
1465
- handlerSets.push(...this.gHSets(child, method, node.params, params));
1466
- continue;
1467
- }
1468
- if (matcher === true || matcher instanceof RegExp && matcher.test(part)) {
1469
- if (typeof key === "string") {
1470
- params[name] = part;
1471
- if (isLast === true) {
1472
- handlerSets.push(...this.gHSets(child, method, params, node.params));
1473
- if (child.children["*"]) handlerSets.push(...this.gHSets(child.children["*"], method, params, node.params));
1474
- } else {
1475
- child.params = params;
1476
- tempNodes.push(child);
1477
- }
1478
- }
1479
- }
1480
- }
1481
- }
1482
- curNodes = tempNodes;
1483
- }
1484
- return [handlerSets.sort((a, b) => {
1485
- return a.score - b.score;
1486
- }).map(({ handler, params }) => [handler, params])];
1487
- }
1488
- };
1489
-
1490
- //#endregion
1491
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/trie-router/router.js
1492
- var TrieRouter = class {
1493
- name = "TrieRouter";
1494
- node;
1495
- constructor() {
1496
- this.node = new Node();
1497
- }
1498
- add(method, path$1, handler) {
1499
- const results = checkOptionalParameter(path$1);
1500
- if (results) {
1501
- for (const p of results) this.node.insert(method, p, handler);
1502
- return;
1503
- }
1504
- this.node.insert(method, path$1, handler);
1505
- }
1506
- match(method, path$1) {
1507
- return this.node.search(method, path$1);
1508
- }
1509
- };
1510
-
1511
- //#endregion
1512
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/hono.js
1513
- var Hono = class extends Hono$1 {
1514
- constructor(options = {}) {
1515
- super(options);
1516
- this.router = options.router ?? new SmartRouter({ routers: [new RegExpRouter(), new TrieRouter()] });
1517
- }
1518
- };
1519
-
1520
- //#endregion
1521
- //#region ../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js
1522
- var require__validateReport = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js": ((exports) => {
1523
- Object.defineProperty(exports, "__esModule", { value: true });
1524
- const _validateReport = (array) => {
1525
- const reportable = (path$1) => {
1526
- if (array.length === 0) return true;
1527
- const last = array[array.length - 1].path;
1528
- return path$1.length > last.length || last.substring(0, path$1.length) !== path$1;
1529
- };
1530
- return (exceptable, error) => {
1531
- if (exceptable && reportable(error.path)) array.push(error);
1532
- return false;
1533
- };
1534
- };
1535
- exports._validateReport = _validateReport;
1536
- }) });
1537
-
1538
- //#endregion
1539
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/cookie.js
1540
- var validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
1541
- var validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/;
1542
- var parse = (cookie, name) => {
1543
- return cookie.trim().split(";").reduce((parsedCookie, pairStr) => {
1544
- pairStr = pairStr.trim();
1545
- const valueStartPos = pairStr.indexOf("=");
1546
- if (valueStartPos === -1) return parsedCookie;
1547
- const cookieName = pairStr.substring(0, valueStartPos).trim();
1548
- if (name && name !== cookieName || !validCookieNameRegEx.test(cookieName)) return parsedCookie;
1549
- let cookieValue = pairStr.substring(valueStartPos + 1).trim();
1550
- if (cookieValue.startsWith("\"") && cookieValue.endsWith("\"")) cookieValue = cookieValue.slice(1, -1);
1551
- if (validCookieValueRegEx.test(cookieValue)) parsedCookie[cookieName] = decodeURIComponent_(cookieValue);
1552
- return parsedCookie;
1553
- }, {});
1554
- };
1555
-
1556
- //#endregion
1557
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/helper/cookie/index.js
1558
- var getCookie = (c, key, prefix) => {
1559
- const cookie = c.req.raw.headers.get("Cookie");
1560
- if (typeof key === "string") {
1561
- if (!cookie) return;
1562
- let finalKey = key;
1563
- if (prefix === "secure") finalKey = "__Secure-" + key;
1564
- else if (prefix === "host") finalKey = "__Host-" + key;
1565
- return parse(cookie, finalKey)[finalKey];
1566
- }
1567
- if (!cookie) return {};
1568
- return parse(cookie);
1569
- };
1570
-
1571
- //#endregion
1572
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/http-exception.js
1573
- var HTTPException = class extends Error {
1574
- res;
1575
- status;
1576
- constructor(status = 500, options) {
1577
- super(options?.message, { cause: options?.cause });
1578
- this.res = options?.res;
1579
- this.status = status;
1580
- }
1581
- getResponse() {
1582
- if (this.res) return new Response(this.res.body, {
1583
- status: this.status,
1584
- headers: this.res.headers
1585
- });
1586
- return new Response(this.message, { status: this.status });
1587
- }
1588
- };
1589
-
1590
- //#endregion
1591
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/buffer.js
1592
- var bufferToFormData = (arrayBuffer, contentType) => {
1593
- return new Response(arrayBuffer, { headers: { "Content-Type": contentType } }).formData();
1594
- };
1595
-
1596
- //#endregion
1597
- //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/validator/validator.js
1598
- var jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/;
1599
- var multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/;
1600
- var urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/;
1601
- var validator = (target, validationFunc) => {
1602
- return async (c, next) => {
1603
- let value = {};
1604
- const contentType = c.req.header("Content-Type");
1605
- switch (target) {
1606
- case "json":
1607
- if (!contentType || !jsonRegex.test(contentType)) break;
1608
- try {
1609
- value = await c.req.json();
1610
- } catch {
1611
- throw new HTTPException(400, { message: "Malformed JSON in request body" });
1612
- }
1613
- break;
1614
- case "form": {
1615
- if (!contentType || !(multipartRegex.test(contentType) || urlencodedRegex.test(contentType))) break;
1616
- let formData;
1617
- if (c.req.bodyCache.formData) formData = await c.req.bodyCache.formData;
1618
- else try {
1619
- formData = await bufferToFormData(await c.req.arrayBuffer(), contentType);
1620
- c.req.bodyCache.formData = formData;
1621
- } catch (e) {
1622
- let message = "Malformed FormData request.";
1623
- message += e instanceof Error ? ` ${e.message}` : ` ${String(e)}`;
1624
- throw new HTTPException(400, { message });
1625
- }
1626
- const form = {};
1627
- formData.forEach((value2, key) => {
1628
- if (key.endsWith("[]")) (form[key] ??= []).push(value2);
1629
- else if (Array.isArray(form[key])) form[key].push(value2);
1630
- else if (key in form) form[key] = [form[key], value2];
1631
- else form[key] = value2;
1632
- });
1633
- value = form;
1634
- break;
1635
- }
1636
- case "query":
1637
- value = Object.fromEntries(Object.entries(c.req.queries()).map(([k, v]) => {
1638
- return v.length === 1 ? [k, v[0]] : [k, v];
1639
- }));
1640
- break;
1641
- case "param":
1642
- value = c.req.param();
1643
- break;
1644
- case "header":
1645
- value = c.req.header();
1646
- break;
1647
- case "cookie":
1648
- value = getCookie(c);
1649
- break;
1650
- }
1651
- const res = await validationFunc(value, c);
1652
- if (res instanceof Response) return res;
1653
- c.req.addValidatedData(target, res);
1654
- await next();
1655
- };
1656
- };
1657
-
1658
- //#endregion
1659
- //#region ../../node_modules/.pnpm/@hono+typia-validator@0.1.2_hono@4.6.3_typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3_/node_modules/@hono/typia-validator/dist/esm/index.js
1660
- var import__validateReport = /* @__PURE__ */ __toESM(require__validateReport(), 1);
1661
- const typiaValidator = (target, validate, hook) => validator(target, async (value, c) => {
1662
- const result = validate(value);
1663
- if (hook) {
1664
- const hookResult = await hook({
1665
- ...result,
1666
- data: value
1667
- }, c);
1668
- if (hookResult) {
1669
- if (hookResult instanceof Response || hookResult instanceof Promise) return hookResult;
1670
- if ("response" in hookResult) return hookResult.response;
1671
- }
1672
- }
1673
- if (!result.success) return c.json({
1674
- success: false,
1675
- error: result.errors
1676
- }, 400);
1677
- return result.data;
1678
- });
1679
-
1680
- //#endregion
1681
- //#region src-server/rpc.ts
1682
- const DEFAULT_PAGE_LIMIT = 20;
1683
- const DEFAULT_PAGE_OFFSET = 0;
1684
- const queryBundlesSchema = (() => {
1685
- const _io0 = (input) => (void 0 === input.channel || "string" === typeof input.channel) && (void 0 === input.platform || "ios" === input.platform || "android" === input.platform) && (void 0 === input.limit || "string" === typeof input.limit) && (void 0 === input.offset || "string" === typeof input.offset);
1686
- const _vo0 = (input, _path, _exceptionable = true) => [
1687
- void 0 === input.channel || "string" === typeof input.channel || _report(_exceptionable, {
1688
- path: _path + ".channel",
1689
- expected: "(string | undefined)",
1690
- value: input.channel
1691
- }),
1692
- void 0 === input.platform || "ios" === input.platform || "android" === input.platform || _report(_exceptionable, {
1693
- path: _path + ".platform",
1694
- expected: "(\"android\" | \"ios\" | undefined)",
1695
- value: input.platform
1696
- }),
1697
- void 0 === input.limit || "string" === typeof input.limit || _report(_exceptionable, {
1698
- path: _path + ".limit",
1699
- expected: "(string | undefined)",
1700
- value: input.limit
1701
- }),
1702
- void 0 === input.offset || "string" === typeof input.offset || _report(_exceptionable, {
1703
- path: _path + ".offset",
1704
- expected: "(string | undefined)",
1705
- value: input.offset
1706
- })
1707
- ].every((flag) => flag);
1708
- const __is = (input) => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
1709
- let errors;
1710
- let _report;
1711
- return (input) => {
1712
- if (false === __is(input)) {
1713
- errors = [];
1714
- _report = import__validateReport._validateReport(errors);
1715
- ((input$1, _path, _exceptionable = true) => ("object" === typeof input$1 && null !== input$1 && false === Array.isArray(input$1) || _report(true, {
1716
- path: _path + "",
1717
- expected: "__type",
1718
- value: input$1
1719
- })) && _vo0(input$1, _path + "", true) || _report(true, {
1720
- path: _path + "",
1721
- expected: "__type",
1722
- value: input$1
1723
- }))(input, "$input", true);
1724
- const success = 0 === errors.length;
1725
- return success ? {
1726
- success,
1727
- data: input
1728
- } : {
1729
- success,
1730
- errors,
1731
- data: input
1732
- };
1733
- }
1734
- return {
1735
- success: true,
1736
- data: input
1737
- };
1738
- };
1739
- })();
1740
- const paramBundleIdSchema = (() => {
1741
- const _io0 = (input) => "string" === typeof input.bundleId;
1742
- const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.bundleId || _report(_exceptionable, {
1743
- path: _path + ".bundleId",
1744
- expected: "string",
1745
- value: input.bundleId
1746
- })].every((flag) => flag);
1747
- const __is = (input) => "object" === typeof input && null !== input && _io0(input);
1748
- let errors;
1749
- let _report;
1750
- return (input) => {
1751
- if (false === __is(input)) {
1752
- errors = [];
1753
- _report = import__validateReport._validateReport(errors);
1754
- ((input$1, _path, _exceptionable = true) => ("object" === typeof input$1 && null !== input$1 || _report(true, {
1755
- path: _path + "",
1756
- expected: "__type",
1757
- value: input$1
1758
- })) && _vo0(input$1, _path + "", true) || _report(true, {
1759
- path: _path + "",
1760
- expected: "__type",
1761
- value: input$1
1762
- }))(input, "$input", true);
1763
- const success = 0 === errors.length;
1764
- return success ? {
1765
- success,
1766
- data: input
1767
- } : {
1768
- success,
1769
- errors,
1770
- data: input
1771
- };
1772
- }
1773
- return {
1774
- success: true,
1775
- data: input
1776
- };
1777
- };
1778
- })();
1779
- const updateBundleSchema = (() => {
1780
- const _io0 = (input) => (void 0 === input.id || "string" === typeof input.id) && (void 0 === input.platform || "ios" === input.platform || "android" === input.platform) && (void 0 === input.shouldForceUpdate || "boolean" === typeof input.shouldForceUpdate) && (void 0 === input.enabled || "boolean" === typeof input.enabled) && (void 0 === input.fileHash || "string" === typeof input.fileHash) && (void 0 === input.storageUri || "string" === typeof input.storageUri) && (null === input.gitCommitHash || void 0 === input.gitCommitHash || "string" === typeof input.gitCommitHash) && (null === input.message || void 0 === input.message || "string" === typeof input.message) && (void 0 === input.channel || "string" === typeof input.channel) && (null === input.targetAppVersion || void 0 === input.targetAppVersion || "string" === typeof input.targetAppVersion) && (null === input.fingerprintHash || void 0 === input.fingerprintHash || "string" === typeof input.fingerprintHash) && (void 0 === input.metadata || "object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) && _io1(input.metadata));
1781
- const _io1 = (input) => void 0 === input.app_version || "string" === typeof input.app_version;
1782
- const _vo0 = (input, _path, _exceptionable = true) => [
1783
- void 0 === input.id || "string" === typeof input.id || _report(_exceptionable, {
1784
- path: _path + ".id",
1785
- expected: "(string | undefined)",
1786
- value: input.id
1787
- }),
1788
- void 0 === input.platform || "ios" === input.platform || "android" === input.platform || _report(_exceptionable, {
1789
- path: _path + ".platform",
1790
- expected: "(\"android\" | \"ios\" | undefined)",
1791
- value: input.platform
1792
- }),
1793
- void 0 === input.shouldForceUpdate || "boolean" === typeof input.shouldForceUpdate || _report(_exceptionable, {
1794
- path: _path + ".shouldForceUpdate",
1795
- expected: "(boolean | undefined)",
1796
- value: input.shouldForceUpdate
1797
- }),
1798
- void 0 === input.enabled || "boolean" === typeof input.enabled || _report(_exceptionable, {
1799
- path: _path + ".enabled",
1800
- expected: "(boolean | undefined)",
1801
- value: input.enabled
1802
- }),
1803
- void 0 === input.fileHash || "string" === typeof input.fileHash || _report(_exceptionable, {
1804
- path: _path + ".fileHash",
1805
- expected: "(string | undefined)",
1806
- value: input.fileHash
1807
- }),
1808
- void 0 === input.storageUri || "string" === typeof input.storageUri || _report(_exceptionable, {
1809
- path: _path + ".storageUri",
1810
- expected: "(string | undefined)",
1811
- value: input.storageUri
1812
- }),
1813
- null === input.gitCommitHash || void 0 === input.gitCommitHash || "string" === typeof input.gitCommitHash || _report(_exceptionable, {
1814
- path: _path + ".gitCommitHash",
1815
- expected: "(null | string | undefined)",
1816
- value: input.gitCommitHash
1817
- }),
1818
- null === input.message || void 0 === input.message || "string" === typeof input.message || _report(_exceptionable, {
1819
- path: _path + ".message",
1820
- expected: "(null | string | undefined)",
1821
- value: input.message
1822
- }),
1823
- void 0 === input.channel || "string" === typeof input.channel || _report(_exceptionable, {
1824
- path: _path + ".channel",
1825
- expected: "(string | undefined)",
1826
- value: input.channel
1827
- }),
1828
- null === input.targetAppVersion || void 0 === input.targetAppVersion || "string" === typeof input.targetAppVersion || _report(_exceptionable, {
1829
- path: _path + ".targetAppVersion",
1830
- expected: "(null | string | undefined)",
1831
- value: input.targetAppVersion
1832
- }),
1833
- null === input.fingerprintHash || void 0 === input.fingerprintHash || "string" === typeof input.fingerprintHash || _report(_exceptionable, {
1834
- path: _path + ".fingerprintHash",
1835
- expected: "(null | string | undefined)",
1836
- value: input.fingerprintHash
1837
- }),
1838
- void 0 === input.metadata || ("object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) || _report(_exceptionable, {
1839
- path: _path + ".metadata",
1840
- expected: "(BundleMetadata | undefined)",
1841
- value: input.metadata
1842
- })) && _vo1(input.metadata, _path + ".metadata", _exceptionable) || _report(_exceptionable, {
1843
- path: _path + ".metadata",
1844
- expected: "(BundleMetadata | undefined)",
1845
- value: input.metadata
1846
- })
1847
- ].every((flag) => flag);
1848
- const _vo1 = (input, _path, _exceptionable = true) => [void 0 === input.app_version || "string" === typeof input.app_version || _report(_exceptionable, {
1849
- path: _path + ".app_version",
1850
- expected: "(string | undefined)",
1851
- value: input.app_version
1852
- })].every((flag) => flag);
1853
- const __is = (input) => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
1854
- let errors;
1855
- let _report;
1856
- return (input) => {
1857
- if (false === __is(input)) {
1858
- errors = [];
1859
- _report = import__validateReport._validateReport(errors);
1860
- ((input$1, _path, _exceptionable = true) => ("object" === typeof input$1 && null !== input$1 && false === Array.isArray(input$1) || _report(true, {
1861
- path: _path + "",
1862
- expected: "Partial<Bundle>",
1863
- value: input$1
1864
- })) && _vo0(input$1, _path + "", true) || _report(true, {
1865
- path: _path + "",
1866
- expected: "Partial<Bundle>",
1867
- value: input$1
1868
- }))(input, "$input", true);
1869
- const success = 0 === errors.length;
1870
- return success ? {
1871
- success,
1872
- data: input
1873
- } : {
1874
- success,
1875
- errors,
1876
- data: input
1877
- };
1878
- }
1879
- return {
1880
- success: true,
1881
- data: input
1882
- };
1883
- };
1884
- })();
1885
- const createBundleSchema = (() => {
1886
- const _io0 = (input) => "string" === typeof input.id && ("ios" === input.platform || "android" === input.platform) && "boolean" === typeof input.shouldForceUpdate && "boolean" === typeof input.enabled && "string" === typeof input.fileHash && "string" === typeof input.storageUri && (null === input.gitCommitHash || "string" === typeof input.gitCommitHash) && (null === input.message || "string" === typeof input.message) && "string" === typeof input.channel && (null === input.targetAppVersion || "string" === typeof input.targetAppVersion) && (null === input.fingerprintHash || "string" === typeof input.fingerprintHash) && (void 0 === input.metadata || "object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) && _io1(input.metadata));
1887
- const _io1 = (input) => void 0 === input.app_version || "string" === typeof input.app_version;
1888
- const _vo0 = (input, _path, _exceptionable = true) => [
1889
- "string" === typeof input.id || _report(_exceptionable, {
1890
- path: _path + ".id",
1891
- expected: "string",
1892
- value: input.id
1893
- }),
1894
- "ios" === input.platform || "android" === input.platform || _report(_exceptionable, {
1895
- path: _path + ".platform",
1896
- expected: "(\"android\" | \"ios\")",
1897
- value: input.platform
1898
- }),
1899
- "boolean" === typeof input.shouldForceUpdate || _report(_exceptionable, {
1900
- path: _path + ".shouldForceUpdate",
1901
- expected: "boolean",
1902
- value: input.shouldForceUpdate
1903
- }),
1904
- "boolean" === typeof input.enabled || _report(_exceptionable, {
1905
- path: _path + ".enabled",
1906
- expected: "boolean",
1907
- value: input.enabled
1908
- }),
1909
- "string" === typeof input.fileHash || _report(_exceptionable, {
1910
- path: _path + ".fileHash",
1911
- expected: "string",
1912
- value: input.fileHash
1913
- }),
1914
- "string" === typeof input.storageUri || _report(_exceptionable, {
1915
- path: _path + ".storageUri",
1916
- expected: "string",
1917
- value: input.storageUri
1918
- }),
1919
- null === input.gitCommitHash || "string" === typeof input.gitCommitHash || _report(_exceptionable, {
1920
- path: _path + ".gitCommitHash",
1921
- expected: "(null | string)",
1922
- value: input.gitCommitHash
1923
- }),
1924
- null === input.message || "string" === typeof input.message || _report(_exceptionable, {
1925
- path: _path + ".message",
1926
- expected: "(null | string)",
1927
- value: input.message
1928
- }),
1929
- "string" === typeof input.channel || _report(_exceptionable, {
1930
- path: _path + ".channel",
1931
- expected: "string",
1932
- value: input.channel
1933
- }),
1934
- null === input.targetAppVersion || "string" === typeof input.targetAppVersion || _report(_exceptionable, {
1935
- path: _path + ".targetAppVersion",
1936
- expected: "(null | string)",
1937
- value: input.targetAppVersion
1938
- }),
1939
- null === input.fingerprintHash || "string" === typeof input.fingerprintHash || _report(_exceptionable, {
1940
- path: _path + ".fingerprintHash",
1941
- expected: "(null | string)",
1942
- value: input.fingerprintHash
1943
- }),
1944
- void 0 === input.metadata || ("object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) || _report(_exceptionable, {
1945
- path: _path + ".metadata",
1946
- expected: "(BundleMetadata | undefined)",
1947
- value: input.metadata
1948
- })) && _vo1(input.metadata, _path + ".metadata", _exceptionable) || _report(_exceptionable, {
1949
- path: _path + ".metadata",
1950
- expected: "(BundleMetadata | undefined)",
1951
- value: input.metadata
1952
- })
1953
- ].every((flag) => flag);
1954
- const _vo1 = (input, _path, _exceptionable = true) => [void 0 === input.app_version || "string" === typeof input.app_version || _report(_exceptionable, {
1955
- path: _path + ".app_version",
1956
- expected: "(string | undefined)",
1957
- value: input.app_version
1958
- })].every((flag) => flag);
1959
- const __is = (input) => "object" === typeof input && null !== input && _io0(input);
1960
- let errors;
1961
- let _report;
1962
- return (input) => {
1963
- if (false === __is(input)) {
1964
- errors = [];
1965
- _report = import__validateReport._validateReport(errors);
1966
- ((input$1, _path, _exceptionable = true) => ("object" === typeof input$1 && null !== input$1 || _report(true, {
1967
- path: _path + "",
1968
- expected: "Bundle",
1969
- value: input$1
1970
- })) && _vo0(input$1, _path + "", true) || _report(true, {
1971
- path: _path + "",
1972
- expected: "Bundle",
1973
- value: input$1
1974
- }))(input, "$input", true);
1975
- const success = 0 === errors.length;
1976
- return success ? {
1977
- success,
1978
- data: input
1979
- } : {
1980
- success,
1981
- errors,
1982
- data: input
1983
- };
1984
- }
1985
- return {
1986
- success: true,
1987
- data: input
1988
- };
1989
- };
1990
- })();
1991
- let configPromise = null;
1992
- const prepareConfig = async () => {
1993
- if (!configPromise) configPromise = (async () => {
1994
- try {
1995
- const config = await loadConfig(null);
1996
- const databasePlugin = await config?.database() ?? null;
1997
- const storagePlugin = await config?.storage() ?? null;
1998
- if (!databasePlugin) throw new Error("Database plugin initialization failed");
1999
- return {
2000
- config,
2001
- databasePlugin,
2002
- storagePlugin
2003
- };
2004
- } catch (error) {
2005
- console.error("Error during configuration initialization:", error);
2006
- throw error;
2007
- }
2008
- })();
2009
- return configPromise;
2010
- };
2011
- const rpc = new Hono().get("/config", async (c) => {
2012
- try {
2013
- const { config } = await prepareConfig();
2014
- return c.json({ console: config.console });
2015
- } catch (error) {
2016
- console.error("Error during config retrieval:", error);
2017
- throw error;
2018
- }
2019
- }).get("/channels", async (c) => {
2020
- try {
2021
- const { databasePlugin } = await prepareConfig();
2022
- const channels = await databasePlugin.getChannels();
2023
- return c.json(channels ?? []);
2024
- } catch (error) {
2025
- console.error("Error during channel retrieval:", error);
2026
- throw error;
2027
- }
2028
- }).get("/config-loaded", (c) => {
2029
- try {
2030
- const isLoaded = !!configPromise;
2031
- return c.json({ configLoaded: isLoaded });
2032
- } catch (error) {
2033
- console.error("Error during config loaded retrieval:", error);
2034
- throw error;
2035
- }
2036
- }).get("/bundles", typiaValidator("query", queryBundlesSchema), async (c) => {
2037
- try {
2038
- const rawQuery = c.req.valid("query");
2039
- const query = {
2040
- channel: rawQuery.channel ?? void 0,
2041
- platform: rawQuery.platform ?? void 0,
2042
- limit: rawQuery.limit ?? DEFAULT_PAGE_LIMIT,
2043
- offset: rawQuery.offset ?? DEFAULT_PAGE_OFFSET
2044
- };
2045
- const { databasePlugin } = await prepareConfig();
2046
- const bundles = await databasePlugin.getBundles({
2047
- where: {
2048
- channel: query.channel,
2049
- platform: query.platform
2050
- },
2051
- limit: Number(query.limit),
2052
- offset: Number(query.offset)
2053
- });
2054
- return c.json(bundles ?? []);
2055
- } catch (error) {
2056
- console.error("Error during bundle retrieval:", error);
2057
- throw error;
2058
- }
2059
- }).get("/bundles/:bundleId", typiaValidator("param", paramBundleIdSchema), async (c) => {
2060
- try {
2061
- const { bundleId } = c.req.valid("param");
2062
- const { databasePlugin } = await prepareConfig();
2063
- const bundle = await databasePlugin.getBundleById(bundleId);
2064
- return c.json(bundle ?? null);
2065
- } catch (error) {
2066
- console.error("Error during bundle retrieval:", error);
2067
- throw error;
2068
- }
2069
- }).patch("/bundles/:bundleId", typiaValidator("json", updateBundleSchema), async (c) => {
2070
- try {
2071
- const bundleId = c.req.param("bundleId");
2072
- const partialBundle = c.req.valid("json");
2073
- if (!bundleId) return c.json({ error: "Target bundle ID is required" }, 400);
2074
- const { databasePlugin } = await prepareConfig();
2075
- await databasePlugin.updateBundle(bundleId, partialBundle);
2076
- await databasePlugin.commitBundle();
2077
- return c.json({ success: true });
2078
- } catch (error) {
2079
- console.error("Error during bundle update:", error);
2080
- if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
2081
- return c.json({ error: "Unknown error" }, 500);
2082
- }
2083
- }).post("/bundles", typiaValidator("json", createBundleSchema), async (c) => {
2084
- try {
2085
- const bundle = c.req.valid("json");
2086
- const { databasePlugin } = await prepareConfig();
2087
- await databasePlugin.appendBundle(bundle);
2088
- await databasePlugin.commitBundle();
2089
- return c.json({
2090
- success: true,
2091
- bundleId: bundle.id
2092
- });
2093
- } catch (error) {
2094
- console.error("Error during bundle creation:", error);
2095
- if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
2096
- return c.json({ error: "Unknown error" }, 500);
2097
- }
2098
- }).delete("/bundles/:bundleId", typiaValidator("param", paramBundleIdSchema), async (c) => {
2099
- try {
2100
- const { bundleId } = c.req.valid("param");
2101
- const { databasePlugin } = await prepareConfig();
2102
- const deleteBundle = await databasePlugin.getBundleById(bundleId);
2103
- if (!deleteBundle) return c.json({ error: "Bundle not found" }, 404);
2104
- await databasePlugin.deleteBundle(deleteBundle);
2105
- await databasePlugin.commitBundle();
2106
- return c.json({ success: true });
2107
- } catch (error) {
2108
- console.error("Error during bundle deletion:", error);
2109
- if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
2110
- return c.json({ error: "Unknown error" }, 500);
2111
- }
2112
- });
2113
-
2114
- //#endregion
2115
- //#region src-server/index.ts
2116
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
2117
- const relativePathToScript = path.relative(process.cwd(), __dirname);
2118
- const app = new Hono().get("/ping", (c) => c.text("pong")).route("/rpc", rpc).use("/assets/*", serveStatic({ root: relativePathToScript })).get("*", serveStatic({
2119
- root: relativePathToScript,
2120
- path: "index.html"
2121
- }));
2122
- var src_server_default = app;
2123
-
2124
- //#endregion
2125
- export { src_server_default as default };