@trpc/server 11.1.3-canary.4 → 11.1.3

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 (36) hide show
  1. package/adapters/node-http/content-type/form-data/index.d.ts +1 -0
  2. package/adapters/node-http/content-type/form-data/index.js +1 -0
  3. package/adapters/node-http/content-type/json/index.d.ts +1 -0
  4. package/adapters/node-http/content-type/json/index.js +1 -0
  5. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +1 -1
  6. package/dist/unstable-core-do-not-import/error/TRPCError.js +2 -9
  7. package/dist/unstable-core-do-not-import/error/TRPCError.mjs +2 -9
  8. package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +1 -1
  9. package/dist/unstable-core-do-not-import/http/contentType.js +10 -12
  10. package/dist/unstable-core-do-not-import/http/contentType.mjs +10 -12
  11. package/dist/unstable-core-do-not-import/http/types.d.ts +1 -1
  12. package/dist/unstable-core-do-not-import/http/types.d.ts.map +1 -1
  13. package/dist/unstable-core-do-not-import/procedure.d.ts +2 -0
  14. package/dist/unstable-core-do-not-import/procedure.d.ts.map +1 -1
  15. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +4 -0
  16. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -1
  17. package/dist/unstable-core-do-not-import/procedureBuilder.js +1 -0
  18. package/dist/unstable-core-do-not-import/procedureBuilder.mjs +1 -0
  19. package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts.map +1 -1
  20. package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.js +5 -0
  21. package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.mjs +5 -0
  22. package/package.json +4 -4
  23. package/src/adapters/node-http/__generated__/cert.csr +16 -0
  24. package/src/adapters/node-http/__generated__/certificate/cert.csr +16 -0
  25. package/src/adapters/node-http/__generated__/certificate/certificate.crt +21 -0
  26. package/src/adapters/node-http/__generated__/certificate/private.key +28 -0
  27. package/src/adapters/node-http/__generated__/certificate.crt +21 -0
  28. package/src/adapters/node-http/__generated__/private.key +28 -0
  29. package/src/adapters/ws.ts +2 -2
  30. package/src/unstable-core-do-not-import/error/TRPCError.ts +2 -10
  31. package/src/unstable-core-do-not-import/http/contentType.ts +11 -12
  32. package/src/unstable-core-do-not-import/http/types.ts +1 -1
  33. package/src/unstable-core-do-not-import/procedure.ts +2 -0
  34. package/src/unstable-core-do-not-import/procedureBuilder.ts +7 -0
  35. package/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts +6 -0
  36. package/dist/bundle-analysis.json +0 -997
@@ -366,6 +366,7 @@ export interface ProcedureBuilder<
366
366
  : QueryProcedure<{
367
367
  input: DefaultValue<TInputIn, void>;
368
368
  output: DefaultValue<TOutputOut, $Output>;
369
+ meta: TMeta;
369
370
  }>;
370
371
 
371
372
  /**
@@ -388,6 +389,7 @@ export interface ProcedureBuilder<
388
389
  : MutationProcedure<{
389
390
  input: DefaultValue<TInputIn, void>;
390
391
  output: DefaultValue<TOutputOut, $Output>;
392
+ meta: TMeta;
391
393
  }>;
392
394
 
393
395
  /**
@@ -408,6 +410,7 @@ export interface ProcedureBuilder<
408
410
  : SubscriptionProcedure<{
409
411
  input: DefaultValue<TInputIn, void>;
410
412
  output: inferSubscriptionOutput<DefaultValue<TOutputOut, $Output>>;
413
+ meta: TMeta;
411
414
  }>;
412
415
  /**
413
416
  * @deprecated Using subscriptions with an observable is deprecated. Use an async generator instead.
@@ -428,6 +431,7 @@ export interface ProcedureBuilder<
428
431
  : LegacyObservableSubscriptionProcedure<{
429
432
  input: DefaultValue<TInputIn, void>;
430
433
  output: inferObservableValue<DefaultValue<TOutputOut, $Output>>;
434
+ meta: TMeta;
431
435
  }>;
432
436
  /**
433
437
  * Overrides the way a procedure is invoked
@@ -592,6 +596,7 @@ function createResolver(
592
596
  };
593
597
 
594
598
  callerWrapper._def = _def;
599
+
595
600
  return callerWrapper;
596
601
  }
597
602
 
@@ -642,6 +647,7 @@ async function callRecursive(
642
647
  });
643
648
  },
644
649
  });
650
+
645
651
  return result;
646
652
  } catch (cause) {
647
653
  return {
@@ -678,6 +684,7 @@ function createProcedureCaller(_def: AnyProcedureBuilderDef): AnyProcedure {
678
684
 
679
685
  procedure._def = _def;
680
686
  procedure.procedure = true;
687
+ procedure.meta = _def.meta;
681
688
 
682
689
  // FIXME typecast shouldn't be needed - fixittt
683
690
  return procedure as unknown as AnyProcedure;
@@ -8,6 +8,12 @@ export function iteratorResource<TYield, TReturn, TNext>(
8
8
  ): AsyncIterator<TYield, TReturn, TNext> & AsyncDisposable {
9
9
  const iterator = iterable[Symbol.asyncIterator]();
10
10
 
11
+ // @ts-expect-error - this is added in node 24 which we don't officially support yet
12
+ // eslint-disable-next-line no-restricted-syntax
13
+ if (iterator[Symbol.asyncDispose]) {
14
+ return iterator as AsyncIterator<TYield, TReturn, TNext> & AsyncDisposable;
15
+ }
16
+
11
17
  return makeAsyncResource(iterator, async () => {
12
18
  await iterator.return?.();
13
19
  });