@shware/http 2.11.4 → 2.12.0
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/_virtual/_rolldown/runtime.cjs +13 -0
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/cache/index.cjs +5 -30
- package/dist/cache/index.cjs.map +1 -1
- package/dist/cache/index.d.cts +7 -5
- package/dist/cache/index.d.cts.map +1 -0
- package/dist/cache/index.d.mts +11 -0
- package/dist/cache/index.d.mts.map +1 -0
- package/dist/cache/index.mjs +5 -6
- package/dist/cache/index.mjs.map +1 -1
- package/dist/error/detail.cjs +100 -90
- package/dist/error/detail.cjs.map +1 -1
- package/dist/error/detail.d.cts +77 -78
- package/dist/error/detail.d.cts.map +1 -0
- package/dist/error/detail.d.mts +108 -0
- package/dist/error/detail.d.mts.map +1 -0
- package/dist/error/detail.mjs +99 -65
- package/dist/error/detail.mjs.map +1 -1
- package/dist/error/i18n/en-us.cjs +5 -29
- package/dist/error/i18n/en-us.cjs.map +1 -1
- package/dist/error/i18n/en-us.d.cts +3 -1
- package/dist/error/i18n/en-us.d.cts.map +1 -0
- package/dist/error/i18n/en-us.d.mts +5 -0
- package/dist/error/i18n/en-us.d.mts.map +1 -0
- package/dist/error/i18n/en-us.mjs +5 -5
- package/dist/error/i18n/en-us.mjs.map +1 -1
- package/dist/error/index.cjs +29 -56
- package/dist/error/index.cjs.map +1 -1
- package/dist/error/index.d.cts +12 -10
- package/dist/error/index.d.cts.map +1 -0
- package/dist/error/index.d.mts +21 -0
- package/dist/error/index.d.mts.map +1 -0
- package/dist/error/index.mjs +25 -28
- package/dist/error/index.mjs.map +1 -1
- package/dist/error/parse.cjs +63 -61
- package/dist/error/parse.cjs.map +1 -1
- package/dist/error/parse.d.cts +8 -7
- package/dist/error/parse.d.cts.map +1 -0
- package/dist/error/{parse.d.ts → parse.d.mts} +8 -7
- package/dist/error/parse.d.mts.map +1 -0
- package/dist/error/parse.mjs +59 -33
- package/dist/error/parse.mjs.map +1 -1
- package/dist/error/reason.cjs +0 -19
- package/dist/error/reason.d.cts +5 -4
- package/dist/error/reason.d.cts.map +1 -0
- package/dist/error/reason.d.mts +6 -0
- package/dist/error/reason.d.mts.map +1 -0
- package/dist/error/reason.mjs +1 -1
- package/dist/error/status.cjs +103 -256
- package/dist/error/status.cjs.map +1 -1
- package/dist/error/status.d.cts +58 -58
- package/dist/error/status.d.cts.map +1 -0
- package/dist/error/status.d.mts +69 -0
- package/dist/error/status.d.mts.map +1 -0
- package/dist/error/status.mjs +98 -227
- package/dist/error/status.mjs.map +1 -1
- package/dist/google-one-tap/index.cjs +135 -138
- package/dist/google-one-tap/index.cjs.map +1 -1
- package/dist/google-one-tap/index.d.cts +49 -48
- package/dist/google-one-tap/index.d.cts.map +1 -0
- package/dist/google-one-tap/index.d.mts +82 -0
- package/dist/google-one-tap/index.d.mts.map +1 -0
- package/dist/google-one-tap/index.mjs +133 -112
- package/dist/google-one-tap/index.mjs.map +1 -1
- package/dist/google-one-tap/types.cjs +0 -19
- package/dist/google-one-tap/types.d.cts +124 -122
- package/dist/google-one-tap/types.d.cts.map +1 -0
- package/dist/google-one-tap/types.d.mts +157 -0
- package/dist/google-one-tap/types.d.mts.map +1 -0
- package/dist/google-one-tap/types.mjs +1 -1
- package/dist/hono/authorizer.cjs +28 -65
- package/dist/hono/authorizer.cjs.map +1 -1
- package/dist/hono/authorizer.d.cts +12 -11
- package/dist/hono/authorizer.d.cts.map +1 -0
- package/dist/hono/authorizer.d.mts +19 -0
- package/dist/hono/authorizer.d.mts.map +1 -0
- package/dist/hono/authorizer.mjs +23 -36
- package/dist/hono/authorizer.mjs.map +1 -1
- package/dist/hono/csrf.cjs +81 -92
- package/dist/hono/csrf.cjs.map +1 -1
- package/dist/hono/csrf.d.cts +46 -45
- package/dist/hono/csrf.d.cts.map +1 -0
- package/dist/hono/csrf.d.mts +76 -0
- package/dist/hono/csrf.d.mts.map +1 -0
- package/dist/hono/csrf.mjs +76 -63
- package/dist/hono/csrf.mjs.map +1 -1
- package/dist/hono/geolocation.cjs +10 -34
- package/dist/hono/geolocation.cjs.map +1 -1
- package/dist/hono/geolocation.d.cts +5 -4
- package/dist/hono/geolocation.d.cts.map +1 -0
- package/dist/hono/geolocation.d.mts +7 -0
- package/dist/hono/geolocation.d.mts.map +1 -0
- package/dist/hono/geolocation.mjs +8 -12
- package/dist/hono/geolocation.mjs.map +1 -1
- package/dist/hono/handler.cjs +37 -61
- package/dist/hono/handler.cjs.map +1 -1
- package/dist/hono/handler.d.cts +26 -25
- package/dist/hono/handler.d.cts.map +1 -0
- package/dist/hono/handler.d.mts +32 -0
- package/dist/hono/handler.d.mts.map +1 -0
- package/dist/hono/handler.mjs +34 -34
- package/dist/hono/handler.mjs.map +1 -1
- package/dist/hono/index.cjs +14 -48
- package/dist/hono/index.d.cts +7 -15
- package/dist/hono/index.d.mts +7 -0
- package/dist/hono/index.mjs +4 -14
- package/dist/hono/rate-limit.cjs +65 -110
- package/dist/hono/rate-limit.cjs.map +1 -1
- package/dist/hono/rate-limit.d.cts +27 -26
- package/dist/hono/rate-limit.d.cts.map +1 -0
- package/dist/hono/rate-limit.d.mts +36 -0
- package/dist/hono/rate-limit.d.mts.map +1 -0
- package/dist/hono/rate-limit.mjs +60 -81
- package/dist/hono/rate-limit.mjs.map +1 -1
- package/dist/hono/validator.cjs +47 -66
- package/dist/hono/validator.cjs.map +1 -1
- package/dist/hono/validator.d.cts +25 -30
- package/dist/hono/validator.d.cts.map +1 -0
- package/dist/hono/validator.d.mts +26 -0
- package/dist/hono/validator.d.mts.map +1 -0
- package/dist/hono/validator.mjs +43 -43
- package/dist/hono/validator.mjs.map +1 -1
- package/dist/index.cjs +39 -95
- package/dist/index.d.cts +12 -14
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +5 -48
- package/dist/iso/iso_3601_1.cjs +1512 -290
- package/dist/iso/iso_3601_1.cjs.map +1 -1
- package/dist/iso/iso_3601_1.d.cts +8 -6
- package/dist/iso/iso_3601_1.d.cts.map +1 -0
- package/dist/iso/iso_3601_1.d.mts +11 -0
- package/dist/iso/iso_3601_1.d.mts.map +1 -0
- package/dist/iso/iso_3601_1.mjs +1511 -265
- package/dist/iso/iso_3601_1.mjs.map +1 -1
- package/dist/max-length/index.cjs +158 -91
- package/dist/max-length/index.cjs.map +1 -1
- package/dist/max-length/index.d.cts +110 -1
- package/dist/max-length/index.d.cts.map +1 -0
- package/dist/{index-BhgdyigB.d.ts → max-length/index.d.mts} +9 -28
- package/dist/max-length/index.d.mts.map +1 -0
- package/dist/max-length/index.mjs +133 -47
- package/dist/max-length/index.mjs.map +1 -1
- package/dist/message.cjs +5 -30
- package/dist/message.cjs.map +1 -1
- package/dist/message.d.cts +3 -1
- package/dist/message.d.cts.map +1 -0
- package/dist/{message.d.ts → message.d.mts} +3 -1
- package/dist/message.d.mts.map +1 -0
- package/dist/message.mjs +5 -6
- package/dist/message.mjs.map +1 -1
- package/dist/polyfills/index.cjs +4 -4
- package/dist/polyfills/index.cjs.map +1 -1
- package/dist/polyfills/index.d.cts +1 -2
- package/dist/polyfills/index.d.mts +1 -0
- package/dist/polyfills/index.mjs +5 -2
- package/dist/polyfills/index.mjs.map +1 -1
- package/dist/response.cjs +191 -208
- package/dist/response.cjs.map +1 -1
- package/dist/response.d.cts +53 -54
- package/dist/response.d.cts.map +1 -0
- package/dist/response.d.mts +82 -0
- package/dist/response.d.mts.map +1 -0
- package/dist/response.mjs +182 -175
- package/dist/response.mjs.map +1 -1
- package/dist/snowflake.cjs +48 -70
- package/dist/snowflake.cjs.map +1 -1
- package/dist/snowflake.d.cts +16 -14
- package/dist/snowflake.d.cts.map +1 -0
- package/dist/snowflake.d.mts +31 -0
- package/dist/snowflake.d.mts.map +1 -0
- package/dist/snowflake.mjs +46 -44
- package/dist/snowflake.mjs.map +1 -1
- package/dist/utils/geolocation.cjs +51 -75
- package/dist/utils/geolocation.cjs.map +1 -1
- package/dist/utils/geolocation.d.cts +14 -12
- package/dist/utils/geolocation.d.cts.map +1 -0
- package/dist/utils/{geolocation.d.ts → geolocation.d.mts} +14 -12
- package/dist/utils/geolocation.d.mts.map +1 -0
- package/dist/utils/geolocation.mjs +47 -47
- package/dist/utils/geolocation.mjs.map +1 -1
- package/dist/utils/google-tag-gateway.cjs +35 -56
- package/dist/utils/google-tag-gateway.cjs.map +1 -1
- package/dist/utils/google-tag-gateway.d.cts +3 -1
- package/dist/utils/google-tag-gateway.d.cts.map +1 -0
- package/dist/utils/{google-tag-gateway.d.ts → google-tag-gateway.d.mts} +3 -1
- package/dist/utils/google-tag-gateway.d.mts.map +1 -0
- package/dist/utils/google-tag-gateway.mjs +33 -30
- package/dist/utils/google-tag-gateway.mjs.map +1 -1
- package/dist/utils/timing.cjs +50 -71
- package/dist/utils/timing.cjs.map +1 -1
- package/dist/utils/timing.d.cts +11 -9
- package/dist/utils/timing.d.cts.map +1 -0
- package/dist/utils/timing.d.mts +15 -0
- package/dist/utils/timing.d.mts.map +1 -0
- package/dist/utils/timing.mjs +49 -46
- package/dist/utils/timing.mjs.map +1 -1
- package/dist/webhook/index.cjs +43 -72
- package/dist/webhook/index.cjs.map +1 -1
- package/dist/webhook/index.d.cts +3 -1
- package/dist/webhook/index.d.cts.map +1 -0
- package/dist/webhook/{index.d.ts → index.d.mts} +3 -1
- package/dist/webhook/index.d.mts.map +1 -0
- package/dist/webhook/index.mjs +41 -46
- package/dist/webhook/index.mjs.map +1 -1
- package/package.json +49 -24
- package/dist/cache/index.d.ts +0 -9
- package/dist/error/detail.d.ts +0 -109
- package/dist/error/i18n/en-us.d.ts +0 -3
- package/dist/error/index.d.ts +0 -19
- package/dist/error/reason.cjs.map +0 -1
- package/dist/error/reason.d.ts +0 -5
- package/dist/error/reason.mjs.map +0 -1
- package/dist/error/status.d.ts +0 -69
- package/dist/google-one-tap/index.d.ts +0 -81
- package/dist/google-one-tap/types.cjs.map +0 -1
- package/dist/google-one-tap/types.d.ts +0 -155
- package/dist/google-one-tap/types.mjs.map +0 -1
- package/dist/hono/authorizer.d.ts +0 -18
- package/dist/hono/csrf.d.ts +0 -75
- package/dist/hono/geolocation.d.ts +0 -6
- package/dist/hono/handler.d.ts +0 -31
- package/dist/hono/index.cjs.map +0 -1
- package/dist/hono/index.d.ts +0 -15
- package/dist/hono/index.mjs.map +0 -1
- package/dist/hono/rate-limit.d.ts +0 -35
- package/dist/hono/validator.d.ts +0 -31
- package/dist/index-BhgdyigB.d.cts +0 -129
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -14
- package/dist/index.mjs.map +0 -1
- package/dist/iso/iso_3601_1.d.ts +0 -9
- package/dist/max-length/index.d.ts +0 -1
- package/dist/polyfills/index.d.ts +0 -2
- package/dist/response.d.ts +0 -83
- package/dist/snowflake.d.ts +0 -29
- package/dist/utils/timing.d.ts +0 -13
package/dist/error/status.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { Detail, Details } from './detail.js';
|
|
2
|
-
import './reason.js';
|
|
3
|
-
|
|
4
|
-
declare const Code: {
|
|
5
|
-
readonly OK: 200;
|
|
6
|
-
readonly CANCELLED: 499;
|
|
7
|
-
readonly UNKNOWN: 500;
|
|
8
|
-
readonly INVALID_ARGUMENT: 400;
|
|
9
|
-
readonly DEADLINE_EXCEEDED: 504;
|
|
10
|
-
readonly NOT_FOUND: 404;
|
|
11
|
-
readonly ALREADY_EXISTS: 409;
|
|
12
|
-
readonly PERMISSION_DENIED: 403;
|
|
13
|
-
readonly RESOURCE_EXHAUSTED: 429;
|
|
14
|
-
readonly FAILED_PRECONDITION: 400;
|
|
15
|
-
readonly ABORTED: 409;
|
|
16
|
-
readonly OUT_OF_RANGE: 400;
|
|
17
|
-
readonly UNIMPLEMENTED: 501;
|
|
18
|
-
readonly INTERNAL: 500;
|
|
19
|
-
readonly UNAVAILABLE: 503;
|
|
20
|
-
readonly DATA_LOSS: 500;
|
|
21
|
-
readonly UNAUTHENTICATED: 401;
|
|
22
|
-
readonly METHOD_NOT_ALLOWED: 405;
|
|
23
|
-
};
|
|
24
|
-
declare const DEFAULT_MESSAGES: Record<keyof typeof Code, string>;
|
|
25
|
-
interface ErrorBody {
|
|
26
|
-
error: {
|
|
27
|
-
code: number;
|
|
28
|
-
status: keyof typeof Code;
|
|
29
|
-
message: string;
|
|
30
|
-
details: Detail[];
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
declare class StatusError extends Error {
|
|
34
|
-
readonly status: number;
|
|
35
|
-
readonly body?: ErrorBody;
|
|
36
|
-
constructor(status: number, body?: ErrorBody);
|
|
37
|
-
}
|
|
38
|
-
declare class StatusCode {
|
|
39
|
-
code: keyof typeof Code;
|
|
40
|
-
message?: string;
|
|
41
|
-
private constructor();
|
|
42
|
-
static of(code: keyof typeof Code, message?: string): StatusCode;
|
|
43
|
-
body(details?: Details): ErrorBody;
|
|
44
|
-
error(details?: Details): Error;
|
|
45
|
-
response(details?: Details): Response;
|
|
46
|
-
}
|
|
47
|
-
declare class Status {
|
|
48
|
-
static adapter?: (status: number, response: ErrorBody) => Error;
|
|
49
|
-
static ok: (message?: string) => StatusCode;
|
|
50
|
-
static cancelled: (message?: string) => StatusCode;
|
|
51
|
-
static unknown: (message?: string) => StatusCode;
|
|
52
|
-
static invalidArgument: (message?: string) => StatusCode;
|
|
53
|
-
static deadlineExceeded: (message?: string) => StatusCode;
|
|
54
|
-
static notFound: (message?: string) => StatusCode;
|
|
55
|
-
static alreadyExists: (message?: string) => StatusCode;
|
|
56
|
-
static permissionDenied: (message?: string) => StatusCode;
|
|
57
|
-
static unauthorized: (message?: string) => StatusCode;
|
|
58
|
-
static resourceExhausted: (message?: string) => StatusCode;
|
|
59
|
-
static failedPrecondition: (message?: string) => StatusCode;
|
|
60
|
-
static aborted: (message?: string) => StatusCode;
|
|
61
|
-
static outOfRange: (message?: string) => StatusCode;
|
|
62
|
-
static unimplemented: (message?: string) => StatusCode;
|
|
63
|
-
static internal: (message?: string) => StatusCode;
|
|
64
|
-
static unavailable: (message?: string) => StatusCode;
|
|
65
|
-
static dataLoss: (message?: string) => StatusCode;
|
|
66
|
-
static methodNotAllowed: (message?: string) => StatusCode;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export { Code, DEFAULT_MESSAGES, type ErrorBody, Status, StatusCode, StatusError };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { GoogleAccounts, CodeResponse, ClientConfigError, PromptMomentNotification, CredentialResponse } from './types.js';
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
interface Window {
|
|
5
|
-
google: {
|
|
6
|
-
accounts: GoogleAccounts;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
type Props = {
|
|
11
|
-
/**
|
|
12
|
-
* Opaque nonce string forwarded as-is to Google. Google echoes it back in
|
|
13
|
-
* the ID Token's `nonce` claim per the OIDC spec; the caller is responsible
|
|
14
|
-
* for any hashing/encoding required by its verifier.
|
|
15
|
-
*/
|
|
16
|
-
nonce?: string;
|
|
17
|
-
client_id: string;
|
|
18
|
-
auto_select?: boolean;
|
|
19
|
-
cancel_on_tap_outside?: boolean;
|
|
20
|
-
use_fedcm_for_prompt?: boolean;
|
|
21
|
-
};
|
|
22
|
-
type PromptMoment = {
|
|
23
|
-
skipped: boolean;
|
|
24
|
-
dismissed: boolean;
|
|
25
|
-
dismissedReason: ReturnType<PromptMomentNotification['getDismissedReason']>;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Why prompt() could not run One Tap, so the caller can decide to fall back
|
|
29
|
-
* to requestCode().
|
|
30
|
-
* - `fedcm_unsupported`: browser has no FedCM (Safari/Firefox/pre-117 Chrome).
|
|
31
|
-
* - `script_load_failed`: the GSI script failed to load (network/CSP).
|
|
32
|
-
* - `prompt_error`: GIS threw synchronously while initializing/prompting.
|
|
33
|
-
*/
|
|
34
|
-
type UnsupportedReason = 'fedcm_unsupported' | 'script_load_failed' | 'prompt_error';
|
|
35
|
-
type PromptResult = {
|
|
36
|
-
authorized: true;
|
|
37
|
-
credential: CredentialResponse;
|
|
38
|
-
} | {
|
|
39
|
-
authorized: false;
|
|
40
|
-
moment: PromptMoment;
|
|
41
|
-
} | {
|
|
42
|
-
authorized: false;
|
|
43
|
-
unsupported: true;
|
|
44
|
-
reason: UnsupportedReason;
|
|
45
|
-
};
|
|
46
|
-
/** debug: chrome://settings/content/federatedIdentityApi */
|
|
47
|
-
declare function prompt({ nonce, client_id, auto_select, use_fedcm_for_prompt, cancel_on_tap_outside, }: Props): Promise<PromptResult>;
|
|
48
|
-
type CodeProps = {
|
|
49
|
-
client_id: string;
|
|
50
|
-
/**
|
|
51
|
-
* Space-delimited OAuth scopes. Defaults to OpenID Connect scopes so the
|
|
52
|
-
* backend can exchange the code for an ID token, mirroring One Tap's intent.
|
|
53
|
-
*/
|
|
54
|
-
scope?: string;
|
|
55
|
-
/** 'popup' resolves the returned promise; 'redirect' navigates away and never resolves. */
|
|
56
|
-
ux_mode?: 'popup' | 'redirect';
|
|
57
|
-
/** Required when ux_mode is 'redirect'; for 'popup' Google uses postMessage. */
|
|
58
|
-
redirect_uri?: string;
|
|
59
|
-
state?: string;
|
|
60
|
-
login_hint?: string;
|
|
61
|
-
hd?: string;
|
|
62
|
-
};
|
|
63
|
-
type CodeResult = {
|
|
64
|
-
ok: true;
|
|
65
|
-
response: CodeResponse;
|
|
66
|
-
} | {
|
|
67
|
-
ok: false;
|
|
68
|
-
error: ClientConfigError | CodeResponse;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* OAuth 2.0 authorization-code fallback for environments where One Tap / FedCM
|
|
72
|
-
* is unavailable (i.e. prompt() resolved with `unsupported: true`). It reuses
|
|
73
|
-
* the same GSI script, so there is no extra dependency.
|
|
74
|
-
*
|
|
75
|
-
* Unlike One Tap it returns an authorization `code` for the backend to
|
|
76
|
-
* exchange, not an ID token, and it must be triggered by a user gesture or the
|
|
77
|
-
* popup may be blocked.
|
|
78
|
-
*/
|
|
79
|
-
declare function requestCode({ client_id, scope, ux_mode, redirect_uri, state, login_hint, hd, }: CodeProps): Promise<CodeResult>;
|
|
80
|
-
|
|
81
|
-
export { type CodeProps, type CodeResult, type PromptMoment, type PromptResult, type Props, type UnsupportedReason, prompt, requestCode };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/google-one-tap/types.ts"],"sourcesContent":["export interface ClientConfigError extends Error {\n message: string;\n stack?: string;\n type: 'unknown' | 'popup_closed' | 'popup_failed_to_open';\n}\n\ninterface OverridableTokenClientConfig {\n scope?: string;\n include_granted_scopes?: boolean;\n prompt?: string;\n enable_granular_consent?: boolean;\n enable_serial_consent?: boolean;\n login_hint?: string;\n hint?: string;\n state?: string;\n}\n\ninterface TokenClient {\n requestAccessToken: (overrideConfig?: OverridableTokenClientConfig) => void;\n}\n\ninterface CodeClient {\n requestCode: () => void;\n}\n\ninterface TokenResponse {\n access_token: string;\n expires_in: string;\n hd: string;\n prompt: string;\n token_type: string;\n scope: string;\n state: string;\n error: string;\n error_description: string;\n error_uri: string;\n}\n\nexport interface CodeResponse {\n code: string;\n scope: string;\n state: string;\n error: string;\n error_description: string;\n error_uri: string;\n}\n\ninterface TokenClientConfig {\n client_id: string;\n scope: string;\n include_granted_scopes?: boolean;\n prompt?: '' | 'none' | 'consent' | 'select_account';\n enable_granular_consent?: boolean;\n enable_serial_consent?: boolean;\n login_hint?: string;\n hint?: string;\n hd?: string;\n hosted_domain?: string;\n state?: string;\n callback: (tokenResponse: TokenResponse) => void;\n error_callback?: (error: ClientConfigError) => void;\n}\n\ninterface CodeClientConfig {\n client_id: string;\n scope: string;\n include_granted_scopes?: boolean;\n redirect_uri?: string;\n state?: string;\n enable_granular_consent?: boolean;\n enable_serial_consent?: boolean;\n login_hint?: string;\n hint?: string;\n hd?: string;\n hosted_domain?: string;\n ux_mode?: 'popup' | 'redirect';\n select_account?: boolean;\n callback?: (response: CodeResponse) => void;\n error_callback?: (error: ClientConfigError) => void;\n}\n\ninterface RevocationResponse {\n successful: boolean;\n error?: string;\n}\n\ninterface Credential {\n id: string;\n password: string;\n}\n\nexport interface CredentialResponse {\n credential: string;\n select_by: string;\n}\n\nexport interface IdConfiguration {\n client_id: string;\n auto_select?: boolean;\n login_uri?: string;\n cancel_on_tap_outside?: boolean;\n prompt_parent_id?: string;\n nonce?: string;\n context?: 'signin' | 'signup' | 'use';\n state_cookie_domain?: string;\n ux_mode?: 'popup' | 'redirect';\n allowed_parent_origin?: string | string[];\n itp_support?: boolean;\n login_hint?: string;\n hd?: string;\n use_fedcm_for_prompt?: boolean;\n callback?: (response: CredentialResponse) => void;\n native_callback?: (response: CredentialResponse) => void;\n intermediate_iframe_close_callback?: () => void;\n}\n/**\n * ref: https://developers.google.com/identity/gsi/web/guides/fedcm-migration?s=dc&utm_source=devtools&utm_campaign=stable#display_moment\n */\nexport interface PromptMomentNotification {\n /** @deprecated */\n isDisplayMoment(): boolean;\n\n /** @deprecated */\n isDisplayed(): boolean;\n\n /** @deprecated */\n isNotDisplayed(): boolean;\n\n /** @deprecated */\n getNotDisplayedReason():\n | 'browser_not_supported'\n | 'invalid_client'\n | 'missing_client_id'\n | 'opt_out_or_no_session'\n | 'secure_http_required'\n | 'suppressed_by_user'\n | 'unregistered_origin'\n | 'unknown_reason';\n\n /** @deprecated */\n getSkippedReason(): 'auto_cancel' | 'user_cancel' | 'tap_outside' | 'issuing_failed';\n\n isSkippedMoment(): boolean;\n isDismissedMoment(): boolean;\n getDismissedReason(): 'credential_returned' | 'cancel_called' | 'flow_restarted';\n getMomentType(): 'display' | 'skipped' | 'dismissed';\n}\n\ninterface GsiButtonConfiguration {\n type: 'standard' | 'icon';\n theme?: 'outline' | 'filled_blue' | 'filled_black';\n size?: 'small' | 'medium' | 'large';\n text?: 'signin_with' | 'signup_with' | 'continue_with' | 'signin';\n shape?: 'rectangular' | 'pill' | 'circle' | 'square';\n logo_alignment?: 'left' | 'center';\n width?: number;\n locale?: string;\n state?: string;\n click_listener?: () => void;\n}\n\nexport interface GoogleAccounts {\n oauth2: {\n initCodeClient(config: CodeClientConfig): CodeClient;\n initTokenClient(config: TokenClientConfig): TokenClient;\n hasGrantedAllScopes(\n tokenResponse: TokenResponse,\n firstScope: string,\n ...restScopes: string[]\n ): boolean;\n hasGrantedAnyScope(\n tokenResponse: TokenResponse,\n firstScope: string,\n ...restScopes: string[]\n ): boolean;\n revoke(accessToken: string, done: () => void): void;\n };\n id: {\n initialize(idConfig: IdConfiguration): void;\n prompt(momentListener?: (promptMomentNotification: PromptMomentNotification) => void): void;\n renderButton(parent: HTMLElement, options: GsiButtonConfiguration): void;\n disableAutoSelect(): void;\n storeCredential(credential: Credential, callback?: () => void): void;\n cancel(): void;\n revoke(hint: string, callback?: (response: RevocationResponse) => void): void;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
interface ClientConfigError extends Error {
|
|
2
|
-
message: string;
|
|
3
|
-
stack?: string;
|
|
4
|
-
type: 'unknown' | 'popup_closed' | 'popup_failed_to_open';
|
|
5
|
-
}
|
|
6
|
-
interface OverridableTokenClientConfig {
|
|
7
|
-
scope?: string;
|
|
8
|
-
include_granted_scopes?: boolean;
|
|
9
|
-
prompt?: string;
|
|
10
|
-
enable_granular_consent?: boolean;
|
|
11
|
-
enable_serial_consent?: boolean;
|
|
12
|
-
login_hint?: string;
|
|
13
|
-
hint?: string;
|
|
14
|
-
state?: string;
|
|
15
|
-
}
|
|
16
|
-
interface TokenClient {
|
|
17
|
-
requestAccessToken: (overrideConfig?: OverridableTokenClientConfig) => void;
|
|
18
|
-
}
|
|
19
|
-
interface CodeClient {
|
|
20
|
-
requestCode: () => void;
|
|
21
|
-
}
|
|
22
|
-
interface TokenResponse {
|
|
23
|
-
access_token: string;
|
|
24
|
-
expires_in: string;
|
|
25
|
-
hd: string;
|
|
26
|
-
prompt: string;
|
|
27
|
-
token_type: string;
|
|
28
|
-
scope: string;
|
|
29
|
-
state: string;
|
|
30
|
-
error: string;
|
|
31
|
-
error_description: string;
|
|
32
|
-
error_uri: string;
|
|
33
|
-
}
|
|
34
|
-
interface CodeResponse {
|
|
35
|
-
code: string;
|
|
36
|
-
scope: string;
|
|
37
|
-
state: string;
|
|
38
|
-
error: string;
|
|
39
|
-
error_description: string;
|
|
40
|
-
error_uri: string;
|
|
41
|
-
}
|
|
42
|
-
interface TokenClientConfig {
|
|
43
|
-
client_id: string;
|
|
44
|
-
scope: string;
|
|
45
|
-
include_granted_scopes?: boolean;
|
|
46
|
-
prompt?: '' | 'none' | 'consent' | 'select_account';
|
|
47
|
-
enable_granular_consent?: boolean;
|
|
48
|
-
enable_serial_consent?: boolean;
|
|
49
|
-
login_hint?: string;
|
|
50
|
-
hint?: string;
|
|
51
|
-
hd?: string;
|
|
52
|
-
hosted_domain?: string;
|
|
53
|
-
state?: string;
|
|
54
|
-
callback: (tokenResponse: TokenResponse) => void;
|
|
55
|
-
error_callback?: (error: ClientConfigError) => void;
|
|
56
|
-
}
|
|
57
|
-
interface CodeClientConfig {
|
|
58
|
-
client_id: string;
|
|
59
|
-
scope: string;
|
|
60
|
-
include_granted_scopes?: boolean;
|
|
61
|
-
redirect_uri?: string;
|
|
62
|
-
state?: string;
|
|
63
|
-
enable_granular_consent?: boolean;
|
|
64
|
-
enable_serial_consent?: boolean;
|
|
65
|
-
login_hint?: string;
|
|
66
|
-
hint?: string;
|
|
67
|
-
hd?: string;
|
|
68
|
-
hosted_domain?: string;
|
|
69
|
-
ux_mode?: 'popup' | 'redirect';
|
|
70
|
-
select_account?: boolean;
|
|
71
|
-
callback?: (response: CodeResponse) => void;
|
|
72
|
-
error_callback?: (error: ClientConfigError) => void;
|
|
73
|
-
}
|
|
74
|
-
interface RevocationResponse {
|
|
75
|
-
successful: boolean;
|
|
76
|
-
error?: string;
|
|
77
|
-
}
|
|
78
|
-
interface Credential {
|
|
79
|
-
id: string;
|
|
80
|
-
password: string;
|
|
81
|
-
}
|
|
82
|
-
interface CredentialResponse {
|
|
83
|
-
credential: string;
|
|
84
|
-
select_by: string;
|
|
85
|
-
}
|
|
86
|
-
interface IdConfiguration {
|
|
87
|
-
client_id: string;
|
|
88
|
-
auto_select?: boolean;
|
|
89
|
-
login_uri?: string;
|
|
90
|
-
cancel_on_tap_outside?: boolean;
|
|
91
|
-
prompt_parent_id?: string;
|
|
92
|
-
nonce?: string;
|
|
93
|
-
context?: 'signin' | 'signup' | 'use';
|
|
94
|
-
state_cookie_domain?: string;
|
|
95
|
-
ux_mode?: 'popup' | 'redirect';
|
|
96
|
-
allowed_parent_origin?: string | string[];
|
|
97
|
-
itp_support?: boolean;
|
|
98
|
-
login_hint?: string;
|
|
99
|
-
hd?: string;
|
|
100
|
-
use_fedcm_for_prompt?: boolean;
|
|
101
|
-
callback?: (response: CredentialResponse) => void;
|
|
102
|
-
native_callback?: (response: CredentialResponse) => void;
|
|
103
|
-
intermediate_iframe_close_callback?: () => void;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* ref: https://developers.google.com/identity/gsi/web/guides/fedcm-migration?s=dc&utm_source=devtools&utm_campaign=stable#display_moment
|
|
107
|
-
*/
|
|
108
|
-
interface PromptMomentNotification {
|
|
109
|
-
/** @deprecated */
|
|
110
|
-
isDisplayMoment(): boolean;
|
|
111
|
-
/** @deprecated */
|
|
112
|
-
isDisplayed(): boolean;
|
|
113
|
-
/** @deprecated */
|
|
114
|
-
isNotDisplayed(): boolean;
|
|
115
|
-
/** @deprecated */
|
|
116
|
-
getNotDisplayedReason(): 'browser_not_supported' | 'invalid_client' | 'missing_client_id' | 'opt_out_or_no_session' | 'secure_http_required' | 'suppressed_by_user' | 'unregistered_origin' | 'unknown_reason';
|
|
117
|
-
/** @deprecated */
|
|
118
|
-
getSkippedReason(): 'auto_cancel' | 'user_cancel' | 'tap_outside' | 'issuing_failed';
|
|
119
|
-
isSkippedMoment(): boolean;
|
|
120
|
-
isDismissedMoment(): boolean;
|
|
121
|
-
getDismissedReason(): 'credential_returned' | 'cancel_called' | 'flow_restarted';
|
|
122
|
-
getMomentType(): 'display' | 'skipped' | 'dismissed';
|
|
123
|
-
}
|
|
124
|
-
interface GsiButtonConfiguration {
|
|
125
|
-
type: 'standard' | 'icon';
|
|
126
|
-
theme?: 'outline' | 'filled_blue' | 'filled_black';
|
|
127
|
-
size?: 'small' | 'medium' | 'large';
|
|
128
|
-
text?: 'signin_with' | 'signup_with' | 'continue_with' | 'signin';
|
|
129
|
-
shape?: 'rectangular' | 'pill' | 'circle' | 'square';
|
|
130
|
-
logo_alignment?: 'left' | 'center';
|
|
131
|
-
width?: number;
|
|
132
|
-
locale?: string;
|
|
133
|
-
state?: string;
|
|
134
|
-
click_listener?: () => void;
|
|
135
|
-
}
|
|
136
|
-
interface GoogleAccounts {
|
|
137
|
-
oauth2: {
|
|
138
|
-
initCodeClient(config: CodeClientConfig): CodeClient;
|
|
139
|
-
initTokenClient(config: TokenClientConfig): TokenClient;
|
|
140
|
-
hasGrantedAllScopes(tokenResponse: TokenResponse, firstScope: string, ...restScopes: string[]): boolean;
|
|
141
|
-
hasGrantedAnyScope(tokenResponse: TokenResponse, firstScope: string, ...restScopes: string[]): boolean;
|
|
142
|
-
revoke(accessToken: string, done: () => void): void;
|
|
143
|
-
};
|
|
144
|
-
id: {
|
|
145
|
-
initialize(idConfig: IdConfiguration): void;
|
|
146
|
-
prompt(momentListener?: (promptMomentNotification: PromptMomentNotification) => void): void;
|
|
147
|
-
renderButton(parent: HTMLElement, options: GsiButtonConfiguration): void;
|
|
148
|
-
disableAutoSelect(): void;
|
|
149
|
-
storeCredential(credential: Credential, callback?: () => void): void;
|
|
150
|
-
cancel(): void;
|
|
151
|
-
revoke(hint: string, callback?: (response: RevocationResponse) => void): void;
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export type { ClientConfigError, CodeResponse, CredentialResponse, GoogleAccounts, IdConfiguration, PromptMomentNotification };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { MiddlewareHandler } from 'hono';
|
|
2
|
-
|
|
3
|
-
type Methods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
4
|
-
type Auth = {
|
|
5
|
-
isAuthenticated: (request: Request) => Promise<boolean>;
|
|
6
|
-
};
|
|
7
|
-
type AuthRule = string | {
|
|
8
|
-
path: string;
|
|
9
|
-
methods?: [Methods, ...Methods[]];
|
|
10
|
-
};
|
|
11
|
-
interface AuthorizerConfig {
|
|
12
|
-
auth: Auth;
|
|
13
|
-
errorMessage?: string;
|
|
14
|
-
rules?: AuthRule[];
|
|
15
|
-
}
|
|
16
|
-
declare function authorizer({ auth, errorMessage, rules, }: AuthorizerConfig): MiddlewareHandler;
|
|
17
|
-
|
|
18
|
-
export { type AuthRule, type AuthorizerConfig, authorizer };
|
package/dist/hono/csrf.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { MiddlewareHandler } from 'hono';
|
|
2
|
-
|
|
3
|
-
type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
4
|
-
type CSRFIgnoreRule = string | {
|
|
5
|
-
path: string;
|
|
6
|
-
methods?: [HTTPMethod, ...HTTPMethod[]];
|
|
7
|
-
};
|
|
8
|
-
interface CSRFConfig {
|
|
9
|
-
/**
|
|
10
|
-
* Cookie name for CSRF token
|
|
11
|
-
* @default 'XSRF-TOKEN'
|
|
12
|
-
*/
|
|
13
|
-
cookieName?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Header name for CSRF token
|
|
16
|
-
* @default 'X-XSRF-TOKEN'
|
|
17
|
-
*/
|
|
18
|
-
headerName?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Ignore rules for specific paths and methods
|
|
21
|
-
* @example
|
|
22
|
-
* [
|
|
23
|
-
* { path: '/api/webhook/*', methods: ['POST'] },
|
|
24
|
-
* { path: '/auth/apple/callback' }, // ignores all methods
|
|
25
|
-
* ]
|
|
26
|
-
*/
|
|
27
|
-
ignores?: CSRFIgnoreRule[];
|
|
28
|
-
/**
|
|
29
|
-
* Skip CSRF check for these methods
|
|
30
|
-
* @default ['GET', 'HEAD', 'OPTIONS']
|
|
31
|
-
*/
|
|
32
|
-
safeMethods?: HTTPMethod[];
|
|
33
|
-
/**
|
|
34
|
-
* Origin allowed to bypass CSRF check
|
|
35
|
-
* @default undefined
|
|
36
|
-
*/
|
|
37
|
-
origin?: string[];
|
|
38
|
-
/**
|
|
39
|
-
* Sec-Fetch-Site allowed to bypass CSRF check
|
|
40
|
-
* @default undefined
|
|
41
|
-
*/
|
|
42
|
-
secFetchSite?: Array<'same-origin' | 'same-site' | 'none' | 'cross-origin'>;
|
|
43
|
-
/**
|
|
44
|
-
* Custom error message
|
|
45
|
-
* @default 'CSRF token validation failed'
|
|
46
|
-
*/
|
|
47
|
-
errorMessage?: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Create CSRF protection middleware
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```ts
|
|
54
|
-
* import { Hono } from 'hono';
|
|
55
|
-
* import { csrf } from '@shware/http/hono';
|
|
56
|
-
*
|
|
57
|
-
* const app = new Hono();
|
|
58
|
-
*
|
|
59
|
-
* // basic usage
|
|
60
|
-
* app.use(csrf());
|
|
61
|
-
*
|
|
62
|
-
* // with configuration
|
|
63
|
-
* app.use(csrf({
|
|
64
|
-
* cookieName: 'csrf-token',
|
|
65
|
-
* headerName: 'X-CSRF-Token',
|
|
66
|
-
* ignores: [
|
|
67
|
-
* { path: '/api/webhook/*', methods: ['POST'] },
|
|
68
|
-
* { path: '/auth/apple/callback' },
|
|
69
|
-
* ]
|
|
70
|
-
* }));
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
declare function csrf(config?: CSRFConfig): MiddlewareHandler;
|
|
74
|
-
|
|
75
|
-
export { type CSRFConfig, type CSRFIgnoreRule, csrf };
|
package/dist/hono/handler.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Context } from 'hono';
|
|
2
|
-
import { RequestIdVariables } from 'hono/request-id';
|
|
3
|
-
import { Bindings, HTTPResponseError } from 'hono/types';
|
|
4
|
-
|
|
5
|
-
type Env = {
|
|
6
|
-
Variables: RequestIdVariables;
|
|
7
|
-
Bindings?: Bindings;
|
|
8
|
-
};
|
|
9
|
-
type AxiosError = {
|
|
10
|
-
code?: string;
|
|
11
|
-
cause?: unknown;
|
|
12
|
-
status?: number;
|
|
13
|
-
message?: string;
|
|
14
|
-
isAxiosError: boolean;
|
|
15
|
-
response?: {
|
|
16
|
-
data: unknown;
|
|
17
|
-
status: number;
|
|
18
|
-
statusText: string;
|
|
19
|
-
headers: Record<string, string>;
|
|
20
|
-
};
|
|
21
|
-
config?: {
|
|
22
|
-
url?: string;
|
|
23
|
-
data?: unknown;
|
|
24
|
-
method?: string;
|
|
25
|
-
headers?: Record<string, string>;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
declare function isAxiosError(payload: unknown): payload is AxiosError;
|
|
29
|
-
declare function errorHandler<E extends Env = never>(error: Error | HTTPResponseError, c: Context<E>): Response | Promise<Response>;
|
|
30
|
-
|
|
31
|
-
export { type Env, errorHandler, isAxiosError };
|
package/dist/hono/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hono/index.ts"],"sourcesContent":["export { zValidator, bigintId } from './validator';\nexport { errorHandler } from './handler';\nexport { geolocation } from './geolocation';\nexport { authorizer, type AuthorizerConfig } from './authorizer';\nexport { csrf, type CSRFConfig, type CSRFIgnoreRule } from './csrf';\nexport { rateLimit, type RateLimitOptions } from './rate-limit';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqC;AACrC,qBAA6B;AAC7B,yBAA4B;AAC5B,wBAAkD;AAClD,kBAA2D;AAC3D,wBAAiD;","names":[]}
|
package/dist/hono/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { bigintId, zValidator } from './validator.js';
|
|
2
|
-
export { errorHandler } from './handler.js';
|
|
3
|
-
export { geolocation } from './geolocation.js';
|
|
4
|
-
export { AuthorizerConfig, authorizer } from './authorizer.js';
|
|
5
|
-
export { CSRFConfig, CSRFIgnoreRule, csrf } from './csrf.js';
|
|
6
|
-
export { RateLimitOptions, rateLimit } from './rate-limit.js';
|
|
7
|
-
import 'zod/mini';
|
|
8
|
-
import 'hono/utils/http-status';
|
|
9
|
-
import 'hono/validator';
|
|
10
|
-
import 'hono/types';
|
|
11
|
-
import 'hono';
|
|
12
|
-
import 'zod/v4/core';
|
|
13
|
-
import 'zod';
|
|
14
|
-
import 'hono/request-id';
|
|
15
|
-
import '../utils/geolocation.js';
|
package/dist/hono/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hono/index.ts"],"sourcesContent":["export { zValidator, bigintId } from './validator';\nexport { errorHandler } from './handler';\nexport { geolocation } from './geolocation';\nexport { authorizer, type AuthorizerConfig } from './authorizer';\nexport { csrf, type CSRFConfig, type CSRFIgnoreRule } from './csrf';\nexport { rateLimit, type RateLimitOptions } from './rate-limit';\n"],"mappings":";AAAA,SAAS,YAAY,gBAAgB;AACrC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,kBAAyC;AAClD,SAAS,YAAkD;AAC3D,SAAS,iBAAwC;","names":[]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Context, MiddlewareHandler } from 'hono';
|
|
2
|
-
|
|
3
|
-
interface KV {
|
|
4
|
-
setItem(key: string, value: string, expiresIn?: number): Promise<void>;
|
|
5
|
-
getItem(key: string): Promise<string | null>;
|
|
6
|
-
removeItem(key: string): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
interface RateLimitOptions {
|
|
9
|
-
kv: KV;
|
|
10
|
-
rate: number;
|
|
11
|
-
capacity: number;
|
|
12
|
-
requested?: number;
|
|
13
|
-
keyPrefix?: string;
|
|
14
|
-
expiresIn?: number;
|
|
15
|
-
getIdentifier?: (c: Context) => string | undefined;
|
|
16
|
-
onRateLimited?: (c: Context, retryAfter: number) => Response | Promise<Response>;
|
|
17
|
-
skip?: (c: Context) => boolean | Promise<boolean>;
|
|
18
|
-
}
|
|
19
|
-
interface RateLimitResult {
|
|
20
|
-
allowed: boolean;
|
|
21
|
-
remaining: number;
|
|
22
|
-
limit: number;
|
|
23
|
-
reset: number;
|
|
24
|
-
retryAfter?: number;
|
|
25
|
-
}
|
|
26
|
-
declare function checkRateLimit(kv: KV, identifier: string, options: {
|
|
27
|
-
rate: number;
|
|
28
|
-
capacity: number;
|
|
29
|
-
requested?: number;
|
|
30
|
-
keyPrefix?: string;
|
|
31
|
-
expiresIn?: number;
|
|
32
|
-
}): Promise<RateLimitResult>;
|
|
33
|
-
declare function rateLimit(options: RateLimitOptions): MiddlewareHandler;
|
|
34
|
-
|
|
35
|
-
export { type KV, type RateLimitOptions, type RateLimitResult, checkRateLimit, rateLimit };
|
package/dist/hono/validator.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as zod_mini from 'zod/mini';
|
|
2
|
-
import { ZodMiniType } from 'zod/mini';
|
|
3
|
-
import * as hono_utils_http_status from 'hono/utils/http-status';
|
|
4
|
-
import * as hono_validator from 'hono/validator';
|
|
5
|
-
import * as hono_types from 'hono/types';
|
|
6
|
-
import * as hono from 'hono';
|
|
7
|
-
import { ValidationTargets } from 'hono';
|
|
8
|
-
import * as zod_v4_core from 'zod/v4/core';
|
|
9
|
-
import { ZodType, output } from 'zod';
|
|
10
|
-
|
|
11
|
-
declare function zValidator<S extends ZodType | ZodMiniType>(target: keyof ValidationTargets, schema: S): hono.MiddlewareHandler<any, string, {
|
|
12
|
-
in: {
|
|
13
|
-
json: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T ? T extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T extends Response | hono.TypedResponse<any, any, any> ? never : T : never : never;
|
|
14
|
-
form: hono_validator.InferInput<(S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_1 ? T_1 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_1 extends Response | hono.TypedResponse<any, any, any> ? never : T_1 : never : never, "form", hono_types.FormValue>;
|
|
15
|
-
query: hono_validator.InferInput<(S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_2 ? T_2 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_2 extends Response | hono.TypedResponse<any, any, any> ? never : T_2 : never : never, "query", hono_types.FormValue>;
|
|
16
|
-
param: hono_validator.InferInput<(S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_3 ? T_3 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_3 extends Response | hono.TypedResponse<any, any, any> ? never : T_3 : never : never, "param", hono_types.FormValue>;
|
|
17
|
-
header: hono_validator.InferInput<(S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_4 ? T_4 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_4 extends Response | hono.TypedResponse<any, any, any> ? never : T_4 : never : never, "header", hono_types.FormValue>;
|
|
18
|
-
cookie: hono_validator.InferInput<(S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_5 ? T_5 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_5 extends Response | hono.TypedResponse<any, any, any> ? never : T_5 : never : never, "cookie", hono_types.FormValue>;
|
|
19
|
-
};
|
|
20
|
-
out: {
|
|
21
|
-
json: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_6 ? T_6 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_6 extends Response | hono.TypedResponse<any, any, any> ? never : T_6 : never : never;
|
|
22
|
-
form: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_7 ? T_7 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_7 extends Response | hono.TypedResponse<any, any, any> ? never : T_7 : never : never;
|
|
23
|
-
query: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_8 ? T_8 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_8 extends Response | hono.TypedResponse<any, any, any> ? never : T_8 : never : never;
|
|
24
|
-
param: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_9 ? T_9 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_9 extends Response | hono.TypedResponse<any, any, any> ? never : T_9 : never : never;
|
|
25
|
-
header: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_10 ? T_10 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_10 extends Response | hono.TypedResponse<any, any, any> ? never : T_10 : never : never;
|
|
26
|
-
cookie: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_11 ? T_11 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_11 extends Response | hono.TypedResponse<any, any, any> ? never : T_11 : never : never;
|
|
27
|
-
};
|
|
28
|
-
}, (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_12 ? T_12 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_12 extends hono.TypedResponse<infer T_13, infer S_1 extends hono_utils_http_status.StatusCode, infer F extends string> ? hono.TypedResponse<T_13, S_1, F> : T_12 extends Response ? T_12 : T_12 extends undefined ? never : never : never : never>;
|
|
29
|
-
declare const bigintId: zod_mini.ZodMiniPipe<zod_mini.ZodMiniString<string>, zod_mini.ZodMiniTransform<bigint, string>>;
|
|
30
|
-
|
|
31
|
-
export { bigintId, zValidator };
|