@trpc/server 10.38.4 → 10.38.5
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/{TRPCError-6a1653a4.mjs → TRPCError-816ff32e.mjs} +5 -1
- package/dist/{TRPCError-d07099d1.js → TRPCError-ae7b67e8.js} +5 -1
- package/dist/{TRPCError-c3de85e9.js → TRPCError-efecb077.js} +5 -1
- package/dist/adapters/aws-lambda/index.js +4 -4
- package/dist/adapters/aws-lambda/index.mjs +4 -4
- package/dist/adapters/express.js +5 -5
- package/dist/adapters/express.mjs +5 -5
- package/dist/adapters/fastify/index.js +4 -4
- package/dist/adapters/fastify/index.mjs +4 -4
- package/dist/adapters/fetch/index.js +4 -4
- package/dist/adapters/fetch/index.mjs +4 -4
- package/dist/adapters/next.js +5 -5
- package/dist/adapters/next.mjs +5 -5
- package/dist/adapters/node-http/content-type/json/index.js +2 -2
- package/dist/adapters/node-http/content-type/json/index.mjs +2 -2
- package/dist/adapters/node-http/index.js +5 -5
- package/dist/adapters/node-http/index.mjs +5 -5
- package/dist/adapters/standalone.js +5 -5
- package/dist/adapters/standalone.mjs +5 -5
- package/dist/adapters/ws.js +2 -2
- package/dist/adapters/ws.mjs +2 -2
- package/dist/{config-3156a1f1.js → config-3ab6b85e.js} +1 -1
- package/dist/{config-cd32070b.mjs → config-4c0f8e88.mjs} +1 -1
- package/dist/{config-44fe8842.js → config-f356f2fd.js} +1 -1
- package/dist/{contentType-5b601838.js → contentType-90bad7bb.js} +1 -1
- package/dist/{contentType-53e30af8.mjs → contentType-93515a46.mjs} +1 -1
- package/dist/{contentType-b87cced2.js → contentType-9940f5d7.js} +1 -1
- package/dist/error/TRPCError.d.ts.map +1 -1
- package/dist/http/index.js +4 -4
- package/dist/http/index.mjs +4 -4
- package/dist/index.js +2 -2
- package/dist/index.mjs +4 -4
- package/dist/{nodeHTTPRequestHandler-4ca02710.js → nodeHTTPRequestHandler-3d15f39f.js} +1 -1
- package/dist/{nodeHTTPRequestHandler-d42348fa.js → nodeHTTPRequestHandler-6a25ebcb.js} +1 -1
- package/dist/{nodeHTTPRequestHandler-a3cc8c22.mjs → nodeHTTPRequestHandler-dbf26ba2.mjs} +1 -1
- package/dist/{resolveHTTPResponse-a885ce7b.js → resolveHTTPResponse-051b3a40.js} +3 -3
- package/dist/{resolveHTTPResponse-67085326.mjs → resolveHTTPResponse-68c8befb.mjs} +3 -3
- package/dist/{resolveHTTPResponse-d21ca7c2.js → resolveHTTPResponse-79011e44.js} +3 -3
- package/dist/subscription.js +1 -1
- package/dist/subscription.mjs +1 -1
- package/package.json +3 -3
- package/src/error/TRPCError.ts +5 -1
|
@@ -9,6 +9,10 @@ function getTRPCErrorFromUnknown(cause) {
|
|
|
9
9
|
if (cause instanceof TRPCError) {
|
|
10
10
|
return cause;
|
|
11
11
|
}
|
|
12
|
+
if (cause instanceof Error && cause.name === 'TRPCError') {
|
|
13
|
+
// https://github.com/trpc/trpc/pull/4848
|
|
14
|
+
return cause;
|
|
15
|
+
}
|
|
12
16
|
const trpcError = new TRPCError({
|
|
13
17
|
code: 'INTERNAL_SERVER_ERROR',
|
|
14
18
|
cause
|
|
@@ -53,7 +57,7 @@ class TRPCError extends Error {
|
|
|
53
57
|
cause
|
|
54
58
|
});
|
|
55
59
|
this.code = opts.code;
|
|
56
|
-
this.name =
|
|
60
|
+
this.name = 'TRPCError';
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
|
|
@@ -11,6 +11,10 @@ function getTRPCErrorFromUnknown(cause) {
|
|
|
11
11
|
if (cause instanceof TRPCError) {
|
|
12
12
|
return cause;
|
|
13
13
|
}
|
|
14
|
+
if (cause instanceof Error && cause.name === 'TRPCError') {
|
|
15
|
+
// https://github.com/trpc/trpc/pull/4848
|
|
16
|
+
return cause;
|
|
17
|
+
}
|
|
14
18
|
const trpcError = new TRPCError({
|
|
15
19
|
code: 'INTERNAL_SERVER_ERROR',
|
|
16
20
|
cause
|
|
@@ -55,7 +59,7 @@ class TRPCError extends Error {
|
|
|
55
59
|
cause
|
|
56
60
|
});
|
|
57
61
|
this.code = opts.code;
|
|
58
|
-
this.name =
|
|
62
|
+
this.name = 'TRPCError';
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -10,6 +10,10 @@ function getTRPCErrorFromUnknown(cause) {
|
|
|
10
10
|
if (cause instanceof TRPCError) {
|
|
11
11
|
return cause;
|
|
12
12
|
}
|
|
13
|
+
if (cause instanceof Error && cause.name === 'TRPCError') {
|
|
14
|
+
// https://github.com/trpc/trpc/pull/4848
|
|
15
|
+
return cause;
|
|
16
|
+
}
|
|
13
17
|
const trpcError = new TRPCError({
|
|
14
18
|
code: 'INTERNAL_SERVER_ERROR',
|
|
15
19
|
cause,
|
|
@@ -52,7 +56,7 @@ class TRPCError extends Error {
|
|
|
52
56
|
// @ts-ignore https://github.com/tc39/proposal-error-cause
|
|
53
57
|
super(message, { cause });
|
|
54
58
|
this.code = opts.code;
|
|
55
|
-
this.name =
|
|
59
|
+
this.name = 'TRPCError';
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
62
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var TRPCError = require('../../TRPCError-
|
|
5
|
+
var TRPCError = require('../../TRPCError-ae7b67e8.js');
|
|
6
6
|
require('../../index-784ff647.js');
|
|
7
7
|
require('../../codes-87f6824b.js');
|
|
8
|
-
require('../../config-
|
|
9
|
-
var resolveHTTPResponse = require('../../resolveHTTPResponse-
|
|
8
|
+
require('../../config-3ab6b85e.js');
|
|
9
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-79011e44.js');
|
|
10
10
|
require('../../transformTRPCResponse-e65f34e9.js');
|
|
11
|
-
require('../../contentType-
|
|
11
|
+
require('../../contentType-90bad7bb.js');
|
|
12
12
|
|
|
13
13
|
function isPayloadV1(event) {
|
|
14
14
|
return determinePayloadFormat(event) == '1.0';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { T as TRPCError } from '../../TRPCError-
|
|
1
|
+
import { T as TRPCError } from '../../TRPCError-816ff32e.mjs';
|
|
2
2
|
import '../../index-f91d720c.mjs';
|
|
3
3
|
import '../../codes-c924c3db.mjs';
|
|
4
|
-
import '../../config-
|
|
5
|
-
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-
|
|
4
|
+
import '../../config-4c0f8e88.mjs';
|
|
5
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-68c8befb.mjs';
|
|
6
6
|
import '../../transformTRPCResponse-1153b421.mjs';
|
|
7
|
-
import '../../contentType-
|
|
7
|
+
import '../../contentType-93515a46.mjs';
|
|
8
8
|
|
|
9
9
|
function isPayloadV1(event) {
|
|
10
10
|
return determinePayloadFormat(event) == '1.0';
|
package/dist/adapters/express.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
5
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-3d15f39f.js');
|
|
6
6
|
require('../index-784ff647.js');
|
|
7
7
|
require('../codes-87f6824b.js');
|
|
8
|
-
require('../resolveHTTPResponse-
|
|
9
|
-
require('../config-
|
|
10
|
-
require('../TRPCError-
|
|
8
|
+
require('../resolveHTTPResponse-79011e44.js');
|
|
9
|
+
require('../config-3ab6b85e.js');
|
|
10
|
+
require('../TRPCError-ae7b67e8.js');
|
|
11
11
|
require('../transformTRPCResponse-e65f34e9.js');
|
|
12
|
-
require('../contentType-
|
|
12
|
+
require('../contentType-90bad7bb.js');
|
|
13
13
|
require('../batchStreamFormatter-93cdcdd4.js');
|
|
14
14
|
require('./node-http/content-type/json/index.js');
|
|
15
15
|
require('../contentType-8c16408e.js');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
1
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-dbf26ba2.mjs';
|
|
2
2
|
import '../index-f91d720c.mjs';
|
|
3
3
|
import '../codes-c924c3db.mjs';
|
|
4
|
-
import '../resolveHTTPResponse-
|
|
5
|
-
import '../config-
|
|
6
|
-
import '../TRPCError-
|
|
4
|
+
import '../resolveHTTPResponse-68c8befb.mjs';
|
|
5
|
+
import '../config-4c0f8e88.mjs';
|
|
6
|
+
import '../TRPCError-816ff32e.mjs';
|
|
7
7
|
import '../transformTRPCResponse-1153b421.mjs';
|
|
8
|
-
import '../contentType-
|
|
8
|
+
import '../contentType-93515a46.mjs';
|
|
9
9
|
import '../batchStreamFormatter-fc1ffb26.mjs';
|
|
10
10
|
import './node-http/content-type/json/index.mjs';
|
|
11
11
|
import '../contentType-3194ed5f.mjs';
|
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var node_stream = require('node:stream');
|
|
6
6
|
require('../../index-784ff647.js');
|
|
7
|
-
var resolveHTTPResponse = require('../../resolveHTTPResponse-
|
|
7
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-79011e44.js');
|
|
8
8
|
var batchStreamFormatter = require('../../batchStreamFormatter-93cdcdd4.js');
|
|
9
9
|
var adapters_ws = require('../ws.js');
|
|
10
10
|
require('../../codes-87f6824b.js');
|
|
11
|
-
require('../../config-
|
|
12
|
-
require('../../TRPCError-
|
|
11
|
+
require('../../config-3ab6b85e.js');
|
|
12
|
+
require('../../TRPCError-ae7b67e8.js');
|
|
13
13
|
require('../../transformTRPCResponse-e65f34e9.js');
|
|
14
|
-
require('../../contentType-
|
|
14
|
+
require('../../contentType-90bad7bb.js');
|
|
15
15
|
require('../../observable-464116ac.js');
|
|
16
16
|
|
|
17
17
|
async function fastifyRequestHandler(opts) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import '../../index-f91d720c.mjs';
|
|
3
|
-
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-
|
|
3
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-68c8befb.mjs';
|
|
4
4
|
import { g as getBatchStreamFormatter } from '../../batchStreamFormatter-fc1ffb26.mjs';
|
|
5
5
|
import { applyWSSHandler } from '../ws.mjs';
|
|
6
6
|
import '../../codes-c924c3db.mjs';
|
|
7
|
-
import '../../config-
|
|
8
|
-
import '../../TRPCError-
|
|
7
|
+
import '../../config-4c0f8e88.mjs';
|
|
8
|
+
import '../../TRPCError-816ff32e.mjs';
|
|
9
9
|
import '../../transformTRPCResponse-1153b421.mjs';
|
|
10
|
-
import '../../contentType-
|
|
10
|
+
import '../../contentType-93515a46.mjs';
|
|
11
11
|
import '../../observable-ade1bad8.mjs';
|
|
12
12
|
|
|
13
13
|
async function fastifyRequestHandler(opts) {
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../index-784ff647.js');
|
|
6
|
-
var resolveHTTPResponse = require('../../resolveHTTPResponse-
|
|
6
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-79011e44.js');
|
|
7
7
|
var batchStreamFormatter = require('../../batchStreamFormatter-93cdcdd4.js');
|
|
8
8
|
require('../../codes-87f6824b.js');
|
|
9
|
-
require('../../config-
|
|
10
|
-
require('../../TRPCError-
|
|
9
|
+
require('../../config-3ab6b85e.js');
|
|
10
|
+
require('../../TRPCError-ae7b67e8.js');
|
|
11
11
|
require('../../transformTRPCResponse-e65f34e9.js');
|
|
12
|
-
require('../../contentType-
|
|
12
|
+
require('../../contentType-90bad7bb.js');
|
|
13
13
|
|
|
14
14
|
async function fetchRequestHandler(opts) {
|
|
15
15
|
const resHeaders = new Headers();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '../../index-f91d720c.mjs';
|
|
2
|
-
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-
|
|
2
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-68c8befb.mjs';
|
|
3
3
|
import { g as getBatchStreamFormatter } from '../../batchStreamFormatter-fc1ffb26.mjs';
|
|
4
4
|
import '../../codes-c924c3db.mjs';
|
|
5
|
-
import '../../config-
|
|
6
|
-
import '../../TRPCError-
|
|
5
|
+
import '../../config-4c0f8e88.mjs';
|
|
6
|
+
import '../../TRPCError-816ff32e.mjs';
|
|
7
7
|
import '../../transformTRPCResponse-1153b421.mjs';
|
|
8
|
-
import '../../contentType-
|
|
8
|
+
import '../../contentType-93515a46.mjs';
|
|
9
9
|
|
|
10
10
|
async function fetchRequestHandler(opts) {
|
|
11
11
|
const resHeaders = new Headers();
|
package/dist/adapters/next.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var TRPCError = require('../TRPCError-
|
|
5
|
+
var TRPCError = require('../TRPCError-ae7b67e8.js');
|
|
6
6
|
var transformTRPCResponse = require('../transformTRPCResponse-e65f34e9.js');
|
|
7
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
7
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-3d15f39f.js');
|
|
8
8
|
require('../index-784ff647.js');
|
|
9
9
|
require('../codes-87f6824b.js');
|
|
10
|
-
require('../resolveHTTPResponse-
|
|
11
|
-
require('../config-
|
|
12
|
-
require('../contentType-
|
|
10
|
+
require('../resolveHTTPResponse-79011e44.js');
|
|
11
|
+
require('../config-3ab6b85e.js');
|
|
12
|
+
require('../contentType-90bad7bb.js');
|
|
13
13
|
require('../batchStreamFormatter-93cdcdd4.js');
|
|
14
14
|
require('./node-http/content-type/json/index.js');
|
|
15
15
|
require('../contentType-8c16408e.js');
|
package/dist/adapters/next.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TRPCError } from '../TRPCError-
|
|
1
|
+
import { T as TRPCError } from '../TRPCError-816ff32e.mjs';
|
|
2
2
|
import { g as getErrorShape } from '../transformTRPCResponse-1153b421.mjs';
|
|
3
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
3
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-dbf26ba2.mjs';
|
|
4
4
|
import '../index-f91d720c.mjs';
|
|
5
5
|
import '../codes-c924c3db.mjs';
|
|
6
|
-
import '../resolveHTTPResponse-
|
|
7
|
-
import '../config-
|
|
8
|
-
import '../contentType-
|
|
6
|
+
import '../resolveHTTPResponse-68c8befb.mjs';
|
|
7
|
+
import '../config-4c0f8e88.mjs';
|
|
8
|
+
import '../contentType-93515a46.mjs';
|
|
9
9
|
import '../batchStreamFormatter-fc1ffb26.mjs';
|
|
10
10
|
import './node-http/content-type/json/index.mjs';
|
|
11
11
|
import '../contentType-3194ed5f.mjs';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var contentType$1 = require('../../../../contentType-
|
|
5
|
+
var contentType$1 = require('../../../../contentType-90bad7bb.js');
|
|
6
6
|
var contentType = require('../../../../contentType-8c16408e.js');
|
|
7
|
-
var TRPCError = require('../../../../TRPCError-
|
|
7
|
+
var TRPCError = require('../../../../TRPCError-ae7b67e8.js');
|
|
8
8
|
|
|
9
9
|
async function getPostBody(opts) {
|
|
10
10
|
const { req , maxBodySize =Infinity } = opts;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getJsonContentTypeInputs } from '../../../../contentType-
|
|
1
|
+
import { g as getJsonContentTypeInputs } from '../../../../contentType-93515a46.mjs';
|
|
2
2
|
import { c as createNodeHTTPContentTypeHandler } from '../../../../contentType-3194ed5f.mjs';
|
|
3
|
-
import { T as TRPCError } from '../../../../TRPCError-
|
|
3
|
+
import { T as TRPCError } from '../../../../TRPCError-816ff32e.mjs';
|
|
4
4
|
|
|
5
5
|
async function getPostBody(opts) {
|
|
6
6
|
const { req , maxBodySize =Infinity } = opts;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-
|
|
5
|
+
var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-3d15f39f.js');
|
|
6
6
|
require('../../index-784ff647.js');
|
|
7
7
|
require('../../codes-87f6824b.js');
|
|
8
|
-
require('../../resolveHTTPResponse-
|
|
9
|
-
require('../../config-
|
|
10
|
-
require('../../TRPCError-
|
|
8
|
+
require('../../resolveHTTPResponse-79011e44.js');
|
|
9
|
+
require('../../config-3ab6b85e.js');
|
|
10
|
+
require('../../TRPCError-ae7b67e8.js');
|
|
11
11
|
require('../../transformTRPCResponse-e65f34e9.js');
|
|
12
|
-
require('../../contentType-
|
|
12
|
+
require('../../contentType-90bad7bb.js');
|
|
13
13
|
require('../../batchStreamFormatter-93cdcdd4.js');
|
|
14
14
|
require('./content-type/json/index.js');
|
|
15
15
|
require('../../contentType-8c16408e.js');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-
|
|
1
|
+
export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-dbf26ba2.mjs';
|
|
2
2
|
import '../../index-f91d720c.mjs';
|
|
3
3
|
import '../../codes-c924c3db.mjs';
|
|
4
|
-
import '../../resolveHTTPResponse-
|
|
5
|
-
import '../../config-
|
|
6
|
-
import '../../TRPCError-
|
|
4
|
+
import '../../resolveHTTPResponse-68c8befb.mjs';
|
|
5
|
+
import '../../config-4c0f8e88.mjs';
|
|
6
|
+
import '../../TRPCError-816ff32e.mjs';
|
|
7
7
|
import '../../transformTRPCResponse-1153b421.mjs';
|
|
8
|
-
import '../../contentType-
|
|
8
|
+
import '../../contentType-93515a46.mjs';
|
|
9
9
|
import '../../batchStreamFormatter-fc1ffb26.mjs';
|
|
10
10
|
import './content-type/json/index.mjs';
|
|
11
11
|
import '../../contentType-3194ed5f.mjs';
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var http = require('node:http');
|
|
6
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
6
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-3d15f39f.js');
|
|
7
7
|
require('../index-784ff647.js');
|
|
8
8
|
require('../codes-87f6824b.js');
|
|
9
|
-
require('../resolveHTTPResponse-
|
|
10
|
-
require('../config-
|
|
11
|
-
require('../TRPCError-
|
|
9
|
+
require('../resolveHTTPResponse-79011e44.js');
|
|
10
|
+
require('../config-3ab6b85e.js');
|
|
11
|
+
require('../TRPCError-ae7b67e8.js');
|
|
12
12
|
require('../transformTRPCResponse-e65f34e9.js');
|
|
13
|
-
require('../contentType-
|
|
13
|
+
require('../contentType-90bad7bb.js');
|
|
14
14
|
require('../batchStreamFormatter-93cdcdd4.js');
|
|
15
15
|
require('./node-http/content-type/json/index.js');
|
|
16
16
|
require('../contentType-8c16408e.js');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import http from 'node:http';
|
|
2
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
2
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-dbf26ba2.mjs';
|
|
3
3
|
import '../index-f91d720c.mjs';
|
|
4
4
|
import '../codes-c924c3db.mjs';
|
|
5
|
-
import '../resolveHTTPResponse-
|
|
6
|
-
import '../config-
|
|
7
|
-
import '../TRPCError-
|
|
5
|
+
import '../resolveHTTPResponse-68c8befb.mjs';
|
|
6
|
+
import '../config-4c0f8e88.mjs';
|
|
7
|
+
import '../TRPCError-816ff32e.mjs';
|
|
8
8
|
import '../transformTRPCResponse-1153b421.mjs';
|
|
9
|
-
import '../contentType-
|
|
9
|
+
import '../contentType-93515a46.mjs';
|
|
10
10
|
import '../batchStreamFormatter-fc1ffb26.mjs';
|
|
11
11
|
import './node-http/content-type/json/index.mjs';
|
|
12
12
|
import '../contentType-3194ed5f.mjs';
|
package/dist/adapters/ws.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var config = require('../config-
|
|
6
|
-
var TRPCError = require('../TRPCError-
|
|
5
|
+
var config = require('../config-3ab6b85e.js');
|
|
6
|
+
var TRPCError = require('../TRPCError-ae7b67e8.js');
|
|
7
7
|
var observable = require('../observable-464116ac.js');
|
|
8
8
|
var transformTRPCResponse = require('../transformTRPCResponse-e65f34e9.js');
|
|
9
9
|
require('../index-784ff647.js');
|
package/dist/adapters/ws.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as callProcedure } from '../config-
|
|
2
|
-
import { T as TRPCError, g as getTRPCErrorFromUnknown } from '../TRPCError-
|
|
1
|
+
import { b as callProcedure } from '../config-4c0f8e88.mjs';
|
|
2
|
+
import { T as TRPCError, g as getTRPCErrorFromUnknown } from '../TRPCError-816ff32e.mjs';
|
|
3
3
|
import { i as isObservable } from '../observable-ade1bad8.mjs';
|
|
4
4
|
import { g as getErrorShape, t as transformTRPCResponse } from '../transformTRPCResponse-1153b421.mjs';
|
|
5
5
|
import '../index-f91d720c.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TRPCError } from './TRPCError-
|
|
1
|
+
import { T as TRPCError } from './TRPCError-816ff32e.mjs';
|
|
2
2
|
import { a as createRecursiveProxy, g as getHTTPStatusCodeFromError } from './index-f91d720c.mjs';
|
|
3
3
|
import { T as TRPC_ERROR_CODES_BY_KEY } from './codes-c924c3db.mjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TRPCError } from './TRPCError-
|
|
1
|
+
import { T as TRPCError } from './TRPCError-efecb077.js';
|
|
2
2
|
import { a as createRecursiveProxy, g as getHTTPStatusCodeFromError } from './index-46cb3130.js';
|
|
3
3
|
import { T as TRPC_ERROR_CODES_BY_KEY } from './codes-e5bb4d58.js';
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TRPCError.d.ts","sourceRoot":"","sources":["../../src/error/TRPCError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"TRPCError.d.ts","sourceRoot":"","sources":["../../src/error/TRPCError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAoBjE;AAiCD,qBAAa,SAAU,SAAQ,KAAK;IAClC,SAAgB,KAAK,CAAC,EAAE,KAAK,CAAC;IAC9B,SAAgB,IAAI,qSAAC;gBAET,IAAI,EAAE;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,mBAAmB,CAAC;QAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAWF"}
|
package/dist/http/index.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var index = require('../index-784ff647.js');
|
|
6
|
-
var resolveHTTPResponse = require('../resolveHTTPResponse-
|
|
6
|
+
var resolveHTTPResponse = require('../resolveHTTPResponse-79011e44.js');
|
|
7
7
|
var batchStreamFormatter = require('../batchStreamFormatter-93cdcdd4.js');
|
|
8
8
|
require('../codes-87f6824b.js');
|
|
9
|
-
require('../config-
|
|
10
|
-
require('../TRPCError-
|
|
9
|
+
require('../config-3ab6b85e.js');
|
|
10
|
+
require('../TRPCError-ae7b67e8.js');
|
|
11
11
|
require('../transformTRPCResponse-e65f34e9.js');
|
|
12
|
-
require('../contentType-
|
|
12
|
+
require('../contentType-90bad7bb.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
package/dist/http/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { T as TRPC_ERROR_CODES_BY_NUMBER, b as getHTTPStatusCode, g as getHTTPStatusCodeFromError } from '../index-f91d720c.mjs';
|
|
2
|
-
export { r as resolveHTTPResponse } from '../resolveHTTPResponse-
|
|
2
|
+
export { r as resolveHTTPResponse } from '../resolveHTTPResponse-68c8befb.mjs';
|
|
3
3
|
export { g as getBatchStreamFormatter } from '../batchStreamFormatter-fc1ffb26.mjs';
|
|
4
4
|
import '../codes-c924c3db.mjs';
|
|
5
|
-
import '../config-
|
|
6
|
-
import '../TRPCError-
|
|
5
|
+
import '../config-4c0f8e88.mjs';
|
|
6
|
+
import '../TRPCError-816ff32e.mjs';
|
|
7
7
|
import '../transformTRPCResponse-1153b421.mjs';
|
|
8
|
-
import '../contentType-
|
|
8
|
+
import '../contentType-93515a46.mjs';
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var config = require('./config-
|
|
6
|
-
var TRPCError = require('./TRPCError-
|
|
5
|
+
var config = require('./config-3ab6b85e.js');
|
|
6
|
+
var TRPCError = require('./TRPCError-ae7b67e8.js');
|
|
7
7
|
var index = require('./index-784ff647.js');
|
|
8
8
|
var codes = require('./codes-87f6824b.js');
|
|
9
9
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as createRouterFactory, d as defaultFormatter, a as defaultTransformer, g as getDataTransformer$1, i as isServerDefault } from './config-
|
|
2
|
-
export { b as callProcedure, a as defaultTransformer, g as getDataTransformer, p as procedureTypes } from './config-
|
|
3
|
-
import { T as TRPCError, g as getTRPCErrorFromUnknown } from './TRPCError-
|
|
4
|
-
export { T as TRPCError, g as getTRPCErrorFromUnknown } from './TRPCError-
|
|
1
|
+
import { c as createRouterFactory, d as defaultFormatter, a as defaultTransformer, g as getDataTransformer$1, i as isServerDefault } from './config-4c0f8e88.mjs';
|
|
2
|
+
export { b as callProcedure, a as defaultTransformer, g as getDataTransformer, p as procedureTypes } from './config-4c0f8e88.mjs';
|
|
3
|
+
import { T as TRPCError, g as getTRPCErrorFromUnknown } from './TRPCError-816ff32e.mjs';
|
|
4
|
+
export { T as TRPCError, g as getTRPCErrorFromUnknown } from './TRPCError-816ff32e.mjs';
|
|
5
5
|
import { g as getHTTPStatusCodeFromError, c as createFlatProxy } from './index-f91d720c.mjs';
|
|
6
6
|
import { T as TRPC_ERROR_CODES_BY_KEY } from './codes-c924c3db.mjs';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('./index-784ff647.js');
|
|
4
|
-
var resolveHTTPResponse = require('./resolveHTTPResponse-
|
|
4
|
+
var resolveHTTPResponse = require('./resolveHTTPResponse-79011e44.js');
|
|
5
5
|
var batchStreamFormatter = require('./batchStreamFormatter-93cdcdd4.js');
|
|
6
6
|
var adapters_nodeHttp_contentType_json_index = require('./adapters/node-http/content-type/json/index.js');
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './index-46cb3130.js';
|
|
2
|
-
import { r as resolveHTTPResponse } from './resolveHTTPResponse-
|
|
2
|
+
import { r as resolveHTTPResponse } from './resolveHTTPResponse-051b3a40.js';
|
|
3
3
|
import { g as getBatchStreamFormatter } from './batchStreamFormatter-2c1405a1.js';
|
|
4
4
|
import { nodeHTTPJSONContentTypeHandler } from './adapters/node-http/content-type/json/index.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './index-f91d720c.mjs';
|
|
2
|
-
import { r as resolveHTTPResponse } from './resolveHTTPResponse-
|
|
2
|
+
import { r as resolveHTTPResponse } from './resolveHTTPResponse-68c8befb.mjs';
|
|
3
3
|
import { g as getBatchStreamFormatter } from './batchStreamFormatter-fc1ffb26.mjs';
|
|
4
4
|
import { nodeHTTPJSONContentTypeHandler } from './adapters/node-http/content-type/json/index.mjs';
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as callProcedure } from './config-
|
|
2
|
-
import { T as TRPCError, g as getTRPCErrorFromUnknown } from './TRPCError-
|
|
1
|
+
import { b as callProcedure } from './config-f356f2fd.js';
|
|
2
|
+
import { T as TRPCError, g as getTRPCErrorFromUnknown } from './TRPCError-efecb077.js';
|
|
3
3
|
import { t as transformTRPCResponse, g as getErrorShape } from './transformTRPCResponse-20ce3b68.js';
|
|
4
|
-
import { g as getJsonContentTypeInputs } from './contentType-
|
|
4
|
+
import { g as getJsonContentTypeInputs } from './contentType-9940f5d7.js';
|
|
5
5
|
import { b as getHTTPStatusCode } from './index-46cb3130.js';
|
|
6
6
|
|
|
7
7
|
const HTTP_METHOD_PROCEDURE_TYPE_MAP = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as callProcedure } from './config-
|
|
2
|
-
import { T as TRPCError, g as getTRPCErrorFromUnknown } from './TRPCError-
|
|
1
|
+
import { b as callProcedure } from './config-4c0f8e88.mjs';
|
|
2
|
+
import { T as TRPCError, g as getTRPCErrorFromUnknown } from './TRPCError-816ff32e.mjs';
|
|
3
3
|
import { t as transformTRPCResponse, g as getErrorShape } from './transformTRPCResponse-1153b421.mjs';
|
|
4
|
-
import { g as getJsonContentTypeInputs } from './contentType-
|
|
4
|
+
import { g as getJsonContentTypeInputs } from './contentType-93515a46.mjs';
|
|
5
5
|
import { b as getHTTPStatusCode } from './index-f91d720c.mjs';
|
|
6
6
|
|
|
7
7
|
const HTTP_METHOD_PROCEDURE_TYPE_MAP = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var config = require('./config-
|
|
4
|
-
var TRPCError = require('./TRPCError-
|
|
3
|
+
var config = require('./config-3ab6b85e.js');
|
|
4
|
+
var TRPCError = require('./TRPCError-ae7b67e8.js');
|
|
5
5
|
var transformTRPCResponse = require('./transformTRPCResponse-e65f34e9.js');
|
|
6
|
-
var contentType = require('./contentType-
|
|
6
|
+
var contentType = require('./contentType-90bad7bb.js');
|
|
7
7
|
var index = require('./index-784ff647.js');
|
|
8
8
|
|
|
9
9
|
const HTTP_METHOD_PROCEDURE_TYPE_MAP = {
|
package/dist/subscription.js
CHANGED
package/dist/subscription.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "10.38.
|
|
3
|
+
"version": "10.38.5",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"codegen-entrypoints": "tsx entrypoints.script.ts",
|
|
36
36
|
"benchmark": "tsc --project tsconfig.benchmark.json",
|
|
37
37
|
"lint": "eslint --cache --ext \".js,.ts,.tsx\" --ignore-path ../../.gitignore --report-unused-disable-directives src",
|
|
38
|
-
"ts-watch": "tsc --project tsconfig.watch.json"
|
|
38
|
+
"ts-watch": "tsc --project tsconfig.watch.json --watch"
|
|
39
39
|
},
|
|
40
40
|
"exports": {
|
|
41
41
|
"./package.json": "./package.json",
|
|
@@ -174,5 +174,5 @@
|
|
|
174
174
|
"funding": [
|
|
175
175
|
"https://trpc.io/sponsor"
|
|
176
176
|
],
|
|
177
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "3faa33bd3079a5721701190e61d8dd5b6054f9f3"
|
|
178
178
|
}
|
package/src/error/TRPCError.ts
CHANGED
|
@@ -5,6 +5,10 @@ export function getTRPCErrorFromUnknown(cause: unknown): TRPCError {
|
|
|
5
5
|
if (cause instanceof TRPCError) {
|
|
6
6
|
return cause;
|
|
7
7
|
}
|
|
8
|
+
if (cause instanceof Error && cause.name === 'TRPCError') {
|
|
9
|
+
// https://github.com/trpc/trpc/pull/4848
|
|
10
|
+
return cause as TRPCError;
|
|
11
|
+
}
|
|
8
12
|
|
|
9
13
|
const trpcError = new TRPCError({
|
|
10
14
|
code: 'INTERNAL_SERVER_ERROR',
|
|
@@ -67,6 +71,6 @@ export class TRPCError extends Error {
|
|
|
67
71
|
super(message, { cause });
|
|
68
72
|
|
|
69
73
|
this.code = opts.code;
|
|
70
|
-
this.name =
|
|
74
|
+
this.name = 'TRPCError';
|
|
71
75
|
}
|
|
72
76
|
}
|