@trpc/server 11.0.0-alpha-tmp-export-from-main-nuke-core.215 → 11.0.0-alpha-tmp-export-from-main.211

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 (207) hide show
  1. package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts +9 -0
  2. package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts.map +1 -0
  3. package/dist/@trpc-server/http.d.ts +1 -1
  4. package/dist/@trpc-server/http.d.ts.map +1 -1
  5. package/dist/@trpc-server.d.ts +3 -3
  6. package/dist/@trpc-server.d.ts.map +1 -1
  7. package/dist/adapters/aws-lambda/index.d.ts +1 -1
  8. package/dist/adapters/aws-lambda/index.js +7 -12
  9. package/dist/adapters/aws-lambda/index.mjs +3 -8
  10. package/dist/adapters/aws-lambda/utils.d.ts +1 -1
  11. package/dist/adapters/express.d.ts +1 -1
  12. package/dist/adapters/express.d.ts.map +1 -1
  13. package/dist/adapters/express.js +2 -8
  14. package/dist/adapters/express.mjs +2 -8
  15. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -1
  16. package/dist/adapters/fastify/index.js +4 -12
  17. package/dist/adapters/fastify/index.mjs +2 -10
  18. package/dist/adapters/fetch/fetchRequestHandler.d.ts +1 -1
  19. package/dist/adapters/fetch/index.js +4 -10
  20. package/dist/adapters/fetch/index.mjs +2 -8
  21. package/dist/adapters/fetch/types.d.ts +1 -1
  22. package/dist/adapters/next.d.ts +1 -1
  23. package/dist/adapters/next.js +5 -11
  24. package/dist/adapters/next.mjs +3 -9
  25. package/dist/adapters/node-http/content-type/json/index.js +3 -5
  26. package/dist/adapters/node-http/content-type/json/index.mjs +1 -3
  27. package/dist/adapters/node-http/index.js +2 -8
  28. package/dist/adapters/node-http/index.mjs +2 -8
  29. package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +1 -1
  30. package/dist/adapters/node-http/types.d.ts +2 -2
  31. package/dist/adapters/node-http/types.d.ts.map +1 -1
  32. package/dist/adapters/standalone.d.ts +1 -1
  33. package/dist/adapters/standalone.js +2 -8
  34. package/dist/adapters/standalone.mjs +2 -8
  35. package/dist/adapters/ws.d.ts +1 -2
  36. package/dist/adapters/ws.d.ts.map +1 -1
  37. package/dist/adapters/ws.js +26 -31
  38. package/dist/adapters/ws.mjs +1 -6
  39. package/dist/http.d.ts +6 -6
  40. package/dist/http.d.ts.map +1 -1
  41. package/dist/http.js +21 -12
  42. package/dist/http.mjs +1 -7
  43. package/dist/index.js +41 -15
  44. package/dist/index.mjs +1 -5
  45. package/dist/{nodeHTTPRequestHandler-257a3b5f.mjs → nodeHTTPRequestHandler-2d5c8791.mjs} +2 -4
  46. package/dist/{nodeHTTPRequestHandler-f4b7e374.js → nodeHTTPRequestHandler-55f05150.js} +4 -6
  47. package/dist/{nodeHTTPRequestHandler-29178135.js → nodeHTTPRequestHandler-7691fc79.js} +1 -3
  48. package/dist/observable.d.ts +2 -2
  49. package/dist/observable.d.ts.map +1 -1
  50. package/dist/observable.js +25 -9
  51. package/dist/observable.mjs +1 -3
  52. package/dist/rpc.d.ts +2 -2
  53. package/dist/rpc.d.ts.map +1 -1
  54. package/dist/rpc.js +13 -5
  55. package/dist/rpc.mjs +1 -2
  56. package/dist/shared.js +9 -4
  57. package/dist/shared.mjs +1 -2
  58. package/package.json +125 -53
  59. package/src/@trpc-core-unstable-do-not-import-this-please.ts +9 -0
  60. package/src/@trpc-server/http.ts +1 -2
  61. package/src/@trpc-server.ts +3 -3
  62. package/src/adapters/aws-lambda/index.ts +1 -1
  63. package/src/adapters/aws-lambda/utils.ts +1 -1
  64. package/src/adapters/express.ts +2 -1
  65. package/src/adapters/fastify/fastifyRequestHandler.ts +1 -1
  66. package/src/adapters/fastify/fastifyTRPCPlugin.ts +1 -1
  67. package/src/adapters/fetch/fetchRequestHandler.ts +1 -1
  68. package/src/adapters/fetch/types.ts +1 -1
  69. package/src/adapters/next.ts +1 -1
  70. package/src/adapters/node-http/nodeHTTPRequestHandler.ts +1 -1
  71. package/src/adapters/node-http/types.ts +3 -2
  72. package/src/adapters/standalone.ts +1 -1
  73. package/src/adapters/ws.ts +10 -9
  74. package/src/http.ts +6 -6
  75. package/src/observable.ts +2 -2
  76. package/src/rpc.ts +2 -2
  77. package/dist/TRPCError-10da405a.js +0 -61
  78. package/dist/TRPCError-14edcf88.mjs +0 -63
  79. package/dist/TRPCError-e2c8eb77.js +0 -67
  80. package/dist/batchStreamFormatter-1971db27.js +0 -32
  81. package/dist/batchStreamFormatter-378277dc.mjs +0 -30
  82. package/dist/batchStreamFormatter-4375dc8b.js +0 -31
  83. package/dist/bundle-analysis.json +0 -767
  84. package/dist/contentType-2ed02bef.mjs +0 -52
  85. package/dist/contentType-3a829011.js +0 -54
  86. package/dist/contentType-e4a2373e.js +0 -59
  87. package/dist/createProxy-0306dcaa.mjs +0 -121
  88. package/dist/createProxy-7e413449.js +0 -127
  89. package/dist/createProxy-dce0c414.js +0 -116
  90. package/dist/initTRPC-2cef03ab.js +0 -384
  91. package/dist/initTRPC-38faa18f.js +0 -371
  92. package/dist/initTRPC-fa1b3d57.mjs +0 -376
  93. package/dist/observable-2a5a96d5.js +0 -125
  94. package/dist/observable-62674916.js +0 -125
  95. package/dist/observable-6d025a37.mjs +0 -121
  96. package/dist/operators-0cc4956a.js +0 -99
  97. package/dist/operators-b08617cb.js +0 -103
  98. package/dist/operators-d0c3e794.mjs +0 -99
  99. package/dist/parseTRPCMessage-6e6c204e.js +0 -65
  100. package/dist/parseTRPCMessage-8eb0bbe9.mjs +0 -62
  101. package/dist/parseTRPCMessage-ebdfe3ca.js +0 -67
  102. package/dist/resolveHTTPResponse-833ca2b8.js +0 -265
  103. package/dist/resolveHTTPResponse-9322334c.mjs +0 -291
  104. package/dist/resolveHTTPResponse-d64c48e1.js +0 -293
  105. package/dist/rootConfig-3371c473.js +0 -89
  106. package/dist/rootConfig-571c9267.js +0 -94
  107. package/dist/rootConfig-6b04a6b8.mjs +0 -81
  108. package/dist/router-3344b52a.js +0 -262
  109. package/dist/router-919c37eb.js +0 -259
  110. package/dist/router-d6789e4b.mjs +0 -252
  111. package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts +0 -6
  112. package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts.map +0 -1
  113. package/dist/unstable-core-do-not-import/createProxy.d.ts +0 -19
  114. package/dist/unstable-core-do-not-import/createProxy.d.ts.map +0 -1
  115. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +0 -13
  116. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +0 -1
  117. package/dist/unstable-core-do-not-import/error/formatter.d.ts +0 -33
  118. package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +0 -1
  119. package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +0 -15
  120. package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +0 -1
  121. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts +0 -24
  122. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +0 -1
  123. package/dist/unstable-core-do-not-import/http/contentType.d.ts +0 -29
  124. package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +0 -1
  125. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +0 -5
  126. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +0 -1
  127. package/dist/unstable-core-do-not-import/http/index.d.ts +0 -7
  128. package/dist/unstable-core-do-not-import/http/index.d.ts.map +0 -1
  129. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +0 -51
  130. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +0 -1
  131. package/dist/unstable-core-do-not-import/http/types.d.ts +0 -96
  132. package/dist/unstable-core-do-not-import/http/types.d.ts.map +0 -1
  133. package/dist/unstable-core-do-not-import/index.d.ts +0 -35
  134. package/dist/unstable-core-do-not-import/index.d.ts.map +0 -1
  135. package/dist/unstable-core-do-not-import/index.js +0 -51
  136. package/dist/unstable-core-do-not-import/index.mjs +0 -11
  137. package/dist/unstable-core-do-not-import/initTRPC.d.ts +0 -96
  138. package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +0 -1
  139. package/dist/unstable-core-do-not-import/middleware.d.ts +0 -105
  140. package/dist/unstable-core-do-not-import/middleware.d.ts.map +0 -1
  141. package/dist/unstable-core-do-not-import/observable/index.d.ts +0 -5
  142. package/dist/unstable-core-do-not-import/observable/index.d.ts.map +0 -1
  143. package/dist/unstable-core-do-not-import/observable/observable.d.ts +0 -13
  144. package/dist/unstable-core-do-not-import/observable/observable.d.ts.map +0 -1
  145. package/dist/unstable-core-do-not-import/observable/operators.d.ts +0 -8
  146. package/dist/unstable-core-do-not-import/observable/operators.d.ts.map +0 -1
  147. package/dist/unstable-core-do-not-import/observable/types.d.ts +0 -26
  148. package/dist/unstable-core-do-not-import/observable/types.d.ts.map +0 -1
  149. package/dist/unstable-core-do-not-import/parser.d.ts +0 -30
  150. package/dist/unstable-core-do-not-import/parser.d.ts.map +0 -1
  151. package/dist/unstable-core-do-not-import/procedure.d.ts +0 -72
  152. package/dist/unstable-core-do-not-import/procedure.d.ts.map +0 -1
  153. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +0 -101
  154. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +0 -1
  155. package/dist/unstable-core-do-not-import/rootConfig.d.ts +0 -75
  156. package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +0 -1
  157. package/dist/unstable-core-do-not-import/router.d.ts +0 -85
  158. package/dist/unstable-core-do-not-import/router.d.ts.map +0 -1
  159. package/dist/unstable-core-do-not-import/rpc/codes.d.ts +0 -51
  160. package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +0 -1
  161. package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +0 -97
  162. package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +0 -1
  163. package/dist/unstable-core-do-not-import/rpc/index.d.ts +0 -5
  164. package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +0 -1
  165. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +0 -5
  166. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +0 -1
  167. package/dist/unstable-core-do-not-import/serialize.d.ts +0 -62
  168. package/dist/unstable-core-do-not-import/serialize.d.ts.map +0 -1
  169. package/dist/unstable-core-do-not-import/transformer.d.ts +0 -107
  170. package/dist/unstable-core-do-not-import/transformer.d.ts.map +0 -1
  171. package/dist/unstable-core-do-not-import/types.d.ts +0 -98
  172. package/dist/unstable-core-do-not-import/types.d.ts.map +0 -1
  173. package/dist/unstable-core-do-not-import/utils.d.ts +0 -31
  174. package/dist/unstable-core-do-not-import/utils.d.ts.map +0 -1
  175. package/src/unstable-core-do-not-import/TRPCInferrable.ts +0 -9
  176. package/src/unstable-core-do-not-import/createProxy.ts +0 -59
  177. package/src/unstable-core-do-not-import/error/TRPCError.ts +0 -82
  178. package/src/unstable-core-do-not-import/error/formatter.ts +0 -51
  179. package/src/unstable-core-do-not-import/error/getErrorShape.ts +0 -36
  180. package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +0 -29
  181. package/src/unstable-core-do-not-import/http/contentType.ts +0 -99
  182. package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +0 -57
  183. package/src/unstable-core-do-not-import/http/index.ts +0 -23
  184. package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +0 -458
  185. package/src/unstable-core-do-not-import/http/types.ts +0 -111
  186. package/src/unstable-core-do-not-import/index.ts +0 -108
  187. package/src/unstable-core-do-not-import/initTRPC.ts +0 -206
  188. package/src/unstable-core-do-not-import/middleware.ts +0 -233
  189. package/src/unstable-core-do-not-import/observable/index.ts +0 -10
  190. package/src/unstable-core-do-not-import/observable/observable.ts +0 -155
  191. package/src/unstable-core-do-not-import/observable/operators.ts +0 -119
  192. package/src/unstable-core-do-not-import/observable/types.ts +0 -76
  193. package/src/unstable-core-do-not-import/parser.ts +0 -94
  194. package/src/unstable-core-do-not-import/procedure.ts +0 -108
  195. package/src/unstable-core-do-not-import/procedureBuilder.ts +0 -458
  196. package/src/unstable-core-do-not-import/rootConfig.ts +0 -90
  197. package/src/unstable-core-do-not-import/router.ts +0 -370
  198. package/src/unstable-core-do-not-import/rpc/codes.ts +0 -44
  199. package/src/unstable-core-do-not-import/rpc/envelopes.ts +0 -136
  200. package/src/unstable-core-do-not-import/rpc/index.ts +0 -21
  201. package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +0 -85
  202. package/src/unstable-core-do-not-import/serialize.ts +0 -122
  203. package/src/unstable-core-do-not-import/transformer.ts +0 -202
  204. package/src/unstable-core-do-not-import/types.ts +0 -151
  205. package/src/unstable-core-do-not-import/utils.ts +0 -66
  206. package/unstable-core-do-not-import/index.d.ts +0 -1
  207. package/unstable-core-do-not-import/index.js +0 -1
@@ -1,75 +0,0 @@
1
- import type { ErrorFormatter } from './error/formatter';
2
- import type { TRPCErrorShape } from './rpc';
3
- /**
4
- * The initial generics that are used in the init function
5
- * @internal
6
- */
7
- export interface RootConfigTypes {
8
- ctx: object;
9
- meta: object;
10
- errorShape: unknown;
11
- transformer: unknown;
12
- }
13
- /**
14
- * The default check to see if we're in a server
15
- */
16
- export declare const isServerDefault: boolean;
17
- /**
18
- * The runtime config that are used and actually represents real values underneath
19
- * @internal
20
- */
21
- export interface RuntimeConfig<TTypes extends RootConfigTypes> {
22
- /**
23
- * Use a data transformer
24
- * @link https://trpc.io/docs/v11/data-transformers
25
- */
26
- transformer: TTypes['transformer'];
27
- /**
28
- * Use custom error formatting
29
- * @link https://trpc.io/docs/v11/error-formatting
30
- */
31
- errorFormatter: ErrorFormatter<TTypes['ctx'], TRPCErrorShape<number> & {
32
- [key: string]: any;
33
- }>;
34
- /**
35
- * Allow `@trpc/server` to run in non-server environments
36
- * @warning **Use with caution**, this should likely mainly be used within testing.
37
- * @default false
38
- */
39
- allowOutsideOfServer: boolean;
40
- /**
41
- * Is this a server environment?
42
- * @warning **Use with caution**, this should likely mainly be used within testing.
43
- * @default typeof window === 'undefined' || 'Deno' in window || process.env.NODE_ENV === 'test'
44
- */
45
- isServer: boolean;
46
- /**
47
- * Is this development?
48
- * Will be used to decide if the API should return stack traces
49
- * @default process.env.NODE_ENV !== 'production'
50
- */
51
- isDev: boolean;
52
- defaultMeta?: TTypes['meta'] extends object ? TTypes['meta'] : never;
53
- }
54
- /**
55
- * @internal
56
- */
57
- export type CreateRootConfigTypes<TGenerics extends RootConfigTypes> = TGenerics;
58
- /**
59
- * The config that is resolved after `initTRPC.create()` has been called
60
- * Combination of `InitTOptions` + `InitGenerics`
61
- * @internal
62
- */
63
- export interface RootConfig<TGenerics extends RootConfigTypes> extends RuntimeConfig<TGenerics> {
64
- $types: TGenerics;
65
- }
66
- /**
67
- * @internal
68
- */
69
- export type AnyRootConfig = RootConfig<{
70
- ctx: any;
71
- meta: any;
72
- errorShape: any;
73
- transformer: any;
74
- }>;
75
- //# sourceMappingURL=rootConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rootConfig.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/rootConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C;;;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,OAMmB,CAAC;AAElD;;;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;IAEf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;CACtE;AAED;;GAEG;AACH,MAAM,MAAM,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,MAAM,MAAM,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"}
@@ -1,85 +0,0 @@
1
- import type { AnyProcedure, inferProcedureInput, inferTransformedProcedureOutput, ProcedureArgs } from './procedure';
2
- import type { ProcedureCallOptions } from './procedureBuilder';
3
- import type { AnyRootConfig } from './rootConfig';
4
- import type { MaybePromise } from './types';
5
- /** @internal **/
6
- export type ProcedureRecord = Record<string, AnyProcedure>;
7
- export interface ProcedureRouterRecord {
8
- [key: string]: AnyProcedure | AnyRouter;
9
- }
10
- export interface RouterDef<TConfig extends AnyRootConfig, TRecord extends ProcedureRouterRecord> {
11
- _config: TConfig;
12
- router: true;
13
- procedure?: never;
14
- procedures: TRecord;
15
- record: TRecord;
16
- }
17
- export type AnyRouterDef<TConfig extends AnyRootConfig = AnyRootConfig> = RouterDef<TConfig, any>;
18
- type DecorateProcedure<TProcedure extends AnyProcedure> = (input: ProcedureArgs<TProcedure['_def']>[0]) => Promise<TProcedure['_def']['_output_out']>;
19
- /**
20
- * @internal
21
- */
22
- type DecoratedProcedureRecord<TProcedures extends ProcedureRouterRecord> = {
23
- [TKey in keyof TProcedures]: TProcedures[TKey] extends AnyRouter ? DecoratedProcedureRecord<TProcedures[TKey]['_def']['record']> : TProcedures[TKey] extends AnyProcedure ? DecorateProcedure<TProcedures[TKey]> : never;
24
- };
25
- /**
26
- * @internal
27
- */
28
- export type RouterCaller<TDef extends AnyRouterDef> = (
29
- /**
30
- * @note
31
- * If passing a function, we recommend it's a cached function
32
- * e.g. wrapped in `React.cache` to avoid unnecessary computations
33
- */
34
- ctx: TDef['_config']['$types']['ctx'] | (() => MaybePromise<TDef['_config']['$types']['ctx']>)) => DecoratedProcedureRecord<TDef['record']>;
35
- export interface Router<TDef extends AnyRouterDef> {
36
- _def: TDef;
37
- /**
38
- * @deprecated use `t.createCallerFactory(router)` instead
39
- * @link https://trpc.io/docs/v11/server/server-side-calls
40
- */
41
- createCaller: RouterCaller<TDef>;
42
- }
43
- export type AnyRouter = Router<AnyRouterDef>;
44
- type inferRouterDef<TRouter extends AnyRouter> = TRouter extends Router<infer TParams> ? TParams extends AnyRouterDef<any> ? TParams : never : never;
45
- type inferRouterConfig<TRouter extends AnyRouter> = inferRouterDef<TRouter>['_config'];
46
- export type inferRouterContext<TRouter extends AnyRouter> = inferRouterConfig<TRouter>['$types']['ctx'];
47
- export type inferRouterError<TRouter extends AnyRouter> = inferRouterConfig<TRouter>['$types']['errorShape'];
48
- export type inferRouterMeta<TRouter extends AnyRouter> = inferRouterConfig<TRouter>['$types']['meta'];
49
- type GetInferenceHelpers<TType extends 'input' | 'output', TRouter extends AnyRouter> = {
50
- [TKey in keyof TRouter['_def']['record']]: TRouter['_def']['record'][TKey] extends infer TRouterOrProcedure ? TRouterOrProcedure extends AnyRouter ? GetInferenceHelpers<TType, TRouterOrProcedure> : TRouterOrProcedure extends AnyProcedure ? TType extends 'input' ? inferProcedureInput<TRouterOrProcedure> : inferTransformedProcedureOutput<TRouter['_def']['_config'], TRouterOrProcedure> : never : never;
51
- };
52
- export type inferRouterInputs<TRouter extends AnyRouter> = GetInferenceHelpers<'input', TRouter>;
53
- export type inferRouterOutputs<TRouter extends AnyRouter> = GetInferenceHelpers<'output', TRouter>;
54
- /**
55
- * @internal
56
- */
57
- export type CreateRouterInner<TConfig extends AnyRootConfig, TProcRouterRecord extends ProcedureRouterRecord> = Router<RouterDef<TConfig, TProcRouterRecord>> &
58
- /**
59
- * This adds ability to call procedures directly but is primarily used for quick access in type inference
60
- */
61
- TProcRouterRecord;
62
- /**
63
- * @internal
64
- */
65
- export declare function createRouterFactory<TConfig extends AnyRootConfig>(config: TConfig): <TProcRouterRecord extends ProcedureRouterRecord>(procedures: TProcRouterRecord) => CreateRouterInner<TConfig, TProcRouterRecord>;
66
- /**
67
- * @internal
68
- */
69
- export declare function callProcedure(opts: ProcedureCallOptions & {
70
- procedures: ProcedureRouterRecord;
71
- }): Promise<unknown>;
72
- export declare function createCallerFactory<TConfig extends AnyRootConfig>(): <TRouter extends Router<AnyRouterDef<TConfig>>>(router: TRouter) => RouterCaller<TRouter["_def"]>;
73
- /** @internal */
74
- type MergeRouters<TRouters extends AnyRouter[], TRouterDef extends AnyRouterDef = RouterDef<TRouters[0]['_def']['_config'], {}>> = TRouters extends [
75
- infer Head extends AnyRouter,
76
- ...infer Tail extends AnyRouter[]
77
- ] ? MergeRouters<Tail, {
78
- _config: TRouterDef['_config'];
79
- router: true;
80
- procedures: Head['_def']['procedures'] & TRouterDef['procedures'];
81
- record: Head['_def']['record'] & TRouterDef['record'];
82
- }> : Router<TRouterDef> & TRouterDef['record'];
83
- export declare function mergeRouters<TRouters extends AnyRouter[]>(...routerList: [...TRouters]): MergeRouters<TRouters>;
84
- export {};
85
- //# sourceMappingURL=router.d.ts.map
@@ -1 +0,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CAAA;CAAE,oBAYnE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,SAAS,aAAa,uGAkChE;AAED,gBAAgB;AAChB,KAAK,YAAY,CACf,QAAQ,SAAS,SAAS,EAAE,EAC5B,UAAU,SAAS,YAAY,GAAG,SAAS,CACzC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAE9B,EAAE,CACH,IACC,QAAQ,SAAS;IACnB,MAAM,IAAI,SAAS,SAAS;IAC5B,GAAG,MAAM,IAAI,SAAS,SAAS,EAAE;CAClC,GACG,YAAY,CACV,IAAI,EACJ;IACE,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,MAAM,EAAE,IAAI,CAAC;IACb,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IAClE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;CACvD,CACF,GACD,MAAM,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAE9C,wBAAgB,YAAY,CAAC,QAAQ,SAAS,SAAS,EAAE,EACvD,GAAG,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,GAC3B,YAAY,CAAC,QAAQ,CAAC,CAmDxB"}
@@ -1,51 +0,0 @@
1
- /**
2
- * JSON-RPC 2.0 Error codes
3
- *
4
- * `-32000` to `-32099` are reserved for implementation-defined server-errors.
5
- * For tRPC we're copying the last digits of HTTP 4XX errors.
6
- */
7
- export declare const TRPC_ERROR_CODES_BY_KEY: {
8
- /**
9
- * Invalid JSON was received by the server.
10
- * An error occurred on the server while parsing the JSON text.
11
- */
12
- readonly PARSE_ERROR: -32700;
13
- /**
14
- * The JSON sent is not a valid Request object.
15
- */
16
- readonly BAD_REQUEST: -32600;
17
- readonly INTERNAL_SERVER_ERROR: -32603;
18
- readonly NOT_IMPLEMENTED: -32603;
19
- readonly UNAUTHORIZED: -32001;
20
- readonly FORBIDDEN: -32003;
21
- readonly NOT_FOUND: -32004;
22
- readonly METHOD_NOT_SUPPORTED: -32005;
23
- readonly TIMEOUT: -32008;
24
- readonly CONFLICT: -32009;
25
- readonly PRECONDITION_FAILED: -32012;
26
- readonly PAYLOAD_TOO_LARGE: -32013;
27
- readonly UNPROCESSABLE_CONTENT: -32022;
28
- readonly TOO_MANY_REQUESTS: -32029;
29
- readonly CLIENT_CLOSED_REQUEST: -32099;
30
- };
31
- export declare const TRPC_ERROR_CODES_BY_NUMBER: {
32
- [-32700]: "PARSE_ERROR";
33
- [-32600]: "BAD_REQUEST";
34
- [-32603]: "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED";
35
- [-32001]: "UNAUTHORIZED";
36
- [-32003]: "FORBIDDEN";
37
- [-32004]: "NOT_FOUND";
38
- [-32005]: "METHOD_NOT_SUPPORTED";
39
- [-32008]: "TIMEOUT";
40
- [-32009]: "CONFLICT";
41
- [-32012]: "PRECONDITION_FAILED";
42
- [-32013]: "PAYLOAD_TOO_LARGE";
43
- [-32022]: "UNPROCESSABLE_CONTENT";
44
- [-32029]: "TOO_MANY_REQUESTS";
45
- [-32099]: "CLIENT_CLOSED_REQUEST";
46
- };
47
- type ValueOf<TObj> = TObj[keyof TObj];
48
- export type TRPC_ERROR_CODE_NUMBER = ValueOf<typeof TRPC_ERROR_CODES_BY_KEY>;
49
- export type TRPC_ERROR_CODE_KEY = keyof typeof TRPC_ERROR_CODES_BY_KEY;
50
- export {};
51
- //# sourceMappingURL=codes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/rpc/codes.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;IAClC;;;OAGG;;IAEH;;OAEG;;;;;;;;;;;;;;;CAmBK,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;CAAkC,CAAC;AAE1E,KAAK,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;AACtC,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,uBAAuB,CAAC"}
@@ -1,97 +0,0 @@
1
- import type { ProcedureType } from '../procedure';
2
- import type { TRPC_ERROR_CODE_NUMBER } from './codes';
3
- /**
4
- * Error response
5
- */
6
- export interface TRPCErrorShape<TCode extends number = TRPC_ERROR_CODE_NUMBER, TData extends Record<string, unknown> = Record<string, unknown>> {
7
- code: TCode;
8
- message: string;
9
- data: TData;
10
- }
11
- /**
12
- * JSON-RPC 2.0 Specification
13
- */
14
- export declare namespace JSONRPC2 {
15
- type RequestId = number | string | null;
16
- /**
17
- * All requests/responses extends this shape
18
- */
19
- interface BaseEnvelope {
20
- id?: RequestId;
21
- jsonrpc?: '2.0';
22
- }
23
- interface BaseRequest<TMethod extends string = string> extends BaseEnvelope {
24
- method: TMethod;
25
- }
26
- interface Request<TMethod extends string = string, TParams = unknown> extends BaseRequest<TMethod> {
27
- params: TParams;
28
- }
29
- interface ResultResponse<TResult = unknown> extends BaseEnvelope {
30
- result: TResult;
31
- }
32
- interface ErrorResponse<TError extends TRPCErrorShape = TRPCErrorShape> extends BaseEnvelope {
33
- error: TError;
34
- }
35
- }
36
- export interface TRPCRequest extends JSONRPC2.Request<ProcedureType, {
37
- path: string;
38
- input: unknown;
39
- }> {
40
- }
41
- export interface TRPCResult<TData = unknown> {
42
- data: TData;
43
- }
44
- export interface TRPCSuccessResponse<TData> extends JSONRPC2.ResultResponse<TRPCResult<TData> & {
45
- type?: 'data';
46
- }> {
47
- }
48
- export interface TRPCErrorResponse<TError extends TRPCErrorShape = TRPCErrorShape> extends JSONRPC2.ErrorResponse<TError> {
49
- }
50
- export type TRPCResponse<TData = unknown, TError extends TRPCErrorShape = TRPCErrorShape> = TRPCErrorResponse<TError> | TRPCSuccessResponse<TData>;
51
- export type TRPCRequestMessage = TRPCRequest & {
52
- id: JSONRPC2.RequestId;
53
- };
54
- /**
55
- * The client asked the server to unsubscribe
56
- */
57
- export interface TRPCSubscriptionStopNotification extends JSONRPC2.BaseRequest<'subscription.stop'> {
58
- id: null;
59
- }
60
- /**
61
- * The client's outgoing request types
62
- */
63
- export type TRPCClientOutgoingRequest = TRPCSubscriptionStopNotification;
64
- /**
65
- * The client's sent messages shape
66
- */
67
- export type TRPCClientOutgoingMessage = TRPCRequestMessage | (JSONRPC2.BaseRequest<'subscription.stop'> & {
68
- id: JSONRPC2.RequestId;
69
- });
70
- export interface TRPCResultMessage<TData> extends JSONRPC2.ResultResponse<{
71
- type: 'started';
72
- data?: never;
73
- } | {
74
- type: 'stopped';
75
- data?: never;
76
- } | (TRPCResult<TData> & {
77
- type: 'data';
78
- })> {
79
- }
80
- export type TRPCResponseMessage<TData = unknown, TError extends TRPCErrorShape = TRPCErrorShape> = {
81
- id: JSONRPC2.RequestId;
82
- } & (TRPCErrorResponse<TError> | TRPCResultMessage<TData>);
83
- /**
84
- * The server asked the client to reconnect - useful when restarting/redeploying service
85
- */
86
- export interface TRPCReconnectNotification extends JSONRPC2.BaseRequest<'reconnect'> {
87
- id: JSONRPC2.RequestId;
88
- }
89
- /**
90
- * The client's incoming request types
91
- */
92
- export type TRPCClientIncomingRequest = TRPCReconnectNotification;
93
- /**
94
- * The client's received messages shape
95
- */
96
- export type TRPCClientIncomingMessage<TResult = unknown, TError extends TRPCErrorShape = TRPCErrorShape> = TRPCClientIncomingRequest | TRPCResponseMessage<TResult, TError>;
97
- //# sourceMappingURL=envelopes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"envelopes.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/rpc/envelopes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,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;CAAG;AAEN,MAAM,MAAM,mBAAmB,CAC7B,KAAK,GAAG,OAAO,EACf,MAAM,SAAS,cAAc,GAAG,cAAc,IAC5C;IAAE,EAAE,EAAE,QAAQ,CAAC,SAAS,CAAA;CAAE,GAAG,CAC7B,iBAAiB,CAAC,MAAM,CAAC,GACzB,iBAAiB,CAAC,KAAK,CAAC,CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,yBACf,SAAQ,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC;IACzC,EAAE,EAAE,QAAQ,CAAC,SAAS,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,yBAAyB,CACnC,OAAO,GAAG,OAAO,EACjB,MAAM,SAAS,cAAc,GAAG,cAAc,IAC5C,yBAAyB,GAAG,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export { TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER } from './codes';
2
- export type { TRPC_ERROR_CODE_KEY, TRPC_ERROR_CODE_NUMBER } from './codes';
3
- export type { JSONRPC2, TRPCClientIncomingMessage, TRPCClientIncomingRequest, TRPCClientOutgoingMessage, TRPCClientOutgoingRequest, TRPCErrorResponse, TRPCErrorShape, TRPCReconnectNotification, TRPCRequest, TRPCRequestMessage, TRPCResponse, TRPCResponseMessage, TRPCResult, TRPCResultMessage, TRPCSubscriptionStopNotification, TRPCSuccessResponse, } from './envelopes';
4
- export { parseTRPCMessage } from './parseTRPCMessage';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC9E,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAC3E,YAAY,EACV,QAAQ,EACR,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,yBAAyB,EACzB,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,gCAAgC,EAChC,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { CombinedDataTransformer } from '../transformer';
2
- import type { TRPCClientOutgoingMessage } from './envelopes';
3
- /** @public */
4
- export declare function parseTRPCMessage(obj: unknown, transformer: CombinedDataTransformer): TRPCClientOutgoingMessage;
5
- //# sourceMappingURL=parseTRPCMessage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseTRPCMessage.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AA8C7D,cAAc;AACd,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,uBAAuB,GACnC,yBAAyB,CA+B3B"}
@@ -1,62 +0,0 @@
1
- import type { Simplify, WithoutIndexSignature } from './types';
2
- /**
3
- * @link https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
4
- */
5
- type JsonPrimitive = boolean | number | string | null;
6
- type NonJsonPrimitive = Function | symbol | undefined;
7
- type IsAny<T> = 0 extends T & 1 ? true : false;
8
- type JsonReturnable = JsonPrimitive | undefined;
9
- type IsRecord<T extends object> = keyof WithoutIndexSignature<T> extends never ? true : false;
10
- export type Serialize<T> = IsAny<T> extends true ? any : unknown extends T ? unknown : T extends JsonReturnable ? T : T extends Map<any, any> | Set<any> ? object : T extends NonJsonPrimitive ? never : T extends {
11
- toJSON(): infer U;
12
- } ? U : T extends [] ? [] : T extends [unknown, ...unknown[]] ? SerializeTuple<T> : T extends readonly (infer U)[] ? (U extends NonJsonPrimitive ? null : Serialize<U>)[] : T extends object ? IsRecord<T> extends true ? Record<keyof T, Serialize<T[keyof T]>> : Simplify<SerializeObject<UndefinedToOptional<T>>> : never;
13
- /** JSON serialize [tuples](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) */
14
- type SerializeTuple<T extends [unknown, ...unknown[]]> = {
15
- [K in keyof T]: T[K] extends NonJsonPrimitive ? null : Serialize<T[K]>;
16
- };
17
- type SerializeObjectKey<T extends Record<any, any>, K> = K extends symbol ? never : IsAny<T[K]> extends true ? K : unknown extends T[K] ? K : T[K] extends NonJsonPrimitive ? never : K;
18
- /**
19
- * JSON serialize objects (not including arrays) and classes
20
- * @internal
21
- **/
22
- export type SerializeObject<T extends object> = {
23
- [K in keyof T as SerializeObjectKey<T, K>]: Serialize<T[K]>;
24
- };
25
- /**
26
- * Extract keys from T where the value dosen't extend undefined
27
- * Note: Can't parse IndexSignature or Record types
28
- */
29
- type FilterDefinedKeys<T extends object> = Exclude<{
30
- [K in keyof T]: undefined extends T[K] ? never : K;
31
- }[keyof T], undefined>;
32
- /**
33
- * Get value of exactOptionalPropertyTypes config
34
- */
35
- type ExactOptionalPropertyTypes = {
36
- a?: 0 | undefined;
37
- } extends {
38
- a?: 0;
39
- } ? false : true;
40
- /**
41
- * Check if T has an index signature
42
- */
43
- type HasIndexSignature<T extends object> = string extends keyof T ? true : false;
44
- /**
45
- * { [key: string]: number | undefined } --> { [key: string]: number }
46
- */
47
- type HandleIndexSignature<T extends object> = {
48
- [K in keyof Omit<T, keyof WithoutIndexSignature<T>>]: Exclude<T[K], undefined>;
49
- };
50
- /**
51
- * { a: number | undefined } --> { a?: number }
52
- * Note: Can't parse IndexSignature or Record types
53
- */
54
- type HandleUndefined<T extends object> = {
55
- [K in keyof Omit<T, FilterDefinedKeys<T>>]?: Exclude<T[K], undefined>;
56
- };
57
- /**
58
- * Handle undefined, index signature and records
59
- */
60
- type UndefinedToOptional<T extends object> = Pick<WithoutIndexSignature<T>, FilterDefinedKeys<WithoutIndexSignature<T>>> & (ExactOptionalPropertyTypes extends true ? HandleIndexSignature<T> & HandleUndefined<WithoutIndexSignature<T>> : HasIndexSignature<T> extends true ? HandleIndexSignature<T> : HandleUndefined<T>);
61
- export {};
62
- //# sourceMappingURL=serialize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/serialize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE/D;;GAEG;AACH,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAEtD,KAAK,gBAAgB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAKtD,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAK/C,KAAK,cAAc,GAAG,aAAa,GAAG,SAAS,CAAC;AAEhD,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,qBAAqB,CAAC,CAAC,CAAC,SAAS,KAAK,GAC1E,IAAI,GACJ,KAAK,CAAC;AAGV,MAAM,MAAM,SAAS,CAAC,CAAC,IACrB,KAAK,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,GAAG,GAC3B,OAAO,SAAS,CAAC,GAAG,OAAO,GAC3B,CAAC,SAAS,cAAc,GAAG,CAAC,GAC5B,CAAC,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,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AAE,iBAAiB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,GAEzE,CAAC,0BAA0B,SAAS,IAAI,GACpC,oBAAoB,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,GACnE,iBAAiB,CAAC,CAAC,CAAC,SAAS,IAAI,GACjC,oBAAoB,CAAC,CAAC,CAAC,GACvB,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -1,107 +0,0 @@
1
- import type { AnyRootConfig } from './rootConfig';
2
- import type { AnyRouter, inferRouterError } from './router';
3
- import type { TRPCResponse, TRPCResponseMessage, TRPCResultMessage } from './rpc';
4
- /**
5
- * @public
6
- */
7
- export interface DataTransformer {
8
- serialize: (object: any) => any;
9
- deserialize: (object: any) => any;
10
- }
11
- interface InputDataTransformer extends DataTransformer {
12
- /**
13
- * This function runs **on the client** before sending the data to the server.
14
- */
15
- serialize: (object: any) => any;
16
- /**
17
- * This function runs **on the server** to transform the data before it is passed to the resolver
18
- */
19
- deserialize: (object: any) => any;
20
- }
21
- interface OutputDataTransformer extends DataTransformer {
22
- /**
23
- * This function runs **on the server** before sending the data to the client.
24
- */
25
- serialize: (object: any) => any;
26
- /**
27
- * This function runs **only on the client** to transform the data sent from the server.
28
- */
29
- deserialize: (object: any) => any;
30
- }
31
- /**
32
- * @public
33
- */
34
- export interface CombinedDataTransformer {
35
- /**
36
- * Specify how the data sent from the client to the server should be transformed.
37
- */
38
- input: InputDataTransformer;
39
- /**
40
- * Specify how the data sent from the server to the client should be transformed.
41
- */
42
- output: OutputDataTransformer;
43
- }
44
- /**
45
- * @public
46
- */
47
- export type CombinedDataTransformerClient = {
48
- input: Pick<CombinedDataTransformer['input'], 'serialize'>;
49
- output: Pick<CombinedDataTransformer['output'], 'deserialize'>;
50
- };
51
- /**
52
- * @public
53
- */
54
- export type DataTransformerOptions = CombinedDataTransformer | DataTransformer;
55
- /**
56
- * @internal
57
- */
58
- export declare function getDataTransformer(transformer: DataTransformerOptions): CombinedDataTransformer;
59
- /**
60
- * @internal
61
- */
62
- export type DefaultDataTransformer = CombinedDataTransformer & {
63
- _default: true;
64
- };
65
- /**
66
- * @internal
67
- */
68
- export declare const defaultTransformer: DefaultDataTransformer;
69
- /**
70
- * Takes a unserialized `TRPCResponse` and serializes it with the router's transformers
71
- **/
72
- export declare function transformTRPCResponse<TResponse extends TRPCResponse | TRPCResponse[] | TRPCResponseMessage | TRPCResponseMessage[]>(config: AnyRootConfig, itemOrItems: TResponse): import("./rpc").TRPCErrorResponse<import("./rpc").TRPCErrorShape<import("./rpc").TRPC_ERROR_CODE_NUMBER, Record<string, unknown>>> | import("./rpc").TRPCSuccessResponse<unknown> | ({
73
- id: import("./rpc").JSONRPC2.RequestId;
74
- } & TRPCResultMessage<unknown>) | (TRPCResponse | TRPCResponseMessage)[];
75
- /** @internal */
76
- declare function transformResultInner<TRouter extends AnyRouter, TOutput>(response: TRPCResponse<TOutput, inferRouterError<TRouter>> | TRPCResponseMessage<TOutput, inferRouterError<TRouter>>, transformer: DataTransformer): {
77
- readonly ok: false;
78
- readonly error: {
79
- readonly error: inferRouterError<TRouter>;
80
- readonly id?: import("./rpc").JSONRPC2.RequestId | undefined;
81
- readonly jsonrpc?: "2.0" | undefined;
82
- } | {
83
- readonly error: inferRouterError<TRouter>;
84
- readonly id: string | number | null;
85
- readonly jsonrpc?: "2.0" | undefined;
86
- };
87
- readonly result?: undefined;
88
- } | {
89
- readonly ok: true;
90
- readonly result: {
91
- type: "started";
92
- data?: undefined;
93
- } | {
94
- type: "stopped";
95
- data?: undefined;
96
- } | (import("./rpc").TRPCResult<TOutput> & {
97
- type: "data";
98
- });
99
- readonly error?: undefined;
100
- };
101
- /**
102
- * Transforms and validates that the result is a valid TRPCResponse
103
- * @internal
104
- */
105
- export declare function transformResult<TRouter extends AnyRouter, TOutput>(response: TRPCResponse<TOutput, inferRouterError<TRouter>> | TRPCResponseMessage<TOutput, inferRouterError<TRouter>>, transformer: DataTransformer): ReturnType<typeof transformResultInner>;
106
- export {};
107
- //# sourceMappingURL=transformer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/transformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,OAAO,CAAC;AAGf;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAChC,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;CACnC;AAED,UAAU,oBAAqB,SAAQ,eAAe;IACpD;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAChC;;OAEG;IACH,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;CACnC;AAED,UAAU,qBAAsB,SAAQ,eAAe;IACrD;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAChC;;OAEG;IACH,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,KAAK,EAAE,oBAAoB,CAAC;IAC5B;;OAEG;IACH,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;IAC3D,MAAM,EAAE,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,CAAC;CAChE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,GAAG,eAAe,CAAC;AAE/E;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,sBAAsB,GAClC,uBAAuB,CAKzB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,GAAG;IAC7D,QAAQ,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,sBAIhC,CAAC;AAyBF;;IAEI;AACJ,wBAAgB,qBAAqB,CACnC,SAAS,SACL,YAAY,GACZ,YAAY,EAAE,GACd,mBAAmB,GACnB,mBAAmB,EAAE,EACzB,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS;;yEAI9C;AAKD,gBAAgB;AAChB,iBAAS,oBAAoB,CAAC,OAAO,SAAS,SAAS,EAAE,OAAO,EAC9D,QAAQ,EACJ,YAAY,CAAC,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAChD,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAC3D,WAAW,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;EAuB7B;AAQD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAS,SAAS,EAAE,OAAO,EAChE,QAAQ,EACJ,YAAY,CAAC,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAChD,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAC3D,WAAW,EAAE,eAAe,GAC3B,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAqBzC"}
@@ -1,98 +0,0 @@
1
- /**
2
- * ================================
3
- * Useful utility types that doesn't have anything to do with tRPC in particular
4
- * ================================
5
- */
6
- /**
7
- * @public
8
- */
9
- export type Maybe<TType> = TType | null | undefined;
10
- /**
11
- * @internal
12
- * @link https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325
13
- */
14
- export type Simplify<TType> = TType extends any[] | Date ? TType : {
15
- [K in keyof TType]: TType[K];
16
- };
17
- /**
18
- * @public
19
- */
20
- export type Dict<TType> = Record<string, TType | undefined>;
21
- /**
22
- * @public
23
- */
24
- export type MaybePromise<TType> = Promise<TType> | TType;
25
- export type FilterKeys<TObj extends object, TFilter> = {
26
- [TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never;
27
- }[keyof TObj];
28
- /**
29
- * @internal
30
- */
31
- export type Filter<TObj extends object, TFilter> = Pick<TObj, FilterKeys<TObj, TFilter>>;
32
- /**
33
- * Unwrap return type if the type is a function (sync or async), else use the type as is
34
- * @internal
35
- */
36
- export type Unwrap<TType> = TType extends (...args: any[]) => infer R ? Awaited<R> : TType;
37
- /**
38
- * Makes the object recursively optional
39
- * @internal
40
- */
41
- export type DeepPartial<TObject> = TObject extends object ? {
42
- [P in keyof TObject]?: DeepPartial<TObject[P]>;
43
- } : TObject;
44
- /**
45
- * Omits the key without removing a potential union
46
- * @internal
47
- */
48
- export type DistributiveOmit<TObj, TKey extends keyof any> = TObj extends any ? Omit<TObj, TKey> : never;
49
- /**
50
- * See https://github.com/microsoft/TypeScript/issues/41966#issuecomment-758187996
51
- * Fixes issues with iterating over keys of objects with index signatures.
52
- * Without this, iterations over keys of objects with index signatures will lose
53
- * type information about the keys and only the index signature will remain.
54
- * @internal
55
- */
56
- export type WithoutIndexSignature<TObj> = {
57
- [K in keyof TObj as string extends K ? never : number extends K ? never : K]: TObj[K];
58
- };
59
- /**
60
- * @internal
61
- * Overwrite properties in `TType` with properties in `TWith`
62
- * Only overwrites properties when the type to be overwritten
63
- * is an object. Otherwise it will just use the type from `TWith`.
64
- */
65
- export type Overwrite<TType, TWith> = TWith extends any ? TType extends object ? {
66
- [K in keyof WithoutIndexSignature<TType> | keyof WithoutIndexSignature<TWith>]: K extends keyof TWith ? TWith[K] : K extends keyof TType ? TType[K] : never;
67
- } & (string extends keyof TWith ? {
68
- [key: string]: TWith[string];
69
- } : number extends keyof TWith ? {
70
- [key: number]: TWith[number];
71
- } : {}) : TWith : never;
72
- /**
73
- * @internal
74
- */
75
- export type ValidateShape<TActualShape, TExpectedShape> = TActualShape extends TExpectedShape ? Exclude<keyof TActualShape, keyof TExpectedShape> extends never ? TActualShape : TExpectedShape : never;
76
- /**
77
- * @internal
78
- */
79
- export type PickFirstDefined<TType, TPick> = undefined extends TType ? undefined extends TPick ? never : TPick : TType;
80
- /**
81
- * ================================
82
- * tRPC specific types
83
- * ================================
84
- */
85
- /**
86
- * @internal
87
- */
88
- export type IntersectionError<TKey extends string> = `The property '${TKey}' in your router collides with a built-in method, rename this router or procedure on your backend.`;
89
- /**
90
- * @internal
91
- */
92
- export type ProtectedIntersection<TType, TWith> = keyof TType & keyof TWith extends never ? TType & TWith : IntersectionError<string & keyof TType & keyof TWith>;
93
- /**
94
- * @internal
95
- * Returns the raw input type of a procedure
96
- */
97
- export type GetRawInputFn = () => Promise<unknown>;
98
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,KAAK,IAAI,KAAK,SAAS,GAAG,EAAE,GAAG,IAAI,GACpD,KAAK,GACL;KAAG,CAAC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;CAAE,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,SAAS,CAAC,CAAC;AAE5D;;GAEG;AACH,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