@devizovaburza/payments-api-sdk 1.1.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/README.md +88 -0
- package/dist/v1/index.cjs +376 -0
- package/dist/v1/index.d.cts +3394 -0
- package/dist/v1/index.d.mts +3394 -0
- package/dist/v1/index.d.ts +3394 -0
- package/dist/v1/index.mjs +372 -0
- package/package.json +25 -0
|
@@ -0,0 +1,3394 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* HTTP Status utility.
|
|
4
|
+
*/
|
|
5
|
+
type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
6
|
+
type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
7
|
+
type DeprecatedStatusCode = 305 | 306;
|
|
8
|
+
type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
9
|
+
type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
|
|
10
|
+
type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
11
|
+
/**
|
|
12
|
+
* `UnofficialStatusCode` can be used to specify an unofficial status code.
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* app.get('/unknown', (c) => {
|
|
17
|
+
* return c.text("Unknown Error", 520 as UnofficialStatusCode)
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
type UnofficialStatusCode = -1;
|
|
22
|
+
/**
|
|
23
|
+
* If you want to use an unofficial status, use `UnofficialStatusCode`.
|
|
24
|
+
*/
|
|
25
|
+
type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode;
|
|
26
|
+
type ContentlessStatusCode = 101 | 204 | 205 | 304;
|
|
27
|
+
type ContentfulStatusCode = Exclude<StatusCode, ContentlessStatusCode>;
|
|
28
|
+
|
|
29
|
+
declare const GET_MATCH_RESULT: unique symbol;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Constant representing all HTTP methods in lowercase.
|
|
33
|
+
*/
|
|
34
|
+
declare const METHOD_NAME_ALL_LOWERCASE: "all";
|
|
35
|
+
/**
|
|
36
|
+
* Array of supported HTTP methods.
|
|
37
|
+
*/
|
|
38
|
+
declare const METHODS: readonly ["get", "post", "put", "delete", "options", "patch"];
|
|
39
|
+
/**
|
|
40
|
+
* Interface representing a router.
|
|
41
|
+
*
|
|
42
|
+
* @template T - The type of the handler.
|
|
43
|
+
*/
|
|
44
|
+
interface Router<T> {
|
|
45
|
+
/**
|
|
46
|
+
* The name of the router.
|
|
47
|
+
*/
|
|
48
|
+
name: string;
|
|
49
|
+
/**
|
|
50
|
+
* Adds a route to the router.
|
|
51
|
+
*
|
|
52
|
+
* @param method - The HTTP method (e.g., 'get', 'post').
|
|
53
|
+
* @param path - The path for the route.
|
|
54
|
+
* @param handler - The handler for the route.
|
|
55
|
+
*/
|
|
56
|
+
add(method: string, path: string, handler: T): void;
|
|
57
|
+
/**
|
|
58
|
+
* Matches a route based on the given method and path.
|
|
59
|
+
*
|
|
60
|
+
* @param method - The HTTP method (e.g., 'get', 'post').
|
|
61
|
+
* @param path - The path to match.
|
|
62
|
+
* @returns The result of the match.
|
|
63
|
+
*/
|
|
64
|
+
match(method: string, path: string): Result<T>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Type representing a map of parameter indices.
|
|
68
|
+
*/
|
|
69
|
+
type ParamIndexMap = Record<string, number>;
|
|
70
|
+
/**
|
|
71
|
+
* Type representing a stash of parameters.
|
|
72
|
+
*/
|
|
73
|
+
type ParamStash = string[];
|
|
74
|
+
/**
|
|
75
|
+
* Type representing a map of parameters.
|
|
76
|
+
*/
|
|
77
|
+
type Params = Record<string, string>;
|
|
78
|
+
/**
|
|
79
|
+
* Type representing the result of a route match.
|
|
80
|
+
*
|
|
81
|
+
* The result can be in one of two formats:
|
|
82
|
+
* 1. An array of handlers with their corresponding parameter index maps, followed by a parameter stash.
|
|
83
|
+
* 2. An array of handlers with their corresponding parameter maps.
|
|
84
|
+
*
|
|
85
|
+
* Example:
|
|
86
|
+
*
|
|
87
|
+
* [[handler, paramIndexMap][], paramArray]
|
|
88
|
+
* ```typescript
|
|
89
|
+
* [
|
|
90
|
+
* [
|
|
91
|
+
* [middlewareA, {}], // '*'
|
|
92
|
+
* [funcA, {'id': 0}], // '/user/:id/*'
|
|
93
|
+
* [funcB, {'id': 0, 'action': 1}], // '/user/:id/:action'
|
|
94
|
+
* ],
|
|
95
|
+
* ['123', 'abc']
|
|
96
|
+
* ]
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* [[handler, params][]]
|
|
100
|
+
* ```typescript
|
|
101
|
+
* [
|
|
102
|
+
* [
|
|
103
|
+
* [middlewareA, {}], // '*'
|
|
104
|
+
* [funcA, {'id': '123'}], // '/user/:id/*'
|
|
105
|
+
* [funcB, {'id': '123', 'action': 'abc'}], // '/user/:id/:action'
|
|
106
|
+
* ]
|
|
107
|
+
* ]
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
type Result<T> = [[T, ParamIndexMap][], ParamStash] | [[T, Params][]];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @module
|
|
114
|
+
* HTTP Headers utility.
|
|
115
|
+
*/
|
|
116
|
+
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';
|
|
117
|
+
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' | 'WWW-Authenticate' | 'Warning' | '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';
|
|
118
|
+
type CustomHeader = string & {};
|
|
119
|
+
|
|
120
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
121
|
+
type RemoveBlankRecord<T> = T extends Record<infer K, unknown> ? (K extends string ? T : never) : never;
|
|
122
|
+
type IfAnyThenEmptyObject<T> = 0 extends 1 & T ? {} : T;
|
|
123
|
+
type JSONPrimitive = string | boolean | number | null;
|
|
124
|
+
type JSONArray = (JSONPrimitive | JSONObject | JSONArray)[];
|
|
125
|
+
type JSONObject = {
|
|
126
|
+
[key: string]: JSONPrimitive | JSONArray | JSONObject | object | InvalidJSONValue;
|
|
127
|
+
};
|
|
128
|
+
type InvalidJSONValue = undefined | symbol | ((...args: unknown[]) => unknown);
|
|
129
|
+
type InvalidToNull<T> = T extends InvalidJSONValue ? null : T;
|
|
130
|
+
type IsInvalid<T> = T extends InvalidJSONValue ? true : false;
|
|
131
|
+
/**
|
|
132
|
+
* symbol keys are omitted through `JSON.stringify`
|
|
133
|
+
*/
|
|
134
|
+
type OmitSymbolKeys<T> = {
|
|
135
|
+
[K in keyof T as K extends symbol ? never : K]: T[K];
|
|
136
|
+
};
|
|
137
|
+
type JSONValue = JSONObject | JSONArray | JSONPrimitive;
|
|
138
|
+
/**
|
|
139
|
+
* Convert a type to a JSON-compatible type.
|
|
140
|
+
*
|
|
141
|
+
* Non-JSON values such as `Date` implement `.toJSON()`,
|
|
142
|
+
* so they can be transformed to a value assignable to `JSONObject`
|
|
143
|
+
*
|
|
144
|
+
* `JSON.stringify()` throws a `TypeError` when it encounters a `bigint` value,
|
|
145
|
+
* unless a custom `replacer` function or `.toJSON()` method is provided.
|
|
146
|
+
*
|
|
147
|
+
* This behaviour can be controlled by the `TError` generic type parameter,
|
|
148
|
+
* which defaults to `bigint | ReadonlyArray<bigint>`.
|
|
149
|
+
* You can set it to `never` to disable this check.
|
|
150
|
+
*/
|
|
151
|
+
type JSONParsed<T, TError = bigint | ReadonlyArray<bigint>> = T extends {
|
|
152
|
+
toJSON(): infer J;
|
|
153
|
+
} ? (() => J) extends () => JSONPrimitive ? J : (() => J) extends () => {
|
|
154
|
+
toJSON(): unknown;
|
|
155
|
+
} ? {} : JSONParsed<J, TError> : T extends JSONPrimitive ? T : T extends InvalidJSONValue ? never : T extends ReadonlyArray<unknown> ? {
|
|
156
|
+
[K in keyof T]: JSONParsed<InvalidToNull<T[K]>, TError>;
|
|
157
|
+
} : T extends Set<unknown> | Map<unknown, unknown> | Record<string, never> ? {} : T extends object ? T[keyof T] extends TError ? never : {
|
|
158
|
+
[K in keyof OmitSymbolKeys<T> as IsInvalid<T[K]> extends true ? never : K]: boolean extends IsInvalid<T[K]> ? JSONParsed<T[K], TError> | undefined : JSONParsed<T[K], TError>;
|
|
159
|
+
} : T extends unknown ? T extends TError ? never : JSONValue : never;
|
|
160
|
+
/**
|
|
161
|
+
* Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
162
|
+
* @copyright from sindresorhus/type-fest
|
|
163
|
+
*/
|
|
164
|
+
type Simplify<T> = {
|
|
165
|
+
[KeyType in keyof T]: T[KeyType];
|
|
166
|
+
} & {};
|
|
167
|
+
type RequiredKeysOf<BaseType extends object> = Exclude<{
|
|
168
|
+
[Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]> ? Key : never;
|
|
169
|
+
}[keyof BaseType], undefined>;
|
|
170
|
+
type HasRequiredKeys<BaseType extends object> = RequiredKeysOf<BaseType> extends never ? false : true;
|
|
171
|
+
type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @module
|
|
175
|
+
* This module contains some type definitions for the Hono modules.
|
|
176
|
+
*/
|
|
177
|
+
|
|
178
|
+
type Bindings = object;
|
|
179
|
+
type Variables = object;
|
|
180
|
+
type BlankEnv = {};
|
|
181
|
+
type Env = {
|
|
182
|
+
Bindings?: Bindings;
|
|
183
|
+
Variables?: Variables;
|
|
184
|
+
};
|
|
185
|
+
type Next = () => Promise<void>;
|
|
186
|
+
type ExtractInput<I extends Input | Input['in']> = I extends Input ? unknown extends I['in'] ? {} : I['in'] : I;
|
|
187
|
+
type Input = {
|
|
188
|
+
in?: {};
|
|
189
|
+
out?: {};
|
|
190
|
+
outputFormat?: ResponseFormat;
|
|
191
|
+
};
|
|
192
|
+
type BlankSchema = {};
|
|
193
|
+
type BlankInput = {};
|
|
194
|
+
interface RouterRoute {
|
|
195
|
+
basePath: string;
|
|
196
|
+
path: string;
|
|
197
|
+
method: string;
|
|
198
|
+
handler: H;
|
|
199
|
+
}
|
|
200
|
+
type HandlerResponse<O> = Response | TypedResponse<O> | Promise<Response | TypedResponse<O>> | Promise<void>;
|
|
201
|
+
type Handler<E extends Env = any, P extends string = any, I extends Input = BlankInput, R extends HandlerResponse<any> = any> = (c: Context<E, P, I>, next: Next) => R;
|
|
202
|
+
type MiddlewareHandler<E extends Env = any, P extends string = string, I extends Input = {}, R extends HandlerResponse<any> = Response> = (c: Context<E, P, I>, next: Next) => Promise<R | void>;
|
|
203
|
+
type H<E extends Env = any, P extends string = any, I extends Input = BlankInput, R extends HandlerResponse<any> = any> = Handler<E, P, I, R> | MiddlewareHandler<E, P, I, R>;
|
|
204
|
+
/**
|
|
205
|
+
* You can extend this interface to define a custom `c.notFound()` Response type.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* declare module 'hono' {
|
|
209
|
+
* interface NotFoundResponse extends Response, TypedResponse<string, 404, 'text'> {}
|
|
210
|
+
* }
|
|
211
|
+
*/
|
|
212
|
+
interface NotFoundResponse {
|
|
213
|
+
}
|
|
214
|
+
type NotFoundHandler<E extends Env = any> = (c: Context<E>) => NotFoundResponse extends Response ? NotFoundResponse | Promise<NotFoundResponse> : Response | Promise<Response>;
|
|
215
|
+
interface HTTPResponseError extends Error {
|
|
216
|
+
getResponse: () => Response;
|
|
217
|
+
}
|
|
218
|
+
type ErrorHandler<E extends Env = any> = (err: Error | HTTPResponseError, c: Context<E>) => Response | Promise<Response>;
|
|
219
|
+
interface HandlerInterface<E extends Env = Env, M extends string = string, S extends Schema = BlankSchema, BasePath extends string = '/', CurrentPath extends string = BasePath> {
|
|
220
|
+
<P extends string = CurrentPath, I extends Input = BlankInput, R extends HandlerResponse<any> = any, E2 extends Env = E>(handler: H<E2, P, I, R>): Hono$1<IntersectNonAnyTypes<[E, E2]>, S & ToSchema<M, P, I, MergeTypedResponse<R>>, BasePath, CurrentPath>;
|
|
221
|
+
<P extends string = CurrentPath, I extends Input = BlankInput, I2 extends Input = I, R extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H<E2, P, any> = H<E2, P, any>>(...handlers: [H<E2, P, I> & M1, H<E3, P, I2, R>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3]>, S & ToSchema<M, P, I2, MergeTypedResponse<R> | MergeMiddlewareResponse<M1>>, BasePath, CurrentPath>;
|
|
222
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, E2 extends Env = E>(path: P, handler: H<E2, MergedPath, I, R>): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R>, S, M, P, I, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
223
|
+
<P extends string = CurrentPath, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H<E2, P, any> = H<E2, P, any>, M2 extends H<E3, P, any> = H<E3, P, any>>(...handlers: [H<E2, P, I> & M1, H<E3, P, I2> & M2, H<E4, P, I3, R>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4]>, S & ToSchema<M, P, I3, MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2>>, BasePath, CurrentPath>;
|
|
224
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H<E2, MergedPath, any> = H<E2, MergedPath, any>>(path: P, ...handlers: [H<E2, MergedPath, I> & M1, H<E3, MergedPath, I2, R>]): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R> | MergeMiddlewareResponse<M1>, S, M, P, I2, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
225
|
+
<P extends string = CurrentPath, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H<E2, P, any> = H<E2, P, any>, M2 extends H<E3, P, any> = H<E3, P, any>, M3 extends H<E4, P, any> = H<E4, P, any>>(...handlers: [H<E2, P, I> & M1, H<E3, P, I2> & M2, H<E4, P, I3> & M3, H<E5, P, I4, R>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S & ToSchema<M, P, I4, MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3>>, BasePath, CurrentPath>;
|
|
226
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H<E2, MergedPath, any> = H<E2, MergedPath, any>, M2 extends H<E3, MergedPath, any> = H<E3, MergedPath, any>>(path: P, ...handlers: [H<E2, MergedPath, I> & M1, H<E3, MergedPath, I2> & M2, H<E4, MergedPath, I3, R>]): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2>, S, M, P, I3, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
227
|
+
<P extends string = CurrentPath, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H<E2, P, any> = H<E2, P, any>, M2 extends H<E3, P, any> = H<E3, P, any>, M3 extends H<E4, P, any> = H<E4, P, any>, M4 extends H<E5, P, any> = H<E5, P, any>>(...handlers: [
|
|
228
|
+
H<E2, P, I> & M1,
|
|
229
|
+
H<E3, P, I2> & M2,
|
|
230
|
+
H<E4, P, I3> & M3,
|
|
231
|
+
H<E5, P, I4> & M4,
|
|
232
|
+
H<E6, P, I5, R>
|
|
233
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S & ToSchema<M, P, I5, MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4>>, BasePath, CurrentPath>;
|
|
234
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H<E2, MergedPath, any> = H<E2, MergedPath, any>, M2 extends H<E3, MergedPath, any> = H<E3, MergedPath, any>, M3 extends H<E4, MergedPath, any> = H<E4, MergedPath, any>>(path: P, ...handlers: [
|
|
235
|
+
H<E2, MergedPath, I> & M1,
|
|
236
|
+
H<E3, MergedPath, I2> & M2,
|
|
237
|
+
H<E4, MergedPath, I3> & M3,
|
|
238
|
+
H<E5, MergedPath, I4, R>
|
|
239
|
+
]): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3>, S, M, P, I4, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
240
|
+
<P extends string = CurrentPath, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H<E2, P, any> = H<E2, P, any>, M2 extends H<E3, P, any> = H<E3, P, any>, M3 extends H<E4, P, any> = H<E4, P, any>, M4 extends H<E5, P, any> = H<E5, P, any>, M5 extends H<E6, P, any> = H<E6, P, any>>(...handlers: [
|
|
241
|
+
H<E2, P, I> & M1,
|
|
242
|
+
H<E3, P, I2> & M2,
|
|
243
|
+
H<E4, P, I3> & M3,
|
|
244
|
+
H<E5, P, I4> & M4,
|
|
245
|
+
H<E6, P, I5> & M5,
|
|
246
|
+
H<E7, P, I6, R>
|
|
247
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, S & ToSchema<M, P, I6, MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5>>, BasePath, CurrentPath>;
|
|
248
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H<E2, MergedPath, any> = H<E2, MergedPath, any>, M2 extends H<E3, MergedPath, any> = H<E3, MergedPath, any>, M3 extends H<E4, MergedPath, any> = H<E4, MergedPath, any>, M4 extends H<E5, MergedPath, any> = H<E5, MergedPath, any>>(path: P, ...handlers: [
|
|
249
|
+
H<E2, MergedPath, I> & M1,
|
|
250
|
+
H<E3, MergedPath, I2> & M2,
|
|
251
|
+
H<E4, MergedPath, I3> & M3,
|
|
252
|
+
H<E5, MergedPath, I4> & M4,
|
|
253
|
+
H<E6, MergedPath, I5, R>
|
|
254
|
+
]): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4>, S, M, P, I5, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
255
|
+
<P extends string = CurrentPath, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H<E2, P, any> = H<E2, P, any>, M2 extends H<E3, P, any> = H<E3, P, any>, M3 extends H<E4, P, any> = H<E4, P, any>, M4 extends H<E5, P, any> = H<E5, P, any>, M5 extends H<E6, P, any> = H<E6, P, any>, M6 extends H<E7, P, any> = H<E7, P, any>>(...handlers: [
|
|
256
|
+
H<E2, P, I> & M1,
|
|
257
|
+
H<E3, P, I2> & M2,
|
|
258
|
+
H<E4, P, I3> & M3,
|
|
259
|
+
H<E5, P, I4> & M4,
|
|
260
|
+
H<E6, P, I5> & M5,
|
|
261
|
+
H<E7, P, I6> & M6,
|
|
262
|
+
H<E8, P, I7, R>
|
|
263
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, S & ToSchema<M, P, I7, MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5> | MergeMiddlewareResponse<M6>>, BasePath, CurrentPath>;
|
|
264
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H<E2, MergedPath, any> = H<E2, MergedPath, any>, M2 extends H<E3, MergedPath, any> = H<E3, MergedPath, any>, M3 extends H<E4, MergedPath, any> = H<E4, MergedPath, any>, M4 extends H<E5, MergedPath, any> = H<E5, MergedPath, any>, M5 extends H<E6, MergedPath, any> = H<E6, MergedPath, any>>(path: P, ...handlers: [
|
|
265
|
+
H<E2, MergedPath, I> & M1,
|
|
266
|
+
H<E3, MergedPath, I2> & M2,
|
|
267
|
+
H<E4, MergedPath, I3> & M3,
|
|
268
|
+
H<E5, MergedPath, I4> & M4,
|
|
269
|
+
H<E6, MergedPath, I5> & M5,
|
|
270
|
+
H<E7, MergedPath, I6, R>
|
|
271
|
+
]): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5>, S, M, P, I6, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
272
|
+
<P extends string = CurrentPath, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H<E2, P, any> = H<E2, P, any>, M2 extends H<E3, P, any> = H<E3, P, any>, M3 extends H<E4, P, any> = H<E4, P, any>, M4 extends H<E5, P, any> = H<E5, P, any>, M5 extends H<E6, P, any> = H<E6, P, any>, M6 extends H<E7, P, any> = H<E7, P, any>, M7 extends H<E8, P, any> = H<E8, P, any>>(...handlers: [
|
|
273
|
+
H<E2, P, I> & M1,
|
|
274
|
+
H<E3, P, I2> & M2,
|
|
275
|
+
H<E4, P, I3> & M3,
|
|
276
|
+
H<E5, P, I4> & M4,
|
|
277
|
+
H<E6, P, I5> & M5,
|
|
278
|
+
H<E7, P, I6> & M6,
|
|
279
|
+
H<E8, P, I7> & M7,
|
|
280
|
+
H<E9, P, I8, R>
|
|
281
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, S & ToSchema<M, P, I8, MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5> | MergeMiddlewareResponse<M6> | MergeMiddlewareResponse<M7>>, BasePath, CurrentPath>;
|
|
282
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H<E2, MergedPath, any> = H<E2, MergedPath, any>, M2 extends H<E3, MergedPath, any> = H<E3, MergedPath, any>, M3 extends H<E4, MergedPath, any> = H<E4, MergedPath, any>, M4 extends H<E5, MergedPath, any> = H<E5, MergedPath, any>, M5 extends H<E6, MergedPath, any> = H<E6, MergedPath, any>, M6 extends H<E7, MergedPath, any> = H<E7, MergedPath, any>>(path: P, ...handlers: [
|
|
283
|
+
H<E2, MergedPath, I> & M1,
|
|
284
|
+
H<E3, MergedPath, I2> & M2,
|
|
285
|
+
H<E4, MergedPath, I3> & M3,
|
|
286
|
+
H<E5, MergedPath, I4> & M4,
|
|
287
|
+
H<E6, MergedPath, I5> & M5,
|
|
288
|
+
H<E7, MergedPath, I6> & M6,
|
|
289
|
+
H<E8, MergedPath, I7, R>
|
|
290
|
+
]): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5> | MergeMiddlewareResponse<M6>, S, M, P, I7, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
291
|
+
<P extends string = CurrentPath, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H<E2, P, any> = H<E2, P, any>, M2 extends H<E3, P, any> = H<E3, P, any>, M3 extends H<E4, P, any> = H<E4, P, any>, M4 extends H<E5, P, any> = H<E5, P, any>, M5 extends H<E6, P, any> = H<E6, P, any>, M6 extends H<E7, P, any> = H<E7, P, any>, M7 extends H<E8, P, any> = H<E8, P, any>, M8 extends H<E9, P, any> = H<E9, P, any>>(...handlers: [
|
|
292
|
+
H<E2, P, I> & M1,
|
|
293
|
+
H<E3, P, I2> & M2,
|
|
294
|
+
H<E4, P, I3> & M3,
|
|
295
|
+
H<E5, P, I4> & M4,
|
|
296
|
+
H<E6, P, I5> & M5,
|
|
297
|
+
H<E7, P, I6> & M6,
|
|
298
|
+
H<E8, P, I7> & M7,
|
|
299
|
+
H<E9, P, I8> & M8,
|
|
300
|
+
H<E10, P, I9, R>
|
|
301
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, S & ToSchema<M, P, I9, MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5> | MergeMiddlewareResponse<M6> | MergeMiddlewareResponse<M7> | MergeMiddlewareResponse<M8>>, BasePath, CurrentPath>;
|
|
302
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H<E2, MergedPath, any> = H<E2, MergedPath, any>, M2 extends H<E3, MergedPath, any> = H<E3, MergedPath, any>, M3 extends H<E4, MergedPath, any> = H<E4, MergedPath, any>, M4 extends H<E5, MergedPath, any> = H<E5, MergedPath, any>, M5 extends H<E6, MergedPath, any> = H<E6, MergedPath, any>, M6 extends H<E7, MergedPath, any> = H<E7, MergedPath, any>, M7 extends H<E8, MergedPath, any> = H<E8, MergedPath, any>>(path: P, ...handlers: [
|
|
303
|
+
H<E2, MergedPath, I> & M1,
|
|
304
|
+
H<E3, MergedPath, I2> & M2,
|
|
305
|
+
H<E4, MergedPath, I3> & M3,
|
|
306
|
+
H<E5, MergedPath, I4> & M4,
|
|
307
|
+
H<E6, MergedPath, I5> & M5,
|
|
308
|
+
H<E7, MergedPath, I6> & M6,
|
|
309
|
+
H<E8, MergedPath, I7> & M7,
|
|
310
|
+
H<E9, MergedPath, I8, R>
|
|
311
|
+
]): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5> | MergeMiddlewareResponse<M6> | MergeMiddlewareResponse<M7>, S, M, P, I8, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
312
|
+
<P extends string = CurrentPath, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H<E2, P, any> = H<E2, P, any>, M2 extends H<E3, P, any> = H<E3, P, any>, M3 extends H<E4, P, any> = H<E4, P, any>, M4 extends H<E5, P, any> = H<E5, P, any>, M5 extends H<E6, P, any> = H<E6, P, any>, M6 extends H<E7, P, any> = H<E7, P, any>, M7 extends H<E8, P, any> = H<E8, P, any>, M8 extends H<E9, P, any> = H<E9, P, any>, M9 extends H<E10, P, any> = H<E10, P, any>>(...handlers: [
|
|
313
|
+
H<E2, P, I> & M1,
|
|
314
|
+
H<E3, P, I2> & M2,
|
|
315
|
+
H<E4, P, I3> & M3,
|
|
316
|
+
H<E5, P, I4> & M4,
|
|
317
|
+
H<E6, P, I5> & M5,
|
|
318
|
+
H<E7, P, I6> & M6,
|
|
319
|
+
H<E8, P, I7> & M7,
|
|
320
|
+
H<E9, P, I8> & M8,
|
|
321
|
+
H<E10, P, I9> & M9,
|
|
322
|
+
H<E11, P, I10, R>
|
|
323
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>, S & ToSchema<M, P, I10, MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5> | MergeMiddlewareResponse<M6> | MergeMiddlewareResponse<M7> | MergeMiddlewareResponse<M8> | MergeMiddlewareResponse<M9>>, BasePath, CurrentPath>;
|
|
324
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H<E2, MergedPath, any> = H<E2, MergedPath, any>, M2 extends H<E3, MergedPath, any> = H<E3, MergedPath, any>, M3 extends H<E4, MergedPath, any> = H<E4, MergedPath, any>, M4 extends H<E5, MergedPath, any> = H<E5, MergedPath, any>, M5 extends H<E6, MergedPath, any> = H<E6, MergedPath, any>, M6 extends H<E7, MergedPath, any> = H<E7, MergedPath, any>, M7 extends H<E8, MergedPath, any> = H<E8, MergedPath, any>, M8 extends H<E9, MergedPath, any> = H<E9, MergedPath, any>>(path: P, ...handlers: [
|
|
325
|
+
H<E2, MergedPath, I> & M1,
|
|
326
|
+
H<E3, MergedPath, I2> & M2,
|
|
327
|
+
H<E4, MergedPath, I3> & M3,
|
|
328
|
+
H<E5, MergedPath, I4> & M4,
|
|
329
|
+
H<E6, MergedPath, I5> & M5,
|
|
330
|
+
H<E7, MergedPath, I6> & M6,
|
|
331
|
+
H<E8, MergedPath, I7> & M7,
|
|
332
|
+
H<E9, MergedPath, I8> & M8,
|
|
333
|
+
H<E10, MergedPath, I9, R>
|
|
334
|
+
]): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5> | MergeMiddlewareResponse<M6> | MergeMiddlewareResponse<M7> | MergeMiddlewareResponse<M8>, S, M, P, I9, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
335
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H<E2, MergedPath, any> = H<E2, MergedPath, any>, M2 extends H<E3, MergedPath, any> = H<E3, MergedPath, any>, M3 extends H<E4, MergedPath, any> = H<E4, MergedPath, any>, M4 extends H<E5, MergedPath, any> = H<E5, MergedPath, any>, M5 extends H<E6, MergedPath, any> = H<E6, MergedPath, any>, M6 extends H<E7, MergedPath, any> = H<E7, MergedPath, any>, M7 extends H<E8, MergedPath, any> = H<E8, MergedPath, any>, M8 extends H<E9, MergedPath, any> = H<E9, MergedPath, any>, M9 extends H<E10, MergedPath, any> = H<E10, MergedPath, any>>(path: P, ...handlers: [
|
|
336
|
+
H<E2, MergedPath, I> & M1,
|
|
337
|
+
H<E3, MergedPath, I2> & M2,
|
|
338
|
+
H<E4, MergedPath, I3> & M3,
|
|
339
|
+
H<E5, MergedPath, I4> & M4,
|
|
340
|
+
H<E6, MergedPath, I5> & M5,
|
|
341
|
+
H<E7, MergedPath, I6> & M6,
|
|
342
|
+
H<E8, MergedPath, I7> & M7,
|
|
343
|
+
H<E9, MergedPath, I8> & M8,
|
|
344
|
+
H<E10, MergedPath, I9> & M9,
|
|
345
|
+
H<E11, MergedPath, I10, R>
|
|
346
|
+
]): Hono$1<E, AddSchemaIfHasResponse<MergeTypedResponse<R> | MergeMiddlewareResponse<M1> | MergeMiddlewareResponse<M2> | MergeMiddlewareResponse<M3> | MergeMiddlewareResponse<M4> | MergeMiddlewareResponse<M5> | MergeMiddlewareResponse<M6> | MergeMiddlewareResponse<M7> | MergeMiddlewareResponse<M8> | MergeMiddlewareResponse<M9>, S, M, P, I10, BasePath>, BasePath, MergePath<BasePath, P>>;
|
|
347
|
+
<P extends string = CurrentPath, I extends Input = BlankInput, R extends HandlerResponse<any> = any>(...handlers: H<E, P, I, R>[]): Hono$1<E, S & ToSchema<M, P, I, MergeTypedResponse<R>>, BasePath, CurrentPath>;
|
|
348
|
+
<P extends string, I extends Input = BlankInput, R extends HandlerResponse<any> = any>(path: P, ...handlers: [H<E, MergePath<BasePath, P>, I, R>, ...H<E, MergePath<BasePath, P>, I, R>[]]): Hono$1<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
349
|
+
<P extends string, R extends HandlerResponse<any> = any, I extends Input = BlankInput>(path: P): Hono$1<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
350
|
+
}
|
|
351
|
+
interface MiddlewareHandlerInterface<E extends Env = Env, S extends Schema = BlankSchema, BasePath extends string = '/'> {
|
|
352
|
+
<E2 extends Env = E>(...handlers: MiddlewareHandler<E2, MergePath<BasePath, '*'>>[]): Hono$1<IntersectNonAnyTypes<[E, E2]>, S, BasePath, MergePath<BasePath, '*'>>;
|
|
353
|
+
<E2 extends Env = E>(handler: MiddlewareHandler<E2, MergePath<BasePath, '*'>>): Hono$1<IntersectNonAnyTypes<[E, E2]>, S, BasePath, MergePath<BasePath, '*'>>;
|
|
354
|
+
<E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, P extends string = MergePath<BasePath, '*'>>(...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3]>, S, BasePath, P>;
|
|
355
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, E2 extends Env = E>(path: P, handler: MiddlewareHandler<E2, MergedPath, any, any>): Hono$1<IntersectNonAnyTypes<[E, E2]>, S, BasePath, MergedPath>;
|
|
356
|
+
<E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, P extends string = MergePath<BasePath, '*'>>(...handlers: [
|
|
357
|
+
MiddlewareHandler<E2, P, any, any>,
|
|
358
|
+
MiddlewareHandler<E3, P, any, any>,
|
|
359
|
+
MiddlewareHandler<E4, P, any, any>
|
|
360
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4]>, S, BasePath, P>;
|
|
361
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(path: P, ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3]>, S, BasePath, MergedPath>;
|
|
362
|
+
<E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, P extends string = MergePath<BasePath, '*'>>(...handlers: [
|
|
363
|
+
MiddlewareHandler<E2, P>,
|
|
364
|
+
MiddlewareHandler<E3, P>,
|
|
365
|
+
MiddlewareHandler<E4, P>,
|
|
366
|
+
MiddlewareHandler<E5, P>
|
|
367
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S, BasePath, P>;
|
|
368
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(path: P, ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>, MiddlewareHandler<E4, P>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4]>, S, BasePath, MergedPath>;
|
|
369
|
+
<E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, P extends string = MergePath<BasePath, '*'>>(...handlers: [
|
|
370
|
+
MiddlewareHandler<E2, P>,
|
|
371
|
+
MiddlewareHandler<E3, P>,
|
|
372
|
+
MiddlewareHandler<E4, P>,
|
|
373
|
+
MiddlewareHandler<E5, P>,
|
|
374
|
+
MiddlewareHandler<E6, P>
|
|
375
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S, BasePath, P>;
|
|
376
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(path: P, ...handlers: [
|
|
377
|
+
MiddlewareHandler<E2, P>,
|
|
378
|
+
MiddlewareHandler<E3, P>,
|
|
379
|
+
MiddlewareHandler<E4, P>,
|
|
380
|
+
MiddlewareHandler<E5, P>
|
|
381
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S, BasePath, MergedPath>;
|
|
382
|
+
<E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, P extends string = MergePath<BasePath, '*'>>(...handlers: [
|
|
383
|
+
MiddlewareHandler<E2, P>,
|
|
384
|
+
MiddlewareHandler<E3, P>,
|
|
385
|
+
MiddlewareHandler<E4, P>,
|
|
386
|
+
MiddlewareHandler<E5, P>,
|
|
387
|
+
MiddlewareHandler<E6, P>,
|
|
388
|
+
MiddlewareHandler<E7, P>
|
|
389
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, S, BasePath, P>;
|
|
390
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(path: P, ...handlers: [
|
|
391
|
+
MiddlewareHandler<E2, P>,
|
|
392
|
+
MiddlewareHandler<E3, P>,
|
|
393
|
+
MiddlewareHandler<E4, P>,
|
|
394
|
+
MiddlewareHandler<E5, P>,
|
|
395
|
+
MiddlewareHandler<E6, P>
|
|
396
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S, BasePath, MergedPath>;
|
|
397
|
+
<E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, P extends string = MergePath<BasePath, '*'>>(...handlers: [
|
|
398
|
+
MiddlewareHandler<E2, P>,
|
|
399
|
+
MiddlewareHandler<E3, P>,
|
|
400
|
+
MiddlewareHandler<E4, P>,
|
|
401
|
+
MiddlewareHandler<E5, P>,
|
|
402
|
+
MiddlewareHandler<E6, P>,
|
|
403
|
+
MiddlewareHandler<E7, P>,
|
|
404
|
+
MiddlewareHandler<E8, P>
|
|
405
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, S, BasePath, P>;
|
|
406
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(path: P, ...handlers: [
|
|
407
|
+
MiddlewareHandler<E2, P>,
|
|
408
|
+
MiddlewareHandler<E3, P>,
|
|
409
|
+
MiddlewareHandler<E4, P>,
|
|
410
|
+
MiddlewareHandler<E5, P>,
|
|
411
|
+
MiddlewareHandler<E6, P>,
|
|
412
|
+
MiddlewareHandler<E7, P>
|
|
413
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, S, BasePath, MergedPath>;
|
|
414
|
+
<E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, P extends string = MergePath<BasePath, '*'>>(...handlers: [
|
|
415
|
+
MiddlewareHandler<E2, P>,
|
|
416
|
+
MiddlewareHandler<E3, P>,
|
|
417
|
+
MiddlewareHandler<E4, P>,
|
|
418
|
+
MiddlewareHandler<E5, P>,
|
|
419
|
+
MiddlewareHandler<E6, P>,
|
|
420
|
+
MiddlewareHandler<E7, P>,
|
|
421
|
+
MiddlewareHandler<E8, P>,
|
|
422
|
+
MiddlewareHandler<E9, P>
|
|
423
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, S, BasePath, P>;
|
|
424
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(path: P, ...handlers: [
|
|
425
|
+
MiddlewareHandler<E2, P>,
|
|
426
|
+
MiddlewareHandler<E3, P>,
|
|
427
|
+
MiddlewareHandler<E4, P>,
|
|
428
|
+
MiddlewareHandler<E5, P>,
|
|
429
|
+
MiddlewareHandler<E6, P>,
|
|
430
|
+
MiddlewareHandler<E7, P>,
|
|
431
|
+
MiddlewareHandler<E8, P>
|
|
432
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, S, BasePath, MergedPath>;
|
|
433
|
+
<E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, P extends string = MergePath<BasePath, '*'>>(...handlers: [
|
|
434
|
+
MiddlewareHandler<E2, P>,
|
|
435
|
+
MiddlewareHandler<E3, P>,
|
|
436
|
+
MiddlewareHandler<E4, P>,
|
|
437
|
+
MiddlewareHandler<E5, P>,
|
|
438
|
+
MiddlewareHandler<E6, P>,
|
|
439
|
+
MiddlewareHandler<E7, P>,
|
|
440
|
+
MiddlewareHandler<E8, P>,
|
|
441
|
+
MiddlewareHandler<E9, P>,
|
|
442
|
+
MiddlewareHandler<E10, P>
|
|
443
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, S, BasePath, P>;
|
|
444
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(path: P, ...handlers: [
|
|
445
|
+
MiddlewareHandler<E2, P>,
|
|
446
|
+
MiddlewareHandler<E3, P>,
|
|
447
|
+
MiddlewareHandler<E4, P>,
|
|
448
|
+
MiddlewareHandler<E5, P>,
|
|
449
|
+
MiddlewareHandler<E6, P>,
|
|
450
|
+
MiddlewareHandler<E7, P>,
|
|
451
|
+
MiddlewareHandler<E8, P>,
|
|
452
|
+
MiddlewareHandler<E9, P>
|
|
453
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, S, BasePath, MergedPath>;
|
|
454
|
+
<E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, P extends string = MergePath<BasePath, '*'>>(...handlers: [
|
|
455
|
+
MiddlewareHandler<E2, P>,
|
|
456
|
+
MiddlewareHandler<E3, P>,
|
|
457
|
+
MiddlewareHandler<E4, P>,
|
|
458
|
+
MiddlewareHandler<E5, P>,
|
|
459
|
+
MiddlewareHandler<E6, P>,
|
|
460
|
+
MiddlewareHandler<E7, P>,
|
|
461
|
+
MiddlewareHandler<E8, P>,
|
|
462
|
+
MiddlewareHandler<E9, P>,
|
|
463
|
+
MiddlewareHandler<E10, P>,
|
|
464
|
+
MiddlewareHandler<E11, P>
|
|
465
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>, S, BasePath, P>;
|
|
466
|
+
<P extends string, MergedPath extends MergePath<BasePath, P>, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(path: P, ...handlers: [
|
|
467
|
+
MiddlewareHandler<E2, P>,
|
|
468
|
+
MiddlewareHandler<E3, P>,
|
|
469
|
+
MiddlewareHandler<E4, P>,
|
|
470
|
+
MiddlewareHandler<E5, P>,
|
|
471
|
+
MiddlewareHandler<E6, P>,
|
|
472
|
+
MiddlewareHandler<E7, P>,
|
|
473
|
+
MiddlewareHandler<E8, P>,
|
|
474
|
+
MiddlewareHandler<E9, P>,
|
|
475
|
+
MiddlewareHandler<E10, P>
|
|
476
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, S, BasePath, MergedPath>;
|
|
477
|
+
<P extends string, E2 extends Env = E>(path: P, ...handlers: MiddlewareHandler<E2, MergePath<BasePath, P>>[]): Hono$1<E, S, BasePath, MergePath<BasePath, P>>;
|
|
478
|
+
}
|
|
479
|
+
interface OnHandlerInterface<E extends Env = Env, S extends Schema = BlankSchema, BasePath extends string = '/'> {
|
|
480
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, E2 extends Env = E>(method: M, path: P, handler: H<E2, MergedPath, I, R>): Hono$1<IntersectNonAnyTypes<[E, E2]>, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
481
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(method: M, path: P, ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2, R>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3]>, S & ToSchema<M, MergePath<BasePath, P>, I2, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
482
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(method: M, path: P, ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2>, H<E4, MergedPath, I3, R>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4]>, S & ToSchema<M, MergePath<BasePath, P>, I3, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
483
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(method: M, path: P, ...handlers: [
|
|
484
|
+
H<E2, MergedPath, I>,
|
|
485
|
+
H<E3, MergedPath, I2>,
|
|
486
|
+
H<E4, MergedPath, I3>,
|
|
487
|
+
H<E5, MergedPath, I4, R>
|
|
488
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S & ToSchema<M, MergePath<BasePath, P>, I4, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
489
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(method: M, path: P, ...handlers: [
|
|
490
|
+
H<E2, MergedPath, I>,
|
|
491
|
+
H<E3, MergedPath, I2>,
|
|
492
|
+
H<E4, MergedPath, I3>,
|
|
493
|
+
H<E5, MergedPath, I4>,
|
|
494
|
+
H<E6, MergedPath, I5, R>
|
|
495
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S & ToSchema<M, MergePath<BasePath, P>, I5, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
496
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(method: M, path: P, ...handlers: [
|
|
497
|
+
H<E2, MergedPath, I>,
|
|
498
|
+
H<E3, MergedPath, I2>,
|
|
499
|
+
H<E4, MergedPath, I3>,
|
|
500
|
+
H<E5, MergedPath, I4>,
|
|
501
|
+
H<E6, MergedPath, I5>,
|
|
502
|
+
H<E7, MergedPath, I6, R>
|
|
503
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, S & ToSchema<M, MergePath<BasePath, P>, I6, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
504
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(method: M, path: P, ...handlers: [
|
|
505
|
+
H<E2, MergedPath, I>,
|
|
506
|
+
H<E3, MergedPath, I2>,
|
|
507
|
+
H<E4, MergedPath, I3>,
|
|
508
|
+
H<E5, MergedPath, I4>,
|
|
509
|
+
H<E6, MergedPath, I5>,
|
|
510
|
+
H<E7, MergedPath, I6>,
|
|
511
|
+
H<E8, MergedPath, I7, R>
|
|
512
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, S & ToSchema<M, MergePath<BasePath, P>, I7, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
513
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(method: M, path: P, ...handlers: [
|
|
514
|
+
H<E2, MergedPath, I>,
|
|
515
|
+
H<E3, MergedPath, I2>,
|
|
516
|
+
H<E4, MergedPath, I3>,
|
|
517
|
+
H<E5, MergedPath, I4>,
|
|
518
|
+
H<E6, MergedPath, I5>,
|
|
519
|
+
H<E7, MergedPath, I6>,
|
|
520
|
+
H<E8, MergedPath, I7>,
|
|
521
|
+
H<E9, MergedPath, I8, R>
|
|
522
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, S & ToSchema<M, MergePath<BasePath, P>, I8, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
523
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(method: M, path: P, ...handlers: [
|
|
524
|
+
H<E2, MergedPath, I>,
|
|
525
|
+
H<E3, MergedPath, I2>,
|
|
526
|
+
H<E4, MergedPath, I3>,
|
|
527
|
+
H<E5, MergedPath, I4>,
|
|
528
|
+
H<E6, MergedPath, I5>,
|
|
529
|
+
H<E7, MergedPath, I6>,
|
|
530
|
+
H<E8, MergedPath, I7>,
|
|
531
|
+
H<E9, MergedPath, I8>,
|
|
532
|
+
H<E10, MergedPath, I9, R>
|
|
533
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, S & ToSchema<M, MergePath<BasePath, P>, I9, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
534
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(method: M, path: P, ...handlers: [
|
|
535
|
+
H<E2, MergedPath, I>,
|
|
536
|
+
H<E3, MergedPath, I2>,
|
|
537
|
+
H<E4, MergedPath, I3>,
|
|
538
|
+
H<E5, MergedPath, I4>,
|
|
539
|
+
H<E6, MergedPath, I5>,
|
|
540
|
+
H<E7, MergedPath, I6>,
|
|
541
|
+
H<E8, MergedPath, I7>,
|
|
542
|
+
H<E9, MergedPath, I8>,
|
|
543
|
+
H<E10, MergedPath, I9>,
|
|
544
|
+
H<E11, MergedPath, I10, R>
|
|
545
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>, S & ToSchema<M, MergePath<BasePath, P>, I10, MergeTypedResponse<HandlerResponse<any>>>, BasePath, MergePath<BasePath, P>>;
|
|
546
|
+
<M extends string, P extends string, R extends HandlerResponse<any> = any, I extends Input = BlankInput>(method: M, path: P, ...handlers: [H<E, MergePath<BasePath, P>, I, R>, ...H<E, MergePath<BasePath, P>, I, R>[]]): Hono$1<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
547
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, E2 extends Env = E>(methods: M[], path: P, handler: H<E2, MergedPath, I, R>): Hono$1<IntersectNonAnyTypes<[E, E2]>, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
548
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(methods: M[], path: P, ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2, R>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3]>, S & ToSchema<M, MergePath<BasePath, P>, I2, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
549
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(methods: M[], path: P, ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2>, H<E4, MergedPath, I3, R>]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4]>, S & ToSchema<M, MergePath<BasePath, P>, I3, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
550
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(methods: M[], path: P, ...handlers: [
|
|
551
|
+
H<E2, MergedPath, I>,
|
|
552
|
+
H<E3, MergedPath, I2>,
|
|
553
|
+
H<E4, MergedPath, I3>,
|
|
554
|
+
H<E5, MergedPath, I4, R>
|
|
555
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S & ToSchema<M, MergePath<BasePath, P>, I4, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
556
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(methods: M[], path: P, ...handlers: [
|
|
557
|
+
H<E2, MergedPath, I>,
|
|
558
|
+
H<E3, MergedPath, I2>,
|
|
559
|
+
H<E4, MergedPath, I3>,
|
|
560
|
+
H<E5, MergedPath, I4>,
|
|
561
|
+
H<E6, MergedPath, I5, R>
|
|
562
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S & ToSchema<M, MergePath<BasePath, P>, I5, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
563
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(methods: M[], path: P, ...handlers: [
|
|
564
|
+
H<E2, MergedPath, I>,
|
|
565
|
+
H<E3, MergedPath, I2>,
|
|
566
|
+
H<E4, MergedPath, I3>,
|
|
567
|
+
H<E5, MergedPath, I4>,
|
|
568
|
+
H<E6, MergedPath, I5>,
|
|
569
|
+
H<E7, MergedPath, I6, R>
|
|
570
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, S & ToSchema<M, MergePath<BasePath, P>, I6, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
571
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(methods: M[], path: P, ...handlers: [
|
|
572
|
+
H<E2, MergedPath, I>,
|
|
573
|
+
H<E3, MergedPath, I2>,
|
|
574
|
+
H<E4, MergedPath, I3>,
|
|
575
|
+
H<E5, MergedPath, I4>,
|
|
576
|
+
H<E6, MergedPath, I5>,
|
|
577
|
+
H<E7, MergedPath, I6>,
|
|
578
|
+
H<E8, MergedPath, I7, R>
|
|
579
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, S & ToSchema<M, MergePath<BasePath, P>, I7, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
580
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(methods: M[], path: P, ...handlers: [
|
|
581
|
+
H<E2, MergedPath, I>,
|
|
582
|
+
H<E3, MergedPath, I2>,
|
|
583
|
+
H<E4, MergedPath, I3>,
|
|
584
|
+
H<E5, MergedPath, I4>,
|
|
585
|
+
H<E6, MergedPath, I5>,
|
|
586
|
+
H<E7, MergedPath, I6>,
|
|
587
|
+
H<E8, MergedPath, I7>,
|
|
588
|
+
H<E9, MergedPath, I8, R>
|
|
589
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, S & ToSchema<M, MergePath<BasePath, P>, I8, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
590
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(methods: M[], path: P, ...handlers: [
|
|
591
|
+
H<E2, MergedPath, I>,
|
|
592
|
+
H<E3, MergedPath, I2>,
|
|
593
|
+
H<E4, MergedPath, I3>,
|
|
594
|
+
H<E5, MergedPath, I4>,
|
|
595
|
+
H<E6, MergedPath, I5>,
|
|
596
|
+
H<E7, MergedPath, I6>,
|
|
597
|
+
H<E8, MergedPath, I7>,
|
|
598
|
+
H<E9, MergedPath, I8>,
|
|
599
|
+
H<E10, MergedPath, I9, R>
|
|
600
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, S & ToSchema<M, MergePath<BasePath, P>, I9, MergeTypedResponse<HandlerResponse<any>>>, BasePath, MergePath<BasePath, P>>;
|
|
601
|
+
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(methods: M[], path: P, ...handlers: [
|
|
602
|
+
H<E2, MergedPath, I>,
|
|
603
|
+
H<E3, MergedPath, I2>,
|
|
604
|
+
H<E4, MergedPath, I3>,
|
|
605
|
+
H<E5, MergedPath, I4>,
|
|
606
|
+
H<E6, MergedPath, I5>,
|
|
607
|
+
H<E7, MergedPath, I6>,
|
|
608
|
+
H<E8, MergedPath, I7>,
|
|
609
|
+
H<E9, MergedPath, I8>,
|
|
610
|
+
H<E10, MergedPath, I9>,
|
|
611
|
+
H<E11, MergedPath, I10, R>
|
|
612
|
+
]): Hono$1<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>, S & ToSchema<M, MergePath<BasePath, P>, I10, MergeTypedResponse<HandlerResponse<any>>>, BasePath, MergePath<BasePath, P>>;
|
|
613
|
+
<M extends string, P extends string, R extends HandlerResponse<any> = any, I extends Input = BlankInput>(methods: M[], path: P, ...handlers: [H<E, MergePath<BasePath, P>, I, R>, ...H<E, MergePath<BasePath, P>, I, R>[]]): Hono$1<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath, MergePath<BasePath, P>>;
|
|
614
|
+
<M extends string, const Ps extends string[], I extends Input = BlankInput, R extends HandlerResponse<any> = any, E2 extends Env = E>(methods: M | M[], paths: Ps, ...handlers: H<E2, MergePath<BasePath, Ps[number]>, I, R>[]): Hono$1<E, S & ToSchema<M, MergePath<BasePath, Ps[number]>, I, MergeTypedResponse<R>>, BasePath, Ps extends [...string[], infer LastPath extends string] ? MergePath<BasePath, LastPath> : never>;
|
|
615
|
+
}
|
|
616
|
+
type ToSchemaOutput<RorO, I extends Input | Input['in']> = RorO extends TypedResponse<infer T, infer U, infer F> ? {
|
|
617
|
+
output: unknown extends T ? {} : T;
|
|
618
|
+
outputFormat: I extends {
|
|
619
|
+
outputFormat: string;
|
|
620
|
+
} ? I['outputFormat'] : F;
|
|
621
|
+
status: U;
|
|
622
|
+
} : {
|
|
623
|
+
output: unknown extends RorO ? {} : RorO;
|
|
624
|
+
outputFormat: unknown extends RorO ? 'json' : I extends {
|
|
625
|
+
outputFormat: string;
|
|
626
|
+
} ? I['outputFormat'] : 'json';
|
|
627
|
+
status: StatusCode;
|
|
628
|
+
};
|
|
629
|
+
type ToSchema<M extends string, P extends string, I extends Input | Input['in'], RorO> = IsAny<RorO> extends true ? {
|
|
630
|
+
[K in P]: {
|
|
631
|
+
[K2 in M as AddDollar<K2>]: {
|
|
632
|
+
input: AddParam<ExtractInput<I>, P>;
|
|
633
|
+
output: {};
|
|
634
|
+
outputFormat: ResponseFormat;
|
|
635
|
+
status: StatusCode;
|
|
636
|
+
};
|
|
637
|
+
};
|
|
638
|
+
} : [RorO] extends [never] ? {} : [RorO] extends [Promise<void>] ? {} : {
|
|
639
|
+
[K in P]: {
|
|
640
|
+
[K2 in M as AddDollar<K2>]: Simplify<{
|
|
641
|
+
input: AddParam<ExtractInput<I>, P>;
|
|
642
|
+
} & ToSchemaOutput<RorO, I>>;
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
type Schema = {
|
|
646
|
+
[Path: string]: {
|
|
647
|
+
[Method: `$${Lowercase<string>}`]: Endpoint;
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
type AddSchemaIfHasResponse<Merged, S extends Schema, M extends string, P extends string, I extends Input | Input['in'], BasePath extends string> = [Merged] extends [Promise<void>] ? S : S & ToSchema<M, MergePath<BasePath, P>, I, Merged>;
|
|
651
|
+
type Endpoint = {
|
|
652
|
+
input: any;
|
|
653
|
+
output: any;
|
|
654
|
+
outputFormat: ResponseFormat;
|
|
655
|
+
status: StatusCode;
|
|
656
|
+
};
|
|
657
|
+
type ExtractParams<Path extends string> = string extends Path ? Record<string, string> : Path extends `${infer _Start}:${infer Param}/${infer Rest}` ? {
|
|
658
|
+
[K in Param | keyof ExtractParams<`/${Rest}`>]: string;
|
|
659
|
+
} : Path extends `${infer _Start}:${infer Param}` ? {
|
|
660
|
+
[K in Param]: string;
|
|
661
|
+
} : never;
|
|
662
|
+
type FlattenIfIntersect<T> = T extends infer O ? {
|
|
663
|
+
[K in keyof O]: O[K];
|
|
664
|
+
} : never;
|
|
665
|
+
type MergeSchemaPath<OrigSchema extends Schema, SubPath extends string> = {
|
|
666
|
+
[P in keyof OrigSchema as MergePath<SubPath, P & string>]: [OrigSchema[P]] extends [
|
|
667
|
+
Record<string, Endpoint>
|
|
668
|
+
] ? {
|
|
669
|
+
[M in keyof OrigSchema[P]]: MergeEndpointParamsWithPath<OrigSchema[P][M], SubPath>;
|
|
670
|
+
} : never;
|
|
671
|
+
};
|
|
672
|
+
type MergeEndpointParamsWithPath<T extends Endpoint, SubPath extends string> = T extends unknown ? {
|
|
673
|
+
input: T['input'] extends {
|
|
674
|
+
param: infer _;
|
|
675
|
+
} ? ExtractParams<SubPath> extends never ? T['input'] : FlattenIfIntersect<T['input'] & {
|
|
676
|
+
param: {
|
|
677
|
+
[K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string;
|
|
678
|
+
};
|
|
679
|
+
}> : RemoveBlankRecord<ExtractParams<SubPath>> extends never ? T['input'] : T['input'] & {
|
|
680
|
+
param: {
|
|
681
|
+
[K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string;
|
|
682
|
+
};
|
|
683
|
+
};
|
|
684
|
+
output: T['output'];
|
|
685
|
+
outputFormat: T['outputFormat'];
|
|
686
|
+
status: T['status'];
|
|
687
|
+
} : never;
|
|
688
|
+
type AddParam<I, P extends string> = ParamKeys<P> extends never ? I : I extends {
|
|
689
|
+
param: infer _;
|
|
690
|
+
} ? I : I & {
|
|
691
|
+
param: UnionToIntersection<ParamKeyToRecord<ParamKeys<P>>>;
|
|
692
|
+
};
|
|
693
|
+
type AddDollar<T extends string> = `$${Lowercase<T>}`;
|
|
694
|
+
type MergePath<A extends string, B extends string> = B extends '' ? MergePath<A, '/'> : A extends '' ? B : A extends '/' ? B : A extends `${infer P}/` ? B extends `/${infer Q}` ? `${P}/${Q}` : `${P}/${B}` : B extends `/${infer Q}` ? Q extends '' ? A : `${A}/${Q}` : `${A}/${B}`;
|
|
695
|
+
type KnownResponseFormat = 'json' | 'text' | 'redirect';
|
|
696
|
+
type ResponseFormat = KnownResponseFormat | string;
|
|
697
|
+
type TypedResponse<T = unknown, U extends StatusCode = StatusCode, F extends ResponseFormat = T extends string ? 'text' : T extends JSONValue ? 'json' : ResponseFormat> = {
|
|
698
|
+
_data: T;
|
|
699
|
+
_status: U;
|
|
700
|
+
_format: F;
|
|
701
|
+
};
|
|
702
|
+
type MergeTypedResponse<T> = T extends Promise<void> ? T : T extends Promise<infer T2> ? T2 extends TypedResponse ? T2 : TypedResponse : T extends TypedResponse ? T : TypedResponse;
|
|
703
|
+
type ExtractTypedResponseOnly<T> = T extends TypedResponse ? T : never;
|
|
704
|
+
type MergeMiddlewareResponse<T> = T extends (c: any, next: any) => Promise<infer R> ? Exclude<R, void> extends never ? never : Exclude<R, void> extends Response | TypedResponse<any, any, any> ? ExtractTypedResponseOnly<Exclude<R, void>> : never : T extends (c: any, next: any) => infer R ? R extends Response | TypedResponse<any, any, any> ? ExtractTypedResponseOnly<R> : never : never;
|
|
705
|
+
type FormValue = string | Blob;
|
|
706
|
+
type ParsedFormValue = string | File;
|
|
707
|
+
type ValidationTargets<T extends FormValue = ParsedFormValue, P extends string = string> = {
|
|
708
|
+
json: any;
|
|
709
|
+
form: Record<string, T | T[]>;
|
|
710
|
+
query: Record<string, string | string[]>;
|
|
711
|
+
param: Record<P, P extends `${infer _}?` ? string | undefined : string>;
|
|
712
|
+
header: Record<RequestHeader | CustomHeader, string>;
|
|
713
|
+
cookie: Record<string, string>;
|
|
714
|
+
};
|
|
715
|
+
type ParamKey<Component> = Component extends `:${infer NameWithPattern}` ? NameWithPattern extends `${infer Name}{${infer Rest}` ? Rest extends `${infer _Pattern}?` ? `${Name}?` : Name : NameWithPattern : never;
|
|
716
|
+
type ParamKeys<Path> = Path extends `${infer Component}/${infer Rest}` ? ParamKey<Component> | ParamKeys<Rest> : ParamKey<Path>;
|
|
717
|
+
type ParamKeyToRecord<T extends string> = T extends `${infer R}?` ? Record<R, string | undefined> : {
|
|
718
|
+
[K in T]: string;
|
|
719
|
+
};
|
|
720
|
+
type InputToDataByTarget<T extends Input['out'], Target extends keyof ValidationTargets> = T extends {
|
|
721
|
+
[K in Target]: infer R;
|
|
722
|
+
} ? R : never;
|
|
723
|
+
type RemoveQuestion<T> = T extends `${infer R}?` ? R : T;
|
|
724
|
+
type ProcessHead<T> = IfAnyThenEmptyObject<T extends Env ? (Env extends T ? {} : T) : T>;
|
|
725
|
+
type IntersectNonAnyTypes<T extends any[]> = T extends [infer Head, ...infer Rest] ? ProcessHead<Head> & IntersectNonAnyTypes<Rest> : {};
|
|
726
|
+
declare abstract class FetchEventLike {
|
|
727
|
+
abstract readonly request: Request;
|
|
728
|
+
abstract respondWith(promise: Response | Promise<Response>): void;
|
|
729
|
+
abstract passThroughOnException(): void;
|
|
730
|
+
abstract waitUntil(promise: Promise<void>): void;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* @module
|
|
735
|
+
* Body utility.
|
|
736
|
+
*/
|
|
737
|
+
|
|
738
|
+
type BodyDataValueDot = {
|
|
739
|
+
[x: string]: string | File | BodyDataValueDot;
|
|
740
|
+
};
|
|
741
|
+
type BodyDataValueDotAll = {
|
|
742
|
+
[x: string]: string | File | (string | File)[] | BodyDataValueDotAll;
|
|
743
|
+
};
|
|
744
|
+
type SimplifyBodyData<T> = {
|
|
745
|
+
[K in keyof T]: string | File | (string | File)[] | BodyDataValueDotAll extends T[K] ? string | File | (string | File)[] | BodyDataValueDotAll : string | File | BodyDataValueDot extends T[K] ? string | File | BodyDataValueDot : string | File | (string | File)[] extends T[K] ? string | File | (string | File)[] : string | File;
|
|
746
|
+
} & {};
|
|
747
|
+
type BodyDataValueComponent<T> = string | File | (T extends {
|
|
748
|
+
all: false;
|
|
749
|
+
} ? never : T extends {
|
|
750
|
+
all: true;
|
|
751
|
+
} | {
|
|
752
|
+
all: boolean;
|
|
753
|
+
} ? (string | File)[] : never);
|
|
754
|
+
type BodyDataValueObject<T> = {
|
|
755
|
+
[key: string]: BodyDataValueComponent<T> | BodyDataValueObject<T>;
|
|
756
|
+
};
|
|
757
|
+
type BodyDataValue<T> = BodyDataValueComponent<T> | (T extends {
|
|
758
|
+
dot: false;
|
|
759
|
+
} ? never : T extends {
|
|
760
|
+
dot: true;
|
|
761
|
+
} | {
|
|
762
|
+
dot: boolean;
|
|
763
|
+
} ? BodyDataValueObject<T> : never);
|
|
764
|
+
type BodyData<T extends Partial<ParseBodyOptions> = {}> = SimplifyBodyData<Record<string, BodyDataValue<T>>>;
|
|
765
|
+
type ParseBodyOptions = {
|
|
766
|
+
/**
|
|
767
|
+
* Determines whether all fields with multiple values should be parsed as arrays.
|
|
768
|
+
* @default false
|
|
769
|
+
* @example
|
|
770
|
+
* const data = new FormData()
|
|
771
|
+
* data.append('file', 'aaa')
|
|
772
|
+
* data.append('file', 'bbb')
|
|
773
|
+
* data.append('message', 'hello')
|
|
774
|
+
*
|
|
775
|
+
* If all is false:
|
|
776
|
+
* parseBody should return { file: 'bbb', message: 'hello' }
|
|
777
|
+
*
|
|
778
|
+
* If all is true:
|
|
779
|
+
* parseBody should return { file: ['aaa', 'bbb'], message: 'hello' }
|
|
780
|
+
*/
|
|
781
|
+
all: boolean;
|
|
782
|
+
/**
|
|
783
|
+
* Determines whether all fields with dot notation should be parsed as nested objects.
|
|
784
|
+
* @default false
|
|
785
|
+
* @example
|
|
786
|
+
* const data = new FormData()
|
|
787
|
+
* data.append('obj.key1', 'value1')
|
|
788
|
+
* data.append('obj.key2', 'value2')
|
|
789
|
+
*
|
|
790
|
+
* If dot is false:
|
|
791
|
+
* parseBody should return { 'obj.key1': 'value1', 'obj.key2': 'value2' }
|
|
792
|
+
*
|
|
793
|
+
* If dot is true:
|
|
794
|
+
* parseBody should return { obj: { key1: 'value1', key2: 'value2' } }
|
|
795
|
+
*/
|
|
796
|
+
dot: boolean;
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
type Body = {
|
|
800
|
+
json: any;
|
|
801
|
+
text: string;
|
|
802
|
+
arrayBuffer: ArrayBuffer;
|
|
803
|
+
blob: Blob;
|
|
804
|
+
formData: FormData;
|
|
805
|
+
};
|
|
806
|
+
type BodyCache = Partial<Body & {
|
|
807
|
+
parsedBody: BodyData;
|
|
808
|
+
}>;
|
|
809
|
+
declare class HonoRequest$1<P extends string = '/', I extends Input['out'] = {}> {
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* `.raw` can get the raw Request object.
|
|
813
|
+
*
|
|
814
|
+
* @see {@link https://hono.dev/docs/api/request#raw}
|
|
815
|
+
*
|
|
816
|
+
* @example
|
|
817
|
+
* ```ts
|
|
818
|
+
* // For Cloudflare Workers
|
|
819
|
+
* app.post('/', async (c) => {
|
|
820
|
+
* const metadata = c.req.raw.cf?.hostMetadata?
|
|
821
|
+
* ...
|
|
822
|
+
* })
|
|
823
|
+
* ```
|
|
824
|
+
*/
|
|
825
|
+
raw: Request;
|
|
826
|
+
routeIndex: number;
|
|
827
|
+
/**
|
|
828
|
+
* `.path` can get the pathname of the request.
|
|
829
|
+
*
|
|
830
|
+
* @see {@link https://hono.dev/docs/api/request#path}
|
|
831
|
+
*
|
|
832
|
+
* @example
|
|
833
|
+
* ```ts
|
|
834
|
+
* app.get('/about/me', (c) => {
|
|
835
|
+
* const pathname = c.req.path // `/about/me`
|
|
836
|
+
* })
|
|
837
|
+
* ```
|
|
838
|
+
*/
|
|
839
|
+
path: string;
|
|
840
|
+
bodyCache: BodyCache;
|
|
841
|
+
constructor(request: Request, path?: string, matchResult?: Result<[unknown, RouterRoute]>);
|
|
842
|
+
/**
|
|
843
|
+
* `.req.param()` gets the path parameters.
|
|
844
|
+
*
|
|
845
|
+
* @see {@link https://hono.dev/docs/api/routing#path-parameter}
|
|
846
|
+
*
|
|
847
|
+
* @example
|
|
848
|
+
* ```ts
|
|
849
|
+
* const name = c.req.param('name')
|
|
850
|
+
* // or all parameters at once
|
|
851
|
+
* const { id, comment_id } = c.req.param()
|
|
852
|
+
* ```
|
|
853
|
+
*/
|
|
854
|
+
param<P2 extends ParamKeys<P> = ParamKeys<P>>(key: P2 extends `${infer _}?` ? never : P2): string;
|
|
855
|
+
param<P2 extends RemoveQuestion<ParamKeys<P>> = RemoveQuestion<ParamKeys<P>>>(key: P2): string | undefined;
|
|
856
|
+
param(key: string): string | undefined;
|
|
857
|
+
param<P2 extends string = P>(): Simplify<UnionToIntersection<ParamKeyToRecord<ParamKeys<P2>>>>;
|
|
858
|
+
/**
|
|
859
|
+
* `.query()` can get querystring parameters.
|
|
860
|
+
*
|
|
861
|
+
* @see {@link https://hono.dev/docs/api/request#query}
|
|
862
|
+
*
|
|
863
|
+
* @example
|
|
864
|
+
* ```ts
|
|
865
|
+
* // Query params
|
|
866
|
+
* app.get('/search', (c) => {
|
|
867
|
+
* const query = c.req.query('q')
|
|
868
|
+
* })
|
|
869
|
+
*
|
|
870
|
+
* // Get all params at once
|
|
871
|
+
* app.get('/search', (c) => {
|
|
872
|
+
* const { q, limit, offset } = c.req.query()
|
|
873
|
+
* })
|
|
874
|
+
* ```
|
|
875
|
+
*/
|
|
876
|
+
query(key: string): string | undefined;
|
|
877
|
+
query(): Record<string, string>;
|
|
878
|
+
/**
|
|
879
|
+
* `.queries()` can get multiple querystring parameter values, e.g. /search?tags=A&tags=B
|
|
880
|
+
*
|
|
881
|
+
* @see {@link https://hono.dev/docs/api/request#queries}
|
|
882
|
+
*
|
|
883
|
+
* @example
|
|
884
|
+
* ```ts
|
|
885
|
+
* app.get('/search', (c) => {
|
|
886
|
+
* // tags will be string[]
|
|
887
|
+
* const tags = c.req.queries('tags')
|
|
888
|
+
* })
|
|
889
|
+
* ```
|
|
890
|
+
*/
|
|
891
|
+
queries(key: string): string[] | undefined;
|
|
892
|
+
queries(): Record<string, string[]>;
|
|
893
|
+
/**
|
|
894
|
+
* `.header()` can get the request header value.
|
|
895
|
+
*
|
|
896
|
+
* @see {@link https://hono.dev/docs/api/request#header}
|
|
897
|
+
*
|
|
898
|
+
* @example
|
|
899
|
+
* ```ts
|
|
900
|
+
* app.get('/', (c) => {
|
|
901
|
+
* const userAgent = c.req.header('User-Agent')
|
|
902
|
+
* })
|
|
903
|
+
* ```
|
|
904
|
+
*/
|
|
905
|
+
header(name: RequestHeader): string | undefined;
|
|
906
|
+
header(name: string): string | undefined;
|
|
907
|
+
header(): Record<RequestHeader | (string & CustomHeader), string>;
|
|
908
|
+
/**
|
|
909
|
+
* `.parseBody()` can parse Request body of type `multipart/form-data` or `application/x-www-form-urlencoded`
|
|
910
|
+
*
|
|
911
|
+
* @see {@link https://hono.dev/docs/api/request#parsebody}
|
|
912
|
+
*
|
|
913
|
+
* @example
|
|
914
|
+
* ```ts
|
|
915
|
+
* app.post('/entry', async (c) => {
|
|
916
|
+
* const body = await c.req.parseBody()
|
|
917
|
+
* })
|
|
918
|
+
* ```
|
|
919
|
+
*/
|
|
920
|
+
parseBody<Options extends Partial<ParseBodyOptions>, T extends BodyData<Options>>(options?: Options): Promise<T>;
|
|
921
|
+
parseBody<T extends BodyData>(options?: Partial<ParseBodyOptions>): Promise<T>;
|
|
922
|
+
/**
|
|
923
|
+
* `.json()` can parse Request body of type `application/json`
|
|
924
|
+
*
|
|
925
|
+
* @see {@link https://hono.dev/docs/api/request#json}
|
|
926
|
+
*
|
|
927
|
+
* @example
|
|
928
|
+
* ```ts
|
|
929
|
+
* app.post('/entry', async (c) => {
|
|
930
|
+
* const body = await c.req.json()
|
|
931
|
+
* })
|
|
932
|
+
* ```
|
|
933
|
+
*/
|
|
934
|
+
json<T = any>(): Promise<T>;
|
|
935
|
+
/**
|
|
936
|
+
* `.text()` can parse Request body of type `text/plain`
|
|
937
|
+
*
|
|
938
|
+
* @see {@link https://hono.dev/docs/api/request#text}
|
|
939
|
+
*
|
|
940
|
+
* @example
|
|
941
|
+
* ```ts
|
|
942
|
+
* app.post('/entry', async (c) => {
|
|
943
|
+
* const body = await c.req.text()
|
|
944
|
+
* })
|
|
945
|
+
* ```
|
|
946
|
+
*/
|
|
947
|
+
text(): Promise<string>;
|
|
948
|
+
/**
|
|
949
|
+
* `.arrayBuffer()` parse Request body as an `ArrayBuffer`
|
|
950
|
+
*
|
|
951
|
+
* @see {@link https://hono.dev/docs/api/request#arraybuffer}
|
|
952
|
+
*
|
|
953
|
+
* @example
|
|
954
|
+
* ```ts
|
|
955
|
+
* app.post('/entry', async (c) => {
|
|
956
|
+
* const body = await c.req.arrayBuffer()
|
|
957
|
+
* })
|
|
958
|
+
* ```
|
|
959
|
+
*/
|
|
960
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
961
|
+
/**
|
|
962
|
+
* Parses the request body as a `Blob`.
|
|
963
|
+
* @example
|
|
964
|
+
* ```ts
|
|
965
|
+
* app.post('/entry', async (c) => {
|
|
966
|
+
* const body = await c.req.blob();
|
|
967
|
+
* });
|
|
968
|
+
* ```
|
|
969
|
+
* @see https://hono.dev/docs/api/request#blob
|
|
970
|
+
*/
|
|
971
|
+
blob(): Promise<Blob>;
|
|
972
|
+
/**
|
|
973
|
+
* Parses the request body as `FormData`.
|
|
974
|
+
* @example
|
|
975
|
+
* ```ts
|
|
976
|
+
* app.post('/entry', async (c) => {
|
|
977
|
+
* const body = await c.req.formData();
|
|
978
|
+
* });
|
|
979
|
+
* ```
|
|
980
|
+
* @see https://hono.dev/docs/api/request#formdata
|
|
981
|
+
*/
|
|
982
|
+
formData(): Promise<FormData>;
|
|
983
|
+
/**
|
|
984
|
+
* Adds validated data to the request.
|
|
985
|
+
*
|
|
986
|
+
* @param target - The target of the validation.
|
|
987
|
+
* @param data - The validated data to add.
|
|
988
|
+
*/
|
|
989
|
+
addValidatedData(target: keyof ValidationTargets, data: {}): void;
|
|
990
|
+
/**
|
|
991
|
+
* Gets validated data from the request.
|
|
992
|
+
*
|
|
993
|
+
* @param target - The target of the validation.
|
|
994
|
+
* @returns The validated data.
|
|
995
|
+
*
|
|
996
|
+
* @see https://hono.dev/docs/api/request#valid
|
|
997
|
+
*/
|
|
998
|
+
valid<T extends keyof I & keyof ValidationTargets>(target: T): InputToDataByTarget<I, T>;
|
|
999
|
+
/**
|
|
1000
|
+
* `.url()` can get the request url strings.
|
|
1001
|
+
*
|
|
1002
|
+
* @see {@link https://hono.dev/docs/api/request#url}
|
|
1003
|
+
*
|
|
1004
|
+
* @example
|
|
1005
|
+
* ```ts
|
|
1006
|
+
* app.get('/about/me', (c) => {
|
|
1007
|
+
* const url = c.req.url // `http://localhost:8787/about/me`
|
|
1008
|
+
* ...
|
|
1009
|
+
* })
|
|
1010
|
+
* ```
|
|
1011
|
+
*/
|
|
1012
|
+
get url(): string;
|
|
1013
|
+
/**
|
|
1014
|
+
* `.method()` can get the method name of the request.
|
|
1015
|
+
*
|
|
1016
|
+
* @see {@link https://hono.dev/docs/api/request#method}
|
|
1017
|
+
*
|
|
1018
|
+
* @example
|
|
1019
|
+
* ```ts
|
|
1020
|
+
* app.get('/about/me', (c) => {
|
|
1021
|
+
* const method = c.req.method // `GET`
|
|
1022
|
+
* })
|
|
1023
|
+
* ```
|
|
1024
|
+
*/
|
|
1025
|
+
get method(): string;
|
|
1026
|
+
get [GET_MATCH_RESULT](): Result<[unknown, RouterRoute]>;
|
|
1027
|
+
/**
|
|
1028
|
+
* `.matchedRoutes()` can return a matched route in the handler
|
|
1029
|
+
*
|
|
1030
|
+
* @deprecated
|
|
1031
|
+
*
|
|
1032
|
+
* Use matchedRoutes helper defined in "hono/route" instead.
|
|
1033
|
+
*
|
|
1034
|
+
* @see {@link https://hono.dev/docs/api/request#matchedroutes}
|
|
1035
|
+
*
|
|
1036
|
+
* @example
|
|
1037
|
+
* ```ts
|
|
1038
|
+
* app.use('*', async function logger(c, next) {
|
|
1039
|
+
* await next()
|
|
1040
|
+
* c.req.matchedRoutes.forEach(({ handler, method, path }, i) => {
|
|
1041
|
+
* const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]')
|
|
1042
|
+
* console.log(
|
|
1043
|
+
* method,
|
|
1044
|
+
* ' ',
|
|
1045
|
+
* path,
|
|
1046
|
+
* ' '.repeat(Math.max(10 - path.length, 0)),
|
|
1047
|
+
* name,
|
|
1048
|
+
* i === c.req.routeIndex ? '<- respond from here' : ''
|
|
1049
|
+
* )
|
|
1050
|
+
* })
|
|
1051
|
+
* })
|
|
1052
|
+
* ```
|
|
1053
|
+
*/
|
|
1054
|
+
get matchedRoutes(): RouterRoute[];
|
|
1055
|
+
/**
|
|
1056
|
+
* `routePath()` can retrieve the path registered within the handler
|
|
1057
|
+
*
|
|
1058
|
+
* @deprecated
|
|
1059
|
+
*
|
|
1060
|
+
* Use routePath helper defined in "hono/route" instead.
|
|
1061
|
+
*
|
|
1062
|
+
* @see {@link https://hono.dev/docs/api/request#routepath}
|
|
1063
|
+
*
|
|
1064
|
+
* @example
|
|
1065
|
+
* ```ts
|
|
1066
|
+
* app.get('/posts/:id', (c) => {
|
|
1067
|
+
* return c.json({ path: c.req.routePath })
|
|
1068
|
+
* })
|
|
1069
|
+
* ```
|
|
1070
|
+
*/
|
|
1071
|
+
get routePath(): string;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Union types for BaseMime
|
|
1076
|
+
*/
|
|
1077
|
+
type BaseMime = (typeof _baseMimes)[keyof typeof _baseMimes];
|
|
1078
|
+
declare const _baseMimes: {
|
|
1079
|
+
readonly aac: "audio/aac";
|
|
1080
|
+
readonly avi: "video/x-msvideo";
|
|
1081
|
+
readonly avif: "image/avif";
|
|
1082
|
+
readonly av1: "video/av1";
|
|
1083
|
+
readonly bin: "application/octet-stream";
|
|
1084
|
+
readonly bmp: "image/bmp";
|
|
1085
|
+
readonly css: "text/css";
|
|
1086
|
+
readonly csv: "text/csv";
|
|
1087
|
+
readonly eot: "application/vnd.ms-fontobject";
|
|
1088
|
+
readonly epub: "application/epub+zip";
|
|
1089
|
+
readonly gif: "image/gif";
|
|
1090
|
+
readonly gz: "application/gzip";
|
|
1091
|
+
readonly htm: "text/html";
|
|
1092
|
+
readonly html: "text/html";
|
|
1093
|
+
readonly ico: "image/x-icon";
|
|
1094
|
+
readonly ics: "text/calendar";
|
|
1095
|
+
readonly jpeg: "image/jpeg";
|
|
1096
|
+
readonly jpg: "image/jpeg";
|
|
1097
|
+
readonly js: "text/javascript";
|
|
1098
|
+
readonly json: "application/json";
|
|
1099
|
+
readonly jsonld: "application/ld+json";
|
|
1100
|
+
readonly map: "application/json";
|
|
1101
|
+
readonly mid: "audio/x-midi";
|
|
1102
|
+
readonly midi: "audio/x-midi";
|
|
1103
|
+
readonly mjs: "text/javascript";
|
|
1104
|
+
readonly mp3: "audio/mpeg";
|
|
1105
|
+
readonly mp4: "video/mp4";
|
|
1106
|
+
readonly mpeg: "video/mpeg";
|
|
1107
|
+
readonly oga: "audio/ogg";
|
|
1108
|
+
readonly ogv: "video/ogg";
|
|
1109
|
+
readonly ogx: "application/ogg";
|
|
1110
|
+
readonly opus: "audio/opus";
|
|
1111
|
+
readonly otf: "font/otf";
|
|
1112
|
+
readonly pdf: "application/pdf";
|
|
1113
|
+
readonly png: "image/png";
|
|
1114
|
+
readonly rtf: "application/rtf";
|
|
1115
|
+
readonly svg: "image/svg+xml";
|
|
1116
|
+
readonly tif: "image/tiff";
|
|
1117
|
+
readonly tiff: "image/tiff";
|
|
1118
|
+
readonly ts: "video/mp2t";
|
|
1119
|
+
readonly ttf: "font/ttf";
|
|
1120
|
+
readonly txt: "text/plain";
|
|
1121
|
+
readonly wasm: "application/wasm";
|
|
1122
|
+
readonly webm: "video/webm";
|
|
1123
|
+
readonly weba: "audio/webm";
|
|
1124
|
+
readonly webmanifest: "application/manifest+json";
|
|
1125
|
+
readonly webp: "image/webp";
|
|
1126
|
+
readonly woff: "font/woff";
|
|
1127
|
+
readonly woff2: "font/woff2";
|
|
1128
|
+
readonly xhtml: "application/xhtml+xml";
|
|
1129
|
+
readonly xml: "application/xml";
|
|
1130
|
+
readonly zip: "application/zip";
|
|
1131
|
+
readonly '3gp': "video/3gpp";
|
|
1132
|
+
readonly '3g2': "video/3gpp2";
|
|
1133
|
+
readonly gltf: "model/gltf+json";
|
|
1134
|
+
readonly glb: "model/gltf-binary";
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
type HeaderRecord = Record<'Content-Type', BaseMime> | Record<ResponseHeader, string | string[]> | Record<string, string | string[]>;
|
|
1138
|
+
/**
|
|
1139
|
+
* Data type can be a string, ArrayBuffer, Uint8Array (buffer), or ReadableStream.
|
|
1140
|
+
*/
|
|
1141
|
+
type Data = string | ArrayBuffer | ReadableStream | Uint8Array<ArrayBuffer>;
|
|
1142
|
+
/**
|
|
1143
|
+
* Interface for the execution context in a web worker or similar environment.
|
|
1144
|
+
*/
|
|
1145
|
+
interface ExecutionContext {
|
|
1146
|
+
/**
|
|
1147
|
+
* Extends the lifetime of the event callback until the promise is settled.
|
|
1148
|
+
*
|
|
1149
|
+
* @param promise - A promise to wait for.
|
|
1150
|
+
*/
|
|
1151
|
+
waitUntil(promise: Promise<unknown>): void;
|
|
1152
|
+
/**
|
|
1153
|
+
* Allows the event to be passed through to subsequent event listeners.
|
|
1154
|
+
*/
|
|
1155
|
+
passThroughOnException(): void;
|
|
1156
|
+
/**
|
|
1157
|
+
* For compatibility with Wrangler 4.x.
|
|
1158
|
+
*/
|
|
1159
|
+
props: any;
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Interface for context variable mapping.
|
|
1163
|
+
*/
|
|
1164
|
+
interface ContextVariableMap {
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Interface for context renderer.
|
|
1168
|
+
*/
|
|
1169
|
+
interface ContextRenderer {
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Interface representing a renderer for content.
|
|
1173
|
+
*
|
|
1174
|
+
* @interface DefaultRenderer
|
|
1175
|
+
* @param {string | Promise<string>} content - The content to be rendered, which can be either a string or a Promise resolving to a string.
|
|
1176
|
+
* @returns {Response | Promise<Response>} - The response after rendering the content, which can be either a Response or a Promise resolving to a Response.
|
|
1177
|
+
*/
|
|
1178
|
+
interface DefaultRenderer {
|
|
1179
|
+
(content: string | Promise<string>): Response | Promise<Response>;
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Renderer type which can either be a ContextRenderer or DefaultRenderer.
|
|
1183
|
+
*/
|
|
1184
|
+
type Renderer = ContextRenderer extends Function ? ContextRenderer : DefaultRenderer;
|
|
1185
|
+
/**
|
|
1186
|
+
* Extracts the props for the renderer.
|
|
1187
|
+
*/
|
|
1188
|
+
type PropsForRenderer = [...Required<Parameters<Renderer>>] extends [unknown, infer Props] ? Props : unknown;
|
|
1189
|
+
type Layout<T = Record<string, any>> = (props: T) => any;
|
|
1190
|
+
/**
|
|
1191
|
+
* Interface for getting context variables.
|
|
1192
|
+
*
|
|
1193
|
+
* @template E - Environment type.
|
|
1194
|
+
*/
|
|
1195
|
+
interface Get<E extends Env> {
|
|
1196
|
+
<Key extends keyof E['Variables']>(key: Key): E['Variables'][Key];
|
|
1197
|
+
<Key extends keyof ContextVariableMap>(key: Key): ContextVariableMap[Key];
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Interface for setting context variables.
|
|
1201
|
+
*
|
|
1202
|
+
* @template E - Environment type.
|
|
1203
|
+
*/
|
|
1204
|
+
interface Set$1<E extends Env> {
|
|
1205
|
+
<Key extends keyof E['Variables']>(key: Key, value: E['Variables'][Key]): void;
|
|
1206
|
+
<Key extends keyof ContextVariableMap>(key: Key, value: ContextVariableMap[Key]): void;
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* Interface for creating a new response.
|
|
1210
|
+
*/
|
|
1211
|
+
interface NewResponse {
|
|
1212
|
+
(data: Data | null, status?: StatusCode, headers?: HeaderRecord): Response;
|
|
1213
|
+
(data: Data | null, init?: ResponseOrInit): Response;
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
* Interface for responding with a body.
|
|
1217
|
+
*/
|
|
1218
|
+
interface BodyRespond {
|
|
1219
|
+
<T extends Data, U extends ContentfulStatusCode>(data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<T, U, 'body'>;
|
|
1220
|
+
<T extends Data, U extends ContentfulStatusCode>(data: T, init?: ResponseOrInit<U>): Response & TypedResponse<T, U, 'body'>;
|
|
1221
|
+
<T extends null, U extends StatusCode>(data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<null, U, 'body'>;
|
|
1222
|
+
<T extends null, U extends StatusCode>(data: T, init?: ResponseOrInit<U>): Response & TypedResponse<null, U, 'body'>;
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* Interface for responding with text.
|
|
1226
|
+
*
|
|
1227
|
+
* @interface TextRespond
|
|
1228
|
+
* @template T - The type of the text content.
|
|
1229
|
+
* @template U - The type of the status code.
|
|
1230
|
+
*
|
|
1231
|
+
* @param {T} text - The text content to be included in the response.
|
|
1232
|
+
* @param {U} [status] - An optional status code for the response.
|
|
1233
|
+
* @param {HeaderRecord} [headers] - An optional record of headers to include in the response.
|
|
1234
|
+
*
|
|
1235
|
+
* @returns {Response & TypedResponse<T, U, 'text'>} - The response after rendering the text content, typed with the provided text and status code types.
|
|
1236
|
+
*/
|
|
1237
|
+
interface TextRespond {
|
|
1238
|
+
<T extends string, U extends ContentfulStatusCode = ContentfulStatusCode>(text: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<T, U, 'text'>;
|
|
1239
|
+
<T extends string, U extends ContentfulStatusCode = ContentfulStatusCode>(text: T, init?: ResponseOrInit<U>): Response & TypedResponse<T, U, 'text'>;
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Interface for responding with JSON.
|
|
1243
|
+
*
|
|
1244
|
+
* @interface JSONRespond
|
|
1245
|
+
* @template T - The type of the JSON value or simplified unknown type.
|
|
1246
|
+
* @template U - The type of the status code.
|
|
1247
|
+
*
|
|
1248
|
+
* @param {T} object - The JSON object to be included in the response.
|
|
1249
|
+
* @param {U} [status] - An optional status code for the response.
|
|
1250
|
+
* @param {HeaderRecord} [headers] - An optional record of headers to include in the response.
|
|
1251
|
+
*
|
|
1252
|
+
* @returns {JSONRespondReturn<T, U>} - The response after rendering the JSON object, typed with the provided object and status code types.
|
|
1253
|
+
*/
|
|
1254
|
+
interface JSONRespond {
|
|
1255
|
+
<T extends JSONValue | {} | InvalidJSONValue, U extends ContentfulStatusCode = ContentfulStatusCode>(object: T, status?: U, headers?: HeaderRecord): JSONRespondReturn<T, U>;
|
|
1256
|
+
<T extends JSONValue | {} | InvalidJSONValue, U extends ContentfulStatusCode = ContentfulStatusCode>(object: T, init?: ResponseOrInit<U>): JSONRespondReturn<T, U>;
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* @template T - The type of the JSON value or simplified unknown type.
|
|
1260
|
+
* @template U - The type of the status code.
|
|
1261
|
+
*
|
|
1262
|
+
* @returns {Response & TypedResponse<JSONParsed<T>, U, 'json'>} - The response after rendering the JSON object, typed with the provided object and status code types.
|
|
1263
|
+
*/
|
|
1264
|
+
type JSONRespondReturn<T extends JSONValue | {} | InvalidJSONValue, U extends ContentfulStatusCode> = Response & TypedResponse<JSONParsed<T>, U, 'json'>;
|
|
1265
|
+
/**
|
|
1266
|
+
* Interface representing a function that responds with HTML content.
|
|
1267
|
+
*
|
|
1268
|
+
* @param html - The HTML content to respond with, which can be a string or a Promise that resolves to a string.
|
|
1269
|
+
* @param status - (Optional) The HTTP status code for the response.
|
|
1270
|
+
* @param headers - (Optional) A record of headers to include in the response.
|
|
1271
|
+
* @param init - (Optional) The response initialization object.
|
|
1272
|
+
*
|
|
1273
|
+
* @returns A Response object or a Promise that resolves to a Response object.
|
|
1274
|
+
*/
|
|
1275
|
+
interface HTMLRespond {
|
|
1276
|
+
<T extends string | Promise<string>>(html: T, status?: ContentfulStatusCode, headers?: HeaderRecord): T extends string ? Response : Promise<Response>;
|
|
1277
|
+
<T extends string | Promise<string>>(html: T, init?: ResponseOrInit<ContentfulStatusCode>): T extends string ? Response : Promise<Response>;
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Options for configuring the context.
|
|
1281
|
+
*
|
|
1282
|
+
* @template E - Environment type.
|
|
1283
|
+
*/
|
|
1284
|
+
type ContextOptions<E extends Env> = {
|
|
1285
|
+
/**
|
|
1286
|
+
* Bindings for the environment.
|
|
1287
|
+
*/
|
|
1288
|
+
env: E['Bindings'];
|
|
1289
|
+
/**
|
|
1290
|
+
* Execution context for the request.
|
|
1291
|
+
*/
|
|
1292
|
+
executionCtx?: FetchEventLike | ExecutionContext | undefined;
|
|
1293
|
+
/**
|
|
1294
|
+
* Handler for not found responses.
|
|
1295
|
+
*/
|
|
1296
|
+
notFoundHandler?: NotFoundHandler<E>;
|
|
1297
|
+
matchResult?: Result<[H, RouterRoute]>;
|
|
1298
|
+
path?: string;
|
|
1299
|
+
};
|
|
1300
|
+
interface SetHeadersOptions {
|
|
1301
|
+
append?: boolean;
|
|
1302
|
+
}
|
|
1303
|
+
interface SetHeaders {
|
|
1304
|
+
(name: 'Content-Type', value?: BaseMime, options?: SetHeadersOptions): void;
|
|
1305
|
+
(name: ResponseHeader, value?: string, options?: SetHeadersOptions): void;
|
|
1306
|
+
(name: string, value?: string, options?: SetHeadersOptions): void;
|
|
1307
|
+
}
|
|
1308
|
+
type ResponseHeadersInit = [string, string][] | Record<'Content-Type', BaseMime> | Record<ResponseHeader, string> | Record<string, string> | Headers;
|
|
1309
|
+
interface ResponseInit<T extends StatusCode = StatusCode> {
|
|
1310
|
+
headers?: ResponseHeadersInit;
|
|
1311
|
+
status?: T;
|
|
1312
|
+
statusText?: string;
|
|
1313
|
+
}
|
|
1314
|
+
type ResponseOrInit<T extends StatusCode = StatusCode> = ResponseInit<T> | Response;
|
|
1315
|
+
declare class Context<E extends Env = any, P extends string = any, I extends Input = {}> {
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers.
|
|
1319
|
+
*
|
|
1320
|
+
* @see {@link https://hono.dev/docs/api/context#env}
|
|
1321
|
+
*
|
|
1322
|
+
* @example
|
|
1323
|
+
* ```ts
|
|
1324
|
+
* // Environment object for Cloudflare Workers
|
|
1325
|
+
* app.get('*', async c => {
|
|
1326
|
+
* const counter = c.env.COUNTER
|
|
1327
|
+
* })
|
|
1328
|
+
* ```
|
|
1329
|
+
*/
|
|
1330
|
+
env: E['Bindings'];
|
|
1331
|
+
finalized: boolean;
|
|
1332
|
+
/**
|
|
1333
|
+
* `.error` can get the error object from the middleware if the Handler throws an error.
|
|
1334
|
+
*
|
|
1335
|
+
* @see {@link https://hono.dev/docs/api/context#error}
|
|
1336
|
+
*
|
|
1337
|
+
* @example
|
|
1338
|
+
* ```ts
|
|
1339
|
+
* app.use('*', async (c, next) => {
|
|
1340
|
+
* await next()
|
|
1341
|
+
* if (c.error) {
|
|
1342
|
+
* // do something...
|
|
1343
|
+
* }
|
|
1344
|
+
* })
|
|
1345
|
+
* ```
|
|
1346
|
+
*/
|
|
1347
|
+
error: Error | undefined;
|
|
1348
|
+
/**
|
|
1349
|
+
* Creates an instance of the Context class.
|
|
1350
|
+
*
|
|
1351
|
+
* @param req - The Request object.
|
|
1352
|
+
* @param options - Optional configuration options for the context.
|
|
1353
|
+
*/
|
|
1354
|
+
constructor(req: Request, options?: ContextOptions<E>);
|
|
1355
|
+
/**
|
|
1356
|
+
* `.req` is the instance of {@link HonoRequest}.
|
|
1357
|
+
*/
|
|
1358
|
+
get req(): HonoRequest$1<P, I['out']>;
|
|
1359
|
+
/**
|
|
1360
|
+
* @see {@link https://hono.dev/docs/api/context#event}
|
|
1361
|
+
* The FetchEvent associated with the current request.
|
|
1362
|
+
*
|
|
1363
|
+
* @throws Will throw an error if the context does not have a FetchEvent.
|
|
1364
|
+
*/
|
|
1365
|
+
get event(): FetchEventLike;
|
|
1366
|
+
/**
|
|
1367
|
+
* @see {@link https://hono.dev/docs/api/context#executionctx}
|
|
1368
|
+
* The ExecutionContext associated with the current request.
|
|
1369
|
+
*
|
|
1370
|
+
* @throws Will throw an error if the context does not have an ExecutionContext.
|
|
1371
|
+
*/
|
|
1372
|
+
get executionCtx(): ExecutionContext;
|
|
1373
|
+
/**
|
|
1374
|
+
* @see {@link https://hono.dev/docs/api/context#res}
|
|
1375
|
+
* The Response object for the current request.
|
|
1376
|
+
*/
|
|
1377
|
+
get res(): Response;
|
|
1378
|
+
/**
|
|
1379
|
+
* Sets the Response object for the current request.
|
|
1380
|
+
*
|
|
1381
|
+
* @param _res - The Response object to set.
|
|
1382
|
+
*/
|
|
1383
|
+
set res(_res: Response | undefined);
|
|
1384
|
+
/**
|
|
1385
|
+
* `.render()` can create a response within a layout.
|
|
1386
|
+
*
|
|
1387
|
+
* @see {@link https://hono.dev/docs/api/context#render-setrenderer}
|
|
1388
|
+
*
|
|
1389
|
+
* @example
|
|
1390
|
+
* ```ts
|
|
1391
|
+
* app.get('/', (c) => {
|
|
1392
|
+
* return c.render('Hello!')
|
|
1393
|
+
* })
|
|
1394
|
+
* ```
|
|
1395
|
+
*/
|
|
1396
|
+
render: Renderer;
|
|
1397
|
+
/**
|
|
1398
|
+
* Sets the layout for the response.
|
|
1399
|
+
*
|
|
1400
|
+
* @param layout - The layout to set.
|
|
1401
|
+
* @returns The layout function.
|
|
1402
|
+
*/
|
|
1403
|
+
setLayout: (layout: Layout<PropsForRenderer & {
|
|
1404
|
+
Layout: Layout;
|
|
1405
|
+
}>) => Layout<PropsForRenderer & {
|
|
1406
|
+
Layout: Layout;
|
|
1407
|
+
}>;
|
|
1408
|
+
/**
|
|
1409
|
+
* Gets the current layout for the response.
|
|
1410
|
+
*
|
|
1411
|
+
* @returns The current layout function.
|
|
1412
|
+
*/
|
|
1413
|
+
getLayout: () => Layout<PropsForRenderer & {
|
|
1414
|
+
Layout: Layout;
|
|
1415
|
+
}> | undefined;
|
|
1416
|
+
/**
|
|
1417
|
+
* `.setRenderer()` can set the layout in the custom middleware.
|
|
1418
|
+
*
|
|
1419
|
+
* @see {@link https://hono.dev/docs/api/context#render-setrenderer}
|
|
1420
|
+
*
|
|
1421
|
+
* @example
|
|
1422
|
+
* ```tsx
|
|
1423
|
+
* app.use('*', async (c, next) => {
|
|
1424
|
+
* c.setRenderer((content) => {
|
|
1425
|
+
* return c.html(
|
|
1426
|
+
* <html>
|
|
1427
|
+
* <body>
|
|
1428
|
+
* <p>{content}</p>
|
|
1429
|
+
* </body>
|
|
1430
|
+
* </html>
|
|
1431
|
+
* )
|
|
1432
|
+
* })
|
|
1433
|
+
* await next()
|
|
1434
|
+
* })
|
|
1435
|
+
* ```
|
|
1436
|
+
*/
|
|
1437
|
+
setRenderer: (renderer: Renderer) => void;
|
|
1438
|
+
/**
|
|
1439
|
+
* `.header()` can set headers.
|
|
1440
|
+
*
|
|
1441
|
+
* @see {@link https://hono.dev/docs/api/context#header}
|
|
1442
|
+
*
|
|
1443
|
+
* @example
|
|
1444
|
+
* ```ts
|
|
1445
|
+
* app.get('/welcome', (c) => {
|
|
1446
|
+
* // Set headers
|
|
1447
|
+
* c.header('X-Message', 'Hello!')
|
|
1448
|
+
* c.header('Content-Type', 'text/plain')
|
|
1449
|
+
*
|
|
1450
|
+
* return c.body('Thank you for coming')
|
|
1451
|
+
* })
|
|
1452
|
+
* ```
|
|
1453
|
+
*/
|
|
1454
|
+
header: SetHeaders;
|
|
1455
|
+
status: (status: StatusCode) => void;
|
|
1456
|
+
/**
|
|
1457
|
+
* `.set()` can set the value specified by the key.
|
|
1458
|
+
*
|
|
1459
|
+
* @see {@link https://hono.dev/docs/api/context#set-get}
|
|
1460
|
+
*
|
|
1461
|
+
* @example
|
|
1462
|
+
* ```ts
|
|
1463
|
+
* app.use('*', async (c, next) => {
|
|
1464
|
+
* c.set('message', 'Hono is hot!!')
|
|
1465
|
+
* await next()
|
|
1466
|
+
* })
|
|
1467
|
+
* ```
|
|
1468
|
+
*/
|
|
1469
|
+
set: Set$1<IsAny<E> extends true ? {
|
|
1470
|
+
Variables: ContextVariableMap & Record<string, any>;
|
|
1471
|
+
} : E>;
|
|
1472
|
+
/**
|
|
1473
|
+
* `.get()` can use the value specified by the key.
|
|
1474
|
+
*
|
|
1475
|
+
* @see {@link https://hono.dev/docs/api/context#set-get}
|
|
1476
|
+
*
|
|
1477
|
+
* @example
|
|
1478
|
+
* ```ts
|
|
1479
|
+
* app.get('/', (c) => {
|
|
1480
|
+
* const message = c.get('message')
|
|
1481
|
+
* return c.text(`The message is "${message}"`)
|
|
1482
|
+
* })
|
|
1483
|
+
* ```
|
|
1484
|
+
*/
|
|
1485
|
+
get: Get<IsAny<E> extends true ? {
|
|
1486
|
+
Variables: ContextVariableMap & Record<string, any>;
|
|
1487
|
+
} : E>;
|
|
1488
|
+
/**
|
|
1489
|
+
* `.var` can access the value of a variable.
|
|
1490
|
+
*
|
|
1491
|
+
* @see {@link https://hono.dev/docs/api/context#var}
|
|
1492
|
+
*
|
|
1493
|
+
* @example
|
|
1494
|
+
* ```ts
|
|
1495
|
+
* const result = c.var.client.oneMethod()
|
|
1496
|
+
* ```
|
|
1497
|
+
*/
|
|
1498
|
+
get var(): Readonly<ContextVariableMap & (IsAny<E['Variables']> extends true ? Record<string, any> : E['Variables'])>;
|
|
1499
|
+
newResponse: NewResponse;
|
|
1500
|
+
/**
|
|
1501
|
+
* `.body()` can return the HTTP response.
|
|
1502
|
+
* You can set headers with `.header()` and set HTTP status code with `.status`.
|
|
1503
|
+
* This can also be set in `.text()`, `.json()` and so on.
|
|
1504
|
+
*
|
|
1505
|
+
* @see {@link https://hono.dev/docs/api/context#body}
|
|
1506
|
+
*
|
|
1507
|
+
* @example
|
|
1508
|
+
* ```ts
|
|
1509
|
+
* app.get('/welcome', (c) => {
|
|
1510
|
+
* // Set headers
|
|
1511
|
+
* c.header('X-Message', 'Hello!')
|
|
1512
|
+
* c.header('Content-Type', 'text/plain')
|
|
1513
|
+
* // Set HTTP status code
|
|
1514
|
+
* c.status(201)
|
|
1515
|
+
*
|
|
1516
|
+
* // Return the response body
|
|
1517
|
+
* return c.body('Thank you for coming')
|
|
1518
|
+
* })
|
|
1519
|
+
* ```
|
|
1520
|
+
*/
|
|
1521
|
+
body: BodyRespond;
|
|
1522
|
+
/**
|
|
1523
|
+
* `.text()` can render text as `Content-Type:text/plain`.
|
|
1524
|
+
*
|
|
1525
|
+
* @see {@link https://hono.dev/docs/api/context#text}
|
|
1526
|
+
*
|
|
1527
|
+
* @example
|
|
1528
|
+
* ```ts
|
|
1529
|
+
* app.get('/say', (c) => {
|
|
1530
|
+
* return c.text('Hello!')
|
|
1531
|
+
* })
|
|
1532
|
+
* ```
|
|
1533
|
+
*/
|
|
1534
|
+
text: TextRespond;
|
|
1535
|
+
/**
|
|
1536
|
+
* `.json()` can render JSON as `Content-Type:application/json`.
|
|
1537
|
+
*
|
|
1538
|
+
* @see {@link https://hono.dev/docs/api/context#json}
|
|
1539
|
+
*
|
|
1540
|
+
* @example
|
|
1541
|
+
* ```ts
|
|
1542
|
+
* app.get('/api', (c) => {
|
|
1543
|
+
* return c.json({ message: 'Hello!' })
|
|
1544
|
+
* })
|
|
1545
|
+
* ```
|
|
1546
|
+
*/
|
|
1547
|
+
json: JSONRespond;
|
|
1548
|
+
html: HTMLRespond;
|
|
1549
|
+
/**
|
|
1550
|
+
* `.redirect()` can Redirect, default status code is 302.
|
|
1551
|
+
*
|
|
1552
|
+
* @see {@link https://hono.dev/docs/api/context#redirect}
|
|
1553
|
+
*
|
|
1554
|
+
* @example
|
|
1555
|
+
* ```ts
|
|
1556
|
+
* app.get('/redirect', (c) => {
|
|
1557
|
+
* return c.redirect('/')
|
|
1558
|
+
* })
|
|
1559
|
+
* app.get('/redirect-permanently', (c) => {
|
|
1560
|
+
* return c.redirect('/', 301)
|
|
1561
|
+
* })
|
|
1562
|
+
* ```
|
|
1563
|
+
*/
|
|
1564
|
+
redirect: <T extends RedirectStatusCode = 302>(location: string | URL, status?: T) => Response & TypedResponse<undefined, T, "redirect">;
|
|
1565
|
+
/**
|
|
1566
|
+
* `.notFound()` can return the Not Found Response.
|
|
1567
|
+
*
|
|
1568
|
+
* @see {@link https://hono.dev/docs/api/context#notfound}
|
|
1569
|
+
*
|
|
1570
|
+
* @example
|
|
1571
|
+
* ```ts
|
|
1572
|
+
* app.get('/notfound', (c) => {
|
|
1573
|
+
* return c.notFound()
|
|
1574
|
+
* })
|
|
1575
|
+
* ```
|
|
1576
|
+
*/
|
|
1577
|
+
notFound: () => ReturnType<NotFoundHandler>;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
/**
|
|
1581
|
+
* @module
|
|
1582
|
+
* This module is the base module for the Hono object.
|
|
1583
|
+
*/
|
|
1584
|
+
|
|
1585
|
+
type GetPath<E extends Env> = (request: Request, options?: {
|
|
1586
|
+
env?: E['Bindings'];
|
|
1587
|
+
}) => string;
|
|
1588
|
+
type HonoOptions<E extends Env> = {
|
|
1589
|
+
/**
|
|
1590
|
+
* `strict` option specifies whether to distinguish whether the last path is a directory or not.
|
|
1591
|
+
*
|
|
1592
|
+
* @see {@link https://hono.dev/docs/api/hono#strict-mode}
|
|
1593
|
+
*
|
|
1594
|
+
* @default true
|
|
1595
|
+
*/
|
|
1596
|
+
strict?: boolean;
|
|
1597
|
+
/**
|
|
1598
|
+
* `router` option specifies which router to use.
|
|
1599
|
+
*
|
|
1600
|
+
* @see {@link https://hono.dev/docs/api/hono#router-option}
|
|
1601
|
+
*
|
|
1602
|
+
* @example
|
|
1603
|
+
* ```ts
|
|
1604
|
+
* const app = new Hono({ router: new RegExpRouter() })
|
|
1605
|
+
* ```
|
|
1606
|
+
*/
|
|
1607
|
+
router?: Router<[H, RouterRoute]>;
|
|
1608
|
+
/**
|
|
1609
|
+
* `getPath` can handle the host header value.
|
|
1610
|
+
*
|
|
1611
|
+
* @see {@link https://hono.dev/docs/api/routing#routing-with-host-header-value}
|
|
1612
|
+
*
|
|
1613
|
+
* @example
|
|
1614
|
+
* ```ts
|
|
1615
|
+
* const app = new Hono({
|
|
1616
|
+
* getPath: (req) =>
|
|
1617
|
+
* '/' + req.headers.get('host') + req.url.replace(/^https?:\/\/[^/]+(\/[^?]*)/, '$1'),
|
|
1618
|
+
* })
|
|
1619
|
+
*
|
|
1620
|
+
* app.get('/www1.example.com/hello', () => c.text('hello www1'))
|
|
1621
|
+
*
|
|
1622
|
+
* // A following request will match the route:
|
|
1623
|
+
* // new Request('http://www1.example.com/hello', {
|
|
1624
|
+
* // headers: { host: 'www1.example.com' },
|
|
1625
|
+
* // })
|
|
1626
|
+
* ```
|
|
1627
|
+
*/
|
|
1628
|
+
getPath?: GetPath<E>;
|
|
1629
|
+
};
|
|
1630
|
+
type MountOptionHandler = (c: Context) => unknown;
|
|
1631
|
+
type MountReplaceRequest = (originalRequest: Request) => Request;
|
|
1632
|
+
type MountOptions = MountOptionHandler | {
|
|
1633
|
+
optionHandler?: MountOptionHandler;
|
|
1634
|
+
replaceRequest?: MountReplaceRequest | false;
|
|
1635
|
+
};
|
|
1636
|
+
declare class Hono$1<E extends Env = Env, S extends Schema = {}, BasePath extends string = '/', CurrentPath extends string = BasePath> {
|
|
1637
|
+
|
|
1638
|
+
get: HandlerInterface<E, 'get', S, BasePath, CurrentPath>;
|
|
1639
|
+
post: HandlerInterface<E, 'post', S, BasePath, CurrentPath>;
|
|
1640
|
+
put: HandlerInterface<E, 'put', S, BasePath, CurrentPath>;
|
|
1641
|
+
delete: HandlerInterface<E, 'delete', S, BasePath, CurrentPath>;
|
|
1642
|
+
options: HandlerInterface<E, 'options', S, BasePath, CurrentPath>;
|
|
1643
|
+
patch: HandlerInterface<E, 'patch', S, BasePath, CurrentPath>;
|
|
1644
|
+
all: HandlerInterface<E, 'all', S, BasePath, CurrentPath>;
|
|
1645
|
+
on: OnHandlerInterface<E, S, BasePath>;
|
|
1646
|
+
use: MiddlewareHandlerInterface<E, S, BasePath>;
|
|
1647
|
+
router: Router<[H, RouterRoute]>;
|
|
1648
|
+
readonly getPath: GetPath<E>;
|
|
1649
|
+
private _basePath;
|
|
1650
|
+
routes: RouterRoute[];
|
|
1651
|
+
constructor(options?: HonoOptions<E>);
|
|
1652
|
+
private errorHandler;
|
|
1653
|
+
/**
|
|
1654
|
+
* `.route()` allows grouping other Hono instance in routes.
|
|
1655
|
+
*
|
|
1656
|
+
* @see {@link https://hono.dev/docs/api/routing#grouping}
|
|
1657
|
+
*
|
|
1658
|
+
* @param {string} path - base Path
|
|
1659
|
+
* @param {Hono} app - other Hono instance
|
|
1660
|
+
* @returns {Hono} routed Hono instance
|
|
1661
|
+
*
|
|
1662
|
+
* @example
|
|
1663
|
+
* ```ts
|
|
1664
|
+
* const app = new Hono()
|
|
1665
|
+
* const app2 = new Hono()
|
|
1666
|
+
*
|
|
1667
|
+
* app2.get("/user", (c) => c.text("user"))
|
|
1668
|
+
* app.route("/api", app2) // GET /api/user
|
|
1669
|
+
* ```
|
|
1670
|
+
*/
|
|
1671
|
+
route<SubPath extends string, SubEnv extends Env, SubSchema extends Schema, SubBasePath extends string, SubCurrentPath extends string>(path: SubPath, app: Hono$1<SubEnv, SubSchema, SubBasePath, SubCurrentPath>): Hono$1<E, MergeSchemaPath<SubSchema, MergePath<BasePath, SubPath>> | S, BasePath, CurrentPath>;
|
|
1672
|
+
/**
|
|
1673
|
+
* `.basePath()` allows base paths to be specified.
|
|
1674
|
+
*
|
|
1675
|
+
* @see {@link https://hono.dev/docs/api/routing#base-path}
|
|
1676
|
+
*
|
|
1677
|
+
* @param {string} path - base Path
|
|
1678
|
+
* @returns {Hono} changed Hono instance
|
|
1679
|
+
*
|
|
1680
|
+
* @example
|
|
1681
|
+
* ```ts
|
|
1682
|
+
* const api = new Hono().basePath('/api')
|
|
1683
|
+
* ```
|
|
1684
|
+
*/
|
|
1685
|
+
basePath<SubPath extends string>(path: SubPath): Hono$1<E, S, MergePath<BasePath, SubPath>, MergePath<BasePath, SubPath>>;
|
|
1686
|
+
/**
|
|
1687
|
+
* `.onError()` handles an error and returns a customized Response.
|
|
1688
|
+
*
|
|
1689
|
+
* @see {@link https://hono.dev/docs/api/hono#error-handling}
|
|
1690
|
+
*
|
|
1691
|
+
* @param {ErrorHandler} handler - request Handler for error
|
|
1692
|
+
* @returns {Hono} changed Hono instance
|
|
1693
|
+
*
|
|
1694
|
+
* @example
|
|
1695
|
+
* ```ts
|
|
1696
|
+
* app.onError((err, c) => {
|
|
1697
|
+
* console.error(`${err}`)
|
|
1698
|
+
* return c.text('Custom Error Message', 500)
|
|
1699
|
+
* })
|
|
1700
|
+
* ```
|
|
1701
|
+
*/
|
|
1702
|
+
onError: (handler: ErrorHandler<E>) => Hono$1<E, S, BasePath, CurrentPath>;
|
|
1703
|
+
/**
|
|
1704
|
+
* `.notFound()` allows you to customize a Not Found Response.
|
|
1705
|
+
*
|
|
1706
|
+
* @see {@link https://hono.dev/docs/api/hono#not-found}
|
|
1707
|
+
*
|
|
1708
|
+
* @param {NotFoundHandler} handler - request handler for not-found
|
|
1709
|
+
* @returns {Hono} changed Hono instance
|
|
1710
|
+
*
|
|
1711
|
+
* @example
|
|
1712
|
+
* ```ts
|
|
1713
|
+
* app.notFound((c) => {
|
|
1714
|
+
* return c.text('Custom 404 Message', 404)
|
|
1715
|
+
* })
|
|
1716
|
+
* ```
|
|
1717
|
+
*/
|
|
1718
|
+
notFound: (handler: NotFoundHandler<E>) => Hono$1<E, S, BasePath, CurrentPath>;
|
|
1719
|
+
/**
|
|
1720
|
+
* `.mount()` allows you to mount applications built with other frameworks into your Hono application.
|
|
1721
|
+
*
|
|
1722
|
+
* @see {@link https://hono.dev/docs/api/hono#mount}
|
|
1723
|
+
*
|
|
1724
|
+
* @param {string} path - base Path
|
|
1725
|
+
* @param {Function} applicationHandler - other Request Handler
|
|
1726
|
+
* @param {MountOptions} [options] - options of `.mount()`
|
|
1727
|
+
* @returns {Hono} mounted Hono instance
|
|
1728
|
+
*
|
|
1729
|
+
* @example
|
|
1730
|
+
* ```ts
|
|
1731
|
+
* import { Router as IttyRouter } from 'itty-router'
|
|
1732
|
+
* import { Hono } from 'hono'
|
|
1733
|
+
* // Create itty-router application
|
|
1734
|
+
* const ittyRouter = IttyRouter()
|
|
1735
|
+
* // GET /itty-router/hello
|
|
1736
|
+
* ittyRouter.get('/hello', () => new Response('Hello from itty-router'))
|
|
1737
|
+
*
|
|
1738
|
+
* const app = new Hono()
|
|
1739
|
+
* app.mount('/itty-router', ittyRouter.handle)
|
|
1740
|
+
* ```
|
|
1741
|
+
*
|
|
1742
|
+
* @example
|
|
1743
|
+
* ```ts
|
|
1744
|
+
* const app = new Hono()
|
|
1745
|
+
* // Send the request to another application without modification.
|
|
1746
|
+
* app.mount('/app', anotherApp, {
|
|
1747
|
+
* replaceRequest: (req) => req,
|
|
1748
|
+
* })
|
|
1749
|
+
* ```
|
|
1750
|
+
*/
|
|
1751
|
+
mount(path: string, applicationHandler: (request: Request, ...args: any) => Response | Promise<Response>, options?: MountOptions): Hono$1<E, S, BasePath, CurrentPath>;
|
|
1752
|
+
/**
|
|
1753
|
+
* `.fetch()` will be entry point of your app.
|
|
1754
|
+
*
|
|
1755
|
+
* @see {@link https://hono.dev/docs/api/hono#fetch}
|
|
1756
|
+
*
|
|
1757
|
+
* @param {Request} request - request Object of request
|
|
1758
|
+
* @param {Env} Env - env Object
|
|
1759
|
+
* @param {ExecutionContext} - context of execution
|
|
1760
|
+
* @returns {Response | Promise<Response>} response of request
|
|
1761
|
+
*
|
|
1762
|
+
*/
|
|
1763
|
+
fetch: (request: Request, Env?: E['Bindings'] | {}, executionCtx?: ExecutionContext) => Response | Promise<Response>;
|
|
1764
|
+
/**
|
|
1765
|
+
* `.request()` is a useful method for testing.
|
|
1766
|
+
* You can pass a URL or pathname to send a GET request.
|
|
1767
|
+
* app will return a Response object.
|
|
1768
|
+
* ```ts
|
|
1769
|
+
* test('GET /hello is ok', async () => {
|
|
1770
|
+
* const res = await app.request('/hello')
|
|
1771
|
+
* expect(res.status).toBe(200)
|
|
1772
|
+
* })
|
|
1773
|
+
* ```
|
|
1774
|
+
* @see https://hono.dev/docs/api/hono#request
|
|
1775
|
+
*/
|
|
1776
|
+
request: (input: RequestInfo | URL, requestInit?: RequestInit, Env?: E["Bindings"] | {}, executionCtx?: ExecutionContext) => Response | Promise<Response>;
|
|
1777
|
+
/**
|
|
1778
|
+
* `.fire()` automatically adds a global fetch event listener.
|
|
1779
|
+
* This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers.
|
|
1780
|
+
* @deprecated
|
|
1781
|
+
* Use `fire` from `hono/service-worker` instead.
|
|
1782
|
+
* ```ts
|
|
1783
|
+
* import { Hono } from 'hono'
|
|
1784
|
+
* import { fire } from 'hono/service-worker'
|
|
1785
|
+
*
|
|
1786
|
+
* const app = new Hono()
|
|
1787
|
+
* // ...
|
|
1788
|
+
* fire(app)
|
|
1789
|
+
* ```
|
|
1790
|
+
* @see https://hono.dev/docs/api/hono#fire
|
|
1791
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
|
|
1792
|
+
* @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/
|
|
1793
|
+
*/
|
|
1794
|
+
fire: () => void;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
/**
|
|
1798
|
+
* The Hono class extends the functionality of the HonoBase class.
|
|
1799
|
+
* It sets up routing and allows for custom options to be passed.
|
|
1800
|
+
*
|
|
1801
|
+
* @template E - The environment type.
|
|
1802
|
+
* @template S - The schema type.
|
|
1803
|
+
* @template BasePath - The base path type.
|
|
1804
|
+
*/
|
|
1805
|
+
declare class Hono<E extends Env = BlankEnv, S extends Schema = BlankSchema, BasePath extends string = '/'> extends Hono$1<E, S, BasePath> {
|
|
1806
|
+
/**
|
|
1807
|
+
* Creates an instance of the Hono class.
|
|
1808
|
+
*
|
|
1809
|
+
* @param options - Optional configuration options for the Hono instance.
|
|
1810
|
+
*/
|
|
1811
|
+
constructor(options?: HonoOptions<E>);
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
/**
|
|
1815
|
+
* Type representing the '$all' method name
|
|
1816
|
+
*/
|
|
1817
|
+
type MethodNameAll = `$${typeof METHOD_NAME_ALL_LOWERCASE}`;
|
|
1818
|
+
/**
|
|
1819
|
+
* Type representing all standard HTTP methods prefixed with '$'
|
|
1820
|
+
* e.g., '$get' | '$post' | '$put' | '$delete' | '$options' | '$patch'
|
|
1821
|
+
*/
|
|
1822
|
+
type StandardMethods = `$${(typeof METHODS)[number]}`;
|
|
1823
|
+
/**
|
|
1824
|
+
* Expands '$all' into all standard HTTP methods.
|
|
1825
|
+
* If the schema contains '$all', it creates a type where all standard HTTP methods
|
|
1826
|
+
* point to the same endpoint definition as '$all', while removing '$all' itself.
|
|
1827
|
+
*/
|
|
1828
|
+
type ExpandAllMethod<S> = MethodNameAll extends keyof S ? {
|
|
1829
|
+
[M in StandardMethods]: S[MethodNameAll];
|
|
1830
|
+
} & Omit<S, MethodNameAll> : S;
|
|
1831
|
+
type HonoRequest = (typeof Hono.prototype)['request'];
|
|
1832
|
+
type BuildSearchParamsFn = (query: Record<string, string | string[]>) => URLSearchParams;
|
|
1833
|
+
type ClientRequestOptions<T = unknown> = {
|
|
1834
|
+
fetch?: typeof fetch | HonoRequest;
|
|
1835
|
+
webSocket?: (...args: ConstructorParameters<typeof WebSocket>) => WebSocket;
|
|
1836
|
+
/**
|
|
1837
|
+
* Standard `RequestInit`, caution that this take highest priority
|
|
1838
|
+
* and could be used to overwrite things that Hono sets for you, like `body | method | headers`.
|
|
1839
|
+
*
|
|
1840
|
+
* If you want to add some headers, use in `headers` instead of `init`
|
|
1841
|
+
*/
|
|
1842
|
+
init?: RequestInit;
|
|
1843
|
+
/**
|
|
1844
|
+
* Custom function to serialize query parameters into URLSearchParams.
|
|
1845
|
+
* By default, arrays are serialized as multiple parameters with the same key (e.g., `key=a&key=b`).
|
|
1846
|
+
* You can provide a custom function to change this behavior, for example to use bracket notation (e.g., `key[]=a&key[]=b`).
|
|
1847
|
+
*
|
|
1848
|
+
* @example
|
|
1849
|
+
* ```ts
|
|
1850
|
+
* const client = hc('http://localhost', {
|
|
1851
|
+
* buildSearchParams: (query) => {
|
|
1852
|
+
* return new URLSearchParams(qs.stringify(query))
|
|
1853
|
+
* }
|
|
1854
|
+
* })
|
|
1855
|
+
* ```
|
|
1856
|
+
*/
|
|
1857
|
+
buildSearchParams?: BuildSearchParamsFn;
|
|
1858
|
+
} & (keyof T extends never ? {
|
|
1859
|
+
headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
|
|
1860
|
+
} : {
|
|
1861
|
+
headers: T | (() => T | Promise<T>);
|
|
1862
|
+
});
|
|
1863
|
+
type ClientRequest<Prefix extends string, Path extends string, S extends Schema> = {
|
|
1864
|
+
[M in keyof ExpandAllMethod<S>]: ExpandAllMethod<S>[M] extends Endpoint & {
|
|
1865
|
+
input: infer R;
|
|
1866
|
+
} ? R extends object ? HasRequiredKeys<R> extends true ? (args: R, options?: ClientRequestOptions) => Promise<ClientResponseOfEndpoint<ExpandAllMethod<S>[M]>> : (args?: R, options?: ClientRequestOptions) => Promise<ClientResponseOfEndpoint<ExpandAllMethod<S>[M]>> : never : never;
|
|
1867
|
+
} & {
|
|
1868
|
+
$url: <const Arg extends (S[keyof S] extends {
|
|
1869
|
+
input: infer R;
|
|
1870
|
+
} ? R extends {
|
|
1871
|
+
param: infer P;
|
|
1872
|
+
} ? R extends {
|
|
1873
|
+
query: infer Q;
|
|
1874
|
+
} ? {
|
|
1875
|
+
param: P;
|
|
1876
|
+
query: Q;
|
|
1877
|
+
} : {
|
|
1878
|
+
param: P;
|
|
1879
|
+
} : R extends {
|
|
1880
|
+
query: infer Q;
|
|
1881
|
+
} ? {
|
|
1882
|
+
query: Q;
|
|
1883
|
+
} : {} : {}) | undefined = undefined>(arg?: Arg) => HonoURL<Prefix, Path, Arg>;
|
|
1884
|
+
} & (S['$get'] extends {
|
|
1885
|
+
outputFormat: 'ws';
|
|
1886
|
+
} ? S['$get'] extends {
|
|
1887
|
+
input: infer I;
|
|
1888
|
+
} ? {
|
|
1889
|
+
$ws: (args?: I) => WebSocket;
|
|
1890
|
+
} : {} : {});
|
|
1891
|
+
type ClientResponseOfEndpoint<T extends Endpoint = Endpoint> = T extends {
|
|
1892
|
+
output: infer O;
|
|
1893
|
+
outputFormat: infer F;
|
|
1894
|
+
status: infer S;
|
|
1895
|
+
} ? ClientResponse<O, S extends number ? S : never, F extends ResponseFormat ? F : never> : never;
|
|
1896
|
+
interface ClientResponse<T, U extends number = StatusCode, F extends ResponseFormat = ResponseFormat> extends globalThis.Response {
|
|
1897
|
+
readonly body: ReadableStream | null;
|
|
1898
|
+
readonly bodyUsed: boolean;
|
|
1899
|
+
ok: U extends SuccessStatusCode ? true : U extends Exclude<StatusCode, SuccessStatusCode> ? false : boolean;
|
|
1900
|
+
status: U;
|
|
1901
|
+
statusText: string;
|
|
1902
|
+
headers: Headers;
|
|
1903
|
+
url: string;
|
|
1904
|
+
redirect(url: string, status: number): Response$1;
|
|
1905
|
+
clone(): Response$1;
|
|
1906
|
+
json(): F extends 'text' ? Promise<never> : F extends 'json' ? Promise<T> : Promise<unknown>;
|
|
1907
|
+
text(): F extends 'text' ? (T extends string ? Promise<T> : Promise<never>) : Promise<string>;
|
|
1908
|
+
blob(): Promise<Blob>;
|
|
1909
|
+
formData(): Promise<FormData>;
|
|
1910
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
1911
|
+
}
|
|
1912
|
+
type BuildSearch<Arg, Key extends 'query'> = Arg extends {
|
|
1913
|
+
[K in Key]: infer Query;
|
|
1914
|
+
} ? IsEmptyObject<Query> extends true ? '' : `?${string}` : '';
|
|
1915
|
+
type BuildPathname<P extends string, Arg> = Arg extends {
|
|
1916
|
+
param: infer Param;
|
|
1917
|
+
} ? `${ApplyParam<TrimStartSlash<P>, Param>}` : `/${TrimStartSlash<P>}`;
|
|
1918
|
+
type BuildTypedURL<Protocol extends string, Host extends string, Port extends string, P extends string, Arg> = TypedURL<`${Protocol}:`, Host, Port, BuildPathname<P, Arg>, BuildSearch<Arg, 'query'>>;
|
|
1919
|
+
type HonoURL<Prefix extends string, Path extends string, Arg> = IsLiteral<Prefix> extends true ? TrimEndSlash<Prefix> extends `${infer Protocol}://${infer Rest}` ? Rest extends `${infer Hostname}/${infer P}` ? ParseHostName<Hostname> extends [infer Host extends string, infer Port extends string] ? BuildTypedURL<Protocol, Host, Port, P, Arg> : never : ParseHostName<Rest> extends [infer Host extends string, infer Port extends string] ? BuildTypedURL<Protocol, Host, Port, Path, Arg> : never : URL : URL;
|
|
1920
|
+
type ParseHostName<T extends string> = T extends `${infer Host}:${infer Port}` ? [Host, Port] : [T, ''];
|
|
1921
|
+
type TrimStartSlash<T extends string> = T extends `/${infer R}` ? TrimStartSlash<R> : T;
|
|
1922
|
+
type TrimEndSlash<T extends string> = T extends `${infer R}/` ? TrimEndSlash<R> : T;
|
|
1923
|
+
type IsLiteral<T extends string> = [T] extends [never] ? false : string extends T ? false : true;
|
|
1924
|
+
type ApplyParam<Path extends string, P, Result extends string = ''> = Path extends `${infer Head}/${infer Rest}` ? Head extends `:${infer Param}` ? P extends Record<Param, infer Value extends string> ? IsLiteral<Value> extends true ? ApplyParam<Rest, P, `${Result}/${Value & string}`> : ApplyParam<Rest, P, `${Result}/${Head}`> : ApplyParam<Rest, P, `${Result}/${Head}`> : ApplyParam<Rest, P, `${Result}/${Head}`> : Path extends `:${infer Param}` ? P extends Record<Param, infer Value extends string> ? IsLiteral<Value> extends true ? `${Result}/${Value & string}` : `${Result}/${Path}` : `${Result}/${Path}` : `${Result}/${Path}`;
|
|
1925
|
+
type IsEmptyObject<T> = keyof T extends never ? true : false;
|
|
1926
|
+
interface TypedURL<Protocol extends string, Hostname extends string, Port extends string, Pathname extends string, Search extends string> extends URL {
|
|
1927
|
+
protocol: Protocol;
|
|
1928
|
+
hostname: Hostname;
|
|
1929
|
+
port: Port;
|
|
1930
|
+
host: Port extends '' ? Hostname : `${Hostname}:${Port}`;
|
|
1931
|
+
origin: `${Protocol}//${Hostname}${Port extends '' ? '' : `:${Port}`}`;
|
|
1932
|
+
pathname: Pathname;
|
|
1933
|
+
search: Search;
|
|
1934
|
+
href: `${Protocol}//${Hostname}${Port extends '' ? '' : `:${Port}`}${Pathname}${Search}`;
|
|
1935
|
+
}
|
|
1936
|
+
interface Response$1 extends ClientResponse<unknown> {
|
|
1937
|
+
}
|
|
1938
|
+
type PathToChain<Prefix extends string, Path extends string, E extends Schema, Original extends string = Path> = Path extends `/${infer P}` ? PathToChain<Prefix, P, E, Path> : Path extends `${infer P}/${infer R}` ? {
|
|
1939
|
+
[K in P]: PathToChain<Prefix, R, E, Original>;
|
|
1940
|
+
} : {
|
|
1941
|
+
[K in Path extends '' ? 'index' : Path]: ClientRequest<Prefix, Original, E extends Record<string, unknown> ? E[Original] : never>;
|
|
1942
|
+
};
|
|
1943
|
+
type Client<T, Prefix extends string> = T extends Hono$1<any, infer S, any> ? S extends Record<infer K, Schema> ? K extends string ? PathToChain<Prefix, K, S> : never : never : never;
|
|
1944
|
+
|
|
1945
|
+
declare const hc: <T extends Hono<any, any, any>, Prefix extends string = string>(baseUrl: Prefix, options?: ClientRequestOptions) => UnionToIntersection<Client<T, Prefix>>;
|
|
1946
|
+
|
|
1947
|
+
declare const createPartnerApiClient: (...args: Parameters<typeof hc>) => {
|
|
1948
|
+
v1: {
|
|
1949
|
+
auth: {
|
|
1950
|
+
token: ClientRequest<string, "/v1/auth/token", {
|
|
1951
|
+
$post: {
|
|
1952
|
+
input: {
|
|
1953
|
+
json: {
|
|
1954
|
+
email: string;
|
|
1955
|
+
password: string;
|
|
1956
|
+
};
|
|
1957
|
+
};
|
|
1958
|
+
output: {
|
|
1959
|
+
message: string;
|
|
1960
|
+
accessToken: string;
|
|
1961
|
+
refreshToken: string;
|
|
1962
|
+
};
|
|
1963
|
+
outputFormat: "json";
|
|
1964
|
+
status: 200;
|
|
1965
|
+
} | {
|
|
1966
|
+
input: {
|
|
1967
|
+
json: {
|
|
1968
|
+
email: string;
|
|
1969
|
+
password: string;
|
|
1970
|
+
};
|
|
1971
|
+
};
|
|
1972
|
+
output: {
|
|
1973
|
+
message: string;
|
|
1974
|
+
};
|
|
1975
|
+
outputFormat: "json";
|
|
1976
|
+
status: 401;
|
|
1977
|
+
};
|
|
1978
|
+
}>;
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
} & {
|
|
1982
|
+
v1: {
|
|
1983
|
+
auth: {
|
|
1984
|
+
token: {
|
|
1985
|
+
refresh: ClientRequest<string, "/v1/auth/token/refresh", {
|
|
1986
|
+
$put: {
|
|
1987
|
+
input: {
|
|
1988
|
+
json: {
|
|
1989
|
+
refreshToken: string;
|
|
1990
|
+
};
|
|
1991
|
+
};
|
|
1992
|
+
output: {
|
|
1993
|
+
message: string;
|
|
1994
|
+
accessToken: string;
|
|
1995
|
+
refreshToken: string;
|
|
1996
|
+
};
|
|
1997
|
+
outputFormat: "json";
|
|
1998
|
+
status: 200;
|
|
1999
|
+
} | {
|
|
2000
|
+
input: {
|
|
2001
|
+
json: {
|
|
2002
|
+
refreshToken: string;
|
|
2003
|
+
};
|
|
2004
|
+
};
|
|
2005
|
+
output: {
|
|
2006
|
+
message: string;
|
|
2007
|
+
};
|
|
2008
|
+
outputFormat: "json";
|
|
2009
|
+
status: 401;
|
|
2010
|
+
};
|
|
2011
|
+
}>;
|
|
2012
|
+
};
|
|
2013
|
+
};
|
|
2014
|
+
};
|
|
2015
|
+
} & {
|
|
2016
|
+
v1: {
|
|
2017
|
+
bank: {
|
|
2018
|
+
auth: {
|
|
2019
|
+
"get-auth-uri": ClientRequest<string, "/v1/bank/auth/get-auth-uri", {
|
|
2020
|
+
$get: {
|
|
2021
|
+
input: {
|
|
2022
|
+
query: {
|
|
2023
|
+
connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
|
|
2024
|
+
};
|
|
2025
|
+
};
|
|
2026
|
+
output: {
|
|
2027
|
+
message: string;
|
|
2028
|
+
uri: string;
|
|
2029
|
+
};
|
|
2030
|
+
outputFormat: "json";
|
|
2031
|
+
status: 200;
|
|
2032
|
+
} | {
|
|
2033
|
+
input: {
|
|
2034
|
+
query: {
|
|
2035
|
+
connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA" | "DBU" | "CSAS" | "AIRBANK" | "KB" | "CSOB";
|
|
2036
|
+
};
|
|
2037
|
+
};
|
|
2038
|
+
output: {
|
|
2039
|
+
message: string;
|
|
2040
|
+
};
|
|
2041
|
+
outputFormat: "json";
|
|
2042
|
+
status: 500;
|
|
2043
|
+
};
|
|
2044
|
+
}>;
|
|
2045
|
+
};
|
|
2046
|
+
};
|
|
2047
|
+
};
|
|
2048
|
+
} & {
|
|
2049
|
+
v1: {
|
|
2050
|
+
bank: {
|
|
2051
|
+
callback: ClientRequest<string, "/v1/bank/callback", {
|
|
2052
|
+
$get: {
|
|
2053
|
+
input: {
|
|
2054
|
+
query: {
|
|
2055
|
+
[x: string]: string;
|
|
2056
|
+
type: "auth" | "batch";
|
|
2057
|
+
ott?: string | undefined;
|
|
2058
|
+
batchId?: string | undefined;
|
|
2059
|
+
};
|
|
2060
|
+
};
|
|
2061
|
+
output: {};
|
|
2062
|
+
outputFormat: string;
|
|
2063
|
+
status: 302;
|
|
2064
|
+
} | {
|
|
2065
|
+
input: {
|
|
2066
|
+
query: {
|
|
2067
|
+
[x: string]: string;
|
|
2068
|
+
type: "auth" | "batch";
|
|
2069
|
+
ott?: string | undefined;
|
|
2070
|
+
batchId?: string | undefined;
|
|
2071
|
+
};
|
|
2072
|
+
};
|
|
2073
|
+
output: {
|
|
2074
|
+
message: string;
|
|
2075
|
+
};
|
|
2076
|
+
outputFormat: "json";
|
|
2077
|
+
status: 200;
|
|
2078
|
+
} | {
|
|
2079
|
+
input: {
|
|
2080
|
+
query: {
|
|
2081
|
+
[x: string]: string;
|
|
2082
|
+
type: "auth" | "batch";
|
|
2083
|
+
ott?: string | undefined;
|
|
2084
|
+
batchId?: string | undefined;
|
|
2085
|
+
};
|
|
2086
|
+
};
|
|
2087
|
+
output: {
|
|
2088
|
+
message: string;
|
|
2089
|
+
};
|
|
2090
|
+
outputFormat: "json";
|
|
2091
|
+
status: 400;
|
|
2092
|
+
} | {
|
|
2093
|
+
input: {
|
|
2094
|
+
query: {
|
|
2095
|
+
[x: string]: string;
|
|
2096
|
+
type: "auth" | "batch";
|
|
2097
|
+
ott?: string | undefined;
|
|
2098
|
+
batchId?: string | undefined;
|
|
2099
|
+
};
|
|
2100
|
+
};
|
|
2101
|
+
output: {
|
|
2102
|
+
message: string;
|
|
2103
|
+
};
|
|
2104
|
+
outputFormat: "json";
|
|
2105
|
+
status: 500;
|
|
2106
|
+
};
|
|
2107
|
+
}>;
|
|
2108
|
+
};
|
|
2109
|
+
};
|
|
2110
|
+
} & {
|
|
2111
|
+
v1: {
|
|
2112
|
+
observability: {
|
|
2113
|
+
"health-check": ClientRequest<string, "/v1/observability/health-check", {
|
|
2114
|
+
$get: {
|
|
2115
|
+
input: {};
|
|
2116
|
+
output: {
|
|
2117
|
+
message: string;
|
|
2118
|
+
};
|
|
2119
|
+
outputFormat: "json";
|
|
2120
|
+
status: 200;
|
|
2121
|
+
};
|
|
2122
|
+
}>;
|
|
2123
|
+
};
|
|
2124
|
+
};
|
|
2125
|
+
} & {
|
|
2126
|
+
v1: {
|
|
2127
|
+
organization: ClientRequest<string, "/v1/organization", {
|
|
2128
|
+
$get: {
|
|
2129
|
+
input: {};
|
|
2130
|
+
output: {
|
|
2131
|
+
message: string;
|
|
2132
|
+
balance: {
|
|
2133
|
+
amount: number;
|
|
2134
|
+
currency: string;
|
|
2135
|
+
};
|
|
2136
|
+
organization: {
|
|
2137
|
+
id: string;
|
|
2138
|
+
name: string;
|
|
2139
|
+
webhook: string;
|
|
2140
|
+
ipAuthorization: boolean;
|
|
2141
|
+
signatureKeyLimit: number;
|
|
2142
|
+
state: string;
|
|
2143
|
+
signatureKeys: {
|
|
2144
|
+
name: string;
|
|
2145
|
+
publicKey: string;
|
|
2146
|
+
}[];
|
|
2147
|
+
authorizedIps: {
|
|
2148
|
+
ip: string;
|
|
2149
|
+
}[];
|
|
2150
|
+
users: {
|
|
2151
|
+
id: string;
|
|
2152
|
+
email: string;
|
|
2153
|
+
role: string;
|
|
2154
|
+
}[];
|
|
2155
|
+
bankAccounts?: {
|
|
2156
|
+
iban: string;
|
|
2157
|
+
currency: "CZK" | "EUR" | "USD";
|
|
2158
|
+
}[] | null | undefined;
|
|
2159
|
+
};
|
|
2160
|
+
};
|
|
2161
|
+
outputFormat: "json";
|
|
2162
|
+
status: 200;
|
|
2163
|
+
} | {
|
|
2164
|
+
input: {};
|
|
2165
|
+
output: {
|
|
2166
|
+
message: string;
|
|
2167
|
+
};
|
|
2168
|
+
outputFormat: "json";
|
|
2169
|
+
status: 500;
|
|
2170
|
+
};
|
|
2171
|
+
}>;
|
|
2172
|
+
};
|
|
2173
|
+
} & {
|
|
2174
|
+
v1: {
|
|
2175
|
+
organizations: {
|
|
2176
|
+
":id": {
|
|
2177
|
+
accounts: ClientRequest<string, "/v1/organizations/:id/accounts", {
|
|
2178
|
+
$get: {
|
|
2179
|
+
input: {
|
|
2180
|
+
param: {
|
|
2181
|
+
id: string;
|
|
2182
|
+
} & {
|
|
2183
|
+
[x: string]: string;
|
|
2184
|
+
[x: number]: string;
|
|
2185
|
+
[x: symbol]: string;
|
|
2186
|
+
};
|
|
2187
|
+
query: {
|
|
2188
|
+
page?: string | undefined;
|
|
2189
|
+
limit?: string | undefined;
|
|
2190
|
+
};
|
|
2191
|
+
};
|
|
2192
|
+
output: {
|
|
2193
|
+
accounts: {
|
|
2194
|
+
id: string;
|
|
2195
|
+
status: "ACTIVE" | "INACTIVE" | "BLOCKED" | "DISABLED";
|
|
2196
|
+
accountHolderName: string | null;
|
|
2197
|
+
iban: string | null;
|
|
2198
|
+
accountNumber: string;
|
|
2199
|
+
bankCode: string;
|
|
2200
|
+
swiftBic: string | null;
|
|
2201
|
+
currency: string;
|
|
2202
|
+
countryCode: string;
|
|
2203
|
+
}[];
|
|
2204
|
+
pagination: {
|
|
2205
|
+
page: number;
|
|
2206
|
+
pageSize: number;
|
|
2207
|
+
totalPages: number;
|
|
2208
|
+
totalCount: number;
|
|
2209
|
+
hasNext: boolean;
|
|
2210
|
+
hasPrevious: boolean;
|
|
2211
|
+
};
|
|
2212
|
+
};
|
|
2213
|
+
outputFormat: "json";
|
|
2214
|
+
status: 200;
|
|
2215
|
+
} | {
|
|
2216
|
+
input: {
|
|
2217
|
+
param: {
|
|
2218
|
+
id: string;
|
|
2219
|
+
} & {
|
|
2220
|
+
[x: string]: string;
|
|
2221
|
+
[x: number]: string;
|
|
2222
|
+
[x: symbol]: string;
|
|
2223
|
+
};
|
|
2224
|
+
query: {
|
|
2225
|
+
page?: string | undefined;
|
|
2226
|
+
limit?: string | undefined;
|
|
2227
|
+
};
|
|
2228
|
+
};
|
|
2229
|
+
output: {
|
|
2230
|
+
message: string;
|
|
2231
|
+
};
|
|
2232
|
+
outputFormat: "json";
|
|
2233
|
+
status: 404;
|
|
2234
|
+
} | {
|
|
2235
|
+
input: {
|
|
2236
|
+
param: {
|
|
2237
|
+
id: string;
|
|
2238
|
+
} & {
|
|
2239
|
+
[x: string]: string;
|
|
2240
|
+
[x: number]: string;
|
|
2241
|
+
[x: symbol]: string;
|
|
2242
|
+
};
|
|
2243
|
+
query: {
|
|
2244
|
+
page?: string | undefined;
|
|
2245
|
+
limit?: string | undefined;
|
|
2246
|
+
};
|
|
2247
|
+
};
|
|
2248
|
+
output: {
|
|
2249
|
+
message: string;
|
|
2250
|
+
};
|
|
2251
|
+
outputFormat: "json";
|
|
2252
|
+
status: 500;
|
|
2253
|
+
};
|
|
2254
|
+
}>;
|
|
2255
|
+
};
|
|
2256
|
+
};
|
|
2257
|
+
};
|
|
2258
|
+
} & {
|
|
2259
|
+
v1: {
|
|
2260
|
+
organizations: {
|
|
2261
|
+
":id": {
|
|
2262
|
+
payments: ClientRequest<string, "/v1/organizations/:id/payments", {
|
|
2263
|
+
$get: {
|
|
2264
|
+
input: {
|
|
2265
|
+
param: {
|
|
2266
|
+
id: string;
|
|
2267
|
+
} & {
|
|
2268
|
+
[x: string]: string;
|
|
2269
|
+
[x: number]: string;
|
|
2270
|
+
[x: symbol]: string;
|
|
2271
|
+
};
|
|
2272
|
+
query: {
|
|
2273
|
+
page?: string | undefined;
|
|
2274
|
+
limit?: string | undefined;
|
|
2275
|
+
sortColumn?: "amount" | "createdAt" | "updatedAt" | undefined;
|
|
2276
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
2277
|
+
filterStatus?: "CREATED" | "PREPARED" | "SIGNED" | "PENDING" | "COMPLETED" | "FAILED" | ("CREATED" | "PREPARED" | "SIGNED" | "PENDING" | "COMPLETED" | "FAILED")[] | undefined;
|
|
2278
|
+
filterPaymentType?: "DOMESTIC" | "SEPA" | "SWIFT" | ("DOMESTIC" | "SEPA" | "SWIFT")[] | undefined;
|
|
2279
|
+
filterCurrency?: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX" | ("CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX")[] | undefined;
|
|
2280
|
+
filterMinAmount?: string | undefined;
|
|
2281
|
+
filterMaxAmount?: string | undefined;
|
|
2282
|
+
filterBatchId?: string | undefined;
|
|
2283
|
+
filterCreditorIban?: string | undefined;
|
|
2284
|
+
filterDebtorIban?: string | undefined;
|
|
2285
|
+
filterDateFrom?: string | undefined;
|
|
2286
|
+
filterDateTo?: string | undefined;
|
|
2287
|
+
filterVariableSymbol?: string | undefined;
|
|
2288
|
+
filterSpecificSymbol?: string | undefined;
|
|
2289
|
+
filterConstantSymbol?: string | undefined;
|
|
2290
|
+
filterMessage?: string | undefined;
|
|
2291
|
+
filterBankRefId?: string | undefined;
|
|
2292
|
+
filterPaymentId?: string | undefined;
|
|
2293
|
+
filterDirection?: "INCOMING" | "OUTGOING" | undefined;
|
|
2294
|
+
filterSource?: "API" | "BANK" | undefined;
|
|
2295
|
+
};
|
|
2296
|
+
};
|
|
2297
|
+
output: {
|
|
2298
|
+
payments: {
|
|
2299
|
+
id: string;
|
|
2300
|
+
source: "API" | "BANK";
|
|
2301
|
+
status: string;
|
|
2302
|
+
direction: "INCOMING" | "OUTGOING";
|
|
2303
|
+
type: string;
|
|
2304
|
+
amount: {
|
|
2305
|
+
value: number;
|
|
2306
|
+
currency: string;
|
|
2307
|
+
};
|
|
2308
|
+
debtor: {
|
|
2309
|
+
name: string | null;
|
|
2310
|
+
iban: string | null;
|
|
2311
|
+
accountId?: string | undefined;
|
|
2312
|
+
bankCode?: string | undefined;
|
|
2313
|
+
};
|
|
2314
|
+
creditor: {
|
|
2315
|
+
name: string | null;
|
|
2316
|
+
iban?: string | undefined;
|
|
2317
|
+
bankCode?: string | undefined;
|
|
2318
|
+
swiftBic?: string | undefined;
|
|
2319
|
+
address?: string | undefined;
|
|
2320
|
+
};
|
|
2321
|
+
dates: {
|
|
2322
|
+
created: string | null;
|
|
2323
|
+
initiated?: string | undefined;
|
|
2324
|
+
processed?: string | undefined;
|
|
2325
|
+
updated?: string | undefined;
|
|
2326
|
+
};
|
|
2327
|
+
referenceId?: string | undefined;
|
|
2328
|
+
bankRefId?: string | undefined;
|
|
2329
|
+
authorization?: {
|
|
2330
|
+
url: string;
|
|
2331
|
+
} | undefined;
|
|
2332
|
+
remittanceInfo?: {
|
|
2333
|
+
message?: string | undefined;
|
|
2334
|
+
variableSymbol?: string | undefined;
|
|
2335
|
+
specificSymbol?: string | undefined;
|
|
2336
|
+
constantSymbol?: string | undefined;
|
|
2337
|
+
} | undefined;
|
|
2338
|
+
statusReason?: string | undefined;
|
|
2339
|
+
batch?: {
|
|
2340
|
+
id: string;
|
|
2341
|
+
} | undefined;
|
|
2342
|
+
}[];
|
|
2343
|
+
pagination: {
|
|
2344
|
+
page: number;
|
|
2345
|
+
pageSize: number;
|
|
2346
|
+
totalPages: number;
|
|
2347
|
+
totalCount: number;
|
|
2348
|
+
hasNext: boolean;
|
|
2349
|
+
hasPrevious: boolean;
|
|
2350
|
+
};
|
|
2351
|
+
};
|
|
2352
|
+
outputFormat: "json";
|
|
2353
|
+
status: 200;
|
|
2354
|
+
} | {
|
|
2355
|
+
input: {
|
|
2356
|
+
param: {
|
|
2357
|
+
id: string;
|
|
2358
|
+
} & {
|
|
2359
|
+
[x: string]: string;
|
|
2360
|
+
[x: number]: string;
|
|
2361
|
+
[x: symbol]: string;
|
|
2362
|
+
};
|
|
2363
|
+
query: {
|
|
2364
|
+
page?: string | undefined;
|
|
2365
|
+
limit?: string | undefined;
|
|
2366
|
+
sortColumn?: "amount" | "createdAt" | "updatedAt" | undefined;
|
|
2367
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
2368
|
+
filterStatus?: "CREATED" | "PREPARED" | "SIGNED" | "PENDING" | "COMPLETED" | "FAILED" | ("CREATED" | "PREPARED" | "SIGNED" | "PENDING" | "COMPLETED" | "FAILED")[] | undefined;
|
|
2369
|
+
filterPaymentType?: "DOMESTIC" | "SEPA" | "SWIFT" | ("DOMESTIC" | "SEPA" | "SWIFT")[] | undefined;
|
|
2370
|
+
filterCurrency?: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX" | ("CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX")[] | undefined;
|
|
2371
|
+
filterMinAmount?: string | undefined;
|
|
2372
|
+
filterMaxAmount?: string | undefined;
|
|
2373
|
+
filterBatchId?: string | undefined;
|
|
2374
|
+
filterCreditorIban?: string | undefined;
|
|
2375
|
+
filterDebtorIban?: string | undefined;
|
|
2376
|
+
filterDateFrom?: string | undefined;
|
|
2377
|
+
filterDateTo?: string | undefined;
|
|
2378
|
+
filterVariableSymbol?: string | undefined;
|
|
2379
|
+
filterSpecificSymbol?: string | undefined;
|
|
2380
|
+
filterConstantSymbol?: string | undefined;
|
|
2381
|
+
filterMessage?: string | undefined;
|
|
2382
|
+
filterBankRefId?: string | undefined;
|
|
2383
|
+
filterPaymentId?: string | undefined;
|
|
2384
|
+
filterDirection?: "INCOMING" | "OUTGOING" | undefined;
|
|
2385
|
+
filterSource?: "API" | "BANK" | undefined;
|
|
2386
|
+
};
|
|
2387
|
+
};
|
|
2388
|
+
output: {
|
|
2389
|
+
message: string;
|
|
2390
|
+
};
|
|
2391
|
+
outputFormat: "json";
|
|
2392
|
+
status: 500;
|
|
2393
|
+
};
|
|
2394
|
+
} & {
|
|
2395
|
+
$post: {
|
|
2396
|
+
input: {
|
|
2397
|
+
param: {
|
|
2398
|
+
id: string;
|
|
2399
|
+
} & {
|
|
2400
|
+
[x: string]: string;
|
|
2401
|
+
[x: number]: string;
|
|
2402
|
+
[x: symbol]: string;
|
|
2403
|
+
};
|
|
2404
|
+
header: {
|
|
2405
|
+
'x-idempotency-key': string;
|
|
2406
|
+
};
|
|
2407
|
+
json: {
|
|
2408
|
+
paymentType: "DOMESTIC" | "SEPA" | "SWIFT";
|
|
2409
|
+
amount: {
|
|
2410
|
+
value: number;
|
|
2411
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
2412
|
+
};
|
|
2413
|
+
debtorAccountId: string;
|
|
2414
|
+
creditor: {
|
|
2415
|
+
name: string;
|
|
2416
|
+
iban?: string | undefined;
|
|
2417
|
+
accountNumber?: string | undefined;
|
|
2418
|
+
bankCode?: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500" | undefined;
|
|
2419
|
+
swiftBic?: string | undefined;
|
|
2420
|
+
sortCode?: string | undefined;
|
|
2421
|
+
routingNumber?: string | undefined;
|
|
2422
|
+
clabe?: string | undefined;
|
|
2423
|
+
bsb?: string | undefined;
|
|
2424
|
+
brBankNumber?: string | undefined;
|
|
2425
|
+
address?: {
|
|
2426
|
+
streetName?: string | undefined;
|
|
2427
|
+
buildingNumber?: string | undefined;
|
|
2428
|
+
city?: string | undefined;
|
|
2429
|
+
postalCode?: string | undefined;
|
|
2430
|
+
countryCode?: string | undefined;
|
|
2431
|
+
} | undefined;
|
|
2432
|
+
};
|
|
2433
|
+
referenceId?: string | undefined;
|
|
2434
|
+
remittanceInfo?: {
|
|
2435
|
+
message?: string | undefined;
|
|
2436
|
+
variableSymbol?: string | undefined;
|
|
2437
|
+
constantSymbol?: string | undefined;
|
|
2438
|
+
specificSymbol?: string | undefined;
|
|
2439
|
+
} | undefined;
|
|
2440
|
+
instructionPriority?: "NORMAL" | "HIGH" | "INSTANT" | undefined;
|
|
2441
|
+
chargeBearer?: "SHA" | "OUR" | "BEN" | undefined;
|
|
2442
|
+
};
|
|
2443
|
+
};
|
|
2444
|
+
output: {
|
|
2445
|
+
paymentId: string;
|
|
2446
|
+
status: "accepted";
|
|
2447
|
+
queuedAt: string;
|
|
2448
|
+
processing: {
|
|
2449
|
+
priority: "NORMAL" | "HIGH" | "INSTANT";
|
|
2450
|
+
estimatedCompletion: string;
|
|
2451
|
+
};
|
|
2452
|
+
referenceId?: string | undefined;
|
|
2453
|
+
};
|
|
2454
|
+
outputFormat: "json";
|
|
2455
|
+
status: 202;
|
|
2456
|
+
} | {
|
|
2457
|
+
input: {
|
|
2458
|
+
param: {
|
|
2459
|
+
id: string;
|
|
2460
|
+
} & {
|
|
2461
|
+
[x: string]: string;
|
|
2462
|
+
[x: number]: string;
|
|
2463
|
+
[x: symbol]: string;
|
|
2464
|
+
};
|
|
2465
|
+
header: {
|
|
2466
|
+
'x-idempotency-key': string;
|
|
2467
|
+
};
|
|
2468
|
+
json: {
|
|
2469
|
+
paymentType: "DOMESTIC" | "SEPA" | "SWIFT";
|
|
2470
|
+
amount: {
|
|
2471
|
+
value: number;
|
|
2472
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
2473
|
+
};
|
|
2474
|
+
debtorAccountId: string;
|
|
2475
|
+
creditor: {
|
|
2476
|
+
name: string;
|
|
2477
|
+
iban?: string | undefined;
|
|
2478
|
+
accountNumber?: string | undefined;
|
|
2479
|
+
bankCode?: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500" | undefined;
|
|
2480
|
+
swiftBic?: string | undefined;
|
|
2481
|
+
sortCode?: string | undefined;
|
|
2482
|
+
routingNumber?: string | undefined;
|
|
2483
|
+
clabe?: string | undefined;
|
|
2484
|
+
bsb?: string | undefined;
|
|
2485
|
+
brBankNumber?: string | undefined;
|
|
2486
|
+
address?: {
|
|
2487
|
+
streetName?: string | undefined;
|
|
2488
|
+
buildingNumber?: string | undefined;
|
|
2489
|
+
city?: string | undefined;
|
|
2490
|
+
postalCode?: string | undefined;
|
|
2491
|
+
countryCode?: string | undefined;
|
|
2492
|
+
} | undefined;
|
|
2493
|
+
};
|
|
2494
|
+
referenceId?: string | undefined;
|
|
2495
|
+
remittanceInfo?: {
|
|
2496
|
+
message?: string | undefined;
|
|
2497
|
+
variableSymbol?: string | undefined;
|
|
2498
|
+
constantSymbol?: string | undefined;
|
|
2499
|
+
specificSymbol?: string | undefined;
|
|
2500
|
+
} | undefined;
|
|
2501
|
+
instructionPriority?: "NORMAL" | "HIGH" | "INSTANT" | undefined;
|
|
2502
|
+
chargeBearer?: "SHA" | "OUR" | "BEN" | undefined;
|
|
2503
|
+
};
|
|
2504
|
+
};
|
|
2505
|
+
output: {
|
|
2506
|
+
message: string;
|
|
2507
|
+
};
|
|
2508
|
+
outputFormat: "json";
|
|
2509
|
+
status: 404;
|
|
2510
|
+
} | {
|
|
2511
|
+
input: {
|
|
2512
|
+
param: {
|
|
2513
|
+
id: string;
|
|
2514
|
+
} & {
|
|
2515
|
+
[x: string]: string;
|
|
2516
|
+
[x: number]: string;
|
|
2517
|
+
[x: symbol]: string;
|
|
2518
|
+
};
|
|
2519
|
+
header: {
|
|
2520
|
+
'x-idempotency-key': string;
|
|
2521
|
+
};
|
|
2522
|
+
json: {
|
|
2523
|
+
paymentType: "DOMESTIC" | "SEPA" | "SWIFT";
|
|
2524
|
+
amount: {
|
|
2525
|
+
value: number;
|
|
2526
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
2527
|
+
};
|
|
2528
|
+
debtorAccountId: string;
|
|
2529
|
+
creditor: {
|
|
2530
|
+
name: string;
|
|
2531
|
+
iban?: string | undefined;
|
|
2532
|
+
accountNumber?: string | undefined;
|
|
2533
|
+
bankCode?: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500" | undefined;
|
|
2534
|
+
swiftBic?: string | undefined;
|
|
2535
|
+
sortCode?: string | undefined;
|
|
2536
|
+
routingNumber?: string | undefined;
|
|
2537
|
+
clabe?: string | undefined;
|
|
2538
|
+
bsb?: string | undefined;
|
|
2539
|
+
brBankNumber?: string | undefined;
|
|
2540
|
+
address?: {
|
|
2541
|
+
streetName?: string | undefined;
|
|
2542
|
+
buildingNumber?: string | undefined;
|
|
2543
|
+
city?: string | undefined;
|
|
2544
|
+
postalCode?: string | undefined;
|
|
2545
|
+
countryCode?: string | undefined;
|
|
2546
|
+
} | undefined;
|
|
2547
|
+
};
|
|
2548
|
+
referenceId?: string | undefined;
|
|
2549
|
+
remittanceInfo?: {
|
|
2550
|
+
message?: string | undefined;
|
|
2551
|
+
variableSymbol?: string | undefined;
|
|
2552
|
+
constantSymbol?: string | undefined;
|
|
2553
|
+
specificSymbol?: string | undefined;
|
|
2554
|
+
} | undefined;
|
|
2555
|
+
instructionPriority?: "NORMAL" | "HIGH" | "INSTANT" | undefined;
|
|
2556
|
+
chargeBearer?: "SHA" | "OUR" | "BEN" | undefined;
|
|
2557
|
+
};
|
|
2558
|
+
};
|
|
2559
|
+
output: {
|
|
2560
|
+
message: string;
|
|
2561
|
+
};
|
|
2562
|
+
outputFormat: "json";
|
|
2563
|
+
status: 500;
|
|
2564
|
+
};
|
|
2565
|
+
}>;
|
|
2566
|
+
};
|
|
2567
|
+
};
|
|
2568
|
+
};
|
|
2569
|
+
} & {
|
|
2570
|
+
v1: {
|
|
2571
|
+
organizations: {
|
|
2572
|
+
":id": {
|
|
2573
|
+
payments: {
|
|
2574
|
+
":paymentId": ClientRequest<string, "/v1/organizations/:id/payments/:paymentId", {
|
|
2575
|
+
$get: {
|
|
2576
|
+
input: {
|
|
2577
|
+
param: {
|
|
2578
|
+
id: string;
|
|
2579
|
+
paymentId: string;
|
|
2580
|
+
} & {
|
|
2581
|
+
id: string;
|
|
2582
|
+
paymentId: string;
|
|
2583
|
+
};
|
|
2584
|
+
};
|
|
2585
|
+
output: {
|
|
2586
|
+
id: string;
|
|
2587
|
+
source: "API" | "BANK";
|
|
2588
|
+
status: string;
|
|
2589
|
+
direction: "INCOMING" | "OUTGOING";
|
|
2590
|
+
type: string;
|
|
2591
|
+
amount: {
|
|
2592
|
+
value: number;
|
|
2593
|
+
currency: string;
|
|
2594
|
+
};
|
|
2595
|
+
debtor: {
|
|
2596
|
+
name: string | null;
|
|
2597
|
+
iban: string | null;
|
|
2598
|
+
accountId?: string | undefined;
|
|
2599
|
+
bankCode?: string | undefined;
|
|
2600
|
+
};
|
|
2601
|
+
creditor: {
|
|
2602
|
+
name: string | null;
|
|
2603
|
+
iban?: string | undefined;
|
|
2604
|
+
bankCode?: string | undefined;
|
|
2605
|
+
swiftBic?: string | undefined;
|
|
2606
|
+
address?: string | undefined;
|
|
2607
|
+
};
|
|
2608
|
+
dates: {
|
|
2609
|
+
created: string | null;
|
|
2610
|
+
initiated?: string | undefined;
|
|
2611
|
+
processed?: string | undefined;
|
|
2612
|
+
updated?: string | undefined;
|
|
2613
|
+
};
|
|
2614
|
+
referenceId?: string | undefined;
|
|
2615
|
+
bankRefId?: string | undefined;
|
|
2616
|
+
authorization?: {
|
|
2617
|
+
url: string;
|
|
2618
|
+
} | undefined;
|
|
2619
|
+
remittanceInfo?: {
|
|
2620
|
+
message?: string | undefined;
|
|
2621
|
+
variableSymbol?: string | undefined;
|
|
2622
|
+
specificSymbol?: string | undefined;
|
|
2623
|
+
constantSymbol?: string | undefined;
|
|
2624
|
+
} | undefined;
|
|
2625
|
+
statusReason?: string | undefined;
|
|
2626
|
+
batch?: {
|
|
2627
|
+
id: string;
|
|
2628
|
+
} | undefined;
|
|
2629
|
+
chargeBearer?: string | undefined;
|
|
2630
|
+
instructionPriority?: string | undefined;
|
|
2631
|
+
};
|
|
2632
|
+
outputFormat: "json";
|
|
2633
|
+
status: 200;
|
|
2634
|
+
} | {
|
|
2635
|
+
input: {
|
|
2636
|
+
param: {
|
|
2637
|
+
id: string;
|
|
2638
|
+
paymentId: string;
|
|
2639
|
+
} & {
|
|
2640
|
+
id: string;
|
|
2641
|
+
paymentId: string;
|
|
2642
|
+
};
|
|
2643
|
+
};
|
|
2644
|
+
output: {
|
|
2645
|
+
message: string;
|
|
2646
|
+
};
|
|
2647
|
+
outputFormat: "json";
|
|
2648
|
+
status: 404;
|
|
2649
|
+
} | {
|
|
2650
|
+
input: {
|
|
2651
|
+
param: {
|
|
2652
|
+
id: string;
|
|
2653
|
+
paymentId: string;
|
|
2654
|
+
} & {
|
|
2655
|
+
id: string;
|
|
2656
|
+
paymentId: string;
|
|
2657
|
+
};
|
|
2658
|
+
};
|
|
2659
|
+
output: {
|
|
2660
|
+
message: string;
|
|
2661
|
+
};
|
|
2662
|
+
outputFormat: "json";
|
|
2663
|
+
status: 500;
|
|
2664
|
+
};
|
|
2665
|
+
}>;
|
|
2666
|
+
};
|
|
2667
|
+
};
|
|
2668
|
+
};
|
|
2669
|
+
};
|
|
2670
|
+
} & {
|
|
2671
|
+
v1: {
|
|
2672
|
+
organization: {
|
|
2673
|
+
"signature-keys": ClientRequest<string, "/v1/organization/signature-keys", {
|
|
2674
|
+
$post: {
|
|
2675
|
+
input: {
|
|
2676
|
+
header: {
|
|
2677
|
+
'X-Idempotency-Key': string;
|
|
2678
|
+
};
|
|
2679
|
+
} & {
|
|
2680
|
+
json: {
|
|
2681
|
+
name: string;
|
|
2682
|
+
};
|
|
2683
|
+
};
|
|
2684
|
+
output: {
|
|
2685
|
+
message: string;
|
|
2686
|
+
publicKey: string;
|
|
2687
|
+
privateKey: string;
|
|
2688
|
+
};
|
|
2689
|
+
outputFormat: "json";
|
|
2690
|
+
status: 200;
|
|
2691
|
+
} | {
|
|
2692
|
+
input: {
|
|
2693
|
+
header: {
|
|
2694
|
+
'X-Idempotency-Key': string;
|
|
2695
|
+
};
|
|
2696
|
+
} & {
|
|
2697
|
+
json: {
|
|
2698
|
+
name: string;
|
|
2699
|
+
};
|
|
2700
|
+
};
|
|
2701
|
+
output: {
|
|
2702
|
+
message: string;
|
|
2703
|
+
};
|
|
2704
|
+
outputFormat: "json";
|
|
2705
|
+
status: 500;
|
|
2706
|
+
};
|
|
2707
|
+
} & {
|
|
2708
|
+
$get: {
|
|
2709
|
+
input: {};
|
|
2710
|
+
output: {
|
|
2711
|
+
message: string;
|
|
2712
|
+
signatureKeys: {
|
|
2713
|
+
name: string;
|
|
2714
|
+
publicKey: string;
|
|
2715
|
+
}[];
|
|
2716
|
+
};
|
|
2717
|
+
outputFormat: "json";
|
|
2718
|
+
status: 200;
|
|
2719
|
+
} | {
|
|
2720
|
+
input: {};
|
|
2721
|
+
output: {
|
|
2722
|
+
message: string;
|
|
2723
|
+
};
|
|
2724
|
+
outputFormat: "json";
|
|
2725
|
+
status: 500;
|
|
2726
|
+
};
|
|
2727
|
+
}>;
|
|
2728
|
+
};
|
|
2729
|
+
};
|
|
2730
|
+
} & {
|
|
2731
|
+
v1: {
|
|
2732
|
+
organization: {
|
|
2733
|
+
"signature-keys": {
|
|
2734
|
+
":name": ClientRequest<string, "/v1/organization/signature-keys/:name", {
|
|
2735
|
+
$delete: {
|
|
2736
|
+
input: {
|
|
2737
|
+
param: {
|
|
2738
|
+
name: string;
|
|
2739
|
+
} & {
|
|
2740
|
+
name: string;
|
|
2741
|
+
};
|
|
2742
|
+
header: {
|
|
2743
|
+
'X-Idempotency-Key': string;
|
|
2744
|
+
};
|
|
2745
|
+
};
|
|
2746
|
+
output: {
|
|
2747
|
+
message: string;
|
|
2748
|
+
};
|
|
2749
|
+
outputFormat: "json";
|
|
2750
|
+
status: 200;
|
|
2751
|
+
} | {
|
|
2752
|
+
input: {
|
|
2753
|
+
param: {
|
|
2754
|
+
name: string;
|
|
2755
|
+
} & {
|
|
2756
|
+
name: string;
|
|
2757
|
+
};
|
|
2758
|
+
header: {
|
|
2759
|
+
'X-Idempotency-Key': string;
|
|
2760
|
+
};
|
|
2761
|
+
};
|
|
2762
|
+
output: {
|
|
2763
|
+
message: string;
|
|
2764
|
+
};
|
|
2765
|
+
outputFormat: "json";
|
|
2766
|
+
status: 500;
|
|
2767
|
+
};
|
|
2768
|
+
}>;
|
|
2769
|
+
};
|
|
2770
|
+
};
|
|
2771
|
+
};
|
|
2772
|
+
} & {
|
|
2773
|
+
v1: {
|
|
2774
|
+
organization: {
|
|
2775
|
+
users: ClientRequest<string, "/v1/organization/users", {
|
|
2776
|
+
$post: {
|
|
2777
|
+
input: {
|
|
2778
|
+
header: {
|
|
2779
|
+
'X-Idempotency-Key': string;
|
|
2780
|
+
};
|
|
2781
|
+
} & {
|
|
2782
|
+
json: {
|
|
2783
|
+
email: string;
|
|
2784
|
+
password: string;
|
|
2785
|
+
roles?: string[] | undefined;
|
|
2786
|
+
scopes?: {
|
|
2787
|
+
scope: "organizations.{jwt.user.rawUserMetaData.organizationId}.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.accounts.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.payments.create" | "organizations.{jwt.user.rawUserMetaData.organizationId}.payments.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.signature-keys.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.signature-keys.create" | "organizations.{jwt.user.rawUserMetaData.organizationId}.signature-keys.delete" | "organizations.{jwt.user.rawUserMetaData.organizationId}.users.create" | "organizations.{jwt.user.rawUserMetaData.organizationId}.users.delete" | "organizations.{jwt.user.rawUserMetaData.organizationId}.users.update" | "organizations.{jwt.user.rawUserMetaData.organizationId}.users.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.transactions.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.transactions.deposit.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.transactions.simulate-deposit.create" | "organizations.{jwt.user.rawUserMetaData.organizationId}.transactions.withdraw.create";
|
|
2788
|
+
resourceId?: string | undefined;
|
|
2789
|
+
}[] | undefined;
|
|
2790
|
+
};
|
|
2791
|
+
};
|
|
2792
|
+
output: {
|
|
2793
|
+
message: string;
|
|
2794
|
+
id: string;
|
|
2795
|
+
email: string;
|
|
2796
|
+
role: "OWNER" | "ADMIN" | "MEMBER";
|
|
2797
|
+
};
|
|
2798
|
+
outputFormat: "json";
|
|
2799
|
+
status: 200;
|
|
2800
|
+
} | {
|
|
2801
|
+
input: {
|
|
2802
|
+
header: {
|
|
2803
|
+
'X-Idempotency-Key': string;
|
|
2804
|
+
};
|
|
2805
|
+
} & {
|
|
2806
|
+
json: {
|
|
2807
|
+
email: string;
|
|
2808
|
+
password: string;
|
|
2809
|
+
roles?: string[] | undefined;
|
|
2810
|
+
scopes?: {
|
|
2811
|
+
scope: "organizations.{jwt.user.rawUserMetaData.organizationId}.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.accounts.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.payments.create" | "organizations.{jwt.user.rawUserMetaData.organizationId}.payments.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.signature-keys.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.signature-keys.create" | "organizations.{jwt.user.rawUserMetaData.organizationId}.signature-keys.delete" | "organizations.{jwt.user.rawUserMetaData.organizationId}.users.create" | "organizations.{jwt.user.rawUserMetaData.organizationId}.users.delete" | "organizations.{jwt.user.rawUserMetaData.organizationId}.users.update" | "organizations.{jwt.user.rawUserMetaData.organizationId}.users.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.transactions.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.transactions.deposit.read" | "organizations.{jwt.user.rawUserMetaData.organizationId}.transactions.simulate-deposit.create" | "organizations.{jwt.user.rawUserMetaData.organizationId}.transactions.withdraw.create";
|
|
2812
|
+
resourceId?: string | undefined;
|
|
2813
|
+
}[] | undefined;
|
|
2814
|
+
};
|
|
2815
|
+
};
|
|
2816
|
+
output: {
|
|
2817
|
+
message: string;
|
|
2818
|
+
};
|
|
2819
|
+
outputFormat: "json";
|
|
2820
|
+
status: 500;
|
|
2821
|
+
};
|
|
2822
|
+
}>;
|
|
2823
|
+
};
|
|
2824
|
+
};
|
|
2825
|
+
} & {
|
|
2826
|
+
v1: {
|
|
2827
|
+
organization: {
|
|
2828
|
+
users: {
|
|
2829
|
+
":id": ClientRequest<string, "/v1/organization/users/:id", {
|
|
2830
|
+
$delete: {
|
|
2831
|
+
input: {
|
|
2832
|
+
param: {
|
|
2833
|
+
id: string;
|
|
2834
|
+
} & {
|
|
2835
|
+
id: string;
|
|
2836
|
+
};
|
|
2837
|
+
header: {
|
|
2838
|
+
'X-Idempotency-Key': string;
|
|
2839
|
+
};
|
|
2840
|
+
};
|
|
2841
|
+
output: {
|
|
2842
|
+
message: string;
|
|
2843
|
+
};
|
|
2844
|
+
outputFormat: "json";
|
|
2845
|
+
status: 200;
|
|
2846
|
+
} | {
|
|
2847
|
+
input: {
|
|
2848
|
+
param: {
|
|
2849
|
+
id: string;
|
|
2850
|
+
} & {
|
|
2851
|
+
id: string;
|
|
2852
|
+
};
|
|
2853
|
+
header: {
|
|
2854
|
+
'X-Idempotency-Key': string;
|
|
2855
|
+
};
|
|
2856
|
+
};
|
|
2857
|
+
output: {
|
|
2858
|
+
message: string;
|
|
2859
|
+
};
|
|
2860
|
+
outputFormat: "json";
|
|
2861
|
+
status: 500;
|
|
2862
|
+
};
|
|
2863
|
+
} & {
|
|
2864
|
+
$patch: {
|
|
2865
|
+
input: {
|
|
2866
|
+
param: {
|
|
2867
|
+
id: string;
|
|
2868
|
+
} & {
|
|
2869
|
+
id: string;
|
|
2870
|
+
};
|
|
2871
|
+
header: {
|
|
2872
|
+
'X-Idempotency-Key': string;
|
|
2873
|
+
};
|
|
2874
|
+
json: {
|
|
2875
|
+
email?: string | undefined;
|
|
2876
|
+
role?: "OWNER" | "ADMIN" | "MEMBER" | undefined;
|
|
2877
|
+
};
|
|
2878
|
+
};
|
|
2879
|
+
output: {
|
|
2880
|
+
message: string;
|
|
2881
|
+
id: string;
|
|
2882
|
+
email: string;
|
|
2883
|
+
role: "OWNER" | "ADMIN" | "MEMBER";
|
|
2884
|
+
};
|
|
2885
|
+
outputFormat: "json";
|
|
2886
|
+
status: 200;
|
|
2887
|
+
} | {
|
|
2888
|
+
input: {
|
|
2889
|
+
param: {
|
|
2890
|
+
id: string;
|
|
2891
|
+
} & {
|
|
2892
|
+
id: string;
|
|
2893
|
+
};
|
|
2894
|
+
header: {
|
|
2895
|
+
'X-Idempotency-Key': string;
|
|
2896
|
+
};
|
|
2897
|
+
json: {
|
|
2898
|
+
email?: string | undefined;
|
|
2899
|
+
role?: "OWNER" | "ADMIN" | "MEMBER" | undefined;
|
|
2900
|
+
};
|
|
2901
|
+
};
|
|
2902
|
+
output: {
|
|
2903
|
+
message: string;
|
|
2904
|
+
};
|
|
2905
|
+
outputFormat: "json";
|
|
2906
|
+
status: 500;
|
|
2907
|
+
};
|
|
2908
|
+
}>;
|
|
2909
|
+
};
|
|
2910
|
+
};
|
|
2911
|
+
};
|
|
2912
|
+
} & {
|
|
2913
|
+
v1: {
|
|
2914
|
+
tasks: {
|
|
2915
|
+
setups: {
|
|
2916
|
+
organization: ClientRequest<string, "/v1/tasks/setups/organization", {
|
|
2917
|
+
$post: {
|
|
2918
|
+
input: {
|
|
2919
|
+
json: {
|
|
2920
|
+
name: string;
|
|
2921
|
+
webhook: string;
|
|
2922
|
+
depositFeeMultiplier: number;
|
|
2923
|
+
withdrawFeeMultiplier: number;
|
|
2924
|
+
ipAuthorization: boolean;
|
|
2925
|
+
ownerEmail: string;
|
|
2926
|
+
bankAccounts: {
|
|
2927
|
+
iban: string;
|
|
2928
|
+
currency: "CZK" | "EUR" | "USD";
|
|
2929
|
+
amount: number;
|
|
2930
|
+
}[];
|
|
2931
|
+
};
|
|
2932
|
+
};
|
|
2933
|
+
output: {
|
|
2934
|
+
message: string;
|
|
2935
|
+
id: string;
|
|
2936
|
+
name: string;
|
|
2937
|
+
webhook: string;
|
|
2938
|
+
signatureKeyLimit: number;
|
|
2939
|
+
state: "BLOCKED" | "OPERATIONAL";
|
|
2940
|
+
createdAt: string;
|
|
2941
|
+
updatedAt: string | null;
|
|
2942
|
+
};
|
|
2943
|
+
outputFormat: "json";
|
|
2944
|
+
status: 200;
|
|
2945
|
+
} | {
|
|
2946
|
+
input: {
|
|
2947
|
+
json: {
|
|
2948
|
+
name: string;
|
|
2949
|
+
webhook: string;
|
|
2950
|
+
depositFeeMultiplier: number;
|
|
2951
|
+
withdrawFeeMultiplier: number;
|
|
2952
|
+
ipAuthorization: boolean;
|
|
2953
|
+
ownerEmail: string;
|
|
2954
|
+
bankAccounts: {
|
|
2955
|
+
iban: string;
|
|
2956
|
+
currency: "CZK" | "EUR" | "USD";
|
|
2957
|
+
amount: number;
|
|
2958
|
+
}[];
|
|
2959
|
+
};
|
|
2960
|
+
};
|
|
2961
|
+
output: {
|
|
2962
|
+
message: string;
|
|
2963
|
+
};
|
|
2964
|
+
outputFormat: "json";
|
|
2965
|
+
status: 404;
|
|
2966
|
+
} | {
|
|
2967
|
+
input: {
|
|
2968
|
+
json: {
|
|
2969
|
+
name: string;
|
|
2970
|
+
webhook: string;
|
|
2971
|
+
depositFeeMultiplier: number;
|
|
2972
|
+
withdrawFeeMultiplier: number;
|
|
2973
|
+
ipAuthorization: boolean;
|
|
2974
|
+
ownerEmail: string;
|
|
2975
|
+
bankAccounts: {
|
|
2976
|
+
iban: string;
|
|
2977
|
+
currency: "CZK" | "EUR" | "USD";
|
|
2978
|
+
amount: number;
|
|
2979
|
+
}[];
|
|
2980
|
+
};
|
|
2981
|
+
};
|
|
2982
|
+
output: {
|
|
2983
|
+
message: string;
|
|
2984
|
+
};
|
|
2985
|
+
outputFormat: "json";
|
|
2986
|
+
status: 500;
|
|
2987
|
+
};
|
|
2988
|
+
}>;
|
|
2989
|
+
};
|
|
2990
|
+
};
|
|
2991
|
+
};
|
|
2992
|
+
} & {
|
|
2993
|
+
v1: {
|
|
2994
|
+
transactions: ClientRequest<string, "/v1/transactions", {
|
|
2995
|
+
$get: {
|
|
2996
|
+
input: {
|
|
2997
|
+
query: {
|
|
2998
|
+
page?: string | undefined;
|
|
2999
|
+
limit?: string | undefined;
|
|
3000
|
+
sort?: "oldest" | "newest" | undefined;
|
|
3001
|
+
filterFromDate?: string | undefined;
|
|
3002
|
+
filterToDate?: string | undefined;
|
|
3003
|
+
filterBankingVs?: string | undefined;
|
|
3004
|
+
filterCreditorReferenceCode?: string | undefined;
|
|
3005
|
+
filterStatus?: "PENDING" | "COMPLETED" | "FAILED" | "APPROVED" | "INITIALIZED" | undefined;
|
|
3006
|
+
filterPaymentId?: string | undefined;
|
|
3007
|
+
};
|
|
3008
|
+
};
|
|
3009
|
+
output: {
|
|
3010
|
+
message: string;
|
|
3011
|
+
transactions: {
|
|
3012
|
+
transaction: {
|
|
3013
|
+
id: string;
|
|
3014
|
+
createdAt: number | null;
|
|
3015
|
+
action: "WITHDRAW" | "DEPOSIT" | "TRANSFER" | "MINT" | "BURN" | "STAKE" | "UNSTAKE";
|
|
3016
|
+
transactionType: string | null;
|
|
3017
|
+
amount: number;
|
|
3018
|
+
amountDecimals: number;
|
|
3019
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
3020
|
+
status: "PENDING" | "COMPLETED" | "FAILED" | "APPROVED" | "INITIALIZED";
|
|
3021
|
+
bank: {
|
|
3022
|
+
vs: string | null;
|
|
3023
|
+
ss: string | null;
|
|
3024
|
+
ks: string | null;
|
|
3025
|
+
message: string | null;
|
|
3026
|
+
};
|
|
3027
|
+
};
|
|
3028
|
+
creditor: {
|
|
3029
|
+
holderName: string;
|
|
3030
|
+
iban: string | null;
|
|
3031
|
+
accountNumber: string | null;
|
|
3032
|
+
bankCode: string | null;
|
|
3033
|
+
referenceCode: string | null;
|
|
3034
|
+
};
|
|
3035
|
+
debtor: {
|
|
3036
|
+
holderName: string;
|
|
3037
|
+
iban: string | null;
|
|
3038
|
+
accountNumber: string | null;
|
|
3039
|
+
bankCode: string | null;
|
|
3040
|
+
referenceCode: string | null;
|
|
3041
|
+
};
|
|
3042
|
+
}[];
|
|
3043
|
+
};
|
|
3044
|
+
outputFormat: "json";
|
|
3045
|
+
status: 200;
|
|
3046
|
+
} | {
|
|
3047
|
+
input: {
|
|
3048
|
+
query: {
|
|
3049
|
+
page?: string | undefined;
|
|
3050
|
+
limit?: string | undefined;
|
|
3051
|
+
sort?: "oldest" | "newest" | undefined;
|
|
3052
|
+
filterFromDate?: string | undefined;
|
|
3053
|
+
filterToDate?: string | undefined;
|
|
3054
|
+
filterBankingVs?: string | undefined;
|
|
3055
|
+
filterCreditorReferenceCode?: string | undefined;
|
|
3056
|
+
filterStatus?: "PENDING" | "COMPLETED" | "FAILED" | "APPROVED" | "INITIALIZED" | undefined;
|
|
3057
|
+
filterPaymentId?: string | undefined;
|
|
3058
|
+
};
|
|
3059
|
+
};
|
|
3060
|
+
output: {
|
|
3061
|
+
message: string;
|
|
3062
|
+
};
|
|
3063
|
+
outputFormat: "json";
|
|
3064
|
+
status: 500;
|
|
3065
|
+
};
|
|
3066
|
+
}>;
|
|
3067
|
+
};
|
|
3068
|
+
} & {
|
|
3069
|
+
v1: {
|
|
3070
|
+
transactions: {
|
|
3071
|
+
deposit: ClientRequest<string, "/v1/transactions/deposit", {
|
|
3072
|
+
$get: {
|
|
3073
|
+
input: {
|
|
3074
|
+
query: {
|
|
3075
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
3076
|
+
};
|
|
3077
|
+
};
|
|
3078
|
+
output: {
|
|
3079
|
+
message: string;
|
|
3080
|
+
accountNumber: string;
|
|
3081
|
+
bankCode: string;
|
|
3082
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
3083
|
+
iban: string;
|
|
3084
|
+
bic: string | null;
|
|
3085
|
+
};
|
|
3086
|
+
outputFormat: "json";
|
|
3087
|
+
status: 200;
|
|
3088
|
+
} | {
|
|
3089
|
+
input: {
|
|
3090
|
+
query: {
|
|
3091
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
3092
|
+
};
|
|
3093
|
+
};
|
|
3094
|
+
output: {
|
|
3095
|
+
message: string;
|
|
3096
|
+
};
|
|
3097
|
+
outputFormat: "json";
|
|
3098
|
+
status: 404;
|
|
3099
|
+
} | {
|
|
3100
|
+
input: {
|
|
3101
|
+
query: {
|
|
3102
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
3103
|
+
};
|
|
3104
|
+
};
|
|
3105
|
+
output: {
|
|
3106
|
+
message: string;
|
|
3107
|
+
};
|
|
3108
|
+
outputFormat: "json";
|
|
3109
|
+
status: 500;
|
|
3110
|
+
};
|
|
3111
|
+
}>;
|
|
3112
|
+
};
|
|
3113
|
+
};
|
|
3114
|
+
} & {
|
|
3115
|
+
v1: {
|
|
3116
|
+
transactions: {
|
|
3117
|
+
withdraw: ClientRequest<string, "/v1/transactions/withdraw", {
|
|
3118
|
+
$post: {
|
|
3119
|
+
input: {
|
|
3120
|
+
header: {
|
|
3121
|
+
'X-Idempotency-Key': string;
|
|
3122
|
+
'X-Signature-Key': string;
|
|
3123
|
+
'X-Signature': string;
|
|
3124
|
+
};
|
|
3125
|
+
} & {
|
|
3126
|
+
json: {
|
|
3127
|
+
amount: number;
|
|
3128
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
3129
|
+
referenceCode: string;
|
|
3130
|
+
creditorAccount: {
|
|
3131
|
+
accountNumber: string;
|
|
3132
|
+
bankCode: string;
|
|
3133
|
+
creditorName: string;
|
|
3134
|
+
iban: string;
|
|
3135
|
+
};
|
|
3136
|
+
paymentMessage: string;
|
|
3137
|
+
vs?: string | undefined;
|
|
3138
|
+
ks?: string | undefined;
|
|
3139
|
+
ss?: string | undefined;
|
|
3140
|
+
};
|
|
3141
|
+
};
|
|
3142
|
+
output: {
|
|
3143
|
+
message: string;
|
|
3144
|
+
id: string;
|
|
3145
|
+
createdAt: number | null;
|
|
3146
|
+
action: "WITHDRAW" | "DEPOSIT" | "TRANSFER" | "MINT" | "BURN" | "STAKE" | "UNSTAKE";
|
|
3147
|
+
transactionType: string | null;
|
|
3148
|
+
amount: number;
|
|
3149
|
+
amountDecimals: number;
|
|
3150
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
3151
|
+
status: "PENDING" | "COMPLETED" | "FAILED" | "APPROVED" | "INITIALIZED";
|
|
3152
|
+
bank: {
|
|
3153
|
+
vs: string | null;
|
|
3154
|
+
ss: string | null;
|
|
3155
|
+
ks: string | null;
|
|
3156
|
+
message: string | null;
|
|
3157
|
+
};
|
|
3158
|
+
};
|
|
3159
|
+
outputFormat: "json";
|
|
3160
|
+
status: 200;
|
|
3161
|
+
} | {
|
|
3162
|
+
input: {
|
|
3163
|
+
header: {
|
|
3164
|
+
'X-Idempotency-Key': string;
|
|
3165
|
+
'X-Signature-Key': string;
|
|
3166
|
+
'X-Signature': string;
|
|
3167
|
+
};
|
|
3168
|
+
} & {
|
|
3169
|
+
json: {
|
|
3170
|
+
amount: number;
|
|
3171
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
3172
|
+
referenceCode: string;
|
|
3173
|
+
creditorAccount: {
|
|
3174
|
+
accountNumber: string;
|
|
3175
|
+
bankCode: string;
|
|
3176
|
+
creditorName: string;
|
|
3177
|
+
iban: string;
|
|
3178
|
+
};
|
|
3179
|
+
paymentMessage: string;
|
|
3180
|
+
vs?: string | undefined;
|
|
3181
|
+
ks?: string | undefined;
|
|
3182
|
+
ss?: string | undefined;
|
|
3183
|
+
};
|
|
3184
|
+
};
|
|
3185
|
+
output: {
|
|
3186
|
+
message: string;
|
|
3187
|
+
};
|
|
3188
|
+
outputFormat: "json";
|
|
3189
|
+
status: 404;
|
|
3190
|
+
} | {
|
|
3191
|
+
input: {
|
|
3192
|
+
header: {
|
|
3193
|
+
'X-Idempotency-Key': string;
|
|
3194
|
+
'X-Signature-Key': string;
|
|
3195
|
+
'X-Signature': string;
|
|
3196
|
+
};
|
|
3197
|
+
} & {
|
|
3198
|
+
json: {
|
|
3199
|
+
amount: number;
|
|
3200
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
3201
|
+
referenceCode: string;
|
|
3202
|
+
creditorAccount: {
|
|
3203
|
+
accountNumber: string;
|
|
3204
|
+
bankCode: string;
|
|
3205
|
+
creditorName: string;
|
|
3206
|
+
iban: string;
|
|
3207
|
+
};
|
|
3208
|
+
paymentMessage: string;
|
|
3209
|
+
vs?: string | undefined;
|
|
3210
|
+
ks?: string | undefined;
|
|
3211
|
+
ss?: string | undefined;
|
|
3212
|
+
};
|
|
3213
|
+
};
|
|
3214
|
+
output: {
|
|
3215
|
+
message: string;
|
|
3216
|
+
};
|
|
3217
|
+
outputFormat: "json";
|
|
3218
|
+
status: 500;
|
|
3219
|
+
};
|
|
3220
|
+
}>;
|
|
3221
|
+
};
|
|
3222
|
+
};
|
|
3223
|
+
} & {
|
|
3224
|
+
v1: {
|
|
3225
|
+
transactions: {
|
|
3226
|
+
"simulate-deposit": ClientRequest<string, "/v1/transactions/simulate-deposit", {
|
|
3227
|
+
$post: {
|
|
3228
|
+
input: {
|
|
3229
|
+
header: {
|
|
3230
|
+
'X-Idempotency-Key': string;
|
|
3231
|
+
'X-Signature-Key': string;
|
|
3232
|
+
'X-Signature': string;
|
|
3233
|
+
};
|
|
3234
|
+
} & {
|
|
3235
|
+
json: {
|
|
3236
|
+
amount: number;
|
|
3237
|
+
currency: "CZK" | "EUR" | "USD";
|
|
3238
|
+
bank: {
|
|
3239
|
+
vs: string;
|
|
3240
|
+
ss?: string | undefined;
|
|
3241
|
+
ks?: string | undefined;
|
|
3242
|
+
message?: string | undefined;
|
|
3243
|
+
};
|
|
3244
|
+
debtorIban: string;
|
|
3245
|
+
debtorHolderName: string;
|
|
3246
|
+
};
|
|
3247
|
+
};
|
|
3248
|
+
output: {
|
|
3249
|
+
message: string;
|
|
3250
|
+
};
|
|
3251
|
+
outputFormat: "json";
|
|
3252
|
+
status: 200;
|
|
3253
|
+
} | {
|
|
3254
|
+
input: {
|
|
3255
|
+
header: {
|
|
3256
|
+
'X-Idempotency-Key': string;
|
|
3257
|
+
'X-Signature-Key': string;
|
|
3258
|
+
'X-Signature': string;
|
|
3259
|
+
};
|
|
3260
|
+
} & {
|
|
3261
|
+
json: {
|
|
3262
|
+
amount: number;
|
|
3263
|
+
currency: "CZK" | "EUR" | "USD";
|
|
3264
|
+
bank: {
|
|
3265
|
+
vs: string;
|
|
3266
|
+
ss?: string | undefined;
|
|
3267
|
+
ks?: string | undefined;
|
|
3268
|
+
message?: string | undefined;
|
|
3269
|
+
};
|
|
3270
|
+
debtorIban: string;
|
|
3271
|
+
debtorHolderName: string;
|
|
3272
|
+
};
|
|
3273
|
+
};
|
|
3274
|
+
output: {
|
|
3275
|
+
message: string;
|
|
3276
|
+
};
|
|
3277
|
+
outputFormat: "json";
|
|
3278
|
+
status: 404;
|
|
3279
|
+
} | {
|
|
3280
|
+
input: {
|
|
3281
|
+
header: {
|
|
3282
|
+
'X-Idempotency-Key': string;
|
|
3283
|
+
'X-Signature-Key': string;
|
|
3284
|
+
'X-Signature': string;
|
|
3285
|
+
};
|
|
3286
|
+
} & {
|
|
3287
|
+
json: {
|
|
3288
|
+
amount: number;
|
|
3289
|
+
currency: "CZK" | "EUR" | "USD";
|
|
3290
|
+
bank: {
|
|
3291
|
+
vs: string;
|
|
3292
|
+
ss?: string | undefined;
|
|
3293
|
+
ks?: string | undefined;
|
|
3294
|
+
message?: string | undefined;
|
|
3295
|
+
};
|
|
3296
|
+
debtorIban: string;
|
|
3297
|
+
debtorHolderName: string;
|
|
3298
|
+
};
|
|
3299
|
+
};
|
|
3300
|
+
output: {
|
|
3301
|
+
message: string;
|
|
3302
|
+
};
|
|
3303
|
+
outputFormat: "json";
|
|
3304
|
+
status: 500;
|
|
3305
|
+
};
|
|
3306
|
+
}>;
|
|
3307
|
+
};
|
|
3308
|
+
};
|
|
3309
|
+
} & {
|
|
3310
|
+
v1: {
|
|
3311
|
+
users: {
|
|
3312
|
+
":userId": {
|
|
3313
|
+
verification: {
|
|
3314
|
+
":confirmationToken": ClientRequest<string, "/v1/users/:userId/verification/:confirmationToken", {
|
|
3315
|
+
$patch: {
|
|
3316
|
+
input: {
|
|
3317
|
+
param: {
|
|
3318
|
+
userId: string;
|
|
3319
|
+
confirmationToken: string;
|
|
3320
|
+
} & {
|
|
3321
|
+
userId: string;
|
|
3322
|
+
confirmationToken: string;
|
|
3323
|
+
};
|
|
3324
|
+
json: {
|
|
3325
|
+
password: string;
|
|
3326
|
+
captchaToken: string;
|
|
3327
|
+
};
|
|
3328
|
+
};
|
|
3329
|
+
output: Response;
|
|
3330
|
+
outputFormat: "json";
|
|
3331
|
+
status: StatusCode;
|
|
3332
|
+
};
|
|
3333
|
+
} & {
|
|
3334
|
+
$get: {
|
|
3335
|
+
input: {
|
|
3336
|
+
param: {
|
|
3337
|
+
userId: string;
|
|
3338
|
+
confirmationToken: string;
|
|
3339
|
+
} & {
|
|
3340
|
+
userId: string;
|
|
3341
|
+
confirmationToken: string;
|
|
3342
|
+
};
|
|
3343
|
+
};
|
|
3344
|
+
output: Response;
|
|
3345
|
+
outputFormat: "json";
|
|
3346
|
+
status: StatusCode;
|
|
3347
|
+
};
|
|
3348
|
+
}>;
|
|
3349
|
+
};
|
|
3350
|
+
};
|
|
3351
|
+
};
|
|
3352
|
+
};
|
|
3353
|
+
} & {
|
|
3354
|
+
v1: {
|
|
3355
|
+
users: {
|
|
3356
|
+
":userId": {
|
|
3357
|
+
verification: {
|
|
3358
|
+
":confirmationToken": {
|
|
3359
|
+
success: ClientRequest<string, "/v1/users/:userId/verification/:confirmationToken/success", {
|
|
3360
|
+
$get: {
|
|
3361
|
+
input: {
|
|
3362
|
+
param: {
|
|
3363
|
+
userId: string;
|
|
3364
|
+
confirmationToken: string;
|
|
3365
|
+
} & {
|
|
3366
|
+
[x: string]: string;
|
|
3367
|
+
[x: number]: string;
|
|
3368
|
+
[x: symbol]: string;
|
|
3369
|
+
};
|
|
3370
|
+
};
|
|
3371
|
+
output: Response;
|
|
3372
|
+
outputFormat: "json";
|
|
3373
|
+
status: StatusCode;
|
|
3374
|
+
};
|
|
3375
|
+
}>;
|
|
3376
|
+
};
|
|
3377
|
+
};
|
|
3378
|
+
};
|
|
3379
|
+
};
|
|
3380
|
+
};
|
|
3381
|
+
};
|
|
3382
|
+
|
|
3383
|
+
declare const signPayload: ({ payload, privateKey, }: {
|
|
3384
|
+
payload: string;
|
|
3385
|
+
privateKey: string;
|
|
3386
|
+
}) => Promise<string>;
|
|
3387
|
+
declare const verifyPayloadSignature: ({ signature, data, publicKey, algorithm, }: {
|
|
3388
|
+
signature: string;
|
|
3389
|
+
data: string;
|
|
3390
|
+
publicKey: string;
|
|
3391
|
+
algorithm?: "RSA" | "EC" | "HMAC";
|
|
3392
|
+
}) => Promise<boolean>;
|
|
3393
|
+
|
|
3394
|
+
export { createPartnerApiClient, signPayload, verifyPayloadSignature };
|