@zuplo/cli 6.70.66 → 6.70.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@fastify/reply-from/node_modules/undici/lib/global.js +1 -1
- package/node_modules/@fastify/reply-from/node_modules/undici/package.json +1 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-O5I2ETU3.js +356 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-O5I2ETU3.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +9 -9
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/language/language.js +10 -32
- package/node_modules/hono/dist/cjs/middleware/timing/timing.js +3 -1
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +6 -1
- package/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
- package/node_modules/hono/dist/middleware/language/language.js +10 -32
- package/node_modules/hono/dist/middleware/timing/timing.js +3 -1
- package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +1 -1
- package/node_modules/hono/dist/utils/ipaddr.js +6 -1
- package/node_modules/hono/package.json +18 -10
- package/package.json +6 -6
- package/node_modules/@zuplo/runtime/out/esm/chunk-WDGKR433.js +0 -370
- package/node_modules/@zuplo/runtime/out/esm/chunk-WDGKR433.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-WDGKR433.js.LEGAL.txt → chunk-O5I2ETU3.js.LEGAL.txt} +0 -0
|
@@ -27,7 +27,7 @@ const PREFIX = "Bearer";
|
|
|
27
27
|
const HEADER = "Authorization";
|
|
28
28
|
const bearerAuth = (options) => {
|
|
29
29
|
if (!("token" in options || "verifyToken" in options)) {
|
|
30
|
-
throw new Error('bearer auth middleware requires options for "token"');
|
|
30
|
+
throw new Error('bearer auth middleware requires options for "token" or "verifyToken"');
|
|
31
31
|
}
|
|
32
32
|
if (!options.realm) {
|
|
33
33
|
options.realm = "";
|
|
@@ -83,20 +83,12 @@ const normalizeLanguage = (lang, options) => {
|
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
const detectFromQuery = (c, options) => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return normalizeLanguage(query, options);
|
|
89
|
-
} catch {
|
|
90
|
-
return void 0;
|
|
91
|
-
}
|
|
86
|
+
const query = c.req.query(options.lookupQueryString);
|
|
87
|
+
return normalizeLanguage(query, options);
|
|
92
88
|
};
|
|
93
89
|
const detectFromCookie = (c, options) => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return normalizeLanguage(cookie, options);
|
|
97
|
-
} catch {
|
|
98
|
-
return void 0;
|
|
99
|
-
}
|
|
90
|
+
const cookie = (0, import_cookie.getCookie)(c, options.lookupCookie);
|
|
91
|
+
return normalizeLanguage(cookie, options);
|
|
100
92
|
};
|
|
101
93
|
function detectFromHeader(c, options) {
|
|
102
94
|
try {
|
|
@@ -117,14 +109,10 @@ function detectFromHeader(c, options) {
|
|
|
117
109
|
}
|
|
118
110
|
}
|
|
119
111
|
function detectFromPath(c, options) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return normalizeLanguage(langSegment, options);
|
|
125
|
-
} catch {
|
|
126
|
-
return void 0;
|
|
127
|
-
}
|
|
112
|
+
const url = new URL(c.req.url);
|
|
113
|
+
const pathSegments = url.pathname.split("/").filter(Boolean);
|
|
114
|
+
const langSegment = pathSegments[options.lookupFromPathIndex];
|
|
115
|
+
return normalizeLanguage(langSegment, options);
|
|
128
116
|
}
|
|
129
117
|
const detectors = {
|
|
130
118
|
querystring: detectFromQuery,
|
|
@@ -159,9 +147,6 @@ const detectLanguage = (c, options) => {
|
|
|
159
147
|
let detectedLang;
|
|
160
148
|
for (const detectorName of options.order) {
|
|
161
149
|
const detector = detectors[detectorName];
|
|
162
|
-
if (!detector) {
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
150
|
try {
|
|
166
151
|
detectedLang = detector(c, options);
|
|
167
152
|
if (detectedLang) {
|
|
@@ -194,15 +179,8 @@ const languageDetector = (userOptions) => {
|
|
|
194
179
|
};
|
|
195
180
|
validateOptions(options);
|
|
196
181
|
return async function languageDetector2(ctx, next) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
ctx.set("language", lang);
|
|
200
|
-
} catch (error) {
|
|
201
|
-
if (options.debug) {
|
|
202
|
-
console.error("Language detection failed:", error);
|
|
203
|
-
}
|
|
204
|
-
ctx.set("language", options.fallbackLanguage);
|
|
205
|
-
}
|
|
182
|
+
const lang = detectLanguage(ctx, options);
|
|
183
|
+
ctx.set("language", lang);
|
|
206
184
|
await next();
|
|
207
185
|
};
|
|
208
186
|
};
|
|
@@ -56,7 +56,9 @@ const timing = (config) => {
|
|
|
56
56
|
endTime(c, "total");
|
|
57
57
|
}
|
|
58
58
|
if (options.autoEnd) {
|
|
59
|
-
timers.forEach((_, key) =>
|
|
59
|
+
timers.forEach((_, key) => {
|
|
60
|
+
endTime(c, key);
|
|
61
|
+
});
|
|
60
62
|
}
|
|
61
63
|
const enabled = typeof options.enabled === "function" ? options.enabled(c) : options.enabled;
|
|
62
64
|
if (enabled) {
|
|
@@ -43,7 +43,9 @@ const expandIPv6 = (ipV6) => {
|
|
|
43
43
|
if (node !== "") {
|
|
44
44
|
sections[i] = node.padStart(4, "0");
|
|
45
45
|
} else {
|
|
46
|
-
sections[i + 1] === ""
|
|
46
|
+
while (sections[i + 1] === "") {
|
|
47
|
+
sections.splice(i + 1, 1);
|
|
48
|
+
}
|
|
47
49
|
sections[i] = new Array(8 - sections.length + 1).fill("0000").join(":");
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -263,6 +265,9 @@ const convertIPv4BinaryToString = (ipV4) => {
|
|
|
263
265
|
const isIPv4MappedIPv6 = (ipv6binary) => ipv6binary >> 32n === 0xffffn;
|
|
264
266
|
const convertIPv4MappedIPv6ToIPv4 = (ipv6binary) => ipv6binary & 0xffffffffn;
|
|
265
267
|
const convertIPv6BinaryToString = (ipV6) => {
|
|
268
|
+
if (ipV6 === 0n) {
|
|
269
|
+
return "::";
|
|
270
|
+
}
|
|
266
271
|
if (isIPv4MappedIPv6(ipV6)) {
|
|
267
272
|
return `::ffff:${convertIPv4BinaryToString(convertIPv4MappedIPv6ToIPv4(ipV6))}`;
|
|
268
273
|
}
|
|
@@ -6,7 +6,7 @@ var PREFIX = "Bearer";
|
|
|
6
6
|
var HEADER = "Authorization";
|
|
7
7
|
var bearerAuth = (options) => {
|
|
8
8
|
if (!("token" in options || "verifyToken" in options)) {
|
|
9
|
-
throw new Error('bearer auth middleware requires options for "token"');
|
|
9
|
+
throw new Error('bearer auth middleware requires options for "token" or "verifyToken"');
|
|
10
10
|
}
|
|
11
11
|
if (!options.realm) {
|
|
12
12
|
options.realm = "";
|
|
@@ -53,20 +53,12 @@ var normalizeLanguage = (lang, options) => {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
var detectFromQuery = (c, options) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return normalizeLanguage(query, options);
|
|
59
|
-
} catch {
|
|
60
|
-
return void 0;
|
|
61
|
-
}
|
|
56
|
+
const query = c.req.query(options.lookupQueryString);
|
|
57
|
+
return normalizeLanguage(query, options);
|
|
62
58
|
};
|
|
63
59
|
var detectFromCookie = (c, options) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return normalizeLanguage(cookie, options);
|
|
67
|
-
} catch {
|
|
68
|
-
return void 0;
|
|
69
|
-
}
|
|
60
|
+
const cookie = getCookie(c, options.lookupCookie);
|
|
61
|
+
return normalizeLanguage(cookie, options);
|
|
70
62
|
};
|
|
71
63
|
function detectFromHeader(c, options) {
|
|
72
64
|
try {
|
|
@@ -87,14 +79,10 @@ function detectFromHeader(c, options) {
|
|
|
87
79
|
}
|
|
88
80
|
}
|
|
89
81
|
function detectFromPath(c, options) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return normalizeLanguage(langSegment, options);
|
|
95
|
-
} catch {
|
|
96
|
-
return void 0;
|
|
97
|
-
}
|
|
82
|
+
const url = new URL(c.req.url);
|
|
83
|
+
const pathSegments = url.pathname.split("/").filter(Boolean);
|
|
84
|
+
const langSegment = pathSegments[options.lookupFromPathIndex];
|
|
85
|
+
return normalizeLanguage(langSegment, options);
|
|
98
86
|
}
|
|
99
87
|
var detectors = {
|
|
100
88
|
querystring: detectFromQuery,
|
|
@@ -129,9 +117,6 @@ var detectLanguage = (c, options) => {
|
|
|
129
117
|
let detectedLang;
|
|
130
118
|
for (const detectorName of options.order) {
|
|
131
119
|
const detector = detectors[detectorName];
|
|
132
|
-
if (!detector) {
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
120
|
try {
|
|
136
121
|
detectedLang = detector(c, options);
|
|
137
122
|
if (detectedLang) {
|
|
@@ -164,15 +149,8 @@ var languageDetector = (userOptions) => {
|
|
|
164
149
|
};
|
|
165
150
|
validateOptions(options);
|
|
166
151
|
return async function languageDetector2(ctx, next) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
ctx.set("language", lang);
|
|
170
|
-
} catch (error) {
|
|
171
|
-
if (options.debug) {
|
|
172
|
-
console.error("Language detection failed:", error);
|
|
173
|
-
}
|
|
174
|
-
ctx.set("language", options.fallbackLanguage);
|
|
175
|
-
}
|
|
152
|
+
const lang = detectLanguage(ctx, options);
|
|
153
|
+
ctx.set("language", lang);
|
|
176
154
|
await next();
|
|
177
155
|
};
|
|
178
156
|
};
|
|
@@ -31,7 +31,9 @@ var timing = (config) => {
|
|
|
31
31
|
endTime(c, "total");
|
|
32
32
|
}
|
|
33
33
|
if (options.autoEnd) {
|
|
34
|
-
timers.forEach((_, key) =>
|
|
34
|
+
timers.forEach((_, key) => {
|
|
35
|
+
endTime(c, key);
|
|
36
|
+
});
|
|
35
37
|
}
|
|
36
38
|
const enabled = typeof options.enabled === "function" ? options.enabled(c) : options.enabled;
|
|
37
39
|
if (enabled) {
|