@trpc/server 11.0.0-rc.752 → 11.0.0-rc.753

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.
@@ -2,7 +2,7 @@ export { TRPCError,
2
2
  /**
3
3
  * @deprecated use `experimental_trpcMiddleware` instead
4
4
  */
5
- experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC, callProcedure as callTRPCProcedure, getTRPCErrorFromUnknown, transformTRPCResponse, createFlatProxy as createTRPCFlatProxy, type inferProcedureInput, type inferProcedureOutput, type inferProcedureBuilderResolverOptions, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferRouterContext, type inferClientTypes as inferTRPCClientTypes, type AnyClientTypes as AnyTRPCClientTypes, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, type AnyProcedure as AnyTRPCProcedure, type AnyRouter as AnyTRPCRouter, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type CombinedDataTransformer as TRPCCombinedDataTransformer, type ProcedureType as TRPCProcedureType, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type RouterRecord as TRPCRouterRecord, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, type CreateContextCallback, type MutationProcedure as TRPCMutationProcedure, type QueryProcedure as TRPCQueryProcedure, type SubscriptionProcedure as TRPCSubscriptionProcedure, type TRPCBuilder, StandardSchemaV1Error,
5
+ experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC, getTRPCErrorFromUnknown, transformTRPCResponse, createFlatProxy as createTRPCFlatProxy, type inferProcedureInput, type inferProcedureOutput, type inferProcedureBuilderResolverOptions, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferRouterContext, type inferClientTypes as inferTRPCClientTypes, type AnyClientTypes as AnyTRPCClientTypes, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, type AnyProcedure as AnyTRPCProcedure, type AnyRouter as AnyTRPCRouter, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type CombinedDataTransformer as TRPCCombinedDataTransformer, type ProcedureType as TRPCProcedureType, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type RouterRecord as TRPCRouterRecord, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, type CreateContextCallback, type MutationProcedure as TRPCMutationProcedure, type QueryProcedure as TRPCQueryProcedure, type SubscriptionProcedure as TRPCSubscriptionProcedure, type TRPCBuilder, StandardSchemaV1Error,
6
6
  /**
7
7
  * @deprecated use `tracked(id, data)` instead
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/@trpc/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS;AACT;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,QAAQ,EAER,aAAa,IAAI,iBAAiB,EAClC,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,IAAI,mBAAmB,EACtC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oCAAoC,EACzC,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,IAAI,oBAAoB,EAC7C,KAAK,cAAc,IAAI,kBAAkB,EACzC,KAAK,+BAA+B,EACpC,KAAK,kCAAkC,EACvC,KAAK,YAAY,IAAI,gBAAgB,EACrC,KAAK,SAAS,IAAI,aAAa,EAC/B,KAAK,qBAAqB,IAAI,yBAAyB,EACvD,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,oBAAoB,IAAI,wBAAwB,EACrD,KAAK,iBAAiB,IAAI,qBAAqB,EAC/C,KAAK,YAAY,IAAI,gBAAgB,EACrC,KAAK,wBAAwB,IAAI,4BAA4B,EAC7D,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,IAAI,qBAAqB,EAC/C,KAAK,cAAc,IAAI,kBAAkB,EACzC,KAAK,qBAAqB,IAAI,yBAAyB,EACvD,KAAK,WAAW,EAChB,qBAAqB;AACrB;;GAEG;AACH,GAAG,EACH,OAAO,EACP,KAAK,eAAe,EACpB,iBAAiB,EACjB,IAAI,IAAI,iBAAiB,GAC1B,MAAM,mCAAmC,CAAC;AAE3C,YAAY;AACV;;GAEG;AACH,YAAY;AACZ;;GAEG;AACH,SAAS;AACT;;GAEG;AACH,qBAAqB;AACrB;;GAEG;AACH,uBAAuB;AAEvB;;GAEG;AACH,IAAI;AAEJ;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,aAAa;AACb;;GAEG;AACH,oBAAoB;AAEpB;;GAEG;AACH,iBAAiB;AACjB;;GAEG;AACH,wBAAwB,GACzB,MAAM,mCAAmC,CAAC;AAE3C,OAAO;AACL;;GAEG;AACH,aAAa;AAEb;;GAEG;AACH,aAAa,GACd,MAAM,mCAAmC,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IACxE,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/@trpc/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS;AACT;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,QAAQ,EAER,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,IAAI,mBAAmB,EACtC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oCAAoC,EACzC,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,IAAI,oBAAoB,EAC7C,KAAK,c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ctxPromise; // asserts context has been set
181
181
  const abortController = new AbortController();
182
182
  const result = await router.callProcedure({
183
- _def: router$1._def,
183
+ router: router$1,
184
184
  path,
185
185
  getRawInput: async ()=>input,
186
186
  ctx,
@@ -178,7 +178,7 @@ function getWSConnectionHandler(opts) {
178
178
  await ctxPromise; // asserts context has been set
179
179
  const abortController = new AbortController();
180
180
  const result = await callProcedure({
181
- _def: router._def,
181
+ router,
182
182
  path,
183
183
  getRawInput: async ()=>input,
184
184
  ctx,
@@ -1,7 +1,7 @@
1
1
  {
2
- "bundleSize": 198979,
3
- "bundleOrigSize": 230695,
4
- "bundleReduction": 13.75,
2
+ "bundleSize": 199016,
3
+ "bundleOrigSize": 230668,
4
+ "bundleReduction": 13.72,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
@@ -19,8 +19,8 @@
19
19
  },
20
20
  {
21
21
  "id": "/src/adapters/ws.ts",
22
- "size": 20151,
23
- "origSize": 15938,
22
+ "size": 20148,
23
+ "origSize": 15927,
24
24
  "renderedExports": [
25
25
  "getWSConnectionHandler",
26
26
  "handleKeepAlive",
@@ -30,7 +30,7 @@
30
30
  "dependents": [
31
31
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
32
32
  ],
33
- "percent": 10.13,
33
+ "percent": 10.12,
34
34
  "reduction": 0
35
35
  },
36
36
  {
@@ -82,8 +82,8 @@
82
82
  },
83
83
  {
84
84
  "id": "/src/unstable-core-do-not-import/router.ts",
85
- "size": 10112,
86
- "origSize": 14424,
85
+ "size": 10167,
86
+ "origSize": 14423,
87
87
  "renderedExports": [
88
88
  "lazy",
89
89
  "createRouterFactory",
@@ -98,8 +98,8 @@
98
98
  "/src/unstable-core-do-not-import/initTRPC.ts",
99
99
  "/src/unstable-core-do-not-import/http/contentType.ts"
100
100
  ],
101
- "percent": 5.08,
102
- "reduction": 29.89
101
+ "percent": 5.11,
102
+ "reduction": 29.51
103
103
  },
104
104
  {
105
105
  "id": "/src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts",
@@ -117,8 +117,8 @@
117
117
  },
118
118
  {
119
119
  "id": "/src/unstable-core-do-not-import/http/contentType.ts",
120
- "size": 7889,
121
- "origSize": 7955,
120
+ "size": 7874,
121
+ "origSize": 7940,
122
122
  "renderedExports": [
123
123
  "getRequestInfo"
124
124
  ],
@@ -246,7 +246,7 @@
246
246
  "dependents": [
247
247
  "/src/observable/index.ts"
248
248
  ],
249
- "percent": 1.97,
249
+ "percent": 1.96,
250
250
  "reduction": 1.66
251
251
  },
252
252
  {
@@ -291,9 +291,9 @@
291
291
  "removedExports": [],
292
292
  "dependents": [
293
293
  "/src/unstable-core-do-not-import.ts",
294
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
294
295
  "/src/unstable-core-do-not-import/router.ts",
295
- "/src/unstable-core-do-not-import/initTRPC.ts",
296
- "/src/unstable-core-do-not-import/http/resolveResponse.ts"
296
+ "/src/unstable-core-do-not-import/initTRPC.ts"
297
297
  ],
298
298
  "percent": 1.38,
299
299
  "reduction": 45.98
@@ -353,13 +353,13 @@
353
353
  "removedExports": [],
354
354
  "dependents": [
355
355
  "/src/unstable-core-do-not-import.ts",
356
+ "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
357
+ "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
358
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
356
359
  "/src/unstable-core-do-not-import/error/TRPCError.ts",
357
360
  "/src/unstable-core-do-not-import/router.ts",
358
361
  "/src/unstable-core-do-not-import/transformer.ts",
359
362
  "/src/unstable-core-do-not-import/middleware.ts",
360
- "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
361
- "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
362
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
363
363
  "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
364
364
  "/src/unstable-core-do-not-import/http/contentType.ts",
365
365
  "/src/unstable-core-do-not-import/http/abortError.ts",
@@ -382,10 +382,10 @@
382
382
  "removedExports": [],
383
383
  "dependents": [
384
384
  "/src/unstable-core-do-not-import.ts",
385
- "/src/unstable-core-do-not-import/router.ts",
386
- "/src/unstable-core-do-not-import/middleware.ts",
387
385
  "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
388
386
  "/src/unstable-core-do-not-import/http/resolveResponse.ts",
387
+ "/src/unstable-core-do-not-import/router.ts",
388
+ "/src/unstable-core-do-not-import/middleware.ts",
389
389
  "/src/unstable-core-do-not-import/http/contentType.ts",
390
390
  "/src/unstable-core-do-not-import/procedureBuilder.ts",
391
391
  "/src/unstable-core-do-not-import/stream/sse.ts"
@@ -452,8 +452,8 @@
452
452
  "removedExports": [],
453
453
  "dependents": [
454
454
  "/src/unstable-core-do-not-import.ts",
455
- "/src/unstable-core-do-not-import/error/getErrorShape.ts",
456
- "/src/unstable-core-do-not-import/http/resolveResponse.ts"
455
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
456
+ "/src/unstable-core-do-not-import/error/getErrorShape.ts"
457
457
  ],
458
458
  "percent": 1.05,
459
459
  "reduction": 18.54
@@ -860,24 +860,24 @@
860
860
  "reduction": 93.9
861
861
  },
862
862
  {
863
- "id": "/src/index.ts",
863
+ "id": "/src/http.ts",
864
864
  "size": 0,
865
- "origSize": 32,
865
+ "origSize": 37,
866
866
  "renderedExports": [],
867
867
  "removedExports": [],
868
- "dependents": [],
868
+ "dependents": [
869
+ "/src/adapters/ws.ts"
870
+ ],
869
871
  "percent": 0,
870
872
  "reduction": 100
871
873
  },
872
874
  {
873
- "id": "/src/http.ts",
875
+ "id": "/src/index.ts",
874
876
  "size": 0,
875
- "origSize": 37,
877
+ "origSize": 32,
876
878
  "renderedExports": [],
877
879
  "removedExports": [],
878
- "dependents": [
879
- "/src/adapters/ws.ts"
880
- ],
880
+ "dependents": [],
881
881
  "percent": 0,
882
882
  "reduction": 100
883
883
  },
@@ -942,9 +942,9 @@
942
942
  "reduction": 100
943
943
  },
944
944
  {
945
- "id": "/src/adapters/fastify/index.ts",
945
+ "id": "/src/adapters/fetch/index.ts",
946
946
  "size": 0,
947
- "origSize": 78,
947
+ "origSize": 64,
948
948
  "renderedExports": [],
949
949
  "removedExports": [],
950
950
  "dependents": [],
@@ -952,9 +952,9 @@
952
952
  "reduction": 100
953
953
  },
954
954
  {
955
- "id": "/src/adapters/fetch/index.ts",
955
+ "id": "/src/adapters/fastify/index.ts",
956
956
  "size": 0,
957
- "origSize": 64,
957
+ "origSize": 78,
958
958
  "renderedExports": [],
959
959
  "removedExports": [],
960
960
  "dependents": [],
package/dist/index.js CHANGED
@@ -20,7 +20,6 @@ exports.getErrorShape = getErrorShape.getErrorShape;
20
20
  exports.TRPCError = TRPCError.TRPCError;
21
21
  exports.getTRPCErrorFromUnknown = TRPCError.getTRPCErrorFromUnknown;
22
22
  exports.callProcedure = router.callProcedure;
23
- exports.callTRPCProcedure = router.callProcedure;
24
23
  exports.experimental_lazy = router.lazy;
25
24
  exports.isTrackedEnvelope = tracked.isTrackedEnvelope;
26
25
  exports.sse = tracked.sse;
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  export { createFlatProxy as createTRPCFlatProxy } from './unstable-core-do-not-import/createProxy.mjs';
2
2
  export { getErrorShape } from './unstable-core-do-not-import/error/getErrorShape.mjs';
3
3
  export { TRPCError, getTRPCErrorFromUnknown } from './unstable-core-do-not-import/error/TRPCError.mjs';
4
- export { callProcedure, callProcedure as callTRPCProcedure, lazy as experimental_lazy } from './unstable-core-do-not-import/router.mjs';
4
+ export { callProcedure, lazy as experimental_lazy } from './unstable-core-do-not-import/router.mjs';
5
5
  import './vendor/unpromise/unpromise.mjs';
6
6
  import './unstable-core-do-not-import/stream/utils/disposable.mjs';
7
7
  export { isTrackedEnvelope, sse, tracked } from './unstable-core-do-not-import/stream/tracked.mjs';
@@ -86,7 +86,7 @@ const jsonContentTypeHandler = {
86
86
  return acc;
87
87
  });
88
88
  const calls = await Promise.all(paths.map(async (path, index)=>{
89
- const procedure = await router.getProcedureAtPath(opts.router._def, path);
89
+ const procedure = await router.getProcedureAtPath(opts.router, path);
90
90
  return {
91
91
  path,
92
92
  procedure,
@@ -152,7 +152,7 @@ const formDataContentTypeHandler = {
152
152
  const fd = await req.formData();
153
153
  return fd;
154
154
  });
155
- const procedure = await router.getProcedureAtPath(opts.router._def, opts.path);
155
+ const procedure = await router.getProcedureAtPath(opts.router, opts.path);
156
156
  return {
157
157
  accept: null,
158
158
  calls: [
@@ -192,7 +192,7 @@ const octetStreamContentTypeHandler = {
192
192
  path: opts.path,
193
193
  getRawInput: getInputs.read,
194
194
  result: getInputs.result,
195
- procedure: await router.getProcedureAtPath(opts.router._def, opts.path)
195
+ procedure: await router.getProcedureAtPath(opts.router, opts.path)
196
196
  }
197
197
  ],
198
198
  isBatchCall: false,
@@ -84,7 +84,7 @@ const jsonContentTypeHandler = {
84
84
  return acc;
85
85
  });
86
86
  const calls = await Promise.all(paths.map(async (path, index)=>{
87
- const procedure = await getProcedureAtPath(opts.router._def, path);
87
+ const procedure = await getProcedureAtPath(opts.router, path);
88
88
  return {
89
89
  path,
90
90
  procedure,
@@ -150,7 +150,7 @@ const formDataContentTypeHandler = {
150
150
  const fd = await req.formData();
151
151
  return fd;
152
152
  });
153
- const procedure = await getProcedureAtPath(opts.router._def, opts.path);
153
+ const procedure = await getProcedureAtPath(opts.router, opts.path);
154
154
  return {
155
155
  accept: null,
156
156
  calls: [
@@ -190,7 +190,7 @@ const octetStreamContentTypeHandler = {
190
190
  path: opts.path,
191
191
  getRawInput: getInputs.read,
192
192
  result: getInputs.result,
193
- procedure: await getProcedureAtPath(opts.router._def, opts.path)
193
+ procedure: await getProcedureAtPath(opts.router, opts.path)
194
194
  }
195
195
  ],
196
196
  isBatchCall: false,
@@ -56,7 +56,6 @@ export interface Router<TRoot extends AnyRootTypes, TRecord extends RouterRecord
56
56
  lazy: Record<string, LazyLoader<AnyRouter>>;
57
57
  };
58
58
  /**
59
- * @deprecated use `t.createCallerFactory(router)` instead
60
59
  * @see https://trpc.io/docs/v11/server/server-side-calls
61
60
  */
62
61
  createCaller: RouterCaller<TRoot, TRecord>;
@@ -77,12 +76,15 @@ export type DecorateCreateRouterOptions<TRouterOptions extends CreateRouterOptio
77
76
  * @internal
78
77
  */
79
78
  export declare function createRouterFactory<TRoot extends AnyRootTypes>(config: RootConfig<TRoot>): <TInput extends CreateRouterOptions>(input: TInput) => BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>>;
80
- export declare function getProcedureAtPath(_def: AnyRouter['_def'], path: string): Promise<AnyProcedure | null>;
79
+ /**
80
+ * @internal
81
+ */
82
+ export declare function getProcedureAtPath(router: Pick<Router<any, any>, '_def'>, path: string): Promise<AnyProcedure | null>;
81
83
  /**
82
84
  * @internal
83
85
  */
84
86
  export declare function callProcedure(opts: ProcedureCallOptions<unknown> & {
85
- _def: AnyRouter['_def'];
87
+ router: AnyRouter;
86
88
  allowMethodOverride?: boolean;
87
89
  }): Promise<any>;
88
90
  export declare function createCallerFactory<TRoot extends AnyRootTypes>(): <TRecord extends RouterRecord>(router: Pick<Router<TRoot, TRecord>, "_def">) => RouterCaller<TRoot, TRecord>;
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAA2B,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qCAAqC,EACtC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAW,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C,GACG,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,GAC3D,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAEhC,wBAAgB,YAAY,CAAC,QAAQ,SAAS,SAAS,EAAE,EACvD,GAAG,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,GAC3B,YAAY,CAAC,QAAQ,CAAC,CAoDxB"}
@@ -168,7 +168,10 @@ const emptyRouter = {
168
168
  function isProcedure(procedureOrRouter) {
169
169
  return typeof procedureOrRouter === 'function';
170
170
  }
171
- async function getProcedureAtPath(_def, path) {
171
+ /**
172
+ * @internal
173
+ */ async function getProcedureAtPath(router, path) {
174
+ const { _def } = router;
172
175
  let procedure = _def.procedures[path];
173
176
  while(!procedure){
174
177
  const key = Object.keys(_def.lazy).find((key)=>path.startsWith(key));
@@ -188,7 +191,7 @@ async function getProcedureAtPath(_def, path) {
188
191
  * @internal
189
192
  */ async function callProcedure(opts) {
190
193
  const { type, path } = opts;
191
- const proc = await getProcedureAtPath(opts._def, path);
194
+ const proc = await getProcedureAtPath(opts.router, path);
192
195
  if (!proc || !isProcedure(proc) || proc._def.type !== type && !opts.allowMethodOverride) {
193
196
  throw new TRPCError.TRPCError({
194
197
  code: 'NOT_FOUND',
@@ -205,14 +208,14 @@ async function getProcedureAtPath(_def, path) {
205
208
  }
206
209
  function createCallerFactory() {
207
210
  return function createCallerInner(router) {
208
- const _def = router._def;
211
+ const { _def } = router;
209
212
  return function createCaller(ctxOrCallback, opts) {
210
213
  return createProxy.createRecursiveProxy(async ({ path, args })=>{
211
214
  const fullPath = path.join('.');
212
215
  if (path.length === 1 && path[0] === '_def') {
213
216
  return _def;
214
217
  }
215
- const procedure = await getProcedureAtPath(_def, fullPath);
218
+ const procedure = await getProcedureAtPath(router, fullPath);
216
219
  let ctx = undefined;
217
220
  try {
218
221
  if (!procedure) {
@@ -166,7 +166,10 @@ const emptyRouter = {
166
166
  function isProcedure(procedureOrRouter) {
167
167
  return typeof procedureOrRouter === 'function';
168
168
  }
169
- async function getProcedureAtPath(_def, path) {
169
+ /**
170
+ * @internal
171
+ */ async function getProcedureAtPath(router, path) {
172
+ const { _def } = router;
170
173
  let procedure = _def.procedures[path];
171
174
  while(!procedure){
172
175
  const key = Object.keys(_def.lazy).find((key)=>path.startsWith(key));
@@ -186,7 +189,7 @@ async function getProcedureAtPath(_def, path) {
186
189
  * @internal
187
190
  */ async function callProcedure(opts) {
188
191
  const { type, path } = opts;
189
- const proc = await getProcedureAtPath(opts._def, path);
192
+ const proc = await getProcedureAtPath(opts.router, path);
190
193
  if (!proc || !isProcedure(proc) || proc._def.type !== type && !opts.allowMethodOverride) {
191
194
  throw new TRPCError({
192
195
  code: 'NOT_FOUND',
@@ -203,14 +206,14 @@ async function getProcedureAtPath(_def, path) {
203
206
  }
204
207
  function createCallerFactory() {
205
208
  return function createCallerInner(router) {
206
- const _def = router._def;
209
+ const { _def } = router;
207
210
  return function createCaller(ctxOrCallback, opts) {
208
211
  return createRecursiveProxy(async ({ path, args })=>{
209
212
  const fullPath = path.join('.');
210
213
  if (path.length === 1 && path[0] === '_def') {
211
214
  return _def;
212
215
  }
213
- const procedure = await getProcedureAtPath(_def, fullPath);
216
+ const procedure = await getProcedureAtPath(router, fullPath);
214
217
  let ctx = undefined;
215
218
  try {
216
219
  if (!procedure) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-rc.752+e31a1f599",
3
+ "version": "11.0.0-rc.753+a0ce6809f",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -152,5 +152,5 @@
152
152
  "peerDependencies": {
153
153
  "typescript": ">=5.7.2"
154
154
  },
155
- "gitHead": "e31a1f59920f20a5bcf690dc01ebda0c9ecf3e1b"
155
+ "gitHead": "a0ce6809f9411c748490eb1e9414ca1c0da70c57"
156
156
  }
@@ -7,7 +7,6 @@ export {
7
7
  experimental_standaloneMiddleware as experimental_trpcMiddleware,
8
8
  initTRPC,
9
9
  // --- FIXME a bunch of these exports are only useful for plugins - move them somewhere else? ----
10
- callProcedure as callTRPCProcedure,
11
10
  getTRPCErrorFromUnknown,
12
11
  transformTRPCResponse,
13
12
  createFlatProxy as createTRPCFlatProxy,
@@ -219,7 +219,7 @@ export function getWSConnectionHandler<TRouter extends AnyRouter>(
219
219
 
220
220
  const abortController = new AbortController();
221
221
  const result = await callProcedure({
222
- _def: router._def,
222
+ router,
223
223
  path,
224
224
  getRawInput: async () => input,
225
225
  ctx,
@@ -113,7 +113,7 @@ const jsonContentTypeHandler: ContentTypeHandler = {
113
113
  const calls = await Promise.all(
114
114
  paths.map(
115
115
  async (path, index): Promise<TRPCRequestInfo['calls'][number]> => {
116
- const procedure = await getProcedureAtPath(opts.router._def, path);
116
+ const procedure = await getProcedureAtPath(opts.router, path);
117
117
  return {
118
118
  path,
119
119
  procedure,
@@ -201,7 +201,7 @@ const formDataContentTypeHandler: ContentTypeHandler = {
201
201
  const fd = await req.formData();
202
202
  return fd;
203
203
  });
204
- const procedure = await getProcedureAtPath(opts.router._def, opts.path);
204
+ const procedure = await getProcedureAtPath(opts.router, opts.path);
205
205
  return {
206
206
  accept: null,
207
207
  calls: [
@@ -245,7 +245,7 @@ const octetStreamContentTypeHandler: ContentTypeHandler = {
245
245
  path: opts.path,
246
246
  getRawInput: getInputs.read,
247
247
  result: getInputs.result,
248
- procedure: await getProcedureAtPath(opts.router._def, opts.path),
248
+ procedure: await getProcedureAtPath(opts.router, opts.path),
249
249
  },
250
250
  ],
251
251
  isBatchCall: false,
@@ -145,7 +145,6 @@ export interface Router<
145
145
  lazy: Record<string, LazyLoader<AnyRouter>>;
146
146
  };
147
147
  /**
148
- * @deprecated use `t.createCallerFactory(router)` instead
149
148
  * @see https://trpc.io/docs/v11/server/server-side-calls
150
149
  */
151
150
  createCaller: RouterCaller<TRoot, TRecord>;
@@ -346,10 +345,14 @@ function isProcedure(
346
345
  return typeof procedureOrRouter === 'function';
347
346
  }
348
347
 
348
+ /**
349
+ * @internal
350
+ */
349
351
  export async function getProcedureAtPath(
350
- _def: AnyRouter['_def'],
352
+ router: Pick<Router<any, any>, '_def'>,
351
353
  path: string,
352
354
  ): Promise<AnyProcedure | null> {
355
+ const { _def } = router;
353
356
  let procedure = _def.procedures[path];
354
357
 
355
358
  while (!procedure) {
@@ -375,12 +378,12 @@ export async function getProcedureAtPath(
375
378
  */
376
379
  export async function callProcedure(
377
380
  opts: ProcedureCallOptions<unknown> & {
378
- _def: AnyRouter['_def'];
381
+ router: AnyRouter;
379
382
  allowMethodOverride?: boolean;
380
383
  },
381
384
  ) {
382
385
  const { type, path } = opts;
383
- const proc = await getProcedureAtPath(opts._def, path);
386
+ const proc = await getProcedureAtPath(opts.router, path);
384
387
  if (
385
388
  !proc ||
386
389
  !isProcedure(proc) ||
@@ -411,7 +414,7 @@ export function createCallerFactory<TRoot extends AnyRootTypes>() {
411
414
  return function createCallerInner<TRecord extends RouterRecord>(
412
415
  router: Pick<Router<TRoot, TRecord>, '_def'>,
413
416
  ): RouterCaller<TRoot, TRecord> {
414
- const _def = router._def;
417
+ const { _def } = router;
415
418
  type Context = TRoot['ctx'];
416
419
 
417
420
  return function createCaller(ctxOrCallback, opts) {
@@ -423,7 +426,7 @@ export function createCallerFactory<TRoot extends AnyRootTypes>() {
423
426
  return _def;
424
427
  }
425
428
 
426
- const procedure = await getProcedureAtPath(_def, fullPath);
429
+ const procedure = await getProcedureAtPath(router, fullPath);
427
430
 
428
431
  let ctx: Context | undefined = undefined;
429
432
  try {