@zuplo/cli 6.74.10 → 6.74.14
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/@hono/node-server/README.md +47 -1
- package/node_modules/@hono/node-server/dist/early-hints.cjs +35 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.cts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.mts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.mjs +33 -0
- package/node_modules/@hono/node-server/dist/index.cjs +4 -1
- package/node_modules/@hono/node-server/dist/index.mjs +4 -1
- package/node_modules/@hono/node-server/package.json +14 -1
- package/node_modules/@posthog/core/dist/featureFlagUtils.d.ts +1 -0
- package/node_modules/@posthog/core/dist/featureFlagUtils.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/featureFlagUtils.js +31 -0
- package/node_modules/@posthog/core/dist/featureFlagUtils.mjs +29 -1
- package/node_modules/@posthog/core/dist/index.d.ts +1 -1
- package/node_modules/@posthog/core/dist/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/index.js +9 -0
- package/node_modules/@posthog/core/dist/index.mjs +2 -2
- package/node_modules/@posthog/core/dist/utils/index.d.ts +1 -0
- package/node_modules/@posthog/core/dist/utils/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/index.js +45 -18
- package/node_modules/@posthog/core/dist/utils/index.mjs +1 -0
- package/node_modules/@posthog/core/dist/utils/json-utils.d.ts +6 -0
- package/node_modules/@posthog/core/dist/utils/json-utils.d.ts.map +1 -0
- package/node_modules/@posthog/core/dist/utils/json-utils.js +128 -0
- package/node_modules/@posthog/core/dist/utils/json-utils.mjs +94 -0
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/featureFlagUtils.ts +35 -0
- package/node_modules/@posthog/core/src/index.ts +1 -0
- package/node_modules/@posthog/core/src/utils/index.ts +1 -0
- package/node_modules/@posthog/core/src/utils/json-utils.spec.ts +115 -0
- package/node_modules/@posthog/core/src/utils/json-utils.ts +148 -0
- package/node_modules/@posthog/types/dist/posthog-config.d.ts +25 -1
- package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/posthog.d.ts +4 -0
- package/node_modules/@posthog/types/dist/posthog.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/posthog-config.ts +26 -1
- package/node_modules/@posthog/types/src/posthog.ts +4 -0
- package/node_modules/@zuplo/core/customer.cli.minified.js +254 -254
- package/node_modules/@zuplo/core/index.minified.js +251 -251
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/out/esm/index.js +12 -12
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +2 -2
- package/node_modules/@zuplo/otel/out/esm/{chunk-TXIQ6WNA.js → chunk-AHNBOCFU.js} +1 -1
- package/node_modules/@zuplo/otel/out/esm/index.js +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-SMQPMERU.js → chunk-4CDML74A.js} +2 -2
- package/node_modules/@zuplo/runtime/out/esm/chunk-4POCC75H.js +37 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-4POCC75H.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-CJFLOF27.js +26 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-CJFLOF27.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-2UG5Z76T.js → chunk-RAZK5G27.js} +2 -2
- package/node_modules/@zuplo/runtime/out/esm/{chunk-2EFTGELI.js → chunk-YFAVPQDX.js} +94 -92
- package/node_modules/@zuplo/runtime/out/esm/chunk-YFAVPQDX.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +177 -0
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/express-rate-limit/dist/index.cjs +6 -1
- package/node_modules/express-rate-limit/dist/index.mjs +6 -1
- package/node_modules/express-rate-limit/package.json +6 -6
- package/node_modules/hono/dist/cjs/context.js +28 -13
- package/node_modules/hono/dist/cjs/hono-base.js +3 -2
- package/node_modules/hono/dist/cjs/jsx/base.js +26 -14
- package/node_modules/hono/dist/cjs/jsx/hooks/index.js +2 -2
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +103 -8
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +5 -0
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +9 -4
- package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +9 -4
- package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +90 -0
- package/node_modules/hono/dist/cjs/request.js +6 -8
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +55 -56
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +64 -85
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +13 -5
- package/node_modules/hono/dist/cjs/router.js +1 -1
- package/node_modules/hono/dist/cjs/utils/cookie.js +1 -1
- package/node_modules/hono/dist/cjs/utils/url.js +7 -7
- package/node_modules/hono/dist/context.js +28 -13
- package/node_modules/hono/dist/hono-base.js +3 -2
- package/node_modules/hono/dist/jsx/base.js +26 -14
- package/node_modules/hono/dist/jsx/hooks/index.js +2 -2
- package/node_modules/hono/dist/middleware/cache/index.js +103 -8
- package/node_modules/hono/dist/middleware/compress/index.js +5 -0
- package/node_modules/hono/dist/middleware/cors/index.js +1 -1
- package/node_modules/hono/dist/middleware/etag/index.js +1 -1
- package/node_modules/hono/dist/middleware/jwk/jwk.js +9 -4
- package/node_modules/hono/dist/middleware/jwt/jwt.js +9 -4
- package/node_modules/hono/dist/middleware/method-not-allowed/index.js +68 -0
- package/node_modules/hono/dist/request.js +7 -9
- package/node_modules/hono/dist/router/reg-exp-router/node.js +55 -56
- package/node_modules/hono/dist/router/reg-exp-router/router.js +64 -85
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +13 -5
- package/node_modules/hono/dist/router.js +1 -1
- package/node_modules/hono/dist/types/client/types.d.ts +1 -1
- package/node_modules/hono/dist/types/hono-base.d.ts +4 -3
- package/node_modules/hono/dist/types/jsx/base.d.ts +4 -2
- package/node_modules/hono/dist/types/jsx/dom/index.d.ts +5 -5
- package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/dom/server.d.ts +5 -5
- package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +8 -6
- package/node_modules/hono/dist/types/jsx/index.d.ts +5 -5
- package/node_modules/hono/dist/types/middleware/cache/index.d.ts +6 -4
- package/node_modules/hono/dist/types/middleware/cors/index.d.ts +1 -1
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -2
- package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +49 -0
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +1 -1
- package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +2 -1
- package/node_modules/hono/dist/types/router.d.ts +1 -1
- package/node_modules/hono/dist/types/utils/headers.d.ts +2 -2
- package/node_modules/hono/dist/types/utils/url.d.ts +1 -0
- package/node_modules/hono/dist/utils/cookie.js +2 -2
- package/node_modules/hono/dist/utils/url.js +5 -6
- package/node_modules/hono/package.json +9 -1
- package/node_modules/tar/dist/commonjs/index.min.js +1 -1
- package/node_modules/tar/dist/commonjs/index.min.js.map +3 -3
- package/node_modules/tar/dist/commonjs/list.d.ts.map +1 -1
- package/node_modules/tar/dist/commonjs/list.js +10 -2
- package/node_modules/tar/dist/commonjs/list.js.map +1 -1
- package/node_modules/tar/dist/commonjs/options.d.ts +1 -1
- package/node_modules/tar/dist/commonjs/options.d.ts.map +1 -1
- package/node_modules/tar/dist/commonjs/options.js.map +1 -1
- package/node_modules/tar/dist/esm/index.min.js +2 -2
- package/node_modules/tar/dist/esm/index.min.js.map +3 -3
- package/node_modules/tar/dist/esm/list.d.ts.map +1 -1
- package/node_modules/tar/dist/esm/list.js +10 -2
- package/node_modules/tar/dist/esm/list.js.map +1 -1
- package/node_modules/tar/dist/esm/options.d.ts +1 -1
- package/node_modules/tar/dist/esm/options.d.ts.map +1 -1
- package/node_modules/tar/dist/esm/options.js.map +1 -1
- package/node_modules/tar/package.json +1 -1
- package/node_modules/undici/lib/core/request.js +12 -1
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -2
- package/node_modules/undici/lib/handler/retry-handler.js +34 -0
- package/node_modules/undici/lib/web/cookies/util.js +79 -9
- package/node_modules/undici/package.json +1 -1
- package/package.json +8 -8
- package/node_modules/@zuplo/runtime/out/esm/chunk-2EFTGELI.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-7AMMYBFQ.js +0 -37
- package/node_modules/@zuplo/runtime/out/esm/chunk-7AMMYBFQ.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-ZB7PAWBM.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-ZB7PAWBM.js.map +0 -1
- /package/node_modules/@zuplo/otel/out/esm/{chunk-TXIQ6WNA.js.map → chunk-AHNBOCFU.js.map} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-SMQPMERU.js.map → chunk-4CDML74A.js.map} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-7AMMYBFQ.js.LEGAL.txt → chunk-4POCC75H.js.LEGAL.txt} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-2UG5Z76T.js.map → chunk-RAZK5G27.js.map} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-2EFTGELI.js.LEGAL.txt → chunk-YFAVPQDX.js.LEGAL.txt} +0 -0
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
import type { Context, PropsForRenderer } from '../../context';
|
|
6
6
|
import type { FC, Context as JSXContext, PropsWithChildren } from '../../jsx';
|
|
7
7
|
import type { Env, Input, MiddlewareHandler } from '../../types';
|
|
8
|
-
import type { HtmlEscapedString } from '../../utils/html';
|
|
9
8
|
export declare const RequestContext: JSXContext<Context<any, any, {}> | null>;
|
|
10
9
|
type RendererOptions = {
|
|
11
10
|
docType?: boolean | string;
|
|
12
11
|
stream?: boolean | Record<string, string>;
|
|
13
12
|
};
|
|
13
|
+
type ComponentResult = Exclude<ReturnType<FC>, null>;
|
|
14
14
|
type ComponentWithChildren = (props: PropsWithChildren<PropsForRenderer & {
|
|
15
15
|
Layout: FC;
|
|
16
|
-
}>, c: Context) =>
|
|
16
|
+
}>, c: Context) => ComponentResult;
|
|
17
17
|
/**
|
|
18
18
|
* JSX Renderer Middleware for hono.
|
|
19
19
|
*
|
|
@@ -20,6 +20,7 @@ import type { VerifyOptions } from '../../utils/jwt/jwt';
|
|
|
20
20
|
* @param {boolean} [options.allow_anon] - If set to `true`, the middleware allows requests without a token to proceed without authentication.
|
|
21
21
|
* @param {string} [options.cookie] - If set, the middleware attempts to retrieve the token from a cookie with these options (optionally signed) only if no token is found in the header.
|
|
22
22
|
* @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'.
|
|
23
|
+
* @param {string} [options.realm] - The protection space described by the `realm` parameter of the returned `WWW-Authenticate` challenge header. Defaults to the request URL.
|
|
23
24
|
* @param {AsymmetricAlgorithm[]} options.alg - An array of allowed asymmetric algorithms for JWT verification. Only tokens signed with these algorithms will be accepted.
|
|
24
25
|
* @param {RequestInit} [init] - Optional init options for the `fetch` request when retrieving JWKS from a URI.
|
|
25
26
|
* @param {VerifyOptions} [options.verification] - Additional options for JWK payload verification.
|
|
@@ -50,5 +51,6 @@ export declare const jwk: (options: {
|
|
|
50
51
|
};
|
|
51
52
|
headerName?: string;
|
|
52
53
|
alg: AsymmetricAlgorithm[];
|
|
54
|
+
realm?: string;
|
|
53
55
|
verification?: VerifyOptions;
|
|
54
56
|
}, init?: RequestInit) => MiddlewareHandler;
|
|
@@ -21,6 +21,7 @@ export type JwtVariables<T = any> = {
|
|
|
21
21
|
* @param {string} [options.cookie] - If this value is set, then the value is retrieved from the cookie header using that value as a key, which is then validated as a token.
|
|
22
22
|
* @param {SignatureAlgorithm} options.alg - An algorithm type that is used for verifying (required). Available types are `HS256` | `HS384` | `HS512` | `RS256` | `RS384` | `RS512` | `PS256` | `PS384` | `PS512` | `ES256` | `ES384` | `ES512` | `EdDSA`.
|
|
23
23
|
* @param {string} [options.headerName='Authorization'] - The name of the header to look for the JWT token. Default is 'Authorization'.
|
|
24
|
+
* @param {string} [options.realm] - The protection space described by the `realm` parameter of the returned `WWW-Authenticate` challenge header. Defaults to the request URL.
|
|
24
25
|
* @param {VerifyOptions} [options.verification] - Additional options for JWT payload verification.
|
|
25
26
|
* @returns {MiddlewareHandler} The middleware handler function.
|
|
26
27
|
*
|
|
@@ -51,6 +52,7 @@ export declare const jwt: (options: {
|
|
|
51
52
|
};
|
|
52
53
|
alg: SignatureAlgorithm;
|
|
53
54
|
headerName?: string;
|
|
55
|
+
realm?: string;
|
|
54
56
|
verification?: VerifyOptions;
|
|
55
57
|
}) => MiddlewareHandler;
|
|
56
58
|
export declare const verifyWithJwks: (token: string, options: {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* Method Not Allowed Middleware for Hono.
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '../../context';
|
|
6
|
+
import type { Hono } from '../../hono';
|
|
7
|
+
import type { Env, MiddlewareHandler } from '../../types';
|
|
8
|
+
type MethodNotAllowedHandler<E extends Env> = (c: Context<E>, allowedMethods: string[]) => Response | Promise<Response>;
|
|
9
|
+
type MethodNotAllowedOptions<E extends Env> = {
|
|
10
|
+
app: Hono<E, any, any>;
|
|
11
|
+
onMethodNotAllowed?: MethodNotAllowedHandler<E>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Method Not Allowed Middleware for Hono.
|
|
15
|
+
*
|
|
16
|
+
* Returns a `405 Method Not Allowed` response with an `Allow` header when the request path
|
|
17
|
+
* matches a registered route but the request method is not supported.
|
|
18
|
+
*
|
|
19
|
+
* @param {MethodNotAllowedOptions} options - The options for the middleware.
|
|
20
|
+
* @param {Hono} options.app - The Hono instance used by the application.
|
|
21
|
+
* @param {MethodNotAllowedHandler} [options.onMethodNotAllowed] - Generates the response, including its `Allow` header.
|
|
22
|
+
* @returns {MiddlewareHandler} The middleware handler function.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const app = new Hono()
|
|
27
|
+
*
|
|
28
|
+
* app.use(methodNotAllowed({ app }))
|
|
29
|
+
*
|
|
30
|
+
* app.get('/hello', (c) => c.text('Hello!'))
|
|
31
|
+
* app.post('/hello', (c) => c.text('Posted!'))
|
|
32
|
+
*
|
|
33
|
+
* // PUT /hello -> 405 Method Not Allowed
|
|
34
|
+
* // Allow: GET, HEAD, POST
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* app.use(
|
|
40
|
+
* methodNotAllowed({
|
|
41
|
+
* app,
|
|
42
|
+
* onMethodNotAllowed: (c, methods) =>
|
|
43
|
+
* c.json({ error: 'Method Not Allowed' }, 405, { Allow: methods.join(', ') }),
|
|
44
|
+
* })
|
|
45
|
+
* )
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare const methodNotAllowed: <E extends Env = Env>(options: MethodNotAllowedOptions<E>) => MiddlewareHandler<E>;
|
|
49
|
+
export {};
|
|
@@ -5,6 +5,6 @@ export interface Context {
|
|
|
5
5
|
}
|
|
6
6
|
export declare class Node {
|
|
7
7
|
|
|
8
|
-
insert(tokens: readonly string[], index: number, paramMap: ParamAssocArray, context: Context,
|
|
8
|
+
insert(tokens: readonly string[], index: number, paramMap: ParamAssocArray, context: Context, isStatic: boolean): void;
|
|
9
9
|
buildRegExpStr(): string;
|
|
10
10
|
}
|
|
@@ -2,6 +2,7 @@ import type { ParamAssocArray } from './node';
|
|
|
2
2
|
export type ReplacementMap = number[];
|
|
3
3
|
export declare class Trie {
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
paths: Record<string, [number, ParamAssocArray]>;
|
|
6
|
+
insert(path: string, isStatic: boolean): void;
|
|
6
7
|
buildRegExp(): [RegExp, ReplacementMap, ReplacementMap];
|
|
7
8
|
}
|
|
@@ -13,7 +13,7 @@ export declare const METHOD_NAME_ALL_LOWERCASE: "all";
|
|
|
13
13
|
/**
|
|
14
14
|
* Array of supported HTTP methods.
|
|
15
15
|
*/
|
|
16
|
-
export declare const METHODS: readonly ["get", "post", "put", "delete", "options", "patch"];
|
|
16
|
+
export declare const METHODS: readonly ["get", "post", "put", "delete", "options", "patch", "query"];
|
|
17
17
|
/**
|
|
18
18
|
* Error message indicating that a route cannot be added because the matcher is already built.
|
|
19
19
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module
|
|
3
3
|
* HTTP Headers utility.
|
|
4
4
|
*/
|
|
5
|
-
export type RequestHeader = 'A-IM' | 'Accept' | 'Accept-Additions' | 'Accept-CH' | 'Accept-Charset' | 'Accept-Datetime' | 'Accept-Encoding' | 'Accept-Features' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Ranges' | 'Accept-Signature' | 'Access-Control' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Age' | 'Allow' | 'ALPN' | 'Alt-Svc' | 'Alt-Used' | 'Alternates' | 'AMP-Cache-Transform' | 'Apply-To-Redirect-Ref' | 'Authentication-Control' | 'Authentication-Info' | 'Authorization' | 'Available-Dictionary' | 'C-Ext' | 'C-Man' | 'C-Opt' | 'C-PEP' | 'C-PEP-Info' | 'Cache-Control' | 'Cache-Status' | 'Cal-Managed-ID' | 'CalDAV-Timezones' | 'Capsule-Protocol' | 'CDN-Cache-Control' | 'CDN-Loop' | 'Cert-Not-After' | 'Cert-Not-Before' | 'Clear-Site-Data' | 'Client-Cert' | 'Client-Cert-Chain' | 'Close' | 'CMCD-Object' | 'CMCD-Request' | 'CMCD-Session' | 'CMCD-Status' | 'CMSD-Dynamic' | 'CMSD-Static' | 'Concealed-Auth-Export' | 'Configuration-Context' | 'Connection' | 'Content-Base' | 'Content-Digest' | 'Content-Disposition' | 'Content-Encoding' | 'Content-ID' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-MD5' | 'Content-Range' | 'Content-Script-Type' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Style-Type' | 'Content-Type' | 'Content-Version' | 'Cookie' | 'Cookie2' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Embedder-Policy-Report-Only' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Opener-Policy-Report-Only' | 'Cross-Origin-Resource-Policy' | 'CTA-Common-Access-Token' | 'DASL' | 'Date' | 'DAV' | 'Default-Style' | 'Delta-Base' | 'Deprecation' | 'Depth' | 'Derived-From' | 'Destination' | 'Differential-ID' | 'Dictionary-ID' | 'Digest' | 'DPoP' | 'DPoP-Nonce' | 'Early-Data' | 'EDIINT-Features' | 'ETag' | 'Expect' | 'Expect-CT' | 'Expires' | 'Ext' | 'Forwarded' | 'From' | 'GetProfile' | 'Hobareg' | 'Host' | 'HTTP2-Settings' | 'If' | 'If-Match' | 'If-Modified-Since' | 'If-None-Match' | 'If-Range' | 'If-Schedule-Tag-Match' | 'If-Unmodified-Since' | 'IM' | 'Include-Referred-Token-Binding-ID' | 'Isolation' | 'Keep-Alive' | 'Label' | 'Last-Event-ID' | 'Last-Modified' | 'Link' | 'Link-Template' | 'Location' | 'Lock-Token' | 'Man' | 'Max-Forwards' | 'Memento-Datetime' | 'Meter' | 'Method-Check' | 'Method-Check-Expires' | 'MIME-Version' | 'Negotiate' | 'NEL' | 'OData-EntityId' | 'OData-Isolation' | 'OData-MaxVersion' | 'OData-Version' | 'Opt' | 'Optional-WWW-Authenticate' | 'Ordering-Type' | 'Origin' | 'Origin-Agent-Cluster' | 'OSCORE' | 'OSLC-Core-Version' | 'Overwrite' | 'P3P' | 'PEP' | 'PEP-Info' | 'Permissions-Policy' | 'PICS-Label' | 'Ping-From' | 'Ping-To' | 'Position' | 'Pragma' | 'Prefer' | 'Preference-Applied' | 'Priority' | 'ProfileObject' | 'Protocol' | 'Protocol-Info' | 'Protocol-Query' | 'Protocol-Request' | 'Proxy-Authenticate' | 'Proxy-Authentication-Info' | 'Proxy-Authorization' | 'Proxy-Features' | 'Proxy-Instruction' | 'Proxy-Status' | 'Public' | 'Public-Key-Pins' | 'Public-Key-Pins-Report-Only' | 'Range' | 'Redirect-Ref' | 'Referer' | 'Referer-Root' | 'Referrer-Policy' | 'Refresh' | 'Repeatability-Client-ID' | 'Repeatability-First-Sent' | 'Repeatability-Request-ID' | 'Repeatability-Result' | 'Replay-Nonce' | 'Reporting-Endpoints' | 'Repr-Digest' | 'Retry-After' | 'Safe' | 'Schedule-Reply' | 'Schedule-Tag' | 'Sec-GPC' | 'Sec-Purpose' | 'Sec-Token-Binding' | 'Sec-WebSocket-Accept' | 'Sec-WebSocket-Extensions' | 'Sec-WebSocket-Key' | 'Sec-WebSocket-Protocol' | 'Sec-WebSocket-Version' | 'Security-Scheme' | 'Server' | 'Server-Timing' | 'Set-Cookie' | 'Set-Cookie2' | 'SetProfile' | 'Signature' | 'Signature-Input' | 'SLUG' | 'SoapAction' | 'Status-URI' | 'Strict-Transport-Security' | 'Sunset' | 'Surrogate-Capability' | 'Surrogate-Control' | 'TCN' | 'TE' | 'Timeout' | 'Timing-Allow-Origin' | 'Topic' | 'Traceparent' | 'Tracestate' | 'Trailer' | 'Transfer-Encoding' | 'TTL' | 'Upgrade' | 'Urgency' | 'URI' | 'Use-As-Dictionary' | 'User-Agent' | 'Variant-Vary' | 'Vary' | 'Via' | 'Want-Content-Digest' | 'Want-Digest' | 'Want-Repr-Digest' | 'Warning' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-Frame-Options';
|
|
6
|
-
export type ResponseHeader = 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Age' | 'Allow' | 'Cache-Control' | 'Clear-Site-Data' | 'Content-Disposition' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Range' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Type' | 'Cookie' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Resource-Policy' | 'Date' | 'ETag' | 'Expires' | 'Last-Modified' | 'Location' | 'Permissions-Policy' | 'Pragma' | 'Retry-After' | 'Save-Data' | 'Sec-CH-Prefers-Color-Scheme' | 'Sec-CH-Prefers-Reduced-Motion' | 'Sec-CH-UA' | 'Sec-CH-UA-Arch' | 'Sec-CH-UA-Bitness' | 'Sec-CH-UA-Form-Factor' | 'Sec-CH-UA-Full-Version' | 'Sec-CH-UA-Full-Version-List' | 'Sec-CH-UA-Mobile' | 'Sec-CH-UA-Model' | 'Sec-CH-UA-Platform' | 'Sec-CH-UA-Platform-Version' | 'Sec-CH-UA-WoW64' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-User' | 'Sec-GPC' | 'Server' | 'Server-Timing' | 'Service-Worker-Navigation-Preload' | 'Set-Cookie' | 'Strict-Transport-Security' | 'Timing-Allow-Origin' | 'Trailer' | 'Transfer-Encoding' | 'Upgrade' | 'Vary' | '
|
|
5
|
+
export type RequestHeader = 'A-IM' | 'Accept' | 'Accept-Additions' | 'Accept-CH' | 'Accept-Charset' | 'Accept-Datetime' | 'Accept-Encoding' | 'Accept-Features' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Query' | 'Accept-Ranges' | 'Accept-Signature' | 'Access-Control' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Activate-Storage-Access' | 'Age' | 'Allow' | 'ALPN' | 'Alt-Svc' | 'Alt-Used' | 'Alternates' | 'AMP-Cache-Transform' | 'Apply-To-Redirect-Ref' | 'Authentication-Control' | 'Authentication-Info' | 'Authorization' | 'Available-Dictionary' | 'C-Ext' | 'C-Man' | 'C-Opt' | 'C-PEP' | 'C-PEP-Info' | 'Cache-Control' | 'Cache-Group-Invalidation' | 'Cache-Groups' | 'Cache-Status' | 'Cal-Managed-ID' | 'CalDAV-Timezones' | 'Capsule-Protocol' | 'CDN-Cache-Control' | 'CDN-Loop' | 'Cert-Not-After' | 'Cert-Not-Before' | 'Clear-Site-Data' | 'Client-Cert' | 'Client-Cert-Chain' | 'Close' | 'CMCD-Object' | 'CMCD-Request' | 'CMCD-Session' | 'CMCD-Status' | 'CMSD-Dynamic' | 'CMSD-Static' | 'Concealed-Auth-Export' | 'Configuration-Context' | 'Connection' | 'Content-Base' | 'Content-Digest' | 'Content-Disposition' | 'Content-Encoding' | 'Content-ID' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-MD5' | 'Content-Range' | 'Content-Script-Type' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Style-Type' | 'Content-Type' | 'Content-Version' | 'Cookie' | 'Cookie2' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Embedder-Policy-Report-Only' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Opener-Policy-Report-Only' | 'Cross-Origin-Resource-Policy' | 'CTA-Common-Access-Token' | 'DASL' | 'Date' | 'DAV' | 'Default-Style' | 'Delta-Base' | 'Deprecation' | 'Depth' | 'Derived-From' | 'Destination' | 'Detached-JWS' | 'Differential-ID' | 'Dictionary-ID' | 'Digest' | 'DPoP' | 'DPoP-Nonce' | 'Early-Data' | 'EDIINT-Features' | 'ETag' | 'Expect' | 'Expect-CT' | 'Expires' | 'Ext' | 'Forwarded' | 'From' | 'GetProfile' | 'Hobareg' | 'Host' | 'HTTP2-Settings' | 'If' | 'If-Match' | 'If-Modified-Since' | 'If-None-Match' | 'If-Range' | 'If-Schedule-Tag-Match' | 'If-Unmodified-Since' | 'IM' | 'Include-Referred-Token-Binding-ID' | 'Incremental' | 'Isolation' | 'Keep-Alive' | 'Label' | 'Last-Event-ID' | 'Last-Modified' | 'Link' | 'Link-Template' | 'Location' | 'Lock-Token' | 'Man' | 'Max-Forwards' | 'Memento-Datetime' | 'Meter' | 'Method-Check' | 'Method-Check-Expires' | 'MIME-Version' | 'Negotiate' | 'NEL' | 'OData-EntityId' | 'OData-Isolation' | 'OData-MaxVersion' | 'OData-Version' | 'Opt' | 'Optional-WWW-Authenticate' | 'Ordering-Type' | 'Origin' | 'Origin-Agent-Cluster' | 'OSCORE' | 'OSLC-Core-Version' | 'Overwrite' | 'P3P' | 'PEP' | 'PEP-Info' | 'Permissions-Policy' | 'PICS-Label' | 'Ping-From' | 'Ping-To' | 'Position' | 'Pragma' | 'Prefer' | 'Preference-Applied' | 'Priority' | 'ProfileObject' | 'Protocol' | 'Protocol-Info' | 'Protocol-Query' | 'Protocol-Request' | 'Proxy-Authenticate' | 'Proxy-Authentication-Info' | 'Proxy-Authorization' | 'Proxy-Features' | 'Proxy-Instruction' | 'Proxy-Status' | 'Public' | 'Public-Key-Pins' | 'Public-Key-Pins-Report-Only' | 'Range' | 'Redirect-Ref' | 'Referer' | 'Referer-Root' | 'Referrer-Policy' | 'Refresh' | 'Repeatability-Client-ID' | 'Repeatability-First-Sent' | 'Repeatability-Request-ID' | 'Repeatability-Result' | 'Replay-Nonce' | 'Reporting-Endpoints' | 'Repr-Digest' | 'Retry-After' | 'Safe' | 'Schedule-Reply' | 'Schedule-Tag' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-Storage-Access' | 'Sec-Fetch-User' | 'Sec-GPC' | 'Sec-Purpose' | 'Sec-Token-Binding' | 'Sec-WebSocket-Accept' | 'Sec-WebSocket-Extensions' | 'Sec-WebSocket-Key' | 'Sec-WebSocket-Protocol' | 'Sec-WebSocket-Version' | 'Security-Scheme' | 'Server' | 'Server-Timing' | 'Set-Cookie' | 'Set-Cookie2' | 'Set-Txn' | 'SetProfile' | 'Signature' | 'Signature-Input' | 'SLUG' | 'SoapAction' | 'Status-URI' | 'Strict-Transport-Security' | 'Sunset' | 'Surrogate-Capability' | 'Surrogate-Control' | 'TCN' | 'TE' | 'Timeout' | 'Timing-Allow-Origin' | 'Topic' | 'Traceparent' | 'Tracestate' | 'Trailer' | 'Transfer-Encoding' | 'TTL' | 'Unencoded-Digest' | 'Upgrade' | 'Urgency' | 'URI' | 'Use-As-Dictionary' | 'User-Agent' | 'Variant-Vary' | 'Vary' | 'Via' | 'Want-Content-Digest' | 'Want-Digest' | 'Want-Repr-Digest' | 'Want-Unencoded-Digest' | 'Warning' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-Frame-Options';
|
|
6
|
+
export type ResponseHeader = 'Accept-Query' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Activate-Storage-Access' | 'Age' | 'Allow' | 'Cache-Control' | 'Cache-Group-Invalidation' | 'Cache-Groups' | 'Clear-Site-Data' | 'Content-Disposition' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Range' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Type' | 'Cookie' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Resource-Policy' | 'Date' | 'ETag' | 'Expires' | 'Incremental' | 'Last-Modified' | 'Location' | 'Permissions-Policy' | 'Pragma' | 'Retry-After' | 'Save-Data' | 'Sec-CH-Prefers-Color-Scheme' | 'Sec-CH-Prefers-Reduced-Motion' | 'Sec-CH-UA' | 'Sec-CH-UA-Arch' | 'Sec-CH-UA-Bitness' | 'Sec-CH-UA-Form-Factor' | 'Sec-CH-UA-Full-Version' | 'Sec-CH-UA-Full-Version-List' | 'Sec-CH-UA-Mobile' | 'Sec-CH-UA-Model' | 'Sec-CH-UA-Platform' | 'Sec-CH-UA-Platform-Version' | 'Sec-CH-UA-WoW64' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-User' | 'Sec-GPC' | 'Server' | 'Server-Timing' | 'Service-Worker-Navigation-Preload' | 'Set-Cookie' | 'Set-Txn' | 'Strict-Transport-Security' | 'Timing-Allow-Origin' | 'Trailer' | 'Transfer-Encoding' | 'Unencoded-Digest' | 'Upgrade' | 'Vary' | 'Want-Unencoded-Digest' | 'Warning' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-DNS-Prefetch-Control' | 'X-Frame-Options' | 'X-Permitted-Cross-Domain-Policies' | 'X-Powered-By' | 'X-Robots-Tag' | 'X-XSS-Protection';
|
|
7
7
|
export type AcceptHeader = 'Accept' | 'Accept-Charset' | 'Accept-Encoding' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Ranges';
|
|
8
8
|
export type CustomHeader = string & {};
|
|
@@ -33,6 +33,7 @@ export declare const getPathNoStrict: (request: Request) => string;
|
|
|
33
33
|
*/
|
|
34
34
|
export declare const mergePath: (...paths: string[]) => string;
|
|
35
35
|
export declare const checkOptionalParameter: (path: string) => string[] | null;
|
|
36
|
+
export declare const tryDecodeURIComponent: (str: string) => string;
|
|
36
37
|
export declare const getQueryParam: (url: string, key?: string) => string | undefined | Record<string, string>;
|
|
37
38
|
export declare const getQueryParams: (url: string, key?: string) => string[] | undefined | Record<string, string[]>;
|
|
38
39
|
export declare const decodeURIComponent_: typeof decodeURIComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/utils/cookie.ts
|
|
2
|
-
import {
|
|
2
|
+
import { tryDecodeURIComponent } from "./url.js";
|
|
3
3
|
var algorithm = { name: "HMAC", hash: "SHA-256" };
|
|
4
4
|
var getCryptoKey = async (secret) => {
|
|
5
5
|
const secretBuf = typeof secret === "string" ? new TextEncoder().encode(secret) : secret;
|
|
@@ -64,7 +64,7 @@ var parse = (cookie, name) => {
|
|
|
64
64
|
cookieValue = cookieValue.slice(1, -1);
|
|
65
65
|
}
|
|
66
66
|
if (validCookieValueRegEx.test(cookieValue)) {
|
|
67
|
-
parsedCookie[cookieName] =
|
|
67
|
+
parsedCookie[cookieName] = tryDecodeURIComponent(cookieValue);
|
|
68
68
|
if (name) {
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
@@ -124,18 +124,16 @@ var checkOptionalParameter = (path) => {
|
|
|
124
124
|
});
|
|
125
125
|
return results.filter((v, i, a) => a.indexOf(v) === i);
|
|
126
126
|
};
|
|
127
|
+
var tryDecodeURIComponent = (str) => str.indexOf("%") !== -1 ? tryDecode(str, decodeURIComponent_) : str;
|
|
127
128
|
var _decodeURI = (value) => {
|
|
128
|
-
if (!/[%+]/.test(value)) {
|
|
129
|
-
return value;
|
|
130
|
-
}
|
|
131
129
|
if (value.indexOf("+") !== -1) {
|
|
132
130
|
value = value.replace(/\+/g, " ");
|
|
133
131
|
}
|
|
134
|
-
return
|
|
132
|
+
return tryDecodeURIComponent(value);
|
|
135
133
|
};
|
|
136
134
|
var _getQueryParam = (url, key, multiple) => {
|
|
137
135
|
let encoded;
|
|
138
|
-
if (!multiple && key &&
|
|
136
|
+
if (!multiple && key && key.indexOf("%") === -1 && key.indexOf("+") === -1) {
|
|
139
137
|
let keyIndex2 = url.indexOf("?", 8);
|
|
140
138
|
if (keyIndex2 === -1) {
|
|
141
139
|
return void 0;
|
|
@@ -218,5 +216,6 @@ export {
|
|
|
218
216
|
splitPath,
|
|
219
217
|
splitRoutingPath,
|
|
220
218
|
tryDecode,
|
|
221
|
-
tryDecodeURI
|
|
219
|
+
tryDecodeURI,
|
|
220
|
+
tryDecodeURIComponent
|
|
222
221
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hono",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"description": "Web framework built on Web Standards",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -231,6 +231,11 @@
|
|
|
231
231
|
"import": "./dist/middleware/logger/index.js",
|
|
232
232
|
"require": "./dist/cjs/middleware/logger/index.js"
|
|
233
233
|
},
|
|
234
|
+
"./method-not-allowed": {
|
|
235
|
+
"types": "./dist/types/middleware/method-not-allowed/index.d.ts",
|
|
236
|
+
"import": "./dist/middleware/method-not-allowed/index.js",
|
|
237
|
+
"require": "./dist/cjs/middleware/method-not-allowed/index.js"
|
|
238
|
+
},
|
|
234
239
|
"./method-override": {
|
|
235
240
|
"types": "./dist/types/middleware/method-override/index.d.ts",
|
|
236
241
|
"import": "./dist/middleware/method-override/index.js",
|
|
@@ -528,6 +533,9 @@
|
|
|
528
533
|
"logger": [
|
|
529
534
|
"./dist/types/middleware/logger"
|
|
530
535
|
],
|
|
536
|
+
"method-not-allowed": [
|
|
537
|
+
"./dist/types/middleware/method-not-allowed"
|
|
538
|
+
],
|
|
531
539
|
"method-override": [
|
|
532
540
|
"./dist/types/middleware/method-override"
|
|
533
541
|
],
|