@trpc/server 9.20.2 → 9.22.0

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 (88) hide show
  1. package/adapters/express/dist/trpc-server-adapters-express.cjs.dev.js +5 -5
  2. package/adapters/express/dist/trpc-server-adapters-express.cjs.prod.js +5 -5
  3. package/adapters/express/dist/trpc-server-adapters-express.esm.js +5 -5
  4. package/adapters/fastify/dist/trpc-server-adapters-fastify.cjs.dev.js +16 -9
  5. package/adapters/fastify/dist/trpc-server-adapters-fastify.cjs.prod.js +16 -9
  6. package/adapters/fastify/dist/trpc-server-adapters-fastify.esm.js +16 -9
  7. package/adapters/next/dist/trpc-server-adapters-next.cjs.dev.js +3 -3
  8. package/adapters/next/dist/trpc-server-adapters-next.cjs.prod.js +3 -3
  9. package/adapters/next/dist/trpc-server-adapters-next.esm.js +3 -3
  10. package/adapters/node-http/dist/trpc-server-adapters-node-http.cjs.dev.js +3 -3
  11. package/adapters/node-http/dist/trpc-server-adapters-node-http.cjs.prod.js +3 -3
  12. package/adapters/node-http/dist/trpc-server-adapters-node-http.esm.js +3 -3
  13. package/adapters/standalone/dist/trpc-server-adapters-standalone.cjs.dev.js +3 -3
  14. package/adapters/standalone/dist/trpc-server-adapters-standalone.cjs.prod.js +3 -3
  15. package/adapters/standalone/dist/trpc-server-adapters-standalone.esm.js +3 -3
  16. package/adapters/ws/dist/trpc-server-adapters-ws.cjs.dev.js +4 -4
  17. package/adapters/ws/dist/trpc-server-adapters-ws.cjs.prod.js +4 -4
  18. package/adapters/ws/dist/trpc-server-adapters-ws.esm.js +4 -4
  19. package/dist/declarations/src/TRPCError.d.ts.map +1 -1
  20. package/dist/declarations/src/adapters/fastify/fastifyRequestHandler.d.ts +2 -2
  21. package/dist/declarations/src/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
  22. package/dist/declarations/src/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -1
  23. package/dist/declarations/src/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
  24. package/dist/declarations/src/adapters/next.d.ts +1 -1
  25. package/dist/declarations/src/adapters/next.d.ts.map +1 -1
  26. package/dist/declarations/src/adapters/node-http/nodeHTTPRequestHandler.d.ts +1 -1
  27. package/dist/declarations/src/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
  28. package/dist/declarations/src/adapters/standalone.d.ts.map +1 -1
  29. package/dist/declarations/src/adapters/ws.d.ts.map +1 -1
  30. package/dist/declarations/src/deprecated/createHttpServer.d.ts +1 -1
  31. package/dist/declarations/src/deprecated/createHttpServer.d.ts.map +1 -1
  32. package/dist/declarations/src/deprecated/requestHandler.d.ts +1 -1
  33. package/dist/declarations/src/deprecated/requestHandler.d.ts.map +1 -1
  34. package/dist/declarations/src/http/internals/getHTTPStatusCode.d.ts +1 -1
  35. package/dist/declarations/src/http/internals/getHTTPStatusCode.d.ts.map +1 -1
  36. package/dist/declarations/src/http/internals/types.d.ts +1 -1
  37. package/dist/declarations/src/http/internals/types.d.ts.map +1 -1
  38. package/dist/declarations/src/http/resolveHTTPResponse.d.ts +2 -2
  39. package/dist/declarations/src/http/resolveHTTPResponse.d.ts.map +1 -1
  40. package/dist/declarations/src/internals/BaseHandlerOptions.d.ts +1 -1
  41. package/dist/declarations/src/internals/BaseHandlerOptions.d.ts.map +1 -1
  42. package/dist/declarations/src/internals/OnErrorFunction.d.ts +1 -1
  43. package/dist/declarations/src/internals/OnErrorFunction.d.ts.map +1 -1
  44. package/dist/declarations/src/internals/middlewares.d.ts +3 -2
  45. package/dist/declarations/src/internals/middlewares.d.ts.map +1 -1
  46. package/dist/declarations/src/internals/procedure.d.ts +44 -32
  47. package/dist/declarations/src/internals/procedure.d.ts.map +1 -1
  48. package/dist/declarations/src/router.d.ts +34 -30
  49. package/dist/declarations/src/router.d.ts.map +1 -1
  50. package/dist/{nodeHTTPRequestHandler-2cc444d8.cjs.dev.js → nodeHTTPRequestHandler-620da2b7.cjs.dev.js} +2 -2
  51. package/dist/{nodeHTTPRequestHandler-d00c1126.esm.js → nodeHTTPRequestHandler-87105aef.esm.js} +2 -2
  52. package/dist/{nodeHTTPRequestHandler-8ddacc19.cjs.prod.js → nodeHTTPRequestHandler-9cfa7523.cjs.prod.js} +2 -2
  53. package/dist/{resolveHTTPResponse-85f3f5df.esm.js → resolveHTTPResponse-12cc3012.esm.js} +1 -1
  54. package/dist/{resolveHTTPResponse-3867844c.cjs.dev.js → resolveHTTPResponse-780f5cab.cjs.dev.js} +1 -1
  55. package/dist/{resolveHTTPResponse-562c3d62.cjs.prod.js → resolveHTTPResponse-d1d2695d.cjs.prod.js} +1 -1
  56. package/dist/{subscription-fbda2888.esm.js → subscription-2ea469a3.esm.js} +2 -2
  57. package/dist/{subscription-c2e0bfbc.cjs.prod.js → subscription-7de48383.cjs.dev.js} +2 -2
  58. package/dist/{subscription-b8831081.cjs.dev.js → subscription-f03bec71.cjs.prod.js} +2 -2
  59. package/dist/{transformTRPCResponse-8248515e.cjs.dev.js → transformTRPCResponse-1e125b28.cjs.prod.js} +38 -38
  60. package/dist/{transformTRPCResponse-f73dc4a2.esm.js → transformTRPCResponse-45c225c3.esm.js} +38 -38
  61. package/dist/{transformTRPCResponse-dcbf66c5.cjs.prod.js → transformTRPCResponse-c654ea92.cjs.dev.js} +38 -38
  62. package/dist/trpc-server.cjs.dev.js +44 -18
  63. package/dist/trpc-server.cjs.prod.js +44 -18
  64. package/dist/trpc-server.esm.js +46 -20
  65. package/package.json +2 -5
  66. package/src/TRPCError.ts +1 -1
  67. package/src/adapters/express.ts +2 -2
  68. package/src/adapters/fastify/fastifyRequestHandler.ts +7 -8
  69. package/src/adapters/fastify/fastifyTRPCPlugin.ts +14 -6
  70. package/src/adapters/next.ts +6 -2
  71. package/src/adapters/node-http/internals/getPostBody.test.ts +2 -1
  72. package/src/adapters/node-http/nodeHTTPRequestHandler.ts +5 -5
  73. package/src/adapters/standalone.ts +1 -0
  74. package/src/adapters/ws.ts +4 -4
  75. package/src/deprecated/createHttpServer.ts +2 -2
  76. package/src/deprecated/requestHandler.ts +2 -2
  77. package/src/http/internals/getHTTPStatusCode.ts +1 -1
  78. package/src/http/internals/types.ts +2 -2
  79. package/src/http/resolveHTTPResponse.ts +3 -3
  80. package/src/internals/BaseHandlerOptions.ts +1 -1
  81. package/src/internals/OnErrorFunction.ts +1 -1
  82. package/src/internals/middlewares.ts +3 -2
  83. package/src/internals/procedure.ts +173 -66
  84. package/src/router.ts +172 -52
  85. package/src/subscription.ts +1 -1
  86. package/ws/dist/trpc-server-ws.cjs.dev.js +2 -2
  87. package/ws/dist/trpc-server-ws.cjs.prod.js +2 -2
  88. package/ws/dist/trpc-server-ws.esm.js +2 -2
@@ -1,51 +1,55 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { TRPCError } from '../TRPCError';
2
3
  import { assertNotBrowser } from '../assertNotBrowser';
3
4
  import { ProcedureType } from '../router';
4
- import { TRPCError } from '../TRPCError';
5
5
  import { getErrorFromUnknown } from './errors';
6
6
  import { MiddlewareFunction, middlewareMarker } from './middlewares';
7
7
  import { wrapCallSafe } from './wrapCallSafe';
8
+
8
9
  assertNotBrowser();
9
10
 
10
- export type ProcedureInputParserZodEsque<TInput, TParsedInput> = {
11
+ export type ProcedureParserZodEsque<TInput, TOutput> = {
11
12
  _input: TInput;
12
- _output: TParsedInput;
13
+ _output: TOutput;
13
14
  };
14
15
 
15
- export type ProcedureInputParserMyZodEsque<TInput> = {
16
- parse: (input: any) => TInput;
16
+ export type ProcedureParserMyZodEsque<T> = {
17
+ parse: (input: any) => T;
17
18
  };
18
19
 
19
- export type ProcedureInputParserSuperstructEsque<TInput> = {
20
- create: (input: unknown) => TInput;
20
+ export type ProcedureParserSuperstructEsque<T> = {
21
+ create: (input: unknown) => T;
21
22
  };
22
23
 
23
- export type ProcedureInputParserCustomValidatorEsque<TInput> = (
24
+ export type ProcedureParserCustomValidatorEsque<T> = (
24
25
  input: unknown,
25
- ) => TInput | Promise<TInput>;
26
+ ) => T | Promise<T>;
26
27
 
27
- export type ProcedureInputParserYupEsque<TInput> = {
28
- validateSync: (input: unknown) => TInput;
28
+ export type ProcedureParserYupEsque<T> = {
29
+ validateSync: (input: unknown) => T;
29
30
  };
30
- export type ProcedureInputParser<TInput> =
31
- | ProcedureInputParserYupEsque<TInput>
32
- | ProcedureInputParserSuperstructEsque<TInput>
33
- | ProcedureInputParserCustomValidatorEsque<TInput>
34
- | ProcedureInputParserMyZodEsque<TInput>;
35
31
 
36
- export type ProcedureInputParserWithInputOutput<TInput, TParsedInput> =
37
- ProcedureInputParserZodEsque<TInput, TParsedInput>;
32
+ export type ProcedureParserWithInputOutput<TInput, TOutput> =
33
+ ProcedureParserZodEsque<TInput, TOutput>;
38
34
 
39
- export type ProcedureResolver<TContext, TParsedInput, TOutput> = (opts: {
35
+ export type ProcedureParser<T> =
36
+ | ProcedureParserYupEsque<T>
37
+ | ProcedureParserSuperstructEsque<T>
38
+ | ProcedureParserCustomValidatorEsque<T>
39
+ | ProcedureParserMyZodEsque<T>;
40
+
41
+ export type ProcedureResolver<TContext, TInput, TOutput> = (opts: {
40
42
  ctx: TContext;
41
- input: TParsedInput;
43
+ input: TInput;
42
44
  type: ProcedureType;
43
45
  }) => Promise<TOutput> | TOutput;
44
46
 
45
- interface ProcedureOptions<TContext, TParsedInput, TOutput> {
46
- middlewares: Array<MiddlewareFunction<any, any>>;
47
- resolver: ProcedureResolver<TContext, TParsedInput, TOutput>;
48
- inputParser: ProcedureInputParser<TParsedInput>;
47
+ interface ProcedureOptions<TContext, TMeta, TInput, TOutput, TParsedOutput> {
48
+ middlewares: Array<MiddlewareFunction<any, any, any>>;
49
+ resolver: ProcedureResolver<TContext, TInput, TOutput>;
50
+ inputParser: ProcedureParser<TInput>;
51
+ outputParser: ProcedureParser<TParsedOutput>;
52
+ meta: TMeta;
49
53
  }
50
54
 
51
55
  /**
@@ -58,36 +62,33 @@ export interface ProcedureCallOptions<TContext> {
58
62
  type: ProcedureType;
59
63
  }
60
64
 
61
- type ParseFn<TParsedInput> = (
62
- value: unknown,
63
- ) => TParsedInput | Promise<TParsedInput>;
64
- function getParseFn<TParsedInput>(
65
- inputParser: ProcedureInputParser<TParsedInput>,
66
- ): ParseFn<TParsedInput> {
67
- const parser = inputParser as any;
65
+ type ParseFn<T> = (value: unknown) => T | Promise<T>;
66
+
67
+ function getParseFn<T>(procedureParser: ProcedureParser<T>): ParseFn<T> {
68
+ const parser = procedureParser as any;
68
69
 
69
70
  if (typeof parser === 'function') {
70
- // ProcedureInputParserCustomValidatorEsque
71
+ // ProcedureParserCustomValidatorEsque
71
72
  return parser;
72
73
  }
73
74
 
74
75
  if (typeof parser.parseAsync === 'function') {
75
- // ProcedureInputParserZodEsque
76
+ // ProcedureParserZodEsque
76
77
  return parser.parseAsync.bind(parser);
77
78
  }
78
79
 
79
80
  if (typeof parser.parse === 'function') {
80
- // ProcedureInputParserZodEsque
81
+ // ProcedureParserZodEsque
81
82
  return parser.parse.bind(parser);
82
83
  }
83
84
 
84
85
  if (typeof parser.validateSync === 'function') {
85
- // ProcedureInputParserYupEsque
86
+ // ProcedureParserYupEsque
86
87
  return parser.validateSync.bind(parser);
87
88
  }
88
89
 
89
90
  if (typeof parser.create === 'function') {
90
- // ProcedureInputParserSuperstructEsque
91
+ // ProcedureParserSuperstructEsque
91
92
  return parser.create.bind(parser);
92
93
  }
93
94
 
@@ -97,22 +98,45 @@ function getParseFn<TParsedInput>(
97
98
  /**
98
99
  * @internal
99
100
  */
100
- export class Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput> {
101
- private middlewares: Readonly<Array<MiddlewareFunction<any, any>>>;
101
+ export class Procedure<
102
+ TInputContext,
103
+ TContext,
104
+ TMeta,
105
+ TInput,
106
+ TParsedInput,
107
+ TOutput,
108
+ TParsedOutput,
109
+ TFinalOutput = unknown extends TParsedOutput ? TOutput : TParsedOutput,
110
+ > {
111
+ private middlewares: Readonly<Array<MiddlewareFunction<any, any, any>>>;
102
112
  private resolver: ProcedureResolver<TContext, TParsedInput, TOutput>;
103
- private readonly inputParser: ProcedureInputParser<TParsedInput>;
104
- private parse: ParseFn<TParsedInput>;
113
+ private readonly inputParser: ProcedureParser<TParsedInput>;
114
+ private parseInputFn: ParseFn<TParsedInput>;
115
+ private readonly outputParser: ProcedureParser<TFinalOutput>;
116
+ private parseOutputFn: ParseFn<TFinalOutput>;
117
+ public readonly meta: TMeta;
105
118
 
106
- constructor(opts: ProcedureOptions<TContext, TParsedInput, TOutput>) {
119
+ constructor(
120
+ opts: ProcedureOptions<
121
+ TContext,
122
+ TMeta,
123
+ TParsedInput,
124
+ TOutput,
125
+ TFinalOutput
126
+ >,
127
+ ) {
107
128
  this.middlewares = opts.middlewares;
108
129
  this.resolver = opts.resolver;
109
130
  this.inputParser = opts.inputParser;
110
- this.parse = getParseFn(this.inputParser);
131
+ this.parseInputFn = getParseFn(this.inputParser);
132
+ this.outputParser = opts.outputParser;
133
+ this.parseOutputFn = getParseFn(this.outputParser);
134
+ this.meta = opts.meta;
111
135
  }
112
136
 
113
137
  private async parseInput(rawInput: unknown): Promise<TParsedInput> {
114
138
  try {
115
- return await this.parse(rawInput);
139
+ return await this.parseInputFn(rawInput);
116
140
  } catch (cause) {
117
141
  throw new TRPCError({
118
142
  code: 'BAD_REQUEST',
@@ -121,18 +145,35 @@ export class Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput> {
121
145
  }
122
146
  }
123
147
 
148
+ private async parseOutput(rawOutput: TOutput): Promise<TFinalOutput> {
149
+ try {
150
+ return await this.parseOutputFn(rawOutput);
151
+ } catch (cause) {
152
+ throw new TRPCError({
153
+ code: 'INTERNAL_SERVER_ERROR',
154
+ cause,
155
+ message: 'Output validation failed',
156
+ });
157
+ }
158
+ }
159
+
124
160
  /**
125
- * Trigger middlewares in order, parse raw input & call resolver
161
+ * Trigger middlewares in order, parse raw input, call resolver & parse raw output
126
162
  * @internal
127
163
  */
128
164
  public async call(
129
165
  opts: ProcedureCallOptions<TInputContext>,
130
- ): Promise<TOutput> {
166
+ ): Promise<TFinalOutput> {
131
167
  // wrap the actual resolver and treat as the last "middleware"
132
168
  const middlewaresWithResolver = this.middlewares.concat([
133
169
  async ({ ctx }: { ctx: TContext }) => {
134
170
  const input = await this.parseInput(opts.rawInput);
135
- const data = await this.resolver({ ...opts, ctx, input });
171
+ const rawOutput = await this.resolver({
172
+ ...opts,
173
+ ctx,
174
+ input,
175
+ });
176
+ const data = await this.parseOutput(rawOutput);
136
177
  return {
137
178
  marker: middlewareMarker,
138
179
  ok: true,
@@ -151,6 +192,7 @@ export class Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput> {
151
192
  type: opts.type,
152
193
  path: opts.path,
153
194
  rawInput: opts.rawInput,
195
+ meta: this.meta,
154
196
  next: nextFns[index + 1],
155
197
  }),
156
198
  );
@@ -178,7 +220,7 @@ export class Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput> {
178
220
  throw result.error;
179
221
  }
180
222
 
181
- return result.data as TOutput;
223
+ return result.data as TFinalOutput;
182
224
  }
183
225
 
184
226
  /**
@@ -186,15 +228,25 @@ export class Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput> {
186
228
  * @param middlewares
187
229
  */
188
230
  public inheritMiddlewares(
189
- middlewares: MiddlewareFunction<TInputContext, TContext>[],
231
+ middlewares: MiddlewareFunction<TInputContext, TContext, TMeta>[],
190
232
  ): this {
191
233
  const Constructor: {
192
- new (opts: ProcedureOptions<TContext, TParsedInput, TOutput>): Procedure<
234
+ new (
235
+ opts: ProcedureOptions<
236
+ TContext,
237
+ TMeta,
238
+ TParsedInput,
239
+ TOutput,
240
+ TFinalOutput
241
+ >,
242
+ ): Procedure<
193
243
  TInputContext,
194
244
  TContext,
245
+ TMeta,
195
246
  TInput,
196
247
  TParsedInput,
197
- TOutput
248
+ TOutput,
249
+ TParsedOutput
198
250
  >;
199
251
  } = (this as any).constructor;
200
252
 
@@ -202,48 +254,92 @@ export class Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput> {
202
254
  middlewares: [...middlewares, ...this.middlewares],
203
255
  resolver: this.resolver,
204
256
  inputParser: this.inputParser,
257
+ outputParser: this.outputParser,
258
+ meta: this.meta,
205
259
  });
206
260
 
207
261
  return instance as any;
208
262
  }
209
263
  }
210
264
 
211
- export type CreateProcedureWithInput<TContext, TInput, TParsedInput, TOutput> =
212
- {
213
- input: ProcedureInputParser<TInput>;
214
- resolve: ProcedureResolver<TContext, TParsedInput, TOutput>;
215
- };
265
+ export type CreateProcedureWithInput<TContext, TMeta, TInput, TOutput> = {
266
+ input: ProcedureParser<TInput>;
267
+ output?: ProcedureParser<TOutput>;
268
+ meta?: TMeta;
269
+ resolve: ProcedureResolver<TContext, TInput, TOutput>;
270
+ };
271
+
216
272
  export type CreateProcedureWithInputOutputParser<
217
273
  TContext,
274
+ TMeta,
218
275
  TInput,
219
276
  TParsedInput,
220
277
  TOutput,
278
+ TParsedOutput,
221
279
  > = {
222
- input: ProcedureInputParserWithInputOutput<TInput, TParsedInput>;
280
+ input: ProcedureParserWithInputOutput<TInput, TParsedInput>;
281
+ output?: ProcedureParserWithInputOutput<TOutput, TParsedOutput>;
282
+ meta?: TMeta;
223
283
  resolve: ProcedureResolver<TContext, TParsedInput, TOutput>;
224
284
  };
225
- export type CreateProcedureWithoutInput<TContext, TOutput> = {
285
+
286
+ export type CreateProcedureWithoutInput<
287
+ TContext,
288
+ TMeta,
289
+ TOutput,
290
+ TParsedOutput,
291
+ > = {
292
+ output?:
293
+ | ProcedureParserWithInputOutput<TOutput, TParsedOutput>
294
+ | ProcedureParser<TOutput>;
295
+ meta?: TMeta;
226
296
  resolve: ProcedureResolver<TContext, undefined, TOutput>;
227
297
  };
228
298
 
229
299
  export type CreateProcedureOptions<
230
300
  TContext,
301
+ TMeta = undefined,
231
302
  TInput = undefined,
232
303
  TParsedInput = undefined,
233
304
  TOutput = undefined,
305
+ TParsedOutput = undefined,
234
306
  > =
235
- | CreateProcedureWithInput<TContext, TInput, TParsedInput, TOutput>
236
307
  | CreateProcedureWithInputOutputParser<
237
308
  TContext,
309
+ TMeta,
238
310
  TInput,
239
311
  TParsedInput,
240
- TOutput
312
+ TOutput,
313
+ TParsedOutput
241
314
  >
242
- | CreateProcedureWithoutInput<TContext, TOutput>;
315
+ | CreateProcedureWithInput<TContext, TMeta, TInput, TOutput>
316
+ | CreateProcedureWithoutInput<TContext, TMeta, TOutput, TParsedOutput>;
243
317
 
244
- export function createProcedure<TContext, TInput, TParsedInput, TOutput>(
245
- opts: CreateProcedureOptions<TContext, TInput, TParsedInput, TOutput>,
246
- ): Procedure<unknown, TContext, TInput, TParsedInput, TOutput> {
318
+ export function createProcedure<
319
+ TContext,
320
+ TMeta,
321
+ TInput,
322
+ TParsedInput,
323
+ TOutput,
324
+ TParsedOutput,
325
+ >(
326
+ opts: CreateProcedureOptions<
327
+ TContext,
328
+ TMeta,
329
+ TInput,
330
+ TParsedInput,
331
+ TOutput,
332
+ TParsedOutput
333
+ >,
334
+ ): Procedure<
335
+ unknown,
336
+ TContext,
337
+ TMeta,
338
+ TInput,
339
+ TParsedInput,
340
+ TOutput,
341
+ TParsedOutput
342
+ > {
247
343
  const inputParser =
248
344
  'input' in opts
249
345
  ? opts.input
@@ -257,27 +353,38 @@ export function createProcedure<TContext, TInput, TParsedInput, TOutput>(
257
353
  return undefined;
258
354
  };
259
355
 
356
+ const outputParser =
357
+ 'output' in opts && opts.output
358
+ ? opts.output
359
+ : (output: unknown) => output as TOutput;
360
+
260
361
  return new Procedure({
261
362
  inputParser: inputParser as any,
262
363
  resolver: opts.resolve as any,
263
364
  middlewares: [],
365
+ outputParser: outputParser as any,
366
+ meta: opts.meta as any,
264
367
  });
265
368
  }
266
369
 
267
370
  export type inferProcedureFromOptions<
268
371
  TInputContext,
269
- TOptions extends CreateProcedureOptions<any, any, any, any>,
372
+ TOptions extends CreateProcedureOptions<any, any, any, any, any, any>,
270
373
  > = TOptions extends CreateProcedureOptions<
271
374
  infer TContext,
375
+ infer TMeta,
272
376
  infer TInput,
273
377
  infer TParsedInput,
274
- infer TOutput
378
+ infer TOutput,
379
+ infer TParsedOutput
275
380
  >
276
381
  ? Procedure<
277
382
  TInputContext,
278
383
  TContext,
384
+ TMeta,
279
385
  unknown extends TInput ? undefined : TInput,
280
386
  unknown extends TParsedInput ? undefined : TParsedInput,
281
- TOutput
387
+ TOutput,
388
+ TParsedOutput
282
389
  >
283
390
  : never;