better-call 0.2.13-beta.7 → 0.2.13-beta.8
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/adapter/node.d.cts +1 -1
- package/dist/adapter/node.d.mts +1 -1
- package/dist/adapter/node.d.ts +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/shared/{better-call.1323d028.d.cts → better-call.25f0dd59.d.cts} +4 -3
- package/dist/shared/{better-call.1323d028.d.mts → better-call.25f0dd59.d.mts} +4 -3
- package/dist/shared/{better-call.1323d028.d.ts → better-call.25f0dd59.d.ts} +4 -3
- package/package.json +1 -1
package/dist/adapter/node.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
import * as undici_types from 'undici-types';
|
|
3
|
-
import { R as Router } from '../shared/better-call.
|
|
3
|
+
import { R as Router } from '../shared/better-call.25f0dd59.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
|
|
6
6
|
import '@asteasolutions/zod-to-openapi';
|
package/dist/adapter/node.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
import * as undici_types from 'undici-types';
|
|
3
|
-
import { R as Router } from '../shared/better-call.
|
|
3
|
+
import { R as Router } from '../shared/better-call.25f0dd59.mjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
|
|
6
6
|
import '@asteasolutions/zod-to-openapi';
|
package/dist/adapter/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
import * as undici_types from 'undici-types';
|
|
3
|
-
import { R as Router } from '../shared/better-call.
|
|
3
|
+
import { R as Router } from '../shared/better-call.25f0dd59.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
|
|
6
6
|
import '@asteasolutions/zod-to-openapi';
|
package/dist/client.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BetterFetchOption, BetterFetchResponse } from '@better-fetch/fetch';
|
|
2
|
-
import { R as Router, U as UnionToIntersection, b as Endpoint, H as HasRequiredKeys } from './shared/better-call.
|
|
2
|
+
import { R as Router, U as UnionToIntersection, b as Endpoint, H as HasRequiredKeys } from './shared/better-call.25f0dd59.cjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
|
|
5
5
|
import '@asteasolutions/zod-to-openapi';
|
package/dist/client.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BetterFetchOption, BetterFetchResponse } from '@better-fetch/fetch';
|
|
2
|
-
import { R as Router, U as UnionToIntersection, b as Endpoint, H as HasRequiredKeys } from './shared/better-call.
|
|
2
|
+
import { R as Router, U as UnionToIntersection, b as Endpoint, H as HasRequiredKeys } from './shared/better-call.25f0dd59.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
|
|
5
5
|
import '@asteasolutions/zod-to-openapi';
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BetterFetchOption, BetterFetchResponse } from '@better-fetch/fetch';
|
|
2
|
-
import { R as Router, U as UnionToIntersection, b as Endpoint, H as HasRequiredKeys } from './shared/better-call.
|
|
2
|
+
import { R as Router, U as UnionToIntersection, b as Endpoint, H as HasRequiredKeys } from './shared/better-call.25f0dd59.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
|
|
5
5
|
import '@asteasolutions/zod-to-openapi';
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EndpointOptions, a as EndpointResponse, b as Endpoint, c as EndpointContext, I as InferUse, C as CookiePrefixOptions, d as CookieOptions } from './shared/better-call.
|
|
2
|
-
export { A as APIError, j as Context, o as Cookie, p as CookieConstraint, H as HasRequiredKeys, m as InferResponse, g as Input, i as IsEmptyObject, J as JSONResponse, P as Prettify, h as RequiredKeysOf, R as Router, S as SignedCookie, U as UnionToIntersection, _ as _statusCode, e as createEndpoint, l as createGetHeader, f as createRouter, k as createSetHeader, n as fromError, q as parse, s as parseSigned, r as runValidation, t as serialize, u as serializeSigned } from './shared/better-call.
|
|
1
|
+
import { E as EndpointOptions, a as EndpointResponse, b as Endpoint, c as EndpointContext, I as InferUse, C as CookiePrefixOptions, d as CookieOptions } from './shared/better-call.25f0dd59.cjs';
|
|
2
|
+
export { A as APIError, j as Context, o as Cookie, p as CookieConstraint, H as HasRequiredKeys, m as InferResponse, g as Input, i as IsEmptyObject, J as JSONResponse, M as MergeObject, P as Prettify, h as RequiredKeysOf, R as Router, S as SignedCookie, U as UnionToIntersection, _ as _statusCode, e as createEndpoint, l as createGetHeader, f as createRouter, k as createSetHeader, n as fromError, q as parse, s as parseSigned, r as runValidation, t as serialize, u as serializeSigned } from './shared/better-call.25f0dd59.cjs';
|
|
3
3
|
import { BufferSource } from 'stream/web';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EndpointOptions, a as EndpointResponse, b as Endpoint, c as EndpointContext, I as InferUse, C as CookiePrefixOptions, d as CookieOptions } from './shared/better-call.
|
|
2
|
-
export { A as APIError, j as Context, o as Cookie, p as CookieConstraint, H as HasRequiredKeys, m as InferResponse, g as Input, i as IsEmptyObject, J as JSONResponse, P as Prettify, h as RequiredKeysOf, R as Router, S as SignedCookie, U as UnionToIntersection, _ as _statusCode, e as createEndpoint, l as createGetHeader, f as createRouter, k as createSetHeader, n as fromError, q as parse, s as parseSigned, r as runValidation, t as serialize, u as serializeSigned } from './shared/better-call.
|
|
1
|
+
import { E as EndpointOptions, a as EndpointResponse, b as Endpoint, c as EndpointContext, I as InferUse, C as CookiePrefixOptions, d as CookieOptions } from './shared/better-call.25f0dd59.mjs';
|
|
2
|
+
export { A as APIError, j as Context, o as Cookie, p as CookieConstraint, H as HasRequiredKeys, m as InferResponse, g as Input, i as IsEmptyObject, J as JSONResponse, M as MergeObject, P as Prettify, h as RequiredKeysOf, R as Router, S as SignedCookie, U as UnionToIntersection, _ as _statusCode, e as createEndpoint, l as createGetHeader, f as createRouter, k as createSetHeader, n as fromError, q as parse, s as parseSigned, r as runValidation, t as serialize, u as serializeSigned } from './shared/better-call.25f0dd59.mjs';
|
|
3
3
|
import { BufferSource } from 'stream/web';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EndpointOptions, a as EndpointResponse, b as Endpoint, c as EndpointContext, I as InferUse, C as CookiePrefixOptions, d as CookieOptions } from './shared/better-call.
|
|
2
|
-
export { A as APIError, j as Context, o as Cookie, p as CookieConstraint, H as HasRequiredKeys, m as InferResponse, g as Input, i as IsEmptyObject, J as JSONResponse, P as Prettify, h as RequiredKeysOf, R as Router, S as SignedCookie, U as UnionToIntersection, _ as _statusCode, e as createEndpoint, l as createGetHeader, f as createRouter, k as createSetHeader, n as fromError, q as parse, s as parseSigned, r as runValidation, t as serialize, u as serializeSigned } from './shared/better-call.
|
|
1
|
+
import { E as EndpointOptions, a as EndpointResponse, b as Endpoint, c as EndpointContext, I as InferUse, C as CookiePrefixOptions, d as CookieOptions } from './shared/better-call.25f0dd59.js';
|
|
2
|
+
export { A as APIError, j as Context, o as Cookie, p as CookieConstraint, H as HasRequiredKeys, m as InferResponse, g as Input, i as IsEmptyObject, J as JSONResponse, M as MergeObject, P as Prettify, h as RequiredKeysOf, R as Router, S as SignedCookie, U as UnionToIntersection, _ as _statusCode, e as createEndpoint, l as createGetHeader, f as createRouter, k as createSetHeader, n as fromError, q as parse, s as parseSigned, r as runValidation, t as serialize, u as serializeSigned } from './shared/better-call.25f0dd59.js';
|
|
3
3
|
import { BufferSource } from 'stream/web';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
|
|
@@ -21,6 +21,7 @@ type Prettify<T> = {
|
|
|
21
21
|
} & {};
|
|
22
22
|
type IsEmptyObject<T> = keyof T extends never ? true : false;
|
|
23
23
|
type UnionToIntersection<Union> = (Union extends unknown ? (distributedUnion: Union) => void : never) extends (mergedIntersection: infer Intersection) => void ? Intersection & Union : never;
|
|
24
|
+
type MergeObject<T extends Record<string, any> | never, S extends Record<string, any> | never> = T extends never ? S : S extends never ? T : T & S;
|
|
24
25
|
|
|
25
26
|
declare module "zod" {
|
|
26
27
|
interface ZodTypeDef {
|
|
@@ -85,7 +86,7 @@ type InferParamWildCard<Path> = Path extends `${infer _Start}/*:${infer Param}/$
|
|
|
85
86
|
type InferParam<Path extends string> = IsEmptyObject<InferParamPath<Path> & InferParamWildCard<Path>> extends true ? never : Prettify<InferParamPath<Path> & InferParamWildCard<Path>>;
|
|
86
87
|
type InferRequest<Option extends EndpointOptions> = Option["requireRequest"] extends true ? Request : Request | undefined;
|
|
87
88
|
type InferHeaders<Option extends EndpointOptions> = Option["requireHeaders"] extends true ? Headers : Headers | undefined;
|
|
88
|
-
type InferUse<Opts extends EndpointOptions["use"]> = Opts extends Endpoint[] ? UnionToIntersection<Awaited<ReturnType<Opts[number]>>> :
|
|
89
|
+
type InferUse<Opts extends EndpointOptions["use"]> = Opts extends Endpoint[] ? UnionToIntersection<Awaited<ReturnType<Opts[number]>>> : {};
|
|
89
90
|
type InferMethod<Options extends EndpointOptions> = Options["method"] extends Array<Method> ? Options["method"][number] : Options["method"];
|
|
90
91
|
|
|
91
92
|
type Cookie = Record<string, string>;
|
|
@@ -366,7 +367,7 @@ declare const createEndpoint: {
|
|
|
366
367
|
declare function createEndpointCreator<E extends {
|
|
367
368
|
use: Endpoint[];
|
|
368
369
|
}>(opts: E): <Path extends string, Opts extends EndpointOptions, R extends EndpointResponse>(path: Path, options: Opts, handler: <InferE extends EndpointContext<Path, Opts>>(ctx: Omit<InferE, "context"> & {
|
|
369
|
-
context: InferUse<E["use"]> &
|
|
370
|
+
context: InferUse<E["use"]> & InferE["context"];
|
|
370
371
|
}) => Promise<R>) => {
|
|
371
372
|
<Ctx extends ({
|
|
372
373
|
body: InferBody<Opts & {
|
|
@@ -673,4 +674,4 @@ declare const createRouter: <E extends Record<string, Endpoint>, Config extends
|
|
|
673
674
|
};
|
|
674
675
|
type Router = ReturnType<typeof createRouter>;
|
|
675
676
|
|
|
676
|
-
export { APIError as A, type CookiePrefixOptions as C, type EndpointOptions as E, type HasRequiredKeys as H, type InferUse as I, type JSONResponse as J, type Prettify as P, type Router as R, type SignedCookie as S, type UnionToIntersection as U, _statusCode as _, type EndpointResponse as a, type Endpoint as b, type EndpointContext as c, type CookieOptions as d, createEndpoint as e, createRouter as f, type Input as g, type RequiredKeysOf as h, type IsEmptyObject as i, type Context as j, createSetHeader as k, createGetHeader as l, type InferResponse as m, fromError as n, type Cookie as o, type CookieConstraint as p, parse as q, runValidation as r, parseSigned as s, serialize as t, serializeSigned as u };
|
|
677
|
+
export { APIError as A, type CookiePrefixOptions as C, type EndpointOptions as E, type HasRequiredKeys as H, type InferUse as I, type JSONResponse as J, type MergeObject as M, type Prettify as P, type Router as R, type SignedCookie as S, type UnionToIntersection as U, _statusCode as _, type EndpointResponse as a, type Endpoint as b, type EndpointContext as c, type CookieOptions as d, createEndpoint as e, createRouter as f, type Input as g, type RequiredKeysOf as h, type IsEmptyObject as i, type Context as j, createSetHeader as k, createGetHeader as l, type InferResponse as m, fromError as n, type Cookie as o, type CookieConstraint as p, parse as q, runValidation as r, parseSigned as s, serialize as t, serializeSigned as u };
|
|
@@ -21,6 +21,7 @@ type Prettify<T> = {
|
|
|
21
21
|
} & {};
|
|
22
22
|
type IsEmptyObject<T> = keyof T extends never ? true : false;
|
|
23
23
|
type UnionToIntersection<Union> = (Union extends unknown ? (distributedUnion: Union) => void : never) extends (mergedIntersection: infer Intersection) => void ? Intersection & Union : never;
|
|
24
|
+
type MergeObject<T extends Record<string, any> | never, S extends Record<string, any> | never> = T extends never ? S : S extends never ? T : T & S;
|
|
24
25
|
|
|
25
26
|
declare module "zod" {
|
|
26
27
|
interface ZodTypeDef {
|
|
@@ -85,7 +86,7 @@ type InferParamWildCard<Path> = Path extends `${infer _Start}/*:${infer Param}/$
|
|
|
85
86
|
type InferParam<Path extends string> = IsEmptyObject<InferParamPath<Path> & InferParamWildCard<Path>> extends true ? never : Prettify<InferParamPath<Path> & InferParamWildCard<Path>>;
|
|
86
87
|
type InferRequest<Option extends EndpointOptions> = Option["requireRequest"] extends true ? Request : Request | undefined;
|
|
87
88
|
type InferHeaders<Option extends EndpointOptions> = Option["requireHeaders"] extends true ? Headers : Headers | undefined;
|
|
88
|
-
type InferUse<Opts extends EndpointOptions["use"]> = Opts extends Endpoint[] ? UnionToIntersection<Awaited<ReturnType<Opts[number]>>> :
|
|
89
|
+
type InferUse<Opts extends EndpointOptions["use"]> = Opts extends Endpoint[] ? UnionToIntersection<Awaited<ReturnType<Opts[number]>>> : {};
|
|
89
90
|
type InferMethod<Options extends EndpointOptions> = Options["method"] extends Array<Method> ? Options["method"][number] : Options["method"];
|
|
90
91
|
|
|
91
92
|
type Cookie = Record<string, string>;
|
|
@@ -366,7 +367,7 @@ declare const createEndpoint: {
|
|
|
366
367
|
declare function createEndpointCreator<E extends {
|
|
367
368
|
use: Endpoint[];
|
|
368
369
|
}>(opts: E): <Path extends string, Opts extends EndpointOptions, R extends EndpointResponse>(path: Path, options: Opts, handler: <InferE extends EndpointContext<Path, Opts>>(ctx: Omit<InferE, "context"> & {
|
|
369
|
-
context: InferUse<E["use"]> &
|
|
370
|
+
context: InferUse<E["use"]> & InferE["context"];
|
|
370
371
|
}) => Promise<R>) => {
|
|
371
372
|
<Ctx extends ({
|
|
372
373
|
body: InferBody<Opts & {
|
|
@@ -673,4 +674,4 @@ declare const createRouter: <E extends Record<string, Endpoint>, Config extends
|
|
|
673
674
|
};
|
|
674
675
|
type Router = ReturnType<typeof createRouter>;
|
|
675
676
|
|
|
676
|
-
export { APIError as A, type CookiePrefixOptions as C, type EndpointOptions as E, type HasRequiredKeys as H, type InferUse as I, type JSONResponse as J, type Prettify as P, type Router as R, type SignedCookie as S, type UnionToIntersection as U, _statusCode as _, type EndpointResponse as a, type Endpoint as b, type EndpointContext as c, type CookieOptions as d, createEndpoint as e, createRouter as f, type Input as g, type RequiredKeysOf as h, type IsEmptyObject as i, type Context as j, createSetHeader as k, createGetHeader as l, type InferResponse as m, fromError as n, type Cookie as o, type CookieConstraint as p, parse as q, runValidation as r, parseSigned as s, serialize as t, serializeSigned as u };
|
|
677
|
+
export { APIError as A, type CookiePrefixOptions as C, type EndpointOptions as E, type HasRequiredKeys as H, type InferUse as I, type JSONResponse as J, type MergeObject as M, type Prettify as P, type Router as R, type SignedCookie as S, type UnionToIntersection as U, _statusCode as _, type EndpointResponse as a, type Endpoint as b, type EndpointContext as c, type CookieOptions as d, createEndpoint as e, createRouter as f, type Input as g, type RequiredKeysOf as h, type IsEmptyObject as i, type Context as j, createSetHeader as k, createGetHeader as l, type InferResponse as m, fromError as n, type Cookie as o, type CookieConstraint as p, parse as q, runValidation as r, parseSigned as s, serialize as t, serializeSigned as u };
|
|
@@ -21,6 +21,7 @@ type Prettify<T> = {
|
|
|
21
21
|
} & {};
|
|
22
22
|
type IsEmptyObject<T> = keyof T extends never ? true : false;
|
|
23
23
|
type UnionToIntersection<Union> = (Union extends unknown ? (distributedUnion: Union) => void : never) extends (mergedIntersection: infer Intersection) => void ? Intersection & Union : never;
|
|
24
|
+
type MergeObject<T extends Record<string, any> | never, S extends Record<string, any> | never> = T extends never ? S : S extends never ? T : T & S;
|
|
24
25
|
|
|
25
26
|
declare module "zod" {
|
|
26
27
|
interface ZodTypeDef {
|
|
@@ -85,7 +86,7 @@ type InferParamWildCard<Path> = Path extends `${infer _Start}/*:${infer Param}/$
|
|
|
85
86
|
type InferParam<Path extends string> = IsEmptyObject<InferParamPath<Path> & InferParamWildCard<Path>> extends true ? never : Prettify<InferParamPath<Path> & InferParamWildCard<Path>>;
|
|
86
87
|
type InferRequest<Option extends EndpointOptions> = Option["requireRequest"] extends true ? Request : Request | undefined;
|
|
87
88
|
type InferHeaders<Option extends EndpointOptions> = Option["requireHeaders"] extends true ? Headers : Headers | undefined;
|
|
88
|
-
type InferUse<Opts extends EndpointOptions["use"]> = Opts extends Endpoint[] ? UnionToIntersection<Awaited<ReturnType<Opts[number]>>> :
|
|
89
|
+
type InferUse<Opts extends EndpointOptions["use"]> = Opts extends Endpoint[] ? UnionToIntersection<Awaited<ReturnType<Opts[number]>>> : {};
|
|
89
90
|
type InferMethod<Options extends EndpointOptions> = Options["method"] extends Array<Method> ? Options["method"][number] : Options["method"];
|
|
90
91
|
|
|
91
92
|
type Cookie = Record<string, string>;
|
|
@@ -366,7 +367,7 @@ declare const createEndpoint: {
|
|
|
366
367
|
declare function createEndpointCreator<E extends {
|
|
367
368
|
use: Endpoint[];
|
|
368
369
|
}>(opts: E): <Path extends string, Opts extends EndpointOptions, R extends EndpointResponse>(path: Path, options: Opts, handler: <InferE extends EndpointContext<Path, Opts>>(ctx: Omit<InferE, "context"> & {
|
|
369
|
-
context: InferUse<E["use"]> &
|
|
370
|
+
context: InferUse<E["use"]> & InferE["context"];
|
|
370
371
|
}) => Promise<R>) => {
|
|
371
372
|
<Ctx extends ({
|
|
372
373
|
body: InferBody<Opts & {
|
|
@@ -673,4 +674,4 @@ declare const createRouter: <E extends Record<string, Endpoint>, Config extends
|
|
|
673
674
|
};
|
|
674
675
|
type Router = ReturnType<typeof createRouter>;
|
|
675
676
|
|
|
676
|
-
export { APIError as A, type CookiePrefixOptions as C, type EndpointOptions as E, type HasRequiredKeys as H, type InferUse as I, type JSONResponse as J, type Prettify as P, type Router as R, type SignedCookie as S, type UnionToIntersection as U, _statusCode as _, type EndpointResponse as a, type Endpoint as b, type EndpointContext as c, type CookieOptions as d, createEndpoint as e, createRouter as f, type Input as g, type RequiredKeysOf as h, type IsEmptyObject as i, type Context as j, createSetHeader as k, createGetHeader as l, type InferResponse as m, fromError as n, type Cookie as o, type CookieConstraint as p, parse as q, runValidation as r, parseSigned as s, serialize as t, serializeSigned as u };
|
|
677
|
+
export { APIError as A, type CookiePrefixOptions as C, type EndpointOptions as E, type HasRequiredKeys as H, type InferUse as I, type JSONResponse as J, type MergeObject as M, type Prettify as P, type Router as R, type SignedCookie as S, type UnionToIntersection as U, _statusCode as _, type EndpointResponse as a, type Endpoint as b, type EndpointContext as c, type CookieOptions as d, createEndpoint as e, createRouter as f, type Input as g, type RequiredKeysOf as h, type IsEmptyObject as i, type Context as j, createSetHeader as k, createGetHeader as l, type InferResponse as m, fromError as n, type Cookie as o, type CookieConstraint as p, parse as q, runValidation as r, parseSigned as s, serialize as t, serializeSigned as u };
|