@trpc/server 11.0.0-rc.455 → 11.0.0-rc.456
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/bundle-analysis.json +38 -38
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +1 -1
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +5 -2
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +5 -2
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +4 -1
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rpc/codes.js +4 -1
- package/dist/unstable-core-do-not-import/rpc/codes.mjs +4 -1
- package/package.json +2 -2
- package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +4 -1
- package/src/unstable-core-do-not-import/rpc/codes.ts +6 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 27.
|
|
2
|
+
"bundleSize": 131618,
|
|
3
|
+
"bundleOrigSize": 181007,
|
|
4
|
+
"bundleReduction": 27.29,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"/src/unstable-core-do-not-import.ts",
|
|
18
18
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
19
19
|
],
|
|
20
|
-
"percent": 13.
|
|
20
|
+
"percent": 13.17,
|
|
21
21
|
"reduction": 4.22
|
|
22
22
|
},
|
|
23
23
|
{
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependents": [
|
|
32
32
|
"/src/unstable-core-do-not-import.ts"
|
|
33
33
|
],
|
|
34
|
-
"percent": 13.
|
|
34
|
+
"percent": 13.04,
|
|
35
35
|
"reduction": 0
|
|
36
36
|
},
|
|
37
37
|
{
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependents": [
|
|
47
47
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
48
48
|
],
|
|
49
|
-
"percent": 10.
|
|
49
|
+
"percent": 10.96,
|
|
50
50
|
"reduction": 0
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"/src/unstable-core-do-not-import.ts",
|
|
62
62
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
63
63
|
],
|
|
64
|
-
"percent": 5.
|
|
64
|
+
"percent": 5.84,
|
|
65
65
|
"reduction": 0
|
|
66
66
|
},
|
|
67
67
|
{
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"/src/unstable-core-do-not-import.ts",
|
|
114
114
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
115
115
|
],
|
|
116
|
-
"percent": 4.
|
|
116
|
+
"percent": 4.28,
|
|
117
117
|
"reduction": 24.48
|
|
118
118
|
},
|
|
119
119
|
{
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"dependents": [
|
|
178
178
|
"/src/observable/index.ts"
|
|
179
179
|
],
|
|
180
|
-
"percent": 2.
|
|
180
|
+
"percent": 2.09,
|
|
181
181
|
"reduction": 0
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
198
198
|
"/src/unstable-core-do-not-import/router.ts"
|
|
199
199
|
],
|
|
200
|
-
"percent": 2.
|
|
200
|
+
"percent": 2.08,
|
|
201
201
|
"reduction": 45.94
|
|
202
202
|
},
|
|
203
203
|
{
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
"dependents": [
|
|
226
226
|
"/src/unstable-core-do-not-import.ts"
|
|
227
227
|
],
|
|
228
|
-
"percent": 2.
|
|
228
|
+
"percent": 2.05,
|
|
229
229
|
"reduction": 40.91
|
|
230
230
|
},
|
|
231
231
|
{
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"dependents": [
|
|
276
276
|
"/src/adapters/fetch/index.ts"
|
|
277
277
|
],
|
|
278
|
-
"percent": 1.
|
|
278
|
+
"percent": 1.71,
|
|
279
279
|
"reduction": 2.17
|
|
280
280
|
},
|
|
281
281
|
{
|
|
@@ -331,6 +331,19 @@
|
|
|
331
331
|
"percent": 1.32,
|
|
332
332
|
"reduction": 19.47
|
|
333
333
|
},
|
|
334
|
+
{
|
|
335
|
+
"id": "/src/unstable-core-do-not-import/rpc/codes.ts",
|
|
336
|
+
"size": 1611,
|
|
337
|
+
"origSize": 2221,
|
|
338
|
+
"renderedExports": [
|
|
339
|
+
"TRPC_ERROR_CODES_BY_KEY",
|
|
340
|
+
"TRPC_ERROR_CODES_BY_NUMBER"
|
|
341
|
+
],
|
|
342
|
+
"removedExports": [],
|
|
343
|
+
"dependents": [],
|
|
344
|
+
"percent": 1.22,
|
|
345
|
+
"reduction": 27.47
|
|
346
|
+
},
|
|
334
347
|
{
|
|
335
348
|
"id": "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
336
349
|
"size": 1580,
|
|
@@ -355,19 +368,6 @@
|
|
|
355
368
|
"percent": 1.17,
|
|
356
369
|
"reduction": 26.94
|
|
357
370
|
},
|
|
358
|
-
{
|
|
359
|
-
"id": "/src/unstable-core-do-not-import/rpc/codes.ts",
|
|
360
|
-
"size": 1524,
|
|
361
|
-
"origSize": 2105,
|
|
362
|
-
"renderedExports": [
|
|
363
|
-
"TRPC_ERROR_CODES_BY_KEY",
|
|
364
|
-
"TRPC_ERROR_CODES_BY_NUMBER"
|
|
365
|
-
],
|
|
366
|
-
"removedExports": [],
|
|
367
|
-
"dependents": [],
|
|
368
|
-
"percent": 1.16,
|
|
369
|
-
"reduction": 27.6
|
|
370
|
-
},
|
|
371
371
|
{
|
|
372
372
|
"id": "/src/adapters/fastify/fastifyTRPCPlugin.ts",
|
|
373
373
|
"size": 1500,
|
|
@@ -384,8 +384,8 @@
|
|
|
384
384
|
},
|
|
385
385
|
{
|
|
386
386
|
"id": "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
387
|
-
"size":
|
|
388
|
-
"origSize":
|
|
387
|
+
"size": 1365,
|
|
388
|
+
"origSize": 1655,
|
|
389
389
|
"renderedExports": [
|
|
390
390
|
"getHTTPStatusCode",
|
|
391
391
|
"getHTTPStatusCodeFromError"
|
|
@@ -396,8 +396,8 @@
|
|
|
396
396
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
397
397
|
"/src/unstable-core-do-not-import/error/getErrorShape.ts"
|
|
398
398
|
],
|
|
399
|
-
"percent":
|
|
400
|
-
"reduction":
|
|
399
|
+
"percent": 1.04,
|
|
400
|
+
"reduction": 17.52
|
|
401
401
|
},
|
|
402
402
|
{
|
|
403
403
|
"id": "/src/unstable-core-do-not-import/utils.ts",
|
|
@@ -418,12 +418,12 @@
|
|
|
418
418
|
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
419
419
|
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
420
420
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
421
|
+
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
421
422
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
422
423
|
"/src/unstable-core-do-not-import/stream/sse.ts",
|
|
423
424
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
424
425
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
425
426
|
"/src/unstable-core-do-not-import/router.ts",
|
|
426
|
-
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
427
427
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
428
428
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
429
429
|
"/src/unstable-core-do-not-import/stream/jsonl.ts"
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
"/src/unstable-core-do-not-import.ts",
|
|
565
565
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
566
566
|
],
|
|
567
|
-
"percent": 0.
|
|
567
|
+
"percent": 0.47,
|
|
568
568
|
"reduction": 43.49
|
|
569
569
|
},
|
|
570
570
|
{
|
|
@@ -722,9 +722,9 @@
|
|
|
722
722
|
"reduction": 100
|
|
723
723
|
},
|
|
724
724
|
{
|
|
725
|
-
"id": "/src/
|
|
725
|
+
"id": "/src/rpc.ts",
|
|
726
726
|
"size": 0,
|
|
727
|
-
"origSize":
|
|
727
|
+
"origSize": 36,
|
|
728
728
|
"renderedExports": [],
|
|
729
729
|
"removedExports": [],
|
|
730
730
|
"dependents": [],
|
|
@@ -732,9 +732,9 @@
|
|
|
732
732
|
"reduction": 100
|
|
733
733
|
},
|
|
734
734
|
{
|
|
735
|
-
"id": "/src/
|
|
735
|
+
"id": "/src/shared.ts",
|
|
736
736
|
"size": 0,
|
|
737
|
-
"origSize":
|
|
737
|
+
"origSize": 653,
|
|
738
738
|
"renderedExports": [],
|
|
739
739
|
"removedExports": [],
|
|
740
740
|
"dependents": [],
|
|
@@ -742,9 +742,9 @@
|
|
|
742
742
|
"reduction": 100
|
|
743
743
|
},
|
|
744
744
|
{
|
|
745
|
-
"id": "/src/
|
|
745
|
+
"id": "/src/index.ts",
|
|
746
746
|
"size": 0,
|
|
747
|
-
"origSize":
|
|
747
|
+
"origSize": 32,
|
|
748
748
|
"renderedExports": [],
|
|
749
749
|
"removedExports": [],
|
|
750
750
|
"dependents": [],
|
|
@@ -814,8 +814,8 @@
|
|
|
814
814
|
"removedExports": [],
|
|
815
815
|
"dependents": [
|
|
816
816
|
"/src/adapters/express.ts",
|
|
817
|
-
"/src/adapters/next.ts",
|
|
818
817
|
"/src/adapters/standalone.ts",
|
|
818
|
+
"/src/adapters/next.ts",
|
|
819
819
|
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
820
820
|
],
|
|
821
821
|
"percent": 0,
|
|
@@ -3,7 +3,7 @@ export declare function getCauseFromUnknown(cause: unknown): Error | undefined;
|
|
|
3
3
|
export declare function getTRPCErrorFromUnknown(cause: unknown): TRPCError;
|
|
4
4
|
export declare class TRPCError extends Error {
|
|
5
5
|
readonly cause?: Error;
|
|
6
|
-
readonly code: "INTERNAL_SERVER_ERROR" | "PARSE_ERROR" | "BAD_REQUEST" | "NOT_IMPLEMENTED" | "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "
|
|
6
|
+
readonly code: "INTERNAL_SERVER_ERROR" | "PARSE_ERROR" | "BAD_REQUEST" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST";
|
|
7
7
|
constructor(opts: {
|
|
8
8
|
message?: string;
|
|
9
9
|
code: TRPC_ERROR_CODE_KEY;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TRPCError.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/error/TRPCError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMxD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAyBrE;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAoBjE;AAED,qBAAa,SAAU,SAAQ,KAAK;IAGlC,SAAyB,KAAK,CAAC,EAAE,KAAK,CAAC;IACvC,SAAgB,IAAI,
|
|
1
|
+
{"version":3,"file":"TRPCError.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/error/TRPCError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMxD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAyBrE;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAoBjE;AAED,qBAAa,SAAU,SAAQ,KAAK;IAGlC,SAAyB,KAAK,CAAC,EAAE,KAAK,CAAC;IACvC,SAAgB,IAAI,4XAAC;gBAET,IAAI,EAAE;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,mBAAmB,CAAC;QAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAgBF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHTTPStatusCode.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/getHTTPStatusCode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAA2B,YAAY,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"getHTTPStatusCode.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/getHTTPStatusCode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAA2B,YAAY,EAAE,MAAM,QAAQ,CAAC;AAiCpE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,MAAM,CAsB7E;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,UAE1D"}
|
|
@@ -7,8 +7,8 @@ const JSONRPC2_TO_HTTP_CODE = {
|
|
|
7
7
|
PARSE_ERROR: 400,
|
|
8
8
|
BAD_REQUEST: 400,
|
|
9
9
|
UNAUTHORIZED: 401,
|
|
10
|
-
NOT_FOUND: 404,
|
|
11
10
|
FORBIDDEN: 403,
|
|
11
|
+
NOT_FOUND: 404,
|
|
12
12
|
METHOD_NOT_SUPPORTED: 405,
|
|
13
13
|
TIMEOUT: 408,
|
|
14
14
|
CONFLICT: 409,
|
|
@@ -19,7 +19,10 @@ const JSONRPC2_TO_HTTP_CODE = {
|
|
|
19
19
|
TOO_MANY_REQUESTS: 429,
|
|
20
20
|
CLIENT_CLOSED_REQUEST: 499,
|
|
21
21
|
INTERNAL_SERVER_ERROR: 500,
|
|
22
|
-
NOT_IMPLEMENTED: 501
|
|
22
|
+
NOT_IMPLEMENTED: 501,
|
|
23
|
+
BAD_GATEWAY: 502,
|
|
24
|
+
SERVICE_UNAVAILABLE: 503,
|
|
25
|
+
GATEWAY_TIMEOUT: 504
|
|
23
26
|
};
|
|
24
27
|
function getStatusCodeFromKey(code) {
|
|
25
28
|
return JSONRPC2_TO_HTTP_CODE[code] ?? 500;
|
|
@@ -5,8 +5,8 @@ const JSONRPC2_TO_HTTP_CODE = {
|
|
|
5
5
|
PARSE_ERROR: 400,
|
|
6
6
|
BAD_REQUEST: 400,
|
|
7
7
|
UNAUTHORIZED: 401,
|
|
8
|
-
NOT_FOUND: 404,
|
|
9
8
|
FORBIDDEN: 403,
|
|
9
|
+
NOT_FOUND: 404,
|
|
10
10
|
METHOD_NOT_SUPPORTED: 405,
|
|
11
11
|
TIMEOUT: 408,
|
|
12
12
|
CONFLICT: 409,
|
|
@@ -17,7 +17,10 @@ const JSONRPC2_TO_HTTP_CODE = {
|
|
|
17
17
|
TOO_MANY_REQUESTS: 429,
|
|
18
18
|
CLIENT_CLOSED_REQUEST: 499,
|
|
19
19
|
INTERNAL_SERVER_ERROR: 500,
|
|
20
|
-
NOT_IMPLEMENTED: 501
|
|
20
|
+
NOT_IMPLEMENTED: 501,
|
|
21
|
+
BAD_GATEWAY: 502,
|
|
22
|
+
SERVICE_UNAVAILABLE: 503,
|
|
23
|
+
GATEWAY_TIMEOUT: 504
|
|
21
24
|
};
|
|
22
25
|
function getStatusCodeFromKey(code) {
|
|
23
26
|
return JSONRPC2_TO_HTTP_CODE[code] ?? 500;
|
|
@@ -17,6 +17,9 @@ export declare const TRPC_ERROR_CODES_BY_KEY: {
|
|
|
17
17
|
readonly BAD_REQUEST: -32600;
|
|
18
18
|
readonly INTERNAL_SERVER_ERROR: -32603;
|
|
19
19
|
readonly NOT_IMPLEMENTED: -32603;
|
|
20
|
+
readonly BAD_GATEWAY: -32603;
|
|
21
|
+
readonly SERVICE_UNAVAILABLE: -32603;
|
|
22
|
+
readonly GATEWAY_TIMEOUT: -32603;
|
|
20
23
|
readonly UNAUTHORIZED: -32001;
|
|
21
24
|
readonly FORBIDDEN: -32003;
|
|
22
25
|
readonly NOT_FOUND: -32004;
|
|
@@ -24,8 +27,8 @@ export declare const TRPC_ERROR_CODES_BY_KEY: {
|
|
|
24
27
|
readonly TIMEOUT: -32008;
|
|
25
28
|
readonly CONFLICT: -32009;
|
|
26
29
|
readonly PRECONDITION_FAILED: -32012;
|
|
27
|
-
readonly UNSUPPORTED_MEDIA_TYPE: -32015;
|
|
28
30
|
readonly PAYLOAD_TOO_LARGE: -32013;
|
|
31
|
+
readonly UNSUPPORTED_MEDIA_TYPE: -32015;
|
|
29
32
|
readonly UNPROCESSABLE_CONTENT: -32022;
|
|
30
33
|
readonly TOO_MANY_REQUESTS: -32029;
|
|
31
34
|
readonly CLIENT_CLOSED_REQUEST: -32099;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/rpc/codes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;IAClC;;;OAGG;;IAEH;;OAEG
|
|
1
|
+
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/rpc/codes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;IAClC;;;OAGG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;CAuBK,CAAC;AAEX,KAAK,YAAY,CAAC,MAAM,EAAE,KAAK,SAAS,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI;KACzE,CAAC,IAAI,MAAM,KAAK,GAAG,MAAM,SAAS,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CACxD,CAAC,MAAM,KAAK,CAAC,CAAC;AAEf,KAAK,MAAM,CAAC,KAAK,SAAS,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI;KAC3D,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC;CAC5D,CAAC;AAGF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAC7C,OAAO,uBAAuB,CAiB/B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,uBAAuB,CAAC"}
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
// Internal JSON-RPC error
|
|
18
18
|
INTERNAL_SERVER_ERROR: -32603,
|
|
19
19
|
NOT_IMPLEMENTED: -32603,
|
|
20
|
+
BAD_GATEWAY: -32603,
|
|
21
|
+
SERVICE_UNAVAILABLE: -32603,
|
|
22
|
+
GATEWAY_TIMEOUT: -32603,
|
|
20
23
|
// Implementation specific errors
|
|
21
24
|
UNAUTHORIZED: -32001,
|
|
22
25
|
FORBIDDEN: -32003,
|
|
@@ -25,8 +28,8 @@
|
|
|
25
28
|
TIMEOUT: -32008,
|
|
26
29
|
CONFLICT: -32009,
|
|
27
30
|
PRECONDITION_FAILED: -32012,
|
|
28
|
-
UNSUPPORTED_MEDIA_TYPE: -32015,
|
|
29
31
|
PAYLOAD_TOO_LARGE: -32013,
|
|
32
|
+
UNSUPPORTED_MEDIA_TYPE: -32015,
|
|
30
33
|
UNPROCESSABLE_CONTENT: -32022,
|
|
31
34
|
TOO_MANY_REQUESTS: -32029,
|
|
32
35
|
CLIENT_CLOSED_REQUEST: -32099
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
// Internal JSON-RPC error
|
|
16
16
|
INTERNAL_SERVER_ERROR: -32603,
|
|
17
17
|
NOT_IMPLEMENTED: -32603,
|
|
18
|
+
BAD_GATEWAY: -32603,
|
|
19
|
+
SERVICE_UNAVAILABLE: -32603,
|
|
20
|
+
GATEWAY_TIMEOUT: -32603,
|
|
18
21
|
// Implementation specific errors
|
|
19
22
|
UNAUTHORIZED: -32001,
|
|
20
23
|
FORBIDDEN: -32003,
|
|
@@ -23,8 +26,8 @@
|
|
|
23
26
|
TIMEOUT: -32008,
|
|
24
27
|
CONFLICT: -32009,
|
|
25
28
|
PRECONDITION_FAILED: -32012,
|
|
26
|
-
UNSUPPORTED_MEDIA_TYPE: -32015,
|
|
27
29
|
PAYLOAD_TOO_LARGE: -32013,
|
|
30
|
+
UNSUPPORTED_MEDIA_TYPE: -32015,
|
|
28
31
|
UNPROCESSABLE_CONTENT: -32022,
|
|
29
32
|
TOO_MANY_REQUESTS: -32029,
|
|
30
33
|
CLIENT_CLOSED_REQUEST: -32099
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-rc.
|
|
3
|
+
"version": "11.0.0-rc.456+a9a2c25b1",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"funding": [
|
|
150
150
|
"https://trpc.io/sponsor"
|
|
151
151
|
],
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "a9a2c25b1ead6113bde45bb26c627e3696fb61a8"
|
|
153
153
|
}
|
|
@@ -10,8 +10,8 @@ const JSONRPC2_TO_HTTP_CODE: Record<
|
|
|
10
10
|
PARSE_ERROR: 400,
|
|
11
11
|
BAD_REQUEST: 400,
|
|
12
12
|
UNAUTHORIZED: 401,
|
|
13
|
-
NOT_FOUND: 404,
|
|
14
13
|
FORBIDDEN: 403,
|
|
14
|
+
NOT_FOUND: 404,
|
|
15
15
|
METHOD_NOT_SUPPORTED: 405,
|
|
16
16
|
TIMEOUT: 408,
|
|
17
17
|
CONFLICT: 409,
|
|
@@ -23,6 +23,9 @@ const JSONRPC2_TO_HTTP_CODE: Record<
|
|
|
23
23
|
CLIENT_CLOSED_REQUEST: 499,
|
|
24
24
|
INTERNAL_SERVER_ERROR: 500,
|
|
25
25
|
NOT_IMPLEMENTED: 501,
|
|
26
|
+
BAD_GATEWAY: 502,
|
|
27
|
+
SERVICE_UNAVAILABLE: 503,
|
|
28
|
+
GATEWAY_TIMEOUT: 504,
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
function getStatusCodeFromKey(code: keyof typeof TRPC_ERROR_CODES_BY_KEY) {
|
|
@@ -20,8 +20,11 @@ export const TRPC_ERROR_CODES_BY_KEY = {
|
|
|
20
20
|
BAD_REQUEST: -32600, // 400
|
|
21
21
|
|
|
22
22
|
// Internal JSON-RPC error
|
|
23
|
-
INTERNAL_SERVER_ERROR: -32603,
|
|
24
|
-
NOT_IMPLEMENTED: -32603,
|
|
23
|
+
INTERNAL_SERVER_ERROR: -32603, // 500
|
|
24
|
+
NOT_IMPLEMENTED: -32603, // 501
|
|
25
|
+
BAD_GATEWAY: -32603, // 502
|
|
26
|
+
SERVICE_UNAVAILABLE: -32603, // 503
|
|
27
|
+
GATEWAY_TIMEOUT: -32603, // 504
|
|
25
28
|
|
|
26
29
|
// Implementation specific errors
|
|
27
30
|
UNAUTHORIZED: -32001, // 401
|
|
@@ -31,8 +34,8 @@ export const TRPC_ERROR_CODES_BY_KEY = {
|
|
|
31
34
|
TIMEOUT: -32008, // 408
|
|
32
35
|
CONFLICT: -32009, // 409
|
|
33
36
|
PRECONDITION_FAILED: -32012, // 412
|
|
34
|
-
UNSUPPORTED_MEDIA_TYPE: -32015, // 415
|
|
35
37
|
PAYLOAD_TOO_LARGE: -32013, // 413
|
|
38
|
+
UNSUPPORTED_MEDIA_TYPE: -32015, // 415
|
|
36
39
|
UNPROCESSABLE_CONTENT: -32022, // 422
|
|
37
40
|
TOO_MANY_REQUESTS: -32029, // 429
|
|
38
41
|
CLIENT_CLOSED_REQUEST: -32099, // 499
|