better-call 1.0.26 → 1.0.27
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/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/{router-BH6Wndse.d.ts → router-D1f_-c2B.d.ts} +18 -18
- package/dist/{router-CeSGPJlX.d.cts → router-DxWRTWmk.d.cts} +18 -18
- package/package.json +1 -1
package/dist/node.d.cts
CHANGED
package/dist/node.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ declare function makeErrorForHideStackFrame<B extends new (...args: any[]) => Er
|
|
|
21
21
|
errorStack: string | undefined;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
declare const
|
|
24
|
+
declare const statusCodes: {
|
|
25
25
|
OK: number;
|
|
26
26
|
CREATED: number;
|
|
27
27
|
ACCEPTED: number;
|
|
@@ -75,7 +75,7 @@ declare const _statusCode: {
|
|
|
75
75
|
};
|
|
76
76
|
type Status = 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
77
77
|
declare class InternalAPIError extends Error {
|
|
78
|
-
status: keyof typeof
|
|
78
|
+
status: keyof typeof statusCodes | Status;
|
|
79
79
|
body: ({
|
|
80
80
|
message?: string;
|
|
81
81
|
code?: string;
|
|
@@ -83,7 +83,7 @@ declare class InternalAPIError extends Error {
|
|
|
83
83
|
} & Record<string, any>) | undefined;
|
|
84
84
|
headers: HeadersInit;
|
|
85
85
|
statusCode: number;
|
|
86
|
-
constructor(status?: keyof typeof
|
|
86
|
+
constructor(status?: keyof typeof statusCodes | Status, body?: ({
|
|
87
87
|
message?: string;
|
|
88
88
|
code?: string;
|
|
89
89
|
cause?: unknown;
|
|
@@ -347,7 +347,7 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
347
347
|
setCookie: (key: string, value: string, options?: CookieOptions) => string;
|
|
348
348
|
setSignedCookie: (key: string, value: string, secret: string, options?: CookieOptions) => Promise<string>;
|
|
349
349
|
redirect: (url: string) => {
|
|
350
|
-
status: keyof typeof
|
|
350
|
+
status: keyof typeof statusCodes | Status;
|
|
351
351
|
body: ({
|
|
352
352
|
message?: string;
|
|
353
353
|
code?: string;
|
|
@@ -362,11 +362,11 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
362
362
|
} & {
|
|
363
363
|
errorStack: string | undefined;
|
|
364
364
|
};
|
|
365
|
-
error: (status: keyof typeof
|
|
365
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
366
366
|
message?: string;
|
|
367
367
|
code?: string;
|
|
368
368
|
} | undefined, headers?: HeadersInit) => {
|
|
369
|
-
status: keyof typeof
|
|
369
|
+
status: keyof typeof statusCodes | Status;
|
|
370
370
|
body: ({
|
|
371
371
|
message?: string;
|
|
372
372
|
code?: string;
|
|
@@ -411,7 +411,7 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
411
411
|
setCookie: (key: string, value: string, options?: CookieOptions) => string;
|
|
412
412
|
setSignedCookie: (key: string, value: string, secret: string, options?: CookieOptions) => Promise<string>;
|
|
413
413
|
redirect: (url: string) => {
|
|
414
|
-
status: keyof typeof
|
|
414
|
+
status: keyof typeof statusCodes | Status;
|
|
415
415
|
body: ({
|
|
416
416
|
message?: string;
|
|
417
417
|
code?: string;
|
|
@@ -426,11 +426,11 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
426
426
|
} & {
|
|
427
427
|
errorStack: string | undefined;
|
|
428
428
|
};
|
|
429
|
-
error: (status: keyof typeof
|
|
429
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
430
430
|
message?: string;
|
|
431
431
|
code?: string;
|
|
432
432
|
} | undefined, headers?: HeadersInit) => {
|
|
433
|
-
status: keyof typeof
|
|
433
|
+
status: keyof typeof statusCodes | Status;
|
|
434
434
|
body: ({
|
|
435
435
|
message?: string;
|
|
436
436
|
code?: string;
|
|
@@ -475,7 +475,7 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
475
475
|
setCookie: (key: string, value: string, options?: CookieOptions) => string;
|
|
476
476
|
setSignedCookie: (key: string, value: string, secret: string, options?: CookieOptions) => Promise<string>;
|
|
477
477
|
redirect: (url: string) => {
|
|
478
|
-
status: keyof typeof
|
|
478
|
+
status: keyof typeof statusCodes | Status;
|
|
479
479
|
body: ({
|
|
480
480
|
message?: string;
|
|
481
481
|
code?: string;
|
|
@@ -490,11 +490,11 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
490
490
|
} & {
|
|
491
491
|
errorStack: string | undefined;
|
|
492
492
|
};
|
|
493
|
-
error: (status: keyof typeof
|
|
493
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
494
494
|
message?: string;
|
|
495
495
|
code?: string;
|
|
496
496
|
} | undefined, headers?: HeadersInit) => {
|
|
497
|
-
status: keyof typeof
|
|
497
|
+
status: keyof typeof statusCodes | Status;
|
|
498
498
|
body: ({
|
|
499
499
|
message?: string;
|
|
500
500
|
code?: string;
|
|
@@ -539,7 +539,7 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
539
539
|
setCookie: (key: string, value: string, options?: CookieOptions) => string;
|
|
540
540
|
setSignedCookie: (key: string, value: string, secret: string, options?: CookieOptions) => Promise<string>;
|
|
541
541
|
redirect: (url: string) => {
|
|
542
|
-
status: keyof typeof
|
|
542
|
+
status: keyof typeof statusCodes | Status;
|
|
543
543
|
body: ({
|
|
544
544
|
message?: string;
|
|
545
545
|
code?: string;
|
|
@@ -554,11 +554,11 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
554
554
|
} & {
|
|
555
555
|
errorStack: string | undefined;
|
|
556
556
|
};
|
|
557
|
-
error: (status: keyof typeof
|
|
557
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
558
558
|
message?: string;
|
|
559
559
|
code?: string;
|
|
560
560
|
} | undefined, headers?: HeadersInit) => {
|
|
561
|
-
status: keyof typeof
|
|
561
|
+
status: keyof typeof statusCodes | Status;
|
|
562
562
|
body: ({
|
|
563
563
|
message?: string;
|
|
564
564
|
code?: string;
|
|
@@ -1123,7 +1123,7 @@ type EndpointContext<Path extends string, Options extends EndpointOptions, Conte
|
|
|
1123
1123
|
/**
|
|
1124
1124
|
* Return error
|
|
1125
1125
|
*/
|
|
1126
|
-
error: (status: keyof typeof
|
|
1126
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
1127
1127
|
message?: string;
|
|
1128
1128
|
code?: string;
|
|
1129
1129
|
} & Record<string, any>, headers?: HeadersInit) => APIError;
|
|
@@ -1259,5 +1259,5 @@ declare const createRouter: <E extends Record<string, Endpoint>, Config extends
|
|
|
1259
1259
|
};
|
|
1260
1260
|
type Router = ReturnType<typeof createRouter>;
|
|
1261
1261
|
//#endregion
|
|
1262
|
-
export { APIError, BetterCallError, CookieOptions, CookiePrefixOptions, Endpoint, EndpointBaseOptions, EndpointBodyMethodOptions, 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,
|
|
1263
|
-
//# sourceMappingURL=router-
|
|
1262
|
+
export { APIError, BetterCallError, CookieOptions, CookiePrefixOptions, Endpoint, EndpointBaseOptions, EndpointBodyMethodOptions, 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, createEndpoint, createInternalContext, createMiddleware, createRouter, generator, getCookieKey, getHTML, hideInternalStackFrames, makeErrorForHideStackFrame, parseCookies, serializeCookie, serializeSignedCookie, statusCodes };
|
|
1263
|
+
//# sourceMappingURL=router-D1f_-c2B.d.ts.map
|
|
@@ -21,7 +21,7 @@ declare function makeErrorForHideStackFrame<B extends new (...args: any[]) => Er
|
|
|
21
21
|
errorStack: string | undefined;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
declare const
|
|
24
|
+
declare const statusCodes: {
|
|
25
25
|
OK: number;
|
|
26
26
|
CREATED: number;
|
|
27
27
|
ACCEPTED: number;
|
|
@@ -75,7 +75,7 @@ declare const _statusCode: {
|
|
|
75
75
|
};
|
|
76
76
|
type Status = 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
77
77
|
declare class InternalAPIError extends Error {
|
|
78
|
-
status: keyof typeof
|
|
78
|
+
status: keyof typeof statusCodes | Status;
|
|
79
79
|
body: ({
|
|
80
80
|
message?: string;
|
|
81
81
|
code?: string;
|
|
@@ -83,7 +83,7 @@ declare class InternalAPIError extends Error {
|
|
|
83
83
|
} & Record<string, any>) | undefined;
|
|
84
84
|
headers: HeadersInit;
|
|
85
85
|
statusCode: number;
|
|
86
|
-
constructor(status?: keyof typeof
|
|
86
|
+
constructor(status?: keyof typeof statusCodes | Status, body?: ({
|
|
87
87
|
message?: string;
|
|
88
88
|
code?: string;
|
|
89
89
|
cause?: unknown;
|
|
@@ -347,7 +347,7 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
347
347
|
setCookie: (key: string, value: string, options?: CookieOptions) => string;
|
|
348
348
|
setSignedCookie: (key: string, value: string, secret: string, options?: CookieOptions) => Promise<string>;
|
|
349
349
|
redirect: (url: string) => {
|
|
350
|
-
status: keyof typeof
|
|
350
|
+
status: keyof typeof statusCodes | Status;
|
|
351
351
|
body: ({
|
|
352
352
|
message?: string;
|
|
353
353
|
code?: string;
|
|
@@ -362,11 +362,11 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
362
362
|
} & {
|
|
363
363
|
errorStack: string | undefined;
|
|
364
364
|
};
|
|
365
|
-
error: (status: keyof typeof
|
|
365
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
366
366
|
message?: string;
|
|
367
367
|
code?: string;
|
|
368
368
|
} | undefined, headers?: HeadersInit) => {
|
|
369
|
-
status: keyof typeof
|
|
369
|
+
status: keyof typeof statusCodes | Status;
|
|
370
370
|
body: ({
|
|
371
371
|
message?: string;
|
|
372
372
|
code?: string;
|
|
@@ -411,7 +411,7 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
411
411
|
setCookie: (key: string, value: string, options?: CookieOptions) => string;
|
|
412
412
|
setSignedCookie: (key: string, value: string, secret: string, options?: CookieOptions) => Promise<string>;
|
|
413
413
|
redirect: (url: string) => {
|
|
414
|
-
status: keyof typeof
|
|
414
|
+
status: keyof typeof statusCodes | Status;
|
|
415
415
|
body: ({
|
|
416
416
|
message?: string;
|
|
417
417
|
code?: string;
|
|
@@ -426,11 +426,11 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
426
426
|
} & {
|
|
427
427
|
errorStack: string | undefined;
|
|
428
428
|
};
|
|
429
|
-
error: (status: keyof typeof
|
|
429
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
430
430
|
message?: string;
|
|
431
431
|
code?: string;
|
|
432
432
|
} | undefined, headers?: HeadersInit) => {
|
|
433
|
-
status: keyof typeof
|
|
433
|
+
status: keyof typeof statusCodes | Status;
|
|
434
434
|
body: ({
|
|
435
435
|
message?: string;
|
|
436
436
|
code?: string;
|
|
@@ -475,7 +475,7 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
475
475
|
setCookie: (key: string, value: string, options?: CookieOptions) => string;
|
|
476
476
|
setSignedCookie: (key: string, value: string, secret: string, options?: CookieOptions) => Promise<string>;
|
|
477
477
|
redirect: (url: string) => {
|
|
478
|
-
status: keyof typeof
|
|
478
|
+
status: keyof typeof statusCodes | Status;
|
|
479
479
|
body: ({
|
|
480
480
|
message?: string;
|
|
481
481
|
code?: string;
|
|
@@ -490,11 +490,11 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
490
490
|
} & {
|
|
491
491
|
errorStack: string | undefined;
|
|
492
492
|
};
|
|
493
|
-
error: (status: keyof typeof
|
|
493
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
494
494
|
message?: string;
|
|
495
495
|
code?: string;
|
|
496
496
|
} | undefined, headers?: HeadersInit) => {
|
|
497
|
-
status: keyof typeof
|
|
497
|
+
status: keyof typeof statusCodes | Status;
|
|
498
498
|
body: ({
|
|
499
499
|
message?: string;
|
|
500
500
|
code?: string;
|
|
@@ -539,7 +539,7 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
539
539
|
setCookie: (key: string, value: string, options?: CookieOptions) => string;
|
|
540
540
|
setSignedCookie: (key: string, value: string, secret: string, options?: CookieOptions) => Promise<string>;
|
|
541
541
|
redirect: (url: string) => {
|
|
542
|
-
status: keyof typeof
|
|
542
|
+
status: keyof typeof statusCodes | Status;
|
|
543
543
|
body: ({
|
|
544
544
|
message?: string;
|
|
545
545
|
code?: string;
|
|
@@ -554,11 +554,11 @@ declare const createInternalContext: (context: InputContext<any, any>, {
|
|
|
554
554
|
} & {
|
|
555
555
|
errorStack: string | undefined;
|
|
556
556
|
};
|
|
557
|
-
error: (status: keyof typeof
|
|
557
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
558
558
|
message?: string;
|
|
559
559
|
code?: string;
|
|
560
560
|
} | undefined, headers?: HeadersInit) => {
|
|
561
|
-
status: keyof typeof
|
|
561
|
+
status: keyof typeof statusCodes | Status;
|
|
562
562
|
body: ({
|
|
563
563
|
message?: string;
|
|
564
564
|
code?: string;
|
|
@@ -1123,7 +1123,7 @@ type EndpointContext<Path extends string, Options extends EndpointOptions, Conte
|
|
|
1123
1123
|
/**
|
|
1124
1124
|
* Return error
|
|
1125
1125
|
*/
|
|
1126
|
-
error: (status: keyof typeof
|
|
1126
|
+
error: (status: keyof typeof statusCodes | Status, body?: {
|
|
1127
1127
|
message?: string;
|
|
1128
1128
|
code?: string;
|
|
1129
1129
|
} & Record<string, any>, headers?: HeadersInit) => APIError;
|
|
@@ -1259,5 +1259,5 @@ declare const createRouter: <E extends Record<string, Endpoint>, Config extends
|
|
|
1259
1259
|
};
|
|
1260
1260
|
type Router = ReturnType<typeof createRouter>;
|
|
1261
1261
|
//#endregion
|
|
1262
|
-
export { APIError, BetterCallError, CookieOptions, CookiePrefixOptions, Endpoint, EndpointBaseOptions, EndpointBodyMethodOptions, 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,
|
|
1263
|
-
//# sourceMappingURL=router-
|
|
1262
|
+
export { APIError, BetterCallError, CookieOptions, CookiePrefixOptions, Endpoint, EndpointBaseOptions, EndpointBodyMethodOptions, 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, createEndpoint, createInternalContext, createMiddleware, createRouter, generator, getCookieKey, getHTML, hideInternalStackFrames, makeErrorForHideStackFrame, parseCookies, serializeCookie, serializeSignedCookie, statusCodes };
|
|
1263
|
+
//# sourceMappingURL=router-DxWRTWmk.d.cts.map
|