@aklinker1/zeta 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/zod-schema-adapter.d.mts +17 -0
- package/dist/adapters/zod-schema-adapter.mjs +726 -0
- package/dist/client.d.mts +71 -0
- package/dist/client.mjs +73 -0
- package/dist/index.d.mts +316 -0
- package/dist/index.mjs +1236 -0
- package/dist/schema-IKHh0I39.d.mts +168 -0
- package/dist/schema.d.mts +2 -0
- package/dist/schema.mjs +151 -0
- package/dist/serialization-C8e7ECQ2.mjs +56 -0
- package/dist/testing.d.mts +26 -0
- package/dist/testing.mjs +52 -0
- package/dist/transports/bun-transport.d.mts +7 -0
- package/dist/transports/bun-transport.mjs +14 -0
- package/dist/transports/deno-transport.d.mts +6 -0
- package/dist/transports/deno-transport.mjs +13 -0
- package/dist/types-D9oRVe1E.d.mts +698 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +1 -0
- package/package.json +38 -16
- package/src/adapters/zod-schema-adapter.ts +0 -29
- package/src/app.ts +0 -479
- package/src/client.ts +0 -184
- package/src/errors.ts +0 -529
- package/src/index.ts +0 -5
- package/src/internal/compile-fetch-function.ts +0 -166
- package/src/internal/compile-route-handler.ts +0 -194
- package/src/internal/context.ts +0 -65
- package/src/internal/serialization.ts +0 -91
- package/src/internal/utils.ts +0 -191
- package/src/meta.ts +0 -14
- package/src/open-api.ts +0 -273
- package/src/schema.ts +0 -271
- package/src/status.ts +0 -143
- package/src/testing.ts +0 -62
- package/src/transports/bun-transport.ts +0 -17
- package/src/transports/deno-transport.ts +0 -13
- package/src/types.ts +0 -1102
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
import { l as HttpStatus } from "./schema-IKHh0I39.mjs";
|
|
2
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
|
+
import { OpenAPI } from "openapi-types";
|
|
4
|
+
|
|
5
|
+
//#region src/internal/utils.d.ts
|
|
6
|
+
declare const IsStatusResult: unique symbol;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/types.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Represents an App object. TAppData represents additional type information not
|
|
11
|
+
* always stored on the app object itself.
|
|
12
|
+
*/
|
|
13
|
+
interface App<TAppData extends AppData = AppData> {
|
|
14
|
+
/**
|
|
15
|
+
* Internal references for implementing routing and calling registered
|
|
16
|
+
* handlers. Subject to breaking changes outside of major versions.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
"~zeta": {
|
|
20
|
+
/**
|
|
21
|
+
* Used for deduplication of hooks.
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* When true, hooks defined on this app should be added to any app that
|
|
26
|
+
* imports this app.
|
|
27
|
+
*/
|
|
28
|
+
exported?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Path prefix from `CreateAppOptions.prefix`.
|
|
31
|
+
*/
|
|
32
|
+
prefix: string;
|
|
33
|
+
/**
|
|
34
|
+
* List of routes registered with the app.
|
|
35
|
+
*/
|
|
36
|
+
routes: {
|
|
37
|
+
[method: string]: {
|
|
38
|
+
[path: string]: RouterData;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Stores arrays of hooks registered on the app.
|
|
43
|
+
*/
|
|
44
|
+
hooks: LifeCycleHooks;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Merge and simplify all the app routes into a single fetch function.
|
|
48
|
+
*/
|
|
49
|
+
build: () => ServerSideFetch;
|
|
50
|
+
/**
|
|
51
|
+
* Returns your application's OpenAPI spec. You do not need to listen to a
|
|
52
|
+
* port to call this method.
|
|
53
|
+
*/
|
|
54
|
+
getOpenApiSpec: () => OpenAPI.Document;
|
|
55
|
+
/**
|
|
56
|
+
* Mark the app as "exported". When an exported app is `use`d by a
|
|
57
|
+
* parent app, the parent app will inherit all of it's hooks and modifiers.
|
|
58
|
+
*
|
|
59
|
+
* Regular, non-exported apps isolate their hooks and modifiers from the
|
|
60
|
+
* parent app (except for the global hooks, `onGlobalRequest`, `onGlobalError`, and
|
|
61
|
+
* `onGlobalAfterResponse`, which are always inherited by the parent app).
|
|
62
|
+
*
|
|
63
|
+
* The basic example is you can't access a decorated value from a parent app
|
|
64
|
+
* unless the child app is exported.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const child = createApp()
|
|
69
|
+
* .decorate("a", "A");
|
|
70
|
+
*
|
|
71
|
+
* const bad = createApp()
|
|
72
|
+
* .use(child)
|
|
73
|
+
* .get("/", ({ a }) => {
|
|
74
|
+
* console.log(a); // => undefined
|
|
75
|
+
* });
|
|
76
|
+
*
|
|
77
|
+
* const good = createApp()
|
|
78
|
+
* .use(child.export())
|
|
79
|
+
* .get("/", ({ a }) => {
|
|
80
|
+
* console.log(a); // => "A"
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export: () => App<MergeAppData<TAppData, {
|
|
85
|
+
exported: true;
|
|
86
|
+
}>>;
|
|
87
|
+
/**
|
|
88
|
+
* Detect the current environment and use `Bun.serve` or `Deno.serve` to serve the app over a port.
|
|
89
|
+
* @param port The port to listen on.
|
|
90
|
+
* @param cb Optional callback to be called when the server is ready.
|
|
91
|
+
*/
|
|
92
|
+
listen: (port: number, cb?: () => void) => this;
|
|
93
|
+
/**
|
|
94
|
+
* Add a static value to the handler context.
|
|
95
|
+
*/
|
|
96
|
+
decorate<TKey extends string, TValue>(key: TKey, value: TValue): App<Simplify<MergeAppData<TAppData, {
|
|
97
|
+
ctx: { [key in TKey]: Readonly<TValue> };
|
|
98
|
+
}>>>;
|
|
99
|
+
/**
|
|
100
|
+
* Add multiple static values to the handler context.
|
|
101
|
+
*/
|
|
102
|
+
decorate<TValues extends Record<string, any>>(values: TValues): App<Simplify<MergeAppData<TAppData, {
|
|
103
|
+
ctx: TValues;
|
|
104
|
+
}>>>;
|
|
105
|
+
/**
|
|
106
|
+
* Add a callback that is called before the route is matched. If the callback
|
|
107
|
+
* returns a value, it will be merged into the `ctx` object. If the callback
|
|
108
|
+
* returns a `Response`, it will be returned immediately.
|
|
109
|
+
*
|
|
110
|
+
* @param callback The function to call.
|
|
111
|
+
*/
|
|
112
|
+
onGlobalRequest(callback: (ctx: OnGlobalRequestContext<GetAppDataCtx<TAppData>>) => MaybePromise<Response | void>): this;
|
|
113
|
+
onGlobalRequest<TNewCtx extends Record<string, any>>(callback: (ctx: OnGlobalRequestContext<GetAppDataCtx<TAppData>>) => MaybePromise<TNewCtx>): App<MergeAppData<TAppData, {
|
|
114
|
+
ctx: TNewCtx;
|
|
115
|
+
}>>;
|
|
116
|
+
/**
|
|
117
|
+
* Add a callback that is called after the route is matched and before the
|
|
118
|
+
* inputs are validated. If the callback returns a value, it will be merged
|
|
119
|
+
* into the `ctx` object. If the callback returns a `Response`, it will be
|
|
120
|
+
* returned immediately.
|
|
121
|
+
*
|
|
122
|
+
* @param callback The function to call.
|
|
123
|
+
*/
|
|
124
|
+
onTransform(callback: (ctx: OnTransformContext<GetAppDataCtx<TAppData>>) => MaybePromise<Response | void>): this;
|
|
125
|
+
onTransform<TNewCtx extends Record<string, any>>(callback: (ctx: OnTransformContext<GetAppDataCtx<TAppData>>) => MaybePromise<TNewCtx>): App<MergeAppData<TAppData, {
|
|
126
|
+
ctx: TNewCtx;
|
|
127
|
+
}>>;
|
|
128
|
+
/**
|
|
129
|
+
* Add a callback that is called after inputs are validated and before the
|
|
130
|
+
* handler is called. If the callback returns a value, it will be merged into
|
|
131
|
+
* the `ctx` object. If the callback returns a `Response`, it will be returned
|
|
132
|
+
* immediately.
|
|
133
|
+
*
|
|
134
|
+
* @param callback The function to call.
|
|
135
|
+
*/
|
|
136
|
+
onBeforeHandle(callback: (ctx: OnBeforeHandleContext<GetAppDataCtx<TAppData>>) => MaybePromise<Response | void>): this;
|
|
137
|
+
onBeforeHandle<TNewCtx extends Record<string, any>>(callback: (ctx: OnBeforeHandleContext<GetAppDataCtx<TAppData>>) => MaybePromise<TNewCtx>): App<MergeAppData<TAppData, {
|
|
138
|
+
ctx: TNewCtx;
|
|
139
|
+
}>>;
|
|
140
|
+
/**
|
|
141
|
+
* Add a callback that is called after the handler is called and before the
|
|
142
|
+
* response is validated. If the callback returns a value, it replaces the
|
|
143
|
+
* response with it.
|
|
144
|
+
*
|
|
145
|
+
* @param callback The function to call.
|
|
146
|
+
*/
|
|
147
|
+
onAfterHandle(callback: (ctx: AfterHandleContext<GetAppDataCtx<TAppData>>) => MaybePromise<unknown | void>): this;
|
|
148
|
+
/**
|
|
149
|
+
* Add a callback that is called after the response is validated and before it
|
|
150
|
+
* is sent to the client. The callback can return a `Response` if you want to
|
|
151
|
+
* change how the response is built.
|
|
152
|
+
*
|
|
153
|
+
* @param callback The function to call.
|
|
154
|
+
*/
|
|
155
|
+
onMapResponse(callback: (ctx: AfterHandleContext<GetAppDataCtx<TAppData>>) => MaybePromise<unknown | void>): this;
|
|
156
|
+
/**
|
|
157
|
+
* Add a callback that is called when an error is thrown. The callback can
|
|
158
|
+
* optionally return a `Response`, which will be used to respond to the
|
|
159
|
+
* client.
|
|
160
|
+
*
|
|
161
|
+
* @param callback The function to call.
|
|
162
|
+
*/
|
|
163
|
+
onGlobalError(callback: (ctx: OnGlobalErrorContext<GetAppDataCtx<TAppData>>) => MaybePromise<void>): this;
|
|
164
|
+
/**
|
|
165
|
+
* Add a callback that is called after the response is sent.
|
|
166
|
+
* @param callback The function to call.
|
|
167
|
+
*/
|
|
168
|
+
onGlobalAfterResponse(callback: (ctx: AfterResponseContext<GetAppDataCtx<TAppData>>) => MaybePromise<void>): this;
|
|
169
|
+
/**
|
|
170
|
+
* Add an undocumented GET route to the app.
|
|
171
|
+
*/
|
|
172
|
+
get<TPath extends BasePath>(path: TPath, handler: RouteHandler<TAppData, TPath, AnyDef>): App<MergeAppData<TAppData, {
|
|
173
|
+
routes: {
|
|
174
|
+
GET: { [path in TPath]: AnyDef };
|
|
175
|
+
};
|
|
176
|
+
}>>;
|
|
177
|
+
/**
|
|
178
|
+
* Add a documented GET route to the app.
|
|
179
|
+
*/
|
|
180
|
+
get<TPath extends BasePath, TRouteDef extends RouteDef>(path: TPath, def: TRouteDef, handler: RouteHandler<TAppData, TPath, TRouteDef>): App<MergeAppData<TAppData, {
|
|
181
|
+
routes: {
|
|
182
|
+
GET: { [path in TPath]: TRouteDef };
|
|
183
|
+
};
|
|
184
|
+
}>>;
|
|
185
|
+
/**
|
|
186
|
+
* Add an undocumented POST route to the app.
|
|
187
|
+
*/
|
|
188
|
+
post<TPath extends BasePath>(path: TPath, handler: RouteHandler<TAppData, TPath, AnyDef>): App<MergeAppData<TAppData, {
|
|
189
|
+
routes: {
|
|
190
|
+
POST: { [path in TPath]: AnyDef };
|
|
191
|
+
};
|
|
192
|
+
}>>;
|
|
193
|
+
/**
|
|
194
|
+
* Add a documented POST route to the app.
|
|
195
|
+
*/
|
|
196
|
+
post<TPath extends BasePath, TRouteDef extends RouteDef>(path: TPath, def: TRouteDef, handler: RouteHandler<TAppData, TPath, TRouteDef>): App<MergeAppData<TAppData, {
|
|
197
|
+
routes: {
|
|
198
|
+
POST: { [path in TPath]: TRouteDef };
|
|
199
|
+
};
|
|
200
|
+
}>>;
|
|
201
|
+
/**
|
|
202
|
+
* Add an undocumented PUT route to the app.
|
|
203
|
+
*/
|
|
204
|
+
put<TPath extends BasePath>(path: TPath, handler: RouteHandler<TAppData, TPath, AnyDef>): App<MergeAppData<TAppData, {
|
|
205
|
+
routes: {
|
|
206
|
+
PUT: { [path in TPath]: AnyDef };
|
|
207
|
+
};
|
|
208
|
+
}>>;
|
|
209
|
+
/**
|
|
210
|
+
* Add a documented PUT route to the app.
|
|
211
|
+
*/
|
|
212
|
+
put<TPath extends BasePath, TRouteDef extends RouteDef>(path: TPath, def: TRouteDef, handler: RouteHandler<TAppData, TPath, TRouteDef>): App<MergeAppData<TAppData, {
|
|
213
|
+
routes: {
|
|
214
|
+
PUT: { [path in TPath]: TRouteDef };
|
|
215
|
+
};
|
|
216
|
+
}>>;
|
|
217
|
+
/**
|
|
218
|
+
* Add an undocumented DELETE route to the app.
|
|
219
|
+
*/
|
|
220
|
+
delete<TPath extends BasePath>(path: TPath, handler: RouteHandler<TAppData, TPath, AnyDef>): App<MergeAppData<TAppData, {
|
|
221
|
+
routes: {
|
|
222
|
+
DELETE: { [path in TPath]: AnyDef };
|
|
223
|
+
};
|
|
224
|
+
}>>;
|
|
225
|
+
/**
|
|
226
|
+
* Add a documented DELETE route to the app.
|
|
227
|
+
*/
|
|
228
|
+
delete<TPath extends BasePath, TRouteDef extends RouteDef>(path: TPath, def: TRouteDef, handler: RouteHandler<TAppData, TPath, TRouteDef>): App<MergeAppData<TAppData, {
|
|
229
|
+
routes: {
|
|
230
|
+
DELETE: { [path in TPath]: TRouteDef };
|
|
231
|
+
};
|
|
232
|
+
}>>;
|
|
233
|
+
/**
|
|
234
|
+
* Add an undocumented route to the app that responds to any method used.
|
|
235
|
+
*/
|
|
236
|
+
any<TPath extends BasePath>(path: TPath, handler: RouteHandler<TAppData, TPath, AnyDef>): App<MergeAppData<TAppData, {
|
|
237
|
+
routes: {
|
|
238
|
+
ANY: { [path in TPath]: AnyDef };
|
|
239
|
+
};
|
|
240
|
+
}>>;
|
|
241
|
+
/**
|
|
242
|
+
* Add an documented route to the app that responds to any method used.
|
|
243
|
+
*/
|
|
244
|
+
any<TPath extends BasePath, TRouteDef extends RouteDef>(path: TPath, def: TRouteDef, handler: RouteHandler<TAppData, TPath, AnyDef>): App<MergeAppData<TAppData, {
|
|
245
|
+
routes: {
|
|
246
|
+
ANY: { [path in TPath]: TRouteDef };
|
|
247
|
+
};
|
|
248
|
+
}>>;
|
|
249
|
+
/**
|
|
250
|
+
* Add an undocumented route to the app using a custom method.
|
|
251
|
+
*/
|
|
252
|
+
method<TMethod extends string, TPath extends BasePath>(method: TMethod, path: TPath, handler: RouteHandler<TAppData, TPath, AnyDef>): App<MergeAppData<TAppData, {
|
|
253
|
+
routes: { [method in TMethod]: { [path in TPath]: AnyDef } };
|
|
254
|
+
}>>;
|
|
255
|
+
/**
|
|
256
|
+
* Add a documented route to the app using a custom method.
|
|
257
|
+
*/
|
|
258
|
+
method<TMethod extends string, TPath extends BasePath, TRouteDef extends RouteDef>(method: TMethod, path: TPath, def: TRouteDef, handler: RouteHandler<TAppData, TPath, TRouteDef>): App<MergeAppData<TAppData, {
|
|
259
|
+
routes: { [method in TMethod]: { [path in TPath]: TRouteDef } };
|
|
260
|
+
}>>;
|
|
261
|
+
/**
|
|
262
|
+
* Mount another fetch function at `/**`.
|
|
263
|
+
*/
|
|
264
|
+
mount(fetch: ServerSideFetch): App<MergeAppData<TAppData, {
|
|
265
|
+
routes: {
|
|
266
|
+
ANY: {
|
|
267
|
+
"/**": AnyDef;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
}>>;
|
|
271
|
+
/**
|
|
272
|
+
* Mount another fetch function at `${path}/**`.
|
|
273
|
+
*/
|
|
274
|
+
mount<TPath extends BasePath>(path: TPath, fetch: ServerSideFetch): App<MergeAppData<TAppData, {
|
|
275
|
+
routes: {
|
|
276
|
+
ANY: { [path in `${TPath}/**`]: AnyDef };
|
|
277
|
+
};
|
|
278
|
+
}>>;
|
|
279
|
+
/**
|
|
280
|
+
* Mount another fetch function at `${path}/**`.
|
|
281
|
+
*/
|
|
282
|
+
mount<TPath extends BasePath, TRouteDef extends RouteDef>(path: TPath, def: TRouteDef, fetch: ServerSideFetch): App<MergeAppData<TAppData, {
|
|
283
|
+
routes: {
|
|
284
|
+
ANY: { [path in `${TPath}/**`]: TRouteDef };
|
|
285
|
+
};
|
|
286
|
+
}>>;
|
|
287
|
+
/**
|
|
288
|
+
* Add a subapp to the app.
|
|
289
|
+
*/
|
|
290
|
+
use<TNewApp extends App>(app: TNewApp): App<UseAppData<TAppData, GetAppData<TNewApp>>>;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Given an `App`, return it's `AppData`.
|
|
294
|
+
*/
|
|
295
|
+
type GetAppData<TApp extends App> = TApp extends App<infer TAppData> ? TAppData : never;
|
|
296
|
+
/**
|
|
297
|
+
* Given an `App`, return the routes defined on it.
|
|
298
|
+
*/
|
|
299
|
+
type GetAppRoutes<TApp extends App> = GetAppData<TApp>["routes"];
|
|
300
|
+
/**
|
|
301
|
+
* Data stored internally for each route inside the `rou3` router.
|
|
302
|
+
*/
|
|
303
|
+
type RouterData = {
|
|
304
|
+
def?: RouteDef;
|
|
305
|
+
route: string;
|
|
306
|
+
hooks: LifeCycleHooks;
|
|
307
|
+
compiledHandler: CompiledRouteHandler;
|
|
308
|
+
} & ({
|
|
309
|
+
fetch: ServerSideFetch;
|
|
310
|
+
} | {
|
|
311
|
+
handler: (ctx: OnBeforeHandleContext) => Promise<any>;
|
|
312
|
+
});
|
|
313
|
+
/**
|
|
314
|
+
* Function type called internally once a route is matched for a request.
|
|
315
|
+
*/
|
|
316
|
+
type CompiledRouteHandler = (request: Request, ctx: any) => MaybePromise<Response>;
|
|
317
|
+
/**
|
|
318
|
+
* Type of the callback function used for each route.
|
|
319
|
+
*/
|
|
320
|
+
type RouteHandler<TAppData extends AppData, TPath extends BasePath, TRouteDef extends RouteDef> = (ctx: BuildHandlerContext<TAppData, TPath, TRouteDef>) => MaybePromise<GetRouteHandlerReturnType<TRouteDef>>;
|
|
321
|
+
type GetRouteHandlerReturnType<TRouteDef extends RouteDef> = TRouteDef extends {
|
|
322
|
+
responses: symbol;
|
|
323
|
+
} ? any : TRouteDef extends {
|
|
324
|
+
responses: infer TResponses;
|
|
325
|
+
} ? TResponses extends StandardSchemaV1 ? StandardSchemaV1.InferInput<TResponses> : TRouteDef["responses"] extends Record<number, StandardSchemaV1<any>> ? StatusResult : never : void;
|
|
326
|
+
/**
|
|
327
|
+
* Given an `App`, a method, and a route, return the handler function's type.
|
|
328
|
+
*/
|
|
329
|
+
type GetRouteHandler<TApp extends App, TMethod extends keyof GetAppRoutes<TApp>, TRoute extends keyof GetAppRoutes<TApp>[TMethod]> = TRoute extends BasePath ? GetAppRoutes<TApp>[TMethod][TRoute] extends RouteDef ? RouteHandler<GetAppData<TApp>, TRoute, GetAppRoutes<TApp>[TMethod][TRoute]> : never : never;
|
|
330
|
+
/**
|
|
331
|
+
* Internal type used to store a hook on an app.
|
|
332
|
+
*/
|
|
333
|
+
type LifeCycleHook<TCallback extends Function> = {
|
|
334
|
+
/**
|
|
335
|
+
* Used for deducplication.
|
|
336
|
+
*/
|
|
337
|
+
id: string;
|
|
338
|
+
/**
|
|
339
|
+
* Where this plugin should be applied.
|
|
340
|
+
* - `global`: Global plugins are hoisted to the top-level app.
|
|
341
|
+
* - `local`: Local plugins are applied to the app they were added to.
|
|
342
|
+
* @default "local"
|
|
343
|
+
*/
|
|
344
|
+
applyTo: "global" | "local";
|
|
345
|
+
/**
|
|
346
|
+
* The function called when the hook is triggered.
|
|
347
|
+
*/
|
|
348
|
+
callback: TCallback;
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Called immediately after receiving the request. Returned record is merged
|
|
352
|
+
* into the handler context.
|
|
353
|
+
*/
|
|
354
|
+
type OnGlobalRequestHook = LifeCycleHook<(ctx: Simplify<OnGlobalRequestContext>) => Record<string, any> | void>;
|
|
355
|
+
/**
|
|
356
|
+
* Called before validating the request inputs. Returned record is merged into
|
|
357
|
+
* the handler context.
|
|
358
|
+
*/
|
|
359
|
+
type OnTransformHook = LifeCycleHook<(ctx: Simplify<OnTransformContext>) => MaybePromise<Record<string, any> | void>>;
|
|
360
|
+
/**
|
|
361
|
+
* Called before calling the route handler. Returned record is merged into the
|
|
362
|
+
* handler context.
|
|
363
|
+
*/
|
|
364
|
+
type OnBeforeHandleHook = LifeCycleHook<(ctx: Simplify<OnBeforeHandleContext>) => MaybePromise<Record<string, any> | void>>;
|
|
365
|
+
/**
|
|
366
|
+
* Called after calling the route handler. If there is a return value, it
|
|
367
|
+
* replaces the return value from the handler. Similar to the `onTransform` hook,
|
|
368
|
+
* but for the response.
|
|
369
|
+
*/
|
|
370
|
+
type OnAfterHandleHook = LifeCycleHook<(ctx: Simplify<AfterHandleContext>) => MaybePromise<unknown | void>>;
|
|
371
|
+
/**
|
|
372
|
+
* Called after validating the handler return value. Used to transform the
|
|
373
|
+
* return value into a `Response`.
|
|
374
|
+
*/
|
|
375
|
+
type OnMapResponseHook = LifeCycleHook<(ctx: Simplify<OnMapResponseContext>) => MaybePromise<Response | void>>;
|
|
376
|
+
/**
|
|
377
|
+
* Called if an error is thrown in any other hook other than `onGlobalAfterResponse`.
|
|
378
|
+
*
|
|
379
|
+
* Zeta will handle any `HttpError`s thrown, but you can handle your own errors
|
|
380
|
+
* here.
|
|
381
|
+
*/
|
|
382
|
+
type OnGlobalErrorHook = LifeCycleHook<(ctx: Simplify<OnGlobalErrorContext>) => void>;
|
|
383
|
+
/**
|
|
384
|
+
* Called after the response is sent back to the client.
|
|
385
|
+
*/
|
|
386
|
+
type OnGlobalAfterResponseHook = LifeCycleHook<(ctx: Simplify<AfterResponseContext>) => void>;
|
|
387
|
+
type LifeCycleHooks = {
|
|
388
|
+
onGlobalRequest?: OnGlobalRequestHook[];
|
|
389
|
+
onTransform?: OnTransformHook[];
|
|
390
|
+
onBeforeHandle?: OnBeforeHandleHook[];
|
|
391
|
+
onAfterHandle?: OnAfterHandleHook[];
|
|
392
|
+
onMapResponse?: OnMapResponseHook[];
|
|
393
|
+
onGlobalError?: OnGlobalErrorHook[];
|
|
394
|
+
onGlobalAfterResponse?: OnGlobalAfterResponseHook[];
|
|
395
|
+
};
|
|
396
|
+
type LifeCycleHookName = keyof LifeCycleHooks;
|
|
397
|
+
/**
|
|
398
|
+
* Base data type associated with each app.
|
|
399
|
+
*/
|
|
400
|
+
type AppData = {
|
|
401
|
+
exported: boolean;
|
|
402
|
+
prefix: BasePrefix;
|
|
403
|
+
ctx: BaseCtx;
|
|
404
|
+
routes: BaseRoutes;
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* Minimal data type that works with `AppData`.
|
|
408
|
+
*/
|
|
409
|
+
type DefaultAppData = {
|
|
410
|
+
exported: false;
|
|
411
|
+
prefix: "";
|
|
412
|
+
ctx: {};
|
|
413
|
+
routes: {};
|
|
414
|
+
};
|
|
415
|
+
/**
|
|
416
|
+
* Minimal data type that matches `AppData["ctx"]`.
|
|
417
|
+
*/
|
|
418
|
+
type BaseCtx = Record<string, any>;
|
|
419
|
+
/**
|
|
420
|
+
* Minimal data type that matches `AppData["routes"]`.
|
|
421
|
+
*/
|
|
422
|
+
type BaseRoutes = {
|
|
423
|
+
[method: string]: {
|
|
424
|
+
[path: BasePath]: RouteDef;
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
/**
|
|
428
|
+
* Minimal data type that matches `AppData["routes"][method][path]`, containing information about the route.
|
|
429
|
+
*/
|
|
430
|
+
type RouteDef = Simplify<Omit<OpenAPI.Operation, "parameters" | "responses"> & {
|
|
431
|
+
headers?: StandardSchemaV1<Record<string, any>>;
|
|
432
|
+
params?: StandardSchemaV1<Record<string, any>>;
|
|
433
|
+
query?: StandardSchemaV1<Record<string, any>>;
|
|
434
|
+
body?: StandardSchemaV1;
|
|
435
|
+
responses?: StandardSchemaV1 | Record<number, StandardSchemaV1>;
|
|
436
|
+
}>;
|
|
437
|
+
/**
|
|
438
|
+
* Used for `TDef` when a route definition is not passed. Essentially removes type-safety from a route.
|
|
439
|
+
*/
|
|
440
|
+
type AnyDef = {
|
|
441
|
+
headers: StandardSchemaV1<Record<string, string>>;
|
|
442
|
+
params: StandardSchemaV1<Record<string, string>>;
|
|
443
|
+
query: StandardSchemaV1<Record<string, string>>;
|
|
444
|
+
body: StandardSchemaV1<any>;
|
|
445
|
+
responses: any;
|
|
446
|
+
};
|
|
447
|
+
/**
|
|
448
|
+
* Base type representing what strings can be passed as a `prefix` when creating an app.
|
|
449
|
+
*/
|
|
450
|
+
type BasePrefix = BasePath | "";
|
|
451
|
+
/**
|
|
452
|
+
* Base type representing what a route's string must look like.
|
|
453
|
+
*/
|
|
454
|
+
type BasePath = `/${string}`;
|
|
455
|
+
/**
|
|
456
|
+
* `ctx` type used in the `onGlobalRequest` hook.
|
|
457
|
+
*/
|
|
458
|
+
type OnGlobalRequestContext<TCtx extends BaseCtx = {}> = TCtx & {
|
|
459
|
+
request: Request;
|
|
460
|
+
url: URL;
|
|
461
|
+
path: string;
|
|
462
|
+
method: string;
|
|
463
|
+
set: Setter;
|
|
464
|
+
};
|
|
465
|
+
/**
|
|
466
|
+
* `ctx` type used in the `onTransform` hook.
|
|
467
|
+
*/
|
|
468
|
+
type OnTransformContext<TCtx extends BaseCtx = {}> = OnGlobalRequestContext<TCtx> & {
|
|
469
|
+
route: string;
|
|
470
|
+
params?: Record<string, string>;
|
|
471
|
+
query?: Record<string, string>;
|
|
472
|
+
headers?: Record<string, string>;
|
|
473
|
+
body?: any;
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* `ctx` type used in the `onBeforeHandle` hook.
|
|
477
|
+
*/
|
|
478
|
+
type OnBeforeHandleContext<TCtx extends BaseCtx = {}> = OnTransformContext<TCtx>;
|
|
479
|
+
/**
|
|
480
|
+
* `ctx` type used in the `onAfterHandle` hook.
|
|
481
|
+
*/
|
|
482
|
+
type AfterHandleContext<TCtx extends BaseCtx = {}> = OnTransformContext<TCtx> & {
|
|
483
|
+
response?: unknown;
|
|
484
|
+
};
|
|
485
|
+
/**
|
|
486
|
+
* `ctx` type used in the `onMapResponse` hook.
|
|
487
|
+
*/
|
|
488
|
+
type OnMapResponseContext<TCtx extends BaseCtx = {}> = AfterHandleContext<TCtx> & {};
|
|
489
|
+
/**
|
|
490
|
+
* `ctx` type used in the `onGlobalError` hook.
|
|
491
|
+
*/
|
|
492
|
+
type OnGlobalErrorContext<TCtx extends BaseCtx = {}> = OnGlobalRequestContext<TCtx> & Partial<OnMapResponseContext> & {
|
|
493
|
+
error: unknown;
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* `ctx` type used in the `onGlobalAfterResponse` hook.
|
|
497
|
+
*/
|
|
498
|
+
type AfterResponseContext<TCtx extends BaseCtx = {}> = OnGlobalRequestContext<TCtx> & Partial<OnMapResponseContext> & {
|
|
499
|
+
response: Response;
|
|
500
|
+
};
|
|
501
|
+
/**
|
|
502
|
+
* Given an `AppData` type, return the type of it's `ctx`.
|
|
503
|
+
*/
|
|
504
|
+
type GetAppDataCtx<TAppData extends AppData> = TAppData extends {
|
|
505
|
+
ctx: infer TCtx;
|
|
506
|
+
} ? TCtx : never;
|
|
507
|
+
type StatusFn<TMap extends Record<any, any>> = TMap extends never ? never : <TStatus extends keyof TMap>(status: TStatus, body: StandardSchemaV1.InferInput<TMap[TStatus]>) => StatusResult;
|
|
508
|
+
type GetResponseStatusMap<TRouteDef extends RouteDef> = TRouteDef extends {
|
|
509
|
+
responses: unknown;
|
|
510
|
+
} ? TRouteDef["responses"] extends symbol ? Record<number, StandardSchemaV1<any, any>> : TRouteDef["responses"] extends StandardSchemaV1 ? {
|
|
511
|
+
200: TRouteDef["responses"];
|
|
512
|
+
} : TRouteDef["responses"] extends Record<number | string, StandardSchemaV1> ? TRouteDef["responses"] : any : never;
|
|
513
|
+
type StatusResult = {
|
|
514
|
+
[IsStatusResult]: true;
|
|
515
|
+
status: number;
|
|
516
|
+
body: unknown;
|
|
517
|
+
};
|
|
518
|
+
/**
|
|
519
|
+
* Build the `ctx` type used for request handlers.
|
|
520
|
+
*/
|
|
521
|
+
type BuildHandlerContext<TAppData extends AppData, TPath extends BasePath, TRouteDef extends RouteDef> = Simplify<Omit<OnBeforeHandleContext<GetAppDataCtx<TAppData>>, InputParams> & {
|
|
522
|
+
route: TPath;
|
|
523
|
+
} & GetRequestParamsOutputFromDef<TRouteDef> & {
|
|
524
|
+
status: StatusFn<GetResponseStatusMap<TRouteDef>>;
|
|
525
|
+
}>;
|
|
526
|
+
/**
|
|
527
|
+
* Given two `App`s, merge their data to match the behavior of `TParent.use(TChild)`.
|
|
528
|
+
*/
|
|
529
|
+
type UseApp<TParent extends App, TChild extends App> = App<Simplify<UseAppData<GetAppData<TParent>, GetAppData<TChild>>>>;
|
|
530
|
+
/**
|
|
531
|
+
* Same as `UseApp`, but instead of app instances, it merges the `AppData` of each.
|
|
532
|
+
*/
|
|
533
|
+
type UseAppData<TParentData extends AppData, TChildData extends AppData> = TChildData extends {
|
|
534
|
+
exported: true;
|
|
535
|
+
} ? MergeAppData<TParentData, Pick<ApplyAppDataPrefix<TChildData>, "ctx" | "routes">> : MergeAppData<TParentData, Pick<ApplyAppDataPrefix<TChildData>, "routes">>;
|
|
536
|
+
/**
|
|
537
|
+
* Merge two `App` types together. See `MergeAppData` for details.
|
|
538
|
+
*/
|
|
539
|
+
type MergeApp<T1, T2> = T1 extends App<infer D1> ? T2 extends App<infer D2> ? App<Simplify<MergeAppData<D1, D2>>> : never : never;
|
|
540
|
+
/**
|
|
541
|
+
* Merge two `AppData` types together.
|
|
542
|
+
* - `prefix`: The second app's prefix overrides the first if present.
|
|
543
|
+
* - `ctx`: The second app's context gets merged with the first if present. Any
|
|
544
|
+
* existing keys are overwritten to match the second app's context.
|
|
545
|
+
* - `exported`: The second app's exported status overrides the first if
|
|
546
|
+
* present.
|
|
547
|
+
* - `routes`: See `MergeRoutes` for details.
|
|
548
|
+
*/
|
|
549
|
+
type MergeAppData<T1 extends AppData, T2 extends Partial<AppData>> = Simplify<{
|
|
550
|
+
prefix: T2["prefix"] extends string ? T2["prefix"] : T1["prefix"];
|
|
551
|
+
ctx: T2["ctx"] extends BaseCtx ? Simplify<Spread<T1["ctx"], T2["ctx"]>> : T1["ctx"];
|
|
552
|
+
exported: T2["exported"] extends boolean ? T2["exported"] : T1["exported"];
|
|
553
|
+
routes: T2["routes"] extends BaseRoutes ? Simplify<MergeRoutes<T1["routes"], T2["routes"]>> : T1["routes"];
|
|
554
|
+
}>;
|
|
555
|
+
/**
|
|
556
|
+
* Merges two route objects together, 2 levels deep. If the same method/path
|
|
557
|
+
* combination exists in both apps, the second app's route overrides the first.
|
|
558
|
+
*/
|
|
559
|
+
type MergeRoutes<A extends Record<string, any>, B extends Record<string, any>> = Simplify<Merge<A, B>>;
|
|
560
|
+
/**
|
|
561
|
+
* Given an app and a new prefix, return a new app type with app's original
|
|
562
|
+
* prefix applied to each route, and with the new prefix stored in the
|
|
563
|
+
* `AppData`.
|
|
564
|
+
*/
|
|
565
|
+
type ApplyAppPrefix<TApp extends App, TNewPrefix extends BasePrefix = ""> = App<Simplify<ApplyAppDataPrefix<GetAppData<TApp>, TNewPrefix>>>;
|
|
566
|
+
/**
|
|
567
|
+
* Same as `ApplyAppPrefix`, but at the `AppData` level.
|
|
568
|
+
*/
|
|
569
|
+
type ApplyAppDataPrefix<TAppData extends AppData, TNewPrefix extends BasePrefix = ""> = {
|
|
570
|
+
ctx: TAppData["ctx"];
|
|
571
|
+
exported: TAppData["exported"];
|
|
572
|
+
prefix: TNewPrefix;
|
|
573
|
+
routes: TAppData["prefix"] extends BasePath ? { [TMethod in keyof TAppData["routes"]]: Simplify<PrefixObjectKeys<TAppData["prefix"], TAppData["routes"][TMethod]>> } : TAppData["routes"];
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
576
|
+
* Given a route definition, return the input types of all the params.
|
|
577
|
+
*/
|
|
578
|
+
type GetRequestParamsInputFromDef<TRouteDef extends RouteDef> = TRouteDef extends AnyDef ? {
|
|
579
|
+
headers?: Record<string, string>;
|
|
580
|
+
params?: Record<string, string>;
|
|
581
|
+
query?: Record<string, string>;
|
|
582
|
+
body?: any;
|
|
583
|
+
} : Simplify<{ [key in keyof GetDefParams<TRouteDef>]: TRouteDef[key] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<TRouteDef[key]> : never }>;
|
|
584
|
+
/**
|
|
585
|
+
* Given a set of routes, a method, and a route, return the input types of all
|
|
586
|
+
* the schemas in the route definition.
|
|
587
|
+
*/
|
|
588
|
+
type GetRequestParamsInput<TRoutes extends BaseRoutes, TMethod extends keyof TRoutes, TRoute extends keyof TRoutes[TMethod]> = TRoute extends BasePath ? GetRequestParamsInputFromDef<TRoutes[TMethod][TRoute]> : never;
|
|
589
|
+
/**
|
|
590
|
+
* Given a route definition, return the input type of the response schema.
|
|
591
|
+
*/
|
|
592
|
+
type GetResponseInputFromDef<TRouteDef extends RouteDef> = TRouteDef["responses"] extends undefined ? undefined : TRouteDef["responses"] extends StandardSchemaV1 ? StandardSchemaV1.InferInput<TRouteDef["responses"]> : never;
|
|
593
|
+
/**
|
|
594
|
+
* Given a set of routes, a method, and a route, return the input type of the
|
|
595
|
+
* response schema in the route definition.
|
|
596
|
+
*/
|
|
597
|
+
type GetResponseInput<TRoutes extends BaseRoutes, TMethod extends keyof TRoutes, TPath extends keyof TRoutes[TMethod]> = TPath extends BasePath ? GetResponseInputFromDef<TRoutes[TMethod][TPath]> : never;
|
|
598
|
+
/**
|
|
599
|
+
* Helper type for converting a schema or object containing schemas to their
|
|
600
|
+
* output types.
|
|
601
|
+
*/
|
|
602
|
+
type ToStandardSchemaOutputs<T> = T extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<T> : T extends { [key in keyof T]: any } ? { [key in keyof T]: ToStandardSchemaOutputs<T[key]> } : never;
|
|
603
|
+
/**
|
|
604
|
+
* Given a route definition, return the output type of the param schemas.
|
|
605
|
+
*/
|
|
606
|
+
type GetRequestParamsOutputFromDef<TRouteDef extends RouteDef> = ToStandardSchemaOutputs<GetDefParams<TRouteDef>>;
|
|
607
|
+
/**
|
|
608
|
+
* Given a set of routes, a method, and a route, return the output type of the
|
|
609
|
+
* param schemas.
|
|
610
|
+
*/
|
|
611
|
+
type GetRequestParamsOutput<TRoutes extends BaseRoutes, TMethod extends keyof TRoutes, TRoute extends keyof TRoutes[TMethod]> = TRoute extends BasePath ? GetRequestParamsOutputFromDef<TRoutes[TMethod][TRoute]> : never;
|
|
612
|
+
type SuccessStatusCodes = 200 | HttpStatus.Ok | 201 | HttpStatus.Created | 202 | HttpStatus.Accepted | 203 | HttpStatus.NonAuthoritativeInformation | 204 | HttpStatus.NoContent | 205 | HttpStatus.ResetContent | 206 | HttpStatus.PartialContent | 207 | HttpStatus.MultiStatus | 208 | HttpStatus.AlreadyReported | 226 | HttpStatus.ImUsed;
|
|
613
|
+
/**
|
|
614
|
+
* Given a `RouteDef`, return a union of all possible handler return values.
|
|
615
|
+
*
|
|
616
|
+
* If `responses` is defined, it will be a discriminated union of objects
|
|
617
|
+
* containing the status and body.
|
|
618
|
+
*
|
|
619
|
+
* If only `response` is defined, it will be the output of that schema.
|
|
620
|
+
*
|
|
621
|
+
* If neither is defined, it will be `void`.
|
|
622
|
+
*/
|
|
623
|
+
type GetResponseOutputFromDef<TRouteDef extends RouteDef> = TRouteDef["responses"] extends undefined ? undefined : TRouteDef["responses"] extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<TRouteDef["responses"]> : { [key in SuccessStatusCodes & keyof TRouteDef["responses"]]: TRouteDef["responses"][key] extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<TRouteDef["responses"][key]> : unknown }[SuccessStatusCodes & keyof TRouteDef["responses"]];
|
|
624
|
+
/**
|
|
625
|
+
* Given a set of routes, a method, and a route, return the output type of the
|
|
626
|
+
* response schema.
|
|
627
|
+
*/
|
|
628
|
+
type GetResponseOutput<TRoutes extends BaseRoutes, TMethod extends keyof TRoutes, TPath extends keyof TRoutes[TMethod]> = TPath extends BasePath ? GetResponseOutputFromDef<TRoutes[TMethod][TPath]> : 1;
|
|
629
|
+
type InputParams = "headers" | "params" | "query" | "body";
|
|
630
|
+
/**
|
|
631
|
+
* Given a route definition, return an object with only the input parameeters.
|
|
632
|
+
*/
|
|
633
|
+
type GetDefParams<TRouteDef extends RouteDef> = { [key in InputParams & keyof TRouteDef]: TRouteDef[key] };
|
|
634
|
+
/**
|
|
635
|
+
* To generate open API docs, Zeta needs to know how process and extract
|
|
636
|
+
* some information from your schema. This adapter is responsible for
|
|
637
|
+
* providing additional functions for parsing your schema.
|
|
638
|
+
*/
|
|
639
|
+
interface SchemaAdapter {
|
|
640
|
+
/**
|
|
641
|
+
* Convert a standard schema definition to it's JSON schema.
|
|
642
|
+
* @param schema The schema to convert.
|
|
643
|
+
* @returns The JSON schema.
|
|
644
|
+
*/
|
|
645
|
+
toJsonSchema: (schema: any) => any;
|
|
646
|
+
getMeta: (schema: StandardSchemaV1) => Record<string, any> | undefined;
|
|
647
|
+
}
|
|
648
|
+
interface Transport {
|
|
649
|
+
listen: (port: number, fetch: ServerSideFetch, cb?: () => void) => void;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Basic object type used to store custom status and headers set while handling the request.
|
|
653
|
+
*/
|
|
654
|
+
interface Setter {
|
|
655
|
+
/**
|
|
656
|
+
* Set this value to change the status code returned.
|
|
657
|
+
*/
|
|
658
|
+
status: number;
|
|
659
|
+
/**
|
|
660
|
+
* Set a value on this header to change which headers are sent in the response.
|
|
661
|
+
*/
|
|
662
|
+
headers: Record<string, string>;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Given a union of objects, combine them into a single object that's easy to read.
|
|
666
|
+
*/
|
|
667
|
+
type Simplify<T> = T extends {
|
|
668
|
+
[key: string]: any;
|
|
669
|
+
} ? { [K in keyof T]: T[K] } : T;
|
|
670
|
+
/**
|
|
671
|
+
* Returns either a Promise of a type or just the type itself.
|
|
672
|
+
*/
|
|
673
|
+
type MaybePromise<T> = Promise<T> | T;
|
|
674
|
+
/**
|
|
675
|
+
* A function that, given a request, returns a response. This type is compliant with WinterCG.
|
|
676
|
+
*/
|
|
677
|
+
type ServerSideFetch = (request: Request) => MaybePromise<Response>;
|
|
678
|
+
/**
|
|
679
|
+
* Apply a string prefix to all the keys of an object.
|
|
680
|
+
*/
|
|
681
|
+
type PrefixObjectKeys<TPrefix extends string, TObject extends Record<string, unknown>> = { [K in keyof TObject as `${TPrefix}${string & K extends "/" ? "" : string & K}`]: TObject[K] };
|
|
682
|
+
/**
|
|
683
|
+
* A helper type that models a single-level object spread: { ...L, ...R }
|
|
684
|
+
* It takes all properties from R, and all properties from L that are not in R.
|
|
685
|
+
*/
|
|
686
|
+
type Spread<L, R> = Omit<L, keyof R> & R;
|
|
687
|
+
/**
|
|
688
|
+
* Merges two objects, A and B, two levels deep.
|
|
689
|
+
*
|
|
690
|
+
* It combines the keys from both A and B.
|
|
691
|
+
* - If a key exists only in A or only in B, it's carried over.
|
|
692
|
+
* - If a key exists in *both* A and B, it recursively merges their
|
|
693
|
+
* values using a single-level spread (`Spread<A[K], B[K]>`).
|
|
694
|
+
* This ensures properties from B's inner objects overwrite those from A's.
|
|
695
|
+
*/
|
|
696
|
+
type Merge<A, B> = Omit<A, keyof B> & { [K in keyof B]: K extends keyof A ? Simplify<Spread<A[K], B[K]>> : B[K] };
|
|
697
|
+
//#endregion
|
|
698
|
+
export { SchemaAdapter as $, LifeCycleHookName as A, OnGlobalAfterResponseHook as B, GetResponseInputFromDef as C, GetRouteHandler as D, GetResponseStatusMap as E, MergeAppData as F, OnMapResponseContext as G, OnGlobalErrorHook as H, MergeRoutes as I, OnTransformHook as J, OnMapResponseHook as K, OnAfterHandleHook as L, MaybePromise as M, Merge as N, GetRouteHandlerReturnType as O, MergeApp as P, RouterData as Q, OnBeforeHandleContext as R, GetResponseInput as S, GetResponseOutputFromDef as T, OnGlobalRequestContext as U, OnGlobalErrorContext as V, OnGlobalRequestHook as W, RouteDef as X, PrefixObjectKeys as Y, RouteHandler as Z, GetAppRoutes as _, AppData as a, Transport as at, GetRequestParamsOutput as b, BaseCtx as c, BaseRoutes as d, ServerSideFetch as et, BuildHandlerContext as f, GetAppDataCtx as g, GetAppData as h, App as i, StatusResult as it, LifeCycleHooks as j, LifeCycleHook as k, BasePath as l, DefaultAppData as m, AfterResponseContext as n, Simplify as nt, ApplyAppDataPrefix as o, UseApp as ot, CompiledRouteHandler as p, OnTransformContext as q, AnyDef as r, StatusFn as rt, ApplyAppPrefix as s, UseAppData as st, AfterHandleContext as t, Setter as tt, BasePrefix as u, GetRequestParamsInput as v, GetResponseOutput as w, GetRequestParamsOutputFromDef as x, GetRequestParamsInputFromDef as y, OnBeforeHandleHook as z };
|