hono 4.7.8 → 4.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helper/cookie/index.js +1 -1
- package/dist/cjs/helper/ssg/ssg.js +3 -1
- package/dist/cjs/hono-base.js +2 -0
- package/dist/cjs/utils/jwt/jwt.js +1 -1
- package/dist/helper/cookie/index.js +1 -1
- package/dist/helper/ssg/ssg.js +3 -1
- package/dist/hono-base.js +2 -0
- package/dist/types/helper/adapter/index.d.ts +1 -1
- package/dist/types/helper/cookie/index.d.ts +3 -3
- package/dist/utils/jwt/jwt.js +1 -1
- package/package.json +1 -1
|
@@ -105,7 +105,7 @@ const setSignedCookie = async (c, name, value, secret, opt) => {
|
|
|
105
105
|
c.header("set-cookie", cookie, { append: true });
|
|
106
106
|
};
|
|
107
107
|
const deleteCookie = (c, name, opt) => {
|
|
108
|
-
const deletedCookie = getCookie(c, name);
|
|
108
|
+
const deletedCookie = getCookie(c, name, opt?.prefix);
|
|
109
109
|
setCookie(c, name, "", { ...opt, maxAge: 0 });
|
|
110
110
|
return deletedCookie;
|
|
111
111
|
};
|
|
@@ -240,7 +240,9 @@ const toSSG = async (app, fs, options) => {
|
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
242
|
for (const content of getContentGen) {
|
|
243
|
-
savePromises.push(
|
|
243
|
+
savePromises.push(
|
|
244
|
+
saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e)
|
|
245
|
+
);
|
|
244
246
|
}
|
|
245
247
|
})
|
|
246
248
|
);
|
package/dist/cjs/hono-base.js
CHANGED
|
@@ -119,7 +119,7 @@ const verifyFromJwks = async (token, options, init) => {
|
|
|
119
119
|
if (!matchingKey) {
|
|
120
120
|
throw new import_types.JwtTokenInvalid(token);
|
|
121
121
|
}
|
|
122
|
-
return await verify(token, matchingKey, matchingKey.alg);
|
|
122
|
+
return await verify(token, matchingKey, matchingKey.alg || header.alg);
|
|
123
123
|
};
|
|
124
124
|
const decode = (token) => {
|
|
125
125
|
try {
|
|
@@ -79,7 +79,7 @@ var setSignedCookie = async (c, name, value, secret, opt) => {
|
|
|
79
79
|
c.header("set-cookie", cookie, { append: true });
|
|
80
80
|
};
|
|
81
81
|
var deleteCookie = (c, name, opt) => {
|
|
82
|
-
const deletedCookie = getCookie(c, name);
|
|
82
|
+
const deletedCookie = getCookie(c, name, opt?.prefix);
|
|
83
83
|
setCookie(c, name, "", { ...opt, maxAge: 0 });
|
|
84
84
|
return deletedCookie;
|
|
85
85
|
};
|
package/dist/helper/ssg/ssg.js
CHANGED
|
@@ -212,7 +212,9 @@ var toSSG = async (app, fs, options) => {
|
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
for (const content of getContentGen) {
|
|
215
|
-
savePromises.push(
|
|
215
|
+
savePromises.push(
|
|
216
|
+
saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e)
|
|
217
|
+
);
|
|
216
218
|
}
|
|
217
219
|
})
|
|
218
220
|
);
|
package/dist/hono-base.js
CHANGED
|
@@ -6,7 +6,7 @@ import type { Context } from '../../context';
|
|
|
6
6
|
export type Runtime = "node" | "deno" | "bun" | "workerd" | "fastly" | "edge-light" | "other";
|
|
7
7
|
export declare const env: <T extends Record<string, unknown>, C extends Context = Context<{
|
|
8
8
|
Bindings: T;
|
|
9
|
-
}
|
|
9
|
+
}>>(c: T extends Record<string, unknown> ? Context : C, runtime?: Runtime) => T & C["env"];
|
|
10
10
|
export declare const knownUserAgents: Partial<Record<Runtime, string>>;
|
|
11
11
|
export declare const getRuntimeKey: () => Runtime;
|
|
12
12
|
export declare const checkUserAgentEquals: (platform: string) => boolean;
|
|
@@ -7,12 +7,12 @@ import type { Cookie, CookieOptions, CookiePrefixOptions, SignedCookie } from '.
|
|
|
7
7
|
interface GetCookie {
|
|
8
8
|
(c: Context, key: string): string | undefined;
|
|
9
9
|
(c: Context): Cookie;
|
|
10
|
-
(c: Context, key: string, prefixOptions
|
|
10
|
+
(c: Context, key: string, prefixOptions?: CookiePrefixOptions): string | undefined;
|
|
11
11
|
}
|
|
12
12
|
interface GetSignedCookie {
|
|
13
13
|
(c: Context, secret: string | BufferSource, key: string): Promise<string | undefined | false>;
|
|
14
|
-
(c: Context, secret: string): Promise<SignedCookie>;
|
|
15
|
-
(c: Context, secret: string | BufferSource, key: string, prefixOptions
|
|
14
|
+
(c: Context, secret: string | BufferSource): Promise<SignedCookie>;
|
|
15
|
+
(c: Context, secret: string | BufferSource, key: string, prefixOptions?: CookiePrefixOptions): Promise<string | undefined | false>;
|
|
16
16
|
}
|
|
17
17
|
export declare const getCookie: GetCookie;
|
|
18
18
|
export declare const getSignedCookie: GetSignedCookie;
|
package/dist/utils/jwt/jwt.js
CHANGED
|
@@ -100,7 +100,7 @@ var verifyFromJwks = async (token, options, init) => {
|
|
|
100
100
|
if (!matchingKey) {
|
|
101
101
|
throw new JwtTokenInvalid(token);
|
|
102
102
|
}
|
|
103
|
-
return await verify(token, matchingKey, matchingKey.alg);
|
|
103
|
+
return await verify(token, matchingKey, matchingKey.alg || header.alg);
|
|
104
104
|
};
|
|
105
105
|
var decode = (token) => {
|
|
106
106
|
try {
|