@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
|
@@ -0,0 +1,1974 @@
|
|
|
1
|
+
import { Observable, inferObservableValue } from "./index.d-D4qZxQJh.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/unstable-core-do-not-import/types.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ================================
|
|
7
|
+
* Useful utility types that doesn't have anything to do with tRPC in particular
|
|
8
|
+
* ================================
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
type Maybe<TType> = TType | null | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
* @see https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325
|
|
17
|
+
*/
|
|
18
|
+
type Simplify<TType> = TType extends any[] | Date ? TType : { [K in keyof TType]: TType[K] };
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
type Dict<TType> = Record<string, TType | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
type MaybePromise<TType> = Promise<TType> | TType;
|
|
27
|
+
type FilterKeys<TObj extends object, TFilter> = { [TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never }[keyof TObj];
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
type Result$1<TType, TErr = unknown> = {
|
|
32
|
+
ok: true;
|
|
33
|
+
value: TType;
|
|
34
|
+
} | {
|
|
35
|
+
ok: false;
|
|
36
|
+
error: TErr;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
type Filter<TObj extends object, TFilter> = Pick<TObj, FilterKeys<TObj, TFilter>>;
|
|
42
|
+
/**
|
|
43
|
+
* Unwrap return type if the type is a function (sync or async), else use the type as is
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
type Unwrap<TType> = TType extends ((...args: any[]) => infer R) ? Awaited<R> : TType;
|
|
47
|
+
/**
|
|
48
|
+
* Makes the object recursively optional
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
type DeepPartial<TObject> = TObject extends object ? { [P in keyof TObject]?: DeepPartial<TObject[P]> } : TObject;
|
|
52
|
+
/**
|
|
53
|
+
* Omits the key without removing a potential union
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
type DistributiveOmit<TObj, TKey extends keyof any> = TObj extends any ? Omit<TObj, TKey> : never;
|
|
57
|
+
/**
|
|
58
|
+
* See https://github.com/microsoft/TypeScript/issues/41966#issuecomment-758187996
|
|
59
|
+
* Fixes issues with iterating over keys of objects with index signatures.
|
|
60
|
+
* Without this, iterations over keys of objects with index signatures will lose
|
|
61
|
+
* type information about the keys and only the index signature will remain.
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
type WithoutIndexSignature<TObj> = { [K in keyof TObj as string extends K ? never : number extends K ? never : K]: TObj[K] };
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
* Overwrite properties in `TType` with properties in `TWith`
|
|
68
|
+
* Only overwrites properties when the type to be overwritten
|
|
69
|
+
* is an object. Otherwise it will just use the type from `TWith`.
|
|
70
|
+
*/
|
|
71
|
+
type Overwrite<TType, TWith> = TWith extends any ? TType extends object ? { [K in keyof WithoutIndexSignature<TType> | keyof WithoutIndexSignature<TWith>]: K extends keyof TWith ? TWith[K] : K extends keyof TType ? TType[K] : never } & (string extends keyof TWith ? {
|
|
72
|
+
[key: string]: TWith[string];
|
|
73
|
+
} : number extends keyof TWith ? {
|
|
74
|
+
[key: number]: TWith[number];
|
|
75
|
+
} : {}) : TWith : never;
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
type ValidateShape<TActualShape, TExpectedShape> = TActualShape extends TExpectedShape ? Exclude<keyof TActualShape, keyof TExpectedShape> extends never ? TActualShape : TExpectedShape : never;
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
type PickFirstDefined<TType, TPick> = undefined extends TType ? undefined extends TPick ? never : TPick : TType;
|
|
84
|
+
type KeyFromValue<TValue, TType extends Record<PropertyKey, PropertyKey>> = { [K in keyof TType]: TValue extends TType[K] ? K : never }[keyof TType];
|
|
85
|
+
type InvertKeyValue<TType extends Record<PropertyKey, PropertyKey>> = { [TValue in TType[keyof TType]]: KeyFromValue<TValue, TType> };
|
|
86
|
+
/**
|
|
87
|
+
* ================================
|
|
88
|
+
* tRPC specific types
|
|
89
|
+
* ================================
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
type IntersectionError<TKey extends string> = `The property '${TKey}' in your router collides with a built-in method, rename this router or procedure on your backend.`;
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
type ProtectedIntersection<TType, TWith> = keyof TType & keyof TWith extends never ? TType & TWith : IntersectionError<string & keyof TType & keyof TWith>;
|
|
99
|
+
/**
|
|
100
|
+
* @internal
|
|
101
|
+
* Returns the raw input type of a procedure
|
|
102
|
+
*/
|
|
103
|
+
type GetRawInputFn = () => Promise<unknown>;
|
|
104
|
+
declare const _errorSymbol: unique symbol;
|
|
105
|
+
type ErrorSymbol = typeof _errorSymbol;
|
|
106
|
+
type TypeError<TMessage extends string> = TMessage & {
|
|
107
|
+
_: typeof _errorSymbol;
|
|
108
|
+
};
|
|
109
|
+
type ValueOf<TObj> = TObj[keyof TObj];
|
|
110
|
+
type coerceAsyncIterableToArray<TValue> = TValue extends AsyncIterable<infer $Inferred> ? $Inferred[] : TValue;
|
|
111
|
+
/**
|
|
112
|
+
* @internal
|
|
113
|
+
* Infers the type of the value yielded by an async iterable
|
|
114
|
+
*/
|
|
115
|
+
type inferAsyncIterableYield<T> = T extends AsyncIterable<infer U> ? U : T;
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/unstable-core-do-not-import/rpc/codes.d.ts
|
|
118
|
+
/**
|
|
119
|
+
* JSON-RPC 2.0 Error codes
|
|
120
|
+
*
|
|
121
|
+
* `-32000` to `-32099` are reserved for implementation-defined server-errors.
|
|
122
|
+
* For tRPC we're copying the last digits of HTTP 4XX errors.
|
|
123
|
+
*/
|
|
124
|
+
declare const TRPC_ERROR_CODES_BY_KEY: {
|
|
125
|
+
/**
|
|
126
|
+
* Invalid JSON was received by the server.
|
|
127
|
+
* An error occurred on the server while parsing the JSON text.
|
|
128
|
+
*/
|
|
129
|
+
readonly PARSE_ERROR: -32700;
|
|
130
|
+
/**
|
|
131
|
+
* The JSON sent is not a valid Request object.
|
|
132
|
+
*/
|
|
133
|
+
readonly BAD_REQUEST: -32600;
|
|
134
|
+
readonly INTERNAL_SERVER_ERROR: -32603;
|
|
135
|
+
readonly NOT_IMPLEMENTED: -32603;
|
|
136
|
+
readonly BAD_GATEWAY: -32603;
|
|
137
|
+
readonly SERVICE_UNAVAILABLE: -32603;
|
|
138
|
+
readonly GATEWAY_TIMEOUT: -32603;
|
|
139
|
+
readonly UNAUTHORIZED: -32001;
|
|
140
|
+
readonly PAYMENT_REQUIRED: -32002;
|
|
141
|
+
readonly FORBIDDEN: -32003;
|
|
142
|
+
readonly NOT_FOUND: -32004;
|
|
143
|
+
readonly METHOD_NOT_SUPPORTED: -32005;
|
|
144
|
+
readonly TIMEOUT: -32008;
|
|
145
|
+
readonly CONFLICT: -32009;
|
|
146
|
+
readonly PRECONDITION_FAILED: -32012;
|
|
147
|
+
readonly PAYLOAD_TOO_LARGE: -32013;
|
|
148
|
+
readonly UNSUPPORTED_MEDIA_TYPE: -32015;
|
|
149
|
+
readonly UNPROCESSABLE_CONTENT: -32022;
|
|
150
|
+
readonly TOO_MANY_REQUESTS: -32029;
|
|
151
|
+
readonly CLIENT_CLOSED_REQUEST: -32099;
|
|
152
|
+
};
|
|
153
|
+
declare const TRPC_ERROR_CODES_BY_NUMBER: InvertKeyValue<typeof TRPC_ERROR_CODES_BY_KEY>;
|
|
154
|
+
type TRPC_ERROR_CODE_NUMBER = ValueOf<typeof TRPC_ERROR_CODES_BY_KEY>;
|
|
155
|
+
type TRPC_ERROR_CODE_KEY = keyof typeof TRPC_ERROR_CODES_BY_KEY;
|
|
156
|
+
/**
|
|
157
|
+
* tRPC error codes that are considered retryable
|
|
158
|
+
* With out of the box SSE, the client will reconnect when these errors are encountered
|
|
159
|
+
*/
|
|
160
|
+
declare const retryableRpcCodes: TRPC_ERROR_CODE_NUMBER[];
|
|
161
|
+
//# sourceMappingURL=codes.d.ts.map
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/unstable-core-do-not-import/error/TRPCError.d.ts
|
|
164
|
+
declare function getCauseFromUnknown(cause: unknown): Error | undefined;
|
|
165
|
+
declare function getTRPCErrorFromUnknown(cause: unknown): TRPCError;
|
|
166
|
+
declare class TRPCError extends Error {
|
|
167
|
+
readonly cause?: Error;
|
|
168
|
+
readonly code: "PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST";
|
|
169
|
+
constructor(opts: {
|
|
170
|
+
message?: string;
|
|
171
|
+
code: TRPC_ERROR_CODE_KEY;
|
|
172
|
+
cause?: unknown;
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=TRPCError.d.ts.map
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/vendor/standard-schema-v1/spec.d.ts
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @see https://github.com/standard-schema/standard-schema/blob/main/packages/spec/src/index.ts
|
|
181
|
+
*/
|
|
182
|
+
/** The Standard Schema interface. */
|
|
183
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
184
|
+
/** The Standard Schema properties. */
|
|
185
|
+
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
186
|
+
}
|
|
187
|
+
declare namespace StandardSchemaV1 {
|
|
188
|
+
/** The Standard Schema properties interface. */
|
|
189
|
+
interface Props<Input = unknown, Output = Input> {
|
|
190
|
+
/** The version number of the standard. */
|
|
191
|
+
readonly version: 1;
|
|
192
|
+
/** The vendor name of the schema library. */
|
|
193
|
+
readonly vendor: string;
|
|
194
|
+
/** Validates unknown input values. */
|
|
195
|
+
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
196
|
+
/** Inferred types associated with the schema. */
|
|
197
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
198
|
+
}
|
|
199
|
+
/** The result interface of the validate function. */
|
|
200
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
201
|
+
/** The result interface if validation succeeds. */
|
|
202
|
+
interface SuccessResult<Output> {
|
|
203
|
+
/** The typed output value. */
|
|
204
|
+
readonly value: Output;
|
|
205
|
+
/** The non-existent issues. */
|
|
206
|
+
readonly issues?: undefined;
|
|
207
|
+
}
|
|
208
|
+
/** The result interface if validation fails. */
|
|
209
|
+
interface FailureResult {
|
|
210
|
+
/** The issues of failed validation. */
|
|
211
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
212
|
+
}
|
|
213
|
+
/** The issue interface of the failure output. */
|
|
214
|
+
interface Issue {
|
|
215
|
+
/** The error message of the issue. */
|
|
216
|
+
readonly message: string;
|
|
217
|
+
/** The path of the issue, if any. */
|
|
218
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
219
|
+
}
|
|
220
|
+
/** The path segment interface of the issue. */
|
|
221
|
+
interface PathSegment {
|
|
222
|
+
/** The key representing a path segment. */
|
|
223
|
+
readonly key: PropertyKey;
|
|
224
|
+
}
|
|
225
|
+
/** The Standard Schema types interface. */
|
|
226
|
+
interface Types<Input = unknown, Output = Input> {
|
|
227
|
+
/** The input type of the schema. */
|
|
228
|
+
readonly input: Input;
|
|
229
|
+
/** The output type of the schema. */
|
|
230
|
+
readonly output: Output;
|
|
231
|
+
}
|
|
232
|
+
/** Infers the input type of a Standard Schema. */
|
|
233
|
+
type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];
|
|
234
|
+
/** Infers the output type of a Standard Schema. */
|
|
235
|
+
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=spec.d.ts.map
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/unstable-core-do-not-import/parser.d.ts
|
|
240
|
+
type ParserZodEsque<TInput, TParsedInput> = {
|
|
241
|
+
_input: TInput;
|
|
242
|
+
_output: TParsedInput;
|
|
243
|
+
};
|
|
244
|
+
type ParserValibotEsque<TInput, TParsedInput> = {
|
|
245
|
+
schema: {
|
|
246
|
+
_types?: {
|
|
247
|
+
input: TInput;
|
|
248
|
+
output: TParsedInput;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
type ParserArkTypeEsque<TInput, TParsedInput> = {
|
|
253
|
+
inferIn: TInput;
|
|
254
|
+
infer: TParsedInput;
|
|
255
|
+
};
|
|
256
|
+
type ParserStandardSchemaEsque<TInput, TParsedInput> = StandardSchemaV1<TInput, TParsedInput>;
|
|
257
|
+
type ParserMyZodEsque<TInput> = {
|
|
258
|
+
parse: (input: any) => TInput;
|
|
259
|
+
};
|
|
260
|
+
type ParserSuperstructEsque<TInput> = {
|
|
261
|
+
create: (input: unknown) => TInput;
|
|
262
|
+
};
|
|
263
|
+
type ParserCustomValidatorEsque<TInput> = (input: unknown) => Promise<TInput> | TInput;
|
|
264
|
+
type ParserYupEsque<TInput> = {
|
|
265
|
+
validateSync: (input: unknown) => TInput;
|
|
266
|
+
};
|
|
267
|
+
type ParserScaleEsque<TInput> = {
|
|
268
|
+
assert(value: unknown): asserts value is TInput;
|
|
269
|
+
};
|
|
270
|
+
type ParserWithoutInput<TInput> = ParserCustomValidatorEsque<TInput> | ParserMyZodEsque<TInput> | ParserScaleEsque<TInput> | ParserSuperstructEsque<TInput> | ParserYupEsque<TInput>;
|
|
271
|
+
type ParserWithInputOutput<TInput, TParsedInput> = ParserZodEsque<TInput, TParsedInput> | ParserValibotEsque<TInput, TParsedInput> | ParserArkTypeEsque<TInput, TParsedInput> | ParserStandardSchemaEsque<TInput, TParsedInput>;
|
|
272
|
+
type Parser = ParserWithInputOutput<any, any> | ParserWithoutInput<any>;
|
|
273
|
+
type inferParser<TParser extends Parser> = TParser extends ParserWithInputOutput<infer $TIn, infer $TOut> ? {
|
|
274
|
+
in: $TIn;
|
|
275
|
+
out: $TOut;
|
|
276
|
+
} : TParser extends ParserWithoutInput<infer $InOut> ? {
|
|
277
|
+
in: $InOut;
|
|
278
|
+
out: $InOut;
|
|
279
|
+
} : never;
|
|
280
|
+
type ParseFn<TType> = (value: unknown) => Promise<TType> | TType;
|
|
281
|
+
declare function getParseFn<TType>(procedureParser: Parser): ParseFn<TType>;
|
|
282
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region src/unstable-core-do-not-import/middleware.d.ts
|
|
285
|
+
/** @internal */
|
|
286
|
+
declare const middlewareMarker: "middlewareMarker" & {
|
|
287
|
+
__brand: "middlewareMarker";
|
|
288
|
+
};
|
|
289
|
+
type MiddlewareMarker = typeof middlewareMarker;
|
|
290
|
+
interface MiddlewareResultBase {
|
|
291
|
+
/**
|
|
292
|
+
* All middlewares should pass through their `next()`'s output.
|
|
293
|
+
* Requiring this marker makes sure that can't be forgotten at compile-time.
|
|
294
|
+
*/
|
|
295
|
+
readonly marker: MiddlewareMarker;
|
|
296
|
+
}
|
|
297
|
+
interface MiddlewareOKResult<_TContextOverride> extends MiddlewareResultBase {
|
|
298
|
+
ok: true;
|
|
299
|
+
data: unknown;
|
|
300
|
+
}
|
|
301
|
+
interface MiddlewareErrorResult<_TContextOverride> extends MiddlewareResultBase {
|
|
302
|
+
ok: false;
|
|
303
|
+
error: TRPCError;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* @internal
|
|
307
|
+
*/
|
|
308
|
+
type MiddlewareResult<_TContextOverride> = MiddlewareErrorResult<_TContextOverride> | MiddlewareOKResult<_TContextOverride>;
|
|
309
|
+
/**
|
|
310
|
+
* @internal
|
|
311
|
+
*/
|
|
312
|
+
interface MiddlewareBuilder<TContext, TMeta, TContextOverrides, TInputOut> {
|
|
313
|
+
/**
|
|
314
|
+
* Create a new builder based on the current middleware builder
|
|
315
|
+
*/
|
|
316
|
+
unstable_pipe<$ContextOverridesOut>(fn: MiddlewareFunction<TContext, TMeta, TContextOverrides, $ContextOverridesOut, TInputOut> | MiddlewareBuilder<Overwrite<TContext, TContextOverrides>, TMeta, $ContextOverridesOut, TInputOut>): MiddlewareBuilder<TContext, TMeta, Overwrite<TContextOverrides, $ContextOverridesOut>, TInputOut>;
|
|
317
|
+
/**
|
|
318
|
+
* List of middlewares within this middleware builder
|
|
319
|
+
*/
|
|
320
|
+
_middlewares: MiddlewareFunction<TContext, TMeta, TContextOverrides, object, TInputOut>[];
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* @internal
|
|
324
|
+
*/
|
|
325
|
+
type MiddlewareFunction<TContext, TMeta, TContextOverridesIn, $ContextOverridesOut, TInputOut> = {
|
|
326
|
+
(opts: {
|
|
327
|
+
ctx: Simplify<Overwrite<TContext, TContextOverridesIn>>;
|
|
328
|
+
type: ProcedureType;
|
|
329
|
+
path: string;
|
|
330
|
+
input: TInputOut;
|
|
331
|
+
getRawInput: GetRawInputFn;
|
|
332
|
+
meta: TMeta | undefined;
|
|
333
|
+
signal: AbortSignal | undefined;
|
|
334
|
+
next: {
|
|
335
|
+
(): Promise<MiddlewareResult<TContextOverridesIn>>;
|
|
336
|
+
<$ContextOverride>(opts: {
|
|
337
|
+
ctx?: $ContextOverride;
|
|
338
|
+
input?: unknown;
|
|
339
|
+
}): Promise<MiddlewareResult<$ContextOverride>>;
|
|
340
|
+
(opts: {
|
|
341
|
+
getRawInput: GetRawInputFn;
|
|
342
|
+
}): Promise<MiddlewareResult<TContextOverridesIn>>;
|
|
343
|
+
};
|
|
344
|
+
}): Promise<MiddlewareResult<$ContextOverridesOut>>;
|
|
345
|
+
_type?: string | undefined;
|
|
346
|
+
};
|
|
347
|
+
type AnyMiddlewareFunction = MiddlewareFunction<any, any, any, any, any>;
|
|
348
|
+
type AnyMiddlewareBuilder = MiddlewareBuilder<any, any, any, any>;
|
|
349
|
+
/**
|
|
350
|
+
* @internal
|
|
351
|
+
*/
|
|
352
|
+
declare function createMiddlewareFactory<TContext, TMeta, TInputOut = unknown>(): <$ContextOverrides>(fn: MiddlewareFunction<TContext, TMeta, object, $ContextOverrides, TInputOut>) => MiddlewareBuilder<TContext, TMeta, $ContextOverrides, TInputOut>;
|
|
353
|
+
/**
|
|
354
|
+
* Create a standalone middleware
|
|
355
|
+
* @see https://trpc.io/docs/v11/server/middlewares#experimental-standalone-middlewares
|
|
356
|
+
* @deprecated use `.concat()` instead
|
|
357
|
+
*/
|
|
358
|
+
declare const experimental_standaloneMiddleware: <TCtx extends {
|
|
359
|
+
ctx?: object;
|
|
360
|
+
meta?: object;
|
|
361
|
+
input?: unknown;
|
|
362
|
+
}>() => {
|
|
363
|
+
create: <$ContextOverrides>(fn: MiddlewareFunction<TCtx extends {
|
|
364
|
+
ctx: infer T extends object;
|
|
365
|
+
} ? T : any, TCtx extends {
|
|
366
|
+
meta: infer T_1 extends object;
|
|
367
|
+
} ? T_1 : object, object, $ContextOverrides, TCtx extends {
|
|
368
|
+
input: infer T_2;
|
|
369
|
+
} ? T_2 : unknown>) => MiddlewareBuilder<TCtx extends {
|
|
370
|
+
ctx: infer T extends object;
|
|
371
|
+
} ? T : any, TCtx extends {
|
|
372
|
+
meta: infer T_1 extends object;
|
|
373
|
+
} ? T_1 : object, $ContextOverrides, TCtx extends {
|
|
374
|
+
input: infer T_2;
|
|
375
|
+
} ? T_2 : unknown>;
|
|
376
|
+
};
|
|
377
|
+
/**
|
|
378
|
+
* @internal
|
|
379
|
+
* Please note, `trpc-openapi` uses this function.
|
|
380
|
+
*/
|
|
381
|
+
declare function createInputMiddleware<TInput>(parse: ParseFn<TInput>): AnyMiddlewareFunction;
|
|
382
|
+
/**
|
|
383
|
+
* @internal
|
|
384
|
+
*/
|
|
385
|
+
declare function createOutputMiddleware<TOutput>(parse: ParseFn<TOutput>): AnyMiddlewareFunction;
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/unstable-core-do-not-import/stream/tracked.d.ts
|
|
388
|
+
declare const trackedSymbol: unique symbol;
|
|
389
|
+
type TrackedId = string & {
|
|
390
|
+
__brand: 'TrackedId';
|
|
391
|
+
};
|
|
392
|
+
type TrackedEnvelope<TData> = [TrackedId, TData, typeof trackedSymbol];
|
|
393
|
+
type TrackedData<TData> = {
|
|
394
|
+
/**
|
|
395
|
+
* The id of the message to keep track of in case the connection gets lost
|
|
396
|
+
*/
|
|
397
|
+
id: string;
|
|
398
|
+
/**
|
|
399
|
+
* The data field of the message - this can be anything
|
|
400
|
+
*/
|
|
401
|
+
data: TData;
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* Produce a typed server-sent event message
|
|
405
|
+
* @deprecated use `tracked(id, data)` instead
|
|
406
|
+
*/
|
|
407
|
+
declare function sse<TData>(event: {
|
|
408
|
+
id: string;
|
|
409
|
+
data: TData;
|
|
410
|
+
}): TrackedEnvelope<TData>;
|
|
411
|
+
declare function isTrackedEnvelope<TData>(value: unknown): value is TrackedEnvelope<TData>;
|
|
412
|
+
/**
|
|
413
|
+
* Automatically track an event so that it can be resumed from a given id if the connection is lost
|
|
414
|
+
*/
|
|
415
|
+
declare function tracked<TData>(id: string, data: TData): TrackedEnvelope<TData>;
|
|
416
|
+
type inferTrackedOutput<TData> = TData extends TrackedEnvelope<infer $Data> ? TrackedData<$Data> : TData;
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/unstable-core-do-not-import/utils.d.ts
|
|
419
|
+
/** @internal */
|
|
420
|
+
type UnsetMarker = 'unsetMarker' & {
|
|
421
|
+
__brand: 'unsetMarker';
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* Ensures there are no duplicate keys when building a procedure.
|
|
425
|
+
* @internal
|
|
426
|
+
*/
|
|
427
|
+
declare function mergeWithoutOverrides<TType extends Record<string, unknown>>(obj1: TType, ...objs: Partial<TType>[]): TType;
|
|
428
|
+
/**
|
|
429
|
+
* Check that value is object
|
|
430
|
+
* @internal
|
|
431
|
+
*/
|
|
432
|
+
declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
433
|
+
type AnyFn = ((...args: any[]) => unknown) & Record<keyof any, unknown>;
|
|
434
|
+
declare function isFunction(fn: unknown): fn is AnyFn;
|
|
435
|
+
/**
|
|
436
|
+
* Create an object without inheriting anything from `Object.prototype`
|
|
437
|
+
* @internal
|
|
438
|
+
*/
|
|
439
|
+
declare function omitPrototype<TObj extends Record<string, unknown>>(obj: TObj): TObj;
|
|
440
|
+
declare function isAsyncIterable<TValue>(value: unknown): value is AsyncIterable<TValue>;
|
|
441
|
+
/**
|
|
442
|
+
* Run an IIFE
|
|
443
|
+
*/
|
|
444
|
+
declare const run: <TValue>(fn: () => TValue) => TValue;
|
|
445
|
+
declare function noop(): void;
|
|
446
|
+
declare function identity<T>(it: T): T;
|
|
447
|
+
/**
|
|
448
|
+
* Generic runtime assertion function. Throws, if the condition is not `true`.
|
|
449
|
+
*
|
|
450
|
+
* Can be used as a slightly less dangerous variant of type assertions. Code
|
|
451
|
+
* mistakes would be revealed at runtime then (hopefully during testing).
|
|
452
|
+
*/
|
|
453
|
+
declare function assert(condition: boolean, msg?: string): asserts condition;
|
|
454
|
+
declare function sleep(ms?: number): Promise<void>;
|
|
455
|
+
/**
|
|
456
|
+
* Ponyfill for
|
|
457
|
+
* [`AbortSignal.any`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static).
|
|
458
|
+
*/
|
|
459
|
+
declare function abortSignalsAnyPonyfill(signals: AbortSignal[]): AbortSignal;
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region src/unstable-core-do-not-import/procedureBuilder.d.ts
|
|
462
|
+
type IntersectIfDefined<TType, TWith> = TType extends UnsetMarker ? TWith : TWith extends UnsetMarker ? TType : Simplify<TType & TWith>;
|
|
463
|
+
type DefaultValue<TValue, TFallback> = TValue extends UnsetMarker ? TFallback : TValue;
|
|
464
|
+
type inferAsyncIterable<TOutput> = TOutput extends AsyncIterable<infer $Yield, infer $Return, infer $Next> ? {
|
|
465
|
+
yield: $Yield;
|
|
466
|
+
return: $Return;
|
|
467
|
+
next: $Next;
|
|
468
|
+
} : never;
|
|
469
|
+
type inferSubscriptionOutput<TOutput> = TOutput extends AsyncIterable<any> ? AsyncIterable<inferTrackedOutput<inferAsyncIterable<TOutput>['yield']>, inferAsyncIterable<TOutput>['return'], inferAsyncIterable<TOutput>['next']> : TypeError<'Subscription output could not be inferred'>;
|
|
470
|
+
type CallerOverride<TContext> = (opts: {
|
|
471
|
+
args: unknown[];
|
|
472
|
+
invoke: (opts: ProcedureCallOptions<TContext>) => Promise<unknown>;
|
|
473
|
+
_def: AnyProcedure['_def'];
|
|
474
|
+
}) => Promise<unknown>;
|
|
475
|
+
type ProcedureBuilderDef<TMeta> = {
|
|
476
|
+
procedure: true;
|
|
477
|
+
inputs: Parser[];
|
|
478
|
+
output?: Parser;
|
|
479
|
+
meta?: TMeta;
|
|
480
|
+
resolver?: ProcedureBuilderResolver;
|
|
481
|
+
middlewares: AnyMiddlewareFunction[];
|
|
482
|
+
/**
|
|
483
|
+
* @deprecated use `type` instead
|
|
484
|
+
*/
|
|
485
|
+
mutation?: boolean;
|
|
486
|
+
/**
|
|
487
|
+
* @deprecated use `type` instead
|
|
488
|
+
*/
|
|
489
|
+
query?: boolean;
|
|
490
|
+
/**
|
|
491
|
+
* @deprecated use `type` instead
|
|
492
|
+
*/
|
|
493
|
+
subscription?: boolean;
|
|
494
|
+
type?: ProcedureType;
|
|
495
|
+
caller?: CallerOverride<unknown>;
|
|
496
|
+
};
|
|
497
|
+
type AnyProcedureBuilderDef = ProcedureBuilderDef<any>;
|
|
498
|
+
/**
|
|
499
|
+
* Procedure resolver options (what the `.query()`, `.mutation()`, and `.subscription()` functions receive)
|
|
500
|
+
* @internal
|
|
501
|
+
*/
|
|
502
|
+
interface ProcedureResolverOptions<TContext, _TMeta, TContextOverridesIn, TInputOut> {
|
|
503
|
+
ctx: Simplify<Overwrite<TContext, TContextOverridesIn>>;
|
|
504
|
+
input: TInputOut extends UnsetMarker ? undefined : TInputOut;
|
|
505
|
+
/**
|
|
506
|
+
* The AbortSignal of the request
|
|
507
|
+
*/
|
|
508
|
+
signal: AbortSignal | undefined;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* A procedure resolver
|
|
512
|
+
*/
|
|
513
|
+
type ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputParserIn, $Output> = (opts: ProcedureResolverOptions<TContext, TMeta, TContextOverrides, TInputOut>) => MaybePromise<DefaultValue<TOutputParserIn, $Output>>;
|
|
514
|
+
type AnyProcedureBuilder = ProcedureBuilder<any, any, any, any, any, any, any, any>;
|
|
515
|
+
/**
|
|
516
|
+
* Infer the context type from a procedure builder
|
|
517
|
+
* Useful to create common helper functions for different procedures
|
|
518
|
+
*/
|
|
519
|
+
type inferProcedureBuilderResolverOptions<TProcedureBuilder extends AnyProcedureBuilder> = TProcedureBuilder extends ProcedureBuilder<infer TContext, infer TMeta, infer TContextOverrides, infer _TInputIn, infer TInputOut, infer _TOutputIn, infer _TOutputOut, infer _TCaller> ? ProcedureResolverOptions<TContext, TMeta, TContextOverrides, TInputOut extends UnsetMarker ? unknown : TInputOut extends object ? Simplify<TInputOut & {
|
|
520
|
+
/**
|
|
521
|
+
* Extra input params might have been added by a `.input()` further down the chain
|
|
522
|
+
*/
|
|
523
|
+
[keyAddedByInputCallFurtherDown: string]: unknown;
|
|
524
|
+
}> : TInputOut> : never;
|
|
525
|
+
interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut, TCaller extends boolean> {
|
|
526
|
+
/**
|
|
527
|
+
* Add an input parser to the procedure.
|
|
528
|
+
* @see https://trpc.io/docs/v11/server/validators
|
|
529
|
+
*/
|
|
530
|
+
input<$Parser extends Parser>(schema: TInputOut extends UnsetMarker ? $Parser : inferParser<$Parser>['out'] extends Record<string, unknown> | undefined ? TInputOut extends Record<string, unknown> | undefined ? undefined extends inferParser<$Parser>['out'] ? undefined extends TInputOut ? $Parser : TypeError<'Cannot chain an optional parser to a required parser'> : $Parser : TypeError<'All input parsers did not resolve to an object'> : TypeError<'All input parsers did not resolve to an object'>): ProcedureBuilder<TContext, TMeta, TContextOverrides, IntersectIfDefined<TInputIn, inferParser<$Parser>['in']>, IntersectIfDefined<TInputOut, inferParser<$Parser>['out']>, TOutputIn, TOutputOut, TCaller>;
|
|
531
|
+
/**
|
|
532
|
+
* Add an output parser to the procedure.
|
|
533
|
+
* @see https://trpc.io/docs/v11/server/validators
|
|
534
|
+
*/
|
|
535
|
+
output<$Parser extends Parser>(schema: $Parser): ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, IntersectIfDefined<TOutputIn, inferParser<$Parser>['in']>, IntersectIfDefined<TOutputOut, inferParser<$Parser>['out']>, TCaller>;
|
|
536
|
+
/**
|
|
537
|
+
* Add a meta data to the procedure.
|
|
538
|
+
* @see https://trpc.io/docs/v11/server/metadata
|
|
539
|
+
*/
|
|
540
|
+
meta(meta: TMeta): ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut, TCaller>;
|
|
541
|
+
/**
|
|
542
|
+
* Add a middleware to the procedure.
|
|
543
|
+
* @see https://trpc.io/docs/v11/server/middlewares
|
|
544
|
+
*/
|
|
545
|
+
use<$ContextOverridesOut>(fn: MiddlewareBuilder<Overwrite<TContext, TContextOverrides>, TMeta, $ContextOverridesOut, TInputOut> | MiddlewareFunction<TContext, TMeta, TContextOverrides, $ContextOverridesOut, TInputOut>): ProcedureBuilder<TContext, TMeta, Overwrite<TContextOverrides, $ContextOverridesOut>, TInputIn, TInputOut, TOutputIn, TOutputOut, TCaller>;
|
|
546
|
+
/**
|
|
547
|
+
* @deprecated use {@link concat} instead
|
|
548
|
+
*/
|
|
549
|
+
unstable_concat<$Context, $Meta, $ContextOverrides, $InputIn, $InputOut, $OutputIn, $OutputOut>(builder: Overwrite<TContext, TContextOverrides> extends $Context ? TMeta extends $Meta ? ProcedureBuilder<$Context, $Meta, $ContextOverrides, $InputIn, $InputOut, $OutputIn, $OutputOut, TCaller> : TypeError<'Meta mismatch'> : TypeError<'Context mismatch'>): ProcedureBuilder<TContext, TMeta, Overwrite<TContextOverrides, $ContextOverrides>, IntersectIfDefined<TInputIn, $InputIn>, IntersectIfDefined<TInputOut, $InputOut>, IntersectIfDefined<TOutputIn, $OutputIn>, IntersectIfDefined<TOutputOut, $OutputOut>, TCaller>;
|
|
550
|
+
/**
|
|
551
|
+
* Combine two procedure builders
|
|
552
|
+
*/
|
|
553
|
+
concat<$Context, $Meta, $ContextOverrides, $InputIn, $InputOut, $OutputIn, $OutputOut>(builder: Overwrite<TContext, TContextOverrides> extends $Context ? TMeta extends $Meta ? ProcedureBuilder<$Context, $Meta, $ContextOverrides, $InputIn, $InputOut, $OutputIn, $OutputOut, TCaller> : TypeError<'Meta mismatch'> : TypeError<'Context mismatch'>): ProcedureBuilder<TContext, TMeta, Overwrite<TContextOverrides, $ContextOverrides>, IntersectIfDefined<TInputIn, $InputIn>, IntersectIfDefined<TInputOut, $InputOut>, IntersectIfDefined<TOutputIn, $OutputIn>, IntersectIfDefined<TOutputOut, $OutputOut>, TCaller>;
|
|
554
|
+
/**
|
|
555
|
+
* Query procedure
|
|
556
|
+
* @see https://trpc.io/docs/v11/concepts#vocabulary
|
|
557
|
+
*/
|
|
558
|
+
query<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): TCaller extends true ? (input: DefaultValue<TInputIn, void>) => Promise<DefaultValue<TOutputOut, $Output>> : QueryProcedure<{
|
|
559
|
+
input: DefaultValue<TInputIn, void>;
|
|
560
|
+
output: DefaultValue<TOutputOut, $Output>;
|
|
561
|
+
meta: TMeta;
|
|
562
|
+
}>;
|
|
563
|
+
/**
|
|
564
|
+
* Mutation procedure
|
|
565
|
+
* @see https://trpc.io/docs/v11/concepts#vocabulary
|
|
566
|
+
*/
|
|
567
|
+
mutation<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): TCaller extends true ? (input: DefaultValue<TInputIn, void>) => Promise<DefaultValue<TOutputOut, $Output>> : MutationProcedure<{
|
|
568
|
+
input: DefaultValue<TInputIn, void>;
|
|
569
|
+
output: DefaultValue<TOutputOut, $Output>;
|
|
570
|
+
meta: TMeta;
|
|
571
|
+
}>;
|
|
572
|
+
/**
|
|
573
|
+
* Subscription procedure
|
|
574
|
+
* @see https://trpc.io/docs/v11/server/subscriptions
|
|
575
|
+
*/
|
|
576
|
+
subscription<$Output extends AsyncIterable<any, void, any>>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): TCaller extends true ? TypeError<'Not implemented'> : SubscriptionProcedure<{
|
|
577
|
+
input: DefaultValue<TInputIn, void>;
|
|
578
|
+
output: inferSubscriptionOutput<DefaultValue<TOutputOut, $Output>>;
|
|
579
|
+
meta: TMeta;
|
|
580
|
+
}>;
|
|
581
|
+
/**
|
|
582
|
+
* @deprecated Using subscriptions with an observable is deprecated. Use an async generator instead.
|
|
583
|
+
* This feature will be removed in v12 of tRPC.
|
|
584
|
+
* @see https://trpc.io/docs/v11/server/subscriptions
|
|
585
|
+
*/
|
|
586
|
+
subscription<$Output extends Observable<any, any>>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): TCaller extends true ? TypeError<'Not implemented'> : LegacyObservableSubscriptionProcedure<{
|
|
587
|
+
input: DefaultValue<TInputIn, void>;
|
|
588
|
+
output: inferObservableValue<DefaultValue<TOutputOut, $Output>>;
|
|
589
|
+
meta: TMeta;
|
|
590
|
+
}>;
|
|
591
|
+
/**
|
|
592
|
+
* Overrides the way a procedure is invoked
|
|
593
|
+
* Do not use this unless you know what you're doing - this is an experimental API
|
|
594
|
+
*/
|
|
595
|
+
experimental_caller(caller: CallerOverride<TContext>): ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut, true>;
|
|
596
|
+
/**
|
|
597
|
+
* @internal
|
|
598
|
+
*/
|
|
599
|
+
_def: ProcedureBuilderDef<TMeta>;
|
|
600
|
+
}
|
|
601
|
+
type ProcedureBuilderResolver = (opts: ProcedureResolverOptions<any, any, any, any>) => Promise<unknown>;
|
|
602
|
+
declare function createBuilder<TContext, TMeta>(initDef?: Partial<AnyProcedureBuilderDef>): ProcedureBuilder<TContext, TMeta, object, UnsetMarker, UnsetMarker, UnsetMarker, UnsetMarker, false>;
|
|
603
|
+
/**
|
|
604
|
+
* @internal
|
|
605
|
+
*/
|
|
606
|
+
interface ProcedureCallOptions<TContext> {
|
|
607
|
+
ctx: TContext;
|
|
608
|
+
getRawInput: GetRawInputFn;
|
|
609
|
+
input?: unknown;
|
|
610
|
+
path: string;
|
|
611
|
+
type: ProcedureType;
|
|
612
|
+
signal: AbortSignal | undefined;
|
|
613
|
+
}
|
|
614
|
+
//#endregion
|
|
615
|
+
//#region src/unstable-core-do-not-import/procedure.d.ts
|
|
616
|
+
declare const procedureTypes: readonly ["query", "mutation", "subscription"];
|
|
617
|
+
/**
|
|
618
|
+
* @public
|
|
619
|
+
*/
|
|
620
|
+
type ProcedureType = (typeof procedureTypes)[number];
|
|
621
|
+
interface BuiltProcedureDef {
|
|
622
|
+
meta: unknown;
|
|
623
|
+
input: unknown;
|
|
624
|
+
output: unknown;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
*
|
|
628
|
+
* @internal
|
|
629
|
+
*/
|
|
630
|
+
interface Procedure<TType extends ProcedureType, TDef extends BuiltProcedureDef> {
|
|
631
|
+
_def: {
|
|
632
|
+
/**
|
|
633
|
+
* These are just types, they can't be used at runtime
|
|
634
|
+
* @internal
|
|
635
|
+
*/
|
|
636
|
+
$types: {
|
|
637
|
+
input: TDef['input'];
|
|
638
|
+
output: TDef['output'];
|
|
639
|
+
};
|
|
640
|
+
procedure: true;
|
|
641
|
+
type: TType;
|
|
642
|
+
/**
|
|
643
|
+
* @internal
|
|
644
|
+
* Meta is not inferrable on individual procedures, only on the router
|
|
645
|
+
*/
|
|
646
|
+
meta: unknown;
|
|
647
|
+
experimental_caller: boolean;
|
|
648
|
+
/**
|
|
649
|
+
* The input parsers for the procedure
|
|
650
|
+
*/
|
|
651
|
+
inputs: Parser[];
|
|
652
|
+
};
|
|
653
|
+
meta: TDef['meta'];
|
|
654
|
+
/**
|
|
655
|
+
* @internal
|
|
656
|
+
*/
|
|
657
|
+
(opts: ProcedureCallOptions<unknown>): Promise<TDef['output']>;
|
|
658
|
+
}
|
|
659
|
+
interface QueryProcedure<TDef extends BuiltProcedureDef> extends Procedure<'query', TDef> {}
|
|
660
|
+
interface MutationProcedure<TDef extends BuiltProcedureDef> extends Procedure<'mutation', TDef> {}
|
|
661
|
+
interface SubscriptionProcedure<TDef extends BuiltProcedureDef> extends Procedure<'subscription', TDef> {}
|
|
662
|
+
/**
|
|
663
|
+
* @deprecated
|
|
664
|
+
*/
|
|
665
|
+
interface LegacyObservableSubscriptionProcedure<TDef extends BuiltProcedureDef> extends SubscriptionProcedure<TDef> {
|
|
666
|
+
_observable: true;
|
|
667
|
+
}
|
|
668
|
+
type AnyQueryProcedure = QueryProcedure<any>;
|
|
669
|
+
type AnyMutationProcedure = MutationProcedure<any>;
|
|
670
|
+
type AnySubscriptionProcedure = SubscriptionProcedure<any> | LegacyObservableSubscriptionProcedure<any>;
|
|
671
|
+
type AnyProcedure = AnyQueryProcedure | AnyMutationProcedure | AnySubscriptionProcedure;
|
|
672
|
+
type inferProcedureInput<TProcedure extends AnyProcedure> = undefined extends inferProcedureParams<TProcedure>['$types']['input'] ? void | inferProcedureParams<TProcedure>['$types']['input'] : inferProcedureParams<TProcedure>['$types']['input'];
|
|
673
|
+
type inferProcedureParams<TProcedure> = TProcedure extends AnyProcedure ? TProcedure['_def'] : never;
|
|
674
|
+
type inferProcedureOutput<TProcedure> = inferProcedureParams<TProcedure>['$types']['output'];
|
|
675
|
+
/**
|
|
676
|
+
* @internal
|
|
677
|
+
*/
|
|
678
|
+
interface ErrorHandlerOptions<TContext> {
|
|
679
|
+
error: TRPCError;
|
|
680
|
+
type: ProcedureType | 'unknown';
|
|
681
|
+
path: string | undefined;
|
|
682
|
+
input: unknown;
|
|
683
|
+
ctx: TContext | undefined;
|
|
684
|
+
}
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region src/unstable-core-do-not-import/http/types.d.ts
|
|
687
|
+
/**
|
|
688
|
+
* @deprecated use `Headers` instead, this will be removed in v12
|
|
689
|
+
*/
|
|
690
|
+
type HTTPHeaders = Dict<string[] | string>;
|
|
691
|
+
interface ResponseMeta {
|
|
692
|
+
status?: number;
|
|
693
|
+
headers?: Headers | HTTPHeaders;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* @internal
|
|
697
|
+
*/
|
|
698
|
+
type ResponseMetaFn<TRouter extends AnyRouter> = (opts: {
|
|
699
|
+
data: TRPCResponse<unknown, inferRouterError<TRouter>>[];
|
|
700
|
+
ctx?: inferRouterContext<TRouter>;
|
|
701
|
+
/**
|
|
702
|
+
* The different tRPC paths requested
|
|
703
|
+
* @deprecated use `info` instead, this will be removed in v12
|
|
704
|
+
**/
|
|
705
|
+
paths: readonly string[] | undefined;
|
|
706
|
+
info: TRPCRequestInfo | undefined;
|
|
707
|
+
type: ProcedureType | 'unknown';
|
|
708
|
+
errors: TRPCError[];
|
|
709
|
+
/**
|
|
710
|
+
* `true` if the `ResponseMeta` is being generated without knowing the response data (e.g. for streamed requests).
|
|
711
|
+
*/
|
|
712
|
+
eagerGeneration: boolean;
|
|
713
|
+
}) => ResponseMeta;
|
|
714
|
+
/**
|
|
715
|
+
* Base interface for anything using HTTP
|
|
716
|
+
*/
|
|
717
|
+
interface HTTPBaseHandlerOptions<TRouter extends AnyRouter, TRequest> extends BaseHandlerOptions<TRouter, TRequest> {
|
|
718
|
+
/**
|
|
719
|
+
* Add handler to be called before response is sent to the user
|
|
720
|
+
* Useful for setting cache headers
|
|
721
|
+
* @see https://trpc.io/docs/v11/caching
|
|
722
|
+
*/
|
|
723
|
+
responseMeta?: ResponseMetaFn<TRouter>;
|
|
724
|
+
}
|
|
725
|
+
type TRPCAcceptHeader = 'application/jsonl';
|
|
726
|
+
interface TRPCRequestInfoProcedureCall {
|
|
727
|
+
path: string;
|
|
728
|
+
/**
|
|
729
|
+
* Read the raw input (deduped and memoized)
|
|
730
|
+
*/
|
|
731
|
+
getRawInput: () => Promise<unknown>;
|
|
732
|
+
/**
|
|
733
|
+
* Get already parsed inputs - won't trigger reading the body or parsing the inputs
|
|
734
|
+
*/
|
|
735
|
+
result: () => unknown;
|
|
736
|
+
/**
|
|
737
|
+
* The procedure being called, `null` if not found
|
|
738
|
+
* @internal
|
|
739
|
+
*/
|
|
740
|
+
procedure: AnyProcedure | null;
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* Information about the incoming request
|
|
744
|
+
* @public
|
|
745
|
+
*/
|
|
746
|
+
interface TRPCRequestInfo {
|
|
747
|
+
/**
|
|
748
|
+
* The `trpc-accept` header
|
|
749
|
+
*/
|
|
750
|
+
accept: TRPCAcceptHeader | null;
|
|
751
|
+
/**
|
|
752
|
+
* The type of the request
|
|
753
|
+
*/
|
|
754
|
+
type: ProcedureType | 'unknown';
|
|
755
|
+
/**
|
|
756
|
+
* If the content type handler has detected that this is a batch call
|
|
757
|
+
*/
|
|
758
|
+
isBatchCall: boolean;
|
|
759
|
+
/**
|
|
760
|
+
* The calls being made
|
|
761
|
+
*/
|
|
762
|
+
calls: TRPCRequestInfoProcedureCall[];
|
|
763
|
+
/**
|
|
764
|
+
* Connection params when using `httpSubscriptionLink` or `createWSClient`
|
|
765
|
+
*/
|
|
766
|
+
connectionParams: Dict<string> | null;
|
|
767
|
+
/**
|
|
768
|
+
* Signal when the request is aborted
|
|
769
|
+
* Can be used to abort async operations during the request, e.g. `fetch()`-requests
|
|
770
|
+
*/
|
|
771
|
+
signal: AbortSignal;
|
|
772
|
+
/**
|
|
773
|
+
* The URL of the request if available
|
|
774
|
+
*/
|
|
775
|
+
url: URL | null;
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Inner createContext function for `resolveResponse` used to forward `TRPCRequestInfo` to `createContext`
|
|
779
|
+
* @internal
|
|
780
|
+
*/
|
|
781
|
+
type ResolveHTTPRequestOptionsContextFn<TRouter extends AnyRouter> = (opts: {
|
|
782
|
+
info: TRPCRequestInfo;
|
|
783
|
+
}) => Promise<inferRouterContext<TRouter>>;
|
|
784
|
+
interface HTTPErrorHandlerOptions<TRouter extends AnyRouter, TRequest> extends ErrorHandlerOptions<inferRouterContext<TRouter>> {
|
|
785
|
+
req: TRequest;
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* @internal
|
|
789
|
+
*/
|
|
790
|
+
type HTTPErrorHandler<TRouter extends AnyRouter, TRequest> = (opts: HTTPErrorHandlerOptions<TRouter, TRequest>) => void;
|
|
791
|
+
/**
|
|
792
|
+
* Base interface for any response handler
|
|
793
|
+
* @internal
|
|
794
|
+
*/
|
|
795
|
+
interface BaseHandlerOptions<TRouter extends AnyRouter, TRequest> {
|
|
796
|
+
onError?: HTTPErrorHandler<TRouter, TRequest>;
|
|
797
|
+
/**
|
|
798
|
+
* @deprecated use `allowBatching` instead, this will be removed in v12
|
|
799
|
+
*/
|
|
800
|
+
batching?: {
|
|
801
|
+
/**
|
|
802
|
+
* @default true
|
|
803
|
+
*/
|
|
804
|
+
enabled: boolean;
|
|
805
|
+
};
|
|
806
|
+
router: TRouter;
|
|
807
|
+
/**
|
|
808
|
+
* Allow method override - will skip the method check
|
|
809
|
+
* @default false
|
|
810
|
+
*/
|
|
811
|
+
allowMethodOverride?: boolean;
|
|
812
|
+
/**
|
|
813
|
+
* Allow request batching
|
|
814
|
+
* @default true
|
|
815
|
+
*/
|
|
816
|
+
allowBatching?: boolean;
|
|
817
|
+
}
|
|
818
|
+
//#endregion
|
|
819
|
+
//#region src/unstable-core-do-not-import/rpc/envelopes.d.ts
|
|
820
|
+
/**
|
|
821
|
+
* Error response
|
|
822
|
+
*/
|
|
823
|
+
interface TRPCErrorShape<TData extends object = object> {
|
|
824
|
+
code: TRPC_ERROR_CODE_NUMBER;
|
|
825
|
+
message: string;
|
|
826
|
+
data: TData;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* JSON-RPC 2.0 Specification
|
|
830
|
+
*/
|
|
831
|
+
declare namespace JSONRPC2 {
|
|
832
|
+
type RequestId = number | string | null;
|
|
833
|
+
/**
|
|
834
|
+
* All requests/responses extends this shape
|
|
835
|
+
*/
|
|
836
|
+
interface BaseEnvelope {
|
|
837
|
+
id?: RequestId;
|
|
838
|
+
jsonrpc?: '2.0';
|
|
839
|
+
}
|
|
840
|
+
interface BaseRequest<TMethod extends string = string> extends BaseEnvelope {
|
|
841
|
+
method: TMethod;
|
|
842
|
+
}
|
|
843
|
+
interface Request<TMethod extends string = string, TParams = unknown> extends BaseRequest<TMethod> {
|
|
844
|
+
params: TParams;
|
|
845
|
+
}
|
|
846
|
+
interface ResultResponse<TResult = unknown> extends BaseEnvelope {
|
|
847
|
+
result: TResult;
|
|
848
|
+
}
|
|
849
|
+
interface ErrorResponse<TError extends TRPCErrorShape = TRPCErrorShape> extends BaseEnvelope {
|
|
850
|
+
error: TError;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
interface TRPCRequest extends JSONRPC2.Request<ProcedureType, {
|
|
854
|
+
path: string;
|
|
855
|
+
input: unknown;
|
|
856
|
+
/**
|
|
857
|
+
* The last event id that the client received
|
|
858
|
+
*/
|
|
859
|
+
lastEventId?: string;
|
|
860
|
+
}> {}
|
|
861
|
+
interface TRPCResult<TData = unknown> {
|
|
862
|
+
data: TData;
|
|
863
|
+
type?: 'data';
|
|
864
|
+
/**
|
|
865
|
+
* The id of the message to keep track of in case of a reconnect
|
|
866
|
+
*/
|
|
867
|
+
id?: string;
|
|
868
|
+
}
|
|
869
|
+
interface TRPCSuccessResponse<TData> extends JSONRPC2.ResultResponse<TRPCResult<TData>> {}
|
|
870
|
+
interface TRPCErrorResponse<TError extends TRPCErrorShape = TRPCErrorShape> extends JSONRPC2.ErrorResponse<TError> {}
|
|
871
|
+
type TRPCResponse<TData = unknown, TError extends TRPCErrorShape = TRPCErrorShape> = TRPCErrorResponse<TError> | TRPCSuccessResponse<TData>;
|
|
872
|
+
type TRPCRequestMessage = TRPCRequest & {
|
|
873
|
+
id: JSONRPC2.RequestId;
|
|
874
|
+
};
|
|
875
|
+
/**
|
|
876
|
+
* The client asked the server to unsubscribe
|
|
877
|
+
*/
|
|
878
|
+
interface TRPCSubscriptionStopNotification extends JSONRPC2.BaseRequest<'subscription.stop'> {
|
|
879
|
+
id: null;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* The client's outgoing request types
|
|
883
|
+
*/
|
|
884
|
+
type TRPCClientOutgoingRequest = TRPCSubscriptionStopNotification;
|
|
885
|
+
/**
|
|
886
|
+
* The client's sent messages shape
|
|
887
|
+
*/
|
|
888
|
+
type TRPCClientOutgoingMessage = TRPCRequestMessage | (JSONRPC2.BaseRequest<'subscription.stop'> & {
|
|
889
|
+
id: JSONRPC2.RequestId;
|
|
890
|
+
});
|
|
891
|
+
interface TRPCResultMessage<TData> extends JSONRPC2.ResultResponse<{
|
|
892
|
+
type: 'started';
|
|
893
|
+
data?: never;
|
|
894
|
+
} | {
|
|
895
|
+
type: 'stopped';
|
|
896
|
+
data?: never;
|
|
897
|
+
} | TRPCResult<TData>> {}
|
|
898
|
+
type TRPCResponseMessage<TData = unknown, TError extends TRPCErrorShape = TRPCErrorShape> = {
|
|
899
|
+
id: JSONRPC2.RequestId;
|
|
900
|
+
} & (TRPCErrorResponse<TError> | TRPCResultMessage<TData>);
|
|
901
|
+
/**
|
|
902
|
+
* The server asked the client to reconnect - useful when restarting/redeploying service
|
|
903
|
+
*/
|
|
904
|
+
interface TRPCReconnectNotification extends JSONRPC2.BaseRequest<'reconnect'> {
|
|
905
|
+
id: JSONRPC2.RequestId;
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* The client's incoming request types
|
|
909
|
+
*/
|
|
910
|
+
type TRPCClientIncomingRequest = TRPCReconnectNotification;
|
|
911
|
+
/**
|
|
912
|
+
* The client's received messages shape
|
|
913
|
+
*/
|
|
914
|
+
type TRPCClientIncomingMessage<TResult = unknown, TError extends TRPCErrorShape = TRPCErrorShape> = TRPCClientIncomingRequest | TRPCResponseMessage<TResult, TError>;
|
|
915
|
+
/**
|
|
916
|
+
* The client sends connection params - always sent as the first message
|
|
917
|
+
*/
|
|
918
|
+
interface TRPCConnectionParamsMessage extends JSONRPC2.BaseRequest<'connectionParams'> {
|
|
919
|
+
data: TRPCRequestInfo['connectionParams'];
|
|
920
|
+
}
|
|
921
|
+
//# sourceMappingURL=envelopes.d.ts.map
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region src/unstable-core-do-not-import/transformer.d.ts
|
|
924
|
+
/**
|
|
925
|
+
* @public
|
|
926
|
+
*/
|
|
927
|
+
interface DataTransformer {
|
|
928
|
+
serialize: (object: any) => any;
|
|
929
|
+
deserialize: (object: any) => any;
|
|
930
|
+
}
|
|
931
|
+
interface InputDataTransformer extends DataTransformer {
|
|
932
|
+
/**
|
|
933
|
+
* This function runs **on the client** before sending the data to the server.
|
|
934
|
+
*/
|
|
935
|
+
serialize: (object: any) => any;
|
|
936
|
+
/**
|
|
937
|
+
* This function runs **on the server** to transform the data before it is passed to the resolver
|
|
938
|
+
*/
|
|
939
|
+
deserialize: (object: any) => any;
|
|
940
|
+
}
|
|
941
|
+
interface OutputDataTransformer extends DataTransformer {
|
|
942
|
+
/**
|
|
943
|
+
* This function runs **on the server** before sending the data to the client.
|
|
944
|
+
*/
|
|
945
|
+
serialize: (object: any) => any;
|
|
946
|
+
/**
|
|
947
|
+
* This function runs **only on the client** to transform the data sent from the server.
|
|
948
|
+
*/
|
|
949
|
+
deserialize: (object: any) => any;
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* @public
|
|
953
|
+
*/
|
|
954
|
+
interface CombinedDataTransformer {
|
|
955
|
+
/**
|
|
956
|
+
* Specify how the data sent from the client to the server should be transformed.
|
|
957
|
+
*/
|
|
958
|
+
input: InputDataTransformer;
|
|
959
|
+
/**
|
|
960
|
+
* Specify how the data sent from the server to the client should be transformed.
|
|
961
|
+
*/
|
|
962
|
+
output: OutputDataTransformer;
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* @public
|
|
966
|
+
*/
|
|
967
|
+
type CombinedDataTransformerClient = {
|
|
968
|
+
input: Pick<CombinedDataTransformer['input'], 'serialize'>;
|
|
969
|
+
output: Pick<CombinedDataTransformer['output'], 'deserialize'>;
|
|
970
|
+
};
|
|
971
|
+
/**
|
|
972
|
+
* @public
|
|
973
|
+
*/
|
|
974
|
+
type DataTransformerOptions = CombinedDataTransformer | DataTransformer;
|
|
975
|
+
/**
|
|
976
|
+
* @internal
|
|
977
|
+
*/
|
|
978
|
+
declare function getDataTransformer(transformer: DataTransformerOptions): CombinedDataTransformer;
|
|
979
|
+
/**
|
|
980
|
+
* @internal
|
|
981
|
+
*/
|
|
982
|
+
declare const defaultTransformer: CombinedDataTransformer;
|
|
983
|
+
/**
|
|
984
|
+
* Takes a unserialized `TRPCResponse` and serializes it with the router's transformers
|
|
985
|
+
**/
|
|
986
|
+
declare function transformTRPCResponse<TResponse extends TRPCResponse | TRPCResponse[] | TRPCResponseMessage | TRPCResponseMessage[]>(config: RootConfig<AnyRootTypes>, itemOrItems: TResponse): TRPCSuccessResponse<unknown> | TRPCErrorResponse<TRPCErrorShape<object>> | ({
|
|
987
|
+
id: JSONRPC2.RequestId;
|
|
988
|
+
} & TRPCResultMessage<unknown>) | (TRPCResponse | TRPCResponseMessage)[];
|
|
989
|
+
/** @internal */
|
|
990
|
+
declare function transformResultInner<TRouter extends AnyRouter, TOutput>(response: TRPCResponse<TOutput, inferRouterError<TRouter>> | TRPCResponseMessage<TOutput, inferRouterError<TRouter>>, transformer: DataTransformer): {
|
|
991
|
+
readonly ok: false;
|
|
992
|
+
readonly error: {
|
|
993
|
+
readonly error: inferRouterError<TRouter>;
|
|
994
|
+
readonly id?: JSONRPC2.RequestId;
|
|
995
|
+
readonly jsonrpc?: "2.0";
|
|
996
|
+
} | {
|
|
997
|
+
readonly error: inferRouterError<TRouter>;
|
|
998
|
+
readonly id: string | number | null;
|
|
999
|
+
readonly jsonrpc?: "2.0";
|
|
1000
|
+
};
|
|
1001
|
+
readonly result?: undefined;
|
|
1002
|
+
} | {
|
|
1003
|
+
readonly ok: true;
|
|
1004
|
+
readonly result: {
|
|
1005
|
+
type: "started";
|
|
1006
|
+
data?: never;
|
|
1007
|
+
} | {
|
|
1008
|
+
type: "stopped";
|
|
1009
|
+
data?: never;
|
|
1010
|
+
} | TRPCResult<TOutput>;
|
|
1011
|
+
readonly error?: undefined;
|
|
1012
|
+
};
|
|
1013
|
+
/**
|
|
1014
|
+
* Transforms and validates that the result is a valid TRPCResponse
|
|
1015
|
+
* @internal
|
|
1016
|
+
*/
|
|
1017
|
+
declare function transformResult<TRouter extends AnyRouter, TOutput>(response: TRPCResponse<TOutput, inferRouterError<TRouter>> | TRPCResponseMessage<TOutput, inferRouterError<TRouter>>, transformer: DataTransformer): ReturnType<typeof transformResultInner>;
|
|
1018
|
+
//#endregion
|
|
1019
|
+
//#region src/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts
|
|
1020
|
+
/** @public */
|
|
1021
|
+
declare function parseTRPCMessage(obj: unknown, transformer: CombinedDataTransformer): TRPCClientOutgoingMessage;
|
|
1022
|
+
//# sourceMappingURL=parseTRPCMessage.d.ts.map
|
|
1023
|
+
|
|
1024
|
+
//#endregion
|
|
1025
|
+
//#region src/unstable-core-do-not-import/error/formatter.d.ts
|
|
1026
|
+
/**
|
|
1027
|
+
* @internal
|
|
1028
|
+
*/
|
|
1029
|
+
type ErrorFormatter<TContext, TShape extends TRPCErrorShape> = (opts: {
|
|
1030
|
+
error: TRPCError;
|
|
1031
|
+
type: ProcedureType | 'unknown';
|
|
1032
|
+
path: string | undefined;
|
|
1033
|
+
input: unknown;
|
|
1034
|
+
ctx: TContext | undefined;
|
|
1035
|
+
shape: DefaultErrorShape;
|
|
1036
|
+
}) => TShape;
|
|
1037
|
+
/**
|
|
1038
|
+
* @internal
|
|
1039
|
+
*/
|
|
1040
|
+
type DefaultErrorData = {
|
|
1041
|
+
code: TRPC_ERROR_CODE_KEY;
|
|
1042
|
+
httpStatus: number;
|
|
1043
|
+
/**
|
|
1044
|
+
* Path to the procedure that threw the error
|
|
1045
|
+
*/
|
|
1046
|
+
path?: string;
|
|
1047
|
+
/**
|
|
1048
|
+
* Stack trace of the error (only in development)
|
|
1049
|
+
*/
|
|
1050
|
+
stack?: string;
|
|
1051
|
+
};
|
|
1052
|
+
/**
|
|
1053
|
+
* @internal
|
|
1054
|
+
*/
|
|
1055
|
+
interface DefaultErrorShape extends TRPCErrorShape<DefaultErrorData> {
|
|
1056
|
+
message: string;
|
|
1057
|
+
code: TRPC_ERROR_CODE_NUMBER;
|
|
1058
|
+
}
|
|
1059
|
+
declare const defaultFormatter: ErrorFormatter<any, any>;
|
|
1060
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
1061
|
+
//#endregion
|
|
1062
|
+
//#region src/unstable-core-do-not-import/stream/jsonl.d.ts
|
|
1063
|
+
/**
|
|
1064
|
+
* A subset of the standard ReadableStream properties needed by tRPC internally.
|
|
1065
|
+
* @see ReadableStream from lib.dom.d.ts
|
|
1066
|
+
*/
|
|
1067
|
+
type WebReadableStreamEsque = {
|
|
1068
|
+
getReader: () => ReadableStreamDefaultReader<Uint8Array>;
|
|
1069
|
+
};
|
|
1070
|
+
type NodeJSReadableStreamEsque = {
|
|
1071
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): NodeJSReadableStreamEsque;
|
|
1072
|
+
};
|
|
1073
|
+
declare const CHUNK_VALUE_TYPE_PROMISE = 0;
|
|
1074
|
+
type CHUNK_VALUE_TYPE_PROMISE = typeof CHUNK_VALUE_TYPE_PROMISE;
|
|
1075
|
+
declare const CHUNK_VALUE_TYPE_ASYNC_ITERABLE = 1;
|
|
1076
|
+
type CHUNK_VALUE_TYPE_ASYNC_ITERABLE = typeof CHUNK_VALUE_TYPE_ASYNC_ITERABLE;
|
|
1077
|
+
declare const PROMISE_STATUS_FULFILLED = 0;
|
|
1078
|
+
type PROMISE_STATUS_FULFILLED = typeof PROMISE_STATUS_FULFILLED;
|
|
1079
|
+
declare const PROMISE_STATUS_REJECTED = 1;
|
|
1080
|
+
type PROMISE_STATUS_REJECTED = typeof PROMISE_STATUS_REJECTED;
|
|
1081
|
+
declare const ASYNC_ITERABLE_STATUS_RETURN = 0;
|
|
1082
|
+
type ASYNC_ITERABLE_STATUS_RETURN = typeof ASYNC_ITERABLE_STATUS_RETURN;
|
|
1083
|
+
declare const ASYNC_ITERABLE_STATUS_YIELD = 1;
|
|
1084
|
+
type ASYNC_ITERABLE_STATUS_YIELD = typeof ASYNC_ITERABLE_STATUS_YIELD;
|
|
1085
|
+
declare const ASYNC_ITERABLE_STATUS_ERROR = 2;
|
|
1086
|
+
type ASYNC_ITERABLE_STATUS_ERROR = typeof ASYNC_ITERABLE_STATUS_ERROR;
|
|
1087
|
+
type ChunkDefinitionKey = null | number | string;
|
|
1088
|
+
type ChunkIndex = number & {
|
|
1089
|
+
__chunkIndex: true;
|
|
1090
|
+
};
|
|
1091
|
+
type ChunkValueType = CHUNK_VALUE_TYPE_PROMISE | CHUNK_VALUE_TYPE_ASYNC_ITERABLE;
|
|
1092
|
+
type ChunkDefinition = [key: ChunkDefinitionKey, type: ChunkValueType, chunkId: ChunkIndex];
|
|
1093
|
+
type EncodedValue = [[unknown] | [], ...ChunkDefinition[]];
|
|
1094
|
+
type PromiseChunk = [chunkIndex: ChunkIndex, status: PROMISE_STATUS_FULFILLED, value: EncodedValue] | [chunkIndex: ChunkIndex, status: PROMISE_STATUS_REJECTED, error: unknown];
|
|
1095
|
+
type IterableChunk = [chunkIndex: ChunkIndex, status: ASYNC_ITERABLE_STATUS_RETURN, value: EncodedValue] | [chunkIndex: ChunkIndex, status: ASYNC_ITERABLE_STATUS_YIELD, value: EncodedValue] | [chunkIndex: ChunkIndex, status: ASYNC_ITERABLE_STATUS_ERROR, error: unknown];
|
|
1096
|
+
type ChunkData = PromiseChunk | IterableChunk;
|
|
1097
|
+
declare function isPromise(value: unknown): value is Promise<unknown>;
|
|
1098
|
+
type Serialize$2 = (value: any) => any;
|
|
1099
|
+
type Deserialize$1 = (value: any) => any;
|
|
1100
|
+
type PathArray = readonly (string | number)[];
|
|
1101
|
+
type ProducerOnError = (opts: {
|
|
1102
|
+
error: unknown;
|
|
1103
|
+
path: PathArray;
|
|
1104
|
+
}) => void;
|
|
1105
|
+
interface JSONLProducerOptions {
|
|
1106
|
+
serialize?: Serialize$2;
|
|
1107
|
+
data: Record<string, unknown> | unknown[];
|
|
1108
|
+
onError?: ProducerOnError;
|
|
1109
|
+
formatError?: (opts: {
|
|
1110
|
+
error: unknown;
|
|
1111
|
+
path: PathArray;
|
|
1112
|
+
}) => unknown;
|
|
1113
|
+
maxDepth?: number;
|
|
1114
|
+
/**
|
|
1115
|
+
* Interval in milliseconds to send a ping to the client to keep the connection alive
|
|
1116
|
+
* This will be sent as a whitespace character
|
|
1117
|
+
* @default undefined
|
|
1118
|
+
*/
|
|
1119
|
+
pingMs?: number;
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* JSON Lines stream producer
|
|
1123
|
+
* @see https://jsonlines.org/
|
|
1124
|
+
*/
|
|
1125
|
+
declare function jsonlStreamProducer(opts: JSONLProducerOptions): ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
1126
|
+
type ConsumerOnError = (opts: {
|
|
1127
|
+
error: unknown;
|
|
1128
|
+
}) => void;
|
|
1129
|
+
/**
|
|
1130
|
+
* JSON Lines stream consumer
|
|
1131
|
+
* @see https://jsonlines.org/
|
|
1132
|
+
*/
|
|
1133
|
+
declare function jsonlStreamConsumer<THead>(opts: {
|
|
1134
|
+
from: NodeJSReadableStreamEsque | WebReadableStreamEsque;
|
|
1135
|
+
deserialize?: Deserialize$1;
|
|
1136
|
+
onError?: ConsumerOnError;
|
|
1137
|
+
formatError?: (opts: {
|
|
1138
|
+
error: unknown;
|
|
1139
|
+
}) => Error;
|
|
1140
|
+
/**
|
|
1141
|
+
* This `AbortController` will be triggered when there are no more listeners to the stream.
|
|
1142
|
+
*/
|
|
1143
|
+
abortController: AbortController;
|
|
1144
|
+
}): Promise<readonly [Awaited<THead>, {
|
|
1145
|
+
getOrCreate: (chunkId: ChunkIndex) => {
|
|
1146
|
+
enqueue: (v: ChunkData) => void;
|
|
1147
|
+
close: () => void;
|
|
1148
|
+
closed: boolean;
|
|
1149
|
+
getReaderResource: () => ReadableStreamDefaultReader<ChunkData> & Disposable;
|
|
1150
|
+
error: (reason: unknown) => void;
|
|
1151
|
+
};
|
|
1152
|
+
isEmpty: () => boolean;
|
|
1153
|
+
cancelAll: (reason: unknown) => void;
|
|
1154
|
+
}]>;
|
|
1155
|
+
//#endregion
|
|
1156
|
+
//#region src/unstable-core-do-not-import/stream/sse.types.d.ts
|
|
1157
|
+
/**
|
|
1158
|
+
* @internal
|
|
1159
|
+
*/
|
|
1160
|
+
declare namespace EventSourceLike {
|
|
1161
|
+
export interface InitDict {
|
|
1162
|
+
withCredentials?: boolean;
|
|
1163
|
+
}
|
|
1164
|
+
export interface MessageEvent extends Event {
|
|
1165
|
+
data: any;
|
|
1166
|
+
lastEventId?: string;
|
|
1167
|
+
}
|
|
1168
|
+
export interface Event {}
|
|
1169
|
+
type EventSourceListenerLike = (event: Event) => void;
|
|
1170
|
+
export type AnyConstructorLike<TInit extends InitDict> = new (url: string, eventSourceInitDict?: TInit) => Instance;
|
|
1171
|
+
export interface Instance {
|
|
1172
|
+
readonly CLOSED: number;
|
|
1173
|
+
readonly CONNECTING: number;
|
|
1174
|
+
readonly OPEN: number;
|
|
1175
|
+
addEventListener(type: string, listener: EventSourceListenerLike): void;
|
|
1176
|
+
removeEventListener(type: string, listener: EventSourceListenerLike): void;
|
|
1177
|
+
close: () => void;
|
|
1178
|
+
readyState: number;
|
|
1179
|
+
}
|
|
1180
|
+
export type AnyConstructor = AnyConstructorLike<any>;
|
|
1181
|
+
export type ListenerOf<T extends AnyConstructor> = Parameters<InstanceType<T>['addEventListener']>[1];
|
|
1182
|
+
export type EventOf<T extends AnyConstructor> = Parameters<ListenerOf<T>>[0];
|
|
1183
|
+
export type InitDictOf<T extends AnyConstructor> = ConstructorParameters<T>[1];
|
|
1184
|
+
export {};
|
|
1185
|
+
}
|
|
1186
|
+
//# sourceMappingURL=sse.types.d.ts.map
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region src/unstable-core-do-not-import/stream/sse.d.ts
|
|
1189
|
+
type Serialize$1 = (value: any) => any;
|
|
1190
|
+
type Deserialize = (value: any) => any;
|
|
1191
|
+
/**
|
|
1192
|
+
* @internal
|
|
1193
|
+
*/
|
|
1194
|
+
interface SSEPingOptions {
|
|
1195
|
+
/**
|
|
1196
|
+
* Enable ping comments sent from the server
|
|
1197
|
+
* @default false
|
|
1198
|
+
*/
|
|
1199
|
+
enabled: boolean;
|
|
1200
|
+
/**
|
|
1201
|
+
* Interval in milliseconds
|
|
1202
|
+
* @default 1000
|
|
1203
|
+
*/
|
|
1204
|
+
intervalMs?: number;
|
|
1205
|
+
}
|
|
1206
|
+
interface SSEClientOptions {
|
|
1207
|
+
/**
|
|
1208
|
+
* Timeout and reconnect after inactivity in milliseconds
|
|
1209
|
+
* @default undefined
|
|
1210
|
+
*/
|
|
1211
|
+
reconnectAfterInactivityMs?: number;
|
|
1212
|
+
}
|
|
1213
|
+
interface SSEStreamProducerOptions<TValue = unknown> {
|
|
1214
|
+
serialize?: Serialize$1;
|
|
1215
|
+
data: AsyncIterable<TValue>;
|
|
1216
|
+
maxDepth?: number;
|
|
1217
|
+
ping?: SSEPingOptions;
|
|
1218
|
+
/**
|
|
1219
|
+
* Maximum duration in milliseconds for the request before ending the stream
|
|
1220
|
+
* @default undefined
|
|
1221
|
+
*/
|
|
1222
|
+
maxDurationMs?: number;
|
|
1223
|
+
/**
|
|
1224
|
+
* End the request immediately after data is sent
|
|
1225
|
+
* Only useful for serverless runtimes that do not support streaming responses
|
|
1226
|
+
* @default false
|
|
1227
|
+
*/
|
|
1228
|
+
emitAndEndImmediately?: boolean;
|
|
1229
|
+
formatError?: (opts: {
|
|
1230
|
+
error: unknown;
|
|
1231
|
+
}) => unknown;
|
|
1232
|
+
/**
|
|
1233
|
+
* Client-specific options - these will be sent to the client as part of the first message
|
|
1234
|
+
* @default {}
|
|
1235
|
+
*/
|
|
1236
|
+
client?: SSEClientOptions;
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
*
|
|
1240
|
+
* @see https://html.spec.whatwg.org/multipage/server-sent-events.html
|
|
1241
|
+
*/
|
|
1242
|
+
declare function sseStreamProducer<TValue = unknown>(opts: SSEStreamProducerOptions<TValue>): ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
1243
|
+
interface ConsumerStreamResultBase<TConfig extends ConsumerConfig> {
|
|
1244
|
+
eventSource: InstanceType<TConfig['EventSource']> | null;
|
|
1245
|
+
}
|
|
1246
|
+
interface ConsumerStreamResultData<TConfig extends ConsumerConfig> extends ConsumerStreamResultBase<TConfig> {
|
|
1247
|
+
type: 'data';
|
|
1248
|
+
data: inferTrackedOutput<TConfig['data']>;
|
|
1249
|
+
}
|
|
1250
|
+
interface ConsumerStreamResultError<TConfig extends ConsumerConfig> extends ConsumerStreamResultBase<TConfig> {
|
|
1251
|
+
type: 'serialized-error';
|
|
1252
|
+
error: TConfig['error'];
|
|
1253
|
+
}
|
|
1254
|
+
interface ConsumerStreamResultConnecting<TConfig extends ConsumerConfig> extends ConsumerStreamResultBase<TConfig> {
|
|
1255
|
+
type: 'connecting';
|
|
1256
|
+
event: EventSourceLike.EventOf<TConfig['EventSource']> | null;
|
|
1257
|
+
}
|
|
1258
|
+
interface ConsumerStreamResultTimeout<TConfig extends ConsumerConfig> extends ConsumerStreamResultBase<TConfig> {
|
|
1259
|
+
type: 'timeout';
|
|
1260
|
+
ms: number;
|
|
1261
|
+
}
|
|
1262
|
+
interface ConsumerStreamResultPing<TConfig extends ConsumerConfig> extends ConsumerStreamResultBase<TConfig> {
|
|
1263
|
+
type: 'ping';
|
|
1264
|
+
}
|
|
1265
|
+
interface ConsumerStreamResultConnected<TConfig extends ConsumerConfig> extends ConsumerStreamResultBase<TConfig> {
|
|
1266
|
+
type: 'connected';
|
|
1267
|
+
options: SSEClientOptions;
|
|
1268
|
+
}
|
|
1269
|
+
type ConsumerStreamResult<TConfig extends ConsumerConfig> = ConsumerStreamResultData<TConfig> | ConsumerStreamResultError<TConfig> | ConsumerStreamResultConnecting<TConfig> | ConsumerStreamResultTimeout<TConfig> | ConsumerStreamResultPing<TConfig> | ConsumerStreamResultConnected<TConfig>;
|
|
1270
|
+
interface SSEStreamConsumerOptions<TConfig extends ConsumerConfig> {
|
|
1271
|
+
url: () => MaybePromise<string>;
|
|
1272
|
+
init: () => MaybePromise<EventSourceLike.InitDictOf<TConfig['EventSource']>> | undefined;
|
|
1273
|
+
signal: AbortSignal;
|
|
1274
|
+
deserialize?: Deserialize;
|
|
1275
|
+
EventSource: TConfig['EventSource'];
|
|
1276
|
+
}
|
|
1277
|
+
interface ConsumerConfig {
|
|
1278
|
+
data: unknown;
|
|
1279
|
+
error: unknown;
|
|
1280
|
+
EventSource: EventSourceLike.AnyConstructor;
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* @see https://html.spec.whatwg.org/multipage/server-sent-events.html
|
|
1284
|
+
*/
|
|
1285
|
+
declare function sseStreamConsumer<TConfig extends ConsumerConfig>(opts: SSEStreamConsumerOptions<TConfig>): AsyncIterable<ConsumerStreamResult<TConfig>>;
|
|
1286
|
+
declare const sseHeaders: {
|
|
1287
|
+
readonly 'Content-Type': "text/event-stream";
|
|
1288
|
+
readonly 'Cache-Control': "no-cache, no-transform";
|
|
1289
|
+
readonly 'X-Accel-Buffering': "no";
|
|
1290
|
+
readonly Connection: "keep-alive";
|
|
1291
|
+
};
|
|
1292
|
+
//#endregion
|
|
1293
|
+
//#region src/unstable-core-do-not-import/rootConfig.d.ts
|
|
1294
|
+
/**
|
|
1295
|
+
* The initial generics that are used in the init function
|
|
1296
|
+
* @internal
|
|
1297
|
+
*/
|
|
1298
|
+
interface RootTypes {
|
|
1299
|
+
ctx: object;
|
|
1300
|
+
meta: object;
|
|
1301
|
+
errorShape: DefaultErrorShape;
|
|
1302
|
+
transformer: boolean;
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* The default check to see if we're in a server
|
|
1306
|
+
*/
|
|
1307
|
+
declare const isServerDefault: boolean;
|
|
1308
|
+
/**
|
|
1309
|
+
* The tRPC root config
|
|
1310
|
+
* @internal
|
|
1311
|
+
*/
|
|
1312
|
+
interface RootConfig<TTypes extends RootTypes> {
|
|
1313
|
+
/**
|
|
1314
|
+
* The types that are used in the config
|
|
1315
|
+
* @internal
|
|
1316
|
+
*/
|
|
1317
|
+
$types: TTypes;
|
|
1318
|
+
/**
|
|
1319
|
+
* Use a data transformer
|
|
1320
|
+
* @see https://trpc.io/docs/v11/data-transformers
|
|
1321
|
+
*/
|
|
1322
|
+
transformer: CombinedDataTransformer;
|
|
1323
|
+
/**
|
|
1324
|
+
* Use custom error formatting
|
|
1325
|
+
* @see https://trpc.io/docs/v11/error-formatting
|
|
1326
|
+
*/
|
|
1327
|
+
errorFormatter: ErrorFormatter<TTypes['ctx'], TTypes['errorShape']>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Allow `@trpc/server` to run in non-server environments
|
|
1330
|
+
* @warning **Use with caution**, this should likely mainly be used within testing.
|
|
1331
|
+
* @default false
|
|
1332
|
+
*/
|
|
1333
|
+
allowOutsideOfServer: boolean;
|
|
1334
|
+
/**
|
|
1335
|
+
* Is this a server environment?
|
|
1336
|
+
* @warning **Use with caution**, this should likely mainly be used within testing.
|
|
1337
|
+
* @default typeof window === 'undefined' || 'Deno' in window || process.env.NODE_ENV === 'test'
|
|
1338
|
+
*/
|
|
1339
|
+
isServer: boolean;
|
|
1340
|
+
/**
|
|
1341
|
+
* Is this development?
|
|
1342
|
+
* Will be used to decide if the API should return stack traces
|
|
1343
|
+
* @default process.env.NODE_ENV !== 'production'
|
|
1344
|
+
*/
|
|
1345
|
+
isDev: boolean;
|
|
1346
|
+
defaultMeta?: TTypes['meta'] extends object ? TTypes['meta'] : never;
|
|
1347
|
+
/**
|
|
1348
|
+
* Options for server-sent events (SSE) subscriptions
|
|
1349
|
+
* @see https://trpc.io/docs/client/links/httpSubscriptionLink
|
|
1350
|
+
*/
|
|
1351
|
+
sse?: {
|
|
1352
|
+
/**
|
|
1353
|
+
* Enable server-sent events (SSE) subscriptions
|
|
1354
|
+
* @default true
|
|
1355
|
+
*/
|
|
1356
|
+
enabled?: boolean;
|
|
1357
|
+
} & Pick<SSEStreamProducerOptions, 'ping' | 'emitAndEndImmediately' | 'maxDurationMs' | 'client'>;
|
|
1358
|
+
/**
|
|
1359
|
+
* Options for batch stream
|
|
1360
|
+
* @see https://trpc.io/docs/client/links/httpBatchStreamLink
|
|
1361
|
+
*/
|
|
1362
|
+
jsonl?: Pick<JSONLProducerOptions, 'pingMs'>;
|
|
1363
|
+
experimental?: {};
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* @internal
|
|
1367
|
+
*/
|
|
1368
|
+
type CreateRootTypes<TGenerics extends RootTypes> = TGenerics;
|
|
1369
|
+
type AnyRootTypes = CreateRootTypes<{
|
|
1370
|
+
ctx: any;
|
|
1371
|
+
meta: any;
|
|
1372
|
+
errorShape: any;
|
|
1373
|
+
transformer: any;
|
|
1374
|
+
}>;
|
|
1375
|
+
type PartialIf<TCondition extends boolean, TType> = TCondition extends true ? Partial<TType> : TType;
|
|
1376
|
+
/**
|
|
1377
|
+
* Adds a `createContext` option with a given callback function
|
|
1378
|
+
* If context is the default value, then the `createContext` option is optional
|
|
1379
|
+
*/
|
|
1380
|
+
type CreateContextCallback<TContext, TFunction extends (...args: any[]) => any> = PartialIf<object extends TContext ? true : false, {
|
|
1381
|
+
/**
|
|
1382
|
+
* @see https://trpc.io/docs/v11/context
|
|
1383
|
+
**/
|
|
1384
|
+
createContext: TFunction;
|
|
1385
|
+
}>;
|
|
1386
|
+
//#endregion
|
|
1387
|
+
//#region src/unstable-core-do-not-import/router.d.ts
|
|
1388
|
+
interface RouterRecord {
|
|
1389
|
+
[key: string]: AnyProcedure | RouterRecord;
|
|
1390
|
+
}
|
|
1391
|
+
type DecorateProcedure<TProcedure extends AnyProcedure> = (input: inferProcedureInput<TProcedure>) => Promise<TProcedure['_def']['type'] extends 'subscription' ? TProcedure extends LegacyObservableSubscriptionProcedure<any> ? Observable<inferProcedureOutput<TProcedure>, TRPCError> : inferProcedureOutput<TProcedure> : inferProcedureOutput<TProcedure>>;
|
|
1392
|
+
/**
|
|
1393
|
+
* @internal
|
|
1394
|
+
*/
|
|
1395
|
+
type DecorateRouterRecord<TRecord extends RouterRecord> = { [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyProcedure ? DecorateProcedure<$Value> : $Value extends RouterRecord ? DecorateRouterRecord<$Value> : never : never };
|
|
1396
|
+
/**
|
|
1397
|
+
* @internal
|
|
1398
|
+
*/
|
|
1399
|
+
type RouterCallerErrorHandler<TContext> = (opts: ErrorHandlerOptions<TContext>) => void;
|
|
1400
|
+
/**
|
|
1401
|
+
* @internal
|
|
1402
|
+
*/
|
|
1403
|
+
type RouterCaller<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = (
|
|
1404
|
+
/**
|
|
1405
|
+
* @note
|
|
1406
|
+
* If passing a function, we recommend it's a cached function
|
|
1407
|
+
* e.g. wrapped in `React.cache` to avoid unnecessary computations
|
|
1408
|
+
*/
|
|
1409
|
+
ctx: TRoot['ctx'] | (() => MaybePromise<TRoot['ctx']>), options?: {
|
|
1410
|
+
onError?: RouterCallerErrorHandler<TRoot['ctx']>;
|
|
1411
|
+
signal?: AbortSignal;
|
|
1412
|
+
}) => DecorateRouterRecord<TRecord>;
|
|
1413
|
+
declare const lazySymbol: unique symbol;
|
|
1414
|
+
type Lazy<TAny> = (() => Promise<TAny>) & {
|
|
1415
|
+
[lazySymbol]: true;
|
|
1416
|
+
};
|
|
1417
|
+
type LazyLoader<TAny> = {
|
|
1418
|
+
load: () => Promise<void>;
|
|
1419
|
+
ref: Lazy<TAny>;
|
|
1420
|
+
};
|
|
1421
|
+
/**
|
|
1422
|
+
* Lazy load a router
|
|
1423
|
+
* @see https://trpc.io/docs/server/merging-routers#lazy-load
|
|
1424
|
+
*/
|
|
1425
|
+
declare function lazy<TRouter extends AnyRouter>(importRouter: () => Promise<TRouter | {
|
|
1426
|
+
[key: string]: TRouter;
|
|
1427
|
+
}>): Lazy<NoInfer<TRouter>>;
|
|
1428
|
+
/**
|
|
1429
|
+
* @internal
|
|
1430
|
+
*/
|
|
1431
|
+
interface RouterDef<TRoot extends AnyRootTypes, TRecord extends RouterRecord> {
|
|
1432
|
+
_config: RootConfig<TRoot>;
|
|
1433
|
+
router: true;
|
|
1434
|
+
procedure?: never;
|
|
1435
|
+
procedures: TRecord;
|
|
1436
|
+
record: TRecord;
|
|
1437
|
+
lazy: Record<string, LazyLoader<AnyRouter>>;
|
|
1438
|
+
}
|
|
1439
|
+
interface Router<TRoot extends AnyRootTypes, TRecord extends RouterRecord> {
|
|
1440
|
+
_def: RouterDef<TRoot, TRecord>;
|
|
1441
|
+
/**
|
|
1442
|
+
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
1443
|
+
*/
|
|
1444
|
+
createCaller: RouterCaller<TRoot, TRecord>;
|
|
1445
|
+
}
|
|
1446
|
+
type BuiltRouter<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = Router<TRoot, TRecord> & TRecord;
|
|
1447
|
+
interface RouterBuilder<TRoot extends AnyRootTypes> {
|
|
1448
|
+
<TIn extends CreateRouterOptions>(_: TIn): BuiltRouter<TRoot, DecorateCreateRouterOptions<TIn>>;
|
|
1449
|
+
}
|
|
1450
|
+
type AnyRouter = Router<any, any>;
|
|
1451
|
+
type inferRouterRootTypes<TRouter extends AnyRouter> = TRouter['_def']['_config']['$types'];
|
|
1452
|
+
type inferRouterContext<TRouter extends AnyRouter> = inferRouterRootTypes<TRouter>['ctx'];
|
|
1453
|
+
type inferRouterError<TRouter extends AnyRouter> = inferRouterRootTypes<TRouter>['errorShape'];
|
|
1454
|
+
type inferRouterMeta<TRouter extends AnyRouter> = inferRouterRootTypes<TRouter>['meta'];
|
|
1455
|
+
/** @internal */
|
|
1456
|
+
type CreateRouterOptions = {
|
|
1457
|
+
[key: string]: AnyProcedure | AnyRouter | CreateRouterOptions | Lazy<AnyRouter>;
|
|
1458
|
+
};
|
|
1459
|
+
/** @internal */
|
|
1460
|
+
type DecorateCreateRouterOptions<TRouterOptions extends CreateRouterOptions> = { [K in keyof TRouterOptions]: TRouterOptions[K] extends infer $Value ? $Value extends AnyProcedure ? $Value : $Value extends Router<any, infer TRecord> ? TRecord : $Value extends Lazy<Router<any, infer TRecord>> ? TRecord : $Value extends CreateRouterOptions ? DecorateCreateRouterOptions<$Value> : never : never };
|
|
1461
|
+
/**
|
|
1462
|
+
* @internal
|
|
1463
|
+
*/
|
|
1464
|
+
declare function createRouterFactory<TRoot extends AnyRootTypes>(config: RootConfig<TRoot>): <TInput extends CreateRouterOptions>(input: TInput) => BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>>;
|
|
1465
|
+
/**
|
|
1466
|
+
* @internal
|
|
1467
|
+
*/
|
|
1468
|
+
declare function getProcedureAtPath(router: Pick<Router<any, any>, '_def'>, path: string): Promise<AnyProcedure | null>;
|
|
1469
|
+
/**
|
|
1470
|
+
* @internal
|
|
1471
|
+
*/
|
|
1472
|
+
declare function callProcedure(opts: ProcedureCallOptions<unknown> & {
|
|
1473
|
+
router: AnyRouter;
|
|
1474
|
+
allowMethodOverride?: boolean;
|
|
1475
|
+
}): Promise<any>;
|
|
1476
|
+
interface RouterCallerFactory<TRoot extends AnyRootTypes> {
|
|
1477
|
+
<TRecord extends RouterRecord>(router: Pick<Router<TRoot, TRecord>, '_def'>): RouterCaller<TRoot, TRecord>;
|
|
1478
|
+
}
|
|
1479
|
+
declare function createCallerFactory<TRoot extends AnyRootTypes>(): RouterCallerFactory<TRoot>;
|
|
1480
|
+
/** @internal */
|
|
1481
|
+
type MergeRouters<TRouters extends AnyRouter[], TRoot extends AnyRootTypes = TRouters[0]['_def']['_config']['$types'], TRecord extends RouterRecord = {}> = TRouters extends [infer Head extends AnyRouter, ...infer Tail extends AnyRouter[]] ? MergeRouters<Tail, TRoot, Head['_def']['record'] & TRecord> : BuiltRouter<TRoot, TRecord>;
|
|
1482
|
+
declare function mergeRouters<TRouters extends AnyRouter[]>(...routerList: [...TRouters]): MergeRouters<TRouters>;
|
|
1483
|
+
//#endregion
|
|
1484
|
+
//#region src/unstable-core-do-not-import/clientish/inferrable.d.ts
|
|
1485
|
+
type AnyClientTypes = Pick<AnyRootTypes, 'errorShape' | 'transformer'>;
|
|
1486
|
+
/**
|
|
1487
|
+
* Result of `initTRPC.create()`
|
|
1488
|
+
*/
|
|
1489
|
+
type InitLike = {
|
|
1490
|
+
_config: {
|
|
1491
|
+
$types: AnyClientTypes;
|
|
1492
|
+
};
|
|
1493
|
+
};
|
|
1494
|
+
/**
|
|
1495
|
+
* Result of `initTRPC.create().router()`
|
|
1496
|
+
*/
|
|
1497
|
+
type RouterLike = {
|
|
1498
|
+
_def: InitLike;
|
|
1499
|
+
};
|
|
1500
|
+
/**
|
|
1501
|
+
* Result of `initTRPC.create()._config`
|
|
1502
|
+
*/
|
|
1503
|
+
type RootConfigLike = {
|
|
1504
|
+
$types: AnyClientTypes;
|
|
1505
|
+
};
|
|
1506
|
+
/**
|
|
1507
|
+
* Anything that can be inferred to the root config types needed for a TRPC client
|
|
1508
|
+
*/
|
|
1509
|
+
type InferrableClientTypes = RouterLike | InitLike | RootConfigLike | AnyClientTypes;
|
|
1510
|
+
type PickTypes<T extends AnyClientTypes> = {
|
|
1511
|
+
transformer: T['transformer'];
|
|
1512
|
+
errorShape: T['errorShape'];
|
|
1513
|
+
};
|
|
1514
|
+
/**
|
|
1515
|
+
* Infer the root types from a InferrableClientTypes
|
|
1516
|
+
*/
|
|
1517
|
+
type inferClientTypes<TInferrable extends InferrableClientTypes> = TInferrable extends AnyClientTypes ? PickTypes<TInferrable> : TInferrable extends RootConfigLike ? PickTypes<TInferrable['$types']> : TInferrable extends InitLike ? PickTypes<TInferrable['_config']['$types']> : TInferrable extends RouterLike ? PickTypes<TInferrable['_def']['_config']['$types']> : never;
|
|
1518
|
+
//#endregion
|
|
1519
|
+
//#region src/unstable-core-do-not-import/clientish/serialize.d.ts
|
|
1520
|
+
/**
|
|
1521
|
+
* @see https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
|
|
1522
|
+
*/
|
|
1523
|
+
type JsonPrimitive = boolean | number | string | null;
|
|
1524
|
+
type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
1525
|
+
type JsonObject = {
|
|
1526
|
+
readonly [key: string | number]: JsonValue;
|
|
1527
|
+
[key: symbol]: never;
|
|
1528
|
+
};
|
|
1529
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
1530
|
+
type IsJson<T> = T extends JsonValue ? true : false;
|
|
1531
|
+
type NonJsonPrimitive = Function | symbol | undefined;
|
|
1532
|
+
type IsAny<T> = 0 extends T & 1 ? true : false;
|
|
1533
|
+
type JsonReturnable = JsonPrimitive | undefined;
|
|
1534
|
+
type IsRecord<T extends object> = keyof WithoutIndexSignature<T> extends never ? true : false;
|
|
1535
|
+
type Serialize<T> = IsAny<T> extends true ? any : unknown extends T ? unknown : IsJson<T> extends true ? T : T extends AsyncIterable<infer $T, infer $Return, infer $Next> ? AsyncIterable<Serialize<$T>, Serialize<$Return>, Serialize<$Next>> : T extends PromiseLike<infer $T> ? Promise<Serialize<$T>> : T extends JsonReturnable ? T : T extends Map<any, any> | Set<any> ? object : T extends NonJsonPrimitive ? never : T extends {
|
|
1536
|
+
toJSON(): infer U;
|
|
1537
|
+
} ? U : T extends [] ? [] : T extends [unknown, ...unknown[]] ? SerializeTuple<T> : T extends readonly (infer U)[] ? (U extends NonJsonPrimitive ? null : Serialize<U>)[] : T extends object ? IsRecord<T> extends true ? Record<keyof T, Serialize<T[keyof T]>> : Simplify<SerializeObject<UndefinedToOptional<T>>> : never;
|
|
1538
|
+
/** JSON serialize [tuples](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) */
|
|
1539
|
+
type SerializeTuple<T extends [unknown, ...unknown[]]> = { [K in keyof T]: T[K] extends NonJsonPrimitive ? null : Serialize<T[K]> };
|
|
1540
|
+
type SerializeObjectKey<T extends Record<any, any>, K> = K extends symbol ? never : IsAny<T[K]> extends true ? K : unknown extends T[K] ? K : T[K] extends NonJsonPrimitive ? never : K;
|
|
1541
|
+
/**
|
|
1542
|
+
* JSON serialize objects (not including arrays) and classes
|
|
1543
|
+
* @internal
|
|
1544
|
+
**/
|
|
1545
|
+
type SerializeObject<T extends object> = { [K in keyof T as SerializeObjectKey<T, K>]: Serialize<T[K]> };
|
|
1546
|
+
/**
|
|
1547
|
+
* Extract keys from T where the value dosen't extend undefined
|
|
1548
|
+
* Note: Can't parse IndexSignature or Record types
|
|
1549
|
+
*/
|
|
1550
|
+
type FilterDefinedKeys<T extends object> = Exclude<{ [K in keyof T]: undefined extends T[K] ? never : K }[keyof T], undefined>;
|
|
1551
|
+
/**
|
|
1552
|
+
* Get value of exactOptionalPropertyTypes config
|
|
1553
|
+
*/
|
|
1554
|
+
type ExactOptionalPropertyTypes = {
|
|
1555
|
+
a?: 0 | undefined;
|
|
1556
|
+
} extends {
|
|
1557
|
+
a?: 0;
|
|
1558
|
+
} ? false : true;
|
|
1559
|
+
/**
|
|
1560
|
+
* Check if T has an index signature
|
|
1561
|
+
*/
|
|
1562
|
+
type HasIndexSignature<T extends object> = string extends keyof T ? true : false;
|
|
1563
|
+
/**
|
|
1564
|
+
* { [key: string]: number | undefined } --> { [key: string]: number }
|
|
1565
|
+
*/
|
|
1566
|
+
type HandleIndexSignature<T extends object> = { [K in keyof Omit<T, keyof WithoutIndexSignature<T>>]: Exclude<T[K], undefined> };
|
|
1567
|
+
/**
|
|
1568
|
+
* { a: number | undefined } --> { a?: number }
|
|
1569
|
+
* Note: Can't parse IndexSignature or Record types
|
|
1570
|
+
*/
|
|
1571
|
+
type HandleUndefined<T extends object> = { [K in keyof Omit<T, FilterDefinedKeys<T>>]?: Exclude<T[K], undefined> };
|
|
1572
|
+
/**
|
|
1573
|
+
* Handle undefined, index signature and records
|
|
1574
|
+
*/
|
|
1575
|
+
type UndefinedToOptional<T extends object> = Pick<WithoutIndexSignature<T>, FilterDefinedKeys<WithoutIndexSignature<T>>> & (ExactOptionalPropertyTypes extends true ? HandleIndexSignature<T> & HandleUndefined<WithoutIndexSignature<T>> : HasIndexSignature<T> extends true ? HandleIndexSignature<T> : HandleUndefined<T>);
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#region src/unstable-core-do-not-import/clientish/inference.d.ts
|
|
1578
|
+
/**
|
|
1579
|
+
* @internal
|
|
1580
|
+
*/
|
|
1581
|
+
type inferTransformedProcedureOutput<TInferrable extends InferrableClientTypes, TProcedure extends AnyProcedure> = inferClientTypes<TInferrable>['transformer'] extends false ? Serialize<inferProcedureOutput<TProcedure>> : inferProcedureOutput<TProcedure>;
|
|
1582
|
+
/** @internal */
|
|
1583
|
+
type inferTransformedSubscriptionOutput<TInferrable extends InferrableClientTypes, TProcedure extends AnyProcedure> = inferClientTypes<TInferrable>['transformer'] extends false ? Serialize<inferObservableValue<inferProcedureOutput<TProcedure>>> : inferObservableValue<inferProcedureOutput<TProcedure>>;
|
|
1584
|
+
type GetInferenceHelpers<TType extends 'input' | 'output', TRoot extends AnyClientTypes, TRecord extends RouterRecord> = { [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyProcedure ? TType extends 'input' ? inferProcedureInput<$Value> : inferTransformedProcedureOutput<TRoot, $Value> : $Value extends RouterRecord ? GetInferenceHelpers<TType, TRoot, $Value> : never : never };
|
|
1585
|
+
type inferRouterInputs<TRouter extends AnyRouter> = GetInferenceHelpers<'input', TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
|
|
1586
|
+
type inferRouterOutputs<TRouter extends AnyRouter> = GetInferenceHelpers<'output', TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
|
|
1587
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
1588
|
+
//#endregion
|
|
1589
|
+
//#region src/unstable-core-do-not-import/createProxy.d.ts
|
|
1590
|
+
interface ProxyCallbackOptions {
|
|
1591
|
+
path: readonly string[];
|
|
1592
|
+
args: readonly unknown[];
|
|
1593
|
+
}
|
|
1594
|
+
type ProxyCallback = (opts: ProxyCallbackOptions) => unknown;
|
|
1595
|
+
/**
|
|
1596
|
+
* Creates a proxy that calls the callback with the path and arguments
|
|
1597
|
+
*
|
|
1598
|
+
* @internal
|
|
1599
|
+
*/
|
|
1600
|
+
declare const createRecursiveProxy: <TFaux = unknown>(callback: ProxyCallback) => TFaux;
|
|
1601
|
+
/**
|
|
1602
|
+
* Used in place of `new Proxy` where each handler will map 1 level deep to another value.
|
|
1603
|
+
*
|
|
1604
|
+
* @internal
|
|
1605
|
+
*/
|
|
1606
|
+
declare const createFlatProxy: <TFaux>(callback: (path: keyof TFaux) => any) => TFaux;
|
|
1607
|
+
//#endregion
|
|
1608
|
+
//#region src/unstable-core-do-not-import/error/getErrorShape.d.ts
|
|
1609
|
+
/**
|
|
1610
|
+
* @internal
|
|
1611
|
+
*/
|
|
1612
|
+
declare function getErrorShape<TRoot extends AnyRootTypes>(opts: {
|
|
1613
|
+
config: RootConfig<TRoot>;
|
|
1614
|
+
error: TRPCError;
|
|
1615
|
+
type: ProcedureType | 'unknown';
|
|
1616
|
+
path: string | undefined;
|
|
1617
|
+
input: unknown;
|
|
1618
|
+
ctx: TRoot['ctx'] | undefined;
|
|
1619
|
+
}): TRoot['errorShape'];
|
|
1620
|
+
//# sourceMappingURL=getErrorShape.d.ts.map
|
|
1621
|
+
//#endregion
|
|
1622
|
+
//#region src/unstable-core-do-not-import/http/contentType.d.ts
|
|
1623
|
+
type GetRequestInfoOptions = {
|
|
1624
|
+
path: string;
|
|
1625
|
+
req: Request;
|
|
1626
|
+
url: URL | null;
|
|
1627
|
+
searchParams: URLSearchParams;
|
|
1628
|
+
headers: Headers;
|
|
1629
|
+
router: AnyRouter;
|
|
1630
|
+
};
|
|
1631
|
+
declare function getRequestInfo(opts: GetRequestInfoOptions): Promise<TRPCRequestInfo>;
|
|
1632
|
+
//#endregion
|
|
1633
|
+
//#region src/unstable-core-do-not-import/http/contentTypeParsers.d.ts
|
|
1634
|
+
type UtilityParser<TInput, TOutput> = ParserZodEsque<TInput, TOutput> & {
|
|
1635
|
+
parse: (input: unknown) => TOutput;
|
|
1636
|
+
};
|
|
1637
|
+
/**
|
|
1638
|
+
* File is only available from Node19+ but it always extends Blob so we can use that as a type until we eventually drop Node18
|
|
1639
|
+
*/
|
|
1640
|
+
interface FileLike extends Blob {
|
|
1641
|
+
readonly name: string;
|
|
1642
|
+
}
|
|
1643
|
+
type OctetInput = Blob | Uint8Array | FileLike;
|
|
1644
|
+
declare const octetInputParser: UtilityParser<OctetInput, ReadableStream>;
|
|
1645
|
+
//#endregion
|
|
1646
|
+
//#region src/unstable-core-do-not-import/http/formDataToObject.d.ts
|
|
1647
|
+
declare function formDataToObject(formData: FormData): Record<string, unknown>;
|
|
1648
|
+
//# sourceMappingURL=formDataToObject.d.ts.map
|
|
1649
|
+
|
|
1650
|
+
//#endregion
|
|
1651
|
+
//#region src/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts
|
|
1652
|
+
declare const JSONRPC2_TO_HTTP_CODE: Record<keyof typeof TRPC_ERROR_CODES_BY_KEY, number>;
|
|
1653
|
+
declare const HTTP_CODE_TO_JSONRPC2: InvertKeyValue<typeof JSONRPC2_TO_HTTP_CODE>;
|
|
1654
|
+
declare function getStatusCodeFromKey(code: keyof typeof TRPC_ERROR_CODES_BY_KEY): number;
|
|
1655
|
+
declare function getStatusKeyFromCode(code: keyof typeof HTTP_CODE_TO_JSONRPC2): ValueOf<typeof HTTP_CODE_TO_JSONRPC2>;
|
|
1656
|
+
declare function getHTTPStatusCode(json: TRPCResponse | TRPCResponse[]): number;
|
|
1657
|
+
declare function getHTTPStatusCodeFromError(error: TRPCError): number;
|
|
1658
|
+
//# sourceMappingURL=getHTTPStatusCode.d.ts.map
|
|
1659
|
+
//#endregion
|
|
1660
|
+
//#region src/unstable-core-do-not-import/http/abortError.d.ts
|
|
1661
|
+
declare function isAbortError(error: unknown): error is DOMException | Error | {
|
|
1662
|
+
name: 'AbortError';
|
|
1663
|
+
};
|
|
1664
|
+
declare function throwAbortError(message?: string): never;
|
|
1665
|
+
//# sourceMappingURL=abortError.d.ts.map
|
|
1666
|
+
//#endregion
|
|
1667
|
+
//#region src/unstable-core-do-not-import/http/parseConnectionParams.d.ts
|
|
1668
|
+
declare function parseConnectionParamsFromUnknown(parsed: unknown): TRPCRequestInfo['connectionParams'];
|
|
1669
|
+
declare function parseConnectionParamsFromString(str: string): TRPCRequestInfo['connectionParams'];
|
|
1670
|
+
//# sourceMappingURL=parseConnectionParams.d.ts.map
|
|
1671
|
+
//#endregion
|
|
1672
|
+
//#region src/unstable-core-do-not-import/http/resolveResponse.d.ts
|
|
1673
|
+
interface ResolveHTTPRequestOptions<TRouter extends AnyRouter> extends HTTPBaseHandlerOptions<TRouter, Request> {
|
|
1674
|
+
createContext: ResolveHTTPRequestOptionsContextFn<TRouter>;
|
|
1675
|
+
req: Request;
|
|
1676
|
+
path: string;
|
|
1677
|
+
/**
|
|
1678
|
+
* If the request had an issue before reaching the handler
|
|
1679
|
+
*/
|
|
1680
|
+
error: TRPCError | null;
|
|
1681
|
+
}
|
|
1682
|
+
declare function resolveResponse<TRouter extends AnyRouter>(opts: ResolveHTTPRequestOptions<TRouter>): Promise<Response>;
|
|
1683
|
+
//#endregion
|
|
1684
|
+
//#region src/unstable-core-do-not-import/initTRPC.d.ts
|
|
1685
|
+
type inferErrorFormatterShape<TType> = TType extends ErrorFormatter<any, infer TShape> ? TShape : DefaultErrorShape;
|
|
1686
|
+
/** @internal */
|
|
1687
|
+
interface RuntimeConfigOptions<TContext extends object, TMeta extends object> extends Partial<Omit<RootConfig<{
|
|
1688
|
+
ctx: TContext;
|
|
1689
|
+
meta: TMeta;
|
|
1690
|
+
errorShape: any;
|
|
1691
|
+
transformer: any;
|
|
1692
|
+
}>, '$types' | 'transformer'>> {
|
|
1693
|
+
/**
|
|
1694
|
+
* Use a data transformer
|
|
1695
|
+
* @see https://trpc.io/docs/v11/data-transformers
|
|
1696
|
+
*/
|
|
1697
|
+
transformer?: DataTransformerOptions;
|
|
1698
|
+
}
|
|
1699
|
+
type ContextCallback = (...args: any[]) => object | Promise<object>;
|
|
1700
|
+
interface TRPCRootObject<TContext extends object, TMeta extends object, TOptions extends RuntimeConfigOptions<TContext, TMeta>, $Root extends AnyRootTypes = {
|
|
1701
|
+
ctx: TContext;
|
|
1702
|
+
meta: TMeta;
|
|
1703
|
+
errorShape: undefined extends TOptions['errorFormatter'] ? DefaultErrorShape : inferErrorFormatterShape<TOptions['errorFormatter']>;
|
|
1704
|
+
transformer: undefined extends TOptions['transformer'] ? false : true;
|
|
1705
|
+
}> {
|
|
1706
|
+
/**
|
|
1707
|
+
* Your router config
|
|
1708
|
+
* @internal
|
|
1709
|
+
*/
|
|
1710
|
+
_config: RootConfig<$Root>;
|
|
1711
|
+
/**
|
|
1712
|
+
* Builder object for creating procedures
|
|
1713
|
+
* @see https://trpc.io/docs/v11/server/procedures
|
|
1714
|
+
*/
|
|
1715
|
+
procedure: ProcedureBuilder<TContext, TMeta, object, UnsetMarker, UnsetMarker, UnsetMarker, UnsetMarker, false>;
|
|
1716
|
+
/**
|
|
1717
|
+
* Create reusable middlewares
|
|
1718
|
+
* @see https://trpc.io/docs/v11/server/middlewares
|
|
1719
|
+
*/
|
|
1720
|
+
middleware: <$ContextOverrides>(fn: MiddlewareFunction<TContext, TMeta, object, $ContextOverrides, unknown>) => MiddlewareBuilder<TContext, TMeta, $ContextOverrides, unknown>;
|
|
1721
|
+
/**
|
|
1722
|
+
* Create a router
|
|
1723
|
+
* @see https://trpc.io/docs/v11/server/routers
|
|
1724
|
+
*/
|
|
1725
|
+
router: RouterBuilder<$Root>;
|
|
1726
|
+
/**
|
|
1727
|
+
* Merge Routers
|
|
1728
|
+
* @see https://trpc.io/docs/v11/server/merging-routers
|
|
1729
|
+
*/
|
|
1730
|
+
mergeRouters: <TRouters extends AnyRouter[]>(...routerList: [...TRouters]) => MergeRouters<TRouters>;
|
|
1731
|
+
/**
|
|
1732
|
+
* Create a server-side caller for a router
|
|
1733
|
+
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
1734
|
+
*/
|
|
1735
|
+
createCallerFactory: RouterCallerFactory<$Root>;
|
|
1736
|
+
}
|
|
1737
|
+
declare class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
1738
|
+
/**
|
|
1739
|
+
* Add a context shape as a generic to the root object
|
|
1740
|
+
* @see https://trpc.io/docs/v11/server/context
|
|
1741
|
+
*/
|
|
1742
|
+
context<TNewContext extends object | ContextCallback>(): TRPCBuilder<TNewContext extends ContextCallback ? Unwrap<TNewContext> : TNewContext, TMeta>;
|
|
1743
|
+
/**
|
|
1744
|
+
* Add a meta shape as a generic to the root object
|
|
1745
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
1746
|
+
*/
|
|
1747
|
+
meta<TNewMeta extends object>(): TRPCBuilder<TContext, TNewMeta>;
|
|
1748
|
+
/**
|
|
1749
|
+
* Create the root object
|
|
1750
|
+
* @see https://trpc.io/docs/v11/server/routers#initialize-trpc
|
|
1751
|
+
*/
|
|
1752
|
+
create<TOptions extends RuntimeConfigOptions<TContext, TMeta>>(opts?: ValidateShape<TOptions, RuntimeConfigOptions<TContext, TMeta>>): TRPCRootObject<TContext, TMeta, TOptions>;
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Builder to initialize the tRPC root object - use this exactly once per backend
|
|
1756
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
1757
|
+
*/
|
|
1758
|
+
declare const initTRPC: TRPCBuilder<object, object>;
|
|
1759
|
+
//#endregion
|
|
1760
|
+
//#region src/unstable-core-do-not-import/stream/utils/createDeferred.d.ts
|
|
1761
|
+
declare function createDeferred<TValue = void>(): {
|
|
1762
|
+
promise: Promise<TValue>;
|
|
1763
|
+
resolve: (value: TValue) => void;
|
|
1764
|
+
reject: (error: unknown) => void;
|
|
1765
|
+
};
|
|
1766
|
+
type Deferred<TValue> = ReturnType<typeof createDeferred<TValue>>;
|
|
1767
|
+
//# sourceMappingURL=createDeferred.d.ts.map
|
|
1768
|
+
//#endregion
|
|
1769
|
+
//#region src/unstable-core-do-not-import/stream/utils/disposable.d.ts
|
|
1770
|
+
/**
|
|
1771
|
+
* Takes a value and a dispose function and returns a new object that implements the Disposable interface.
|
|
1772
|
+
* The returned object is the original value augmented with a Symbol.dispose method.
|
|
1773
|
+
* @param thing The value to make disposable
|
|
1774
|
+
* @param dispose Function to call when disposing the resource
|
|
1775
|
+
* @returns The original value with Symbol.dispose method added
|
|
1776
|
+
*/
|
|
1777
|
+
declare function makeResource<T>(thing: T, dispose: () => void): T & Disposable;
|
|
1778
|
+
/**
|
|
1779
|
+
* Takes a value and an async dispose function and returns a new object that implements the AsyncDisposable interface.
|
|
1780
|
+
* The returned object is the original value augmented with a Symbol.asyncDispose method.
|
|
1781
|
+
* @param thing The value to make async disposable
|
|
1782
|
+
* @param dispose Async function to call when disposing the resource
|
|
1783
|
+
* @returns The original value with Symbol.asyncDispose method added
|
|
1784
|
+
*/
|
|
1785
|
+
declare function makeAsyncResource<T>(thing: T, dispose: () => Promise<void>): T & AsyncDisposable;
|
|
1786
|
+
//# sourceMappingURL=disposable.d.ts.map
|
|
1787
|
+
//#endregion
|
|
1788
|
+
//#region src/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts
|
|
1789
|
+
declare function iteratorResource<TYield, TReturn, TNext>(iterable: AsyncIterable<TYield, TReturn, TNext>): AsyncIterator<TYield, TReturn, TNext> & AsyncDisposable;
|
|
1790
|
+
/**
|
|
1791
|
+
* Derives a new {@link AsyncGenerator} based on {@link iterable}, that automatically aborts after the specified duration.
|
|
1792
|
+
*/
|
|
1793
|
+
declare function withMaxDuration<T>(iterable: AsyncIterable<T>, opts: {
|
|
1794
|
+
maxDurationMs: number;
|
|
1795
|
+
}): AsyncGenerator<T>;
|
|
1796
|
+
/**
|
|
1797
|
+
* Derives a new {@link AsyncGenerator} based of {@link iterable}, that yields its first
|
|
1798
|
+
* {@link count} values. Then, a grace period of {@link gracePeriodMs} is started in which further
|
|
1799
|
+
* values may still come through. After this period, the generator aborts.
|
|
1800
|
+
*/
|
|
1801
|
+
declare function takeWithGrace<T>(iterable: AsyncIterable<T>, opts: {
|
|
1802
|
+
count: number;
|
|
1803
|
+
gracePeriodMs: number;
|
|
1804
|
+
}): AsyncGenerator<T>;
|
|
1805
|
+
//# sourceMappingURL=asyncIterable.d.ts.map
|
|
1806
|
+
//#endregion
|
|
1807
|
+
//#region src/vendor/standard-schema-v1/error.d.ts
|
|
1808
|
+
/** A schema error with useful information. */
|
|
1809
|
+
declare class StandardSchemaV1Error extends Error {
|
|
1810
|
+
/** The schema issues. */
|
|
1811
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
1812
|
+
/**
|
|
1813
|
+
* Creates a schema error with useful information.
|
|
1814
|
+
*
|
|
1815
|
+
* @param issues The schema issues.
|
|
1816
|
+
*/
|
|
1817
|
+
constructor(issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
1818
|
+
}
|
|
1819
|
+
//# sourceMappingURL=error.d.ts.map
|
|
1820
|
+
//#endregion
|
|
1821
|
+
//#region src/vendor/unpromise/types.d.ts
|
|
1822
|
+
/** TYPES */
|
|
1823
|
+
/** A promise that exploits a single, memory-safe upstream subscription
|
|
1824
|
+
* to a single re-used Unpromise that persists for the VM lifetime of a
|
|
1825
|
+
* Promise.
|
|
1826
|
+
*
|
|
1827
|
+
* Calling unsubscribe() removes the subscription, eliminating
|
|
1828
|
+
* all references to the SubscribedPromise. */
|
|
1829
|
+
interface SubscribedPromise<T> extends Promise<T> {
|
|
1830
|
+
unsubscribe: () => void;
|
|
1831
|
+
}
|
|
1832
|
+
/** Duplicate of Promise interface, except each call returns SubscribedPromise */
|
|
1833
|
+
interface ProxyPromise<T> extends Promise<T> {
|
|
1834
|
+
subscribe: () => SubscribedPromise<T>;
|
|
1835
|
+
then: <TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null) => SubscribedPromise<TResult1 | TResult2>;
|
|
1836
|
+
catch: <TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null) => SubscribedPromise<T | TResult>;
|
|
1837
|
+
finally: (onfinally?: (() => void) | null) => SubscribedPromise<T>;
|
|
1838
|
+
}
|
|
1839
|
+
type PromiseExecutor<T> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void;
|
|
1840
|
+
/** A standard pattern for a resolvable, rejectable Promise, based
|
|
1841
|
+
* on the emerging ES2023 standard. Type ported from
|
|
1842
|
+
* https://github.com/microsoft/TypeScript/pull/56593 */
|
|
1843
|
+
interface PromiseWithResolvers<T> {
|
|
1844
|
+
promise: Promise<T>;
|
|
1845
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
1846
|
+
reject: (reason?: any) => void;
|
|
1847
|
+
}
|
|
1848
|
+
/** Given an array, this is the union of its members' types. */
|
|
1849
|
+
//# sourceMappingURL=types.d.ts.map
|
|
1850
|
+
|
|
1851
|
+
//#endregion
|
|
1852
|
+
//#region src/vendor/unpromise/unpromise.d.ts
|
|
1853
|
+
/**
|
|
1854
|
+
* Every `Promise<T>` can be shadowed by a single `ProxyPromise<T>`. It is
|
|
1855
|
+
* created once, cached and reused throughout the lifetime of the Promise. Get a
|
|
1856
|
+
* Promise's ProxyPromise using `Unpromise.proxy(promise)`.
|
|
1857
|
+
*
|
|
1858
|
+
* The `ProxyPromise<T>` attaches handlers to the original `Promise<T>`
|
|
1859
|
+
* `.then()` and `.catch()` just once. Promises derived from it use a
|
|
1860
|
+
* subscription- (and unsubscription-) based mechanism that monitors these
|
|
1861
|
+
* handlers.
|
|
1862
|
+
*
|
|
1863
|
+
* Every time you call `.subscribe()`, `.then()` `.catch()` or `.finally()` on a
|
|
1864
|
+
* `ProxyPromise<T>` it returns a `SubscribedPromise<T>` having an additional
|
|
1865
|
+
* `unsubscribe()` method. Calling `unsubscribe()` detaches reference chains
|
|
1866
|
+
* from the original, potentially long-lived Promise, eliminating memory leaks.
|
|
1867
|
+
*
|
|
1868
|
+
* This approach can eliminate the memory leaks that otherwise come about from
|
|
1869
|
+
* repeated `race()` or `any()` calls invoking `.then()` and `.catch()` multiple
|
|
1870
|
+
* times on the same long-lived native Promise (subscriptions which can never be
|
|
1871
|
+
* cleaned up).
|
|
1872
|
+
*
|
|
1873
|
+
* `Unpromise.race(promises)` is a reference implementation of `Promise.race`
|
|
1874
|
+
* avoiding memory leaks when using long-lived unsettled Promises.
|
|
1875
|
+
*
|
|
1876
|
+
* `Unpromise.any(promises)` is a reference implementation of `Promise.any`
|
|
1877
|
+
* avoiding memory leaks when using long-lived unsettled Promises.
|
|
1878
|
+
*
|
|
1879
|
+
* `Unpromise.resolve(promise)` returns an ephemeral `SubscribedPromise<T>` for
|
|
1880
|
+
* any given `Promise<T>` facilitating arbitrary async/await patterns. Behind
|
|
1881
|
+
* the scenes, `resolve` is implemented simply as
|
|
1882
|
+
* `Unpromise.proxy(promise).subscribe()`. Don't forget to call `.unsubscribe()`
|
|
1883
|
+
* to tidy up!
|
|
1884
|
+
*
|
|
1885
|
+
*/
|
|
1886
|
+
declare class Unpromise<T> implements ProxyPromise<T> {
|
|
1887
|
+
/** INSTANCE IMPLEMENTATION */
|
|
1888
|
+
/** The promise shadowed by this Unpromise<T> */
|
|
1889
|
+
protected readonly promise: Promise<T> | PromiseLike<T>;
|
|
1890
|
+
/** Promises expecting eventual settlement (unless unsubscribed first). This list is deleted
|
|
1891
|
+
* after the original promise settles - no further notifications will be issued. */
|
|
1892
|
+
protected subscribers: ReadonlyArray<PromiseWithResolvers<T>> | null;
|
|
1893
|
+
/** The Promise's settlement (recorded when it fulfils or rejects). This is consulted when
|
|
1894
|
+
* calling .subscribe() .then() .catch() .finally() to see if an immediately-resolving Promise
|
|
1895
|
+
* can be returned, and therefore subscription can be bypassed. */
|
|
1896
|
+
protected settlement: PromiseSettledResult<T> | null;
|
|
1897
|
+
/** Constructor accepts a normal Promise executor function like `new
|
|
1898
|
+
* Unpromise((resolve, reject) => {...})` or accepts a pre-existing Promise
|
|
1899
|
+
* like `new Unpromise(existingPromise)`. Adds `.then()` and `.catch()`
|
|
1900
|
+
* handlers to the Promise. These handlers pass fulfilment and rejection
|
|
1901
|
+
* notifications to downstream subscribers and maintains records of value
|
|
1902
|
+
* or error if the Promise ever settles. */
|
|
1903
|
+
protected constructor(promise: Promise<T>);
|
|
1904
|
+
protected constructor(promise: PromiseLike<T>);
|
|
1905
|
+
protected constructor(executor: PromiseExecutor<T>);
|
|
1906
|
+
/** Create a promise that mitigates uncontrolled subscription to a long-lived
|
|
1907
|
+
* Promise via .then() and .catch() - otherwise a source of memory leaks.
|
|
1908
|
+
*
|
|
1909
|
+
* The returned promise has an `unsubscribe()` method which can be called when
|
|
1910
|
+
* the Promise is no longer being tracked by application logic, and which
|
|
1911
|
+
* ensures that there is no reference chain from the original promise to the
|
|
1912
|
+
* new one, and therefore no memory leak.
|
|
1913
|
+
*
|
|
1914
|
+
* If original promise has not yet settled, this adds a new unique promise
|
|
1915
|
+
* that listens to then/catch events, along with an `unsubscribe()` method to
|
|
1916
|
+
* detach it.
|
|
1917
|
+
*
|
|
1918
|
+
* If original promise has settled, then creates a new Promise.resolve() or
|
|
1919
|
+
* Promise.reject() and provided unsubscribe is a noop.
|
|
1920
|
+
*
|
|
1921
|
+
* If you call `unsubscribe()` before the returned Promise has settled, it
|
|
1922
|
+
* will never settle.
|
|
1923
|
+
*/
|
|
1924
|
+
subscribe(): SubscribedPromise<T>;
|
|
1925
|
+
/** STANDARD PROMISE METHODS (but returning a SubscribedPromise) */
|
|
1926
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): SubscribedPromise<TResult1 | TResult2>;
|
|
1927
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): SubscribedPromise<T | TResult>;
|
|
1928
|
+
finally(onfinally?: (() => void) | null): SubscribedPromise<T>;
|
|
1929
|
+
/** TOSTRING SUPPORT */
|
|
1930
|
+
readonly [Symbol.toStringTag] = "Unpromise";
|
|
1931
|
+
/** Unpromise STATIC METHODS */
|
|
1932
|
+
/** Create or Retrieve the proxy Unpromise (a re-used Unpromise for the VM lifetime
|
|
1933
|
+
* of the provided Promise reference) */
|
|
1934
|
+
static proxy<T>(promise: PromiseLike<T>): ProxyPromise<T>;
|
|
1935
|
+
/** Create and store an Unpromise keyed by an original Promise. */
|
|
1936
|
+
protected static createSubscribablePromise<T>(promise: PromiseLike<T>): Unpromise<T>;
|
|
1937
|
+
/** Retrieve a previously-created Unpromise keyed by an original Promise. */
|
|
1938
|
+
protected static getSubscribablePromise<T>(promise: PromiseLike<T>): ProxyPromise<T> | undefined;
|
|
1939
|
+
/** Promise STATIC METHODS */
|
|
1940
|
+
/** Lookup the Unpromise for this promise, and derive a SubscribedPromise from
|
|
1941
|
+
* it (that can be later unsubscribed to eliminate Memory leaks) */
|
|
1942
|
+
static resolve<T>(value: T | PromiseLike<T>): SubscribedPromise<Awaited<T>>;
|
|
1943
|
+
/** Perform Promise.any() via SubscribedPromises, then unsubscribe them.
|
|
1944
|
+
* Equivalent to Promise.any but eliminates memory leaks from long-lived
|
|
1945
|
+
* promises accumulating .then() and .catch() subscribers. */
|
|
1946
|
+
static any<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
|
|
1947
|
+
/** Perform Promise.race via SubscribedPromises, then unsubscribe them.
|
|
1948
|
+
* Equivalent to Promise.race but eliminates memory leaks from long-lived
|
|
1949
|
+
* promises accumulating .then() and .catch() subscribers. */
|
|
1950
|
+
static race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
|
|
1951
|
+
/** Create a race of SubscribedPromises that will fulfil to a single winning
|
|
1952
|
+
* Promise (in a 1-Tuple). Eliminates memory leaks from long-lived promises
|
|
1953
|
+
* accumulating .then() and .catch() subscribers. Allows simple logic to
|
|
1954
|
+
* consume the result, like...
|
|
1955
|
+
* ```ts
|
|
1956
|
+
* const [ winner ] = await Unpromise.race([ promiseA, promiseB ]);
|
|
1957
|
+
* if(winner === promiseB){
|
|
1958
|
+
* const result = await promiseB;
|
|
1959
|
+
* // do the thing
|
|
1960
|
+
* }
|
|
1961
|
+
* ```
|
|
1962
|
+
* */
|
|
1963
|
+
static raceReferences<TPromise extends Promise<unknown>>(promises: readonly TPromise[]): Promise<readonly [TPromise]>;
|
|
1964
|
+
}
|
|
1965
|
+
/** Promises a 1-tuple containing the original promise when it resolves. Allows
|
|
1966
|
+
* awaiting the eventual Promise ***reference*** (easy to destructure and
|
|
1967
|
+
* exactly compare with ===). Avoids resolving to the Promise ***value*** (which
|
|
1968
|
+
* may be ambiguous and therefore hard to identify as the winner of a race).
|
|
1969
|
+
* You can call unsubscribe on the Promise to mitigate memory leaks.
|
|
1970
|
+
* */
|
|
1971
|
+
|
|
1972
|
+
//#endregion
|
|
1973
|
+
export { AnyClientTypes, AnyMiddlewareBuilder, AnyMiddlewareFunction, AnyMutationProcedure, AnyProcedure, AnyProcedureBuilder, AnyQueryProcedure, AnyRootTypes, AnyRouter, AnySubscriptionProcedure, BaseHandlerOptions, BuiltRouter, CallerOverride, CombinedDataTransformer, CombinedDataTransformerClient, ConsumerOnError, CreateContextCallback, CreateRootTypes, CreateRouterOptions, DataTransformer, DataTransformerOptions, DecorateCreateRouterOptions, DecorateRouterRecord, DeepPartial, DefaultErrorData, DefaultErrorShape, Deferred, Dict, DistributiveOmit, ErrorFormatter, ErrorHandlerOptions, ErrorSymbol, EventSourceLike, Filter, FilterKeys, GetInferenceHelpers, GetRawInputFn, HTTPBaseHandlerOptions, HTTPErrorHandler, HTTP_CODE_TO_JSONRPC2, InferrableClientTypes, IntersectionError, InvertKeyValue, JSONLProducerOptions, JSONRPC2, JSONRPC2_TO_HTTP_CODE, KeyFromValue, Lazy, LegacyObservableSubscriptionProcedure, Maybe, MaybePromise, MergeRouters, MiddlewareBuilder, MiddlewareFunction, MiddlewareResult, MutationProcedure, NodeJSReadableStreamEsque, Overwrite, ParseFn, Parser, ParserArkTypeEsque, ParserCustomValidatorEsque, ParserMyZodEsque, ParserScaleEsque, ParserStandardSchemaEsque, ParserSuperstructEsque, ParserValibotEsque, ParserWithInputOutput, ParserWithoutInput, ParserYupEsque, ParserZodEsque, PickFirstDefined, Procedure, ProcedureBuilder, ProcedureCallOptions, ProcedureResolverOptions, ProcedureType, ProducerOnError, PromiseExecutor, PromiseWithResolvers, ProtectedIntersection, ProxyPromise, QueryProcedure, ResolveHTTPRequestOptionsContextFn, ResponseMeta, ResponseMetaFn, Result$1 as Result, RootConfig, RootTypes, Router, RouterBuilder, RouterCaller, RouterCallerErrorHandler, RouterCallerFactory, RouterDef, RouterRecord, RuntimeConfigOptions, SSEClientOptions, SSEPingOptions, SSEStreamConsumerOptions, SSEStreamProducerOptions, Serialize, SerializeObject, Simplify, StandardSchemaV1, StandardSchemaV1Error, SubscribedPromise, SubscriptionProcedure, TRPCAcceptHeader, TRPCBuilder, TRPCClientIncomingMessage, TRPCClientIncomingRequest, TRPCClientOutgoingMessage, TRPCClientOutgoingRequest, TRPCConnectionParamsMessage, TRPCError, TRPCErrorResponse, TRPCErrorShape, TRPCReconnectNotification, TRPCRequest, TRPCRequestInfo, TRPCRequestInfoProcedureCall, TRPCRequestMessage, TRPCResponse, TRPCResponseMessage, TRPCResult, TRPCResultMessage, TRPCRootObject, TRPCSubscriptionStopNotification, TRPCSuccessResponse, TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER, TRPC_ERROR_CODE_KEY, TRPC_ERROR_CODE_NUMBER, TrackedEnvelope, TypeError, Unpromise, UnsetMarker, Unwrap, ValidateShape, ValueOf, WebReadableStreamEsque, WithoutIndexSignature, abortSignalsAnyPonyfill, assert, callProcedure, coerceAsyncIterableToArray, createBuilder, createCallerFactory, createDeferred, createFlatProxy, createInputMiddleware, createMiddlewareFactory, createOutputMiddleware, createRecursiveProxy, createRouterFactory, defaultFormatter, defaultTransformer, experimental_standaloneMiddleware, formDataToObject, getCauseFromUnknown, getDataTransformer, getErrorShape, getHTTPStatusCode, getHTTPStatusCodeFromError, getParseFn, getProcedureAtPath, getRequestInfo, getStatusCodeFromKey, getStatusKeyFromCode, getTRPCErrorFromUnknown, identity, inferAsyncIterableYield, inferClientTypes, inferParser, inferProcedureBuilderResolverOptions, inferProcedureInput, inferProcedureOutput, inferProcedureParams, inferRouterContext, inferRouterError, inferRouterInputs, inferRouterMeta, inferRouterOutputs, inferRouterRootTypes, inferTrackedOutput, inferTransformedProcedureOutput, inferTransformedSubscriptionOutput, initTRPC, isAbortError, isAsyncIterable, isFunction, isObject, isPromise, isServerDefault, isTrackedEnvelope, iteratorResource, jsonlStreamConsumer, jsonlStreamProducer, lazy, makeAsyncResource, makeResource, mergeRouters, mergeWithoutOverrides, middlewareMarker, noop, octetInputParser, omitPrototype, parseConnectionParamsFromString, parseConnectionParamsFromUnknown, parseTRPCMessage, procedureTypes, resolveResponse, retryableRpcCodes, run, sleep, sse, sseHeaders, sseStreamConsumer, sseStreamProducer, takeWithGrace, throwAbortError, tracked, transformResult, transformTRPCResponse, withMaxDuration };
|
|
1974
|
+
//# sourceMappingURL=unstable-core-do-not-import.d-ptrxwuSa.d.mts.map
|