@trpc/server 11.0.0-next-alpha.175 → 11.0.0-next-beta.190
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.
- package/dist/@trpc-server.d.ts +34 -2
- package/dist/@trpc-server.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/utils.d.ts +2 -2
- package/dist/adapters/fetch/types.d.ts +2 -2
- package/dist/adapters/node-http/content-type/form-data/index.d.ts +1 -1
- package/dist/adapters/node-http/content-type/form-data/index.js +1 -1
- package/dist/adapters/node-http/content-type/form-data/index.mjs +1 -1
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts +1 -1
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts +1 -1
- package/dist/adapters/node-http/types.d.ts +2 -2
- package/dist/adapters/ws.d.ts +2 -2
- package/dist/adapters/ws.js +1 -1
- package/dist/adapters/ws.mjs +1 -1
- package/dist/bundle-analysis.json +26 -16
- package/dist/index.js +4 -0
- package/dist/index.mjs +1 -1
- package/dist/shared.d.ts +26 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +16 -0
- package/dist/shared.mjs +1 -0
- package/package.json +3 -3
- package/src/@trpc-server.ts +45 -0
- package/src/adapters/aws-lambda/utils.ts +2 -2
- package/src/adapters/fetch/types.ts +2 -2
- package/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts +1 -1
- package/src/adapters/node-http/content-type/form-data/index.ts +2 -2
- package/src/adapters/node-http/content-type/form-data/memoryUploadHandler.ts +1 -1
- package/src/adapters/node-http/content-type/form-data/uploadHandler.ts +1 -1
- package/src/adapters/node-http/types.ts +2 -2
- package/src/adapters/ws.ts +3 -3
- package/src/shared.ts +26 -0
package/dist/@trpc-server.d.ts
CHANGED
|
@@ -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, type inferProcedureInput, type inferProcedureOutput, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferRouterContext, type AnyProcedure as AnyTRPCProcedure, type AnyRouter as AnyTRPCRouter, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type CombinedDataTransformer as TRPCCombinedDataTransformer, } from './@trpc-core-unstable-do-not-import-this-please';
|
|
5
|
+
experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC, callProcedure as callTRPCProcedure, getTRPCErrorFromUnknown, transformTRPCResponse, createFlatProxy as createTRPCFlatProxy, type inferProcedureInput, type inferProcedureOutput, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferRouterContext, 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 ProcedureRouterRecord as TRPCProcedureRouterRecord, type ProcedureArgs as TRPCProcedureArgs, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, } from './@trpc-core-unstable-do-not-import-this-please';
|
|
6
6
|
export type {
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated use `AnyTRPCProcedure` instead
|
|
@@ -19,7 +19,39 @@ AnyMiddlewareFunction,
|
|
|
19
19
|
/**
|
|
20
20
|
* @deprecated use `TRPCCombinedDataTransformer` instead
|
|
21
21
|
*/
|
|
22
|
-
CombinedDataTransformer,
|
|
22
|
+
CombinedDataTransformer,
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated This is a utility type will be removed in v12
|
|
25
|
+
*/
|
|
26
|
+
Dict,
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated This is a utility type will be removed in v12
|
|
29
|
+
*/
|
|
30
|
+
DeepPartial,
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated use `TRPCProcedureType` instead
|
|
33
|
+
*/
|
|
34
|
+
ProcedureType,
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated use `AnyTRPCMutationProcedure` instead
|
|
37
|
+
*/
|
|
38
|
+
AnyMutationProcedure,
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated use `AnyTRPCQueryProcedure` instead
|
|
41
|
+
*/
|
|
42
|
+
AnyQueryProcedure,
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated use `TRPCProcedureRouterRecord` instead
|
|
45
|
+
*/
|
|
46
|
+
ProcedureRouterRecord,
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated use `TRPCProcedureArgs` instead
|
|
49
|
+
*/
|
|
50
|
+
ProcedureArgs,
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated use `AnyTRPCSubscriptionProcedure` instead
|
|
53
|
+
*/
|
|
54
|
+
AnySubscriptionProcedure, } from '@trpc/core';
|
|
23
55
|
export {
|
|
24
56
|
/**
|
|
25
57
|
* @deprecated use `getTRPCErrorShape` instead
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"@trpc-server.d.ts","sourceRoot":"","sources":["../src/@trpc-server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS;AACT;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,QAAQ,
|
|
1
|
+
{"version":3,"file":"@trpc-server.d.ts","sourceRoot":"","sources":["../src/@trpc-server.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,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,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,qBAAqB,IAAI,yBAAyB,EACvD,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,wBAAwB,IAAI,4BAA4B,GAC9D,MAAM,iDAAiD,CAAC;AAEzD,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,qBAAqB;AACrB;;GAEG;AACH,aAAa;AACb;;GAEG;AACH,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAEpB,OAAO;AACL;;GAEG;AACH,aAAa;AAEb;;GAEG;AACH,aAAa,GACd,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"}
|
|
@@ -28,12 +28,12 @@ export type AWSLambdaOptions<TRouter extends AnyRouter, TEvent extends APIGatewa
|
|
|
28
28
|
responseMeta?: ResponseMetaFn<TRouter>;
|
|
29
29
|
} & ({
|
|
30
30
|
/**
|
|
31
|
-
* @link https://trpc.io/docs/context
|
|
31
|
+
* @link https://trpc.io/docs/v11/context
|
|
32
32
|
**/
|
|
33
33
|
createContext: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
34
34
|
} | {
|
|
35
35
|
/**
|
|
36
|
-
* @link https://trpc.io/docs/context
|
|
36
|
+
* @link https://trpc.io/docs/v11/context
|
|
37
37
|
**/
|
|
38
38
|
createContext?: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
39
39
|
});
|
|
@@ -18,12 +18,12 @@ export type FetchCreateContextFnOptions = {
|
|
|
18
18
|
export type FetchCreateContextFn<TRouter extends AnyRouter> = (opts: FetchCreateContextFnOptions) => inferRouterContext<TRouter> | Promise<inferRouterContext<TRouter>>;
|
|
19
19
|
export type FetchCreateContextOption<TRouter extends AnyRouter> = unknown extends inferRouterContext<TRouter> ? {
|
|
20
20
|
/**
|
|
21
|
-
* @link https://trpc.io/docs/context
|
|
21
|
+
* @link https://trpc.io/docs/v11/context
|
|
22
22
|
**/
|
|
23
23
|
createContext?: FetchCreateContextFn<TRouter>;
|
|
24
24
|
} : {
|
|
25
25
|
/**
|
|
26
|
-
* @link https://trpc.io/docs/context
|
|
26
|
+
* @link https://trpc.io/docs/v11/context
|
|
27
27
|
**/
|
|
28
28
|
createContext: FetchCreateContextFn<TRouter>;
|
|
29
29
|
};
|
|
@@ -14,7 +14,7 @@ import type { UploadHandler } from './uploadHandler';
|
|
|
14
14
|
* @param uploadHandler A function that handles file uploads and returns a value to be used in the request body. If uploaded to disk, the returned value is a NodeOnDiskFile. If uploaded to memory, the returned value is a File.
|
|
15
15
|
* @param maxBodySize The maximum size of the request body in bytes. Defaults to Infinity.
|
|
16
16
|
*
|
|
17
|
-
* @
|
|
17
|
+
* @link https://remix.run/utils/parse-multipart-form-data
|
|
18
18
|
*/
|
|
19
19
|
declare function parseMultipartFormData(request: NodeHTTPRequest, uploadHandler: UploadHandler, maxBodySize?: number): Promise<FormData>;
|
|
20
20
|
declare function isMultipartFormDataRequest(req: NodeHTTPRequest): boolean;
|
|
@@ -662,7 +662,7 @@ const utfTextDecoder = new TextDecoder('utf-8');
|
|
|
662
662
|
* @param uploadHandler A function that handles file uploads and returns a value to be used in the request body. If uploaded to disk, the returned value is a NodeOnDiskFile. If uploaded to memory, the returned value is a File.
|
|
663
663
|
* @param maxBodySize The maximum size of the request body in bytes. Defaults to Infinity.
|
|
664
664
|
*
|
|
665
|
-
* @
|
|
665
|
+
* @link https://remix.run/utils/parse-multipart-form-data
|
|
666
666
|
*/ async function parseMultipartFormData(request, uploadHandler, maxBodySize = Infinity) {
|
|
667
667
|
const contentType = request.headers['content-type'] ?? '';
|
|
668
668
|
const [type, boundary] = contentType.split(/\s*;\s*boundary=/);
|
|
@@ -639,7 +639,7 @@ const utfTextDecoder = new TextDecoder('utf-8');
|
|
|
639
639
|
* @param uploadHandler A function that handles file uploads and returns a value to be used in the request body. If uploaded to disk, the returned value is a NodeOnDiskFile. If uploaded to memory, the returned value is a File.
|
|
640
640
|
* @param maxBodySize The maximum size of the request body in bytes. Defaults to Infinity.
|
|
641
641
|
*
|
|
642
|
-
* @
|
|
642
|
+
* @link https://remix.run/utils/parse-multipart-form-data
|
|
643
643
|
*/ async function parseMultipartFormData(request, uploadHandler, maxBodySize = Infinity) {
|
|
644
644
|
const contentType = request.headers['content-type'] ?? '';
|
|
645
645
|
const [type, boundary] = contentType.split(/\s*;\s*boundary=/);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* @
|
|
8
|
+
* @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/upload/memoryUploadHandler.ts
|
|
9
9
|
*/
|
|
10
10
|
import type { UploadHandler } from './uploadHandler';
|
|
11
11
|
export type MemoryUploadHandlerFilterArgs = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NodeOnDiskFile } from './fileUploadHandler';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/formData.ts
|
|
4
4
|
*/
|
|
5
5
|
export type UploadHandlerPart = {
|
|
6
6
|
name: string;
|
|
@@ -34,12 +34,12 @@ export type NodeHTTPResponse = ServerResponse & {
|
|
|
34
34
|
};
|
|
35
35
|
export type NodeHTTPCreateContextOption<TRouter extends AnyRouter, TRequest, TResponse> = object extends inferRouterContext<TRouter> ? {
|
|
36
36
|
/**
|
|
37
|
-
* @link https://trpc.io/docs/context
|
|
37
|
+
* @link https://trpc.io/docs/v11/context
|
|
38
38
|
**/
|
|
39
39
|
createContext?: NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>;
|
|
40
40
|
} : {
|
|
41
41
|
/**
|
|
42
|
-
* @link https://trpc.io/docs/context
|
|
42
|
+
* @link https://trpc.io/docs/v11/context
|
|
43
43
|
**/
|
|
44
44
|
createContext: NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>;
|
|
45
45
|
};
|
package/dist/adapters/ws.d.ts
CHANGED
|
@@ -20,12 +20,12 @@ export type CreateWSSContextFn<TRouter extends AnyRouter> = (opts: CreateWSSCont
|
|
|
20
20
|
*/
|
|
21
21
|
export type WSSHandlerOptions<TRouter extends AnyRouter> = BaseHandlerOptions<TRouter, IncomingMessage> & (object extends inferRouterContext<TRouter> ? {
|
|
22
22
|
/**
|
|
23
|
-
* @link https://trpc.io/docs/context
|
|
23
|
+
* @link https://trpc.io/docs/v11/context
|
|
24
24
|
**/
|
|
25
25
|
createContext?: CreateWSSContextFn<TRouter>;
|
|
26
26
|
} : {
|
|
27
27
|
/**
|
|
28
|
-
* @link https://trpc.io/docs/context
|
|
28
|
+
* @link https://trpc.io/docs/v11/context
|
|
29
29
|
**/
|
|
30
30
|
createContext: CreateWSSContextFn<TRouter>;
|
|
31
31
|
}) & {
|
package/dist/adapters/ws.js
CHANGED
|
@@ -8,7 +8,7 @@ var core = require('@trpc/core');
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Importing ws causes a build error
|
|
11
|
-
* @
|
|
11
|
+
* @link https://github.com/trpc/trpc/pull/5279
|
|
12
12
|
*/ const WEBSOCKET_OPEN = 1; /* ws.WebSocket.OPEN */
|
|
13
13
|
function applyWSSHandler(opts) {
|
|
14
14
|
const { wss , createContext , router } = opts;
|
package/dist/adapters/ws.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { TRPCError, getErrorShape, getTRPCErrorFromUnknown, transformTRPCRespons
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Importing ws causes a build error
|
|
7
|
-
* @
|
|
7
|
+
* @link https://github.com/trpc/trpc/pull/5279
|
|
8
8
|
*/ const WEBSOCKET_OPEN = 1; /* ws.WebSocket.OPEN */
|
|
9
9
|
function applyWSSHandler(opts) {
|
|
10
10
|
const { wss , createContext , router } = opts;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction":
|
|
2
|
+
"bundleSize": 54490,
|
|
3
|
+
"bundleOrigSize": 76109,
|
|
4
|
+
"bundleReduction": 28.41,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/adapters/ws.ts",
|
|
8
|
-
"size":
|
|
9
|
-
"origSize":
|
|
8
|
+
"size": 9738,
|
|
9
|
+
"origSize": 9130,
|
|
10
10
|
"renderedExports": [
|
|
11
11
|
"applyWSSHandler"
|
|
12
12
|
],
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
{
|
|
37
37
|
"id": "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts",
|
|
38
38
|
"size": 4939,
|
|
39
|
-
"origSize":
|
|
39
|
+
"origSize": 7871,
|
|
40
40
|
"renderedExports": [
|
|
41
41
|
"readableStreamToString",
|
|
42
42
|
"createFileUploadHandler",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"/src/adapters/node-http/content-type/form-data/index.ts"
|
|
48
48
|
],
|
|
49
49
|
"percent": 9.06,
|
|
50
|
-
"reduction": 37.
|
|
50
|
+
"reduction": 37.25
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"id": "/home/runner/work/trpc/trpc/node_modules/.pnpm/@web3-storage+multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/search.js",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"id": "/src/adapters/node-http/content-type/form-data/index.ts",
|
|
78
|
-
"size":
|
|
79
|
-
"origSize":
|
|
78
|
+
"size": 4354,
|
|
79
|
+
"origSize": 6716,
|
|
80
80
|
"renderedExports": [
|
|
81
81
|
"nodeHTTPFormDataContentTypeHandler",
|
|
82
82
|
"experimental_parseMultipartFormData",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
{
|
|
119
119
|
"id": "/src/adapters/aws-lambda/utils.ts",
|
|
120
120
|
"size": 3337,
|
|
121
|
-
"origSize":
|
|
121
|
+
"origSize": 5234,
|
|
122
122
|
"renderedExports": [
|
|
123
123
|
"isPayloadV1",
|
|
124
124
|
"isPayloadV2",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"/src/adapters/aws-lambda/index.ts"
|
|
133
133
|
],
|
|
134
134
|
"percent": 6.12,
|
|
135
|
-
"reduction": 36.
|
|
135
|
+
"reduction": 36.24
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"id": "/src/adapters/fastify/fastifyRequestHandler.ts",
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
{
|
|
219
219
|
"id": "/src/adapters/node-http/content-type/form-data/uploadHandler.ts",
|
|
220
220
|
"size": 726,
|
|
221
|
-
"origSize":
|
|
221
|
+
"origSize": 2235,
|
|
222
222
|
"renderedExports": [
|
|
223
223
|
"composeUploadHandlers",
|
|
224
224
|
"MaxPartSizeExceededError",
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
"/src/adapters/node-http/content-type/form-data/index.ts"
|
|
234
234
|
],
|
|
235
235
|
"percent": 1.33,
|
|
236
|
-
"reduction": 67.
|
|
236
|
+
"reduction": 67.52
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
239
|
"id": "/home/runner/work/trpc/trpc/node_modules/.pnpm/@web3-storage+multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/utils.js",
|
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
{
|
|
257
257
|
"id": "/src/adapters/node-http/content-type/form-data/memoryUploadHandler.ts",
|
|
258
258
|
"size": 685,
|
|
259
|
-
"origSize":
|
|
259
|
+
"origSize": 2428,
|
|
260
260
|
"renderedExports": [
|
|
261
261
|
"createMemoryUploadHandler"
|
|
262
262
|
],
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
"/src/adapters/node-http/content-type/form-data/index.ts"
|
|
266
266
|
],
|
|
267
267
|
"percent": 1.26,
|
|
268
|
-
"reduction": 71.
|
|
268
|
+
"reduction": 71.79
|
|
269
269
|
},
|
|
270
270
|
{
|
|
271
271
|
"id": "/src/adapters/standalone.ts",
|
|
@@ -400,7 +400,17 @@
|
|
|
400
400
|
"dependents": [],
|
|
401
401
|
"percent": 0,
|
|
402
402
|
"reduction": 100
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"id": "/src/shared.ts",
|
|
406
|
+
"size": 0,
|
|
407
|
+
"origSize": 653,
|
|
408
|
+
"renderedExports": [],
|
|
409
|
+
"removedExports": [],
|
|
410
|
+
"dependents": [],
|
|
411
|
+
"percent": 0,
|
|
412
|
+
"reduction": 100
|
|
403
413
|
}
|
|
404
414
|
],
|
|
405
|
-
"moduleCount":
|
|
415
|
+
"moduleCount": 29
|
|
406
416
|
}
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,10 @@ Object.defineProperty(exports, 'callTRPCProcedure', {
|
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function () { return core.callProcedure; }
|
|
20
20
|
});
|
|
21
|
+
Object.defineProperty(exports, 'createTRPCFlatProxy', {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return core.createFlatProxy; }
|
|
24
|
+
});
|
|
21
25
|
Object.defineProperty(exports, 'experimental_standaloneMiddleware', {
|
|
22
26
|
enumerable: true,
|
|
23
27
|
get: function () { return core.experimental_standaloneMiddleware; }
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TRPCError, callProcedure, callProcedure as callTRPCProcedure, experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, getErrorShape, getTRPCErrorFromUnknown, initTRPC, transformTRPCResponse } from '@trpc/core';
|
|
1
|
+
export { TRPCError, callProcedure, callProcedure as callTRPCProcedure, createFlatProxy as createTRPCFlatProxy, experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, getErrorShape, getTRPCErrorFromUnknown, initTRPC, transformTRPCResponse } from '@trpc/core';
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export {
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
4
|
+
*/
|
|
5
|
+
type inferProcedureInput,
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
8
|
+
*/
|
|
9
|
+
type inferProcedureOutput,
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
12
|
+
*/
|
|
13
|
+
type inferTransformedProcedureOutput,
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
16
|
+
*/
|
|
17
|
+
type inferTransformedSubscriptionOutput,
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
20
|
+
*/
|
|
21
|
+
getErrorShape,
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated `import { createTRPCFlatProxy } from '@trpc/server'` instead
|
|
24
|
+
*/
|
|
25
|
+
createTRPCFlatProxy as createFlatProxy, } from './@trpc-server';
|
|
26
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO;AACL;;GAEG;AACH,KAAK,mBAAmB;AACxB;;GAEG;AACH,KAAK,oBAAoB;AACzB;;GAEG;AACH,KAAK,+BAA+B;AACpC;;GAEG;AACH,KAAK,kCAAkC;AACvC;;GAEG;AACH,aAAa;AACb;;GAEG;AACH,mBAAmB,IAAI,eAAe,GACvC,MAAM,gBAAgB,CAAC"}
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@trpc/core');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'createFlatProxy', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return core.createFlatProxy; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, 'getErrorShape', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return core.getErrorShape; }
|
|
16
|
+
});
|
package/dist/shared.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createFlatProxy, getErrorShape } from '@trpc/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-next-
|
|
3
|
+
"version": "11.0.0-next-beta.190+fc3e467c5",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"access": "public"
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
|
-
"@trpc/core": "11.0.0-next-
|
|
118
|
+
"@trpc/core": "11.0.0-next-beta.190+fc3e467c5"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@fastify/websocket": "^7.1.2",
|
|
@@ -154,5 +154,5 @@
|
|
|
154
154
|
"funding": [
|
|
155
155
|
"https://trpc.io/sponsor"
|
|
156
156
|
],
|
|
157
|
-
"gitHead": "
|
|
157
|
+
"gitHead": "fc3e467c5189ff452893f3f6cd51d956ba21de0a"
|
|
158
158
|
}
|
package/src/@trpc-server.ts
CHANGED
|
@@ -6,19 +6,29 @@ export {
|
|
|
6
6
|
experimental_standaloneMiddleware,
|
|
7
7
|
experimental_standaloneMiddleware as experimental_trpcMiddleware,
|
|
8
8
|
initTRPC,
|
|
9
|
+
// --- FIXME a bunch of these exports are only useful for plugins - move them somewhere else? ----
|
|
9
10
|
callProcedure as callTRPCProcedure,
|
|
10
11
|
getTRPCErrorFromUnknown,
|
|
11
12
|
transformTRPCResponse,
|
|
13
|
+
createFlatProxy as createTRPCFlatProxy,
|
|
12
14
|
type inferProcedureInput,
|
|
13
15
|
type inferProcedureOutput,
|
|
14
16
|
type inferRouterError,
|
|
15
17
|
type inferRouterInputs,
|
|
16
18
|
type inferRouterOutputs,
|
|
17
19
|
type inferRouterContext,
|
|
20
|
+
type inferTransformedProcedureOutput,
|
|
21
|
+
type inferTransformedSubscriptionOutput,
|
|
18
22
|
type AnyProcedure as AnyTRPCProcedure,
|
|
19
23
|
type AnyRouter as AnyTRPCRouter,
|
|
20
24
|
type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction,
|
|
21
25
|
type CombinedDataTransformer as TRPCCombinedDataTransformer,
|
|
26
|
+
type ProcedureType as TRPCProcedureType,
|
|
27
|
+
type AnyMutationProcedure as AnyTRPCMutationProcedure,
|
|
28
|
+
type AnyQueryProcedure as AnyTRPCQueryProcedure,
|
|
29
|
+
type ProcedureRouterRecord as TRPCProcedureRouterRecord,
|
|
30
|
+
type ProcedureArgs as TRPCProcedureArgs,
|
|
31
|
+
type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure,
|
|
22
32
|
} from './@trpc-core-unstable-do-not-import-this-please';
|
|
23
33
|
|
|
24
34
|
export type {
|
|
@@ -38,6 +48,41 @@ export type {
|
|
|
38
48
|
* @deprecated use `TRPCCombinedDataTransformer` instead
|
|
39
49
|
*/
|
|
40
50
|
CombinedDataTransformer,
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated This is a utility type will be removed in v12
|
|
54
|
+
*/
|
|
55
|
+
Dict,
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated This is a utility type will be removed in v12
|
|
59
|
+
*/
|
|
60
|
+
DeepPartial,
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated use `TRPCProcedureType` instead
|
|
63
|
+
*/
|
|
64
|
+
ProcedureType,
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated use `AnyTRPCMutationProcedure` instead
|
|
67
|
+
*/
|
|
68
|
+
AnyMutationProcedure,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated use `AnyTRPCQueryProcedure` instead
|
|
72
|
+
*/
|
|
73
|
+
AnyQueryProcedure,
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated use `TRPCProcedureRouterRecord` instead
|
|
76
|
+
*/
|
|
77
|
+
ProcedureRouterRecord,
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated use `TRPCProcedureArgs` instead
|
|
80
|
+
*/
|
|
81
|
+
ProcedureArgs,
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated use `AnyTRPCSubscriptionProcedure` instead
|
|
84
|
+
*/
|
|
85
|
+
AnySubscriptionProcedure,
|
|
41
86
|
} from '@trpc/core';
|
|
42
87
|
|
|
43
88
|
export {
|
|
@@ -61,13 +61,13 @@ export type AWSLambdaOptions<
|
|
|
61
61
|
} & (
|
|
62
62
|
| {
|
|
63
63
|
/**
|
|
64
|
-
* @link https://trpc.io/docs/context
|
|
64
|
+
* @link https://trpc.io/docs/v11/context
|
|
65
65
|
**/
|
|
66
66
|
createContext: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
67
67
|
}
|
|
68
68
|
| {
|
|
69
69
|
/**
|
|
70
|
-
* @link https://trpc.io/docs/context
|
|
70
|
+
* @link https://trpc.io/docs/v11/context
|
|
71
71
|
**/
|
|
72
72
|
createContext?: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
73
73
|
}
|
|
@@ -30,13 +30,13 @@ export type FetchCreateContextOption<TRouter extends AnyRouter> =
|
|
|
30
30
|
unknown extends inferRouterContext<TRouter>
|
|
31
31
|
? {
|
|
32
32
|
/**
|
|
33
|
-
* @link https://trpc.io/docs/context
|
|
33
|
+
* @link https://trpc.io/docs/v11/context
|
|
34
34
|
**/
|
|
35
35
|
createContext?: FetchCreateContextFn<TRouter>;
|
|
36
36
|
}
|
|
37
37
|
: {
|
|
38
38
|
/**
|
|
39
|
-
* @link https://trpc.io/docs/context
|
|
39
|
+
* @link https://trpc.io/docs/v11/context
|
|
40
40
|
**/
|
|
41
41
|
createContext: FetchCreateContextFn<TRouter>;
|
|
42
42
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @
|
|
11
|
+
* @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-node/upload/fileUploadHandler.ts
|
|
12
12
|
*/
|
|
13
13
|
import { randomBytes } from 'node:crypto';
|
|
14
14
|
import { createReadStream, createWriteStream, statSync } from 'node:fs';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @
|
|
9
|
+
* @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/formData.ts
|
|
10
10
|
*/
|
|
11
11
|
import * as fs from 'fs/promises';
|
|
12
12
|
import { Readable } from 'node:stream';
|
|
@@ -31,7 +31,7 @@ const utfTextDecoder = new TextDecoder('utf-8');
|
|
|
31
31
|
* @param uploadHandler A function that handles file uploads and returns a value to be used in the request body. If uploaded to disk, the returned value is a NodeOnDiskFile. If uploaded to memory, the returned value is a File.
|
|
32
32
|
* @param maxBodySize The maximum size of the request body in bytes. Defaults to Infinity.
|
|
33
33
|
*
|
|
34
|
-
* @
|
|
34
|
+
* @link https://remix.run/utils/parse-multipart-form-data
|
|
35
35
|
*/
|
|
36
36
|
async function parseMultipartFormData(
|
|
37
37
|
request: NodeHTTPRequest,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @
|
|
9
|
+
* @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/upload/memoryUploadHandler.ts
|
|
10
10
|
*/
|
|
11
11
|
import type { UploadHandler } from './uploadHandler';
|
|
12
12
|
import { MaxPartSizeExceededError } from './uploadHandler';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NodeOnDiskFile } from './fileUploadHandler';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/formData.ts
|
|
5
5
|
*/
|
|
6
6
|
export type UploadHandlerPart = {
|
|
7
7
|
name: string;
|
|
@@ -47,13 +47,13 @@ export type NodeHTTPCreateContextOption<
|
|
|
47
47
|
> = object extends inferRouterContext<TRouter>
|
|
48
48
|
? {
|
|
49
49
|
/**
|
|
50
|
-
* @link https://trpc.io/docs/context
|
|
50
|
+
* @link https://trpc.io/docs/v11/context
|
|
51
51
|
**/
|
|
52
52
|
createContext?: NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>;
|
|
53
53
|
}
|
|
54
54
|
: {
|
|
55
55
|
/**
|
|
56
|
-
* @link https://trpc.io/docs/context
|
|
56
|
+
* @link https://trpc.io/docs/v11/context
|
|
57
57
|
**/
|
|
58
58
|
createContext: NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>;
|
|
59
59
|
};
|
package/src/adapters/ws.ts
CHANGED
|
@@ -24,7 +24,7 @@ import type { NodeHTTPCreateContextFnOptions } from './node-http';
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Importing ws causes a build error
|
|
27
|
-
* @
|
|
27
|
+
* @link https://github.com/trpc/trpc/pull/5279
|
|
28
28
|
*/
|
|
29
29
|
const WEBSOCKET_OPEN = 1; /* ws.WebSocket.OPEN */
|
|
30
30
|
|
|
@@ -53,13 +53,13 @@ export type WSSHandlerOptions<TRouter extends AnyRouter> = BaseHandlerOptions<
|
|
|
53
53
|
(object extends inferRouterContext<TRouter>
|
|
54
54
|
? {
|
|
55
55
|
/**
|
|
56
|
-
* @link https://trpc.io/docs/context
|
|
56
|
+
* @link https://trpc.io/docs/v11/context
|
|
57
57
|
**/
|
|
58
58
|
createContext?: CreateWSSContextFn<TRouter>;
|
|
59
59
|
}
|
|
60
60
|
: {
|
|
61
61
|
/**
|
|
62
|
-
* @link https://trpc.io/docs/context
|
|
62
|
+
* @link https://trpc.io/docs/v11/context
|
|
63
63
|
**/
|
|
64
64
|
createContext: CreateWSSContextFn<TRouter>;
|
|
65
65
|
}) & {
|
package/src/shared.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export {
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
4
|
+
*/
|
|
5
|
+
type inferProcedureInput,
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
8
|
+
*/
|
|
9
|
+
type inferProcedureOutput,
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
12
|
+
*/
|
|
13
|
+
type inferTransformedProcedureOutput,
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
16
|
+
*/
|
|
17
|
+
type inferTransformedSubscriptionOutput,
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated `import from '@trpc/server'` instead
|
|
20
|
+
*/
|
|
21
|
+
getErrorShape,
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated `import { createTRPCFlatProxy } from '@trpc/server'` instead
|
|
24
|
+
*/
|
|
25
|
+
createTRPCFlatProxy as createFlatProxy,
|
|
26
|
+
} from './@trpc-server';
|