Aktueller Stand
This commit is contained in:
44
backend/node_modules/hono/dist/cjs/helper/accepts/accepts.js
generated
vendored
Normal file
44
backend/node_modules/hono/dist/cjs/helper/accepts/accepts.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var accepts_exports = {};
|
||||
__export(accepts_exports, {
|
||||
accepts: () => accepts,
|
||||
defaultMatch: () => defaultMatch
|
||||
});
|
||||
module.exports = __toCommonJS(accepts_exports);
|
||||
var import_accept = require("../../utils/accept");
|
||||
const defaultMatch = (accepts2, config) => {
|
||||
const { supports, default: defaultSupport } = config;
|
||||
const accept = accepts2.sort((a, b) => b.q - a.q).find((accept2) => supports.includes(accept2.type));
|
||||
return accept ? accept.type : defaultSupport;
|
||||
};
|
||||
const accepts = (c, options) => {
|
||||
const acceptHeader = c.req.header(options.header);
|
||||
if (!acceptHeader) {
|
||||
return options.default;
|
||||
}
|
||||
const accepts2 = (0, import_accept.parseAccept)(acceptHeader);
|
||||
const match = options.match || defaultMatch;
|
||||
return match(accepts2, options);
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
accepts,
|
||||
defaultMatch
|
||||
});
|
||||
28
backend/node_modules/hono/dist/cjs/helper/accepts/index.js
generated
vendored
Normal file
28
backend/node_modules/hono/dist/cjs/helper/accepts/index.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var accepts_exports = {};
|
||||
__export(accepts_exports, {
|
||||
accepts: () => import_accepts.accepts
|
||||
});
|
||||
module.exports = __toCommonJS(accepts_exports);
|
||||
var import_accepts = require("./accepts");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
accepts
|
||||
});
|
||||
82
backend/node_modules/hono/dist/cjs/helper/adapter/index.js
generated
vendored
Normal file
82
backend/node_modules/hono/dist/cjs/helper/adapter/index.js
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var adapter_exports = {};
|
||||
__export(adapter_exports, {
|
||||
checkUserAgentEquals: () => checkUserAgentEquals,
|
||||
env: () => env,
|
||||
getRuntimeKey: () => getRuntimeKey,
|
||||
knownUserAgents: () => knownUserAgents
|
||||
});
|
||||
module.exports = __toCommonJS(adapter_exports);
|
||||
const env = (c, runtime) => {
|
||||
const global = globalThis;
|
||||
const globalEnv = global?.process?.env;
|
||||
runtime ??= getRuntimeKey();
|
||||
const runtimeEnvHandlers = {
|
||||
bun: () => globalEnv,
|
||||
node: () => globalEnv,
|
||||
"edge-light": () => globalEnv,
|
||||
deno: () => {
|
||||
return Deno.env.toObject();
|
||||
},
|
||||
workerd: () => c.env,
|
||||
// On Fastly Compute, you can use the ConfigStore to manage user-defined data.
|
||||
fastly: () => ({}),
|
||||
other: () => ({})
|
||||
};
|
||||
return runtimeEnvHandlers[runtime]();
|
||||
};
|
||||
const knownUserAgents = {
|
||||
deno: "Deno",
|
||||
bun: "Bun",
|
||||
workerd: "Cloudflare-Workers",
|
||||
node: "Node.js"
|
||||
};
|
||||
const getRuntimeKey = () => {
|
||||
const global = globalThis;
|
||||
const userAgentSupported = typeof navigator !== "undefined" && typeof navigator.userAgent === "string";
|
||||
if (userAgentSupported) {
|
||||
for (const [runtimeKey, userAgent] of Object.entries(knownUserAgents)) {
|
||||
if (checkUserAgentEquals(userAgent)) {
|
||||
return runtimeKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof global?.EdgeRuntime === "string") {
|
||||
return "edge-light";
|
||||
}
|
||||
if (global?.fastly !== void 0) {
|
||||
return "fastly";
|
||||
}
|
||||
if (global?.process?.release?.name === "node") {
|
||||
return "node";
|
||||
}
|
||||
return "other";
|
||||
};
|
||||
const checkUserAgentEquals = (platform) => {
|
||||
const userAgent = navigator.userAgent;
|
||||
return userAgent.startsWith(platform);
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
checkUserAgentEquals,
|
||||
env,
|
||||
getRuntimeKey,
|
||||
knownUserAgents
|
||||
});
|
||||
16
backend/node_modules/hono/dist/cjs/helper/conninfo/index.js
generated
vendored
Normal file
16
backend/node_modules/hono/dist/cjs/helper/conninfo/index.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var conninfo_exports = {};
|
||||
module.exports = __toCommonJS(conninfo_exports);
|
||||
16
backend/node_modules/hono/dist/cjs/helper/conninfo/types.js
generated
vendored
Normal file
16
backend/node_modules/hono/dist/cjs/helper/conninfo/types.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var types_exports = {};
|
||||
module.exports = __toCommonJS(types_exports);
|
||||
131
backend/node_modules/hono/dist/cjs/helper/cookie/index.js
generated
vendored
Normal file
131
backend/node_modules/hono/dist/cjs/helper/cookie/index.js
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cookie_exports = {};
|
||||
__export(cookie_exports, {
|
||||
deleteCookie: () => deleteCookie,
|
||||
generateCookie: () => generateCookie,
|
||||
generateSignedCookie: () => generateSignedCookie,
|
||||
getCookie: () => getCookie,
|
||||
getSignedCookie: () => getSignedCookie,
|
||||
setCookie: () => setCookie,
|
||||
setSignedCookie: () => setSignedCookie
|
||||
});
|
||||
module.exports = __toCommonJS(cookie_exports);
|
||||
var import_cookie = require("../../utils/cookie");
|
||||
const getCookie = (c, key, prefix) => {
|
||||
const cookie = c.req.raw.headers.get("Cookie");
|
||||
if (typeof key === "string") {
|
||||
if (!cookie) {
|
||||
return void 0;
|
||||
}
|
||||
let finalKey = key;
|
||||
if (prefix === "secure") {
|
||||
finalKey = "__Secure-" + key;
|
||||
} else if (prefix === "host") {
|
||||
finalKey = "__Host-" + key;
|
||||
}
|
||||
const obj2 = (0, import_cookie.parse)(cookie, finalKey);
|
||||
return obj2[finalKey];
|
||||
}
|
||||
if (!cookie) {
|
||||
return {};
|
||||
}
|
||||
const obj = (0, import_cookie.parse)(cookie);
|
||||
return obj;
|
||||
};
|
||||
const getSignedCookie = async (c, secret, key, prefix) => {
|
||||
const cookie = c.req.raw.headers.get("Cookie");
|
||||
if (typeof key === "string") {
|
||||
if (!cookie) {
|
||||
return void 0;
|
||||
}
|
||||
let finalKey = key;
|
||||
if (prefix === "secure") {
|
||||
finalKey = "__Secure-" + key;
|
||||
} else if (prefix === "host") {
|
||||
finalKey = "__Host-" + key;
|
||||
}
|
||||
const obj2 = await (0, import_cookie.parseSigned)(cookie, secret, finalKey);
|
||||
return obj2[finalKey];
|
||||
}
|
||||
if (!cookie) {
|
||||
return {};
|
||||
}
|
||||
const obj = await (0, import_cookie.parseSigned)(cookie, secret);
|
||||
return obj;
|
||||
};
|
||||
const generateCookie = (name, value, opt) => {
|
||||
let cookie;
|
||||
if (opt?.prefix === "secure") {
|
||||
cookie = (0, import_cookie.serialize)("__Secure-" + name, value, { path: "/", ...opt, secure: true });
|
||||
} else if (opt?.prefix === "host") {
|
||||
cookie = (0, import_cookie.serialize)("__Host-" + name, value, {
|
||||
...opt,
|
||||
path: "/",
|
||||
secure: true,
|
||||
domain: void 0
|
||||
});
|
||||
} else {
|
||||
cookie = (0, import_cookie.serialize)(name, value, { path: "/", ...opt });
|
||||
}
|
||||
return cookie;
|
||||
};
|
||||
const setCookie = (c, name, value, opt) => {
|
||||
const cookie = generateCookie(name, value, opt);
|
||||
c.header("Set-Cookie", cookie, { append: true });
|
||||
};
|
||||
const generateSignedCookie = async (name, value, secret, opt) => {
|
||||
let cookie;
|
||||
if (opt?.prefix === "secure") {
|
||||
cookie = await (0, import_cookie.serializeSigned)("__Secure-" + name, value, secret, {
|
||||
path: "/",
|
||||
...opt,
|
||||
secure: true
|
||||
});
|
||||
} else if (opt?.prefix === "host") {
|
||||
cookie = await (0, import_cookie.serializeSigned)("__Host-" + name, value, secret, {
|
||||
...opt,
|
||||
path: "/",
|
||||
secure: true,
|
||||
domain: void 0
|
||||
});
|
||||
} else {
|
||||
cookie = await (0, import_cookie.serializeSigned)(name, value, secret, { path: "/", ...opt });
|
||||
}
|
||||
return cookie;
|
||||
};
|
||||
const setSignedCookie = async (c, name, value, secret, opt) => {
|
||||
const cookie = await generateSignedCookie(name, value, secret, opt);
|
||||
c.header("set-cookie", cookie, { append: true });
|
||||
};
|
||||
const deleteCookie = (c, name, opt) => {
|
||||
const deletedCookie = getCookie(c, name, opt?.prefix);
|
||||
setCookie(c, name, "", { ...opt, maxAge: 0 });
|
||||
return deletedCookie;
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
deleteCookie,
|
||||
generateCookie,
|
||||
generateSignedCookie,
|
||||
getCookie,
|
||||
getSignedCookie,
|
||||
setCookie,
|
||||
setSignedCookie
|
||||
});
|
||||
223
backend/node_modules/hono/dist/cjs/helper/css/common.js
generated
vendored
Normal file
223
backend/node_modules/hono/dist/cjs/helper/css/common.js
generated
vendored
Normal file
@@ -0,0 +1,223 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var common_exports = {};
|
||||
__export(common_exports, {
|
||||
CLASS_NAME: () => CLASS_NAME,
|
||||
DEFAULT_STYLE_ID: () => DEFAULT_STYLE_ID,
|
||||
EXTERNAL_CLASS_NAMES: () => EXTERNAL_CLASS_NAMES,
|
||||
IS_CSS_ESCAPED: () => IS_CSS_ESCAPED,
|
||||
PSEUDO_GLOBAL_SELECTOR: () => PSEUDO_GLOBAL_SELECTOR,
|
||||
SELECTOR: () => SELECTOR,
|
||||
SELECTORS: () => SELECTORS,
|
||||
STYLE_STRING: () => STYLE_STRING,
|
||||
buildStyleString: () => buildStyleString,
|
||||
cssCommon: () => cssCommon,
|
||||
cxCommon: () => cxCommon,
|
||||
isPseudoGlobalSelectorRe: () => isPseudoGlobalSelectorRe,
|
||||
keyframesCommon: () => keyframesCommon,
|
||||
minify: () => minify,
|
||||
rawCssString: () => rawCssString,
|
||||
viewTransitionCommon: () => viewTransitionCommon
|
||||
});
|
||||
module.exports = __toCommonJS(common_exports);
|
||||
const PSEUDO_GLOBAL_SELECTOR = ":-hono-global";
|
||||
const isPseudoGlobalSelectorRe = new RegExp(`^${PSEUDO_GLOBAL_SELECTOR}{(.*)}$`);
|
||||
const DEFAULT_STYLE_ID = "hono-css";
|
||||
const SELECTOR = /* @__PURE__ */ Symbol();
|
||||
const CLASS_NAME = /* @__PURE__ */ Symbol();
|
||||
const STYLE_STRING = /* @__PURE__ */ Symbol();
|
||||
const SELECTORS = /* @__PURE__ */ Symbol();
|
||||
const EXTERNAL_CLASS_NAMES = /* @__PURE__ */ Symbol();
|
||||
const CSS_ESCAPED = /* @__PURE__ */ Symbol();
|
||||
const IS_CSS_ESCAPED = /* @__PURE__ */ Symbol();
|
||||
const rawCssString = (value) => {
|
||||
return {
|
||||
[CSS_ESCAPED]: value
|
||||
};
|
||||
};
|
||||
const toHash = (str) => {
|
||||
let i = 0, out = 11;
|
||||
while (i < str.length) {
|
||||
out = 101 * out + str.charCodeAt(i++) >>> 0;
|
||||
}
|
||||
return "css-" + out;
|
||||
};
|
||||
const cssStringReStr = [
|
||||
'"(?:(?:\\\\[\\s\\S]|[^"\\\\])*)"',
|
||||
// double quoted string
|
||||
"'(?:(?:\\\\[\\s\\S]|[^'\\\\])*)'"
|
||||
// single quoted string
|
||||
].join("|");
|
||||
const minifyCssRe = new RegExp(
|
||||
[
|
||||
"(" + cssStringReStr + ")",
|
||||
// $1: quoted string
|
||||
"(?:" + [
|
||||
"^\\s+",
|
||||
// head whitespace
|
||||
"\\/\\*.*?\\*\\/\\s*",
|
||||
// multi-line comment
|
||||
"\\/\\/.*\\n\\s*",
|
||||
// single-line comment
|
||||
"\\s+$"
|
||||
// tail whitespace
|
||||
].join("|") + ")",
|
||||
"\\s*;\\s*(}|$)\\s*",
|
||||
// $2: trailing semicolon
|
||||
"\\s*([{};:,])\\s*",
|
||||
// $3: whitespace around { } : , ;
|
||||
"(\\s)\\s+"
|
||||
// $4: 2+ spaces
|
||||
].join("|"),
|
||||
"g"
|
||||
);
|
||||
const minify = (css) => {
|
||||
return css.replace(minifyCssRe, (_, $1, $2, $3, $4) => $1 || $2 || $3 || $4 || "");
|
||||
};
|
||||
const buildStyleString = (strings, values) => {
|
||||
const selectors = [];
|
||||
const externalClassNames = [];
|
||||
const label = strings[0].match(/^\s*\/\*(.*?)\*\//)?.[1] || "";
|
||||
let styleString = "";
|
||||
for (let i = 0, len = strings.length; i < len; i++) {
|
||||
styleString += strings[i];
|
||||
let vArray = values[i];
|
||||
if (typeof vArray === "boolean" || vArray === null || vArray === void 0) {
|
||||
continue;
|
||||
}
|
||||
if (!Array.isArray(vArray)) {
|
||||
vArray = [vArray];
|
||||
}
|
||||
for (let j = 0, len2 = vArray.length; j < len2; j++) {
|
||||
let value = vArray[j];
|
||||
if (typeof value === "boolean" || value === null || value === void 0) {
|
||||
continue;
|
||||
}
|
||||
if (typeof value === "string") {
|
||||
if (/([\\"'\/])/.test(value)) {
|
||||
styleString += value.replace(/([\\"']|(?<=<)\/)/g, "\\$1");
|
||||
} else {
|
||||
styleString += value;
|
||||
}
|
||||
} else if (typeof value === "number") {
|
||||
styleString += value;
|
||||
} else if (value[CSS_ESCAPED]) {
|
||||
styleString += value[CSS_ESCAPED];
|
||||
} else if (value[CLASS_NAME].startsWith("@keyframes ")) {
|
||||
selectors.push(value);
|
||||
styleString += ` ${value[CLASS_NAME].substring(11)} `;
|
||||
} else {
|
||||
if (strings[i + 1]?.match(/^\s*{/)) {
|
||||
selectors.push(value);
|
||||
value = `.${value[CLASS_NAME]}`;
|
||||
} else {
|
||||
selectors.push(...value[SELECTORS]);
|
||||
externalClassNames.push(...value[EXTERNAL_CLASS_NAMES]);
|
||||
value = value[STYLE_STRING];
|
||||
const valueLen = value.length;
|
||||
if (valueLen > 0) {
|
||||
const lastChar = value[valueLen - 1];
|
||||
if (lastChar !== ";" && lastChar !== "}") {
|
||||
value += ";";
|
||||
}
|
||||
}
|
||||
}
|
||||
styleString += `${value || ""}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
return [label, minify(styleString), selectors, externalClassNames];
|
||||
};
|
||||
const cssCommon = (strings, values) => {
|
||||
let [label, thisStyleString, selectors, externalClassNames] = buildStyleString(strings, values);
|
||||
const isPseudoGlobal = isPseudoGlobalSelectorRe.exec(thisStyleString);
|
||||
if (isPseudoGlobal) {
|
||||
thisStyleString = isPseudoGlobal[1];
|
||||
}
|
||||
const selector = (isPseudoGlobal ? PSEUDO_GLOBAL_SELECTOR : "") + toHash(label + thisStyleString);
|
||||
const className = (isPseudoGlobal ? selectors.map((s) => s[CLASS_NAME]) : [selector, ...externalClassNames]).join(" ");
|
||||
return {
|
||||
[SELECTOR]: selector,
|
||||
[CLASS_NAME]: className,
|
||||
[STYLE_STRING]: thisStyleString,
|
||||
[SELECTORS]: selectors,
|
||||
[EXTERNAL_CLASS_NAMES]: externalClassNames
|
||||
};
|
||||
};
|
||||
const cxCommon = (args) => {
|
||||
for (let i = 0, len = args.length; i < len; i++) {
|
||||
const arg = args[i];
|
||||
if (typeof arg === "string") {
|
||||
args[i] = {
|
||||
[SELECTOR]: "",
|
||||
[CLASS_NAME]: "",
|
||||
[STYLE_STRING]: "",
|
||||
[SELECTORS]: [],
|
||||
[EXTERNAL_CLASS_NAMES]: [arg]
|
||||
};
|
||||
}
|
||||
}
|
||||
return args;
|
||||
};
|
||||
const keyframesCommon = (strings, ...values) => {
|
||||
const [label, styleString] = buildStyleString(strings, values);
|
||||
return {
|
||||
[SELECTOR]: "",
|
||||
[CLASS_NAME]: `@keyframes ${toHash(label + styleString)}`,
|
||||
[STYLE_STRING]: styleString,
|
||||
[SELECTORS]: [],
|
||||
[EXTERNAL_CLASS_NAMES]: []
|
||||
};
|
||||
};
|
||||
let viewTransitionNameIndex = 0;
|
||||
const viewTransitionCommon = ((strings, values) => {
|
||||
if (!strings) {
|
||||
strings = [`/* h-v-t ${viewTransitionNameIndex++} */`];
|
||||
}
|
||||
const content = Array.isArray(strings) ? cssCommon(strings, values) : strings;
|
||||
const transitionName = content[CLASS_NAME];
|
||||
const res = cssCommon(["view-transition-name:", ""], [transitionName]);
|
||||
content[CLASS_NAME] = PSEUDO_GLOBAL_SELECTOR + content[CLASS_NAME];
|
||||
content[STYLE_STRING] = content[STYLE_STRING].replace(
|
||||
/(?<=::view-transition(?:[a-z-]*)\()(?=\))/g,
|
||||
transitionName
|
||||
);
|
||||
res[CLASS_NAME] = res[SELECTOR] = transitionName;
|
||||
res[SELECTORS] = [...content[SELECTORS], content];
|
||||
return res;
|
||||
});
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
CLASS_NAME,
|
||||
DEFAULT_STYLE_ID,
|
||||
EXTERNAL_CLASS_NAMES,
|
||||
IS_CSS_ESCAPED,
|
||||
PSEUDO_GLOBAL_SELECTOR,
|
||||
SELECTOR,
|
||||
SELECTORS,
|
||||
STYLE_STRING,
|
||||
buildStyleString,
|
||||
cssCommon,
|
||||
cxCommon,
|
||||
isPseudoGlobalSelectorRe,
|
||||
keyframesCommon,
|
||||
minify,
|
||||
rawCssString,
|
||||
viewTransitionCommon
|
||||
});
|
||||
143
backend/node_modules/hono/dist/cjs/helper/css/index.js
generated
vendored
Normal file
143
backend/node_modules/hono/dist/cjs/helper/css/index.js
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var css_exports = {};
|
||||
__export(css_exports, {
|
||||
Style: () => Style,
|
||||
createCssContext: () => createCssContext,
|
||||
css: () => css,
|
||||
cx: () => cx,
|
||||
keyframes: () => keyframes,
|
||||
rawCssString: () => import_common2.rawCssString,
|
||||
viewTransition: () => viewTransition
|
||||
});
|
||||
module.exports = __toCommonJS(css_exports);
|
||||
var import_html = require("../../helper/html");
|
||||
var import_constants = require("../../jsx/constants");
|
||||
var import_css = require("../../jsx/dom/css");
|
||||
var import_common = require("./common");
|
||||
var import_common2 = require("./common");
|
||||
const createCssContext = ({ id }) => {
|
||||
const [cssJsxDomObject, StyleRenderToDom] = (0, import_css.createCssJsxDomObjects)({ id });
|
||||
const contextMap = /* @__PURE__ */ new WeakMap();
|
||||
const nonceMap = /* @__PURE__ */ new WeakMap();
|
||||
const replaceStyleRe = new RegExp(`(<style id="${id}"(?: nonce="[^"]*")?>.*?)(</style>)`);
|
||||
const newCssClassNameObject = (cssClassName) => {
|
||||
const appendStyle = ({ buffer, context }) => {
|
||||
const [toAdd, added] = contextMap.get(context);
|
||||
const names = Object.keys(toAdd);
|
||||
if (!names.length) {
|
||||
return;
|
||||
}
|
||||
let stylesStr = "";
|
||||
names.forEach((className2) => {
|
||||
added[className2] = true;
|
||||
stylesStr += className2.startsWith(import_common.PSEUDO_GLOBAL_SELECTOR) ? toAdd[className2] : `${className2[0] === "@" ? "" : "."}${className2}{${toAdd[className2]}}`;
|
||||
});
|
||||
contextMap.set(context, [{}, added]);
|
||||
if (buffer && replaceStyleRe.test(buffer[0])) {
|
||||
buffer[0] = buffer[0].replace(replaceStyleRe, (_, pre, post) => `${pre}${stylesStr}${post}`);
|
||||
return;
|
||||
}
|
||||
const nonce = nonceMap.get(context);
|
||||
const appendStyleScript = `<script${nonce ? ` nonce="${nonce}"` : ""}>document.querySelector('#${id}').textContent+=${JSON.stringify(stylesStr)}</script>`;
|
||||
if (buffer) {
|
||||
buffer[0] = `${appendStyleScript}${buffer[0]}`;
|
||||
return;
|
||||
}
|
||||
return Promise.resolve(appendStyleScript);
|
||||
};
|
||||
const addClassNameToContext = ({ context }) => {
|
||||
if (!contextMap.has(context)) {
|
||||
contextMap.set(context, [{}, {}]);
|
||||
}
|
||||
const [toAdd, added] = contextMap.get(context);
|
||||
let allAdded = true;
|
||||
if (!added[cssClassName[import_common.SELECTOR]]) {
|
||||
allAdded = false;
|
||||
toAdd[cssClassName[import_common.SELECTOR]] = cssClassName[import_common.STYLE_STRING];
|
||||
}
|
||||
cssClassName[import_common.SELECTORS].forEach(
|
||||
({ [import_common.CLASS_NAME]: className2, [import_common.STYLE_STRING]: styleString }) => {
|
||||
if (!added[className2]) {
|
||||
allAdded = false;
|
||||
toAdd[className2] = styleString;
|
||||
}
|
||||
}
|
||||
);
|
||||
if (allAdded) {
|
||||
return;
|
||||
}
|
||||
return Promise.resolve((0, import_html.raw)("", [appendStyle]));
|
||||
};
|
||||
const className = new String(cssClassName[import_common.CLASS_NAME]);
|
||||
Object.assign(className, cssClassName);
|
||||
className.isEscaped = true;
|
||||
className.callbacks = [addClassNameToContext];
|
||||
const promise = Promise.resolve(className);
|
||||
Object.assign(promise, cssClassName);
|
||||
promise.toString = cssJsxDomObject.toString;
|
||||
return promise;
|
||||
};
|
||||
const css2 = (strings, ...values) => {
|
||||
return newCssClassNameObject((0, import_common.cssCommon)(strings, values));
|
||||
};
|
||||
const cx2 = (...args) => {
|
||||
args = (0, import_common.cxCommon)(args);
|
||||
return css2(Array(args.length).fill(""), ...args);
|
||||
};
|
||||
const keyframes2 = import_common.keyframesCommon;
|
||||
const viewTransition2 = ((strings, ...values) => {
|
||||
return newCssClassNameObject((0, import_common.viewTransitionCommon)(strings, values));
|
||||
});
|
||||
const Style2 = ({ children, nonce } = {}) => (0, import_html.raw)(
|
||||
`<style id="${id}"${nonce ? ` nonce="${nonce}"` : ""}>${children ? children[import_common.STYLE_STRING] : ""}</style>`,
|
||||
[
|
||||
({ context }) => {
|
||||
nonceMap.set(context, nonce);
|
||||
return void 0;
|
||||
}
|
||||
]
|
||||
);
|
||||
Style2[import_constants.DOM_RENDERER] = StyleRenderToDom;
|
||||
return {
|
||||
css: css2,
|
||||
cx: cx2,
|
||||
keyframes: keyframes2,
|
||||
viewTransition: viewTransition2,
|
||||
Style: Style2
|
||||
};
|
||||
};
|
||||
const defaultContext = createCssContext({
|
||||
id: import_common.DEFAULT_STYLE_ID
|
||||
});
|
||||
const css = defaultContext.css;
|
||||
const cx = defaultContext.cx;
|
||||
const keyframes = defaultContext.keyframes;
|
||||
const viewTransition = defaultContext.viewTransition;
|
||||
const Style = defaultContext.Style;
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Style,
|
||||
createCssContext,
|
||||
css,
|
||||
cx,
|
||||
keyframes,
|
||||
rawCssString,
|
||||
viewTransition
|
||||
});
|
||||
80
backend/node_modules/hono/dist/cjs/helper/dev/index.js
generated
vendored
Normal file
80
backend/node_modules/hono/dist/cjs/helper/dev/index.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var dev_exports = {};
|
||||
__export(dev_exports, {
|
||||
getRouterName: () => getRouterName,
|
||||
inspectRoutes: () => inspectRoutes,
|
||||
showRoutes: () => showRoutes
|
||||
});
|
||||
module.exports = __toCommonJS(dev_exports);
|
||||
var import_color = require("../../utils/color");
|
||||
var import_handler = require("../../utils/handler");
|
||||
const handlerName = (handler) => {
|
||||
return handler.name || ((0, import_handler.isMiddleware)(handler) ? "[middleware]" : "[handler]");
|
||||
};
|
||||
const inspectRoutes = (hono) => {
|
||||
return hono.routes.map(({ path, method, handler }) => {
|
||||
const targetHandler = (0, import_handler.findTargetHandler)(handler);
|
||||
return {
|
||||
path,
|
||||
method,
|
||||
name: handlerName(targetHandler),
|
||||
isMiddleware: (0, import_handler.isMiddleware)(targetHandler)
|
||||
};
|
||||
});
|
||||
};
|
||||
const showRoutes = (hono, opts) => {
|
||||
const colorEnabled = opts?.colorize ?? (0, import_color.getColorEnabled)();
|
||||
const routeData = {};
|
||||
let maxMethodLength = 0;
|
||||
let maxPathLength = 0;
|
||||
inspectRoutes(hono).filter(({ isMiddleware: isMiddleware2 }) => opts?.verbose || !isMiddleware2).map((route) => {
|
||||
const key = `${route.method}-${route.path}`;
|
||||
(routeData[key] ||= []).push(route);
|
||||
if (routeData[key].length > 1) {
|
||||
return;
|
||||
}
|
||||
maxMethodLength = Math.max(maxMethodLength, route.method.length);
|
||||
maxPathLength = Math.max(maxPathLength, route.path.length);
|
||||
return { method: route.method, path: route.path, routes: routeData[key] };
|
||||
}).forEach((data) => {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
const { method, path, routes } = data;
|
||||
const methodStr = colorEnabled ? `\x1B[32m${method}\x1B[0m` : method;
|
||||
console.log(`${methodStr} ${" ".repeat(maxMethodLength - method.length)} ${path}`);
|
||||
if (!opts?.verbose) {
|
||||
return;
|
||||
}
|
||||
routes.forEach(({ name }) => {
|
||||
console.log(`${" ".repeat(maxMethodLength + 3)} ${name}`);
|
||||
});
|
||||
});
|
||||
};
|
||||
const getRouterName = (app) => {
|
||||
app.router.match("GET", "/");
|
||||
return app.router.name;
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getRouterName,
|
||||
inspectRoutes,
|
||||
showRoutes
|
||||
});
|
||||
55
backend/node_modules/hono/dist/cjs/helper/factory/index.js
generated
vendored
Normal file
55
backend/node_modules/hono/dist/cjs/helper/factory/index.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var factory_exports = {};
|
||||
__export(factory_exports, {
|
||||
Factory: () => Factory,
|
||||
createFactory: () => createFactory,
|
||||
createMiddleware: () => createMiddleware
|
||||
});
|
||||
module.exports = __toCommonJS(factory_exports);
|
||||
var import_hono = require("../../hono");
|
||||
class Factory {
|
||||
initApp;
|
||||
#defaultAppOptions;
|
||||
constructor(init) {
|
||||
this.initApp = init?.initApp;
|
||||
this.#defaultAppOptions = init?.defaultAppOptions;
|
||||
}
|
||||
createApp = (options) => {
|
||||
const app = new import_hono.Hono(
|
||||
options && this.#defaultAppOptions ? { ...this.#defaultAppOptions, ...options } : options ?? this.#defaultAppOptions
|
||||
);
|
||||
if (this.initApp) {
|
||||
this.initApp(app);
|
||||
}
|
||||
return app;
|
||||
};
|
||||
createMiddleware = (middleware) => middleware;
|
||||
createHandlers = (...handlers) => {
|
||||
return handlers.filter((handler) => handler !== void 0);
|
||||
};
|
||||
}
|
||||
const createFactory = (init) => new Factory(init);
|
||||
const createMiddleware = (middleware) => middleware;
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Factory,
|
||||
createFactory,
|
||||
createMiddleware
|
||||
});
|
||||
65
backend/node_modules/hono/dist/cjs/helper/html/index.js
generated
vendored
Normal file
65
backend/node_modules/hono/dist/cjs/helper/html/index.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var html_exports = {};
|
||||
__export(html_exports, {
|
||||
html: () => html,
|
||||
raw: () => import_html.raw
|
||||
});
|
||||
module.exports = __toCommonJS(html_exports);
|
||||
var import_html = require("../../utils/html");
|
||||
const html = (strings, ...values) => {
|
||||
const buffer = [""];
|
||||
for (let i = 0, len = strings.length - 1; i < len; i++) {
|
||||
buffer[0] += strings[i];
|
||||
const children = Array.isArray(values[i]) ? values[i].flat(Infinity) : [values[i]];
|
||||
for (let i2 = 0, len2 = children.length; i2 < len2; i2++) {
|
||||
const child = children[i2];
|
||||
if (typeof child === "string") {
|
||||
(0, import_html.escapeToBuffer)(child, buffer);
|
||||
} else if (typeof child === "number") {
|
||||
;
|
||||
buffer[0] += child;
|
||||
} else if (typeof child === "boolean" || child === null || child === void 0) {
|
||||
continue;
|
||||
} else if (typeof child === "object" && child.isEscaped) {
|
||||
if (child.callbacks) {
|
||||
buffer.unshift("", child);
|
||||
} else {
|
||||
const tmp = child.toString();
|
||||
if (tmp instanceof Promise) {
|
||||
buffer.unshift("", tmp);
|
||||
} else {
|
||||
buffer[0] += tmp;
|
||||
}
|
||||
}
|
||||
} else if (child instanceof Promise) {
|
||||
buffer.unshift("", child);
|
||||
} else {
|
||||
(0, import_html.escapeToBuffer)(child.toString(), buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
buffer[0] += strings.at(-1);
|
||||
return buffer.length === 1 ? "callbacks" in buffer ? (0, import_html.raw)((0, import_html.resolveCallbackSync)((0, import_html.raw)(buffer[0], buffer.callbacks))) : (0, import_html.raw)(buffer[0]) : (0, import_html.stringBufferToString)(buffer, buffer.callbacks);
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
html,
|
||||
raw
|
||||
});
|
||||
112
backend/node_modules/hono/dist/cjs/helper/proxy/index.js
generated
vendored
Normal file
112
backend/node_modules/hono/dist/cjs/helper/proxy/index.js
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var proxy_exports = {};
|
||||
__export(proxy_exports, {
|
||||
proxy: () => proxy
|
||||
});
|
||||
module.exports = __toCommonJS(proxy_exports);
|
||||
var import_http_exception = require("../../http-exception");
|
||||
const hopByHopHeaders = [
|
||||
"connection",
|
||||
"keep-alive",
|
||||
"proxy-authenticate",
|
||||
"proxy-authorization",
|
||||
"te",
|
||||
"trailer",
|
||||
"transfer-encoding",
|
||||
"upgrade"
|
||||
];
|
||||
const ALLOWED_TOKEN_PATTERN = /^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/;
|
||||
const buildRequestInitFromRequest = (request, strictConnectionProcessing) => {
|
||||
if (!request) {
|
||||
return {};
|
||||
}
|
||||
const headers = new Headers(request.headers);
|
||||
if (strictConnectionProcessing) {
|
||||
const connectionValue = headers.get("connection");
|
||||
if (connectionValue) {
|
||||
const headerNames = connectionValue.split(",").map((h) => h.trim());
|
||||
const invalidHeaders = headerNames.filter((h) => !ALLOWED_TOKEN_PATTERN.test(h));
|
||||
if (invalidHeaders.length > 0) {
|
||||
throw new import_http_exception.HTTPException(400, {
|
||||
message: `Invalid Connection header value: ${invalidHeaders.join(", ")}`
|
||||
});
|
||||
}
|
||||
headerNames.forEach((headerName) => {
|
||||
headers.delete(headerName);
|
||||
});
|
||||
}
|
||||
}
|
||||
hopByHopHeaders.forEach((header) => {
|
||||
headers.delete(header);
|
||||
});
|
||||
return {
|
||||
method: request.method,
|
||||
body: request.body,
|
||||
duplex: request.body ? "half" : void 0,
|
||||
headers,
|
||||
signal: request.signal
|
||||
};
|
||||
};
|
||||
const preprocessRequestInit = (requestInit) => {
|
||||
if (!requestInit.headers || Array.isArray(requestInit.headers) || requestInit.headers instanceof Headers) {
|
||||
return requestInit;
|
||||
}
|
||||
const headers = new Headers();
|
||||
for (const [key, value] of Object.entries(requestInit.headers)) {
|
||||
if (value == null) {
|
||||
headers.delete(key);
|
||||
} else {
|
||||
headers.set(key, value);
|
||||
}
|
||||
}
|
||||
requestInit.headers = headers;
|
||||
return requestInit;
|
||||
};
|
||||
const proxy = async (input, proxyInit) => {
|
||||
const {
|
||||
raw,
|
||||
customFetch,
|
||||
strictConnectionProcessing = false,
|
||||
...requestInit
|
||||
} = proxyInit instanceof Request ? { raw: proxyInit } : proxyInit ?? {};
|
||||
const req = new Request(input, {
|
||||
...buildRequestInitFromRequest(raw, strictConnectionProcessing),
|
||||
...preprocessRequestInit(requestInit)
|
||||
});
|
||||
req.headers.delete("accept-encoding");
|
||||
const res = await (customFetch || fetch)(req);
|
||||
const resHeaders = new Headers(res.headers);
|
||||
hopByHopHeaders.forEach((header) => {
|
||||
resHeaders.delete(header);
|
||||
});
|
||||
if (resHeaders.has("content-encoding")) {
|
||||
resHeaders.delete("content-encoding");
|
||||
resHeaders.delete("content-length");
|
||||
}
|
||||
return new Response(res.body, {
|
||||
status: res.status,
|
||||
statusText: res.statusText,
|
||||
headers: resHeaders
|
||||
});
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
proxy
|
||||
});
|
||||
72
backend/node_modules/hono/dist/cjs/helper/route/index.js
generated
vendored
Normal file
72
backend/node_modules/hono/dist/cjs/helper/route/index.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var route_exports = {};
|
||||
__export(route_exports, {
|
||||
basePath: () => basePath,
|
||||
baseRoutePath: () => baseRoutePath,
|
||||
matchedRoutes: () => matchedRoutes,
|
||||
routePath: () => routePath
|
||||
});
|
||||
module.exports = __toCommonJS(route_exports);
|
||||
var import_constants = require("../../request/constants");
|
||||
var import_url = require("../../utils/url");
|
||||
const matchedRoutes = (c) => (
|
||||
// @ts-expect-error c.req[GET_MATCH_RESULT] is not typed
|
||||
c.req[import_constants.GET_MATCH_RESULT][0].map(([[, route]]) => route)
|
||||
);
|
||||
const routePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.path ?? "";
|
||||
const baseRoutePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.basePath ?? "";
|
||||
const basePathCacheMap = /* @__PURE__ */ new WeakMap();
|
||||
const basePath = (c, index) => {
|
||||
index ??= c.req.routeIndex;
|
||||
const cache = basePathCacheMap.get(c) || [];
|
||||
if (typeof cache[index] === "string") {
|
||||
return cache[index];
|
||||
}
|
||||
let result;
|
||||
const rp = baseRoutePath(c, index);
|
||||
if (!/[:*]/.test(rp)) {
|
||||
result = rp;
|
||||
} else {
|
||||
const paths = (0, import_url.splitRoutingPath)(rp);
|
||||
const reqPath = c.req.path;
|
||||
let basePathLength = 0;
|
||||
for (let i = 0, len = paths.length; i < len; i++) {
|
||||
const pattern = (0, import_url.getPattern)(paths[i], paths[i + 1]);
|
||||
if (pattern) {
|
||||
const re = pattern[2] === true || pattern === "*" ? /[^\/]+/ : pattern[2];
|
||||
basePathLength += reqPath.substring(basePathLength + 1).match(re)?.[0].length || 0;
|
||||
} else {
|
||||
basePathLength += paths[i].length;
|
||||
}
|
||||
basePathLength += 1;
|
||||
}
|
||||
result = reqPath.substring(0, basePathLength);
|
||||
}
|
||||
cache[index] = result;
|
||||
basePathCacheMap.set(c, cache);
|
||||
return result;
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
basePath,
|
||||
baseRoutePath,
|
||||
matchedRoutes,
|
||||
routePath
|
||||
});
|
||||
39
backend/node_modules/hono/dist/cjs/helper/ssg/index.js
generated
vendored
Normal file
39
backend/node_modules/hono/dist/cjs/helper/ssg/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var ssg_exports = {};
|
||||
__export(ssg_exports, {
|
||||
X_HONO_DISABLE_SSG_HEADER_KEY: () => import_middleware.X_HONO_DISABLE_SSG_HEADER_KEY,
|
||||
disableSSG: () => import_middleware.disableSSG,
|
||||
isSSGContext: () => import_middleware.isSSGContext,
|
||||
onlySSG: () => import_middleware.onlySSG,
|
||||
ssgParams: () => import_middleware.ssgParams
|
||||
});
|
||||
module.exports = __toCommonJS(ssg_exports);
|
||||
__reExport(ssg_exports, require("./ssg"), module.exports);
|
||||
var import_middleware = require("./middleware");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
X_HONO_DISABLE_SSG_HEADER_KEY,
|
||||
disableSSG,
|
||||
isSSGContext,
|
||||
onlySSG,
|
||||
ssgParams,
|
||||
...require("./ssg")
|
||||
});
|
||||
74
backend/node_modules/hono/dist/cjs/helper/ssg/middleware.js
generated
vendored
Normal file
74
backend/node_modules/hono/dist/cjs/helper/ssg/middleware.js
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var middleware_exports = {};
|
||||
__export(middleware_exports, {
|
||||
SSG_CONTEXT: () => SSG_CONTEXT,
|
||||
SSG_DISABLED_RESPONSE: () => SSG_DISABLED_RESPONSE,
|
||||
X_HONO_DISABLE_SSG_HEADER_KEY: () => X_HONO_DISABLE_SSG_HEADER_KEY,
|
||||
disableSSG: () => disableSSG,
|
||||
isSSGContext: () => isSSGContext,
|
||||
onlySSG: () => onlySSG,
|
||||
ssgParams: () => ssgParams
|
||||
});
|
||||
module.exports = __toCommonJS(middleware_exports);
|
||||
var import_utils = require("./utils");
|
||||
const SSG_CONTEXT = "HONO_SSG_CONTEXT";
|
||||
const X_HONO_DISABLE_SSG_HEADER_KEY = "x-hono-disable-ssg";
|
||||
const SSG_DISABLED_RESPONSE = (() => {
|
||||
try {
|
||||
return new Response("SSG is disabled", {
|
||||
status: 404,
|
||||
headers: { [X_HONO_DISABLE_SSG_HEADER_KEY]: "true" }
|
||||
});
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
})();
|
||||
const ssgParams = (params) => async (c, next) => {
|
||||
if ((0, import_utils.isDynamicRoute)(c.req.path)) {
|
||||
;
|
||||
c.req.raw.ssgParams = Array.isArray(params) ? params : await params(c);
|
||||
return c.notFound();
|
||||
}
|
||||
await next();
|
||||
};
|
||||
const isSSGContext = (c) => !!c.env?.[SSG_CONTEXT];
|
||||
const disableSSG = () => async function disableSSG2(c, next) {
|
||||
if (isSSGContext(c)) {
|
||||
c.header(X_HONO_DISABLE_SSG_HEADER_KEY, "true");
|
||||
return c.notFound();
|
||||
}
|
||||
await next();
|
||||
};
|
||||
const onlySSG = () => async function onlySSG2(c, next) {
|
||||
if (!isSSGContext(c)) {
|
||||
return c.notFound();
|
||||
}
|
||||
await next();
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
SSG_CONTEXT,
|
||||
SSG_DISABLED_RESPONSE,
|
||||
X_HONO_DISABLE_SSG_HEADER_KEY,
|
||||
disableSSG,
|
||||
isSSGContext,
|
||||
onlySSG,
|
||||
ssgParams
|
||||
});
|
||||
326
backend/node_modules/hono/dist/cjs/helper/ssg/ssg.js
generated
vendored
Normal file
326
backend/node_modules/hono/dist/cjs/helper/ssg/ssg.js
generated
vendored
Normal file
@@ -0,0 +1,326 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var ssg_exports = {};
|
||||
__export(ssg_exports, {
|
||||
DEFAULT_OUTPUT_DIR: () => DEFAULT_OUTPUT_DIR,
|
||||
combineAfterGenerateHooks: () => combineAfterGenerateHooks,
|
||||
combineAfterResponseHooks: () => combineAfterResponseHooks,
|
||||
combineBeforeRequestHooks: () => combineBeforeRequestHooks,
|
||||
defaultExtensionMap: () => defaultExtensionMap,
|
||||
defaultPlugin: () => defaultPlugin,
|
||||
fetchRoutesContent: () => fetchRoutesContent,
|
||||
saveContentToFile: () => saveContentToFile,
|
||||
toSSG: () => toSSG
|
||||
});
|
||||
module.exports = __toCommonJS(ssg_exports);
|
||||
var import_utils = require("../../client/utils");
|
||||
var import_concurrent = require("../../utils/concurrent");
|
||||
var import_mime = require("../../utils/mime");
|
||||
var import_middleware = require("./middleware");
|
||||
var import_utils2 = require("./utils");
|
||||
const DEFAULT_CONCURRENCY = 2;
|
||||
const DEFAULT_CONTENT_TYPE = "text/plain";
|
||||
const DEFAULT_OUTPUT_DIR = "./static";
|
||||
const generateFilePath = (routePath, outDir, mimeType, extensionMap) => {
|
||||
const extension = determineExtension(mimeType, extensionMap);
|
||||
if (routePath.endsWith(`.${extension}`)) {
|
||||
return (0, import_utils2.joinPaths)(outDir, routePath);
|
||||
}
|
||||
if (routePath === "/") {
|
||||
return (0, import_utils2.joinPaths)(outDir, `index.${extension}`);
|
||||
}
|
||||
if (routePath.endsWith("/")) {
|
||||
return (0, import_utils2.joinPaths)(outDir, routePath, `index.${extension}`);
|
||||
}
|
||||
return (0, import_utils2.joinPaths)(outDir, `${routePath}.${extension}`);
|
||||
};
|
||||
const parseResponseContent = async (response) => {
|
||||
const contentType = response.headers.get("Content-Type");
|
||||
try {
|
||||
if (contentType?.includes("text") || contentType?.includes("json")) {
|
||||
return await response.text();
|
||||
} else {
|
||||
return await response.arrayBuffer();
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`Error processing response: ${error instanceof Error ? error.message : "Unknown error"}`
|
||||
);
|
||||
}
|
||||
};
|
||||
const defaultExtensionMap = {
|
||||
"text/html": "html",
|
||||
"text/xml": "xml",
|
||||
"application/xml": "xml",
|
||||
"application/yaml": "yaml"
|
||||
};
|
||||
const determineExtension = (mimeType, userExtensionMap) => {
|
||||
const extensionMap = userExtensionMap || defaultExtensionMap;
|
||||
if (mimeType in extensionMap) {
|
||||
return extensionMap[mimeType];
|
||||
}
|
||||
return (0, import_mime.getExtension)(mimeType) || "html";
|
||||
};
|
||||
const combineBeforeRequestHooks = (hooks) => {
|
||||
if (!Array.isArray(hooks)) {
|
||||
return hooks;
|
||||
}
|
||||
return async (req) => {
|
||||
let currentReq = req;
|
||||
for (const hook of hooks) {
|
||||
const result = await hook(currentReq);
|
||||
if (result === false) {
|
||||
return false;
|
||||
}
|
||||
if (result instanceof Request) {
|
||||
currentReq = result;
|
||||
}
|
||||
}
|
||||
return currentReq;
|
||||
};
|
||||
};
|
||||
const combineAfterResponseHooks = (hooks) => {
|
||||
if (!Array.isArray(hooks)) {
|
||||
return hooks;
|
||||
}
|
||||
return async (res) => {
|
||||
let currentRes = res;
|
||||
for (const hook of hooks) {
|
||||
const result = await hook(currentRes);
|
||||
if (result === false) {
|
||||
return false;
|
||||
}
|
||||
if (result instanceof Response) {
|
||||
currentRes = result;
|
||||
}
|
||||
}
|
||||
return currentRes;
|
||||
};
|
||||
};
|
||||
const combineAfterGenerateHooks = (hooks, fsModule, options) => {
|
||||
if (!Array.isArray(hooks)) {
|
||||
return hooks;
|
||||
}
|
||||
return async (result) => {
|
||||
for (const hook of hooks) {
|
||||
await hook(result, fsModule, options);
|
||||
}
|
||||
};
|
||||
};
|
||||
const fetchRoutesContent = function* (app, beforeRequestHook, afterResponseHook, concurrency) {
|
||||
const baseURL = "http://localhost";
|
||||
const pool = (0, import_concurrent.createPool)({ concurrency });
|
||||
for (const route of (0, import_utils2.filterStaticGenerateRoutes)(app)) {
|
||||
const thisRouteBaseURL = new URL(route.path, baseURL).toString();
|
||||
let forGetInfoURLRequest = new Request(thisRouteBaseURL);
|
||||
yield new Promise(async (resolveGetInfo, rejectGetInfo) => {
|
||||
try {
|
||||
if (beforeRequestHook) {
|
||||
const maybeRequest = await beforeRequestHook(forGetInfoURLRequest);
|
||||
if (!maybeRequest) {
|
||||
resolveGetInfo(void 0);
|
||||
return;
|
||||
}
|
||||
forGetInfoURLRequest = maybeRequest;
|
||||
}
|
||||
await pool.run(() => app.fetch(forGetInfoURLRequest));
|
||||
if (!forGetInfoURLRequest.ssgParams) {
|
||||
if ((0, import_utils2.isDynamicRoute)(route.path)) {
|
||||
resolveGetInfo(void 0);
|
||||
return;
|
||||
}
|
||||
forGetInfoURLRequest.ssgParams = [{}];
|
||||
}
|
||||
const requestInit = {
|
||||
method: forGetInfoURLRequest.method,
|
||||
headers: forGetInfoURLRequest.headers
|
||||
};
|
||||
resolveGetInfo(
|
||||
(function* () {
|
||||
for (const param of forGetInfoURLRequest.ssgParams) {
|
||||
yield new Promise(async (resolveReq, rejectReq) => {
|
||||
try {
|
||||
const replacedUrlParam = (0, import_utils.replaceUrlParam)(route.path, param);
|
||||
let response = await pool.run(
|
||||
() => app.request(replacedUrlParam, requestInit, {
|
||||
[import_middleware.SSG_CONTEXT]: true
|
||||
})
|
||||
);
|
||||
if (response.headers.get(import_middleware.X_HONO_DISABLE_SSG_HEADER_KEY)) {
|
||||
resolveReq(void 0);
|
||||
return;
|
||||
}
|
||||
if (afterResponseHook) {
|
||||
const maybeResponse = await afterResponseHook(response);
|
||||
if (!maybeResponse) {
|
||||
resolveReq(void 0);
|
||||
return;
|
||||
}
|
||||
response = maybeResponse;
|
||||
}
|
||||
const mimeType = response.headers.get("Content-Type")?.split(";")[0] || DEFAULT_CONTENT_TYPE;
|
||||
const content = await parseResponseContent(response);
|
||||
resolveReq({
|
||||
routePath: replacedUrlParam,
|
||||
mimeType,
|
||||
content
|
||||
});
|
||||
} catch (error) {
|
||||
rejectReq(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
})()
|
||||
);
|
||||
} catch (error) {
|
||||
rejectGetInfo(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const createdDirs = /* @__PURE__ */ new Set();
|
||||
const saveContentToFile = async (data, fsModule, outDir, extensionMap) => {
|
||||
const awaitedData = await data;
|
||||
if (!awaitedData) {
|
||||
return;
|
||||
}
|
||||
const { routePath, content, mimeType } = awaitedData;
|
||||
const filePath = generateFilePath(routePath, outDir, mimeType, extensionMap);
|
||||
const dirPath = (0, import_utils2.dirname)(filePath);
|
||||
if (!createdDirs.has(dirPath)) {
|
||||
await fsModule.mkdir(dirPath, { recursive: true });
|
||||
createdDirs.add(dirPath);
|
||||
}
|
||||
if (typeof content === "string") {
|
||||
await fsModule.writeFile(filePath, content);
|
||||
} else if (content instanceof ArrayBuffer) {
|
||||
await fsModule.writeFile(filePath, new Uint8Array(content));
|
||||
}
|
||||
return filePath;
|
||||
};
|
||||
const defaultPlugin = {
|
||||
afterResponseHook: (res) => {
|
||||
if (res.status !== 200) {
|
||||
return false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
};
|
||||
const toSSG = async (app, fs, options) => {
|
||||
let result;
|
||||
const getInfoPromises = [];
|
||||
const savePromises = [];
|
||||
const plugins = options?.plugins || [defaultPlugin];
|
||||
const beforeRequestHooks = [];
|
||||
const afterResponseHooks = [];
|
||||
const afterGenerateHooks = [];
|
||||
if (options?.beforeRequestHook) {
|
||||
beforeRequestHooks.push(
|
||||
...Array.isArray(options.beforeRequestHook) ? options.beforeRequestHook : [options.beforeRequestHook]
|
||||
);
|
||||
}
|
||||
if (options?.afterResponseHook) {
|
||||
afterResponseHooks.push(
|
||||
...Array.isArray(options.afterResponseHook) ? options.afterResponseHook : [options.afterResponseHook]
|
||||
);
|
||||
}
|
||||
if (options?.afterGenerateHook) {
|
||||
afterGenerateHooks.push(
|
||||
...Array.isArray(options.afterGenerateHook) ? options.afterGenerateHook : [options.afterGenerateHook]
|
||||
);
|
||||
}
|
||||
for (const plugin of plugins) {
|
||||
if (plugin.beforeRequestHook) {
|
||||
beforeRequestHooks.push(
|
||||
...Array.isArray(plugin.beforeRequestHook) ? plugin.beforeRequestHook : [plugin.beforeRequestHook]
|
||||
);
|
||||
}
|
||||
if (plugin.afterResponseHook) {
|
||||
afterResponseHooks.push(
|
||||
...Array.isArray(plugin.afterResponseHook) ? plugin.afterResponseHook : [plugin.afterResponseHook]
|
||||
);
|
||||
}
|
||||
if (plugin.afterGenerateHook) {
|
||||
afterGenerateHooks.push(
|
||||
...Array.isArray(plugin.afterGenerateHook) ? plugin.afterGenerateHook : [plugin.afterGenerateHook]
|
||||
);
|
||||
}
|
||||
}
|
||||
try {
|
||||
const outputDir = options?.dir ?? DEFAULT_OUTPUT_DIR;
|
||||
const concurrency = options?.concurrency ?? DEFAULT_CONCURRENCY;
|
||||
const combinedBeforeRequestHook = combineBeforeRequestHooks(
|
||||
beforeRequestHooks.length > 0 ? beforeRequestHooks : [(req) => req]
|
||||
);
|
||||
const combinedAfterResponseHook = combineAfterResponseHooks(
|
||||
afterResponseHooks.length > 0 ? afterResponseHooks : [(req) => req]
|
||||
);
|
||||
const getInfoGen = fetchRoutesContent(
|
||||
app,
|
||||
combinedBeforeRequestHook,
|
||||
combinedAfterResponseHook,
|
||||
concurrency
|
||||
);
|
||||
for (const getInfo of getInfoGen) {
|
||||
getInfoPromises.push(
|
||||
getInfo.then((getContentGen) => {
|
||||
if (!getContentGen) {
|
||||
return;
|
||||
}
|
||||
for (const content of getContentGen) {
|
||||
savePromises.push(
|
||||
saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e)
|
||||
);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
await Promise.all(getInfoPromises);
|
||||
const files = [];
|
||||
for (const savePromise of savePromises) {
|
||||
const fileOrError = await savePromise;
|
||||
if (typeof fileOrError === "string") {
|
||||
files.push(fileOrError);
|
||||
} else if (fileOrError) {
|
||||
throw fileOrError;
|
||||
}
|
||||
}
|
||||
result = { success: true, files };
|
||||
} catch (error) {
|
||||
const errorObj = error instanceof Error ? error : new Error(String(error));
|
||||
result = { success: false, files: [], error: errorObj };
|
||||
}
|
||||
if (afterGenerateHooks.length > 0) {
|
||||
const combinedAfterGenerateHooks = combineAfterGenerateHooks(afterGenerateHooks, fs, options);
|
||||
await combinedAfterGenerateHooks(result, fs, options);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
DEFAULT_OUTPUT_DIR,
|
||||
combineAfterGenerateHooks,
|
||||
combineAfterResponseHooks,
|
||||
combineBeforeRequestHooks,
|
||||
defaultExtensionMap,
|
||||
defaultPlugin,
|
||||
fetchRoutesContent,
|
||||
saveContentToFile,
|
||||
toSSG
|
||||
});
|
||||
85
backend/node_modules/hono/dist/cjs/helper/ssg/utils.js
generated
vendored
Normal file
85
backend/node_modules/hono/dist/cjs/helper/ssg/utils.js
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var utils_exports = {};
|
||||
__export(utils_exports, {
|
||||
dirname: () => dirname,
|
||||
filterStaticGenerateRoutes: () => filterStaticGenerateRoutes,
|
||||
isDynamicRoute: () => isDynamicRoute,
|
||||
joinPaths: () => joinPaths
|
||||
});
|
||||
module.exports = __toCommonJS(utils_exports);
|
||||
var import_router = require("../../router");
|
||||
var import_handler = require("../../utils/handler");
|
||||
const dirname = (path) => {
|
||||
const separatedPath = path.split(/[\/\\]/);
|
||||
return separatedPath.slice(0, -1).join("/");
|
||||
};
|
||||
const normalizePath = (path) => {
|
||||
return path.replace(/(\\)/g, "/").replace(/\/$/g, "");
|
||||
};
|
||||
const handleParent = (resultPaths, beforeParentFlag) => {
|
||||
if (resultPaths.length === 0 || beforeParentFlag) {
|
||||
resultPaths.push("..");
|
||||
} else {
|
||||
resultPaths.pop();
|
||||
}
|
||||
};
|
||||
const handleNonDot = (path, resultPaths) => {
|
||||
path = path.replace(/^\.(?!.)/, "");
|
||||
if (path !== "") {
|
||||
resultPaths.push(path);
|
||||
}
|
||||
};
|
||||
const handleSegments = (paths, resultPaths) => {
|
||||
let beforeParentFlag = false;
|
||||
for (const path of paths) {
|
||||
if (path === "..") {
|
||||
handleParent(resultPaths, beforeParentFlag);
|
||||
beforeParentFlag = true;
|
||||
} else {
|
||||
handleNonDot(path, resultPaths);
|
||||
beforeParentFlag = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
const joinPaths = (...paths) => {
|
||||
paths = paths.map(normalizePath);
|
||||
const resultPaths = [];
|
||||
handleSegments(paths.join("/").split("/"), resultPaths);
|
||||
return (paths[0][0] === "/" ? "/" : "") + resultPaths.join("/");
|
||||
};
|
||||
const filterStaticGenerateRoutes = (hono) => {
|
||||
return hono.routes.reduce((acc, { method, handler, path }) => {
|
||||
const targetHandler = (0, import_handler.findTargetHandler)(handler);
|
||||
if (["GET", import_router.METHOD_NAME_ALL].includes(method) && !(0, import_handler.isMiddleware)(targetHandler)) {
|
||||
acc.push({ path });
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
const isDynamicRoute = (path) => {
|
||||
return path.split("/").some((segment) => segment.startsWith(":") || segment.includes("*"));
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
dirname,
|
||||
filterStaticGenerateRoutes,
|
||||
isDynamicRoute,
|
||||
joinPaths
|
||||
});
|
||||
36
backend/node_modules/hono/dist/cjs/helper/streaming/index.js
generated
vendored
Normal file
36
backend/node_modules/hono/dist/cjs/helper/streaming/index.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var streaming_exports = {};
|
||||
__export(streaming_exports, {
|
||||
SSEStreamingApi: () => import_sse.SSEStreamingApi,
|
||||
stream: () => import_stream.stream,
|
||||
streamSSE: () => import_sse.streamSSE,
|
||||
streamText: () => import_text.streamText
|
||||
});
|
||||
module.exports = __toCommonJS(streaming_exports);
|
||||
var import_stream = require("./stream");
|
||||
var import_sse = require("./sse");
|
||||
var import_text = require("./text");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
SSEStreamingApi,
|
||||
stream,
|
||||
streamSSE,
|
||||
streamText
|
||||
});
|
||||
86
backend/node_modules/hono/dist/cjs/helper/streaming/sse.js
generated
vendored
Normal file
86
backend/node_modules/hono/dist/cjs/helper/streaming/sse.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var sse_exports = {};
|
||||
__export(sse_exports, {
|
||||
SSEStreamingApi: () => SSEStreamingApi,
|
||||
streamSSE: () => streamSSE
|
||||
});
|
||||
module.exports = __toCommonJS(sse_exports);
|
||||
var import_html = require("../../utils/html");
|
||||
var import_stream = require("../../utils/stream");
|
||||
var import_utils = require("./utils");
|
||||
class SSEStreamingApi extends import_stream.StreamingApi {
|
||||
constructor(writable, readable) {
|
||||
super(writable, readable);
|
||||
}
|
||||
async writeSSE(message) {
|
||||
const data = await (0, import_html.resolveCallback)(message.data, import_html.HtmlEscapedCallbackPhase.Stringify, false, {});
|
||||
const dataLines = data.split("\n").map((line) => {
|
||||
return `data: ${line}`;
|
||||
}).join("\n");
|
||||
const sseData = [
|
||||
message.event && `event: ${message.event}`,
|
||||
dataLines,
|
||||
message.id && `id: ${message.id}`,
|
||||
message.retry && `retry: ${message.retry}`
|
||||
].filter(Boolean).join("\n") + "\n\n";
|
||||
await this.write(sseData);
|
||||
}
|
||||
}
|
||||
const run = async (stream, cb, onError) => {
|
||||
try {
|
||||
await cb(stream);
|
||||
} catch (e) {
|
||||
if (e instanceof Error && onError) {
|
||||
await onError(e, stream);
|
||||
await stream.writeSSE({
|
||||
event: "error",
|
||||
data: e.message
|
||||
});
|
||||
} else {
|
||||
console.error(e);
|
||||
}
|
||||
} finally {
|
||||
stream.close();
|
||||
}
|
||||
};
|
||||
const contextStash = /* @__PURE__ */ new WeakMap();
|
||||
const streamSSE = (c, cb, onError) => {
|
||||
const { readable, writable } = new TransformStream();
|
||||
const stream = new SSEStreamingApi(writable, readable);
|
||||
if ((0, import_utils.isOldBunVersion)()) {
|
||||
c.req.raw.signal.addEventListener("abort", () => {
|
||||
if (!stream.closed) {
|
||||
stream.abort();
|
||||
}
|
||||
});
|
||||
}
|
||||
contextStash.set(stream.responseReadable, c);
|
||||
c.header("Transfer-Encoding", "chunked");
|
||||
c.header("Content-Type", "text/event-stream");
|
||||
c.header("Cache-Control", "no-cache");
|
||||
c.header("Connection", "keep-alive");
|
||||
run(stream, cb, onError);
|
||||
return c.newResponse(stream.responseReadable);
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
SSEStreamingApi,
|
||||
streamSSE
|
||||
});
|
||||
57
backend/node_modules/hono/dist/cjs/helper/streaming/stream.js
generated
vendored
Normal file
57
backend/node_modules/hono/dist/cjs/helper/streaming/stream.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var stream_exports = {};
|
||||
__export(stream_exports, {
|
||||
stream: () => stream
|
||||
});
|
||||
module.exports = __toCommonJS(stream_exports);
|
||||
var import_stream = require("../../utils/stream");
|
||||
var import_utils = require("./utils");
|
||||
const contextStash = /* @__PURE__ */ new WeakMap();
|
||||
const stream = (c, cb, onError) => {
|
||||
const { readable, writable } = new TransformStream();
|
||||
const stream2 = new import_stream.StreamingApi(writable, readable);
|
||||
if ((0, import_utils.isOldBunVersion)()) {
|
||||
c.req.raw.signal.addEventListener("abort", () => {
|
||||
if (!stream2.closed) {
|
||||
stream2.abort();
|
||||
}
|
||||
});
|
||||
}
|
||||
contextStash.set(stream2.responseReadable, c);
|
||||
(async () => {
|
||||
try {
|
||||
await cb(stream2);
|
||||
} catch (e) {
|
||||
if (e === void 0) {
|
||||
} else if (e instanceof Error && onError) {
|
||||
await onError(e, stream2);
|
||||
} else {
|
||||
console.error(e);
|
||||
}
|
||||
} finally {
|
||||
stream2.close();
|
||||
}
|
||||
})();
|
||||
return c.newResponse(stream2.responseReadable);
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
stream
|
||||
});
|
||||
35
backend/node_modules/hono/dist/cjs/helper/streaming/text.js
generated
vendored
Normal file
35
backend/node_modules/hono/dist/cjs/helper/streaming/text.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var text_exports = {};
|
||||
__export(text_exports, {
|
||||
streamText: () => streamText
|
||||
});
|
||||
module.exports = __toCommonJS(text_exports);
|
||||
var import_context = require("../../context");
|
||||
var import__ = require("./");
|
||||
const streamText = (c, cb, onError) => {
|
||||
c.header("Content-Type", import_context.TEXT_PLAIN);
|
||||
c.header("X-Content-Type-Options", "nosniff");
|
||||
c.header("Transfer-Encoding", "chunked");
|
||||
return (0, import__.stream)(c, cb, onError);
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
streamText
|
||||
});
|
||||
36
backend/node_modules/hono/dist/cjs/helper/streaming/utils.js
generated
vendored
Normal file
36
backend/node_modules/hono/dist/cjs/helper/streaming/utils.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var utils_exports = {};
|
||||
__export(utils_exports, {
|
||||
isOldBunVersion: () => isOldBunVersion
|
||||
});
|
||||
module.exports = __toCommonJS(utils_exports);
|
||||
let isOldBunVersion = () => {
|
||||
const version = typeof Bun !== "undefined" ? Bun.version : void 0;
|
||||
if (version === void 0) {
|
||||
return false;
|
||||
}
|
||||
const result = version.startsWith("1.1") || version.startsWith("1.0") || version.startsWith("0.");
|
||||
isOldBunVersion = () => result;
|
||||
return result;
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
isOldBunVersion
|
||||
});
|
||||
34
backend/node_modules/hono/dist/cjs/helper/testing/index.js
generated
vendored
Normal file
34
backend/node_modules/hono/dist/cjs/helper/testing/index.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var testing_exports = {};
|
||||
__export(testing_exports, {
|
||||
testClient: () => testClient
|
||||
});
|
||||
module.exports = __toCommonJS(testing_exports);
|
||||
var import_client = require("../../client");
|
||||
const testClient = (app, Env, executionCtx, options) => {
|
||||
const customFetch = (input, init) => {
|
||||
return app.request(input, init, Env, executionCtx);
|
||||
};
|
||||
return (0, import_client.hc)("http://localhost", { ...options, fetch: customFetch });
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
testClient
|
||||
});
|
||||
82
backend/node_modules/hono/dist/cjs/helper/websocket/index.js
generated
vendored
Normal file
82
backend/node_modules/hono/dist/cjs/helper/websocket/index.js
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var websocket_exports = {};
|
||||
__export(websocket_exports, {
|
||||
WSContext: () => WSContext,
|
||||
createWSMessageEvent: () => createWSMessageEvent,
|
||||
defineWebSocketHelper: () => defineWebSocketHelper
|
||||
});
|
||||
module.exports = __toCommonJS(websocket_exports);
|
||||
class WSContext {
|
||||
#init;
|
||||
constructor(init) {
|
||||
this.#init = init;
|
||||
this.raw = init.raw;
|
||||
this.url = init.url ? new URL(init.url) : null;
|
||||
this.protocol = init.protocol ?? null;
|
||||
}
|
||||
send(source, options) {
|
||||
this.#init.send(source, options ?? {});
|
||||
}
|
||||
raw;
|
||||
binaryType = "arraybuffer";
|
||||
get readyState() {
|
||||
return this.#init.readyState;
|
||||
}
|
||||
url;
|
||||
protocol;
|
||||
close(code, reason) {
|
||||
this.#init.close(code, reason);
|
||||
}
|
||||
}
|
||||
const createWSMessageEvent = (source) => {
|
||||
return new MessageEvent("message", {
|
||||
data: source
|
||||
});
|
||||
};
|
||||
const defineWebSocketHelper = (handler) => {
|
||||
return ((...args) => {
|
||||
if (typeof args[0] === "function") {
|
||||
const [createEvents, options] = args;
|
||||
return async function upgradeWebSocket(c, next) {
|
||||
const events = await createEvents(c);
|
||||
const result = await handler(c, events, options);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
await next();
|
||||
};
|
||||
} else {
|
||||
const [c, events, options] = args;
|
||||
return (async () => {
|
||||
const upgraded = await handler(c, events, options);
|
||||
if (!upgraded) {
|
||||
throw new Error("Failed to upgrade WebSocket");
|
||||
}
|
||||
return upgraded;
|
||||
})();
|
||||
}
|
||||
});
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
WSContext,
|
||||
createWSMessageEvent,
|
||||
defineWebSocketHelper
|
||||
});
|
||||
Reference in New Issue
Block a user