@trpc/server 11.0.0-alpha-tmp.198 → 11.0.0-alpha-tmp.213

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.
@@ -1,8 +1,7 @@
1
1
  import type { AnyRouter, inferRouterContext } from '@trpc/core';
2
- import { OnErrorFunction } from '@trpc/core';
3
2
  import type { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2, Context as APIGWContext } from 'aws-lambda';
4
3
  import { TRPCRequestInfo } from '../../http';
5
- import type { HTTPHeaders, ResponseMetaFn } from '../../http';
4
+ import type { HTTPHeaders, OnErrorFunction, ResponseMetaFn } from '../../http';
6
5
  export type APIGatewayEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
7
6
  export type APIGatewayResult = APIGatewayProxyResult | APIGatewayProxyStructuredResultV2;
8
7
  export type CreateAWSLambdaContextOptions<TEvent extends APIGatewayEvent> = {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,eAAe,EAAa,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EACjC,OAAO,IAAI,YAAY,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAC5E,MAAM,MAAM,gBAAgB,GACxB,qBAAqB,GACrB,iCAAiC,CAAC;AAEtC,MAAM,MAAM,6BAA6B,CAAC,MAAM,SAAS,eAAe,IA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ClB,CAAC;IACF,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACxC,GAAG,CACA;IACE;;QAEI;IACJ,aAAa,EAAE,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;CAC1D,GACD;IACE;;QAEI;IACJ,aAAa,CAAC,EAAE,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;CAC3D,CACJ,CAAC;AAEN,wBAAgB,WAAW,CACzB,KAAK,EAAE,eAAe,GACrB,KAAK,IAAI,oBAAoB,CAE/B;AACD,wBAAgB,WAAW,CACzB,KAAK,EAAE,eAAe,GACrB,KAAK,IAAI,sBAAsB,CAEjC;AAoBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,UAWnD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,eAAe,UA+B7C;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,GACnB,gBAAgB,CAAC,SAAS,CAAC,CAU7B;AAED,MAAM,MAAM,+BAA+B,GAAG,KAAK,GAAG,KAAK,CAAC;AAC5D,MAAM,MAAM,8BAA8B,GACtC,+BAA+B,GAC/B,QAAQ,CAAC;AAEb,eAAO,MAAM,4CAA4C,QAEiD,CAAC"}
@@ -8,7 +8,6 @@ var adapters_ws = require('../ws.js');
8
8
  require('@trpc/core');
9
9
  require('@trpc/core/observable');
10
10
  require('@trpc/core/rpc');
11
- require('@trpc/core/shared');
12
11
 
13
12
  async function fastifyRequestHandler(opts) {
14
13
  const createContext = async (innerOpts)=>{
@@ -4,7 +4,6 @@ import { applyWSSHandler } from '../ws.mjs';
4
4
  import '@trpc/core';
5
5
  import '@trpc/core/observable';
6
6
  import '@trpc/core/rpc';
7
- import '@trpc/core/shared';
8
7
 
9
8
  async function fastifyRequestHandler(opts) {
10
9
  const createContext = async (innerOpts)=>{
@@ -1 +1 @@
1
- {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EAEvB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,CACnE,cAAc,EACd,eAAe,CAChB,CAAC;AACF,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE5E,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,SAAS,EAC5D,IAAI,EAAE,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,eAAe,CAAC,GACrE,cAAc,CA8ChB"}
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4B,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EAEvB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,CACnE,cAAc,EACd,eAAe,CAChB,CAAC;AACF,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE5E,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,SAAS,EAC5D,IAAI,EAAE,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,eAAe,CAAC,GACrE,cAAc,CA8ChB"}
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@trpc/core');
6
- var shared = require('@trpc/core/shared');
7
6
  var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-30028c9a.js');
8
7
  require('@trpc/core/http');
9
8
  require('./node-http/content-type/json/index.js');
@@ -22,7 +21,7 @@ function createNextApiHandler(opts) {
22
21
  }
23
22
  const path = getPath();
24
23
  if (path === null) {
25
- const error = shared.getErrorShape({
24
+ const error = core.getErrorShape({
26
25
  config: opts.router._def._config,
27
26
  error: new core.TRPCError({
28
27
  message: 'Query "trpc" not found - is the file named `[trpc]`.ts or `[...trpc].ts`?',
@@ -1,5 +1,4 @@
1
- import { TRPCError } from '@trpc/core';
2
- import { getErrorShape } from '@trpc/core/shared';
1
+ import { getErrorShape, TRPCError } from '@trpc/core';
3
2
  import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-36974696.mjs';
4
3
  import '@trpc/core/http';
5
4
  import './node-http/content-type/json/index.mjs';
@@ -3,7 +3,7 @@
3
3
  /// <reference types="node" />
4
4
  import { IncomingMessage } from 'http';
5
5
  import { AnyRouter, inferRouterContext, MaybePromise } from '@trpc/core';
6
- import { BaseHandlerOptions } from '@trpc/core/internals';
6
+ import { BaseHandlerOptions } from '@trpc/core/http';
7
7
  import { WebSocket, WebSocketServer } from 'ws';
8
8
  import { NodeHTTPCreateContextFnOptions } from './node-http';
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src/adapters/ws.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EACL,SAAS,EAGT,kBAAkB,EAClB,YAAY,EAEb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAU1D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,8BAA8B,CAAC,eAAe,EAAE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AAC,OAAO,SAAS,SAAS,IAAI,CAC1D,IAAI,EAAE,yBAAyB,KAC5B,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,SAAS,IAAI,kBAAkB,CAC3E,OAAO,EACP,eAAe,CAChB,GACC,CAAC,MAAM,SAAS,kBAAkB,CAAC,OAAO,CAAC,GACvC;IACE;;QAEI;IACJ,aAAa,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;CAC7C,GACD;IACE;;QAEI;IACJ,aAAa,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;CAC5C,CAAC,GAAG;IACP,GAAG,EAAE,eAAe,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC;CAC1B,CAAC;AAEJ,wBAAgB,eAAe,CAAC,OAAO,SAAS,SAAS,EACvD,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC;;EAwQjC"}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var core = require('@trpc/core');
6
6
  var observable = require('@trpc/core/observable');
7
7
  var rpc = require('@trpc/core/rpc');
8
- var shared = require('@trpc/core/shared');
9
8
 
10
9
  function applyWSSHandler(opts) {
11
10
  const { wss , createContext , router } = opts;
@@ -13,7 +12,7 @@ function applyWSSHandler(opts) {
13
12
  wss.on('connection', async (client, req)=>{
14
13
  const clientSubscriptions = new Map();
15
14
  function respond(untransformedJSON) {
16
- client.send(JSON.stringify(shared.transformTRPCResponse(router._def._config, untransformedJSON)));
15
+ client.send(JSON.stringify(core.transformTRPCResponse(router._def._config, untransformedJSON)));
17
16
  }
18
17
  function stopSubscription(subscription, { id , jsonrpc }) {
19
18
  subscription.unsubscribe();
@@ -104,7 +103,7 @@ function applyWSSHandler(opts) {
104
103
  respond({
105
104
  id,
106
105
  jsonrpc,
107
- error: shared.getErrorShape({
106
+ error: core.getErrorShape({
108
107
  config: router._def._config,
109
108
  error,
110
109
  type,
@@ -163,7 +162,7 @@ function applyWSSHandler(opts) {
163
162
  respond({
164
163
  id,
165
164
  jsonrpc,
166
- error: shared.getErrorShape({
165
+ error: core.getErrorShape({
167
166
  config: router._def._config,
168
167
  error,
169
168
  type,
@@ -190,7 +189,7 @@ function applyWSSHandler(opts) {
190
189
  });
191
190
  respond({
192
191
  id: null,
193
- error: shared.getErrorShape({
192
+ error: core.getErrorShape({
194
193
  config: router._def._config,
195
194
  error,
196
195
  type: 'unknown',
@@ -236,7 +235,7 @@ function applyWSSHandler(opts) {
236
235
  });
237
236
  respond({
238
237
  id: null,
239
- error: shared.getErrorShape({
238
+ error: core.getErrorShape({
240
239
  config: router._def._config,
241
240
  error,
242
241
  type: 'unknown',
@@ -1,7 +1,6 @@
1
- import { TRPCError, getTRPCErrorFromUnknown, callProcedure } from '@trpc/core';
1
+ import { TRPCError, getErrorShape, getTRPCErrorFromUnknown, transformTRPCResponse, callProcedure } from '@trpc/core';
2
2
  import { isObservable } from '@trpc/core/observable';
3
3
  import { parseTRPCMessage } from '@trpc/core/rpc';
4
- import { getErrorShape, transformTRPCResponse } from '@trpc/core/shared';
5
4
 
6
5
  function applyWSSHandler(opts) {
7
6
  const { wss , createContext , router } = opts;
@@ -1,12 +1,12 @@
1
1
  {
2
- "bundleSize": 52022,
3
- "bundleOrigSize": 71843,
4
- "bundleReduction": 27.59,
2
+ "bundleSize": 52010,
3
+ "bundleOrigSize": 71742,
4
+ "bundleReduction": 27.5,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/adapters/ws.ts",
8
- "size": 9603,
9
- "origSize": 8812,
8
+ "size": 9593,
9
+ "origSize": 8775,
10
10
  "renderedExports": [
11
11
  "applyWSSHandler"
12
12
  ],
@@ -14,7 +14,7 @@
14
14
  "dependents": [
15
15
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
16
16
  ],
17
- "percent": 18.46,
17
+ "percent": 18.44,
18
18
  "reduction": 0
19
19
  },
20
20
  {
@@ -30,7 +30,7 @@
30
30
  "dependents": [
31
31
  "/src/adapters/node-http/content-type/form-data/index.ts"
32
32
  ],
33
- "percent": 11.3,
33
+ "percent": 11.31,
34
34
  "reduction": 7.43
35
35
  },
36
36
  {
@@ -46,7 +46,7 @@
46
46
  "dependents": [
47
47
  "/src/adapters/node-http/content-type/form-data/index.ts"
48
48
  ],
49
- "percent": 9.49,
49
+ "percent": 9.5,
50
50
  "reduction": 36.93
51
51
  },
52
52
  {
@@ -177,15 +177,15 @@
177
177
  },
178
178
  {
179
179
  "id": "/src/adapters/next.ts",
180
- "size": 1253,
181
- "origSize": 1728,
180
+ "size": 1251,
181
+ "origSize": 1692,
182
182
  "renderedExports": [
183
183
  "createNextApiHandler"
184
184
  ],
185
185
  "removedExports": [],
186
186
  "dependents": [],
187
187
  "percent": 2.41,
188
- "reduction": 27.49
188
+ "reduction": 26.06
189
189
  },
190
190
  {
191
191
  "id": "/src/adapters/fastify/fastifyTRPCPlugin.ts",
@@ -277,7 +277,7 @@
277
277
  ],
278
278
  "removedExports": [],
279
279
  "dependents": [],
280
- "percent": 1.26,
280
+ "percent": 1.27,
281
281
  "reduction": 49.73
282
282
  },
283
283
  {
@@ -374,7 +374,7 @@
374
374
  {
375
375
  "id": "/src/index.ts",
376
376
  "size": 0,
377
- "origSize": 751,
377
+ "origSize": 831,
378
378
  "renderedExports": [],
379
379
  "removedExports": [],
380
380
  "dependents": [],
@@ -400,17 +400,7 @@
400
400
  "dependents": [],
401
401
  "percent": 0,
402
402
  "reduction": 100
403
- },
404
- {
405
- "id": "/src/shared.ts",
406
- "size": 0,
407
- "origSize": 108,
408
- "renderedExports": [],
409
- "removedExports": [],
410
- "dependents": [],
411
- "percent": 0,
412
- "reduction": 100
413
403
  }
414
404
  ],
415
- "moduleCount": 29
405
+ "moduleCount": 28
416
406
  }
package/dist/index.d.ts CHANGED
@@ -1,14 +1,8 @@
1
- export { initTRPC, TRPCError,
1
+ export { TRPCError,
2
2
  /**
3
3
  * @deprecated use `experimental_trpcMiddleware` instead
4
4
  */
5
- experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, type inferProcedureInput, type inferProcedureOutput, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, } from './index.core';
6
- export type {
7
- /**
8
- * @deprecated
9
- * Use `Awaited<ReturnType<T>>` instead
10
- */
11
- inferAsyncReturnType, } from './index.core';
5
+ experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC, type inferProcedureInput, type inferProcedureOutput, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type AnyProcedure as AnyTRPCProcedure, type AnyRouter as AnyTRPCRouter, } from './unstableDoNotImportThis';
12
6
  export type {
13
7
  /**
14
8
  * @deprecated use `AnyTRPCProcedure` instead
@@ -17,5 +11,10 @@ AnyProcedure,
17
11
  /**
18
12
  * @deprecated use `AnyTRPCRouter` instead
19
13
  */
20
- AnyRouter, AnyProcedure as AnyTRPCProcedure, AnyRouter as AnyTRPCRouter, } from './index.core';
14
+ AnyRouter, } from '@trpc/core';
15
+ /**
16
+ * @deprecated
17
+ * Use `Awaited<ReturnType<typeof myFunction>>` instead
18
+ */
19
+ export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> = Awaited<ReturnType<TFunction>>;
21
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,SAAS;AACT;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,cAAc,CAAC;AAEtB,YAAY;AACV;;;GAGG;AACH,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,YAAY;AACV;;GAEG;AACH,YAAY;AACZ;;GAEG;AACH,SAAS,EACT,YAAY,IAAI,gBAAgB,EAChC,SAAS,IAAI,aAAa,GAC3B,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS;AACT;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,YAAY,IAAI,gBAAgB,EACrC,KAAK,SAAS,IAAI,aAAa,GAChC,MAAM,2BAA2B,CAAC;AAEnC,YAAY;AACV;;GAEG;AACH,YAAY;AACZ;;GAEG;AACH,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB;;;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"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is here to make TypeScript happy and prevent _"The inferred type of 'createContext' cannot be named without a reference to [...]"_.
3
+ *
4
+ * We're basically just re-exporting everything from @trpc/core here.
5
+ *
6
+ * If you need to import anything from here, please open an issue at https://github.com/trpc/trpc/issues
7
+ */
8
+ export * from '@trpc/core';
9
+ //# sourceMappingURL=unstableDoNotImportThis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unstableDoNotImportThis.d.ts","sourceRoot":"","sources":["../src/unstableDoNotImportThis.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-alpha-tmp.198+d54dfc68a",
3
+ "version": "11.0.0-alpha-tmp.213+24a3b8da5",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -131,7 +131,7 @@
131
131
  "access": "public"
132
132
  },
133
133
  "dependencies": {
134
- "@trpc/core": "11.0.0-alpha-tmp.198+d54dfc68a"
134
+ "@trpc/core": "11.0.0-alpha-tmp.213+24a3b8da5"
135
135
  },
136
136
  "devDependencies": {
137
137
  "@fastify/websocket": "^7.1.2",
@@ -170,5 +170,5 @@
170
170
  "funding": [
171
171
  "https://trpc.io/sponsor"
172
172
  ],
173
- "gitHead": "d54dfc68a56cde8005738e4217286c430df3fc4e"
173
+ "gitHead": "24a3b8da51c73373bffe5f6888a23af2642c6d3c"
174
174
  }
@@ -1,5 +1,5 @@
1
1
  import type { AnyRouter, inferRouterContext } from '@trpc/core';
2
- import { OnErrorFunction, TRPCError } from '@trpc/core';
2
+ import { TRPCError } from '@trpc/core';
3
3
  import type {
4
4
  APIGatewayProxyEvent,
5
5
  APIGatewayProxyEventV2,
@@ -8,7 +8,7 @@ import type {
8
8
  Context as APIGWContext,
9
9
  } from 'aws-lambda';
10
10
  import { TRPCRequestInfo } from '../../http';
11
- import type { HTTPHeaders, ResponseMetaFn } from '../../http';
11
+ import type { HTTPHeaders, OnErrorFunction, ResponseMetaFn } from '../../http';
12
12
 
13
13
  export type APIGatewayEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
14
14
  export type APIGatewayResult =
@@ -1,5 +1,4 @@
1
- import { AnyRouter, TRPCError } from '@trpc/core';
2
- import { getErrorShape } from '@trpc/core/shared';
1
+ import { AnyRouter, getErrorShape, TRPCError } from '@trpc/core';
3
2
  import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
4
3
  import {
5
4
  NodeHTTPCreateContextFnOptions,
@@ -2,12 +2,14 @@ import { IncomingMessage } from 'http';
2
2
  import {
3
3
  AnyRouter,
4
4
  callProcedure,
5
+ getErrorShape,
5
6
  getTRPCErrorFromUnknown,
6
7
  inferRouterContext,
7
8
  MaybePromise,
9
+ transformTRPCResponse,
8
10
  TRPCError,
9
11
  } from '@trpc/core';
10
- import { BaseHandlerOptions } from '@trpc/core/internals';
12
+ import { BaseHandlerOptions } from '@trpc/core/http';
11
13
  import { isObservable, Unsubscribable } from '@trpc/core/observable';
12
14
  import {
13
15
  JSONRPC2,
@@ -16,7 +18,6 @@ import {
16
18
  TRPCReconnectNotification,
17
19
  TRPCResponseMessage,
18
20
  } from '@trpc/core/rpc';
19
- import { getErrorShape, transformTRPCResponse } from '@trpc/core/shared';
20
21
  import { WebSocket, WebSocketServer } from 'ws';
21
22
  import { NodeHTTPCreateContextFnOptions } from './node-http';
22
23
 
package/src/index.ts CHANGED
@@ -1,25 +1,19 @@
1
1
  export {
2
- initTRPC,
3
2
  TRPCError,
4
3
  /**
5
4
  * @deprecated use `experimental_trpcMiddleware` instead
6
5
  */
7
6
  experimental_standaloneMiddleware,
8
7
  experimental_standaloneMiddleware as experimental_trpcMiddleware,
8
+ initTRPC,
9
9
  type inferProcedureInput,
10
10
  type inferProcedureOutput,
11
11
  type inferRouterError,
12
12
  type inferRouterInputs,
13
13
  type inferRouterOutputs,
14
- } from './index.core';
15
-
16
- export type {
17
- /**
18
- * @deprecated
19
- * Use `Awaited<ReturnType<T>>` instead
20
- */
21
- inferAsyncReturnType,
22
- } from './index.core';
14
+ type AnyProcedure as AnyTRPCProcedure,
15
+ type AnyRouter as AnyTRPCRouter,
16
+ } from './unstableDoNotImportThis';
23
17
 
24
18
  export type {
25
19
  /**
@@ -30,6 +24,11 @@ export type {
30
24
  * @deprecated use `AnyTRPCRouter` instead
31
25
  */
32
26
  AnyRouter,
33
- AnyProcedure as AnyTRPCProcedure,
34
- AnyRouter as AnyTRPCRouter,
35
- } from './index.core';
27
+ } from '@trpc/core';
28
+
29
+ /**
30
+ * @deprecated
31
+ * Use `Awaited<ReturnType<typeof myFunction>>` instead
32
+ */
33
+ export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> =
34
+ Awaited<ReturnType<TFunction>>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is here to make TypeScript happy and prevent _"The inferred type of 'createContext' cannot be named without a reference to [...]"_.
3
+ *
4
+ * We're basically just re-exporting everything from @trpc/core here.
5
+ *
6
+ * If you need to import anything from here, please open an issue at https://github.com/trpc/trpc/issues
7
+ */
8
+
9
+ export * from '@trpc/core';
@@ -1,7 +0,0 @@
1
- /**
2
- * This file is here to make TypeScript happy.
3
- *
4
- * If you need to import anything from here, please open an issue.
5
- */
6
- export * from '@trpc/core';
7
- //# sourceMappingURL=index.core.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.core.d.ts","sourceRoot":"","sources":["../src/index.core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,YAAY,CAAC"}
package/dist/shared.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from '@trpc/core/shared';
2
- //# sourceMappingURL=shared.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC"}
package/dist/shared.js DELETED
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var shared = require('@trpc/core/shared');
6
-
7
-
8
-
9
- Object.keys(shared).forEach(function (k) {
10
- if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
11
- enumerable: true,
12
- get: function () { return shared[k]; }
13
- });
14
- });
package/dist/shared.mjs DELETED
@@ -1 +0,0 @@
1
- export * from '@trpc/core/shared';
package/src/index.core.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * This file is here to make TypeScript happy.
3
- *
4
- * If you need to import anything from here, please open an issue.
5
- */
6
- export * from '@trpc/core';
package/src/shared.ts DELETED
@@ -1,2 +0,0 @@
1
- // Note: this should likely be moved to a sort of `@trpc/plugin` package
2
- export * from '@trpc/core/shared';