@trpc/server 11.3.1 → 11.3.2-canary.2
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/adapters/aws-lambda/package.json +1 -0
- package/adapters/express/package.json +1 -0
- package/adapters/fastify/package.json +1 -0
- package/adapters/fetch/package.json +1 -0
- package/adapters/next/package.json +1 -0
- package/adapters/next-app-dir/package.json +1 -0
- package/adapters/node-http/package.json +1 -0
- package/adapters/standalone/package.json +1 -0
- package/adapters/ws/package.json +1 -0
- package/dist/adapters/aws-lambda/index.cjs +255 -0
- package/dist/adapters/aws-lambda/index.d.cts +31 -0
- package/dist/adapters/aws-lambda/index.d.cts.map +1 -0
- package/dist/adapters/aws-lambda/index.d.mts +31 -0
- package/dist/adapters/aws-lambda/index.d.mts.map +1 -0
- package/dist/adapters/aws-lambda/index.mjs +248 -57
- package/dist/adapters/aws-lambda/index.mjs.map +1 -0
- package/dist/adapters/express.cjs +34 -0
- package/dist/adapters/express.d.cts +15 -0
- package/dist/adapters/express.d.cts.map +1 -0
- package/dist/adapters/express.d.mts +15 -0
- package/dist/adapters/express.d.mts.map +1 -0
- package/dist/adapters/express.mjs +30 -32
- package/dist/adapters/express.mjs.map +1 -0
- package/dist/adapters/fastify/index.cjs +75 -0
- package/dist/adapters/fastify/index.d.cts +29 -0
- package/dist/adapters/fastify/index.d.cts.map +1 -0
- package/dist/adapters/fastify/index.d.mts +29 -0
- package/dist/adapters/fastify/index.d.mts.map +1 -0
- package/dist/adapters/fastify/index.mjs +75 -2
- package/dist/adapters/fastify/index.mjs.map +1 -0
- package/dist/adapters/fetch/index.cjs +58 -0
- package/dist/adapters/fetch/index.d.cts +30 -0
- package/dist/adapters/fetch/index.d.cts.map +1 -0
- package/dist/adapters/fetch/index.d.mts +30 -0
- package/dist/adapters/fetch/index.d.mts.map +1 -0
- package/dist/adapters/fetch/index.mjs +59 -1
- package/dist/adapters/fetch/index.mjs.map +1 -0
- package/dist/adapters/next-app-dir.cjs +3050 -0
- package/dist/adapters/next-app-dir.d.cts +58 -0
- package/dist/adapters/next-app-dir.d.cts.map +1 -0
- package/dist/adapters/next-app-dir.d.mts +58 -0
- package/dist/adapters/next-app-dir.d.mts.map +1 -0
- package/dist/adapters/next-app-dir.mjs +3048 -4
- package/dist/adapters/next-app-dir.mjs.map +1 -0
- package/dist/adapters/next.cjs +41 -0
- package/dist/adapters/next.d.cts +19 -0
- package/dist/adapters/next.d.cts.map +1 -0
- package/dist/adapters/next.d.mts +19 -0
- package/dist/adapters/next.d.mts.map +1 -0
- package/dist/adapters/next.mjs +37 -44
- package/dist/adapters/next.mjs.map +1 -0
- package/dist/adapters/node-http/index.cjs +15 -0
- package/dist/adapters/node-http/index.d.cts +5 -0
- package/dist/adapters/node-http/index.d.mts +5 -0
- package/dist/adapters/node-http/index.mjs +12 -2
- package/dist/adapters/standalone.cjs +52 -0
- package/dist/adapters/standalone.d.cts +33 -0
- package/dist/adapters/standalone.d.cts.map +1 -0
- package/dist/adapters/standalone.d.mts +33 -0
- package/dist/adapters/standalone.d.mts.map +1 -0
- package/dist/adapters/standalone.mjs +40 -34
- package/dist/adapters/standalone.mjs.map +1 -0
- package/dist/adapters/ws.cjs +17 -0
- package/dist/adapters/ws.d.cts +61 -0
- package/dist/adapters/ws.d.cts.map +1 -0
- package/dist/adapters/ws.d.mts +61 -0
- package/dist/adapters/ws.d.mts.map +1 -0
- package/dist/adapters/ws.mjs +14 -539
- package/dist/contentTypeParsers-SN4WL9ze.mjs +13 -0
- package/dist/contentTypeParsers-SN4WL9ze.mjs.map +1 -0
- package/dist/contentTypeParsers-iAFF_pJG.cjs +18 -0
- package/dist/getErrorShape-CsikfkAc.cjs +201 -0
- package/dist/getErrorShape-DyYil4aT.mjs +149 -0
- package/dist/getErrorShape-DyYil4aT.mjs.map +1 -0
- package/dist/http-CWyjOa1l.mjs +0 -0
- package/dist/http-DXy3XyhL.cjs +0 -0
- package/dist/http.cjs +14 -0
- package/dist/http.d.cts +3 -0
- package/dist/http.d.mts +3 -0
- package/dist/http.mjs +9 -8
- package/dist/index.cjs +22 -0
- package/dist/index.d-BiUz7kM_.d.cts +65 -0
- package/dist/index.d-BiUz7kM_.d.cts.map +1 -0
- package/dist/index.d-ChWYhXbd.d.cts +99 -0
- package/dist/index.d-ChWYhXbd.d.cts.map +1 -0
- package/dist/index.d-CvZXeEyR.d.cts +11 -0
- package/dist/index.d-CvZXeEyR.d.cts.map +1 -0
- package/dist/index.d-D4qZxQJh.d.mts +65 -0
- package/dist/index.d-D4qZxQJh.d.mts.map +1 -0
- package/dist/index.d-Ocy_AnXj.d.mts +99 -0
- package/dist/index.d-Ocy_AnXj.d.mts.map +1 -0
- package/dist/index.d-vq_QHko2.d.mts +11 -0
- package/dist/index.d-vq_QHko2.d.mts.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +6 -13
- package/dist/initTRPC-COaJMShh.mjs +339 -0
- package/dist/initTRPC-COaJMShh.mjs.map +1 -0
- package/dist/initTRPC-DjEpHmY2.cjs +397 -0
- package/dist/node-http-BPR68yI4.cjs +243 -0
- package/dist/node-http-BUQnHuGI.mjs +221 -0
- package/dist/node-http-BUQnHuGI.mjs.map +1 -0
- package/dist/observable/index.cjs +13 -0
- package/dist/observable/index.d.cts +2 -0
- package/dist/observable/index.d.mts +2 -0
- package/dist/observable/index.mjs +4 -3
- package/dist/observable-B1orLHHI.mjs +155 -0
- package/dist/observable-B1orLHHI.mjs.map +1 -0
- package/dist/observable-BwdrSFZU.cjs +178 -0
- package/dist/observable-C6qq2Ydk.cjs +180 -0
- package/dist/observable-CFXA_tyK.mjs +146 -0
- package/dist/observable-CFXA_tyK.mjs.map +1 -0
- package/dist/parseTRPCMessage-ByQWigsq.cjs +73 -0
- package/dist/parseTRPCMessage-CNyYMSRB.mjs +63 -0
- package/dist/parseTRPCMessage-CNyYMSRB.mjs.map +1 -0
- package/dist/resolveResponse-B2CuaT_1.cjs +2042 -0
- package/dist/resolveResponse-DPbYgJDD.mjs +1912 -0
- package/dist/resolveResponse-DPbYgJDD.mjs.map +1 -0
- package/dist/rpc.cjs +6 -0
- package/dist/rpc.d.cts +3 -0
- package/dist/rpc.d.mts +3 -0
- package/dist/rpc.mjs +4 -5
- package/dist/shared.cjs +5 -0
- package/dist/shared.d.cts +4 -0
- package/dist/shared.d.mts +4 -0
- package/dist/shared.mjs +4 -6
- package/dist/tracked-Dl9sBZxY.cjs +483 -0
- package/dist/tracked-GEWPoL0C.mjs +383 -0
- package/dist/tracked-GEWPoL0C.mjs.map +1 -0
- package/dist/unstable-core-do-not-import-D89CaGtL.mjs +29 -0
- package/dist/unstable-core-do-not-import-D89CaGtL.mjs.map +1 -0
- package/dist/unstable-core-do-not-import-DFQys1IC.cjs +34 -0
- package/dist/unstable-core-do-not-import.cjs +83 -0
- package/dist/unstable-core-do-not-import.d-CSxj_rbP.d.cts +1974 -0
- package/dist/unstable-core-do-not-import.d-CSxj_rbP.d.cts.map +1 -0
- package/dist/unstable-core-do-not-import.d-ptrxwuSa.d.mts +1974 -0
- package/dist/unstable-core-do-not-import.d-ptrxwuSa.d.mts.map +1 -0
- package/dist/unstable-core-do-not-import.d.cts +3 -0
- package/dist/unstable-core-do-not-import.d.mts +3 -0
- package/dist/unstable-core-do-not-import.mjs +11 -30
- package/dist/utils-BHZJcBRv.mjs +137 -0
- package/dist/utils-BHZJcBRv.mjs.map +1 -0
- package/dist/utils-DVO6HZiR.cjs +220 -0
- package/dist/ws-C2nEUNk_.cjs +425 -0
- package/dist/ws-eIVIMTrw.mjs +409 -0
- package/dist/ws-eIVIMTrw.mjs.map +1 -0
- package/http/package.json +1 -0
- package/observable/package.json +1 -0
- package/package.json +131 -55
- package/rpc/package.json +1 -0
- package/shared/package.json +1 -0
- package/src/@trpc/server/index.ts +24 -0
- package/src/unstable-core-do-not-import/http/contentType.ts +5 -4
- package/src/unstable-core-do-not-import/initTRPC.ts +79 -4
- package/src/unstable-core-do-not-import/router.ts +36 -12
- package/src/unstable-core-do-not-import/utils.ts +3 -2
- package/unstable-core-do-not-import/package.json +1 -0
- package/adapters/aws-lambda/index.d.ts +0 -1
- package/adapters/aws-lambda/index.js +0 -1
- package/adapters/express/index.d.ts +0 -1
- package/adapters/express/index.js +0 -1
- package/adapters/fastify/index.d.ts +0 -1
- package/adapters/fastify/index.js +0 -1
- package/adapters/fetch/index.d.ts +0 -1
- package/adapters/fetch/index.js +0 -1
- package/adapters/next/index.d.ts +0 -1
- package/adapters/next/index.js +0 -1
- package/adapters/next-app-dir/index.d.ts +0 -1
- package/adapters/next-app-dir/index.js +0 -1
- package/adapters/node-http/content-type/form-data/index.d.ts +0 -1
- package/adapters/node-http/content-type/form-data/index.js +0 -1
- package/adapters/node-http/content-type/json/index.d.ts +0 -1
- package/adapters/node-http/content-type/json/index.js +0 -1
- package/adapters/node-http/index.d.ts +0 -1
- package/adapters/node-http/index.js +0 -1
- package/adapters/standalone/index.d.ts +0 -1
- package/adapters/standalone/index.js +0 -1
- package/adapters/ws/index.d.ts +0 -1
- package/adapters/ws/index.js +0 -1
- package/dist/@trpc/server/http.d.ts +0 -8
- package/dist/@trpc/server/http.d.ts.map +0 -1
- package/dist/@trpc/server/index.d.ts +0 -65
- package/dist/@trpc/server/index.d.ts.map +0 -1
- package/dist/@trpc/server/rpc.d.ts +0 -3
- package/dist/@trpc/server/rpc.d.ts.map +0 -1
- package/dist/adapters/aws-lambda/getPlanner.d.ts +0 -15
- package/dist/adapters/aws-lambda/getPlanner.d.ts.map +0 -1
- package/dist/adapters/aws-lambda/getPlanner.js +0 -179
- package/dist/adapters/aws-lambda/getPlanner.mjs +0 -177
- package/dist/adapters/aws-lambda/index.d.ts +0 -23
- package/dist/adapters/aws-lambda/index.d.ts.map +0 -1
- package/dist/adapters/aws-lambda/index.js +0 -67
- package/dist/adapters/express.d.ts +0 -15
- package/dist/adapters/express.d.ts.map +0 -1
- package/dist/adapters/express.js +0 -39
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +0 -22
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +0 -1
- package/dist/adapters/fastify/fastifyRequestHandler.js +0 -49
- package/dist/adapters/fastify/fastifyRequestHandler.mjs +0 -47
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +0 -21
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +0 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.js +0 -56
- package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +0 -54
- package/dist/adapters/fastify/index.d.ts +0 -3
- package/dist/adapters/fastify/index.d.ts.map +0 -1
- package/dist/adapters/fastify/index.js +0 -9
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +0 -13
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +0 -1
- package/dist/adapters/fetch/fetchRequestHandler.js +0 -77
- package/dist/adapters/fetch/fetchRequestHandler.mjs +0 -75
- package/dist/adapters/fetch/index.d.ts +0 -3
- package/dist/adapters/fetch/index.d.ts.map +0 -1
- package/dist/adapters/fetch/index.js +0 -7
- package/dist/adapters/fetch/types.d.ts +0 -27
- package/dist/adapters/fetch/types.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/nextAppDirCaller.d.ts +0 -25
- package/dist/adapters/next-app-dir/nextAppDirCaller.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/nextAppDirCaller.js +0 -94
- package/dist/adapters/next-app-dir/nextAppDirCaller.mjs +0 -92
- package/dist/adapters/next-app-dir/notFound.d.ts +0 -7
- package/dist/adapters/next-app-dir/notFound.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/notFound.js +0 -18
- package/dist/adapters/next-app-dir/notFound.mjs +0 -16
- package/dist/adapters/next-app-dir/redirect.d.ts +0 -18
- package/dist/adapters/next-app-dir/redirect.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/redirect.js +0 -49
- package/dist/adapters/next-app-dir/redirect.mjs +0 -46
- package/dist/adapters/next-app-dir/rethrowNextErrors.d.ts +0 -6
- package/dist/adapters/next-app-dir/rethrowNextErrors.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/rethrowNextErrors.js +0 -70
- package/dist/adapters/next-app-dir/rethrowNextErrors.mjs +0 -49
- package/dist/adapters/next-app-dir.d.ts +0 -7
- package/dist/adapters/next-app-dir.d.ts.map +0 -1
- package/dist/adapters/next-app-dir.js +0 -13
- package/dist/adapters/next.d.ts +0 -19
- package/dist/adapters/next.d.ts.map +0 -1
- package/dist/adapters/next.js +0 -51
- package/dist/adapters/node-http/incomingMessageToRequest.d.ts +0 -12
- package/dist/adapters/node-http/incomingMessageToRequest.d.ts.map +0 -1
- package/dist/adapters/node-http/incomingMessageToRequest.js +0 -123
- package/dist/adapters/node-http/incomingMessageToRequest.mjs +0 -120
- package/dist/adapters/node-http/index.d.ts +0 -4
- package/dist/adapters/node-http/index.d.ts.map +0 -1
- package/dist/adapters/node-http/index.js +0 -11
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +0 -20
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +0 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.js +0 -96
- package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +0 -93
- package/dist/adapters/node-http/types.d.ts +0 -81
- package/dist/adapters/node-http/types.d.ts.map +0 -1
- package/dist/adapters/node-http/writeResponse.d.ts +0 -18
- package/dist/adapters/node-http/writeResponse.d.ts.map +0 -1
- package/dist/adapters/node-http/writeResponse.js +0 -83
- package/dist/adapters/node-http/writeResponse.mjs +0 -80
- package/dist/adapters/standalone.d.ts +0 -36
- package/dist/adapters/standalone.d.ts.map +0 -1
- package/dist/adapters/standalone.js +0 -49
- package/dist/adapters/ws.d.ts +0 -54
- package/dist/adapters/ws.d.ts.map +0 -1
- package/dist/adapters/ws.js +0 -544
- package/dist/http.d.ts +0 -2
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -19
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -35
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@12.1.2_rollup@4.34.8_tslib@2.8.1_typescript@5.8.2/node_modules/tslib/tslib.es6.js +0 -73
- package/dist/observable/behaviorSubject.d.ts +0 -15
- package/dist/observable/behaviorSubject.d.ts.map +0 -1
- package/dist/observable/behaviorSubject.js +0 -40
- package/dist/observable/behaviorSubject.mjs +0 -38
- package/dist/observable/index.d.ts +0 -5
- package/dist/observable/index.d.ts.map +0 -1
- package/dist/observable/index.js +0 -18
- package/dist/observable/observable.d.ts +0 -12
- package/dist/observable/observable.d.ts.map +0 -1
- package/dist/observable/observable.js +0 -180
- package/dist/observable/observable.mjs +0 -175
- package/dist/observable/operators.d.ts +0 -10
- package/dist/observable/operators.d.ts.map +0 -1
- package/dist/observable/operators.js +0 -134
- package/dist/observable/operators.mjs +0 -128
- package/dist/observable/types.d.ts +0 -26
- package/dist/observable/types.d.ts.map +0 -1
- package/dist/rpc.d.ts +0 -2
- package/dist/rpc.d.ts.map +0 -1
- package/dist/rpc.js +0 -13
- package/dist/shared.d.ts +0 -26
- package/dist/shared.d.ts.map +0 -1
- package/dist/shared.js +0 -13
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts +0 -17
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/clientish/inferrable.d.ts +0 -36
- package/dist/unstable-core-do-not-import/clientish/inferrable.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/clientish/serialize.d.ts +0 -69
- package/dist/unstable-core-do-not-import/clientish/serialize.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/createProxy.d.ts +0 -19
- package/dist/unstable-core-do-not-import/createProxy.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/createProxy.js +0 -76
- package/dist/unstable-core-do-not-import/createProxy.mjs +0 -73
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +0 -13
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/TRPCError.js +0 -76
- package/dist/unstable-core-do-not-import/error/TRPCError.mjs +0 -72
- package/dist/unstable-core-do-not-import/error/formatter.d.ts +0 -38
- package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/formatter.js +0 -7
- package/dist/unstable-core-do-not-import/error/formatter.mjs +0 -5
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +0 -15
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/getErrorShape.js +0 -31
- package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +0 -29
- package/dist/unstable-core-do-not-import/http/abortError.d.ts +0 -5
- package/dist/unstable-core-do-not-import/http/abortError.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/abortError.js +0 -13
- package/dist/unstable-core-do-not-import/http/abortError.mjs +0 -10
- package/dist/unstable-core-do-not-import/http/contentType.d.ts +0 -13
- package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/contentType.js +0 -229
- package/dist/unstable-core-do-not-import/http/contentType.mjs +0 -227
- package/dist/unstable-core-do-not-import/http/contentTypeParsers.d.ts +0 -14
- package/dist/unstable-core-do-not-import/http/contentTypeParsers.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/contentTypeParsers.js +0 -14
- package/dist/unstable-core-do-not-import/http/contentTypeParsers.mjs +0 -12
- package/dist/unstable-core-do-not-import/http/formDataToObject.d.ts +0 -2
- package/dist/unstable-core-do-not-import/http/formDataToObject.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/formDataToObject.js +0 -40
- package/dist/unstable-core-do-not-import/http/formDataToObject.mjs +0 -38
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +0 -10
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +0 -85
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +0 -78
- package/dist/unstable-core-do-not-import/http/parseConnectionParams.d.ts +0 -4
- package/dist/unstable-core-do-not-import/http/parseConnectionParams.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/parseConnectionParams.js +0 -42
- package/dist/unstable-core-do-not-import/http/parseConnectionParams.mjs +0 -39
- package/dist/unstable-core-do-not-import/http/resolveResponse.d.ts +0 -15
- package/dist/unstable-core-do-not-import/http/resolveResponse.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/resolveResponse.js +0 -572
- package/dist/unstable-core-do-not-import/http/resolveResponse.mjs +0 -570
- package/dist/unstable-core-do-not-import/http/types.d.ts +0 -138
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +0 -94
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/initTRPC.js +0 -82
- package/dist/unstable-core-do-not-import/initTRPC.mjs +0 -80
- package/dist/unstable-core-do-not-import/middleware.d.ts +0 -107
- package/dist/unstable-core-do-not-import/middleware.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/middleware.js +0 -96
- package/dist/unstable-core-do-not-import/middleware.mjs +0 -90
- package/dist/unstable-core-do-not-import/parser.d.ts +0 -44
- package/dist/unstable-core-do-not-import/parser.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/parser.js +0 -54
- package/dist/unstable-core-do-not-import/parser.mjs +0 -52
- package/dist/unstable-core-do-not-import/procedure.d.ts +0 -77
- package/dist/unstable-core-do-not-import/procedure.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/procedure.js +0 -9
- package/dist/unstable-core-do-not-import/procedure.mjs +0 -7
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +0 -161
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.js +0 -201
- package/dist/unstable-core-do-not-import/procedureBuilder.mjs +0 -199
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +0 -98
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rootConfig.js +0 -8
- package/dist/unstable-core-do-not-import/rootConfig.mjs +0 -6
- package/dist/unstable-core-do-not-import/router.d.ts +0 -98
- package/dist/unstable-core-do-not-import/router.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/router.js +0 -285
- package/dist/unstable-core-do-not-import/router.mjs +0 -278
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +0 -45
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/codes.js +0 -69
- package/dist/unstable-core-do-not-import/rpc/codes.mjs +0 -65
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +0 -109
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/index.d.ts +0 -5
- package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +0 -5
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +0 -63
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +0 -61
- package/dist/unstable-core-do-not-import/stream/jsonl.d.ts +0 -119
- package/dist/unstable-core-do-not-import/stream/jsonl.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/jsonl.js +0 -607
- package/dist/unstable-core-do-not-import/stream/jsonl.mjs +0 -603
- package/dist/unstable-core-do-not-import/stream/sse.d.ts +0 -108
- package/dist/unstable-core-do-not-import/stream/sse.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/sse.js +0 -373
- package/dist/unstable-core-do-not-import/stream/sse.mjs +0 -369
- package/dist/unstable-core-do-not-import/stream/sse.types.d.ts +0 -31
- package/dist/unstable-core-do-not-import/stream/sse.types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/tracked.d.ts +0 -31
- package/dist/unstable-core-do-not-import/stream/tracked.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/tracked.js +0 -29
- package/dist/unstable-core-do-not-import/stream/tracked.mjs +0 -25
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts +0 -17
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.js +0 -174
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.mjs +0 -170
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.d.ts +0 -7
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.js +0 -17
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.mjs +0 -15
- package/dist/unstable-core-do-not-import/stream/utils/disposable.d.ts +0 -17
- package/dist/unstable-core-do-not-import/stream/utils/disposable.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/disposable.js +0 -46
- package/dist/unstable-core-do-not-import/stream/utils/disposable.mjs +0 -43
- package/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.d.ts +0 -17
- package/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.js +0 -241
- package/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.mjs +0 -239
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.d.ts +0 -8
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.js +0 -25
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.mjs +0 -23
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.d.ts +0 -5
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.js +0 -26
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.mjs +0 -23
- package/dist/unstable-core-do-not-import/stream/utils/withPing.d.ts +0 -7
- package/dist/unstable-core-do-not-import/stream/utils/withPing.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/withPing.js +0 -130
- package/dist/unstable-core-do-not-import/stream/utils/withPing.mjs +0 -127
- package/dist/unstable-core-do-not-import/transformer.d.ts +0 -99
- package/dist/unstable-core-do-not-import/transformer.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/transformer.js +0 -106
- package/dist/unstable-core-do-not-import/transformer.mjs +0 -101
- package/dist/unstable-core-do-not-import/types.d.ts +0 -127
- package/dist/unstable-core-do-not-import/types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/utils.d.ts +0 -42
- package/dist/unstable-core-do-not-import/utils.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/utils.js +0 -96
- package/dist/unstable-core-do-not-import/utils.mjs +0 -83
- package/dist/unstable-core-do-not-import.d.ts +0 -47
- package/dist/unstable-core-do-not-import.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import.js +0 -109
- package/dist/vendor/cookie-es/set-cookie/split.d.ts +0 -18
- package/dist/vendor/cookie-es/set-cookie/split.d.ts.map +0 -1
- package/dist/vendor/cookie-es/set-cookie/split.js +0 -79
- package/dist/vendor/cookie-es/set-cookie/split.mjs +0 -77
- package/dist/vendor/standard-schema-v1/error.d.ts +0 -13
- package/dist/vendor/standard-schema-v1/error.d.ts.map +0 -1
- package/dist/vendor/standard-schema-v1/error.js +0 -28
- package/dist/vendor/standard-schema-v1/error.mjs +0 -26
- package/dist/vendor/standard-schema-v1/spec.d.ts +0 -60
- package/dist/vendor/standard-schema-v1/spec.d.ts.map +0 -1
- package/dist/vendor/unpromise/index.d.ts +0 -3
- package/dist/vendor/unpromise/index.d.ts.map +0 -1
- package/dist/vendor/unpromise/types.d.ts +0 -28
- package/dist/vendor/unpromise/types.d.ts.map +0 -1
- package/dist/vendor/unpromise/unpromise.d.ts +0 -121
- package/dist/vendor/unpromise/unpromise.d.ts.map +0 -1
- package/dist/vendor/unpromise/unpromise.js +0 -292
- package/dist/vendor/unpromise/unpromise.mjs +0 -289
- package/http/index.d.ts +0 -1
- package/http/index.js +0 -1
- package/observable/index.d.ts +0 -1
- package/observable/index.js +0 -1
- package/rpc/index.d.ts +0 -1
- package/rpc/index.js +0 -1
- package/shared/index.d.ts +0 -1
- package/shared/index.js +0 -1
- package/unstable-core-do-not-import/index.d.ts +0 -1
- package/unstable-core-do-not-import/index.js +0 -1
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"version": "11.3.2-canary.2+b0426132b",
|
|
4
6
|
"description": "The tRPC server library",
|
|
5
7
|
"author": "KATT",
|
|
6
8
|
"license": "MIT",
|
|
7
|
-
"main": "dist/index.
|
|
8
|
-
"module": "dist/index.mjs",
|
|
9
|
-
"
|
|
9
|
+
"main": "./dist/index.cjs",
|
|
10
|
+
"module": "./dist/index.mjs",
|
|
11
|
+
"types": "./dist/index.d.cts",
|
|
10
12
|
"homepage": "https://trpc.io",
|
|
11
13
|
"repository": {
|
|
12
14
|
"type": "git",
|
|
@@ -14,9 +16,8 @@
|
|
|
14
16
|
"directory": "packages/server"
|
|
15
17
|
},
|
|
16
18
|
"scripts": {
|
|
17
|
-
"build": "
|
|
18
|
-
"dev": "
|
|
19
|
-
"codegen-entrypoints": "tsx entrypoints.script.ts",
|
|
19
|
+
"build": "tsdown",
|
|
20
|
+
"dev": "tsdown --watch",
|
|
20
21
|
"benchmark": "tsc --project tsconfig.benchmark.json",
|
|
21
22
|
"lint": "eslint --cache src",
|
|
22
23
|
"ts-watch": "tsc --watch"
|
|
@@ -24,79 +25,154 @@
|
|
|
24
25
|
"exports": {
|
|
25
26
|
"./package.json": "./package.json",
|
|
26
27
|
".": {
|
|
27
|
-
"import":
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
"import": {
|
|
29
|
+
"default": "./dist/index.mjs",
|
|
30
|
+
"types": "./dist/index.d.mts"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"default": "./dist/index.cjs",
|
|
34
|
+
"types": "./dist/index.d.cts"
|
|
35
|
+
}
|
|
30
36
|
},
|
|
31
37
|
"./adapters/aws-lambda": {
|
|
32
|
-
"import":
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
"import": {
|
|
39
|
+
"default": "./dist/adapters/aws-lambda/index.mjs",
|
|
40
|
+
"types": "./dist/adapters/aws-lambda/index.d.mts"
|
|
41
|
+
},
|
|
42
|
+
"require": {
|
|
43
|
+
"default": "./dist/adapters/aws-lambda/index.cjs",
|
|
44
|
+
"types": "./dist/adapters/aws-lambda/index.d.cts"
|
|
45
|
+
}
|
|
35
46
|
},
|
|
36
47
|
"./adapters/express": {
|
|
37
|
-
"import":
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
"import": {
|
|
49
|
+
"default": "./dist/adapters/express.mjs",
|
|
50
|
+
"types": "./dist/adapters/express.d.mts"
|
|
51
|
+
},
|
|
52
|
+
"require": {
|
|
53
|
+
"default": "./dist/adapters/express.cjs",
|
|
54
|
+
"types": "./dist/adapters/express.d.cts"
|
|
55
|
+
}
|
|
40
56
|
},
|
|
41
57
|
"./adapters/fastify": {
|
|
42
|
-
"import":
|
|
43
|
-
|
|
44
|
-
|
|
58
|
+
"import": {
|
|
59
|
+
"default": "./dist/adapters/fastify/index.mjs",
|
|
60
|
+
"types": "./dist/adapters/fastify/index.d.mts"
|
|
61
|
+
},
|
|
62
|
+
"require": {
|
|
63
|
+
"default": "./dist/adapters/fastify/index.cjs",
|
|
64
|
+
"types": "./dist/adapters/fastify/index.d.cts"
|
|
65
|
+
}
|
|
45
66
|
},
|
|
46
67
|
"./adapters/fetch": {
|
|
47
|
-
"import":
|
|
48
|
-
|
|
49
|
-
|
|
68
|
+
"import": {
|
|
69
|
+
"default": "./dist/adapters/fetch/index.mjs",
|
|
70
|
+
"types": "./dist/adapters/fetch/index.d.mts"
|
|
71
|
+
},
|
|
72
|
+
"require": {
|
|
73
|
+
"default": "./dist/adapters/fetch/index.cjs",
|
|
74
|
+
"types": "./dist/adapters/fetch/index.d.cts"
|
|
75
|
+
}
|
|
50
76
|
},
|
|
51
77
|
"./adapters/next-app-dir": {
|
|
52
|
-
"import":
|
|
53
|
-
|
|
54
|
-
|
|
78
|
+
"import": {
|
|
79
|
+
"default": "./dist/adapters/next-app-dir.mjs",
|
|
80
|
+
"types": "./dist/adapters/next-app-dir.d.mts"
|
|
81
|
+
},
|
|
82
|
+
"require": {
|
|
83
|
+
"default": "./dist/adapters/next-app-dir.cjs",
|
|
84
|
+
"types": "./dist/adapters/next-app-dir.d.cts"
|
|
85
|
+
}
|
|
55
86
|
},
|
|
56
87
|
"./adapters/next": {
|
|
57
|
-
"import":
|
|
58
|
-
|
|
59
|
-
|
|
88
|
+
"import": {
|
|
89
|
+
"default": "./dist/adapters/next.mjs",
|
|
90
|
+
"types": "./dist/adapters/next.d.mts"
|
|
91
|
+
},
|
|
92
|
+
"require": {
|
|
93
|
+
"default": "./dist/adapters/next.cjs",
|
|
94
|
+
"types": "./dist/adapters/next.d.cts"
|
|
95
|
+
}
|
|
60
96
|
},
|
|
61
97
|
"./adapters/node-http": {
|
|
62
|
-
"import":
|
|
63
|
-
|
|
64
|
-
|
|
98
|
+
"import": {
|
|
99
|
+
"default": "./dist/adapters/node-http/index.mjs",
|
|
100
|
+
"types": "./dist/adapters/node-http/index.d.mts"
|
|
101
|
+
},
|
|
102
|
+
"require": {
|
|
103
|
+
"default": "./dist/adapters/node-http/index.cjs",
|
|
104
|
+
"types": "./dist/adapters/node-http/index.d.cts"
|
|
105
|
+
}
|
|
65
106
|
},
|
|
66
107
|
"./adapters/standalone": {
|
|
67
|
-
"import":
|
|
68
|
-
|
|
69
|
-
|
|
108
|
+
"import": {
|
|
109
|
+
"default": "./dist/adapters/standalone.mjs",
|
|
110
|
+
"types": "./dist/adapters/standalone.d.mts"
|
|
111
|
+
},
|
|
112
|
+
"require": {
|
|
113
|
+
"default": "./dist/adapters/standalone.cjs",
|
|
114
|
+
"types": "./dist/adapters/standalone.d.cts"
|
|
115
|
+
}
|
|
70
116
|
},
|
|
71
117
|
"./adapters/ws": {
|
|
72
|
-
"import":
|
|
73
|
-
|
|
74
|
-
|
|
118
|
+
"import": {
|
|
119
|
+
"default": "./dist/adapters/ws.mjs",
|
|
120
|
+
"types": "./dist/adapters/ws.d.mts"
|
|
121
|
+
},
|
|
122
|
+
"require": {
|
|
123
|
+
"default": "./dist/adapters/ws.cjs",
|
|
124
|
+
"types": "./dist/adapters/ws.d.cts"
|
|
125
|
+
}
|
|
75
126
|
},
|
|
76
127
|
"./http": {
|
|
77
|
-
"import":
|
|
78
|
-
|
|
79
|
-
|
|
128
|
+
"import": {
|
|
129
|
+
"default": "./dist/http.mjs",
|
|
130
|
+
"types": "./dist/http.d.mts"
|
|
131
|
+
},
|
|
132
|
+
"require": {
|
|
133
|
+
"default": "./dist/http.cjs",
|
|
134
|
+
"types": "./dist/http.d.cts"
|
|
135
|
+
}
|
|
80
136
|
},
|
|
81
137
|
"./observable": {
|
|
82
|
-
"import":
|
|
83
|
-
|
|
84
|
-
|
|
138
|
+
"import": {
|
|
139
|
+
"default": "./dist/observable/index.mjs",
|
|
140
|
+
"types": "./dist/observable/index.d.mts"
|
|
141
|
+
},
|
|
142
|
+
"require": {
|
|
143
|
+
"default": "./dist/observable/index.cjs",
|
|
144
|
+
"types": "./dist/observable/index.d.cts"
|
|
145
|
+
}
|
|
85
146
|
},
|
|
86
147
|
"./rpc": {
|
|
87
|
-
"import":
|
|
88
|
-
|
|
89
|
-
|
|
148
|
+
"import": {
|
|
149
|
+
"default": "./dist/rpc.mjs",
|
|
150
|
+
"types": "./dist/rpc.d.mts"
|
|
151
|
+
},
|
|
152
|
+
"require": {
|
|
153
|
+
"default": "./dist/rpc.cjs",
|
|
154
|
+
"types": "./dist/rpc.d.cts"
|
|
155
|
+
}
|
|
90
156
|
},
|
|
91
157
|
"./shared": {
|
|
92
|
-
"import":
|
|
93
|
-
|
|
94
|
-
|
|
158
|
+
"import": {
|
|
159
|
+
"default": "./dist/shared.mjs",
|
|
160
|
+
"types": "./dist/shared.d.mts"
|
|
161
|
+
},
|
|
162
|
+
"require": {
|
|
163
|
+
"default": "./dist/shared.cjs",
|
|
164
|
+
"types": "./dist/shared.d.cts"
|
|
165
|
+
}
|
|
95
166
|
},
|
|
96
167
|
"./unstable-core-do-not-import": {
|
|
97
|
-
"import":
|
|
98
|
-
|
|
99
|
-
|
|
168
|
+
"import": {
|
|
169
|
+
"default": "./dist/unstable-core-do-not-import.mjs",
|
|
170
|
+
"types": "./dist/unstable-core-do-not-import.d.mts"
|
|
171
|
+
},
|
|
172
|
+
"require": {
|
|
173
|
+
"default": "./dist/unstable-core-do-not-import.cjs",
|
|
174
|
+
"types": "./dist/unstable-core-do-not-import.d.cts"
|
|
175
|
+
}
|
|
100
176
|
}
|
|
101
177
|
},
|
|
102
178
|
"files": [
|
|
@@ -118,6 +194,7 @@
|
|
|
118
194
|
},
|
|
119
195
|
"devDependencies": {
|
|
120
196
|
"@fastify/websocket": "^10.0.1",
|
|
197
|
+
"@oxc-project/runtime": "0.69.0",
|
|
121
198
|
"@tanstack/react-query": "^5.80.3",
|
|
122
199
|
"@types/aws-lambda": "^8.10.149",
|
|
123
200
|
"@types/express": "^5.0.0",
|
|
@@ -136,10 +213,9 @@
|
|
|
136
213
|
"next": "^15.3.1",
|
|
137
214
|
"react": "^19.1.0",
|
|
138
215
|
"react-dom": "^19.1.0",
|
|
139
|
-
"rollup": "^4.34.8",
|
|
140
216
|
"superjson": "^1.12.4",
|
|
141
217
|
"superstruct": "^2.0.0",
|
|
142
|
-
"
|
|
218
|
+
"tsdown": "0.12.7",
|
|
143
219
|
"typescript": "^5.8.2",
|
|
144
220
|
"valibot": "1.1.0",
|
|
145
221
|
"ws": "^8.0.0",
|
|
@@ -152,5 +228,5 @@
|
|
|
152
228
|
"peerDependencies": {
|
|
153
229
|
"typescript": ">=5.7.2"
|
|
154
230
|
},
|
|
155
|
-
"gitHead": "
|
|
231
|
+
"gitHead": "b0426132b53af5b3a679063522429e5842f577e4"
|
|
156
232
|
}
|
package/rpc/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"main":"../dist/rpc.cjs","module":"../dist/rpc.mjs","types":"../dist/rpc.d.cts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"main":"../dist/shared.cjs","module":"../dist/shared.mjs","types":"../dist/shared.d.cts"}
|
|
@@ -24,19 +24,38 @@ export {
|
|
|
24
24
|
type inferTransformedSubscriptionOutput,
|
|
25
25
|
type AnyProcedure as AnyTRPCProcedure,
|
|
26
26
|
type AnyRouter as AnyTRPCRouter,
|
|
27
|
+
type RouterDef as TRPCRouterDef,
|
|
28
|
+
type RouterBuilder as TRPCRouterBuilder,
|
|
29
|
+
type RouterCallerFactory as TRPCRouterCallerFactory,
|
|
30
|
+
type RootConfig as TRPCRootConfig,
|
|
27
31
|
type AnyRootTypes as AnyTRPCRootTypes,
|
|
32
|
+
type MiddlewareFunction as TRPCMiddlewareFunction,
|
|
33
|
+
type MiddlewareBuilder as TRPCMiddlewareBuilder,
|
|
28
34
|
type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction,
|
|
29
35
|
type CombinedDataTransformer as TRPCCombinedDataTransformer,
|
|
30
36
|
type ProcedureType as TRPCProcedureType,
|
|
31
37
|
type AnyMutationProcedure as AnyTRPCMutationProcedure,
|
|
32
38
|
type AnyQueryProcedure as AnyTRPCQueryProcedure,
|
|
33
39
|
type RouterRecord as TRPCRouterRecord,
|
|
40
|
+
type MergeRouters as TRPCMergeRouters,
|
|
34
41
|
type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure,
|
|
35
42
|
type CreateContextCallback,
|
|
36
43
|
type MutationProcedure as TRPCMutationProcedure,
|
|
37
44
|
type QueryProcedure as TRPCQueryProcedure,
|
|
45
|
+
type BuiltRouter as TRPCBuiltRouter,
|
|
38
46
|
type SubscriptionProcedure as TRPCSubscriptionProcedure,
|
|
39
47
|
type TRPCBuilder,
|
|
48
|
+
type ProcedureBuilder as TRPCProcedureBuilder,
|
|
49
|
+
type RuntimeConfigOptions as TRPCRuntimeConfigOptions,
|
|
50
|
+
type TRPCRootObject,
|
|
51
|
+
type ErrorFormatter as TRPCErrorFormatter,
|
|
52
|
+
type TRPCErrorShape,
|
|
53
|
+
type DefaultErrorShape as TRPCDefaultErrorShape,
|
|
54
|
+
type DefaultErrorData as TRPCDefaultErrorData,
|
|
55
|
+
type TRPC_ERROR_CODE_KEY,
|
|
56
|
+
type TRPC_ERROR_CODE_NUMBER,
|
|
57
|
+
type DecorateCreateRouterOptions as TRPCDecorateCreateRouterOptions,
|
|
58
|
+
type CreateRouterOptions as TRPCCreateRouterOptions,
|
|
40
59
|
StandardSchemaV1Error,
|
|
41
60
|
/**
|
|
42
61
|
* @deprecated use `tracked(id, data)` instead
|
|
@@ -51,6 +70,11 @@ export {
|
|
|
51
70
|
*/
|
|
52
71
|
lazy as experimental_lazy,
|
|
53
72
|
callProcedure as callTRPCProcedure,
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
type UnsetMarker as TRPCUnsetMarker,
|
|
54
78
|
} from '../../unstable-core-do-not-import';
|
|
55
79
|
|
|
56
80
|
export type {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TRPCError } from '../error/TRPCError';
|
|
2
2
|
import type { ProcedureType } from '../procedure';
|
|
3
3
|
import { getProcedureAtPath, type AnyRouter } from '../router';
|
|
4
|
-
import { isObject
|
|
4
|
+
import { isObject } from '../utils';
|
|
5
5
|
import { parseConnectionParamsFromString } from './parseConnectionParams';
|
|
6
6
|
import type { TRPCAcceptHeader, TRPCRequestInfo } from './types';
|
|
7
7
|
|
|
@@ -25,13 +25,14 @@ type ContentTypeHandler = {
|
|
|
25
25
|
*/
|
|
26
26
|
function memo<TReturn>(fn: () => Promise<TReturn>) {
|
|
27
27
|
let promise: Promise<TReturn> | null = null;
|
|
28
|
-
|
|
28
|
+
const sym = Symbol.for('@trpc/server/http/memo');
|
|
29
|
+
let value: TReturn | typeof sym = sym;
|
|
29
30
|
return {
|
|
30
31
|
/**
|
|
31
32
|
* Lazily read the value
|
|
32
33
|
*/
|
|
33
34
|
read: async (): Promise<TReturn> => {
|
|
34
|
-
if (value !==
|
|
35
|
+
if (value !== sym) {
|
|
35
36
|
return value;
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -56,7 +57,7 @@ function memo<TReturn>(fn: () => Promise<TReturn>) {
|
|
|
56
57
|
* Get an already stored result
|
|
57
58
|
*/
|
|
58
59
|
result: (): TReturn | undefined => {
|
|
59
|
-
return value !==
|
|
60
|
+
return value !== sym ? value : undefined;
|
|
60
61
|
},
|
|
61
62
|
};
|
|
62
63
|
}
|
|
@@ -3,10 +3,18 @@ import {
|
|
|
3
3
|
type DefaultErrorShape,
|
|
4
4
|
type ErrorFormatter,
|
|
5
5
|
} from './error/formatter';
|
|
6
|
+
import type { MiddlewareBuilder, MiddlewareFunction } from './middleware';
|
|
6
7
|
import { createMiddlewareFactory } from './middleware';
|
|
8
|
+
import type { ProcedureBuilder } from './procedureBuilder';
|
|
7
9
|
import { createBuilder } from './procedureBuilder';
|
|
8
|
-
import type { CreateRootTypes } from './rootConfig';
|
|
10
|
+
import type { AnyRootTypes, CreateRootTypes } from './rootConfig';
|
|
9
11
|
import { isServerDefault, type RootConfig } from './rootConfig';
|
|
12
|
+
import type {
|
|
13
|
+
AnyRouter,
|
|
14
|
+
MergeRouters,
|
|
15
|
+
RouterBuilder,
|
|
16
|
+
RouterCallerFactory,
|
|
17
|
+
} from './router';
|
|
10
18
|
import {
|
|
11
19
|
createCallerFactory,
|
|
12
20
|
createRouterFactory,
|
|
@@ -15,11 +23,15 @@ import {
|
|
|
15
23
|
import type { DataTransformerOptions } from './transformer';
|
|
16
24
|
import { defaultTransformer, getDataTransformer } from './transformer';
|
|
17
25
|
import type { Unwrap, ValidateShape } from './types';
|
|
26
|
+
import type { UnsetMarker } from './utils';
|
|
18
27
|
|
|
19
28
|
type inferErrorFormatterShape<TType> =
|
|
20
29
|
TType extends ErrorFormatter<any, infer TShape> ? TShape : DefaultErrorShape;
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
/** @internal */
|
|
31
|
+
export interface RuntimeConfigOptions<
|
|
32
|
+
TContext extends object,
|
|
33
|
+
TMeta extends object,
|
|
34
|
+
> extends Partial<
|
|
23
35
|
Omit<
|
|
24
36
|
RootConfig<{
|
|
25
37
|
ctx: TContext;
|
|
@@ -39,6 +51,69 @@ interface RuntimeConfigOptions<TContext extends object, TMeta extends object>
|
|
|
39
51
|
|
|
40
52
|
type ContextCallback = (...args: any[]) => object | Promise<object>;
|
|
41
53
|
|
|
54
|
+
export interface TRPCRootObject<
|
|
55
|
+
TContext extends object,
|
|
56
|
+
TMeta extends object,
|
|
57
|
+
TOptions extends RuntimeConfigOptions<TContext, TMeta>,
|
|
58
|
+
$Root extends AnyRootTypes = {
|
|
59
|
+
ctx: TContext;
|
|
60
|
+
meta: TMeta;
|
|
61
|
+
errorShape: undefined extends TOptions['errorFormatter']
|
|
62
|
+
? DefaultErrorShape
|
|
63
|
+
: inferErrorFormatterShape<TOptions['errorFormatter']>;
|
|
64
|
+
transformer: undefined extends TOptions['transformer'] ? false : true;
|
|
65
|
+
},
|
|
66
|
+
> {
|
|
67
|
+
/**
|
|
68
|
+
* Your router config
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
_config: RootConfig<$Root>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Builder object for creating procedures
|
|
75
|
+
* @see https://trpc.io/docs/v11/server/procedures
|
|
76
|
+
*/
|
|
77
|
+
procedure: ProcedureBuilder<
|
|
78
|
+
TContext,
|
|
79
|
+
TMeta,
|
|
80
|
+
object,
|
|
81
|
+
UnsetMarker,
|
|
82
|
+
UnsetMarker,
|
|
83
|
+
UnsetMarker,
|
|
84
|
+
UnsetMarker,
|
|
85
|
+
false
|
|
86
|
+
>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Create reusable middlewares
|
|
90
|
+
* @see https://trpc.io/docs/v11/server/middlewares
|
|
91
|
+
*/
|
|
92
|
+
middleware: <$ContextOverrides>(
|
|
93
|
+
fn: MiddlewareFunction<TContext, TMeta, object, $ContextOverrides, unknown>,
|
|
94
|
+
) => MiddlewareBuilder<TContext, TMeta, $ContextOverrides, unknown>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Create a router
|
|
98
|
+
* @see https://trpc.io/docs/v11/server/routers
|
|
99
|
+
*/
|
|
100
|
+
router: RouterBuilder<$Root>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Merge Routers
|
|
104
|
+
* @see https://trpc.io/docs/v11/server/merging-routers
|
|
105
|
+
*/
|
|
106
|
+
mergeRouters: <TRouters extends AnyRouter[]>(
|
|
107
|
+
...routerList: [...TRouters]
|
|
108
|
+
) => MergeRouters<TRouters>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Create a server-side caller for a router
|
|
112
|
+
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
113
|
+
*/
|
|
114
|
+
createCallerFactory: RouterCallerFactory<$Root>;
|
|
115
|
+
}
|
|
116
|
+
|
|
42
117
|
class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
43
118
|
/**
|
|
44
119
|
* Add a context shape as a generic to the root object
|
|
@@ -65,7 +140,7 @@ class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
65
140
|
*/
|
|
66
141
|
create<TOptions extends RuntimeConfigOptions<TContext, TMeta>>(
|
|
67
142
|
opts?: ValidateShape<TOptions, RuntimeConfigOptions<TContext, TMeta>>,
|
|
68
|
-
) {
|
|
143
|
+
): TRPCRootObject<TContext, TMeta, TOptions> {
|
|
69
144
|
type $Root = CreateRootTypes<{
|
|
70
145
|
ctx: TContext;
|
|
71
146
|
meta: TMeta;
|
|
@@ -132,18 +132,26 @@ function isLazy<TAny>(input: unknown): input is Lazy<TAny> {
|
|
|
132
132
|
return typeof input === 'function' && lazySymbol in input;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
export interface RouterDef<
|
|
139
|
+
TRoot extends AnyRootTypes,
|
|
140
|
+
TRecord extends RouterRecord,
|
|
141
|
+
> {
|
|
142
|
+
_config: RootConfig<TRoot>;
|
|
143
|
+
router: true;
|
|
144
|
+
procedure?: never;
|
|
145
|
+
procedures: TRecord;
|
|
146
|
+
record: TRecord;
|
|
147
|
+
lazy: Record<string, LazyLoader<AnyRouter>>;
|
|
148
|
+
}
|
|
149
|
+
|
|
135
150
|
export interface Router<
|
|
136
151
|
TRoot extends AnyRootTypes,
|
|
137
152
|
TRecord extends RouterRecord,
|
|
138
153
|
> {
|
|
139
|
-
_def:
|
|
140
|
-
_config: RootConfig<TRoot>;
|
|
141
|
-
router: true;
|
|
142
|
-
procedure?: never;
|
|
143
|
-
procedures: TRecord;
|
|
144
|
-
record: TRecord;
|
|
145
|
-
lazy: Record<string, LazyLoader<AnyRouter>>;
|
|
146
|
-
};
|
|
154
|
+
_def: RouterDef<TRoot, TRecord>;
|
|
147
155
|
/**
|
|
148
156
|
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
149
157
|
*/
|
|
@@ -152,8 +160,14 @@ export interface Router<
|
|
|
152
160
|
|
|
153
161
|
export type BuiltRouter<
|
|
154
162
|
TRoot extends AnyRootTypes,
|
|
155
|
-
|
|
156
|
-
> = Router<TRoot,
|
|
163
|
+
TRecord extends RouterRecord,
|
|
164
|
+
> = Router<TRoot, TRecord> & TRecord;
|
|
165
|
+
|
|
166
|
+
export interface RouterBuilder<TRoot extends AnyRootTypes> {
|
|
167
|
+
<TIn extends CreateRouterOptions>(
|
|
168
|
+
_: TIn,
|
|
169
|
+
): BuiltRouter<TRoot, DecorateCreateRouterOptions<TIn>>;
|
|
170
|
+
}
|
|
157
171
|
|
|
158
172
|
export type AnyRouter = Router<any, any>;
|
|
159
173
|
|
|
@@ -200,6 +214,7 @@ const reservedWords = [
|
|
|
200
214
|
'apply',
|
|
201
215
|
];
|
|
202
216
|
|
|
217
|
+
/** @internal */
|
|
203
218
|
export type CreateRouterOptions = {
|
|
204
219
|
[key: string]:
|
|
205
220
|
| AnyProcedure
|
|
@@ -208,6 +223,7 @@ export type CreateRouterOptions = {
|
|
|
208
223
|
| Lazy<AnyRouter>;
|
|
209
224
|
};
|
|
210
225
|
|
|
226
|
+
/** @internal */
|
|
211
227
|
export type DecorateCreateRouterOptions<
|
|
212
228
|
TRouterOptions extends CreateRouterOptions,
|
|
213
229
|
> = {
|
|
@@ -410,7 +426,15 @@ export async function callProcedure(
|
|
|
410
426
|
return proc(opts);
|
|
411
427
|
}
|
|
412
428
|
|
|
413
|
-
export
|
|
429
|
+
export interface RouterCallerFactory<TRoot extends AnyRootTypes> {
|
|
430
|
+
<TRecord extends RouterRecord>(
|
|
431
|
+
router: Pick<Router<TRoot, TRecord>, '_def'>,
|
|
432
|
+
): RouterCaller<TRoot, TRecord>;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export function createCallerFactory<
|
|
436
|
+
TRoot extends AnyRootTypes,
|
|
437
|
+
>(): RouterCallerFactory<TRoot> {
|
|
414
438
|
return function createCallerInner<TRecord extends RouterRecord>(
|
|
415
439
|
router: Pick<Router<TRoot, TRecord>, '_def'>,
|
|
416
440
|
): RouterCaller<TRoot, TRecord> {
|
|
@@ -464,7 +488,7 @@ export function createCallerFactory<TRoot extends AnyRootTypes>() {
|
|
|
464
488
|
}
|
|
465
489
|
|
|
466
490
|
/** @internal */
|
|
467
|
-
type MergeRouters<
|
|
491
|
+
export type MergeRouters<
|
|
468
492
|
TRouters extends AnyRouter[],
|
|
469
493
|
TRoot extends AnyRootTypes = TRouters[0]['_def']['_config']['$types'],
|
|
470
494
|
TRecord extends RouterRecord = {},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"main":"../dist/unstable-core-do-not-import.cjs","module":"../dist/unstable-core-do-not-import.mjs","types":"../dist/unstable-core-do-not-import.d.cts"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/aws-lambda';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/aws-lambda');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/express';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/express');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/fastify';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/fastify');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/fetch';
|
package/adapters/fetch/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/fetch');
|
package/adapters/next/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/next';
|
package/adapters/next/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/next');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/next-app-dir';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/next-app-dir');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../../../dist/adapters/node-http/content-type/form-data';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../../../dist/adapters/node-http/content-type/form-data');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../../../dist/adapters/node-http/content-type/json';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../../../dist/adapters/node-http/content-type/json');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/node-http';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/node-http');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/standalone';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/standalone');
|
package/adapters/ws/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/ws';
|
package/adapters/ws/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/ws');
|