@aklinker1/zeta 2.1.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/zod-schema-adapter.d.mts +1 -1
- package/dist/app-Bc9Kn3KA.mjs +1225 -0
- package/dist/client.d.mts +2 -2
- package/dist/client.mjs +1 -1
- package/dist/index.d.mts +7 -6
- package/dist/index.mjs +2 -1235
- package/dist/schema.d.mts +1 -1
- package/dist/testing.d.mts +1 -1
- package/dist/transports/bun-transport.d.mts +44 -4
- package/dist/transports/bun-transport.mjs +46 -2
- package/dist/transports/deno-transport.d.mts +45 -3
- package/dist/transports/deno-transport.mjs +50 -6
- package/dist/transports/fetch-transport.d.mts +6 -0
- package/dist/transports/fetch-transport.mjs +25 -0
- package/dist/{types-D9oRVe1E.d.mts → types-BvjPE9EM.d.mts} +24 -10
- package/dist/types.d.mts +2 -2
- package/package.json +15 -5
- /package/dist/{schema-IKHh0I39.d.mts → schema-DKqL09oQ.d.mts} +0 -0
- /package/dist/{serialization-C8e7ECQ2.mjs → serialization-0dai2wUm.mjs} +0 -0
package/dist/schema.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as UploadFileBody, c as isZetaSchema, i as NoResponse, n as ErrorResponseJsonSchema, o as UploadFilesBody, r as FormDataBody, s as ZetaSchema, t as ErrorResponse } from "./schema-
|
|
1
|
+
import { a as UploadFileBody, c as isZetaSchema, i as NoResponse, n as ErrorResponseJsonSchema, o as UploadFilesBody, r as FormDataBody, s as ZetaSchema, t as ErrorResponse } from "./schema-DKqL09oQ.mjs";
|
|
2
2
|
export { ErrorResponse, ErrorResponseJsonSchema, FormDataBody, NoResponse, UploadFileBody, UploadFilesBody, ZetaSchema, isZetaSchema };
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ServeFunctionOptions } from "@types/bun";
|
|
1
|
+
import { Z as RequestContext, a as App, st as Transport } from "../types-BvjPE9EM.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/transports/bun-transport.d.ts
|
|
5
|
-
|
|
4
|
+
type BunTransport = Transport<[request: Request, server: Bun.Server]>;
|
|
5
|
+
declare function createBunTransport(options?: Omit<Bun.ServeFunctionOptions<any, any>, "fetch" | "port">): BunTransport;
|
|
6
|
+
/**
|
|
7
|
+
* Given the request context, return Bun's `server` object. Throws an error if the bun transport is not provided on the top-level app.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const app = createApp({
|
|
12
|
+
* transport: createBunTransport(),
|
|
13
|
+
* }).get("/", (ctx) => {
|
|
14
|
+
* const server = getBunServer(ctx);
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @see `bunServerPlugin` to add the `server` object to request context directly.
|
|
19
|
+
*/
|
|
20
|
+
declare function getBunServer(ctx: RequestContext): Bun.Server;
|
|
21
|
+
/**
|
|
22
|
+
* Plugin that decorates Bun's `server` object in the request context.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const app = createApp({
|
|
27
|
+
* transport: createBunTransport(),
|
|
28
|
+
* })
|
|
29
|
+
* .use(bunServerPlugin)
|
|
30
|
+
* .get("/", ({ server }) => {
|
|
31
|
+
* // ...
|
|
32
|
+
* })
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @see `getBunServer` for a simple function to return the server
|
|
36
|
+
*/
|
|
37
|
+
declare const bunServerPlugin: App<{
|
|
38
|
+
prefix: "";
|
|
39
|
+
ctx: {
|
|
40
|
+
server: Bun.Server;
|
|
41
|
+
};
|
|
42
|
+
exported: true;
|
|
43
|
+
routes: {};
|
|
44
|
+
transport: BunTransport;
|
|
45
|
+
}>;
|
|
6
46
|
//#endregion
|
|
7
|
-
export { createBunTransport };
|
|
47
|
+
export { BunTransport, bunServerPlugin, createBunTransport, getBunServer };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { t as createApp } from "../app-Bc9Kn3KA.mjs";
|
|
1
2
|
//#region src/transports/bun-transport.ts
|
|
3
|
+
const SERVER_KEY = Symbol("bun-transport.server");
|
|
2
4
|
function createBunTransport(options) {
|
|
3
5
|
const listen = (port, fetch, cb) => {
|
|
4
6
|
Bun.serve({
|
|
@@ -8,7 +10,49 @@ function createBunTransport(options) {
|
|
|
8
10
|
});
|
|
9
11
|
if (cb) setTimeout(cb, 0);
|
|
10
12
|
};
|
|
11
|
-
|
|
13
|
+
const decorate = (ctx, _request, server) => {
|
|
14
|
+
ctx[SERVER_KEY] = server;
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
listen,
|
|
18
|
+
decorate
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Given the request context, return Bun's `server` object. Throws an error if the bun transport is not provided on the top-level app.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const app = createApp({
|
|
27
|
+
* transport: createBunTransport(),
|
|
28
|
+
* }).get("/", (ctx) => {
|
|
29
|
+
* const server = getBunServer(ctx);
|
|
30
|
+
* })
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @see `bunServerPlugin` to add the `server` object to request context directly.
|
|
34
|
+
*/
|
|
35
|
+
function getBunServer(ctx) {
|
|
36
|
+
const server = ctx[SERVER_KEY];
|
|
37
|
+
if (!server) throw Error("Bun server not found. Did you forget to provide the bun transport?");
|
|
38
|
+
return server;
|
|
12
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Plugin that decorates Bun's `server` object in the request context.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const app = createApp({
|
|
46
|
+
* transport: createBunTransport(),
|
|
47
|
+
* })
|
|
48
|
+
* .use(bunServerPlugin)
|
|
49
|
+
* .get("/", ({ server }) => {
|
|
50
|
+
* // ...
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @see `getBunServer` for a simple function to return the server
|
|
55
|
+
*/
|
|
56
|
+
const bunServerPlugin = createApp().onTransform((ctx) => ({ server: getBunServer(ctx) })).export();
|
|
13
57
|
//#endregion
|
|
14
|
-
export { createBunTransport };
|
|
58
|
+
export { bunServerPlugin, createBunTransport, getBunServer };
|
|
@@ -1,6 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Z as RequestContext, a as App, st as Transport } from "../types-BvjPE9EM.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/transports/deno-transport.d.ts
|
|
4
|
-
|
|
4
|
+
type DenoTransport = Transport<[request: Request, server: Deno.HttpServer]>;
|
|
5
|
+
type ServeOptions = Parameters<typeof Deno.serve>[0];
|
|
6
|
+
declare function createDenoTransport(options?: Omit<ServeOptions, "port">): DenoTransport;
|
|
7
|
+
/**
|
|
8
|
+
* Given the request context, return Deno's `server` object. Throws an error if the Deno transport is not provided on the top-level app.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const app = createApp({
|
|
13
|
+
* transport: createDenoTransport(),
|
|
14
|
+
* }).get("/", (ctx) => {
|
|
15
|
+
* const server = getDenoServer(ctx);
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @see `denoServerPlugin` to add the `server` object to request context directly.
|
|
20
|
+
*/
|
|
21
|
+
declare function getDenoServer(ctx: RequestContext): Deno.HttpServer;
|
|
22
|
+
/**
|
|
23
|
+
* Plugin that decorates Deno's `server` object in the request context.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const app = createApp({
|
|
28
|
+
* transport: createDenoTransport(),
|
|
29
|
+
* })
|
|
30
|
+
* .use(denoServerPlugin)
|
|
31
|
+
* .get("/", ({ server }) => {
|
|
32
|
+
* // ...
|
|
33
|
+
* })
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see `getDenoServer` for a simple function to return the server
|
|
37
|
+
*/
|
|
38
|
+
declare const denoServerPlugin: App<{
|
|
39
|
+
prefix: "";
|
|
40
|
+
ctx: {
|
|
41
|
+
server: Deno.HttpServer;
|
|
42
|
+
};
|
|
43
|
+
exported: true;
|
|
44
|
+
routes: {};
|
|
45
|
+
transport: DenoTransport;
|
|
46
|
+
}>;
|
|
5
47
|
//#endregion
|
|
6
|
-
export { createDenoTransport };
|
|
48
|
+
export { DenoTransport, createDenoTransport, denoServerPlugin, getDenoServer };
|
|
@@ -1,13 +1,57 @@
|
|
|
1
|
+
import { t as createApp } from "../app-Bc9Kn3KA.mjs";
|
|
1
2
|
//#region src/transports/deno-transport.ts
|
|
2
|
-
|
|
3
|
+
const SERVER_KEY = Symbol("deno-transport.server");
|
|
4
|
+
function createDenoTransport(options) {
|
|
3
5
|
const listen = (port, fetch, cb) => {
|
|
4
6
|
Deno.serve({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
7
|
+
...options,
|
|
8
|
+
port
|
|
9
|
+
}, fetch);
|
|
8
10
|
if (cb) setTimeout(cb, 0);
|
|
9
11
|
};
|
|
10
|
-
|
|
12
|
+
const decorate = (ctx, _request, server) => {
|
|
13
|
+
ctx[SERVER_KEY] = server;
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
listen,
|
|
17
|
+
decorate
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Given the request context, return Deno's `server` object. Throws an error if the Deno transport is not provided on the top-level app.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const app = createApp({
|
|
26
|
+
* transport: createDenoTransport(),
|
|
27
|
+
* }).get("/", (ctx) => {
|
|
28
|
+
* const server = getDenoServer(ctx);
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @see `denoServerPlugin` to add the `server` object to request context directly.
|
|
33
|
+
*/
|
|
34
|
+
function getDenoServer(ctx) {
|
|
35
|
+
const server = ctx[SERVER_KEY];
|
|
36
|
+
if (!server) throw Error("Deno server not found. Did you forget to provide the deno transport?");
|
|
37
|
+
return server;
|
|
11
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Plugin that decorates Deno's `server` object in the request context.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const app = createApp({
|
|
45
|
+
* transport: createDenoTransport(),
|
|
46
|
+
* })
|
|
47
|
+
* .use(denoServerPlugin)
|
|
48
|
+
* .get("/", ({ server }) => {
|
|
49
|
+
* // ...
|
|
50
|
+
* })
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @see `getDenoServer` for a simple function to return the server
|
|
54
|
+
*/
|
|
55
|
+
const denoServerPlugin = createApp().onTransform((ctx) => ({ server: getDenoServer(ctx) })).export();
|
|
12
56
|
//#endregion
|
|
13
|
-
export { createDenoTransport };
|
|
57
|
+
export { createDenoTransport, denoServerPlugin, getDenoServer };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/transports/fetch-transport.ts
|
|
2
|
+
function createFetchTransport() {
|
|
3
|
+
const listen = (port, fetch, cb) => {
|
|
4
|
+
if (globalThis.Bun) Bun.serve({
|
|
5
|
+
port,
|
|
6
|
+
fetch
|
|
7
|
+
});
|
|
8
|
+
else if (globalThis.Deno) Deno.serve({ port }, fetch);
|
|
9
|
+
else throw Error(`Cannot automatically detect which transport to use. You must specify a transport in your top-level app:
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
import { createBunTransport } from '@aklinker1/zeta/transports/bun-transport';
|
|
13
|
+
|
|
14
|
+
const app = createApp({
|
|
15
|
+
transport: createBunTransport(),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
app.listen();
|
|
19
|
+
---`);
|
|
20
|
+
if (cb) setTimeout(cb, 0);
|
|
21
|
+
};
|
|
22
|
+
return { listen };
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { createFetchTransport };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as HttpStatus } from "./schema-
|
|
1
|
+
import { l as HttpStatus } from "./schema-DKqL09oQ.mjs";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
3
|
import { OpenAPI } from "openapi-types";
|
|
4
4
|
|
|
@@ -46,7 +46,7 @@ interface App<TAppData extends AppData = AppData> {
|
|
|
46
46
|
/**
|
|
47
47
|
* Merge and simplify all the app routes into a single fetch function.
|
|
48
48
|
*/
|
|
49
|
-
build: () => ServerSideFetch
|
|
49
|
+
build: () => ServerSideFetch<TAppData["transport"]>;
|
|
50
50
|
/**
|
|
51
51
|
* Returns your application's OpenAPI spec. You do not need to listen to a
|
|
52
52
|
* port to call this method.
|
|
@@ -402,6 +402,7 @@ type AppData = {
|
|
|
402
402
|
prefix: BasePrefix;
|
|
403
403
|
ctx: BaseCtx;
|
|
404
404
|
routes: BaseRoutes;
|
|
405
|
+
transport: AnyTransport;
|
|
405
406
|
};
|
|
406
407
|
/**
|
|
407
408
|
* Minimal data type that works with `AppData`.
|
|
@@ -411,6 +412,7 @@ type DefaultAppData = {
|
|
|
411
412
|
prefix: "";
|
|
412
413
|
ctx: {};
|
|
413
414
|
routes: {};
|
|
415
|
+
transport: AnyTransport;
|
|
414
416
|
};
|
|
415
417
|
/**
|
|
416
418
|
* Minimal data type that matches `AppData["ctx"]`.
|
|
@@ -452,16 +454,17 @@ type BasePrefix = BasePath | "";
|
|
|
452
454
|
* Base type representing what a route's string must look like.
|
|
453
455
|
*/
|
|
454
456
|
type BasePath = `/${string}`;
|
|
455
|
-
|
|
456
|
-
* `ctx` type used in the `onGlobalRequest` hook.
|
|
457
|
-
*/
|
|
458
|
-
type OnGlobalRequestContext<TCtx extends BaseCtx = {}> = TCtx & {
|
|
457
|
+
interface RequestContext {
|
|
459
458
|
request: Request;
|
|
460
459
|
url: URL;
|
|
461
460
|
path: string;
|
|
462
461
|
method: string;
|
|
463
462
|
set: Setter;
|
|
464
|
-
}
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* `ctx` type used in the `onGlobalRequest` hook.
|
|
466
|
+
*/
|
|
467
|
+
type OnGlobalRequestContext<TCtx extends BaseCtx = {}> = TCtx & RequestContext;
|
|
465
468
|
/**
|
|
466
469
|
* `ctx` type used in the `onTransform` hook.
|
|
467
470
|
*/
|
|
@@ -545,12 +548,14 @@ type MergeApp<T1, T2> = T1 extends App<infer D1> ? T2 extends App<infer D2> ? Ap
|
|
|
545
548
|
* - `exported`: The second app's exported status overrides the first if
|
|
546
549
|
* present.
|
|
547
550
|
* - `routes`: See `MergeRoutes` for details.
|
|
551
|
+
* - `transport`: Use the original transport, it cannot be overridden
|
|
548
552
|
*/
|
|
549
553
|
type MergeAppData<T1 extends AppData, T2 extends Partial<AppData>> = Simplify<{
|
|
550
554
|
prefix: T2["prefix"] extends string ? T2["prefix"] : T1["prefix"];
|
|
551
555
|
ctx: T2["ctx"] extends BaseCtx ? Simplify<Spread<T1["ctx"], T2["ctx"]>> : T1["ctx"];
|
|
552
556
|
exported: T2["exported"] extends boolean ? T2["exported"] : T1["exported"];
|
|
553
557
|
routes: T2["routes"] extends BaseRoutes ? Simplify<MergeRoutes<T1["routes"], T2["routes"]>> : T1["routes"];
|
|
558
|
+
transport: T1["transport"];
|
|
554
559
|
}>;
|
|
555
560
|
/**
|
|
556
561
|
* Merges two route objects together, 2 levels deep. If the same method/path
|
|
@@ -571,6 +576,7 @@ type ApplyAppDataPrefix<TAppData extends AppData, TNewPrefix extends BasePrefix
|
|
|
571
576
|
exported: TAppData["exported"];
|
|
572
577
|
prefix: TNewPrefix;
|
|
573
578
|
routes: TAppData["prefix"] extends BasePath ? { [TMethod in keyof TAppData["routes"]]: Simplify<PrefixObjectKeys<TAppData["prefix"], TAppData["routes"][TMethod]>> } : TAppData["routes"];
|
|
579
|
+
transport: TAppData["transport"];
|
|
574
580
|
};
|
|
575
581
|
/**
|
|
576
582
|
* Given a route definition, return the input types of all the params.
|
|
@@ -645,9 +651,17 @@ interface SchemaAdapter {
|
|
|
645
651
|
toJsonSchema: (schema: any) => any;
|
|
646
652
|
getMeta: (schema: StandardSchemaV1) => Record<string, any> | undefined;
|
|
647
653
|
}
|
|
648
|
-
interface Transport {
|
|
654
|
+
interface Transport<TFetchArgs extends [request: Request, ...params: any[]] = [request: Request]> {
|
|
655
|
+
/**
|
|
656
|
+
* Actually bind the server to a local port for hosting.
|
|
657
|
+
*/
|
|
649
658
|
listen: (port: number, fetch: ServerSideFetch, cb?: () => void) => void;
|
|
659
|
+
/**
|
|
660
|
+
* Callback where the ctx object can be modified based on the args provided to the fetch function.
|
|
661
|
+
*/
|
|
662
|
+
decorate?: (ctx: any, ...fetchArgs: TFetchArgs) => void;
|
|
650
663
|
}
|
|
664
|
+
type AnyTransport = Transport<[request: Request, ...params: any[]]>;
|
|
651
665
|
/**
|
|
652
666
|
* Basic object type used to store custom status and headers set while handling the request.
|
|
653
667
|
*/
|
|
@@ -674,7 +688,7 @@ type MaybePromise<T> = Promise<T> | T;
|
|
|
674
688
|
/**
|
|
675
689
|
* A function that, given a request, returns a response. This type is compliant with WinterCG.
|
|
676
690
|
*/
|
|
677
|
-
type ServerSideFetch = (
|
|
691
|
+
type ServerSideFetch<TTransport extends AnyTransport = Transport> = TTransport extends Transport<infer Params> ? (...args: Params) => MaybePromise<Response> : never;
|
|
678
692
|
/**
|
|
679
693
|
* Apply a string prefix to all the keys of an object.
|
|
680
694
|
*/
|
|
@@ -695,4 +709,4 @@ type Spread<L, R> = Omit<L, keyof R> & R;
|
|
|
695
709
|
*/
|
|
696
710
|
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
711
|
//#endregion
|
|
698
|
-
export {
|
|
712
|
+
export { RouteHandler as $, LifeCycleHook as A, OnBeforeHandleHook as B, GetResponseInput as C, GetResponseStatusMap as D, GetResponseOutputFromDef as E, MergeApp as F, OnGlobalRequestHook as G, OnGlobalErrorContext as H, MergeAppData as I, OnTransformContext as J, OnMapResponseContext as K, MergeRoutes as L, LifeCycleHooks as M, MaybePromise as N, GetRouteHandler as O, Merge as P, RouteDef as Q, OnAfterHandleHook as R, GetRequestParamsOutputFromDef as S, GetResponseOutput as T, OnGlobalErrorHook as U, OnGlobalAfterResponseHook as V, OnGlobalRequestContext as W, PrefixObjectKeys as X, OnTransformHook as Y, RequestContext as Z, GetAppDataCtx as _, App as a, StatusFn as at, GetRequestParamsInputFromDef as b, ApplyAppPrefix as c, UseApp as ct, BasePrefix as d, RouterData as et, BaseRoutes as f, GetAppData as g, DefaultAppData as h, AnyTransport as i, Simplify as it, LifeCycleHookName as j, GetRouteHandlerReturnType as k, BaseCtx as l, UseAppData as lt, CompiledRouteHandler as m, AfterResponseContext as n, ServerSideFetch as nt, AppData as o, StatusResult as ot, BuildHandlerContext as p, OnMapResponseHook as q, AnyDef as r, Setter as rt, ApplyAppDataPrefix as s, Transport as st, AfterHandleContext as t, SchemaAdapter as tt, BasePath as u, GetAppRoutes as v, GetResponseInputFromDef as w, GetRequestParamsOutput as x, GetRequestParamsInput as y, OnBeforeHandleContext as z };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { AfterHandleContext, AfterResponseContext, AnyDef, App, AppData, ApplyAppDataPrefix, ApplyAppPrefix, BaseCtx, BasePath, BasePrefix, BaseRoutes, BuildHandlerContext, CompiledRouteHandler, DefaultAppData, GetAppData, GetAppDataCtx, GetAppRoutes, GetRequestParamsInput, GetRequestParamsInputFromDef, GetRequestParamsOutput, GetRequestParamsOutputFromDef, GetResponseInput, GetResponseInputFromDef, GetResponseOutput, GetResponseOutputFromDef, GetResponseStatusMap, GetRouteHandler, GetRouteHandlerReturnType, LifeCycleHook, LifeCycleHookName, LifeCycleHooks, MaybePromise, Merge, MergeApp, MergeAppData, MergeRoutes, OnAfterHandleHook, OnBeforeHandleContext, OnBeforeHandleHook, OnGlobalAfterResponseHook, OnGlobalErrorContext, OnGlobalErrorHook, OnGlobalRequestContext, OnGlobalRequestHook, OnMapResponseContext, OnMapResponseHook, OnTransformContext, OnTransformHook, PrefixObjectKeys, RouteDef, RouteHandler, RouterData, SchemaAdapter, ServerSideFetch, Setter, Simplify, StatusFn, StatusResult, Transport, UseApp, UseAppData };
|
|
1
|
+
import { $ as RouteHandler, A as LifeCycleHook, B as OnBeforeHandleHook, C as GetResponseInput, D as GetResponseStatusMap, E as GetResponseOutputFromDef, F as MergeApp, G as OnGlobalRequestHook, H as OnGlobalErrorContext, I as MergeAppData, J as OnTransformContext, K as OnMapResponseContext, L as MergeRoutes, M as LifeCycleHooks, N as MaybePromise, O as GetRouteHandler, P as Merge, Q as RouteDef, R as OnAfterHandleHook, S as GetRequestParamsOutputFromDef, T as GetResponseOutput, U as OnGlobalErrorHook, V as OnGlobalAfterResponseHook, W as OnGlobalRequestContext, X as PrefixObjectKeys, Y as OnTransformHook, Z as RequestContext, _ as GetAppDataCtx, a as App, at as StatusFn, b as GetRequestParamsInputFromDef, c as ApplyAppPrefix, ct as UseApp, d as BasePrefix, et as RouterData, f as BaseRoutes, g as GetAppData, h as DefaultAppData, i as AnyTransport, it as Simplify, j as LifeCycleHookName, k as GetRouteHandlerReturnType, l as BaseCtx, lt as UseAppData, m as CompiledRouteHandler, n as AfterResponseContext, nt as ServerSideFetch, o as AppData, ot as StatusResult, p as BuildHandlerContext, q as OnMapResponseHook, r as AnyDef, rt as Setter, s as ApplyAppDataPrefix, st as Transport, t as AfterHandleContext, tt as SchemaAdapter, u as BasePath, v as GetAppRoutes, w as GetResponseInputFromDef, x as GetRequestParamsOutput, y as GetRequestParamsInput, z as OnBeforeHandleContext } from "./types-BvjPE9EM.mjs";
|
|
2
|
+
export { AfterHandleContext, AfterResponseContext, AnyDef, AnyTransport, App, AppData, ApplyAppDataPrefix, ApplyAppPrefix, BaseCtx, BasePath, BasePrefix, BaseRoutes, BuildHandlerContext, CompiledRouteHandler, DefaultAppData, GetAppData, GetAppDataCtx, GetAppRoutes, GetRequestParamsInput, GetRequestParamsInputFromDef, GetRequestParamsOutput, GetRequestParamsOutputFromDef, GetResponseInput, GetResponseInputFromDef, GetResponseOutput, GetResponseOutputFromDef, GetResponseStatusMap, GetRouteHandler, GetRouteHandlerReturnType, LifeCycleHook, LifeCycleHookName, LifeCycleHooks, MaybePromise, Merge, MergeApp, MergeAppData, MergeRoutes, OnAfterHandleHook, OnBeforeHandleContext, OnBeforeHandleHook, OnGlobalAfterResponseHook, OnGlobalErrorContext, OnGlobalErrorHook, OnGlobalRequestContext, OnGlobalRequestHook, OnMapResponseContext, OnMapResponseHook, OnTransformContext, OnTransformHook, PrefixObjectKeys, RequestContext, RouteDef, RouteHandler, RouterData, SchemaAdapter, ServerSideFetch, Setter, Simplify, StatusFn, StatusResult, Transport, UseApp, UseAppData };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aklinker1/zeta",
|
|
3
3
|
"description": "Composable, testable, OpenAPI-first backend framework with validation built-in",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"packageManager": "bun@1.3.
|
|
7
|
+
"packageManager": "bun@1.3.10",
|
|
8
8
|
"module": "dist/index.mjs",
|
|
9
9
|
"types": "dist/index.d.mts",
|
|
10
10
|
"exports": {
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
"types": "./dist/transports/bun-transport.d.mts",
|
|
37
37
|
"default": "./dist/transports/bun-transport.mjs"
|
|
38
38
|
},
|
|
39
|
+
"./transports/fetch-transport": {
|
|
40
|
+
"types": "./dist/transports/fetch-transport.d.mts",
|
|
41
|
+
"default": "./dist/transports/fetch-transport.mjs"
|
|
42
|
+
},
|
|
39
43
|
"./transports/deno-transport": {
|
|
40
44
|
"types": "./dist/transports/deno-transport.d.mts",
|
|
41
45
|
"default": "./dist/transports/deno-transport.mjs"
|
|
@@ -58,8 +62,9 @@
|
|
|
58
62
|
],
|
|
59
63
|
"scripts": {
|
|
60
64
|
"dev": "bun test --watch",
|
|
61
|
-
"build": "tsdown src/{index,types,client,testing,schema,adapters/zod-schema-adapter,transports/bun-transport,transports/deno-transport}.ts",
|
|
62
|
-
"bench": "bun run
|
|
65
|
+
"build": "tsdown src/{index,types,client,testing,schema,adapters/zod-schema-adapter,transports/bun-transport,transports/fetch-transport,transports/deno-transport}.ts",
|
|
66
|
+
"bench": "bun run --sequential build 'bench:*'",
|
|
67
|
+
"bench:overhead": "bun run benchmarks/overhead.ts",
|
|
63
68
|
"example": "bun --watch run example.ts",
|
|
64
69
|
"example:prod": "NODE_ENV=production bun run example",
|
|
65
70
|
"docs:dev": "zola -r docs serve",
|
|
@@ -80,6 +85,7 @@
|
|
|
80
85
|
"@opentelemetry/sdk-trace-node": "^2.5.0",
|
|
81
86
|
"@opentelemetry/semantic-conventions": "^1.39.0",
|
|
82
87
|
"@types/bun": "latest",
|
|
88
|
+
"@types/deno": "^2.5.0",
|
|
83
89
|
"@typescript/native-preview": "^7.0.0-dev.20260202.1",
|
|
84
90
|
"changelogen": "^0.6.2",
|
|
85
91
|
"cookie": "^1.1.1",
|
|
@@ -99,11 +105,15 @@
|
|
|
99
105
|
"zod": "^4.1.11"
|
|
100
106
|
},
|
|
101
107
|
"peerDependencies": {
|
|
102
|
-
"@types/bun": "*"
|
|
108
|
+
"@types/bun": "*",
|
|
109
|
+
"@types/deno": "*"
|
|
103
110
|
},
|
|
104
111
|
"peerDependenciesMeta": {
|
|
105
112
|
"@types/bun": {
|
|
106
113
|
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"@types/deno": {
|
|
116
|
+
"optional": true
|
|
107
117
|
}
|
|
108
118
|
}
|
|
109
119
|
}
|
|
File without changes
|
|
File without changes
|