@trpc/server 10.11.1 → 10.12.0
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/adapters/aws-lambda/index.js +1 -1
- package/dist/adapters/aws-lambda/index.mjs +1 -1
- package/dist/adapters/express.js +2 -2
- package/dist/adapters/express.mjs +2 -2
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/fastify/index.mjs +1 -1
- package/dist/adapters/fetch/index.js +1 -1
- package/dist/adapters/fetch/index.mjs +1 -1
- package/dist/adapters/next.js +2 -2
- package/dist/adapters/next.mjs +2 -2
- package/dist/adapters/node-http/index.js +2 -2
- package/dist/adapters/node-http/index.mjs +2 -2
- package/dist/adapters/standalone.js +2 -2
- package/dist/adapters/standalone.mjs +2 -2
- package/dist/core/internals/config.d.ts +4 -1
- package/dist/core/internals/config.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/http/index.mjs +1 -1
- package/dist/http/resolveHTTPResponse.d.ts.map +1 -1
- package/dist/internals.d.ts +3 -4
- package/dist/internals.d.ts.map +1 -1
- package/dist/{nodeHTTPRequestHandler-64cf5f55.js → nodeHTTPRequestHandler-196730a5.js} +1 -1
- package/dist/{nodeHTTPRequestHandler-34404221.mjs → nodeHTTPRequestHandler-1fb01cee.mjs} +1 -1
- package/dist/{resolveHTTPResponse-3408bbf7.js → resolveHTTPResponse-5e0173eb.js} +1 -0
- package/dist/{resolveHTTPResponse-b831e644.mjs → resolveHTTPResponse-64517f5d.mjs} +1 -0
- package/package.json +2 -2
- package/src/core/internals/config.ts +5 -1
- package/src/http/resolveHTTPResponse.ts +1 -0
- package/src/internals.ts +3 -4
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var TRPCError = require('../../TRPCError-bd37df84.js');
|
|
6
6
|
require('../../config-d356ff77.js');
|
|
7
7
|
require('../../codes-e0ea0f4c.js');
|
|
8
|
-
var resolveHTTPResponse = require('../../resolveHTTPResponse-
|
|
8
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-5e0173eb.js');
|
|
9
9
|
require('../../index-4d2d31b6.js');
|
|
10
10
|
require('../../transformTRPCResponse-d2700b72.js');
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { T as TRPCError } from '../../TRPCError-7de0a793.mjs';
|
|
2
2
|
import '../../config-4ca0221b.mjs';
|
|
3
3
|
import '../../codes-52c11119.mjs';
|
|
4
|
-
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-
|
|
4
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-64517f5d.mjs';
|
|
5
5
|
import '../../index-972002da.mjs';
|
|
6
6
|
import '../../transformTRPCResponse-7a73a2df.mjs';
|
|
7
7
|
|
package/dist/adapters/express.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
6
|
-
require('../resolveHTTPResponse-
|
|
5
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-196730a5.js');
|
|
6
|
+
require('../resolveHTTPResponse-5e0173eb.js');
|
|
7
7
|
require('../config-d356ff77.js');
|
|
8
8
|
require('../TRPCError-bd37df84.js');
|
|
9
9
|
require('../codes-e0ea0f4c.js');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
2
|
-
import '../resolveHTTPResponse-
|
|
1
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-1fb01cee.mjs';
|
|
2
|
+
import '../resolveHTTPResponse-64517f5d.mjs';
|
|
3
3
|
import '../config-4ca0221b.mjs';
|
|
4
4
|
import '../TRPCError-7de0a793.mjs';
|
|
5
5
|
import '../codes-52c11119.mjs';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var resolveHTTPResponse = require('../../resolveHTTPResponse-
|
|
5
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-5e0173eb.js');
|
|
6
6
|
var adapters_ws = require('../ws.js');
|
|
7
7
|
require('../../config-d356ff77.js');
|
|
8
8
|
require('../../TRPCError-bd37df84.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-
|
|
1
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-64517f5d.mjs';
|
|
2
2
|
import { applyWSSHandler } from '../ws.mjs';
|
|
3
3
|
import '../../config-4ca0221b.mjs';
|
|
4
4
|
import '../../TRPCError-7de0a793.mjs';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var resolveHTTPResponse = require('../../resolveHTTPResponse-
|
|
5
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-5e0173eb.js');
|
|
6
6
|
require('../../config-d356ff77.js');
|
|
7
7
|
require('../../TRPCError-bd37df84.js');
|
|
8
8
|
require('../../codes-e0ea0f4c.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-
|
|
1
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-64517f5d.mjs';
|
|
2
2
|
import '../../config-4ca0221b.mjs';
|
|
3
3
|
import '../../TRPCError-7de0a793.mjs';
|
|
4
4
|
import '../../codes-52c11119.mjs';
|
package/dist/adapters/next.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var TRPCError = require('../TRPCError-bd37df84.js');
|
|
6
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
7
|
-
require('../resolveHTTPResponse-
|
|
6
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-196730a5.js');
|
|
7
|
+
require('../resolveHTTPResponse-5e0173eb.js');
|
|
8
8
|
require('../config-d356ff77.js');
|
|
9
9
|
require('../codes-e0ea0f4c.js');
|
|
10
10
|
require('../index-4d2d31b6.js');
|
package/dist/adapters/next.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { T as TRPCError } from '../TRPCError-7de0a793.mjs';
|
|
2
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
3
|
-
import '../resolveHTTPResponse-
|
|
2
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-1fb01cee.mjs';
|
|
3
|
+
import '../resolveHTTPResponse-64517f5d.mjs';
|
|
4
4
|
import '../config-4ca0221b.mjs';
|
|
5
5
|
import '../codes-52c11119.mjs';
|
|
6
6
|
import '../index-972002da.mjs';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-
|
|
6
|
-
require('../../resolveHTTPResponse-
|
|
5
|
+
var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-196730a5.js');
|
|
6
|
+
require('../../resolveHTTPResponse-5e0173eb.js');
|
|
7
7
|
require('../../config-d356ff77.js');
|
|
8
8
|
require('../../TRPCError-bd37df84.js');
|
|
9
9
|
require('../../codes-e0ea0f4c.js');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-
|
|
2
|
-
import '../../resolveHTTPResponse-
|
|
1
|
+
export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-1fb01cee.mjs';
|
|
2
|
+
import '../../resolveHTTPResponse-64517f5d.mjs';
|
|
3
3
|
import '../../config-4ca0221b.mjs';
|
|
4
4
|
import '../../TRPCError-7de0a793.mjs';
|
|
5
5
|
import '../../codes-52c11119.mjs';
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var http = require('node:http');
|
|
6
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
7
|
-
require('../resolveHTTPResponse-
|
|
6
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-196730a5.js');
|
|
7
|
+
require('../resolveHTTPResponse-5e0173eb.js');
|
|
8
8
|
require('../config-d356ff77.js');
|
|
9
9
|
require('../TRPCError-bd37df84.js');
|
|
10
10
|
require('../codes-e0ea0f4c.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import http from 'node:http';
|
|
2
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
3
|
-
import '../resolveHTTPResponse-
|
|
2
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-1fb01cee.mjs';
|
|
3
|
+
import '../resolveHTTPResponse-64517f5d.mjs';
|
|
4
4
|
import '../config-4ca0221b.mjs';
|
|
5
5
|
import '../TRPCError-7de0a793.mjs';
|
|
6
6
|
import '../codes-52c11119.mjs';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ErrorFormatter } from '../../error/formatter';
|
|
2
|
+
import type { TRPCErrorShape } from '../../rpc';
|
|
2
3
|
/**
|
|
3
4
|
* The initial generics that are used in the init function
|
|
4
5
|
* @internal
|
|
@@ -27,7 +28,9 @@ export interface RuntimeConfig<TTypes extends RootConfigTypes> {
|
|
|
27
28
|
* Use custom error formatting
|
|
28
29
|
* @link https://trpc.io/docs/error-formatting
|
|
29
30
|
*/
|
|
30
|
-
errorFormatter: ErrorFormatter<TTypes['ctx'],
|
|
31
|
+
errorFormatter: ErrorFormatter<TTypes['ctx'], TRPCErrorShape<number> & {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}>;
|
|
31
34
|
/**
|
|
32
35
|
* Allow `@trpc/server` to run in non-server environments
|
|
33
36
|
* @warning **Use with caution**, this should likely mainly be used within testing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/core/internals/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/core/internals/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,OAIa,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,MAAM,SAAS,eAAe;IAC3D;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IACnC;;;OAGG;IACH,cAAc,EAAE,cAAc,CAC5B,MAAM,CAAC,KAAK,CAAC,EACb,cAAc,CAAC,MAAM,CAAC,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAChD,CAAC;IACF;;;;OAIG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,oBAAY,qBAAqB,CAAC,SAAS,SAAS,eAAe,IACjE,SAAS,CAAC;AAEZ;;;;GAIG;AACH,MAAM,WAAW,UAAU,CAAC,SAAS,SAAS,eAAe,CAC3D,SAAQ,aAAa,CAAC,SAAS,CAAC;IAChC,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;GAEG;AACH,oBAAY,aAAa,GAAG,UAAU,CAAC;IACrC,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,GAAG,CAAC;IACV,UAAU,EAAE,GAAG,CAAC;IAChB,WAAW,EAAE,GAAG,CAAC;CAClB,CAAC,CAAC"}
|
package/dist/http/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var config = require('../config-d356ff77.js');
|
|
6
|
-
var resolveHTTPResponse = require('../resolveHTTPResponse-
|
|
6
|
+
var resolveHTTPResponse = require('../resolveHTTPResponse-5e0173eb.js');
|
|
7
7
|
require('../TRPCError-bd37df84.js');
|
|
8
8
|
require('../codes-e0ea0f4c.js');
|
|
9
9
|
require('../index-4d2d31b6.js');
|
package/dist/http/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { T as TRPC_ERROR_CODES_BY_NUMBER, f as getHTTPStatusCode, g as getHTTPStatusCodeFromError } from '../config-4ca0221b.mjs';
|
|
2
|
-
export { r as resolveHTTPResponse } from '../resolveHTTPResponse-
|
|
2
|
+
export { r as resolveHTTPResponse } from '../resolveHTTPResponse-64517f5d.mjs';
|
|
3
3
|
import '../TRPCError-7de0a793.mjs';
|
|
4
4
|
import '../codes-52c11119.mjs';
|
|
5
5
|
import '../index-972002da.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveHTTPResponse.d.ts","sourceRoot":"","sources":["../../src/http/resolveHTTPResponse.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAGT,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EACL,sBAAsB,EAEtB,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AA+B3B,UAAU,yBAAyB,CACjC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,CAC5B,SAAQ,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACjD,aAAa,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC1B;AAED,wBAAsB,mBAAmB,CACvC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,EAC5B,IAAI,EAAE,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"resolveHTTPResponse.d.ts","sourceRoot":"","sources":["../../src/http/resolveHTTPResponse.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAGT,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EACL,sBAAsB,EAEtB,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AA+B3B,UAAU,yBAAyB,CACjC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,CAC5B,SAAQ,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACjD,aAAa,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC1B;AAED,wBAAsB,mBAAmB,CACvC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,EAC5B,IAAI,EAAE,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAyM3E"}
|
package/dist/internals.d.ts
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* These types have to be exported so users can generate their own types definitions files
|
|
3
3
|
*/
|
|
4
4
|
export type { DefaultErrorShape } from './error/formatter';
|
|
5
|
-
export type {
|
|
5
|
+
export type { mergeRouters } from './core/internals/mergeRouters';
|
|
6
6
|
export type { RootConfig, AnyRootConfig } from './core/internals/config';
|
|
7
7
|
export type { ProcedureBuilder, BuildProcedure, } from './core/internals/procedureBuilder';
|
|
8
|
-
export type {
|
|
9
|
-
export type { MiddlewareFunction } from './core/middleware';
|
|
10
|
-
export type { Router, RouterDef } from './core/router';
|
|
8
|
+
export type { unsetMarker } from './core/internals/utils';
|
|
9
|
+
export type { MiddlewareFunction, MiddlewareBuilder } from './core/middleware';
|
|
11
10
|
//# sourceMappingURL=internals.d.ts.map
|
package/dist/internals.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internals.d.ts","sourceRoot":"","sources":["../src/internals.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACzE,YAAY,EACV,gBAAgB,EAChB,cAAc,GACf,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"internals.d.ts","sourceRoot":"","sources":["../src/internals.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACzE,YAAY,EACV,gBAAgB,EAChB,cAAc,GACf,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -182,6 +182,7 @@ async function resolveHTTPResponse(opts) {
|
|
|
182
182
|
// - `createContext()` throws
|
|
183
183
|
// - post body is too large
|
|
184
184
|
// - input deserialization fails
|
|
185
|
+
// - `errorFormatter` return value is malformed
|
|
185
186
|
const error = TRPCError.getTRPCErrorFromUnknown(cause);
|
|
186
187
|
onError?.({
|
|
187
188
|
error,
|
|
@@ -180,6 +180,7 @@ async function resolveHTTPResponse(opts) {
|
|
|
180
180
|
// - `createContext()` throws
|
|
181
181
|
// - post body is too large
|
|
182
182
|
// - input deserialization fails
|
|
183
|
+
// - `errorFormatter` return value is malformed
|
|
183
184
|
const error = getTRPCErrorFromUnknown(cause);
|
|
184
185
|
onError?.({
|
|
185
186
|
error,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.12.0",
|
|
4
4
|
"description": "tRPC Server",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -160,5 +160,5 @@
|
|
|
160
160
|
"yup": "^0.32.8",
|
|
161
161
|
"zod": "^3.0.0"
|
|
162
162
|
},
|
|
163
|
-
"gitHead": "
|
|
163
|
+
"gitHead": "5f5d1f937dcae4addd850d320f3c0273559fd2ab"
|
|
164
164
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ErrorFormatter } from '../../error/formatter';
|
|
2
|
+
import type { TRPCErrorShape } from '../../rpc';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The initial generics that are used in the init function
|
|
@@ -34,7 +35,10 @@ export interface RuntimeConfig<TTypes extends RootConfigTypes> {
|
|
|
34
35
|
* Use custom error formatting
|
|
35
36
|
* @link https://trpc.io/docs/error-formatting
|
|
36
37
|
*/
|
|
37
|
-
errorFormatter: ErrorFormatter<
|
|
38
|
+
errorFormatter: ErrorFormatter<
|
|
39
|
+
TTypes['ctx'],
|
|
40
|
+
TRPCErrorShape<number> & { [key: string]: any }
|
|
41
|
+
>;
|
|
38
42
|
/**
|
|
39
43
|
* Allow `@trpc/server` to run in non-server environments
|
|
40
44
|
* @warning **Use with caution**, this should likely mainly be used within testing.
|
|
@@ -238,6 +238,7 @@ export async function resolveHTTPResponse<
|
|
|
238
238
|
// - `createContext()` throws
|
|
239
239
|
// - post body is too large
|
|
240
240
|
// - input deserialization fails
|
|
241
|
+
// - `errorFormatter` return value is malformed
|
|
241
242
|
const error = getTRPCErrorFromUnknown(cause);
|
|
242
243
|
|
|
243
244
|
onError?.({
|
package/src/internals.ts
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
* These types have to be exported so users can generate their own types definitions files
|
|
3
3
|
*/
|
|
4
4
|
export type { DefaultErrorShape } from './error/formatter';
|
|
5
|
-
export type {
|
|
5
|
+
export type { mergeRouters } from './core/internals/mergeRouters';
|
|
6
6
|
export type { RootConfig, AnyRootConfig } from './core/internals/config';
|
|
7
7
|
export type {
|
|
8
8
|
ProcedureBuilder,
|
|
9
9
|
BuildProcedure,
|
|
10
10
|
} from './core/internals/procedureBuilder';
|
|
11
|
-
export type {
|
|
12
|
-
export type { MiddlewareFunction } from './core/middleware';
|
|
13
|
-
export type { Router, RouterDef } from './core/router';
|
|
11
|
+
export type { unsetMarker } from './core/internals/utils';
|
|
12
|
+
export type { MiddlewareFunction, MiddlewareBuilder } from './core/middleware';
|