better-call 1.0.22 → 1.0.23

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/node.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Router } from "./router-IP1pntSS.cjs";
1
+ import { Router } from "./router-B4CojZF8.cjs";
2
2
  import { IncomingMessage, ServerResponse } from "node:http";
3
3
 
4
4
  //#region src/adapters/node/request.d.ts
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Router } from "./router-BPTd8L-P.js";
1
+ import { Router } from "./router-ChUeaXgp.js";
2
2
  import { IncomingMessage, ServerResponse } from "node:http";
3
3
 
4
4
  //#region src/adapters/node/request.d.ts
@@ -1079,21 +1079,21 @@ type EndpointContext<Path extends string, Options extends EndpointOptions, Conte
1079
1079
  } & Record<string, any>, headers?: HeadersInit) => APIError;
1080
1080
  };
1081
1081
  declare const createEndpoint: {
1082
- <Path extends string, Options extends EndpointOptions, R extends Promise<any>>(path: Path, options: Options, handler: (context: EndpointContext<Path, Options>) => R): StrictEndpoint<Path, Options, R>;
1082
+ <Path extends string, Options extends EndpointOptions, R>(path: Path, options: Options, handler: (context: EndpointContext<Path, Options>) => Promise<R>): StrictEndpoint<Path, Options, R>;
1083
1083
  create<E extends {
1084
1084
  use?: Middleware[];
1085
1085
  }>(opts?: E): <Path extends string, Opts extends EndpointOptions, R extends Promise<any>>(path: Path, options: Opts, handler: (ctx: EndpointContext<Path, Opts, InferUse<E["use"]>>) => R) => StrictEndpoint<Path, Opts & {
1086
1086
  use: any[];
1087
- }, R>;
1087
+ }, any>;
1088
1088
  };
1089
- type StrictEndpoint<Path extends string = string, Options extends EndpointOptions = EndpointOptions, R extends Promise<any> = Promise<any>> = {
1089
+ type StrictEndpoint<Path extends string, Options extends EndpointOptions, R = any> = {
1090
1090
  (context: InputContext<Path, Options> & {
1091
1091
  asResponse: true;
1092
1092
  }): Promise<Response>;
1093
1093
  (context: InputContext<Path, Options> & {
1094
1094
  asResponse: false;
1095
1095
  returnHeaders?: false;
1096
- }): R;
1096
+ }): Promise<R>;
1097
1097
  (context: InputContext<Path, Options> & {
1098
1098
  asResponse?: false;
1099
1099
  returnHeaders: true;
@@ -1101,7 +1101,7 @@ type StrictEndpoint<Path extends string = string, Options extends EndpointOption
1101
1101
  headers: Headers;
1102
1102
  response: Awaited<R>;
1103
1103
  }>;
1104
- (context?: InputContext<Path, Options>): R;
1104
+ (context?: InputContext<Path, Options>): Promise<R>;
1105
1105
  wrap: <T>(fn: (context: EndpointContext<Path, Options>, original: (context: EndpointContext<Path, Options>) => Promise<any>) => T) => StrictEndpoint<Path, Options, Promise<T>>;
1106
1106
  options: Options;
1107
1107
  path: Path;
@@ -1184,4 +1184,4 @@ declare const createRouter: <E extends Record<string, Endpoint>, Config extends
1184
1184
  type Router = ReturnType<typeof createRouter>;
1185
1185
  //#endregion
1186
1186
  export { APIError, CookieOptions, CookiePrefixOptions, Endpoint, EndpointContext, EndpointOptions, HTTPMethod, HasRequiredKeys, InferBody, InferBodyInput, InferHeaders, InferHeadersInput, InferInputMethod, InferMethod, InferMiddlewareBody, InferMiddlewareQuery, InferParam, InferParamInput, InferParamPath, InferParamWildCard, InferQuery, InferQueryInput, InferRequest, InferRequestInput, InferUse, InputContext, IsEmptyObject, MergeObject, Method, Middleware, MiddlewareContext, MiddlewareInputContext, MiddlewareOptions, MiddlewareResponse, OpenAPIParameter, OpenAPISchemaType, Path$1 as Path, Prettify, RequiredKeysOf, Router, RouterConfig, StandardSchemaV1, Status, StrictEndpoint, UnionToIntersection, _statusCode, createEndpoint, createInternalContext, createMiddleware, createRouter, generator, getCookieKey, getHTML, hideInternalStackFrames, makeErrorForHideStackFrame, parseCookies, serializeCookie, serializeSignedCookie };
1187
- //# sourceMappingURL=router-BPTd8L-P.d.ts.map
1187
+ //# sourceMappingURL=router-B4CojZF8.d.cts.map
@@ -1079,21 +1079,21 @@ type EndpointContext<Path extends string, Options extends EndpointOptions, Conte
1079
1079
  } & Record<string, any>, headers?: HeadersInit) => APIError;
1080
1080
  };
1081
1081
  declare const createEndpoint: {
1082
- <Path extends string, Options extends EndpointOptions, R extends Promise<any>>(path: Path, options: Options, handler: (context: EndpointContext<Path, Options>) => R): StrictEndpoint<Path, Options, R>;
1082
+ <Path extends string, Options extends EndpointOptions, R>(path: Path, options: Options, handler: (context: EndpointContext<Path, Options>) => Promise<R>): StrictEndpoint<Path, Options, R>;
1083
1083
  create<E extends {
1084
1084
  use?: Middleware[];
1085
1085
  }>(opts?: E): <Path extends string, Opts extends EndpointOptions, R extends Promise<any>>(path: Path, options: Opts, handler: (ctx: EndpointContext<Path, Opts, InferUse<E["use"]>>) => R) => StrictEndpoint<Path, Opts & {
1086
1086
  use: any[];
1087
- }, R>;
1087
+ }, any>;
1088
1088
  };
1089
- type StrictEndpoint<Path extends string = string, Options extends EndpointOptions = EndpointOptions, R extends Promise<any> = Promise<any>> = {
1089
+ type StrictEndpoint<Path extends string, Options extends EndpointOptions, R = any> = {
1090
1090
  (context: InputContext<Path, Options> & {
1091
1091
  asResponse: true;
1092
1092
  }): Promise<Response>;
1093
1093
  (context: InputContext<Path, Options> & {
1094
1094
  asResponse: false;
1095
1095
  returnHeaders?: false;
1096
- }): R;
1096
+ }): Promise<R>;
1097
1097
  (context: InputContext<Path, Options> & {
1098
1098
  asResponse?: false;
1099
1099
  returnHeaders: true;
@@ -1101,7 +1101,7 @@ type StrictEndpoint<Path extends string = string, Options extends EndpointOption
1101
1101
  headers: Headers;
1102
1102
  response: Awaited<R>;
1103
1103
  }>;
1104
- (context?: InputContext<Path, Options>): R;
1104
+ (context?: InputContext<Path, Options>): Promise<R>;
1105
1105
  wrap: <T>(fn: (context: EndpointContext<Path, Options>, original: (context: EndpointContext<Path, Options>) => Promise<any>) => T) => StrictEndpoint<Path, Options, Promise<T>>;
1106
1106
  options: Options;
1107
1107
  path: Path;
@@ -1184,4 +1184,4 @@ declare const createRouter: <E extends Record<string, Endpoint>, Config extends
1184
1184
  type Router = ReturnType<typeof createRouter>;
1185
1185
  //#endregion
1186
1186
  export { APIError, CookieOptions, CookiePrefixOptions, Endpoint, EndpointContext, EndpointOptions, HTTPMethod, HasRequiredKeys, InferBody, InferBodyInput, InferHeaders, InferHeadersInput, InferInputMethod, InferMethod, InferMiddlewareBody, InferMiddlewareQuery, InferParam, InferParamInput, InferParamPath, InferParamWildCard, InferQuery, InferQueryInput, InferRequest, InferRequestInput, InferUse, InputContext, IsEmptyObject, MergeObject, Method, Middleware, MiddlewareContext, MiddlewareInputContext, MiddlewareOptions, MiddlewareResponse, OpenAPIParameter, OpenAPISchemaType, Path$1 as Path, Prettify, RequiredKeysOf, Router, RouterConfig, StandardSchemaV1, Status, StrictEndpoint, UnionToIntersection, _statusCode, createEndpoint, createInternalContext, createMiddleware, createRouter, generator, getCookieKey, getHTML, hideInternalStackFrames, makeErrorForHideStackFrame, parseCookies, serializeCookie, serializeSignedCookie };
1187
- //# sourceMappingURL=router-IP1pntSS.d.cts.map
1187
+ //# sourceMappingURL=router-ChUeaXgp.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-call",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",