@trpc/server 10.36.0 → 10.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/aws-lambda/index.js +1 -1
- package/dist/adapters/aws-lambda/index.mjs +1 -1
- package/dist/adapters/express.js +2 -2
- package/dist/adapters/express.mjs +2 -2
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/fastify/index.mjs +1 -1
- package/dist/adapters/fetch/index.js +1 -1
- package/dist/adapters/fetch/index.mjs +1 -1
- package/dist/adapters/next.js +2 -2
- package/dist/adapters/next.mjs +2 -2
- package/dist/adapters/node-http/index.js +2 -2
- package/dist/adapters/node-http/index.mjs +2 -2
- package/dist/adapters/standalone.js +2 -2
- package/dist/adapters/standalone.mjs +2 -2
- package/dist/core/internals/getParseFn.d.ts.map +1 -1
- package/dist/core/parser.d.ts +7 -1
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/http/index.mjs +1 -1
- package/dist/index.js +6 -5
- package/dist/index.mjs +6 -5
- package/dist/{nodeHTTPRequestHandler-3038c41d.js → nodeHTTPRequestHandler-34adf7b8.js} +1 -1
- package/dist/{nodeHTTPRequestHandler-2b341e93.mjs → nodeHTTPRequestHandler-842a1461.mjs} +1 -1
- package/dist/{nodeHTTPRequestHandler-37bd2d87.js → nodeHTTPRequestHandler-b7bc691f.js} +1 -1
- package/dist/{resolveHTTPResponse-d73f215c.js → resolveHTTPResponse-11792475.js} +1 -1
- package/dist/{resolveHTTPResponse-8d917a7c.mjs → resolveHTTPResponse-3aef2178.mjs} +1 -1
- package/dist/{resolveHTTPResponse-f49de169.js → resolveHTTPResponse-d6110ed7.js} +3 -1
- package/package.json +3 -2
- package/src/core/internals/getParseFn.ts +6 -5
- package/src/core/parser.ts +10 -4
- package/src/http/resolveHTTPResponse.ts +3 -1
|
@@ -6,7 +6,7 @@ var TRPCError = require('../../TRPCError-d07099d1.js');
|
|
|
6
6
|
require('../../index-784ff647.js');
|
|
7
7
|
require('../../codes-87f6824b.js');
|
|
8
8
|
require('../../config-3156a1f1.js');
|
|
9
|
-
var resolveHTTPResponse = require('../../resolveHTTPResponse-
|
|
9
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-11792475.js');
|
|
10
10
|
require('../../transformTRPCResponse-e65f34e9.js');
|
|
11
11
|
require('../../contentType-5b601838.js');
|
|
12
12
|
|
|
@@ -2,7 +2,7 @@ import { T as TRPCError } from '../../TRPCError-6a1653a4.mjs';
|
|
|
2
2
|
import '../../index-f91d720c.mjs';
|
|
3
3
|
import '../../codes-c924c3db.mjs';
|
|
4
4
|
import '../../config-cd32070b.mjs';
|
|
5
|
-
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-
|
|
5
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-3aef2178.mjs';
|
|
6
6
|
import '../../transformTRPCResponse-1153b421.mjs';
|
|
7
7
|
import '../../contentType-53e30af8.mjs';
|
|
8
8
|
|
package/dist/adapters/express.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
5
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-34adf7b8.js');
|
|
6
6
|
require('../index-784ff647.js');
|
|
7
7
|
require('../codes-87f6824b.js');
|
|
8
|
-
require('../resolveHTTPResponse-
|
|
8
|
+
require('../resolveHTTPResponse-11792475.js');
|
|
9
9
|
require('../config-3156a1f1.js');
|
|
10
10
|
require('../TRPCError-d07099d1.js');
|
|
11
11
|
require('../transformTRPCResponse-e65f34e9.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
1
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-842a1461.mjs';
|
|
2
2
|
import '../index-f91d720c.mjs';
|
|
3
3
|
import '../codes-c924c3db.mjs';
|
|
4
|
-
import '../resolveHTTPResponse-
|
|
4
|
+
import '../resolveHTTPResponse-3aef2178.mjs';
|
|
5
5
|
import '../config-cd32070b.mjs';
|
|
6
6
|
import '../TRPCError-6a1653a4.mjs';
|
|
7
7
|
import '../transformTRPCResponse-1153b421.mjs';
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var node_stream = require('node:stream');
|
|
6
6
|
require('../../index-784ff647.js');
|
|
7
|
-
var resolveHTTPResponse = require('../../resolveHTTPResponse-
|
|
7
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-11792475.js');
|
|
8
8
|
var batchStreamFormatter = require('../../batchStreamFormatter-93cdcdd4.js');
|
|
9
9
|
var adapters_ws = require('../ws.js');
|
|
10
10
|
require('../../codes-87f6824b.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import '../../index-f91d720c.mjs';
|
|
3
|
-
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-
|
|
3
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-3aef2178.mjs';
|
|
4
4
|
import { g as getBatchStreamFormatter } from '../../batchStreamFormatter-fc1ffb26.mjs';
|
|
5
5
|
import { applyWSSHandler } from '../ws.mjs';
|
|
6
6
|
import '../../codes-c924c3db.mjs';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../index-784ff647.js');
|
|
6
|
-
var resolveHTTPResponse = require('../../resolveHTTPResponse-
|
|
6
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-11792475.js');
|
|
7
7
|
var batchStreamFormatter = require('../../batchStreamFormatter-93cdcdd4.js');
|
|
8
8
|
require('../../codes-87f6824b.js');
|
|
9
9
|
require('../../config-3156a1f1.js');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../../index-f91d720c.mjs';
|
|
2
|
-
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-
|
|
2
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-3aef2178.mjs';
|
|
3
3
|
import { g as getBatchStreamFormatter } from '../../batchStreamFormatter-fc1ffb26.mjs';
|
|
4
4
|
import '../../codes-c924c3db.mjs';
|
|
5
5
|
import '../../config-cd32070b.mjs';
|
package/dist/adapters/next.js
CHANGED
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var TRPCError = require('../TRPCError-d07099d1.js');
|
|
6
6
|
var transformTRPCResponse = require('../transformTRPCResponse-e65f34e9.js');
|
|
7
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
7
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-34adf7b8.js');
|
|
8
8
|
require('../index-784ff647.js');
|
|
9
9
|
require('../codes-87f6824b.js');
|
|
10
|
-
require('../resolveHTTPResponse-
|
|
10
|
+
require('../resolveHTTPResponse-11792475.js');
|
|
11
11
|
require('../config-3156a1f1.js');
|
|
12
12
|
require('../contentType-5b601838.js');
|
|
13
13
|
require('../batchStreamFormatter-93cdcdd4.js');
|
package/dist/adapters/next.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { T as TRPCError } from '../TRPCError-6a1653a4.mjs';
|
|
2
2
|
import { g as getErrorShape } from '../transformTRPCResponse-1153b421.mjs';
|
|
3
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
3
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-842a1461.mjs';
|
|
4
4
|
import '../index-f91d720c.mjs';
|
|
5
5
|
import '../codes-c924c3db.mjs';
|
|
6
|
-
import '../resolveHTTPResponse-
|
|
6
|
+
import '../resolveHTTPResponse-3aef2178.mjs';
|
|
7
7
|
import '../config-cd32070b.mjs';
|
|
8
8
|
import '../contentType-53e30af8.mjs';
|
|
9
9
|
import '../batchStreamFormatter-fc1ffb26.mjs';
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-
|
|
5
|
+
var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-34adf7b8.js');
|
|
6
6
|
require('../../index-784ff647.js');
|
|
7
7
|
require('../../codes-87f6824b.js');
|
|
8
|
-
require('../../resolveHTTPResponse-
|
|
8
|
+
require('../../resolveHTTPResponse-11792475.js');
|
|
9
9
|
require('../../config-3156a1f1.js');
|
|
10
10
|
require('../../TRPCError-d07099d1.js');
|
|
11
11
|
require('../../transformTRPCResponse-e65f34e9.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-
|
|
1
|
+
export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-842a1461.mjs';
|
|
2
2
|
import '../../index-f91d720c.mjs';
|
|
3
3
|
import '../../codes-c924c3db.mjs';
|
|
4
|
-
import '../../resolveHTTPResponse-
|
|
4
|
+
import '../../resolveHTTPResponse-3aef2178.mjs';
|
|
5
5
|
import '../../config-cd32070b.mjs';
|
|
6
6
|
import '../../TRPCError-6a1653a4.mjs';
|
|
7
7
|
import '../../transformTRPCResponse-1153b421.mjs';
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var http = require('node:http');
|
|
6
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
6
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-34adf7b8.js');
|
|
7
7
|
require('../index-784ff647.js');
|
|
8
8
|
require('../codes-87f6824b.js');
|
|
9
|
-
require('../resolveHTTPResponse-
|
|
9
|
+
require('../resolveHTTPResponse-11792475.js');
|
|
10
10
|
require('../config-3156a1f1.js');
|
|
11
11
|
require('../TRPCError-d07099d1.js');
|
|
12
12
|
require('../transformTRPCResponse-e65f34e9.js');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import http from 'node:http';
|
|
2
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
2
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-842a1461.mjs';
|
|
3
3
|
import '../index-f91d720c.mjs';
|
|
4
4
|
import '../codes-c924c3db.mjs';
|
|
5
|
-
import '../resolveHTTPResponse-
|
|
5
|
+
import '../resolveHTTPResponse-3aef2178.mjs';
|
|
6
6
|
import '../config-cd32070b.mjs';
|
|
7
7
|
import '../TRPCError-6a1653a4.mjs';
|
|
8
8
|
import '../transformTRPCResponse-1153b421.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getParseFn.d.ts","sourceRoot":"","sources":["../../../src/core/internals/getParseFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AAExE,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"getParseFn.d.ts","sourceRoot":"","sources":["../../../src/core/internals/getParseFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AAExE,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAsCzE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAC3C,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO,CAAC,KAAK,CAAC,CAKhB"}
|
package/dist/core/parser.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ export type ParserZodEsque<TInput, TParsedInput> = {
|
|
|
2
2
|
_input: TInput;
|
|
3
3
|
_output: TParsedInput;
|
|
4
4
|
};
|
|
5
|
+
export type ParserValibotEsque<TInput, TParsedInput> = {
|
|
6
|
+
types?: {
|
|
7
|
+
input: TInput;
|
|
8
|
+
output: TParsedInput;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
5
11
|
export type ParserMyZodEsque<TInput> = {
|
|
6
12
|
parse: (input: any) => TInput;
|
|
7
13
|
};
|
|
@@ -16,7 +22,7 @@ export type ParserScaleEsque<TInput> = {
|
|
|
16
22
|
assert(value: unknown): asserts value is TInput;
|
|
17
23
|
};
|
|
18
24
|
export type ParserWithoutInput<TInput> = ParserCustomValidatorEsque<TInput> | ParserMyZodEsque<TInput> | ParserScaleEsque<TInput> | ParserSuperstructEsque<TInput> | ParserYupEsque<TInput>;
|
|
19
|
-
export type ParserWithInputOutput<TInput, TParsedInput> = ParserZodEsque<TInput, TParsedInput>;
|
|
25
|
+
export type ParserWithInputOutput<TInput, TParsedInput> = ParserZodEsque<TInput, TParsedInput> | ParserValibotEsque<TInput, TParsedInput>;
|
|
20
26
|
export type Parser = ParserWithInputOutput<any, any> | ParserWithoutInput<any>;
|
|
21
27
|
export type inferParser<TParser extends Parser> = TParser extends ParserWithInputOutput<infer $TIn, infer $TOut> ? {
|
|
22
28
|
in: $TIn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/core/parser.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,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qB,CAAC,MAAM,IAAI,EAAE,MAAM,KAAK,CAAC,GAC1D;IACE,EAAE,EAAE,IAAI,CAAC;IACT,GAAG,EAAE,KAAK,CAAC;CACZ,GACD,OAAO,SAAS,kBAAkB,CAAC,MAAM,MAAM,CAAC,GAChD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb,GACD,KAAK,CAAC"}
|
package/dist/http/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var index = require('../index-784ff647.js');
|
|
6
|
-
var resolveHTTPResponse = require('../resolveHTTPResponse-
|
|
6
|
+
var resolveHTTPResponse = require('../resolveHTTPResponse-11792475.js');
|
|
7
7
|
var batchStreamFormatter = require('../batchStreamFormatter-93cdcdd4.js');
|
|
8
8
|
require('../codes-87f6824b.js');
|
|
9
9
|
require('../config-3156a1f1.js');
|
package/dist/http/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { T as TRPC_ERROR_CODES_BY_NUMBER, b as getHTTPStatusCode, g as getHTTPStatusCodeFromError } from '../index-f91d720c.mjs';
|
|
2
|
-
export { r as resolveHTTPResponse } from '../resolveHTTPResponse-
|
|
2
|
+
export { r as resolveHTTPResponse } from '../resolveHTTPResponse-3aef2178.mjs';
|
|
3
3
|
export { g as getBatchStreamFormatter } from '../batchStreamFormatter-fc1ffb26.mjs';
|
|
4
4
|
import '../codes-c924c3db.mjs';
|
|
5
5
|
import '../config-cd32070b.mjs';
|
package/dist/index.js
CHANGED
|
@@ -185,23 +185,24 @@ function createProcedure(opts) {
|
|
|
185
185
|
function getParseFn(procedureParser) {
|
|
186
186
|
const parser = procedureParser;
|
|
187
187
|
if (typeof parser === 'function') {
|
|
188
|
-
//
|
|
188
|
+
// ParserCustomValidatorEsque
|
|
189
189
|
return parser;
|
|
190
190
|
}
|
|
191
191
|
if (typeof parser.parseAsync === 'function') {
|
|
192
|
-
//
|
|
192
|
+
// ParserZodEsque
|
|
193
193
|
return parser.parseAsync.bind(parser);
|
|
194
194
|
}
|
|
195
195
|
if (typeof parser.parse === 'function') {
|
|
196
|
-
//
|
|
196
|
+
// ParserZodEsque
|
|
197
|
+
// ParserValibotEsque
|
|
197
198
|
return parser.parse.bind(parser);
|
|
198
199
|
}
|
|
199
200
|
if (typeof parser.validateSync === 'function') {
|
|
200
|
-
//
|
|
201
|
+
// ParserYupEsque
|
|
201
202
|
return parser.validateSync.bind(parser);
|
|
202
203
|
}
|
|
203
204
|
if (typeof parser.create === 'function') {
|
|
204
|
-
//
|
|
205
|
+
// ParserSuperstructEsque
|
|
205
206
|
return parser.create.bind(parser);
|
|
206
207
|
}
|
|
207
208
|
if (typeof parser.assert === 'function') {
|
package/dist/index.mjs
CHANGED
|
@@ -183,23 +183,24 @@ function createProcedure(opts) {
|
|
|
183
183
|
function getParseFn(procedureParser) {
|
|
184
184
|
const parser = procedureParser;
|
|
185
185
|
if (typeof parser === 'function') {
|
|
186
|
-
//
|
|
186
|
+
// ParserCustomValidatorEsque
|
|
187
187
|
return parser;
|
|
188
188
|
}
|
|
189
189
|
if (typeof parser.parseAsync === 'function') {
|
|
190
|
-
//
|
|
190
|
+
// ParserZodEsque
|
|
191
191
|
return parser.parseAsync.bind(parser);
|
|
192
192
|
}
|
|
193
193
|
if (typeof parser.parse === 'function') {
|
|
194
|
-
//
|
|
194
|
+
// ParserZodEsque
|
|
195
|
+
// ParserValibotEsque
|
|
195
196
|
return parser.parse.bind(parser);
|
|
196
197
|
}
|
|
197
198
|
if (typeof parser.validateSync === 'function') {
|
|
198
|
-
//
|
|
199
|
+
// ParserYupEsque
|
|
199
200
|
return parser.validateSync.bind(parser);
|
|
200
201
|
}
|
|
201
202
|
if (typeof parser.create === 'function') {
|
|
202
|
-
//
|
|
203
|
+
// ParserSuperstructEsque
|
|
203
204
|
return parser.create.bind(parser);
|
|
204
205
|
}
|
|
205
206
|
if (typeof parser.assert === 'function') {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('./index-784ff647.js');
|
|
4
|
-
var resolveHTTPResponse = require('./resolveHTTPResponse-
|
|
4
|
+
var resolveHTTPResponse = require('./resolveHTTPResponse-11792475.js');
|
|
5
5
|
var batchStreamFormatter = require('./batchStreamFormatter-93cdcdd4.js');
|
|
6
6
|
var adapters_nodeHttp_contentType_json_index = require('./adapters/node-http/content-type/json/index.js');
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './index-f91d720c.mjs';
|
|
2
|
-
import { r as resolveHTTPResponse } from './resolveHTTPResponse-
|
|
2
|
+
import { r as resolveHTTPResponse } from './resolveHTTPResponse-3aef2178.mjs';
|
|
3
3
|
import { g as getBatchStreamFormatter } from './batchStreamFormatter-fc1ffb26.mjs';
|
|
4
4
|
import { nodeHTTPJSONContentTypeHandler } from './adapters/node-http/content-type/json/index.mjs';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './index-46cb3130.js';
|
|
2
|
-
import { r as resolveHTTPResponse } from './resolveHTTPResponse-
|
|
2
|
+
import { r as resolveHTTPResponse } from './resolveHTTPResponse-d6110ed7.js';
|
|
3
3
|
import { g as getBatchStreamFormatter } from './batchStreamFormatter-2c1405a1.js';
|
|
4
4
|
import { nodeHTTPJSONContentTypeHandler } from './adapters/node-http/content-type/json/index.js';
|
|
5
5
|
|
|
@@ -155,7 +155,7 @@ async function resolveHTTPResponse(opts) {
|
|
|
155
155
|
router,
|
|
156
156
|
preprocessedBody: opts.preprocessedBody ?? false
|
|
157
157
|
});
|
|
158
|
-
paths = isBatchCall ? opts.path.split(',') : [
|
|
158
|
+
paths = isBatchCall ? decodeURIComponent(opts.path).split(',') : [
|
|
159
159
|
opts.path
|
|
160
160
|
];
|
|
161
161
|
ctx = await opts.createContext();
|
|
@@ -153,7 +153,7 @@ async function resolveHTTPResponse(opts) {
|
|
|
153
153
|
router,
|
|
154
154
|
preprocessedBody: opts.preprocessedBody ?? false
|
|
155
155
|
});
|
|
156
|
-
paths = isBatchCall ? opts.path.split(',') : [
|
|
156
|
+
paths = isBatchCall ? decodeURIComponent(opts.path).split(',') : [
|
|
157
157
|
opts.path
|
|
158
158
|
];
|
|
159
159
|
ctx = await opts.createContext();
|
|
@@ -150,7 +150,9 @@ async function resolveHTTPResponse(opts) {
|
|
|
150
150
|
router,
|
|
151
151
|
preprocessedBody: opts.preprocessedBody ?? false,
|
|
152
152
|
});
|
|
153
|
-
paths = isBatchCall
|
|
153
|
+
paths = isBatchCall
|
|
154
|
+
? decodeURIComponent(opts.path).split(',')
|
|
155
|
+
: [opts.path];
|
|
154
156
|
ctx = await opts.createContext();
|
|
155
157
|
const promises = paths.map((path, index) => inputToProcedureCall({ opts, ctx, type, input: inputs[index], path }));
|
|
156
158
|
if (!isStreamCall) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.37.1",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
"tslib": "^2.5.0",
|
|
166
166
|
"tsx": "^3.12.7",
|
|
167
167
|
"typescript": "^5.1.3",
|
|
168
|
+
"valibot": "^0.8.0",
|
|
168
169
|
"vitest": "^0.32.0",
|
|
169
170
|
"ws": "^8.0.0",
|
|
170
171
|
"yup": "^1.0.0",
|
|
@@ -173,5 +174,5 @@
|
|
|
173
174
|
"funding": [
|
|
174
175
|
"https://trpc.io/sponsor"
|
|
175
176
|
],
|
|
176
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "9ebca19eb2690d4717601d9d54f39e4ffeff369f"
|
|
177
178
|
}
|
|
@@ -6,27 +6,28 @@ export function getParseFn<TType>(procedureParser: Parser): ParseFn<TType> {
|
|
|
6
6
|
const parser = procedureParser as any;
|
|
7
7
|
|
|
8
8
|
if (typeof parser === 'function') {
|
|
9
|
-
//
|
|
9
|
+
// ParserCustomValidatorEsque
|
|
10
10
|
return parser;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
if (typeof parser.parseAsync === 'function') {
|
|
14
|
-
//
|
|
14
|
+
// ParserZodEsque
|
|
15
15
|
return parser.parseAsync.bind(parser);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
if (typeof parser.parse === 'function') {
|
|
19
|
-
//
|
|
19
|
+
// ParserZodEsque
|
|
20
|
+
// ParserValibotEsque
|
|
20
21
|
return parser.parse.bind(parser);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
if (typeof parser.validateSync === 'function') {
|
|
24
|
-
//
|
|
25
|
+
// ParserYupEsque
|
|
25
26
|
return parser.validateSync.bind(parser);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
if (typeof parser.create === 'function') {
|
|
29
|
-
//
|
|
30
|
+
// ParserSuperstructEsque
|
|
30
31
|
return parser.create.bind(parser);
|
|
31
32
|
}
|
|
32
33
|
|
package/src/core/parser.ts
CHANGED
|
@@ -3,6 +3,13 @@ export type ParserZodEsque<TInput, TParsedInput> = {
|
|
|
3
3
|
_output: TParsedInput;
|
|
4
4
|
};
|
|
5
5
|
|
|
6
|
+
export type ParserValibotEsque<TInput, TParsedInput> = {
|
|
7
|
+
types?: {
|
|
8
|
+
input: TInput;
|
|
9
|
+
output: TParsedInput;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
6
13
|
export type ParserMyZodEsque<TInput> = {
|
|
7
14
|
parse: (input: any) => TInput;
|
|
8
15
|
};
|
|
@@ -30,10 +37,9 @@ export type ParserWithoutInput<TInput> =
|
|
|
30
37
|
| ParserSuperstructEsque<TInput>
|
|
31
38
|
| ParserYupEsque<TInput>;
|
|
32
39
|
|
|
33
|
-
export type ParserWithInputOutput<TInput, TParsedInput> =
|
|
34
|
-
TInput,
|
|
35
|
-
TParsedInput
|
|
36
|
-
>;
|
|
40
|
+
export type ParserWithInputOutput<TInput, TParsedInput> =
|
|
41
|
+
| ParserZodEsque<TInput, TParsedInput>
|
|
42
|
+
| ParserValibotEsque<TInput, TParsedInput>;
|
|
37
43
|
|
|
38
44
|
export type Parser = ParserWithInputOutput<any, any> | ParserWithoutInput<any>;
|
|
39
45
|
|
|
@@ -314,7 +314,9 @@ export async function resolveHTTPResponse<
|
|
|
314
314
|
preprocessedBody: opts.preprocessedBody ?? false,
|
|
315
315
|
});
|
|
316
316
|
|
|
317
|
-
paths = isBatchCall
|
|
317
|
+
paths = isBatchCall
|
|
318
|
+
? decodeURIComponent(opts.path).split(',')
|
|
319
|
+
: [opts.path];
|
|
318
320
|
ctx = await opts.createContext();
|
|
319
321
|
const promises = paths.map((path, index) =>
|
|
320
322
|
inputToProcedureCall({ opts, ctx, type, input: inputs[index], path }),
|