@kaito-http/core 4.0.0-beta.27 → 4.0.0-beta.29
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/index.cjs +3 -0
- package/dist/index.d.cts +14 -19
- package/dist/index.d.ts +14 -19
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1228,6 +1228,9 @@ var Router = class _Router {
|
|
|
1228
1228
|
const parsed = route.openapi.schema.serialize(result);
|
|
1229
1229
|
return head.toResponse(parsed);
|
|
1230
1230
|
}
|
|
1231
|
+
if (result === void 0) {
|
|
1232
|
+
return head.toResponse(null);
|
|
1233
|
+
}
|
|
1231
1234
|
return head.toResponse(result);
|
|
1232
1235
|
} catch (e) {
|
|
1233
1236
|
const error = WrappedError.maybe(e);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { JSONValue as JSONValue$1, AnySchemaFor, BaseSchema, BaseSchemaDef } from './schema/schema.cjs';
|
|
1
|
+
import { JSONValue, AnySchemaFor, BaseSchema, BaseSchemaDef } from './schema/schema.cjs';
|
|
3
2
|
export { ArrayChecks, ArrayDef, BooleanDef, Issue, JSONPrimitive, KArray, KBoolean, KLazy, KLiteral, KNull, KNumber, KObject, KObjectFromURLSearchParams, KRecord, KRef, KScalar, KString, KUnion, LazyDef, LiteralDef, NullDef, NumberChecks, NumberDef, NumberFormat, ObjectDef, ParseContext, ParseResult, RecordDef, RefDef, STRING_FORMAT_REGEXES, ScalarDef, ScalarOptions, SchemaError, StringChecks, StringDef, StringFormat, UnionDef, isPrimitiveJSONValue, k } from './schema/schema.cjs';
|
|
3
|
+
import * as OpenAPI from 'openapi3-ts/oas31';
|
|
4
4
|
import { KaitoSSEResponse } from './stream/stream.cjs';
|
|
5
5
|
|
|
6
6
|
declare class WrappedError<T> extends Error {
|
|
@@ -29,11 +29,6 @@ declare class KaitoRequest {
|
|
|
29
29
|
get request(): Request;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
type JSONPrimitive = string | number | boolean | null;
|
|
33
|
-
type JSONValue = JSONPrimitive | JSONValue[] | {
|
|
34
|
-
[key: string]: JSONValue;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
32
|
/**
|
|
38
33
|
* This class is merely a wrapper around a `Headers` object and a status code.
|
|
39
34
|
* It's used while the router is executing a route to store any mutations to the status
|
|
@@ -128,13 +123,13 @@ declare class Router<ContextFrom, ContextTo, RequiredParams extends string, Rout
|
|
|
128
123
|
servers?: Partial<Record<(`https://` | `http://`) | ({} & string), string>>;
|
|
129
124
|
}) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, never, Response, "/openapi.json", RequiredParams, "GET", {}, never>, Input>;
|
|
130
125
|
private readonly method;
|
|
131
|
-
readonly get: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
132
|
-
readonly post: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
133
|
-
readonly put: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
134
|
-
readonly patch: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
135
|
-
readonly delete: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
136
|
-
readonly head: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
137
|
-
readonly options: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
126
|
+
readonly get: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "GET", Query, Body>, "body" | "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "GET", Query, Body>, Input>;
|
|
127
|
+
readonly post: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "POST", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "POST", Query, Body>, Input>;
|
|
128
|
+
readonly put: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "PUT", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "PUT", Query, Body>, Input>;
|
|
129
|
+
readonly patch: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "PATCH", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "PATCH", Query, Body>, Input>;
|
|
130
|
+
readonly delete: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "DELETE", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "DELETE", Query, Body>, Input>;
|
|
131
|
+
readonly head: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "HEAD", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "HEAD", Query, Body>, Input>;
|
|
132
|
+
readonly options: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "OPTIONS", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "OPTIONS", Query, Body>, Input>;
|
|
138
133
|
through: <NextContext>(through: (context: ContextTo, params: Record<RequiredParams, string>) => MaybePromise<NextContext>) => Router<ContextFrom, NextContext, RequiredParams, Routes, Input>;
|
|
139
134
|
}
|
|
140
135
|
|
|
@@ -148,18 +143,18 @@ type AnyQuery = {
|
|
|
148
143
|
[key in string]: any;
|
|
149
144
|
};
|
|
150
145
|
type Through<From, To, RequiredParams extends string> = (context: From, params: Record<RequiredParams, string>) => Promise<To>;
|
|
151
|
-
type SSEOutputSpec<Result extends JSONValue
|
|
146
|
+
type SSEOutputSpec<Result extends JSONValue> = {
|
|
152
147
|
type: 'sse';
|
|
153
148
|
schema: AnySchemaFor<Result>;
|
|
154
149
|
description?: string | undefined;
|
|
155
150
|
};
|
|
156
|
-
type JSONOutputSpec<ResultInput, ResultOutput extends JSONValue
|
|
151
|
+
type JSONOutputSpec<ResultInput, ResultOutput extends JSONValue> = {
|
|
157
152
|
type: 'json';
|
|
158
153
|
schema: BaseSchema<ResultOutput, ResultInput, BaseSchemaDef<ResultOutput>>;
|
|
159
154
|
description?: string | undefined;
|
|
160
155
|
};
|
|
161
|
-
type OutputSpec<ResultInput, ResultOutput> = ResultInput extends KaitoSSEResponse<infer R> ? SSEOutputSpec<Extract<R, JSONValue
|
|
162
|
-
type Route<ContextFrom, ContextTo, RouterInput extends readonly unknown[], ResultInput, ResultOutput, Path extends string, AdditionalParams extends string, Method extends KaitoMethod, Query extends Record<string, JSONValue
|
|
156
|
+
type OutputSpec<ResultInput, ResultOutput> = ResultInput extends KaitoSSEResponse<infer R> ? SSEOutputSpec<Extract<R, JSONValue>> : JSONOutputSpec<ResultOutput, Extract<ResultInput, JSONValue>>;
|
|
157
|
+
type Route<ContextFrom, ContextTo, RouterInput extends readonly unknown[], ResultInput, ResultOutput, Path extends string, AdditionalParams extends string, Method extends KaitoMethod, Query extends Record<string, JSONValue>, Body extends JSONValue> = {
|
|
163
158
|
body?: AnySchemaFor<Body>;
|
|
164
159
|
query?: {
|
|
165
160
|
[Key in keyof Query]: AnySchemaFor<Query[Key]>;
|
|
@@ -272,4 +267,4 @@ interface KaitoConfig<ContextFrom, Input extends readonly unknown[]> {
|
|
|
272
267
|
*/
|
|
273
268
|
declare const create: <Context = null, Input extends readonly unknown[] = []>(config?: KaitoConfig<Context, Input>) => Router<Context, Context, never, never, Input>;
|
|
274
269
|
|
|
275
|
-
export { type AnyQuery, type AnyRoute, AnySchemaFor, BaseSchema, BaseSchemaDef, type ExtractRouteParams, type GetContext, type InferRoutes, type JSONOutputSpec, JSONValue
|
|
270
|
+
export { type AnyQuery, type AnyRoute, AnySchemaFor, BaseSchema, BaseSchemaDef, type ExtractRouteParams, type GetContext, type InferRoutes, type JSONOutputSpec, JSONValue, type KaitoConfig, KaitoError, KaitoHead, type KaitoMethod, KaitoRequest, type MaybePromise, type OutputSpec, type Route, type RouteRunData, Router, type RouterState, type SSEOutputSpec, type Through, WrappedError, create, isNodeLikeDev };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { JSONValue as JSONValue$1, AnySchemaFor, BaseSchema, BaseSchemaDef } from './schema/schema.js';
|
|
1
|
+
import { JSONValue, AnySchemaFor, BaseSchema, BaseSchemaDef } from './schema/schema.js';
|
|
3
2
|
export { ArrayChecks, ArrayDef, BooleanDef, Issue, JSONPrimitive, KArray, KBoolean, KLazy, KLiteral, KNull, KNumber, KObject, KObjectFromURLSearchParams, KRecord, KRef, KScalar, KString, KUnion, LazyDef, LiteralDef, NullDef, NumberChecks, NumberDef, NumberFormat, ObjectDef, ParseContext, ParseResult, RecordDef, RefDef, STRING_FORMAT_REGEXES, ScalarDef, ScalarOptions, SchemaError, StringChecks, StringDef, StringFormat, UnionDef, isPrimitiveJSONValue, k } from './schema/schema.js';
|
|
3
|
+
import * as OpenAPI from 'openapi3-ts/oas31';
|
|
4
4
|
import { KaitoSSEResponse } from './stream/stream.js';
|
|
5
5
|
|
|
6
6
|
declare class WrappedError<T> extends Error {
|
|
@@ -29,11 +29,6 @@ declare class KaitoRequest {
|
|
|
29
29
|
get request(): Request;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
type JSONPrimitive = string | number | boolean | null;
|
|
33
|
-
type JSONValue = JSONPrimitive | JSONValue[] | {
|
|
34
|
-
[key: string]: JSONValue;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
32
|
/**
|
|
38
33
|
* This class is merely a wrapper around a `Headers` object and a status code.
|
|
39
34
|
* It's used while the router is executing a route to store any mutations to the status
|
|
@@ -128,13 +123,13 @@ declare class Router<ContextFrom, ContextTo, RequiredParams extends string, Rout
|
|
|
128
123
|
servers?: Partial<Record<(`https://` | `http://`) | ({} & string), string>>;
|
|
129
124
|
}) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, never, Response, "/openapi.json", RequiredParams, "GET", {}, never>, Input>;
|
|
130
125
|
private readonly method;
|
|
131
|
-
readonly get: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
132
|
-
readonly post: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
133
|
-
readonly put: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
134
|
-
readonly patch: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
135
|
-
readonly delete: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
136
|
-
readonly head: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
137
|
-
readonly options: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue
|
|
126
|
+
readonly get: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "GET", Query, Body>, "body" | "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "GET", Query, Body>, Input>;
|
|
127
|
+
readonly post: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "POST", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "POST", Query, Body>, Input>;
|
|
128
|
+
readonly put: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "PUT", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "PUT", Query, Body>, Input>;
|
|
129
|
+
readonly patch: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "PATCH", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "PATCH", Query, Body>, Input>;
|
|
130
|
+
readonly delete: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "DELETE", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "DELETE", Query, Body>, Input>;
|
|
131
|
+
readonly head: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "HEAD", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "HEAD", Query, Body>, Input>;
|
|
132
|
+
readonly options: <Path extends string, ResultInput = never, ResultOutput = ResultInput, Query extends AnyQuery = {}, Body extends JSONValue = never>(path: Path, route: ((data: RouteRunData<RequiredParams | ExtractRouteParams<Path>, ContextTo, Query, Body>) => ResultOutput | Promise<ResultOutput>) | Omit<Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "OPTIONS", Query, Body>, "path" | "method" | "router">) => Router<ContextFrom, ContextTo, RequiredParams, Routes | Route<ContextFrom, ContextTo, Input, ResultInput, ResultOutput, Path, RequiredParams, "OPTIONS", Query, Body>, Input>;
|
|
138
133
|
through: <NextContext>(through: (context: ContextTo, params: Record<RequiredParams, string>) => MaybePromise<NextContext>) => Router<ContextFrom, NextContext, RequiredParams, Routes, Input>;
|
|
139
134
|
}
|
|
140
135
|
|
|
@@ -148,18 +143,18 @@ type AnyQuery = {
|
|
|
148
143
|
[key in string]: any;
|
|
149
144
|
};
|
|
150
145
|
type Through<From, To, RequiredParams extends string> = (context: From, params: Record<RequiredParams, string>) => Promise<To>;
|
|
151
|
-
type SSEOutputSpec<Result extends JSONValue
|
|
146
|
+
type SSEOutputSpec<Result extends JSONValue> = {
|
|
152
147
|
type: 'sse';
|
|
153
148
|
schema: AnySchemaFor<Result>;
|
|
154
149
|
description?: string | undefined;
|
|
155
150
|
};
|
|
156
|
-
type JSONOutputSpec<ResultInput, ResultOutput extends JSONValue
|
|
151
|
+
type JSONOutputSpec<ResultInput, ResultOutput extends JSONValue> = {
|
|
157
152
|
type: 'json';
|
|
158
153
|
schema: BaseSchema<ResultOutput, ResultInput, BaseSchemaDef<ResultOutput>>;
|
|
159
154
|
description?: string | undefined;
|
|
160
155
|
};
|
|
161
|
-
type OutputSpec<ResultInput, ResultOutput> = ResultInput extends KaitoSSEResponse<infer R> ? SSEOutputSpec<Extract<R, JSONValue
|
|
162
|
-
type Route<ContextFrom, ContextTo, RouterInput extends readonly unknown[], ResultInput, ResultOutput, Path extends string, AdditionalParams extends string, Method extends KaitoMethod, Query extends Record<string, JSONValue
|
|
156
|
+
type OutputSpec<ResultInput, ResultOutput> = ResultInput extends KaitoSSEResponse<infer R> ? SSEOutputSpec<Extract<R, JSONValue>> : JSONOutputSpec<ResultOutput, Extract<ResultInput, JSONValue>>;
|
|
157
|
+
type Route<ContextFrom, ContextTo, RouterInput extends readonly unknown[], ResultInput, ResultOutput, Path extends string, AdditionalParams extends string, Method extends KaitoMethod, Query extends Record<string, JSONValue>, Body extends JSONValue> = {
|
|
163
158
|
body?: AnySchemaFor<Body>;
|
|
164
159
|
query?: {
|
|
165
160
|
[Key in keyof Query]: AnySchemaFor<Query[Key]>;
|
|
@@ -272,4 +267,4 @@ interface KaitoConfig<ContextFrom, Input extends readonly unknown[]> {
|
|
|
272
267
|
*/
|
|
273
268
|
declare const create: <Context = null, Input extends readonly unknown[] = []>(config?: KaitoConfig<Context, Input>) => Router<Context, Context, never, never, Input>;
|
|
274
269
|
|
|
275
|
-
export { type AnyQuery, type AnyRoute, AnySchemaFor, BaseSchema, BaseSchemaDef, type ExtractRouteParams, type GetContext, type InferRoutes, type JSONOutputSpec, JSONValue
|
|
270
|
+
export { type AnyQuery, type AnyRoute, AnySchemaFor, BaseSchema, BaseSchemaDef, type ExtractRouteParams, type GetContext, type InferRoutes, type JSONOutputSpec, JSONValue, type KaitoConfig, KaitoError, KaitoHead, type KaitoMethod, KaitoRequest, type MaybePromise, type OutputSpec, type Route, type RouteRunData, Router, type RouterState, type SSEOutputSpec, type Through, WrappedError, create, isNodeLikeDev };
|
package/dist/index.js
CHANGED
|
@@ -256,6 +256,9 @@ var Router = class _Router {
|
|
|
256
256
|
const parsed = route.openapi.schema.serialize(result);
|
|
257
257
|
return head.toResponse(parsed);
|
|
258
258
|
}
|
|
259
|
+
if (result === void 0) {
|
|
260
|
+
return head.toResponse(null);
|
|
261
|
+
}
|
|
259
262
|
return head.toResponse(result);
|
|
260
263
|
} catch (e) {
|
|
261
264
|
const error = WrappedError.maybe(e);
|