@trpc/server 11.19.0 → 11.21.1-canary.20.10e2ef98f
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/index.d.ts +1 -0
- package/adapters/aws-lambda/index.js +1 -0
- package/adapters/express/index.d.ts +1 -0
- package/adapters/express/index.js +1 -0
- package/adapters/fastify/index.d.ts +1 -0
- package/adapters/fastify/index.js +1 -0
- package/adapters/fetch/index.d.ts +1 -0
- package/adapters/fetch/index.js +1 -0
- package/adapters/next/index.d.ts +1 -0
- package/adapters/next/index.js +1 -0
- package/adapters/next-app-dir/index.d.ts +1 -0
- package/adapters/next-app-dir/index.js +1 -0
- package/adapters/node-http/content-type/form-data/index.d.ts +1 -0
- package/adapters/node-http/content-type/form-data/index.js +1 -0
- package/adapters/node-http/content-type/json/index.d.ts +1 -0
- package/adapters/node-http/content-type/json/index.js +1 -0
- package/adapters/node-http/index.d.ts +1 -0
- package/adapters/node-http/index.js +1 -0
- package/adapters/standalone/index.d.ts +1 -0
- package/adapters/standalone/index.js +1 -0
- package/adapters/ws/index.d.ts +1 -0
- package/adapters/ws/index.js +1 -0
- package/dist/adapters/aws-lambda/index.cjs +2 -2
- package/dist/adapters/aws-lambda/index.d.cts +1 -1
- package/dist/adapters/aws-lambda/index.d.mts +1 -1
- package/dist/adapters/aws-lambda/index.mjs +2 -2
- package/dist/adapters/express.cjs +3 -3
- package/dist/adapters/express.d.cts +2 -2
- package/dist/adapters/express.d.mts +2 -2
- package/dist/adapters/express.mjs +3 -3
- package/dist/adapters/fastify/index.cjs +4 -4
- package/dist/adapters/fastify/index.d.cts +2 -2
- package/dist/adapters/fastify/index.d.mts +2 -2
- package/dist/adapters/fastify/index.mjs +4 -4
- package/dist/adapters/fetch/index.cjs +2 -2
- package/dist/adapters/fetch/index.d.cts +1 -1
- package/dist/adapters/fetch/index.d.mts +1 -1
- package/dist/adapters/fetch/index.mjs +2 -2
- package/dist/adapters/next-app-dir.cjs +7 -7
- package/dist/adapters/next-app-dir.d.cts +1 -1
- package/dist/adapters/next-app-dir.d.mts +1 -1
- package/dist/adapters/next-app-dir.mjs +2 -2
- package/dist/adapters/next.cjs +5 -5
- package/dist/adapters/next.d.cts +2 -2
- package/dist/adapters/next.d.mts +2 -2
- package/dist/adapters/next.mjs +4 -4
- package/dist/adapters/node-http/index.cjs +1 -1
- package/dist/adapters/node-http/index.d.cts +1 -1
- package/dist/adapters/node-http/index.d.mts +1 -1
- package/dist/adapters/node-http/index.mjs +1 -1
- package/dist/adapters/standalone.cjs +3 -3
- package/dist/adapters/standalone.d.cts +2 -2
- package/dist/adapters/standalone.d.mts +2 -2
- package/dist/adapters/standalone.mjs +3 -3
- package/dist/adapters/ws.cjs +1 -1
- package/dist/adapters/ws.d.cts +2 -2
- package/dist/adapters/ws.d.mts +2 -2
- package/dist/adapters/ws.mjs +1 -1
- package/dist/{tracked-BQJb0ANk.cjs → asyncGeneratorDelegate-D2tFgl_z.cjs} +167 -17
- package/dist/{tracked-D4jU_Hb3.mjs → asyncGeneratorDelegate-mPyp1u6d.mjs} +141 -9
- package/dist/asyncGeneratorDelegate-mPyp1u6d.mjs.map +1 -0
- package/dist/{codes-C6ZIq69A.cjs → codes-BwD4QurF.cjs} +9 -0
- package/dist/{codes-D5Ya6_Bi.mjs → codes-D6C_OiJy.mjs} +5 -2
- package/dist/codes-D6C_OiJy.mjs.map +1 -0
- package/dist/{getErrorShape-B0JBUs-i.mjs → getErrorShape-BziUKLM_.mjs} +52 -14
- package/dist/getErrorShape-BziUKLM_.mjs.map +1 -0
- package/dist/{getErrorShape-DeIapApr.cjs → getErrorShape-CVxLwJgN.cjs} +80 -12
- package/dist/http.cjs +2 -2
- package/dist/http.d.cts +1 -1
- package/dist/http.d.mts +1 -1
- package/dist/http.mjs +2 -2
- package/dist/{index-_jAhoJQ7.d.mts → index-BDZDS1SD.d.mts} +2 -2
- package/dist/{index-BHatz_Pu.d.cts.map → index-BDZDS1SD.d.mts.map} +1 -1
- package/dist/{index-BHatz_Pu.d.cts → index-BzKrDvzg.d.cts} +2 -2
- package/dist/{index-_jAhoJQ7.d.mts.map → index-BzKrDvzg.d.cts.map} +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{initTRPC-B7UdX-c3.cjs → initTRPC-DLNeKv0z.cjs} +114 -26
- package/dist/{initTRPC-B259os3T.mjs → initTRPC-DpOypWK_.mjs} +95 -19
- package/dist/initTRPC-DpOypWK_.mjs.map +1 -0
- package/dist/{node-http-BUlb5EdB.mjs → node-http-B_z10Yky.mjs} +5 -5
- package/dist/{node-http-BUlb5EdB.mjs.map → node-http-B_z10Yky.mjs.map} +1 -1
- package/dist/{node-http-CikCqjt6.cjs → node-http-Bti3aBT6.cjs} +9 -9
- package/dist/{parseTRPCMessage-MJWDg1vX.mjs → parseTRPCMessage-CSh-CVPr.mjs} +2 -2
- package/dist/{parseTRPCMessage-MJWDg1vX.mjs.map → parseTRPCMessage-CSh-CVPr.mjs.map} +1 -1
- package/dist/{parseTRPCMessage-BxAIUx49.cjs → parseTRPCMessage-RJS87G_t.cjs} +1 -1
- package/dist/{resolveResponse-JtMyT9TQ.mjs → resolveResponse-CrB_9MSD.mjs} +43 -179
- package/dist/resolveResponse-CrB_9MSD.mjs.map +1 -0
- package/dist/{resolveResponse-DLpzHrPG.cjs → resolveResponse-D5JAuwvU.cjs} +90 -226
- package/dist/rpc.cjs +2 -2
- package/dist/rpc.d.cts +1 -1
- package/dist/rpc.d.mts +1 -1
- package/dist/rpc.mjs +2 -2
- package/dist/shared.cjs +1 -1
- package/dist/shared.d.cts +1 -1
- package/dist/shared.d.mts +1 -1
- package/dist/shared.mjs +1 -1
- package/dist/{unstable-core-do-not-import-BK_OKrtM.d.mts → unstable-core-do-not-import-JE3NCpqt.d.mts} +707 -636
- package/dist/unstable-core-do-not-import-JE3NCpqt.d.mts.map +1 -0
- package/dist/{unstable-core-do-not-import-B9ZnrQAU.d.cts → unstable-core-do-not-import-Jynlfuqc.d.cts} +707 -636
- package/dist/unstable-core-do-not-import-Jynlfuqc.d.cts.map +1 -0
- package/dist/unstable-core-do-not-import.cjs +30 -23
- package/dist/unstable-core-do-not-import.d.cts +2 -2
- package/dist/unstable-core-do-not-import.d.mts +2 -2
- package/dist/unstable-core-do-not-import.mjs +7 -7
- package/dist/{ws-BMSSVFiW.cjs → ws-BgBeYgGS.cjs} +22 -22
- package/dist/{ws-C7ZOJJeA.mjs → ws-CNjkWAs9.mjs} +7 -7
- package/dist/{ws-C7ZOJJeA.mjs.map → ws-CNjkWAs9.mjs.map} +1 -1
- package/http/index.d.ts +1 -0
- package/http/index.js +1 -0
- package/observable/index.d.ts +1 -0
- package/observable/index.js +1 -0
- package/package.json +14 -14
- package/rpc/index.d.ts +1 -0
- package/rpc/index.js +1 -0
- package/shared/index.d.ts +1 -0
- package/shared/index.js +1 -0
- package/src/@trpc/server/index.ts +1 -0
- package/src/unstable-core-do-not-import/clientish/inference.ts +12 -0
- package/src/unstable-core-do-not-import/error/formatter.ts +90 -3
- package/src/unstable-core-do-not-import/error/getErrorShape.ts +8 -17
- package/src/unstable-core-do-not-import/initTRPC.ts +10 -7
- package/src/unstable-core-do-not-import/middleware.ts +93 -2
- package/src/unstable-core-do-not-import/procedure.ts +2 -0
- package/src/unstable-core-do-not-import/procedureBuilder.ts +79 -13
- package/src/unstable-core-do-not-import/rootConfig.ts +8 -0
- package/src/unstable-core-do-not-import/stream/jsonl.ts +41 -33
- package/src/unstable-core-do-not-import/utils.ts +4 -0
- package/unstable-core-do-not-import/index.d.ts +1 -0
- package/unstable-core-do-not-import/index.js +1 -0
- package/dist/codes-D5Ya6_Bi.mjs.map +0 -1
- package/dist/getErrorShape-B0JBUs-i.mjs.map +0 -1
- package/dist/initTRPC-B259os3T.mjs.map +0 -1
- package/dist/resolveResponse-JtMyT9TQ.mjs.map +0 -1
- package/dist/tracked-D4jU_Hb3.mjs.map +0 -1
- package/dist/unstable-core-do-not-import-B9ZnrQAU.d.cts.map +0 -1
- package/dist/unstable-core-do-not-import-BK_OKrtM.d.mts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_codes = require("./codes-
|
|
1
|
+
const require_codes = require("./codes-BwD4QurF.cjs");
|
|
2
2
|
//#region src/unstable-core-do-not-import/createProxy.ts
|
|
3
3
|
const noop = () => {};
|
|
4
4
|
const freezeIfAvailable = (obj) => {
|
|
@@ -123,6 +123,48 @@ function getHTTPStatusCodeFromError(error) {
|
|
|
123
123
|
return getStatusCodeFromKey(error.code);
|
|
124
124
|
}
|
|
125
125
|
//#endregion
|
|
126
|
+
//#region src/unstable-core-do-not-import/error/formatter.ts
|
|
127
|
+
const defaultFormatter = ({ shape }) => {
|
|
128
|
+
return shape;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
function getDefaultErrorShape(opts) {
|
|
134
|
+
const shape = {
|
|
135
|
+
message: opts.error.message,
|
|
136
|
+
code: require_codes.TRPC_ERROR_CODES_BY_KEY[opts.error.code],
|
|
137
|
+
data: {
|
|
138
|
+
code: opts.error.code,
|
|
139
|
+
httpStatus: getHTTPStatusCodeFromError(opts.error)
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
if (opts.isDev && typeof opts.error.stack === "string") shape.data.stack = opts.error.stack;
|
|
143
|
+
if (typeof opts.path === "string") shape.data.path = opts.path;
|
|
144
|
+
return shape;
|
|
145
|
+
}
|
|
146
|
+
const formattedShapeSymbol = Symbol("trpc_formattedErrorShape");
|
|
147
|
+
/**
|
|
148
|
+
* @internal
|
|
149
|
+
*/
|
|
150
|
+
function setFormattedErrorShape(error, shape) {
|
|
151
|
+
Object.defineProperty(error, formattedShapeSymbol, {
|
|
152
|
+
value: shape,
|
|
153
|
+
enumerable: false,
|
|
154
|
+
configurable: true,
|
|
155
|
+
writable: true
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
function getFormattedErrorShape(error) {
|
|
162
|
+
if (isFormattedErrorShape(error)) return error[formattedShapeSymbol];
|
|
163
|
+
}
|
|
164
|
+
function isFormattedErrorShape(error) {
|
|
165
|
+
return formattedShapeSymbol in error;
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
126
168
|
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/typeof.js
|
|
127
169
|
function _typeof(o) {
|
|
128
170
|
"@babel/helpers - typeof";
|
|
@@ -190,17 +232,13 @@ function _objectSpread2(e) {
|
|
|
190
232
|
*/
|
|
191
233
|
function getErrorShape(opts) {
|
|
192
234
|
const { path, error, config } = opts;
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
if (config.isDev && typeof opts.error.stack === "string") shape.data.stack = opts.error.stack;
|
|
203
|
-
if (typeof path === "string") shape.data.path = path;
|
|
235
|
+
const formatted = getFormattedErrorShape(error);
|
|
236
|
+
if (formatted !== void 0) return formatted;
|
|
237
|
+
const shape = getDefaultErrorShape({
|
|
238
|
+
error,
|
|
239
|
+
path,
|
|
240
|
+
isDev: config.isDev
|
|
241
|
+
});
|
|
204
242
|
return config.errorFormatter(_objectSpread2(_objectSpread2({}, opts), {}, { shape }));
|
|
205
243
|
}
|
|
206
244
|
//#endregion
|
|
@@ -240,12 +278,30 @@ Object.defineProperty(exports, "createRecursiveProxy", {
|
|
|
240
278
|
return createRecursiveProxy;
|
|
241
279
|
}
|
|
242
280
|
});
|
|
281
|
+
Object.defineProperty(exports, "defaultFormatter", {
|
|
282
|
+
enumerable: true,
|
|
283
|
+
get: function() {
|
|
284
|
+
return defaultFormatter;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
Object.defineProperty(exports, "getDefaultErrorShape", {
|
|
288
|
+
enumerable: true,
|
|
289
|
+
get: function() {
|
|
290
|
+
return getDefaultErrorShape;
|
|
291
|
+
}
|
|
292
|
+
});
|
|
243
293
|
Object.defineProperty(exports, "getErrorShape", {
|
|
244
294
|
enumerable: true,
|
|
245
295
|
get: function() {
|
|
246
296
|
return getErrorShape;
|
|
247
297
|
}
|
|
248
298
|
});
|
|
299
|
+
Object.defineProperty(exports, "getFormattedErrorShape", {
|
|
300
|
+
enumerable: true,
|
|
301
|
+
get: function() {
|
|
302
|
+
return getFormattedErrorShape;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
249
305
|
Object.defineProperty(exports, "getHTTPStatusCode", {
|
|
250
306
|
enumerable: true,
|
|
251
307
|
get: function() {
|
|
@@ -270,3 +326,15 @@ Object.defineProperty(exports, "getStatusKeyFromCode", {
|
|
|
270
326
|
return getStatusKeyFromCode;
|
|
271
327
|
}
|
|
272
328
|
});
|
|
329
|
+
Object.defineProperty(exports, "isFormattedErrorShape", {
|
|
330
|
+
enumerable: true,
|
|
331
|
+
get: function() {
|
|
332
|
+
return isFormattedErrorShape;
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
Object.defineProperty(exports, "setFormattedErrorShape", {
|
|
336
|
+
enumerable: true,
|
|
337
|
+
get: function() {
|
|
338
|
+
return setFormattedErrorShape;
|
|
339
|
+
}
|
|
340
|
+
});
|
package/dist/http.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_getErrorShape = require("./getErrorShape-
|
|
3
|
-
const require_resolveResponse = require("./resolveResponse-
|
|
2
|
+
const require_getErrorShape = require("./getErrorShape-CVxLwJgN.cjs");
|
|
3
|
+
const require_resolveResponse = require("./resolveResponse-D5JAuwvU.cjs");
|
|
4
4
|
const require_contentTypeParsers = require("./contentTypeParsers-DUzXRHT1.cjs");
|
|
5
5
|
exports.getHTTPStatusCode = require_getErrorShape.getHTTPStatusCode;
|
|
6
6
|
exports.getHTTPStatusCodeFromError = require_getErrorShape.getHTTPStatusCodeFromError;
|
package/dist/http.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as OctetInput,
|
|
1
|
+
import { A as OctetInput, An as ResponseMeta, Dn as HTTPBaseHandlerOptions, En as BaseHandlerOptions, M as octetInputParser, Nn as TRPCRequestInfo, On as HTTPErrorHandler, T as getHTTPStatusCodeFromError, _ as resolveResponse, j as UtilityParser, jn as ResponseMetaFn, k as FileLike, kn as ResolveHTTPRequestOptionsContextFn, v as parseConnectionParamsFromString, w as getHTTPStatusCode, y as parseConnectionParamsFromUnknown } from "./unstable-core-do-not-import-Jynlfuqc.cjs";
|
|
2
2
|
export { type BaseHandlerOptions, type FileLike, type HTTPBaseHandlerOptions, type HTTPErrorHandler, type HTTPErrorHandler as OnErrorFunction, type OctetInput, type ResolveHTTPRequestOptionsContextFn, type ResponseMeta, type ResponseMetaFn, type TRPCRequestInfo, type UtilityParser, getHTTPStatusCode, getHTTPStatusCodeFromError, octetInputParser, parseConnectionParamsFromString, parseConnectionParamsFromUnknown, resolveResponse };
|
package/dist/http.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as OctetInput,
|
|
1
|
+
import { A as OctetInput, An as ResponseMeta, Dn as HTTPBaseHandlerOptions, En as BaseHandlerOptions, M as octetInputParser, Nn as TRPCRequestInfo, On as HTTPErrorHandler, T as getHTTPStatusCodeFromError, _ as resolveResponse, j as UtilityParser, jn as ResponseMetaFn, k as FileLike, kn as ResolveHTTPRequestOptionsContextFn, v as parseConnectionParamsFromString, w as getHTTPStatusCode, y as parseConnectionParamsFromUnknown } from "./unstable-core-do-not-import-JE3NCpqt.mjs";
|
|
2
2
|
export { type BaseHandlerOptions, type FileLike, type HTTPBaseHandlerOptions, type HTTPErrorHandler, type HTTPErrorHandler as OnErrorFunction, type OctetInput, type ResolveHTTPRequestOptionsContextFn, type ResponseMeta, type ResponseMetaFn, type TRPCRequestInfo, type UtilityParser, getHTTPStatusCode, getHTTPStatusCodeFromError, octetInputParser, parseConnectionParamsFromString, parseConnectionParamsFromUnknown, resolveResponse };
|
package/dist/http.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as parseConnectionParamsFromUnknown, t as resolveResponse, y as parseConnectionParamsFromString } from "./resolveResponse-
|
|
1
|
+
import { d as getHTTPStatusCode, f as getHTTPStatusCodeFromError } from "./getErrorShape-BziUKLM_.mjs";
|
|
2
|
+
import { b as parseConnectionParamsFromUnknown, t as resolveResponse, y as parseConnectionParamsFromString } from "./resolveResponse-CrB_9MSD.mjs";
|
|
3
3
|
import { t as octetInputParser } from "./contentTypeParsers-KFMy_fwz.mjs";
|
|
4
4
|
export { getHTTPStatusCode, getHTTPStatusCodeFromError, octetInputParser, parseConnectionParamsFromString, parseConnectionParamsFromUnknown, resolveResponse };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as inferRouterContext, Dn as HTTPBaseHandlerOptions, Fn as AnyRouter, Nn as TRPCRequestInfo, hi as MaybePromise, oi as DistributiveOmit, or as CreateContextCallback } from "./unstable-core-do-not-import-JE3NCpqt.mjs";
|
|
2
2
|
import * as http$1 from "http";
|
|
3
3
|
import * as http2 from "http2";
|
|
4
4
|
//#region src/adapters/node-http/types.d.ts
|
|
@@ -91,4 +91,4 @@ declare function incomingMessageToRequest(req: NodeHTTPRequest, res: NodeHTTPRes
|
|
|
91
91
|
}): Request;
|
|
92
92
|
//#endregion
|
|
93
93
|
export { NodeHTTPCreateContextFn as a, NodeHTTPHandlerOptions as c, NodeHTTPResponse as d, nodeHTTPRequestHandler as i, NodeHTTPRequest as l, incomingMessageToRequest as n, NodeHTTPCreateContextFnOptions as o, internal_exceptionHandler as r, NodeHTTPCreateContextOption as s, createURL as t, NodeHTTPRequestHandlerOptions as u };
|
|
94
|
-
//# sourceMappingURL=index-
|
|
94
|
+
//# sourceMappingURL=index-BDZDS1SD.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-BDZDS1SD.d.mts","names":[],"sources":["../src/adapters/node-http/types.ts","../src/adapters/node-http/nodeHTTPRequestHandler.ts","../src/adapters/node-http/incomingMessageToRequest.ts"],"mappings":";;;;KA4BY,kBAAkB,iBAC5B,OAAK,kBAAkB,MAAM;;;;EAM7B;;;;;;;EAOA,SACI,QAAQ,OAAK,6BACb,QAAQ,MAAM;;KAGR,mBAAmB,iBAC7B,OAAK,iBAAiB,MAAM;;;;;;;;;EAW5B;EAEA,QAAQ,gBAAgB;;KAEd,4BACV,gBAAgB,WAChB,UACA,aACE,sBACF,mBAAmB,UACnB,wBAAwB,SAAS,UAAU;;;;KAMxC,kBACH,iBAAiB,kBAAkB,iBACnC,kBAAkB,mBAAmB,qBAClC,KAAK,UAAU,KAAK,WAAW,OAAO;KAE/B,uBACV,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,oBAChB,uBAAuB,SAAS,YAClC,4BAA4B,SAAS,UAAU;;;;;;;;;;;;;;;;;EAiB7C,aAAa,kBAAkB,UAAU;EACzC;;KAGQ,8BACV,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,oBAChB,uBAAuB,SAAS,UAAU;EAC5C,KAAK;EACL,KAAK;;;;;EAKL;;KAGU,+BAA+B,UAAU;EACnD,KAAK;EACL,KAAK;EACL,MAAM;;KAEI,wBACV,gBAAgB,WAChB,UACA,cAEA,MAAM,+BAA+B,UAAU,eAC5C,aAAa,mBAAmB;;;;;;iBCnGrB,0BACd,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,kBAClB,MAAM,8BAA8B,SAAS,UAAU,cAAU;;;;iBAmC7C,uBACpB,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,kBAClB,MAAM,8BAA8B,SAAS,UAAU,aAAU;;;iBCHnD,UAAU,KAAK,kBAAkB;;;;iBAgDjC,yBACd,KAAK,iBACL,KAAK,kBACL;;;;EAIE;IAED"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as inferRouterContext, Dn as HTTPBaseHandlerOptions, Fn as AnyRouter, Nn as TRPCRequestInfo, hi as MaybePromise, oi as DistributiveOmit, or as CreateContextCallback } from "./unstable-core-do-not-import-Jynlfuqc.cjs";
|
|
2
2
|
import * as http$1 from "http";
|
|
3
3
|
import * as http2 from "http2";
|
|
4
4
|
//#region src/adapters/node-http/types.d.ts
|
|
@@ -91,4 +91,4 @@ declare function incomingMessageToRequest(req: NodeHTTPRequest, res: NodeHTTPRes
|
|
|
91
91
|
}): Request;
|
|
92
92
|
//#endregion
|
|
93
93
|
export { NodeHTTPCreateContextFn as a, NodeHTTPHandlerOptions as c, NodeHTTPResponse as d, nodeHTTPRequestHandler as i, NodeHTTPRequest as l, incomingMessageToRequest as n, NodeHTTPCreateContextFnOptions as o, internal_exceptionHandler as r, NodeHTTPCreateContextOption as s, createURL as t, NodeHTTPRequestHandlerOptions as u };
|
|
94
|
-
//# sourceMappingURL=index-
|
|
94
|
+
//# sourceMappingURL=index-BzKrDvzg.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-BzKrDvzg.d.cts","names":[],"sources":["../src/adapters/node-http/types.ts","../src/adapters/node-http/nodeHTTPRequestHandler.ts","../src/adapters/node-http/incomingMessageToRequest.ts"],"mappings":";;;;KA4BY,kBAAkB,iBAC5B,OAAK,kBAAkB,MAAM;;;;EAM7B;;;;;;;EAOA,SACI,QAAQ,OAAK,6BACb,QAAQ,MAAM;;KAGR,mBAAmB,iBAC7B,OAAK,iBAAiB,MAAM;;;;;;;;;EAW5B;EAEA,QAAQ,gBAAgB;;KAEd,4BACV,gBAAgB,WAChB,UACA,aACE,sBACF,mBAAmB,UACnB,wBAAwB,SAAS,UAAU;;;;KAMxC,kBACH,iBAAiB,kBAAkB,iBACnC,kBAAkB,mBAAmB,qBAClC,KAAK,UAAU,KAAK,WAAW,OAAO;KAE/B,uBACV,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,oBAChB,uBAAuB,SAAS,YAClC,4BAA4B,SAAS,UAAU;;;;;;;;;;;;;;;;;EAiB7C,aAAa,kBAAkB,UAAU;EACzC;;KAGQ,8BACV,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,oBAChB,uBAAuB,SAAS,UAAU;EAC5C,KAAK;EACL,KAAK;;;;;EAKL;;KAGU,+BAA+B,UAAU;EACnD,KAAK;EACL,KAAK;EACL,MAAM;;KAEI,wBACV,gBAAgB,WAChB,UACA,cAEA,MAAM,+BAA+B,UAAU,eAC5C,aAAa,mBAAmB;;;;;;iBCnGrB,0BACd,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,kBAClB,MAAM,8BAA8B,SAAS,UAAU,cAAU;;;;iBAmC7C,uBACpB,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,kBAClB,MAAM,8BAA8B,SAAS,UAAU,aAAU;;;iBCHnD,UAAU,KAAK,kBAAkB;;;;iBAgDjC,yBACd,KAAK,iBACL,KAAK,kBACL;;;;EAIE;IAED"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_getErrorShape = require("./getErrorShape-
|
|
3
|
-
const
|
|
4
|
-
const require_initTRPC = require("./initTRPC-
|
|
2
|
+
const require_getErrorShape = require("./getErrorShape-CVxLwJgN.cjs");
|
|
3
|
+
const require_asyncGeneratorDelegate = require("./asyncGeneratorDelegate-D2tFgl_z.cjs");
|
|
4
|
+
const require_initTRPC = require("./initTRPC-DLNeKv0z.cjs");
|
|
5
5
|
exports.StandardSchemaV1Error = require_initTRPC.StandardSchemaV1Error;
|
|
6
|
-
exports.TRPCError =
|
|
7
|
-
exports.callTRPCProcedure =
|
|
6
|
+
exports.TRPCError = require_asyncGeneratorDelegate.TRPCError;
|
|
7
|
+
exports.callTRPCProcedure = require_asyncGeneratorDelegate.callProcedure;
|
|
8
8
|
exports.createTRPCFlatProxy = require_getErrorShape.createFlatProxy;
|
|
9
9
|
exports.createTRPCRecursiveProxy = require_getErrorShape.createRecursiveProxy;
|
|
10
|
-
exports.experimental_lazy =
|
|
10
|
+
exports.experimental_lazy = require_asyncGeneratorDelegate.lazy;
|
|
11
11
|
exports.experimental_standaloneMiddleware = require_initTRPC.experimental_standaloneMiddleware;
|
|
12
12
|
exports.experimental_trpcMiddleware = require_initTRPC.experimental_standaloneMiddleware;
|
|
13
13
|
exports.getErrorShape = require_getErrorShape.getErrorShape;
|
|
14
|
-
exports.getTRPCErrorFromUnknown =
|
|
14
|
+
exports.getTRPCErrorFromUnknown = require_asyncGeneratorDelegate.getTRPCErrorFromUnknown;
|
|
15
15
|
exports.getTRPCErrorShape = require_getErrorShape.getErrorShape;
|
|
16
16
|
exports.initTRPC = require_initTRPC.initTRPC;
|
|
17
|
-
exports.isTrackedEnvelope =
|
|
18
|
-
exports.lazy =
|
|
19
|
-
exports.sse =
|
|
20
|
-
exports.tracked =
|
|
21
|
-
exports.transformTRPCResponse =
|
|
17
|
+
exports.isTrackedEnvelope = require_asyncGeneratorDelegate.isTrackedEnvelope;
|
|
18
|
+
exports.lazy = require_asyncGeneratorDelegate.lazy;
|
|
19
|
+
exports.sse = require_asyncGeneratorDelegate.sse;
|
|
20
|
+
exports.tracked = require_asyncGeneratorDelegate.tracked;
|
|
21
|
+
exports.transformTRPCResponse = require_asyncGeneratorDelegate.transformTRPCResponse;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as
|
|
1
|
+
import { $n as inferRouterContext, B as inferRouterInputs, Cr as sse, F as getErrorShape, Fn as AnyRouter, Ft as MiddlewareFunction, Gt as DefaultErrorShape, H as inferTransformedProcedureOutput, I as createFlatProxy, In as BuiltRouter, J as inferClientTypes, Jn as RouterRecord, K as AnyClientTypes, Kn as RouterCallerFactory, Kt as ErrorFormatter, L as createRecursiveProxy, Ln as CreateRouterOptions, Nt as AnyMiddlewareFunction, Pt as MiddlewareBuilder, Q as AnySubscriptionProcedure, Qr as getTRPCErrorFromUnknown, Rn as DecorateCreateRouterOptions, Si as Unwrap, Sr as isTrackedEnvelope, U as inferTransformedSubscriptionOutput, Un as RouterBuilder, V as inferRouterOutputs, Vn as MergeRouters, Vt as experimental_standaloneMiddleware, Wn as RouterCaller, Wt as DefaultErrorData, X as AnyProcedure, Xr as TRPCError, Y as AnyMutationProcedure, Yn as callProcedure, Z as AnyQueryProcedure, ai as Dict, ar as AnyRootTypes, at as SubscriptionProcedure, br as TrackedEnvelope, cn as transformTRPCResponse, cr as RootConfig, er as inferRouterError, g as initTRPC, gn as TRPCErrorShape, h as TRPCRootObject, ii as DeepPartial, it as QueryProcedure, lt as inferSubscriptionInput, m as TRPCBuilder, mt as ProcedureBuilder, ni as TRPC_ERROR_CODE_NUMBER, o as StandardSchemaV1Error, or as CreateContextCallback, ot as inferProcedureInput, p as RuntimeConfigOptions, qn as RouterDef, rn as DataTransformer, rr as lazy, rt as ProcedureType, st as inferProcedureOutput, ti as TRPC_ERROR_CODE_KEY, tn as CombinedDataTransformer, tt as MutationProcedure, ut as inferSubscriptionOutput, vt as inferProcedureBuilderResolverOptions, wr as tracked, yt as UnsetMarker, z as inferProcedureErrorShape } from "./unstable-core-do-not-import-Jynlfuqc.cjs";
|
|
2
2
|
//#region src/@trpc/server/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated
|
|
@@ -6,5 +6,5 @@ import { B as inferRouterOutputs, Bn as inferSubscriptionOutput, Bt as DefaultEr
|
|
|
6
6
|
*/
|
|
7
7
|
export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> = Awaited<ReturnType<TFunction>>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { type AnyMiddlewareFunction, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type AnyMutationProcedure, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyProcedure, type AnyProcedure as AnyTRPCProcedure, type AnyQueryProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type AnyRouter, type AnyRouter as AnyTRPCRouter, type AnySubscriptionProcedure, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, type AnyClientTypes as AnyTRPCClientTypes, type AnyRootTypes as AnyTRPCRootTypes, type CombinedDataTransformer, type CombinedDataTransformer as TRPCCombinedDataTransformer, type CreateContextCallback, type DataTransformer, type DataTransformer as TRPCDataTransformer, type DeepPartial, type Dict, type ProcedureType, type ProcedureType as TRPCProcedureType, StandardSchemaV1Error, type TRPCBuilder, type BuiltRouter as TRPCBuiltRouter, type CreateRouterOptions as TRPCCreateRouterOptions, type DecorateCreateRouterOptions as TRPCDecorateCreateRouterOptions, type DefaultErrorData as TRPCDefaultErrorData, type DefaultErrorShape as TRPCDefaultErrorShape, TRPCError, type ErrorFormatter as TRPCErrorFormatter, type TRPCErrorShape, type MergeRouters as TRPCMergeRouters, type MiddlewareBuilder as TRPCMiddlewareBuilder, type MiddlewareFunction as TRPCMiddlewareFunction, type MutationProcedure as TRPCMutationProcedure, type ProcedureBuilder as TRPCProcedureBuilder, type QueryProcedure as TRPCQueryProcedure, type RootConfig as TRPCRootConfig, type TRPCRootObject, type RouterBuilder as TRPCRouterBuilder, type RouterCaller as TRPCRouterCaller, type RouterCallerFactory as TRPCRouterCallerFactory, type RouterDef as TRPCRouterDef, type RouterRecord as TRPCRouterRecord, type RuntimeConfigOptions as TRPCRuntimeConfigOptions, type SubscriptionProcedure as TRPCSubscriptionProcedure, type UnsetMarker as TRPCUnsetMarker, type Unwrap as TRPCUnwrap, type TRPC_ERROR_CODE_KEY, type TRPC_ERROR_CODE_NUMBER, type TrackedEnvelope, callProcedure as callTRPCProcedure, createFlatProxy as createTRPCFlatProxy, createRecursiveProxy as createTRPCRecursiveProxy, lazy as experimental_lazy, lazy, experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, getErrorShape, getErrorShape as getTRPCErrorShape, getTRPCErrorFromUnknown, type inferProcedureBuilderResolverOptions, type inferProcedureInput, type inferProcedureOutput, type inferRouterContext, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferSubscriptionInput, type inferSubscriptionOutput, type inferClientTypes as inferTRPCClientTypes, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, initTRPC, isTrackedEnvelope, sse, tracked, transformTRPCResponse };
|
|
9
|
+
export { type AnyMiddlewareFunction, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type AnyMutationProcedure, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyProcedure, type AnyProcedure as AnyTRPCProcedure, type AnyQueryProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type AnyRouter, type AnyRouter as AnyTRPCRouter, type AnySubscriptionProcedure, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, type AnyClientTypes as AnyTRPCClientTypes, type AnyRootTypes as AnyTRPCRootTypes, type CombinedDataTransformer, type CombinedDataTransformer as TRPCCombinedDataTransformer, type CreateContextCallback, type DataTransformer, type DataTransformer as TRPCDataTransformer, type DeepPartial, type Dict, type ProcedureType, type ProcedureType as TRPCProcedureType, StandardSchemaV1Error, type TRPCBuilder, type BuiltRouter as TRPCBuiltRouter, type CreateRouterOptions as TRPCCreateRouterOptions, type DecorateCreateRouterOptions as TRPCDecorateCreateRouterOptions, type DefaultErrorData as TRPCDefaultErrorData, type DefaultErrorShape as TRPCDefaultErrorShape, TRPCError, type ErrorFormatter as TRPCErrorFormatter, type TRPCErrorShape, type MergeRouters as TRPCMergeRouters, type MiddlewareBuilder as TRPCMiddlewareBuilder, type MiddlewareFunction as TRPCMiddlewareFunction, type MutationProcedure as TRPCMutationProcedure, type ProcedureBuilder as TRPCProcedureBuilder, type QueryProcedure as TRPCQueryProcedure, type RootConfig as TRPCRootConfig, type TRPCRootObject, type RouterBuilder as TRPCRouterBuilder, type RouterCaller as TRPCRouterCaller, type RouterCallerFactory as TRPCRouterCallerFactory, type RouterDef as TRPCRouterDef, type RouterRecord as TRPCRouterRecord, type RuntimeConfigOptions as TRPCRuntimeConfigOptions, type SubscriptionProcedure as TRPCSubscriptionProcedure, type UnsetMarker as TRPCUnsetMarker, type Unwrap as TRPCUnwrap, type TRPC_ERROR_CODE_KEY, type TRPC_ERROR_CODE_NUMBER, type TrackedEnvelope, callProcedure as callTRPCProcedure, createFlatProxy as createTRPCFlatProxy, createRecursiveProxy as createTRPCRecursiveProxy, lazy as experimental_lazy, lazy, experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, getErrorShape, getErrorShape as getTRPCErrorShape, getTRPCErrorFromUnknown, type inferProcedureBuilderResolverOptions, type inferProcedureErrorShape, type inferProcedureInput, type inferProcedureOutput, type inferRouterContext, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferSubscriptionInput, type inferSubscriptionOutput, type inferClientTypes as inferTRPCClientTypes, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, initTRPC, isTrackedEnvelope, sse, tracked, transformTRPCResponse };
|
|
10
10
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/@trpc/server/index.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/@trpc/server/index.ts"],"mappings":";;;;;;YAsJY,qBAAqB,sBAAsB,uBACrD,QAAQ,WAAW"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as
|
|
1
|
+
import { $n as inferRouterContext, B as inferRouterInputs, Cr as sse, F as getErrorShape, Fn as AnyRouter, Ft as MiddlewareFunction, Gt as DefaultErrorShape, H as inferTransformedProcedureOutput, I as createFlatProxy, In as BuiltRouter, J as inferClientTypes, Jn as RouterRecord, K as AnyClientTypes, Kn as RouterCallerFactory, Kt as ErrorFormatter, L as createRecursiveProxy, Ln as CreateRouterOptions, Nt as AnyMiddlewareFunction, Pt as MiddlewareBuilder, Q as AnySubscriptionProcedure, Qr as getTRPCErrorFromUnknown, Rn as DecorateCreateRouterOptions, Si as Unwrap, Sr as isTrackedEnvelope, U as inferTransformedSubscriptionOutput, Un as RouterBuilder, V as inferRouterOutputs, Vn as MergeRouters, Vt as experimental_standaloneMiddleware, Wn as RouterCaller, Wt as DefaultErrorData, X as AnyProcedure, Xr as TRPCError, Y as AnyMutationProcedure, Yn as callProcedure, Z as AnyQueryProcedure, ai as Dict, ar as AnyRootTypes, at as SubscriptionProcedure, br as TrackedEnvelope, cn as transformTRPCResponse, cr as RootConfig, er as inferRouterError, g as initTRPC, gn as TRPCErrorShape, h as TRPCRootObject, ii as DeepPartial, it as QueryProcedure, lt as inferSubscriptionInput, m as TRPCBuilder, mt as ProcedureBuilder, ni as TRPC_ERROR_CODE_NUMBER, o as StandardSchemaV1Error, or as CreateContextCallback, ot as inferProcedureInput, p as RuntimeConfigOptions, qn as RouterDef, rn as DataTransformer, rr as lazy, rt as ProcedureType, st as inferProcedureOutput, ti as TRPC_ERROR_CODE_KEY, tn as CombinedDataTransformer, tt as MutationProcedure, ut as inferSubscriptionOutput, vt as inferProcedureBuilderResolverOptions, wr as tracked, yt as UnsetMarker, z as inferProcedureErrorShape } from "./unstable-core-do-not-import-JE3NCpqt.mjs";
|
|
2
2
|
//#region src/@trpc/server/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated
|
|
@@ -6,5 +6,5 @@ import { B as inferRouterOutputs, Bn as inferSubscriptionOutput, Bt as DefaultEr
|
|
|
6
6
|
*/
|
|
7
7
|
export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> = Awaited<ReturnType<TFunction>>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { type AnyMiddlewareFunction, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type AnyMutationProcedure, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyProcedure, type AnyProcedure as AnyTRPCProcedure, type AnyQueryProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type AnyRouter, type AnyRouter as AnyTRPCRouter, type AnySubscriptionProcedure, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, type AnyClientTypes as AnyTRPCClientTypes, type AnyRootTypes as AnyTRPCRootTypes, type CombinedDataTransformer, type CombinedDataTransformer as TRPCCombinedDataTransformer, type CreateContextCallback, type DataTransformer, type DataTransformer as TRPCDataTransformer, type DeepPartial, type Dict, type ProcedureType, type ProcedureType as TRPCProcedureType, StandardSchemaV1Error, type TRPCBuilder, type BuiltRouter as TRPCBuiltRouter, type CreateRouterOptions as TRPCCreateRouterOptions, type DecorateCreateRouterOptions as TRPCDecorateCreateRouterOptions, type DefaultErrorData as TRPCDefaultErrorData, type DefaultErrorShape as TRPCDefaultErrorShape, TRPCError, type ErrorFormatter as TRPCErrorFormatter, type TRPCErrorShape, type MergeRouters as TRPCMergeRouters, type MiddlewareBuilder as TRPCMiddlewareBuilder, type MiddlewareFunction as TRPCMiddlewareFunction, type MutationProcedure as TRPCMutationProcedure, type ProcedureBuilder as TRPCProcedureBuilder, type QueryProcedure as TRPCQueryProcedure, type RootConfig as TRPCRootConfig, type TRPCRootObject, type RouterBuilder as TRPCRouterBuilder, type RouterCaller as TRPCRouterCaller, type RouterCallerFactory as TRPCRouterCallerFactory, type RouterDef as TRPCRouterDef, type RouterRecord as TRPCRouterRecord, type RuntimeConfigOptions as TRPCRuntimeConfigOptions, type SubscriptionProcedure as TRPCSubscriptionProcedure, type UnsetMarker as TRPCUnsetMarker, type Unwrap as TRPCUnwrap, type TRPC_ERROR_CODE_KEY, type TRPC_ERROR_CODE_NUMBER, type TrackedEnvelope, callProcedure as callTRPCProcedure, createFlatProxy as createTRPCFlatProxy, createRecursiveProxy as createTRPCRecursiveProxy, lazy as experimental_lazy, lazy, experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, getErrorShape, getErrorShape as getTRPCErrorShape, getTRPCErrorFromUnknown, type inferProcedureBuilderResolverOptions, type inferProcedureInput, type inferProcedureOutput, type inferRouterContext, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferSubscriptionInput, type inferSubscriptionOutput, type inferClientTypes as inferTRPCClientTypes, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, initTRPC, isTrackedEnvelope, sse, tracked, transformTRPCResponse };
|
|
9
|
+
export { type AnyMiddlewareFunction, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type AnyMutationProcedure, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyProcedure, type AnyProcedure as AnyTRPCProcedure, type AnyQueryProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type AnyRouter, type AnyRouter as AnyTRPCRouter, type AnySubscriptionProcedure, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, type AnyClientTypes as AnyTRPCClientTypes, type AnyRootTypes as AnyTRPCRootTypes, type CombinedDataTransformer, type CombinedDataTransformer as TRPCCombinedDataTransformer, type CreateContextCallback, type DataTransformer, type DataTransformer as TRPCDataTransformer, type DeepPartial, type Dict, type ProcedureType, type ProcedureType as TRPCProcedureType, StandardSchemaV1Error, type TRPCBuilder, type BuiltRouter as TRPCBuiltRouter, type CreateRouterOptions as TRPCCreateRouterOptions, type DecorateCreateRouterOptions as TRPCDecorateCreateRouterOptions, type DefaultErrorData as TRPCDefaultErrorData, type DefaultErrorShape as TRPCDefaultErrorShape, TRPCError, type ErrorFormatter as TRPCErrorFormatter, type TRPCErrorShape, type MergeRouters as TRPCMergeRouters, type MiddlewareBuilder as TRPCMiddlewareBuilder, type MiddlewareFunction as TRPCMiddlewareFunction, type MutationProcedure as TRPCMutationProcedure, type ProcedureBuilder as TRPCProcedureBuilder, type QueryProcedure as TRPCQueryProcedure, type RootConfig as TRPCRootConfig, type TRPCRootObject, type RouterBuilder as TRPCRouterBuilder, type RouterCaller as TRPCRouterCaller, type RouterCallerFactory as TRPCRouterCallerFactory, type RouterDef as TRPCRouterDef, type RouterRecord as TRPCRouterRecord, type RuntimeConfigOptions as TRPCRuntimeConfigOptions, type SubscriptionProcedure as TRPCSubscriptionProcedure, type UnsetMarker as TRPCUnsetMarker, type Unwrap as TRPCUnwrap, type TRPC_ERROR_CODE_KEY, type TRPC_ERROR_CODE_NUMBER, type TrackedEnvelope, callProcedure as callTRPCProcedure, createFlatProxy as createTRPCFlatProxy, createRecursiveProxy as createTRPCRecursiveProxy, lazy as experimental_lazy, lazy, experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, getErrorShape, getErrorShape as getTRPCErrorShape, getTRPCErrorFromUnknown, type inferProcedureBuilderResolverOptions, type inferProcedureErrorShape, type inferProcedureInput, type inferProcedureOutput, type inferRouterContext, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferSubscriptionInput, type inferSubscriptionOutput, type inferClientTypes as inferTRPCClientTypes, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, initTRPC, isTrackedEnvelope, sse, tracked, transformTRPCResponse };
|
|
10
10
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/@trpc/server/index.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/@trpc/server/index.ts"],"mappings":";;;;;;YAsJY,qBAAqB,sBAAsB,uBACrD,QAAQ,WAAW"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { g as createRecursiveProxy, h as createFlatProxy, t as getErrorShape } from "./getErrorShape-BziUKLM_.mjs";
|
|
2
|
+
import { _ as transformTRPCResponse, b as getTRPCErrorFromUnknown, c as callProcedure, f as lazy, i as tracked, n as isTrackedEnvelope, r as sse, v as TRPCError } from "./asyncGeneratorDelegate-mPyp1u6d.mjs";
|
|
3
|
+
import { d as experimental_standaloneMiddleware, o as StandardSchemaV1Error, t as initTRPC } from "./initTRPC-DpOypWK_.mjs";
|
|
4
4
|
export { StandardSchemaV1Error, TRPCError, callProcedure as callTRPCProcedure, createFlatProxy as createTRPCFlatProxy, createRecursiveProxy as createTRPCRecursiveProxy, lazy as experimental_lazy, lazy, experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, getErrorShape, getErrorShape as getTRPCErrorShape, getTRPCErrorFromUnknown, initTRPC, isTrackedEnvelope, sse, tracked, transformTRPCResponse };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const require_codes = require("./codes-
|
|
2
|
-
const require_getErrorShape = require("./getErrorShape-
|
|
3
|
-
const
|
|
1
|
+
const require_codes = require("./codes-BwD4QurF.cjs");
|
|
2
|
+
const require_getErrorShape = require("./getErrorShape-CVxLwJgN.cjs");
|
|
3
|
+
const require_asyncGeneratorDelegate = require("./asyncGeneratorDelegate-D2tFgl_z.cjs");
|
|
4
|
+
const require_observable = require("./observable-CIyO2eSm.cjs");
|
|
4
5
|
//#region src/unstable-core-do-not-import/middleware.ts
|
|
5
6
|
/** @internal */
|
|
6
7
|
const middlewareMarker = "middlewareMarker";
|
|
@@ -39,7 +40,7 @@ function createInputMiddleware(parse) {
|
|
|
39
40
|
try {
|
|
40
41
|
parsedInput = await parse(rawInput);
|
|
41
42
|
} catch (cause) {
|
|
42
|
-
throw new
|
|
43
|
+
throw new require_asyncGeneratorDelegate.TRPCError({
|
|
43
44
|
code: "BAD_REQUEST",
|
|
44
45
|
cause
|
|
45
46
|
});
|
|
@@ -53,6 +54,64 @@ function createInputMiddleware(parse) {
|
|
|
53
54
|
/**
|
|
54
55
|
* @internal
|
|
55
56
|
*/
|
|
57
|
+
function createErrorFormatterMiddleware(formatter, isDev) {
|
|
58
|
+
const errorMiddleware = async function errorFormatterMiddleware(opts) {
|
|
59
|
+
const tryFormat = (error) => {
|
|
60
|
+
if (require_getErrorShape.isFormattedErrorShape(error)) return error;
|
|
61
|
+
const shape = formatter({
|
|
62
|
+
error,
|
|
63
|
+
type: opts.type,
|
|
64
|
+
path: opts.path,
|
|
65
|
+
input: opts.input,
|
|
66
|
+
ctx: opts.ctx,
|
|
67
|
+
shape: require_getErrorShape.getDefaultErrorShape({
|
|
68
|
+
error,
|
|
69
|
+
path: opts.path,
|
|
70
|
+
isDev
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
if (shape !== void 0) require_getErrorShape.setFormattedErrorShape(error, shape);
|
|
74
|
+
return error;
|
|
75
|
+
};
|
|
76
|
+
const tryFormatThrown = (cause) => {
|
|
77
|
+
const formatted = tryFormat(require_asyncGeneratorDelegate.getTRPCErrorFromUnknown(cause));
|
|
78
|
+
return require_getErrorShape.isFormattedErrorShape(formatted) ? formatted : cause;
|
|
79
|
+
};
|
|
80
|
+
function wrapIterable(_x) {
|
|
81
|
+
return _wrapIterable.apply(this, arguments);
|
|
82
|
+
}
|
|
83
|
+
function _wrapIterable() {
|
|
84
|
+
_wrapIterable = require_asyncGeneratorDelegate._wrapAsyncGenerator(function* (iterable) {
|
|
85
|
+
try {
|
|
86
|
+
return yield* require_asyncGeneratorDelegate._asyncGeneratorDelegate(require_asyncGeneratorDelegate._asyncIterator(iterable));
|
|
87
|
+
} catch (cause) {
|
|
88
|
+
throw tryFormatThrown(cause);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return _wrapIterable.apply(this, arguments);
|
|
92
|
+
}
|
|
93
|
+
function wrapObservable(source) {
|
|
94
|
+
return require_observable.observable((observer) => source.subscribe({
|
|
95
|
+
next: (value) => observer.next(value),
|
|
96
|
+
error: (cause) => observer.error(tryFormatThrown(cause)),
|
|
97
|
+
complete: () => observer.complete()
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
const result = await opts.next();
|
|
101
|
+
if (!result.ok) {
|
|
102
|
+
tryFormat(result.error);
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
if (require_codes.isAsyncIterable(result.data)) return require_getErrorShape._objectSpread2(require_getErrorShape._objectSpread2({}, result), {}, { data: wrapIterable(result.data) });
|
|
106
|
+
if (opts.type === "subscription" && require_observable.isObservable(result.data)) return require_getErrorShape._objectSpread2(require_getErrorShape._objectSpread2({}, result), {}, { data: wrapObservable(result.data) });
|
|
107
|
+
return result;
|
|
108
|
+
};
|
|
109
|
+
errorMiddleware._type = "errors";
|
|
110
|
+
return errorMiddleware;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
56
115
|
function createOutputMiddleware(parse) {
|
|
57
116
|
const outputMiddleware = async function outputValidatorMiddleware({ next }) {
|
|
58
117
|
const result = await next();
|
|
@@ -61,7 +120,7 @@ function createOutputMiddleware(parse) {
|
|
|
61
120
|
const data = await parse(result.data);
|
|
62
121
|
return require_getErrorShape._objectSpread2(require_getErrorShape._objectSpread2({}, result), {}, { data });
|
|
63
122
|
} catch (cause) {
|
|
64
|
-
throw new
|
|
123
|
+
throw new require_asyncGeneratorDelegate.TRPCError({
|
|
65
124
|
message: "Output validation failed",
|
|
66
125
|
code: "INTERNAL_SERVER_ERROR",
|
|
67
126
|
cause
|
|
@@ -111,6 +170,22 @@ function getParseFn(procedureParser) {
|
|
|
111
170
|
throw new Error("Could not find a validator fn");
|
|
112
171
|
}
|
|
113
172
|
//#endregion
|
|
173
|
+
//#region src/unstable-core-do-not-import/rootConfig.ts
|
|
174
|
+
var _globalThis$process;
|
|
175
|
+
var _globalThis$process2;
|
|
176
|
+
var _globalThis$process3;
|
|
177
|
+
/**
|
|
178
|
+
* The default check to see if we're in a server
|
|
179
|
+
*/
|
|
180
|
+
const isServerDefault = typeof window === "undefined" || "Deno" in window || ((_globalThis$process = globalThis.process) === null || _globalThis$process === void 0 || (_globalThis$process = _globalThis$process.env) === null || _globalThis$process === void 0 ? void 0 : _globalThis$process["NODE_ENV"]) === "test" || !!((_globalThis$process2 = globalThis.process) === null || _globalThis$process2 === void 0 || (_globalThis$process2 = _globalThis$process2.env) === null || _globalThis$process2 === void 0 ? void 0 : _globalThis$process2["JEST_WORKER_ID"]) || !!((_globalThis$process3 = globalThis.process) === null || _globalThis$process3 === void 0 || (_globalThis$process3 = _globalThis$process3.env) === null || _globalThis$process3 === void 0 ? void 0 : _globalThis$process3["VITEST_WORKER_ID"]);
|
|
181
|
+
/**
|
|
182
|
+
* The default check to see if we're in development
|
|
183
|
+
*/
|
|
184
|
+
function isDevDefault() {
|
|
185
|
+
var _globalThis$process4;
|
|
186
|
+
return ((_globalThis$process4 = globalThis.process) === null || _globalThis$process4 === void 0 ? void 0 : _globalThis$process4.env["NODE_ENV"]) !== "production";
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
114
189
|
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
115
190
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
116
191
|
if (null == r) return {};
|
|
@@ -137,11 +212,14 @@ function _objectWithoutProperties(e, t) {
|
|
|
137
212
|
const _excluded = [
|
|
138
213
|
"middlewares",
|
|
139
214
|
"inputs",
|
|
140
|
-
"meta"
|
|
215
|
+
"meta",
|
|
216
|
+
"config"
|
|
141
217
|
];
|
|
142
218
|
function createNewBuilder(def1, def2) {
|
|
143
|
-
|
|
219
|
+
var _def1$config;
|
|
220
|
+
const { middlewares = [], inputs, meta, config } = def2, rest = _objectWithoutProperties(def2, _excluded);
|
|
144
221
|
return createBuilder(require_getErrorShape._objectSpread2(require_getErrorShape._objectSpread2({}, require_codes.mergeWithoutOverrides(def1, rest)), {}, {
|
|
222
|
+
config: (_def1$config = def1.config) !== null && _def1$config !== void 0 ? _def1$config : config,
|
|
145
223
|
inputs: [...def1.inputs, ...inputs !== null && inputs !== void 0 ? inputs : []],
|
|
146
224
|
middlewares: [...def1.middlewares, ...middlewares],
|
|
147
225
|
meta: def1.meta && meta ? require_getErrorShape._objectSpread2(require_getErrorShape._objectSpread2({}, def1.meta), meta) : meta !== null && meta !== void 0 ? meta : def1.meta
|
|
@@ -172,6 +250,10 @@ function createBuilder(initDef = {}) {
|
|
|
172
250
|
meta(meta) {
|
|
173
251
|
return createNewBuilder(_def, { meta });
|
|
174
252
|
},
|
|
253
|
+
errors(formatter) {
|
|
254
|
+
var _def$config$isDev, _def$config;
|
|
255
|
+
return createNewBuilder(_def, { middlewares: [createErrorFormatterMiddleware(formatter, (_def$config$isDev = (_def$config = _def.config) === null || _def$config === void 0 ? void 0 : _def$config.isDev) !== null && _def$config$isDev !== void 0 ? _def$config$isDev : isDevDefault())] });
|
|
256
|
+
},
|
|
175
257
|
use(middlewareBuilderOrFn) {
|
|
176
258
|
const middlewares = "_middlewares" in middlewareBuilderOrFn ? middlewareBuilderOrFn._middlewares : [middlewareBuilderOrFn];
|
|
177
259
|
return createNewBuilder(_def, { middlewares });
|
|
@@ -251,7 +333,7 @@ async function callRecursive(index, _def, opts) {
|
|
|
251
333
|
} catch (cause) {
|
|
252
334
|
return {
|
|
253
335
|
ok: false,
|
|
254
|
-
error:
|
|
336
|
+
error: require_asyncGeneratorDelegate.getTRPCErrorFromUnknown(cause),
|
|
255
337
|
marker: middlewareMarker
|
|
256
338
|
};
|
|
257
339
|
}
|
|
@@ -260,7 +342,7 @@ function createProcedureCaller(_def) {
|
|
|
260
342
|
async function procedure(opts) {
|
|
261
343
|
if (!opts || !("getRawInput" in opts)) throw new Error(codeblock);
|
|
262
344
|
const result = await callRecursive(0, _def, opts);
|
|
263
|
-
if (!result) throw new
|
|
345
|
+
if (!result) throw new require_asyncGeneratorDelegate.TRPCError({
|
|
264
346
|
code: "INTERNAL_SERVER_ERROR",
|
|
265
347
|
message: "No result from middlewares - did you forget to `return next()`?"
|
|
266
348
|
});
|
|
@@ -272,15 +354,6 @@ function createProcedureCaller(_def) {
|
|
|
272
354
|
procedure.meta = _def.meta;
|
|
273
355
|
return procedure;
|
|
274
356
|
}
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region src/unstable-core-do-not-import/rootConfig.ts
|
|
277
|
-
var _globalThis$process;
|
|
278
|
-
var _globalThis$process2;
|
|
279
|
-
var _globalThis$process3;
|
|
280
|
-
/**
|
|
281
|
-
* The default check to see if we're in a server
|
|
282
|
-
*/
|
|
283
|
-
const isServerDefault = typeof window === "undefined" || "Deno" in window || ((_globalThis$process = globalThis.process) === null || _globalThis$process === void 0 || (_globalThis$process = _globalThis$process.env) === null || _globalThis$process === void 0 ? void 0 : _globalThis$process["NODE_ENV"]) === "test" || !!((_globalThis$process2 = globalThis.process) === null || _globalThis$process2 === void 0 || (_globalThis$process2 = _globalThis$process2.env) === null || _globalThis$process2 === void 0 ? void 0 : _globalThis$process2["JEST_WORKER_ID"]) || !!((_globalThis$process3 = globalThis.process) === null || _globalThis$process3 === void 0 || (_globalThis$process3 = _globalThis$process3.env) === null || _globalThis$process3 === void 0 ? void 0 : _globalThis$process3["VITEST_WORKER_ID"]);
|
|
284
357
|
/**
|
|
285
358
|
* Builder to initialize the tRPC root object - use this exactly once per backend
|
|
286
359
|
* @see https://trpc.io/docs/v11/quickstart
|
|
@@ -305,12 +378,12 @@ const initTRPC = new class TRPCBuilder {
|
|
|
305
378
|
* @see https://trpc.io/docs/v11/server/routers#initialize-trpc
|
|
306
379
|
*/
|
|
307
380
|
create(opts) {
|
|
308
|
-
var _opts$transformer, _opts$isDev,
|
|
381
|
+
var _opts$transformer, _opts$isDev, _opts$allowOutsideOfS, _opts$errorFormatter, _opts$isServer;
|
|
309
382
|
const config = require_getErrorShape._objectSpread2(require_getErrorShape._objectSpread2({}, opts), {}, {
|
|
310
|
-
transformer:
|
|
311
|
-
isDev: (_opts$isDev = opts === null || opts === void 0 ? void 0 : opts.isDev) !== null && _opts$isDev !== void 0 ? _opts$isDev : (
|
|
383
|
+
transformer: require_asyncGeneratorDelegate.getDataTransformer((_opts$transformer = opts === null || opts === void 0 ? void 0 : opts.transformer) !== null && _opts$transformer !== void 0 ? _opts$transformer : require_asyncGeneratorDelegate.defaultTransformer),
|
|
384
|
+
isDev: (_opts$isDev = opts === null || opts === void 0 ? void 0 : opts.isDev) !== null && _opts$isDev !== void 0 ? _opts$isDev : isDevDefault(),
|
|
312
385
|
allowOutsideOfServer: (_opts$allowOutsideOfS = opts === null || opts === void 0 ? void 0 : opts.allowOutsideOfServer) !== null && _opts$allowOutsideOfS !== void 0 ? _opts$allowOutsideOfS : false,
|
|
313
|
-
errorFormatter: (_opts$errorFormatter = opts === null || opts === void 0 ? void 0 : opts.errorFormatter) !== null && _opts$errorFormatter !== void 0 ? _opts$errorFormatter :
|
|
386
|
+
errorFormatter: (_opts$errorFormatter = opts === null || opts === void 0 ? void 0 : opts.errorFormatter) !== null && _opts$errorFormatter !== void 0 ? _opts$errorFormatter : require_getErrorShape.defaultFormatter,
|
|
314
387
|
isServer: (_opts$isServer = opts === null || opts === void 0 ? void 0 : opts.isServer) !== null && _opts$isServer !== void 0 ? _opts$isServer : isServerDefault,
|
|
315
388
|
/**
|
|
316
389
|
* These are just types, they can't be used at runtime
|
|
@@ -330,7 +403,10 @@ const initTRPC = new class TRPCBuilder {
|
|
|
330
403
|
* Builder object for creating procedures
|
|
331
404
|
* @see https://trpc.io/docs/v11/server/procedures
|
|
332
405
|
*/
|
|
333
|
-
procedure: createBuilder({
|
|
406
|
+
procedure: createBuilder({
|
|
407
|
+
meta: opts === null || opts === void 0 ? void 0 : opts.defaultMeta,
|
|
408
|
+
config
|
|
409
|
+
}),
|
|
334
410
|
/**
|
|
335
411
|
* Create reusable middlewares
|
|
336
412
|
* @see https://trpc.io/docs/v11/server/middlewares
|
|
@@ -340,17 +416,17 @@ const initTRPC = new class TRPCBuilder {
|
|
|
340
416
|
* Create a router
|
|
341
417
|
* @see https://trpc.io/docs/v11/server/routers
|
|
342
418
|
*/
|
|
343
|
-
router:
|
|
419
|
+
router: require_asyncGeneratorDelegate.createRouterFactory(config),
|
|
344
420
|
/**
|
|
345
421
|
* Merge Routers
|
|
346
422
|
* @see https://trpc.io/docs/v11/server/merging-routers
|
|
347
423
|
*/
|
|
348
|
-
mergeRouters:
|
|
424
|
+
mergeRouters: require_asyncGeneratorDelegate.mergeRouters,
|
|
349
425
|
/**
|
|
350
426
|
* Create a server-side caller for a router
|
|
351
427
|
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
352
428
|
*/
|
|
353
|
-
createCallerFactory:
|
|
429
|
+
createCallerFactory: require_asyncGeneratorDelegate.createCallerFactory()
|
|
354
430
|
};
|
|
355
431
|
}
|
|
356
432
|
}();
|
|
@@ -367,6 +443,12 @@ Object.defineProperty(exports, "createBuilder", {
|
|
|
367
443
|
return createBuilder;
|
|
368
444
|
}
|
|
369
445
|
});
|
|
446
|
+
Object.defineProperty(exports, "createErrorFormatterMiddleware", {
|
|
447
|
+
enumerable: true,
|
|
448
|
+
get: function() {
|
|
449
|
+
return createErrorFormatterMiddleware;
|
|
450
|
+
}
|
|
451
|
+
});
|
|
370
452
|
Object.defineProperty(exports, "createInputMiddleware", {
|
|
371
453
|
enumerable: true,
|
|
372
454
|
get: function() {
|
|
@@ -403,6 +485,12 @@ Object.defineProperty(exports, "initTRPC", {
|
|
|
403
485
|
return initTRPC;
|
|
404
486
|
}
|
|
405
487
|
});
|
|
488
|
+
Object.defineProperty(exports, "isDevDefault", {
|
|
489
|
+
enumerable: true,
|
|
490
|
+
get: function() {
|
|
491
|
+
return isDevDefault;
|
|
492
|
+
}
|
|
493
|
+
});
|
|
406
494
|
Object.defineProperty(exports, "isServerDefault", {
|
|
407
495
|
enumerable: true,
|
|
408
496
|
get: function() {
|