better-call 0.2.13-beta.6 → 0.2.13-beta.7

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.
@@ -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.bb4fb8f1.cjs';
3
+ import { R as Router } from '../shared/better-call.1323d028.cjs';
4
4
  import 'zod';
5
5
  import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
6
6
  import '@asteasolutions/zod-to-openapi';
@@ -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.bb4fb8f1.mjs';
3
+ import { R as Router } from '../shared/better-call.1323d028.mjs';
4
4
  import 'zod';
5
5
  import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
6
6
  import '@asteasolutions/zod-to-openapi';
@@ -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.bb4fb8f1.js';
3
+ import { R as Router } from '../shared/better-call.1323d028.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.bb4fb8f1.cjs';
2
+ import { R as Router, U as UnionToIntersection, b as Endpoint, H as HasRequiredKeys } from './shared/better-call.1323d028.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.bb4fb8f1.mjs';
2
+ import { R as Router, U as UnionToIntersection, b as Endpoint, H as HasRequiredKeys } from './shared/better-call.1323d028.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.bb4fb8f1.js';
2
+ import { R as Router, U as UnionToIntersection, b as Endpoint, H as HasRequiredKeys } from './shared/better-call.1323d028.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.bb4fb8f1.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, 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.bb4fb8f1.cjs';
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.1323d028.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, 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.1323d028.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.bb4fb8f1.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, 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.bb4fb8f1.mjs';
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.1323d028.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, 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.1323d028.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.bb4fb8f1.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, 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.bb4fb8f1.js';
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.1323d028.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, 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.1323d028.js';
3
3
  import { BufferSource } from 'stream/web';
4
4
  import 'zod';
5
5
  import '@asteasolutions/zod-to-openapi/dist/zod-extensions';
@@ -202,7 +202,7 @@ interface EndpointContext<Path extends string, Options extends EndpointOptions>
202
202
  * @param routerResponse - The response object to return if `asResponse` is
203
203
  * true in the context this will take precedence
204
204
  */
205
- json: <R extends Record<string, any>>(json: R, routerResponse?: {
205
+ json: <R extends Record<string, any> | null>(json: R, routerResponse?: {
206
206
  status?: number;
207
207
  headers?: Record<string, string>;
208
208
  response?: Response;
@@ -331,7 +331,7 @@ interface JSONResponse<R = any> {
331
331
  */
332
332
  _flag: "json";
333
333
  }
334
- type EndpointResponse = JSONResponse | Response | void | Record<string, any>;
334
+ type EndpointResponse = JSONResponse | Response | void | Record<string, any> | null;
335
335
  type InferResponse<Ctx, R> = Ctx extends {
336
336
  asResponse: true;
337
337
  } ? Response : R extends JSONResponse<infer T> ? T : R;
@@ -202,7 +202,7 @@ interface EndpointContext<Path extends string, Options extends EndpointOptions>
202
202
  * @param routerResponse - The response object to return if `asResponse` is
203
203
  * true in the context this will take precedence
204
204
  */
205
- json: <R extends Record<string, any>>(json: R, routerResponse?: {
205
+ json: <R extends Record<string, any> | null>(json: R, routerResponse?: {
206
206
  status?: number;
207
207
  headers?: Record<string, string>;
208
208
  response?: Response;
@@ -331,7 +331,7 @@ interface JSONResponse<R = any> {
331
331
  */
332
332
  _flag: "json";
333
333
  }
334
- type EndpointResponse = JSONResponse | Response | void | Record<string, any>;
334
+ type EndpointResponse = JSONResponse | Response | void | Record<string, any> | null;
335
335
  type InferResponse<Ctx, R> = Ctx extends {
336
336
  asResponse: true;
337
337
  } ? Response : R extends JSONResponse<infer T> ? T : R;
@@ -202,7 +202,7 @@ interface EndpointContext<Path extends string, Options extends EndpointOptions>
202
202
  * @param routerResponse - The response object to return if `asResponse` is
203
203
  * true in the context this will take precedence
204
204
  */
205
- json: <R extends Record<string, any>>(json: R, routerResponse?: {
205
+ json: <R extends Record<string, any> | null>(json: R, routerResponse?: {
206
206
  status?: number;
207
207
  headers?: Record<string, string>;
208
208
  response?: Response;
@@ -331,7 +331,7 @@ interface JSONResponse<R = any> {
331
331
  */
332
332
  _flag: "json";
333
333
  }
334
- type EndpointResponse = JSONResponse | Response | void | Record<string, any>;
334
+ type EndpointResponse = JSONResponse | Response | void | Record<string, any> | null;
335
335
  type InferResponse<Ctx, R> = Ctx extends {
336
336
  asResponse: true;
337
337
  } ? Response : R extends JSONResponse<infer T> ? T : R;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-call",
3
- "version": "0.2.13-beta.6",
3
+ "version": "0.2.13-beta.7",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.ts",