@trpc/server 11.0.0-alpha-tmp-export-from-main-nuke-core.219 → 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 (209) 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 -13
  9. package/dist/adapters/aws-lambda/index.mjs +3 -9
  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 -9
  14. package/dist/adapters/express.mjs +2 -9
  15. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -1
  16. package/dist/adapters/fastify/index.js +4 -13
  17. package/dist/adapters/fastify/index.mjs +2 -11
  18. package/dist/adapters/fetch/fetchRequestHandler.d.ts +1 -1
  19. package/dist/adapters/fetch/index.js +4 -11
  20. package/dist/adapters/fetch/index.mjs +2 -9
  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 -12
  24. package/dist/adapters/next.mjs +3 -10
  25. package/dist/adapters/node-http/content-type/json/index.js +3 -6
  26. package/dist/adapters/node-http/content-type/json/index.mjs +1 -4
  27. package/dist/adapters/node-http/index.js +2 -9
  28. package/dist/adapters/node-http/index.mjs +2 -9
  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 -9
  34. package/dist/adapters/standalone.mjs +2 -9
  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 -32
  38. package/dist/adapters/ws.mjs +1 -7
  39. package/dist/http.d.ts +6 -6
  40. package/dist/http.d.ts.map +1 -1
  41. package/dist/http.js +21 -13
  42. package/dist/http.mjs +1 -8
  43. package/dist/index.js +41 -16
  44. package/dist/index.mjs +1 -6
  45. package/dist/{nodeHTTPRequestHandler-d8558115.mjs → nodeHTTPRequestHandler-2d5c8791.mjs} +2 -4
  46. package/dist/{nodeHTTPRequestHandler-0bc1dc41.js → nodeHTTPRequestHandler-55f05150.js} +4 -6
  47. package/dist/{nodeHTTPRequestHandler-c7d41cde.js → nodeHTTPRequestHandler-7691fc79.js} +1 -3
  48. package/dist/observable.d.ts +3 -0
  49. package/dist/observable.d.ts.map +1 -0
  50. package/dist/observable.js +32 -0
  51. package/dist/observable.mjs +1 -0
  52. package/dist/rpc.d.ts +2 -2
  53. package/dist/rpc.d.ts.map +1 -1
  54. package/dist/rpc.js +13 -6
  55. package/dist/rpc.mjs +1 -3
  56. package/dist/shared.js +9 -5
  57. package/dist/shared.mjs +1 -3
  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 +16 -0
  76. package/src/rpc.ts +2 -2
  77. package/dist/TRPCError-57838b33.js +0 -67
  78. package/dist/TRPCError-af754aba.mjs +0 -63
  79. package/dist/TRPCError-ebbde27d.js +0 -61
  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 -770
  84. package/dist/contentType-9756da28.js +0 -59
  85. package/dist/contentType-b31eab56.js +0 -54
  86. package/dist/contentType-f93c6ba8.mjs +0 -52
  87. package/dist/createProxy-7293f632.mjs +0 -121
  88. package/dist/createProxy-c5cd21e8.js +0 -127
  89. package/dist/createProxy-f6960c7b.js +0 -116
  90. package/dist/initTRPC-6c16fa27.mjs +0 -377
  91. package/dist/initTRPC-8b5714ea.js +0 -385
  92. package/dist/initTRPC-b65b35e2.js +0 -372
  93. package/dist/observable/index.d.ts +0 -5
  94. package/dist/observable/index.d.ts.map +0 -1
  95. package/dist/observable/index.js +0 -111
  96. package/dist/observable/index.mjs +0 -102
  97. package/dist/observable/observable.d.ts +0 -13
  98. package/dist/observable/observable.d.ts.map +0 -1
  99. package/dist/observable/operators.d.ts +0 -8
  100. package/dist/observable/operators.d.ts.map +0 -1
  101. package/dist/observable/types.d.ts +0 -26
  102. package/dist/observable/types.d.ts.map +0 -1
  103. package/dist/observable-7233bd21.mjs +0 -121
  104. package/dist/observable-7865c812.js +0 -125
  105. package/dist/observable-cbbc588a.js +0 -125
  106. package/dist/parseTRPCMessage-3ae1b295.js +0 -67
  107. package/dist/parseTRPCMessage-abbd6862.mjs +0 -62
  108. package/dist/parseTRPCMessage-c6022e94.js +0 -65
  109. package/dist/resolveHTTPResponse-3133d603.js +0 -265
  110. package/dist/resolveHTTPResponse-80c99f62.mjs +0 -291
  111. package/dist/resolveHTTPResponse-9e260431.js +0 -293
  112. package/dist/rootConfig-a1ad09d0.js +0 -48
  113. package/dist/rootConfig-db88d377.js +0 -44
  114. package/dist/rootConfig-f741a4e7.mjs +0 -40
  115. package/dist/router-68063d64.mjs +0 -252
  116. package/dist/router-7a7bb4fd.js +0 -262
  117. package/dist/router-c5bd7780.js +0 -259
  118. package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts +0 -6
  119. package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts.map +0 -1
  120. package/dist/unstable-core-do-not-import/createProxy.d.ts +0 -19
  121. package/dist/unstable-core-do-not-import/createProxy.d.ts.map +0 -1
  122. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +0 -13
  123. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +0 -1
  124. package/dist/unstable-core-do-not-import/error/formatter.d.ts +0 -33
  125. package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +0 -1
  126. package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +0 -15
  127. package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +0 -1
  128. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts +0 -24
  129. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +0 -1
  130. package/dist/unstable-core-do-not-import/http/contentType.d.ts +0 -29
  131. package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +0 -1
  132. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +0 -5
  133. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +0 -1
  134. package/dist/unstable-core-do-not-import/http/index.d.ts +0 -7
  135. package/dist/unstable-core-do-not-import/http/index.d.ts.map +0 -1
  136. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +0 -51
  137. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +0 -1
  138. package/dist/unstable-core-do-not-import/http/types.d.ts +0 -96
  139. package/dist/unstable-core-do-not-import/http/types.d.ts.map +0 -1
  140. package/dist/unstable-core-do-not-import/index.d.ts +0 -34
  141. package/dist/unstable-core-do-not-import/index.d.ts.map +0 -1
  142. package/dist/unstable-core-do-not-import/index.js +0 -44
  143. package/dist/unstable-core-do-not-import/index.mjs +0 -10
  144. package/dist/unstable-core-do-not-import/initTRPC.d.ts +0 -96
  145. package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +0 -1
  146. package/dist/unstable-core-do-not-import/middleware.d.ts +0 -105
  147. package/dist/unstable-core-do-not-import/middleware.d.ts.map +0 -1
  148. package/dist/unstable-core-do-not-import/parser.d.ts +0 -30
  149. package/dist/unstable-core-do-not-import/parser.d.ts.map +0 -1
  150. package/dist/unstable-core-do-not-import/procedure.d.ts +0 -72
  151. package/dist/unstable-core-do-not-import/procedure.d.ts.map +0 -1
  152. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +0 -101
  153. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +0 -1
  154. package/dist/unstable-core-do-not-import/rootConfig.d.ts +0 -75
  155. package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +0 -1
  156. package/dist/unstable-core-do-not-import/router.d.ts +0 -85
  157. package/dist/unstable-core-do-not-import/router.d.ts.map +0 -1
  158. package/dist/unstable-core-do-not-import/rpc/codes.d.ts +0 -51
  159. package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +0 -1
  160. package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +0 -97
  161. package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +0 -1
  162. package/dist/unstable-core-do-not-import/rpc/index.d.ts +0 -5
  163. package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +0 -1
  164. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +0 -5
  165. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +0 -1
  166. package/dist/unstable-core-do-not-import/serialize.d.ts +0 -62
  167. package/dist/unstable-core-do-not-import/serialize.d.ts.map +0 -1
  168. package/dist/unstable-core-do-not-import/transformer.d.ts +0 -107
  169. package/dist/unstable-core-do-not-import/transformer.d.ts.map +0 -1
  170. package/dist/unstable-core-do-not-import/types.d.ts +0 -98
  171. package/dist/unstable-core-do-not-import/types.d.ts.map +0 -1
  172. package/dist/unstable-core-do-not-import/utils.d.ts +0 -31
  173. package/dist/unstable-core-do-not-import/utils.d.ts.map +0 -1
  174. package/dist/utils-42a3ba6d.js +0 -50
  175. package/dist/utils-cf6178ec.mjs +0 -44
  176. package/dist/utils-e1d51fac.js +0 -49
  177. package/src/observable/index.ts +0 -10
  178. package/src/observable/observable.ts +0 -155
  179. package/src/observable/operators.ts +0 -119
  180. package/src/observable/types.ts +0 -76
  181. package/src/unstable-core-do-not-import/TRPCInferrable.ts +0 -9
  182. package/src/unstable-core-do-not-import/createProxy.ts +0 -59
  183. package/src/unstable-core-do-not-import/error/TRPCError.ts +0 -82
  184. package/src/unstable-core-do-not-import/error/formatter.ts +0 -51
  185. package/src/unstable-core-do-not-import/error/getErrorShape.ts +0 -36
  186. package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +0 -29
  187. package/src/unstable-core-do-not-import/http/contentType.ts +0 -99
  188. package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +0 -57
  189. package/src/unstable-core-do-not-import/http/index.ts +0 -23
  190. package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +0 -458
  191. package/src/unstable-core-do-not-import/http/types.ts +0 -111
  192. package/src/unstable-core-do-not-import/index.ts +0 -107
  193. package/src/unstable-core-do-not-import/initTRPC.ts +0 -206
  194. package/src/unstable-core-do-not-import/middleware.ts +0 -233
  195. package/src/unstable-core-do-not-import/parser.ts +0 -94
  196. package/src/unstable-core-do-not-import/procedure.ts +0 -108
  197. package/src/unstable-core-do-not-import/procedureBuilder.ts +0 -458
  198. package/src/unstable-core-do-not-import/rootConfig.ts +0 -90
  199. package/src/unstable-core-do-not-import/router.ts +0 -370
  200. package/src/unstable-core-do-not-import/rpc/codes.ts +0 -44
  201. package/src/unstable-core-do-not-import/rpc/envelopes.ts +0 -136
  202. package/src/unstable-core-do-not-import/rpc/index.ts +0 -21
  203. package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +0 -85
  204. package/src/unstable-core-do-not-import/serialize.ts +0 -122
  205. package/src/unstable-core-do-not-import/transformer.ts +0 -202
  206. package/src/unstable-core-do-not-import/types.ts +0 -151
  207. package/src/unstable-core-do-not-import/utils.ts +0 -66
  208. package/unstable-core-do-not-import/index.d.ts +0 -1
  209. package/unstable-core-do-not-import/index.js +0 -1
@@ -1,72 +0,0 @@
1
- import type { inferObservableValue } from '../observable';
2
- import type { ProcedureCallOptions } from './procedureBuilder';
3
- import type { Serialize } from './serialize';
4
- import type { DefaultDataTransformer } from './transformer';
5
- import type { inferConfig, TRPCInferrable } from './TRPCInferrable';
6
- export declare const procedureTypes: readonly ["query", "mutation", "subscription"];
7
- /**
8
- * @public
9
- */
10
- export type ProcedureType = (typeof procedureTypes)[number];
11
- type ClientContext = Record<string, unknown>;
12
- /**
13
- * @internal
14
- */
15
- export interface ProcedureOptions {
16
- /**
17
- * Client-side context
18
- */
19
- context?: ClientContext;
20
- signal?: AbortSignal;
21
- }
22
- /**
23
- * @internal
24
- */
25
- export type ProcedureArgs<TParams extends AnyProcedure['_def']> = void extends TParams['_input_in'] ? [input?: undefined | void, opts?: ProcedureOptions] : undefined extends TParams['_input_in'] ? [input?: TParams['_input_in'] | void, opts?: ProcedureOptions] : [input: TParams['_input_in'], opts?: ProcedureOptions];
26
- interface BuiltProcedureDef {
27
- input: unknown;
28
- output: unknown;
29
- }
30
- /**
31
- *
32
- * @internal
33
- */
34
- export interface Procedure<TType extends ProcedureType, TDef extends BuiltProcedureDef> {
35
- _def: {
36
- _input_in: TDef['input'];
37
- _output_out: TDef['output'];
38
- procedure: true;
39
- type: TType;
40
- /**
41
- * @internal
42
- * Meta is not inferrable on individual procedures, only on the router
43
- */
44
- meta: unknown;
45
- };
46
- /**
47
- * @internal
48
- */
49
- (opts: ProcedureCallOptions): Promise<unknown>;
50
- }
51
- export interface QueryProcedure<TDef extends BuiltProcedureDef> extends Procedure<'query', TDef> {
52
- }
53
- export interface MutationProcedure<TDef extends BuiltProcedureDef> extends Procedure<'mutation', TDef> {
54
- }
55
- export interface SubscriptionProcedure<TDef extends BuiltProcedureDef> extends Procedure<'subscription', TDef> {
56
- }
57
- export type AnyQueryProcedure = QueryProcedure<any>;
58
- export type AnyMutationProcedure = MutationProcedure<any>;
59
- export type AnySubscriptionProcedure = SubscriptionProcedure<any>;
60
- export type AnyProcedure = Procedure<ProcedureType, any>;
61
- /**
62
- * @internal
63
- */
64
- export type inferTransformedProcedureOutput<TInferrable extends TRPCInferrable, TProcedure extends AnyProcedure> = inferConfig<TInferrable>['transformer'] extends DefaultDataTransformer ? Serialize<TProcedure['_def']['_output_out']> : TProcedure['_def']['_output_out'];
65
- /** @internal */
66
- export type inferTransformedSubscriptionOutput<TInferrable extends TRPCInferrable, TProcedure extends AnyProcedure> = inferConfig<TInferrable>['transformer'] extends DefaultDataTransformer ? Serialize<inferObservableValue<TProcedure['_def']['_output_out']>> : inferObservableValue<TProcedure['_def']['_output_out']>;
67
- export type inferHandlerInput<TProcedure extends AnyProcedure> = ProcedureArgs<inferProcedureParams<TProcedure>>;
68
- export type inferProcedureInput<TProcedure extends AnyProcedure> = inferProcedureParams<TProcedure>['_input_in'];
69
- export type inferProcedureParams<TProcedure> = TProcedure extends AnyProcedure ? TProcedure['_def'] : never;
70
- export type inferProcedureOutput<TProcedure> = inferProcedureParams<TProcedure>['_output_out'];
71
- export {};
72
- //# sourceMappingURL=procedure.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"procedure.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/procedure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MA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C,UAAU,SAAS,YAAY,IAC7B,WAAW,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC,SAAS,sBAAsB,GACtE,SAAS,CAAC,oBAAoB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAClE,oBAAoB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAE5D,MAAM,MAAM,iBAAiB,CAAC,UAAU,SAAS,YAAY,IAAI,aAAa,CAC5E,oBAAoB,CAAC,UAAU,CAAC,CACjC,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,UAAU,SAAS,YAAY,IAC7D,oBAAoB,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC;AAEhD,MAAM,MAAM,oBAAoB,CAAC,UAAU,IAAI,UAAU,SAAS,YAAY,GAC1E,UAAU,CAAC,MAAM,CAAC,GAClB,KAAK,CAAC;AACV,MAAM,MAAM,oBAAoB,CAAC,UAAU,IACzC,oBAAoB,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC"}
@@ -1,101 +0,0 @@
1
- import type { AnyMiddlewareFunction, MiddlewareBuilder, MiddlewareFunction } from './middleware';
2
- import type { inferParser, Parser } from './parser';
3
- import type { MutationProcedure, ProcedureType, QueryProcedure, SubscriptionProcedure } from './procedure';
4
- import type { GetRawInputFn, MaybePromise, Overwrite, Simplify } from './types';
5
- type IntersectIfDefined<TType, TWith> = TType extends UnsetMarker ? TWith : Simplify<TType & TWith>;
6
- type ErrorMessage<TMessage extends string> = TMessage;
7
- /** @internal */
8
- export declare const unsetMarker: unique symbol;
9
- type UnsetMarker = typeof unsetMarker;
10
- type DefaultValue<TValue, TFallback> = TValue extends UnsetMarker ? TFallback : TValue;
11
- type ProcedureBuilderDef<TMeta> = {
12
- procedure: true;
13
- inputs: Parser[];
14
- output?: Parser;
15
- meta?: TMeta;
16
- resolver?: ProcedureBuilderResolver;
17
- middlewares: AnyMiddlewareFunction[];
18
- mutation?: boolean;
19
- query?: boolean;
20
- subscription?: boolean;
21
- };
22
- type AnyProcedureBuilderDef = ProcedureBuilderDef<any>;
23
- /**
24
- * Procedure resolver options
25
- * @internal
26
- */
27
- interface ResolverOptions<TContext, _TMeta, TContextOverridesIn, TInputOut> {
28
- ctx: Simplify<Overwrite<TContext, TContextOverridesIn>>;
29
- input: TInputOut extends UnsetMarker ? undefined : TInputOut;
30
- }
31
- /**
32
- * A procedure resolver
33
- */
34
- type ProcedureResolver<TContext, _TMeta, TContextOverrides, TInputOut, TOutputIn, TOutputOut> = (opts: {
35
- ctx: Simplify<Overwrite<TContext, TContextOverrides>>;
36
- input: TInputOut extends UnsetMarker ? undefined : TInputOut;
37
- }) => MaybePromise<DefaultValue<TOutputIn, TOutputOut>>;
38
- export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut> {
39
- /**
40
- * Add an input parser to the procedure.
41
- * @link https://trpc.io/docs/v11/server/validators
42
- */
43
- input<$Parser extends Parser>(schema: TInputOut extends UnsetMarker ? $Parser : inferParser<$Parser>['out'] extends Record<string, unknown> | undefined ? TInputOut extends Record<string, unknown> | undefined ? undefined extends inferParser<$Parser>['out'] ? undefined extends TInputOut ? $Parser : ErrorMessage<'Cannot chain an optional parser to a required parser'> : $Parser : ErrorMessage<'All input parsers did not resolve to an object'> : ErrorMessage<'All input parsers did not resolve to an object'>): ProcedureBuilder<TContext, TMeta, TContextOverrides, IntersectIfDefined<TInputIn, inferParser<$Parser>['in']>, IntersectIfDefined<TInputOut, inferParser<$Parser>['out']>, TOutputIn, TOutputOut>;
44
- /**
45
- * Add an output parser to the procedure.
46
- * @link https://trpc.io/docs/v11/server/validators
47
- */
48
- output<$Parser extends Parser>(schema: $Parser): ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, IntersectIfDefined<TOutputIn, inferParser<$Parser>['in']>, IntersectIfDefined<TOutputOut, inferParser<$Parser>['out']>>;
49
- /**
50
- * Add a meta data to the procedure.
51
- * @link https://trpc.io/docs/v11/server/metadata
52
- */
53
- meta(meta: TMeta): ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut>;
54
- /**
55
- * Add a middleware to the procedure.
56
- * @link https://trpc.io/docs/v11/server/middlewares
57
- */
58
- use<$ContextOverridesOut>(fn: MiddlewareBuilder<Overwrite<TContext, TContextOverrides>, TMeta, $ContextOverridesOut, TInputIn> | MiddlewareFunction<TContext, TMeta, TContextOverrides, $ContextOverridesOut, TInputIn>): ProcedureBuilder<TContext, TMeta, Overwrite<TContextOverrides, $ContextOverridesOut>, TInputIn, TInputOut, TOutputIn, TOutputOut>;
59
- /**
60
- * Query procedure
61
- * @link https://trpc.io/docs/v11/concepts#vocabulary
62
- */
63
- query<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): QueryProcedure<{
64
- input: DefaultValue<TInputIn, void>;
65
- output: DefaultValue<TOutputOut, $Output>;
66
- }>;
67
- /**
68
- * Mutation procedure
69
- * @link https://trpc.io/docs/v11/concepts#vocabulary
70
- */
71
- mutation<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): MutationProcedure<{
72
- input: DefaultValue<TInputIn, void>;
73
- output: DefaultValue<TOutputOut, $Output>;
74
- }>;
75
- /**
76
- * Subscription procedure
77
- * @link https://trpc.io/docs/v11/concepts#vocabulary
78
- */
79
- subscription<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): SubscriptionProcedure<{
80
- input: DefaultValue<TInputIn, void>;
81
- output: DefaultValue<TOutputOut, $Output>;
82
- }>;
83
- /**
84
- * @internal
85
- */
86
- _def: ProcedureBuilderDef<TMeta>;
87
- }
88
- type ProcedureBuilderResolver = (opts: ResolverOptions<any, any, any, any>) => Promise<unknown>;
89
- export declare function createBuilder<TContext, TMeta>(initDef?: Partial<AnyProcedureBuilderDef>): ProcedureBuilder<TContext, TMeta, object, UnsetMarker, UnsetMarker, UnsetMarker, UnsetMarker>;
90
- /**
91
- * @internal
92
- */
93
- export interface ProcedureCallOptions {
94
- ctx: unknown;
95
- getRawInput: GetRawInputFn;
96
- input?: unknown;
97
- path: string;
98
- type: ProcedureType;
99
- }
100
- export {};
101
- //# sourceMappingURL=procedureBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"procedureBuilder.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/procedureBuilder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,cAAc,CAAC;AAOtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAKV,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGhF,KAAK,kBAAkB,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,SAAS,WAAW,GAC7D,KAAK,GACL,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;AAE5B,KAAK,YAAY,CAAC,QAAQ,SAAS,MAAM,IAAI,QAAQ,CAAC;AAEtD,gBAAgB;AAChB,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,KAAK,WAAW,GAAG,OAAO,WAAW,CAAC;AACtC,KAAK,YAAY,CAAC,MAAM,EAAE,SAAS,IAAI,MAAM,SAAS,WAAW,GAC7D,SAAS,GACT,MAAM,CAAC;AAEX,KAAK,mBAAmB,CAAC,KAAK,IAAI;IAChC,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,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Q,EAAE,KAAK,EAC3C,OAAO,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC5C,gBAAgB,CACjB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,CACZ,CAuEA;AAwBD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,OAAO,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;CACrB"}
@@ -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,0 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/router.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,+BAA+B,EAC/B,aAAa,EACd,MAAM,aAAa,C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ACzC,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,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,cAAc,CAC7B,KAAK,SAAS,MAAM,GAAG,sBAAsB,EAC7C,KAAK,SAAS,MAA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AC,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,MAAM,GAC3C,CAAC,SAAS,gBAAgB,GAAG,KAAK,GAClC,CAAC,SAAS;IAAE,MAAM,IAAI,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GACnC,CAAC,SAAS,EAAE,GAAG,EAAE,GACjB,CAAC,SAAS,CA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