@trpc/server 11.0.0-next-beta.302 → 11.0.0-next-beta.304

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.
Files changed (55) hide show
  1. package/dist/adapters/aws-lambda/index.js +0 -1
  2. package/dist/adapters/aws-lambda/index.mjs +0 -1
  3. package/dist/adapters/aws-lambda/utils.js +0 -1
  4. package/dist/adapters/aws-lambda/utils.mjs +0 -1
  5. package/dist/adapters/fastify/fastifyRequestHandler.js +0 -1
  6. package/dist/adapters/fastify/fastifyRequestHandler.mjs +0 -1
  7. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
  8. package/dist/adapters/fastify/fastifyTRPCPlugin.js +3 -7
  9. package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +4 -8
  10. package/dist/adapters/fetch/fetchRequestHandler.js +0 -1
  11. package/dist/adapters/fetch/fetchRequestHandler.mjs +0 -1
  12. package/dist/adapters/next.js +0 -1
  13. package/dist/adapters/next.mjs +0 -1
  14. package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +1 -1
  15. package/dist/adapters/node-http/content-type/json/getPostBody.js +3 -4
  16. package/dist/adapters/node-http/content-type/json/getPostBody.mjs +3 -4
  17. package/dist/adapters/node-http/content-type/json/index.js +0 -1
  18. package/dist/adapters/node-http/content-type/json/index.mjs +0 -1
  19. package/dist/adapters/node-http/nodeHTTPRequestHandler.js +0 -1
  20. package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +0 -1
  21. package/dist/adapters/standalone.js +0 -1
  22. package/dist/adapters/standalone.mjs +0 -1
  23. package/dist/adapters/ws.d.ts +7 -5
  24. package/dist/adapters/ws.d.ts.map +1 -1
  25. package/dist/adapters/ws.js +14 -7
  26. package/dist/adapters/ws.mjs +14 -8
  27. package/dist/bundle-analysis.json +97 -98
  28. package/dist/http.js +0 -1
  29. package/dist/http.mjs +0 -1
  30. package/dist/index.js +0 -1
  31. package/dist/index.mjs +0 -1
  32. package/dist/shared.js +0 -1
  33. package/dist/shared.mjs +0 -1
  34. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +1 -1
  35. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +1 -1
  36. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +1 -1
  37. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +1 -0
  38. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +1 -0
  39. package/dist/unstable-core-do-not-import/rpc/codes.d.ts +8 -15
  40. package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +1 -1
  41. package/dist/unstable-core-do-not-import/rpc/codes.js +19 -3
  42. package/dist/unstable-core-do-not-import/rpc/codes.mjs +19 -3
  43. package/dist/unstable-core-do-not-import/utils.d.ts +0 -11
  44. package/dist/unstable-core-do-not-import/utils.d.ts.map +1 -1
  45. package/dist/unstable-core-do-not-import/utils.js +0 -11
  46. package/dist/unstable-core-do-not-import/utils.mjs +1 -11
  47. package/dist/unstable-core-do-not-import.js +0 -1
  48. package/dist/unstable-core-do-not-import.mjs +1 -1
  49. package/package.json +2 -2
  50. package/src/adapters/fastify/fastifyTRPCPlugin.ts +6 -7
  51. package/src/adapters/node-http/content-type/json/getPostBody.ts +6 -5
  52. package/src/adapters/ws.ts +37 -25
  53. package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +1 -0
  54. package/src/unstable-core-do-not-import/rpc/codes.ts +29 -2
  55. package/src/unstable-core-do-not-import/utils.ts +0 -21
@@ -1,20 +1,21 @@
1
1
  {
2
- "bundleSize": 92734,
3
- "bundleOrigSize": 147860,
4
- "bundleReduction": 37.28,
2
+ "bundleSize": 93191,
3
+ "bundleOrigSize": 148516,
4
+ "bundleReduction": 37.25,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/adapters/ws.ts",
8
- "size": 9970,
9
- "origSize": 9269,
8
+ "size": 10170,
9
+ "origSize": 9698,
10
10
  "renderedExports": [
11
+ "getWSConnectionHandler",
11
12
  "applyWSSHandler"
12
13
  ],
13
14
  "removedExports": [],
14
15
  "dependents": [
15
16
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
16
17
  ],
17
- "percent": 10.75,
18
+ "percent": 10.91,
18
19
  "reduction": 0
19
20
  },
20
21
  {
@@ -26,7 +27,7 @@
26
27
  ],
27
28
  "removedExports": [],
28
29
  "dependents": [],
29
- "percent": 10.12,
30
+ "percent": 10.07,
30
31
  "reduction": 21.23
31
32
  },
32
33
  {
@@ -45,7 +46,7 @@
45
46
  "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
46
47
  "/src/unstable-core-do-not-import/initTRPC.ts"
47
48
  ],
48
- "percent": 6.54,
49
+ "percent": 6.51,
49
50
  "reduction": 38.58
50
51
  },
51
52
  {
@@ -61,7 +62,7 @@
61
62
  "/src/unstable-core-do-not-import.ts",
62
63
  "/src/unstable-core-do-not-import/initTRPC.ts"
63
64
  ],
64
- "percent": 6.15,
65
+ "percent": 6.12,
65
66
  "reduction": 58.57
66
67
  },
67
68
  {
@@ -77,7 +78,7 @@
77
78
  "dependents": [
78
79
  "/src/adapters/node-http/content-type/form-data/index.ts"
79
80
  ],
80
- "percent": 5.37,
81
+ "percent": 5.34,
81
82
  "reduction": 36.77
82
83
  },
83
84
  {
@@ -91,7 +92,7 @@
91
92
  ],
92
93
  "removedExports": [],
93
94
  "dependents": [],
94
- "percent": 4.77,
95
+ "percent": 4.74,
95
96
  "reduction": 32.71
96
97
  },
97
98
  {
@@ -105,7 +106,7 @@
105
106
  "dependents": [
106
107
  "/src/adapters/node-http/index.ts"
107
108
  ],
108
- "percent": 4.24,
109
+ "percent": 4.22,
109
110
  "reduction": 13.56
110
111
  },
111
112
  {
@@ -119,7 +120,7 @@
119
120
  "dependents": [
120
121
  "/src/adapters/fetch/index.ts"
121
122
  ],
122
- "percent": 3.83,
123
+ "percent": 3.81,
123
124
  "reduction": 9.5
124
125
  },
125
126
  {
@@ -135,7 +136,7 @@
135
136
  "dependents": [
136
137
  "/src/observable/index.ts"
137
138
  ],
138
- "percent": 3.7,
139
+ "percent": 3.68,
139
140
  "reduction": 5.43
140
141
  },
141
142
  {
@@ -154,7 +155,7 @@
154
155
  "dependents": [
155
156
  "/src/adapters/aws-lambda/index.ts"
156
157
  ],
157
- "percent": 3.57,
158
+ "percent": 3.55,
158
159
  "reduction": 36.48
159
160
  },
160
161
  {
@@ -170,7 +171,7 @@
170
171
  "dependents": [
171
172
  "/src/observable/index.ts"
172
173
  ],
173
- "percent": 3.21,
174
+ "percent": 3.2,
174
175
  "reduction": 0
175
176
  },
176
177
  {
@@ -190,7 +191,7 @@
190
191
  "/src/unstable-core-do-not-import/router.ts",
191
192
  "/src/unstable-core-do-not-import/initTRPC.ts"
192
193
  ],
193
- "percent": 2.96,
194
+ "percent": 2.94,
194
195
  "reduction": 45.94
195
196
  },
196
197
  {
@@ -204,7 +205,7 @@
204
205
  "dependents": [
205
206
  "/src/unstable-core-do-not-import.ts"
206
207
  ],
207
- "percent": 2.94,
208
+ "percent": 2.93,
208
209
  "reduction": 39.13
209
210
  },
210
211
  {
@@ -224,7 +225,7 @@
224
225
  "/src/unstable-core-do-not-import/initTRPC.ts",
225
226
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
226
227
  ],
227
- "percent": 2.83,
228
+ "percent": 2.82,
228
229
  "reduction": 55.5
229
230
  },
230
231
  {
@@ -239,7 +240,7 @@
239
240
  "/src/adapters/fastify/index.ts",
240
241
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
241
242
  ],
242
- "percent": 2.79,
243
+ "percent": 2.78,
243
244
  "reduction": 35.33
244
245
  },
245
246
  {
@@ -251,7 +252,7 @@
251
252
  ],
252
253
  "removedExports": [],
253
254
  "dependents": [],
254
- "percent": 2.74,
255
+ "percent": 2.73,
255
256
  "reduction": 31.37
256
257
  },
257
258
  {
@@ -272,7 +273,7 @@
272
273
  "/src/unstable-core-do-not-import/middleware.ts",
273
274
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
274
275
  ],
275
- "percent": 1.87,
276
+ "percent": 1.86,
276
277
  "reduction": 19.47
277
278
  },
278
279
  {
@@ -286,23 +287,9 @@
286
287
  "dependents": [
287
288
  "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
288
289
  ],
289
- "percent": 1.77,
290
+ "percent": 1.76,
290
291
  "reduction": 34.79
291
292
  },
292
- {
293
- "id": "/src/adapters/fastify/fastifyTRPCPlugin.ts",
294
- "size": 1603,
295
- "origSize": 2343,
296
- "renderedExports": [
297
- "fastifyTRPCPlugin"
298
- ],
299
- "removedExports": [],
300
- "dependents": [
301
- "/src/adapters/fastify/index.ts"
302
- ],
303
- "percent": 1.73,
304
- "reduction": 31.58
305
- },
306
293
  {
307
294
  "id": "/src/adapters/next.ts",
308
295
  "size": 1602,
@@ -312,9 +299,23 @@
312
299
  ],
313
300
  "removedExports": [],
314
301
  "dependents": [],
315
- "percent": 1.73,
302
+ "percent": 1.72,
316
303
  "reduction": 29.12
317
304
  },
305
+ {
306
+ "id": "/src/adapters/node-http/content-type/json/getPostBody.ts",
307
+ "size": 1590,
308
+ "origSize": 1593,
309
+ "renderedExports": [
310
+ "getPostBody"
311
+ ],
312
+ "removedExports": [],
313
+ "dependents": [
314
+ "/src/adapters/node-http/content-type/json/index.ts"
315
+ ],
316
+ "percent": 1.71,
317
+ "reduction": 0.19
318
+ },
318
319
  {
319
320
  "id": "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
320
321
  "size": 1580,
@@ -328,18 +329,17 @@
328
329
  "reduction": 21.04
329
330
  },
330
331
  {
331
- "id": "/src/adapters/node-http/content-type/json/getPostBody.ts",
332
- "size": 1562,
333
- "origSize": 1547,
332
+ "id": "/src/unstable-core-do-not-import/rpc/codes.ts",
333
+ "size": 1524,
334
+ "origSize": 2105,
334
335
  "renderedExports": [
335
- "getPostBody"
336
+ "TRPC_ERROR_CODES_BY_KEY",
337
+ "TRPC_ERROR_CODES_BY_NUMBER"
336
338
  ],
337
339
  "removedExports": [],
338
- "dependents": [
339
- "/src/adapters/node-http/content-type/json/index.ts"
340
- ],
341
- "percent": 1.68,
342
- "reduction": 0
340
+ "dependents": [],
341
+ "percent": 1.64,
342
+ "reduction": 27.6
343
343
  },
344
344
  {
345
345
  "id": "/src/unstable-core-do-not-import/createProxy.ts",
@@ -355,9 +355,23 @@
355
355
  "/src/unstable-core-do-not-import/router.ts",
356
356
  "/src/unstable-core-do-not-import/initTRPC.ts"
357
357
  ],
358
- "percent": 1.63,
358
+ "percent": 1.62,
359
359
  "reduction": 5.58
360
360
  },
361
+ {
362
+ "id": "/src/adapters/fastify/fastifyTRPCPlugin.ts",
363
+ "size": 1486,
364
+ "origSize": 2263,
365
+ "renderedExports": [
366
+ "fastifyTRPCPlugin"
367
+ ],
368
+ "removedExports": [],
369
+ "dependents": [
370
+ "/src/adapters/fastify/index.ts"
371
+ ],
372
+ "percent": 1.59,
373
+ "reduction": 34.33
374
+ },
361
375
  {
362
376
  "id": "/src/adapters/node-http/content-type/form-data/streamSlice.ts",
363
377
  "size": 1393,
@@ -369,13 +383,13 @@
369
383
  "dependents": [
370
384
  "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts"
371
385
  ],
372
- "percent": 1.5,
386
+ "percent": 1.49,
373
387
  "reduction": 0
374
388
  },
375
389
  {
376
390
  "id": "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
377
- "size": 1233,
378
- "origSize": 1608,
391
+ "size": 1266,
392
+ "origSize": 1639,
379
393
  "renderedExports": [
380
394
  "getHTTPStatusCode",
381
395
  "getHTTPStatusCodeFromError"
@@ -385,28 +399,29 @@
385
399
  "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
386
400
  "/src/unstable-core-do-not-import/error/getErrorShape.ts"
387
401
  ],
388
- "percent": 1.33,
389
- "reduction": 23.32
402
+ "percent": 1.36,
403
+ "reduction": 22.76
390
404
  },
391
405
  {
392
- "id": "/src/unstable-core-do-not-import/rpc/codes.ts",
393
- "size": 1020,
394
- "origSize": 1325,
406
+ "id": "/src/unstable-core-do-not-import/parser.ts",
407
+ "size": 992,
408
+ "origSize": 2266,
395
409
  "renderedExports": [
396
- "TRPC_ERROR_CODES_BY_KEY",
397
- "TRPC_ERROR_CODES_BY_NUMBER"
410
+ "getParseFn"
398
411
  ],
399
412
  "removedExports": [],
400
- "dependents": [],
401
- "percent": 1.1,
402
- "reduction": 23.02
413
+ "dependents": [
414
+ "/src/unstable-core-do-not-import.ts",
415
+ "/src/unstable-core-do-not-import/procedureBuilder.ts"
416
+ ],
417
+ "percent": 1.06,
418
+ "reduction": 56.22
403
419
  },
404
420
  {
405
421
  "id": "/src/unstable-core-do-not-import/utils.ts",
406
- "size": 1006,
407
- "origSize": 1566,
422
+ "size": 815,
423
+ "origSize": 1016,
408
424
  "renderedExports": [
409
- "invert",
410
425
  "mergeWithoutOverrides",
411
426
  "isObject",
412
427
  "omitPrototype"
@@ -414,7 +429,6 @@
414
429
  "removedExports": [],
415
430
  "dependents": [
416
431
  "/src/unstable-core-do-not-import.ts",
417
- "/src/unstable-core-do-not-import/rpc/codes.ts",
418
432
  "/src/unstable-core-do-not-import/error/TRPCError.ts",
419
433
  "/src/unstable-core-do-not-import/router.ts",
420
434
  "/src/unstable-core-do-not-import/transformer.ts",
@@ -422,23 +436,8 @@
422
436
  "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
423
437
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
424
438
  ],
425
- "percent": 1.08,
426
- "reduction": 35.76
427
- },
428
- {
429
- "id": "/src/unstable-core-do-not-import/parser.ts",
430
- "size": 992,
431
- "origSize": 2266,
432
- "renderedExports": [
433
- "getParseFn"
434
- ],
435
- "removedExports": [],
436
- "dependents": [
437
- "/src/unstable-core-do-not-import.ts",
438
- "/src/unstable-core-do-not-import/procedureBuilder.ts"
439
- ],
440
- "percent": 1.07,
441
- "reduction": 56.22
439
+ "percent": 0.87,
440
+ "reduction": 19.78
442
441
  },
443
442
  {
444
443
  "id": "/src/adapters/node-http/content-type/form-data/uploadHandler.ts",
@@ -538,7 +537,7 @@
538
537
  ],
539
538
  "removedExports": [],
540
539
  "dependents": [],
541
- "percent": 0.37,
540
+ "percent": 0.36,
542
541
  "reduction": 71.37
543
542
  },
544
543
  {
@@ -593,7 +592,7 @@
593
592
  "/src/adapters/node-http/content-type/form-data/index.ts",
594
593
  "/src/adapters/node-http/content-type/json/index.ts"
595
594
  ],
596
- "percent": 0.13,
595
+ "percent": 0.12,
597
596
  "reduction": 86.68
598
597
  },
599
598
  {
@@ -658,9 +657,9 @@
658
657
  "reduction": 100
659
658
  },
660
659
  {
661
- "id": "/src/shared.ts",
660
+ "id": "/src/unstable-core-do-not-import.ts",
662
661
  "size": 0,
663
- "origSize": 653,
662
+ "origSize": 1552,
664
663
  "renderedExports": [],
665
664
  "removedExports": [],
666
665
  "dependents": [],
@@ -668,9 +667,9 @@
668
667
  "reduction": 100
669
668
  },
670
669
  {
671
- "id": "/src/unstable-core-do-not-import.ts",
670
+ "id": "/src/shared.ts",
672
671
  "size": 0,
673
- "origSize": 1552,
672
+ "origSize": 653,
674
673
  "renderedExports": [],
675
674
  "removedExports": [],
676
675
  "dependents": [],
@@ -700,26 +699,26 @@
700
699
  "reduction": 100
701
700
  },
702
701
  {
703
- "id": "/src/adapters/node-http/index.ts",
702
+ "id": "/src/adapters/fetch/index.ts",
704
703
  "size": 0,
705
- "origSize": 67,
704
+ "origSize": 64,
706
705
  "renderedExports": [],
707
706
  "removedExports": [],
708
- "dependents": [
709
- "/src/adapters/express.ts",
710
- "/src/adapters/standalone.ts",
711
- "/src/adapters/next.ts"
712
- ],
707
+ "dependents": [],
713
708
  "percent": 0,
714
709
  "reduction": 100
715
710
  },
716
711
  {
717
- "id": "/src/adapters/fetch/index.ts",
712
+ "id": "/src/adapters/node-http/index.ts",
718
713
  "size": 0,
719
- "origSize": 64,
714
+ "origSize": 67,
720
715
  "renderedExports": [],
721
716
  "removedExports": [],
722
- "dependents": [],
717
+ "dependents": [
718
+ "/src/adapters/next.ts",
719
+ "/src/adapters/express.ts",
720
+ "/src/adapters/standalone.ts"
721
+ ],
723
722
  "percent": 0,
724
723
  "reduction": 100
725
724
  }
package/dist/http.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var getHTTPStatusCode = require('./unstable-core-do-not-import/http/getHTTPStatusCode.js');
4
- require('./unstable-core-do-not-import/rpc/codes.js');
5
4
  var resolveHTTPResponse = require('./unstable-core-do-not-import/http/resolveHTTPResponse.js');
6
5
  var batchStreamFormatter = require('./unstable-core-do-not-import/http/batchStreamFormatter.js');
7
6
  var contentType = require('./unstable-core-do-not-import/http/contentType.js');
package/dist/http.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  export { getHTTPStatusCode, getHTTPStatusCodeFromError } from './unstable-core-do-not-import/http/getHTTPStatusCode.mjs';
2
- import './unstable-core-do-not-import/rpc/codes.mjs';
3
2
  export { resolveHTTPResponse } from './unstable-core-do-not-import/http/resolveHTTPResponse.mjs';
4
3
  export { getBatchStreamFormatter } from './unstable-core-do-not-import/http/batchStreamFormatter.mjs';
5
4
  export { getJsonContentTypeInputs } from './unstable-core-do-not-import/http/contentType.mjs';
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@
3
3
  var createProxy = require('./unstable-core-do-not-import/createProxy.js');
4
4
  var getErrorShape = require('./unstable-core-do-not-import/error/getErrorShape.js');
5
5
  var TRPCError = require('./unstable-core-do-not-import/error/TRPCError.js');
6
- require('./unstable-core-do-not-import/rpc/codes.js');
7
6
  var router = require('./unstable-core-do-not-import/router.js');
8
7
  var transformer = require('./unstable-core-do-not-import/transformer.js');
9
8
  var initTRPC = require('./unstable-core-do-not-import/initTRPC.js');
package/dist/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  export { createFlatProxy as createTRPCFlatProxy } from './unstable-core-do-not-import/createProxy.mjs';
2
2
  export { getErrorShape } from './unstable-core-do-not-import/error/getErrorShape.mjs';
3
3
  export { TRPCError, getTRPCErrorFromUnknown } from './unstable-core-do-not-import/error/TRPCError.mjs';
4
- import './unstable-core-do-not-import/rpc/codes.mjs';
5
4
  export { callProcedure, callProcedure as callTRPCProcedure } from './unstable-core-do-not-import/router.mjs';
6
5
  export { transformTRPCResponse } from './unstable-core-do-not-import/transformer.mjs';
7
6
  export { initTRPC } from './unstable-core-do-not-import/initTRPC.mjs';
package/dist/shared.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  var createProxy = require('./unstable-core-do-not-import/createProxy.js');
4
4
  var getErrorShape = require('./unstable-core-do-not-import/error/getErrorShape.js');
5
- require('./unstable-core-do-not-import/rpc/codes.js');
6
5
  require('./unstable-core-do-not-import/rootConfig.js');
7
6
 
8
7
 
package/dist/shared.mjs CHANGED
@@ -1,4 +1,3 @@
1
1
  export { createFlatProxy } from './unstable-core-do-not-import/createProxy.mjs';
2
2
  export { getErrorShape } from './unstable-core-do-not-import/error/getErrorShape.mjs';
3
- import './unstable-core-do-not-import/rpc/codes.mjs';
4
3
  import './unstable-core-do-not-import/rootConfig.mjs';
@@ -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" | "PAYLOAD_TOO_LARGE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST";
6
+ readonly code: "INTERNAL_SERVER_ERROR" | "PARSE_ERROR" | "BAD_REQUEST" | "NOT_IMPLEMENTED" | "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "UNSUPPORTED_MEDIA_TYPE" | "PAYLOAD_TOO_LARGE" | "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,qSAAC;gBAET,IAAI,EAAE;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,mBAAmB,CAAC;QAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAgBF"}
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,gUAAC;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":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAA2B,YAAY,EAAE,MAAM,QAAQ,CAAC;AA4BpE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,EAAE,OAyBpE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,UAE1D"}
1
+ {"version":3,"file":"getHTTPStatusCode.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/getHTTPStatusCode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAA2B,YAAY,EAAE,MAAM,QAAQ,CAAC;AA6BpE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,EAAE,OAyBpE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,UAE1D"}
@@ -13,6 +13,7 @@ const JSONRPC2_TO_HTTP_CODE = {
13
13
  CONFLICT: 409,
14
14
  PRECONDITION_FAILED: 412,
15
15
  PAYLOAD_TOO_LARGE: 413,
16
+ UNSUPPORTED_MEDIA_TYPE: 415,
16
17
  UNPROCESSABLE_CONTENT: 422,
17
18
  TOO_MANY_REQUESTS: 429,
18
19
  CLIENT_CLOSED_REQUEST: 499,
@@ -11,6 +11,7 @@ const JSONRPC2_TO_HTTP_CODE = {
11
11
  CONFLICT: 409,
12
12
  PRECONDITION_FAILED: 412,
13
13
  PAYLOAD_TOO_LARGE: 413,
14
+ UNSUPPORTED_MEDIA_TYPE: 415,
14
15
  UNPROCESSABLE_CONTENT: 422,
15
16
  TOO_MANY_REQUESTS: 429,
16
17
  CLIENT_CLOSED_REQUEST: 499,
@@ -24,27 +24,20 @@ export declare const TRPC_ERROR_CODES_BY_KEY: {
24
24
  readonly TIMEOUT: -32008;
25
25
  readonly CONFLICT: -32009;
26
26
  readonly PRECONDITION_FAILED: -32012;
27
+ readonly UNSUPPORTED_MEDIA_TYPE: -32015;
27
28
  readonly PAYLOAD_TOO_LARGE: -32013;
28
29
  readonly UNPROCESSABLE_CONTENT: -32022;
29
30
  readonly TOO_MANY_REQUESTS: -32029;
30
31
  readonly CLIENT_CLOSED_REQUEST: -32099;
31
32
  };
32
- export declare const TRPC_ERROR_CODES_BY_NUMBER: {
33
- [-32700]: "PARSE_ERROR";
34
- [-32600]: "BAD_REQUEST";
35
- [-32603]: "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED";
36
- [-32001]: "UNAUTHORIZED";
37
- [-32003]: "FORBIDDEN";
38
- [-32004]: "NOT_FOUND";
39
- [-32005]: "METHOD_NOT_SUPPORTED";
40
- [-32008]: "TIMEOUT";
41
- [-32009]: "CONFLICT";
42
- [-32012]: "PRECONDITION_FAILED";
43
- [-32013]: "PAYLOAD_TOO_LARGE";
44
- [-32022]: "UNPROCESSABLE_CONTENT";
45
- [-32029]: "TOO_MANY_REQUESTS";
46
- [-32099]: "CLIENT_CLOSED_REQUEST";
33
+ type KeyFromValue<TValue, TType extends Record<PropertyKey, PropertyKey>> = {
34
+ [K in keyof TType]: TValue extends TType[K] ? K : never;
35
+ }[keyof TType];
36
+ type Invert<TType extends Record<PropertyKey, PropertyKey>> = {
37
+ [TValue in TType[keyof TType]]: KeyFromValue<TValue, TType>;
47
38
  };
39
+ export declare const TRPC_ERROR_CODES_BY_NUMBER: Invert<typeof TRPC_ERROR_CODES_BY_KEY>;
48
40
  export type TRPC_ERROR_CODE_NUMBER = ValueOf<typeof TRPC_ERROR_CODES_BY_KEY>;
49
41
  export type TRPC_ERROR_CODE_KEY = keyof typeof TRPC_ERROR_CODES_BY_KEY;
42
+ export {};
50
43
  //# sourceMappingURL=codes.d.ts.map
@@ -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;AAKxC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;IAClC;;;OAGG;;IAEH;;OAEG;;;;;;;;;;;;;;;CAmBK,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;CAAkC,CAAC;AAE1E,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,uBAAuB,CAAC"}
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;;;;;;;;;;;;;;;;CAoBK,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"}
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var utils = require('../utils.js');
4
-
5
3
  // reference: https://www.jsonrpc.org/specification
6
4
  /**
7
5
  * JSON-RPC 2.0 Error codes
@@ -27,12 +25,30 @@ var utils = require('../utils.js');
27
25
  TIMEOUT: -32008,
28
26
  CONFLICT: -32009,
29
27
  PRECONDITION_FAILED: -32012,
28
+ UNSUPPORTED_MEDIA_TYPE: -32015,
30
29
  PAYLOAD_TOO_LARGE: -32013,
31
30
  UNPROCESSABLE_CONTENT: -32022,
32
31
  TOO_MANY_REQUESTS: -32029,
33
32
  CLIENT_CLOSED_REQUEST: -32099
34
33
  };
35
- const TRPC_ERROR_CODES_BY_NUMBER = utils.invert(TRPC_ERROR_CODES_BY_KEY);
34
+ // pure
35
+ const TRPC_ERROR_CODES_BY_NUMBER = {
36
+ [-32700]: 'PARSE_ERROR',
37
+ [-32600]: 'BAD_REQUEST',
38
+ [-32603]: 'INTERNAL_SERVER_ERROR',
39
+ [-32001]: 'UNAUTHORIZED',
40
+ [-32003]: 'FORBIDDEN',
41
+ [-32004]: 'NOT_FOUND',
42
+ [-32005]: 'METHOD_NOT_SUPPORTED',
43
+ [-32008]: 'TIMEOUT',
44
+ [-32009]: 'CONFLICT',
45
+ [-32012]: 'PRECONDITION_FAILED',
46
+ [-32013]: 'PAYLOAD_TOO_LARGE',
47
+ [-32015]: 'UNSUPPORTED_MEDIA_TYPE',
48
+ [-32022]: 'UNPROCESSABLE_CONTENT',
49
+ [-32029]: 'TOO_MANY_REQUESTS',
50
+ [-32099]: 'CLIENT_CLOSED_REQUEST'
51
+ };
36
52
 
37
53
  exports.TRPC_ERROR_CODES_BY_KEY = TRPC_ERROR_CODES_BY_KEY;
38
54
  exports.TRPC_ERROR_CODES_BY_NUMBER = TRPC_ERROR_CODES_BY_NUMBER;
@@ -1,5 +1,3 @@
1
- import { invert } from '../utils.mjs';
2
-
3
1
  // reference: https://www.jsonrpc.org/specification
4
2
  /**
5
3
  * JSON-RPC 2.0 Error codes
@@ -25,11 +23,29 @@ import { invert } from '../utils.mjs';
25
23
  TIMEOUT: -32008,
26
24
  CONFLICT: -32009,
27
25
  PRECONDITION_FAILED: -32012,
26
+ UNSUPPORTED_MEDIA_TYPE: -32015,
28
27
  PAYLOAD_TOO_LARGE: -32013,
29
28
  UNPROCESSABLE_CONTENT: -32022,
30
29
  TOO_MANY_REQUESTS: -32029,
31
30
  CLIENT_CLOSED_REQUEST: -32099
32
31
  };
33
- const TRPC_ERROR_CODES_BY_NUMBER = invert(TRPC_ERROR_CODES_BY_KEY);
32
+ // pure
33
+ const TRPC_ERROR_CODES_BY_NUMBER = {
34
+ [-32700]: 'PARSE_ERROR',
35
+ [-32600]: 'BAD_REQUEST',
36
+ [-32603]: 'INTERNAL_SERVER_ERROR',
37
+ [-32001]: 'UNAUTHORIZED',
38
+ [-32003]: 'FORBIDDEN',
39
+ [-32004]: 'NOT_FOUND',
40
+ [-32005]: 'METHOD_NOT_SUPPORTED',
41
+ [-32008]: 'TIMEOUT',
42
+ [-32009]: 'CONFLICT',
43
+ [-32012]: 'PRECONDITION_FAILED',
44
+ [-32013]: 'PAYLOAD_TOO_LARGE',
45
+ [-32015]: 'UNSUPPORTED_MEDIA_TYPE',
46
+ [-32022]: 'UNPROCESSABLE_CONTENT',
47
+ [-32029]: 'TOO_MANY_REQUESTS',
48
+ [-32099]: 'CLIENT_CLOSED_REQUEST'
49
+ };
34
50
 
35
51
  export { TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER };
@@ -1,13 +1,3 @@
1
- type KeyFromValue<TValue, TType extends Record<PropertyKey, PropertyKey>> = {
2
- [K in keyof TType]: TValue extends TType[K] ? K : never;
3
- }[keyof TType];
4
- type Invert<TType extends Record<PropertyKey, PropertyKey>> = {
5
- [TValue in TType[keyof TType]]: KeyFromValue<TValue, TType>;
6
- };
7
- /**
8
- * @internal
9
- */
10
- export declare function invert<TRecord extends Record<PropertyKey, PropertyKey>>(obj: TRecord): Invert<TRecord>;
11
1
  /**
12
2
  * Ensures there are no duplicate keys when building a procedure.
13
3
  * @internal
@@ -23,5 +13,4 @@ export declare function isObject(value: unknown): value is Record<string, unknow
23
13
  * @internal
24
14
  */
25
15
  export declare function omitPrototype<TObj extends Record<string, unknown>>(obj: TObj): TObj;
26
- export {};
27
16
  //# sourceMappingURL=utils.d.ts.map