@trpc/server 10.38.1 → 10.38.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/zodFileSchema/index.d.ts +1 -0
- package/adapters/zodFileSchema/index.js +1 -0
- package/dist/adapters/express.js +1 -1
- package/dist/adapters/express.mjs +1 -1
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fetch/index.js +1 -1
- package/dist/adapters/fetch/index.mjs +1 -1
- package/dist/adapters/next.js +1 -1
- package/dist/adapters/next.mjs +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/json/index.js +2 -2
- package/dist/adapters/node-http/content-type/json/index.mjs +2 -2
- package/dist/adapters/node-http/index.js +1 -1
- package/dist/adapters/node-http/index.mjs +1 -1
- package/dist/adapters/standalone.js +1 -1
- package/dist/adapters/standalone.mjs +1 -1
- package/package.json +3 -3
- package/src/adapters/fetch/fetchRequestHandler.ts +3 -4
- package/src/adapters/node-http/content-type/json/getPostBody.ts +2 -1
- package/src/adapters/node-http/content-type/json/index.ts +1 -1
- /package/dist/{nodeHTTPRequestHandler-70149627.js → nodeHTTPRequestHandler-4ca02710.js} +0 -0
- /package/dist/{nodeHTTPRequestHandler-2503a117.mjs → nodeHTTPRequestHandler-a3cc8c22.mjs} +0 -0
- /package/dist/{nodeHTTPRequestHandler-ec69aab4.js → nodeHTTPRequestHandler-d42348fa.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../dist/adapters/zodFileSchema';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../dist/adapters/zodFileSchema');
|
package/dist/adapters/express.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
5
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-4ca02710.js');
|
|
6
6
|
require('../index-784ff647.js');
|
|
7
7
|
require('../codes-87f6824b.js');
|
|
8
8
|
require('../resolveHTTPResponse-d21ca7c2.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
1
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-a3cc8c22.mjs';
|
|
2
2
|
import '../index-f91d720c.mjs';
|
|
3
3
|
import '../codes-c924c3db.mjs';
|
|
4
4
|
import '../resolveHTTPResponse-67085326.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,0BAA0B,CAAC,OAAO,SAAS,SAAS,IAC9D,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAC7B,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEJ,wBAAsB,mBAAmB,CAAC,OAAO,SAAS,SAAS,EACjE,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,GACxC,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,0BAA0B,CAAC,OAAO,SAAS,SAAS,IAC9D,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAC7B,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEJ,wBAAsB,mBAAmB,CAAC,OAAO,SAAS,SAAS,EACjE,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,GACxC,OAAO,CAAC,QAAQ,CAAC,CAmGnB"}
|
|
@@ -25,7 +25,7 @@ async function fetchRequestHandler(opts) {
|
|
|
25
25
|
query: url.searchParams,
|
|
26
26
|
method: opts.req.method,
|
|
27
27
|
headers: Object.fromEntries(opts.req.headers),
|
|
28
|
-
body: opts.req.headers.get('content-type')
|
|
28
|
+
body: opts.req.headers.get('content-type')?.startsWith('application/json') ? await opts.req.text() : ''
|
|
29
29
|
};
|
|
30
30
|
let resolve;
|
|
31
31
|
const promise = new Promise((r)=>resolve = r);
|
|
@@ -21,7 +21,7 @@ async function fetchRequestHandler(opts) {
|
|
|
21
21
|
query: url.searchParams,
|
|
22
22
|
method: opts.req.method,
|
|
23
23
|
headers: Object.fromEntries(opts.req.headers),
|
|
24
|
-
body: opts.req.headers.get('content-type')
|
|
24
|
+
body: opts.req.headers.get('content-type')?.startsWith('application/json') ? await opts.req.text() : ''
|
|
25
25
|
};
|
|
26
26
|
let resolve;
|
|
27
27
|
const promise = new Promise((r)=>resolve = r);
|
package/dist/adapters/next.js
CHANGED
|
@@ -4,7 +4,7 @@ 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-4ca02710.js');
|
|
8
8
|
require('../index-784ff647.js');
|
|
9
9
|
require('../codes-87f6824b.js');
|
|
10
10
|
require('../resolveHTTPResponse-d21ca7c2.js');
|
package/dist/adapters/next.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-a3cc8c22.mjs';
|
|
4
4
|
import '../index-f91d720c.mjs';
|
|
5
5
|
import '../codes-c924c3db.mjs';
|
|
6
6
|
import '../resolveHTTPResponse-67085326.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPostBody.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/node-http/content-type/json/getPostBody.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACtC,GAAG,EAAE,eAAe,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"getPostBody.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/node-http/content-type/json/getPostBody.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACtC,GAAG,EAAE,eAAe,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,UAAU,CAAC,CAkCtB"}
|
|
@@ -14,7 +14,7 @@ async function getPostBody(opts) {
|
|
|
14
14
|
ok: true,
|
|
15
15
|
data: req.body,
|
|
16
16
|
// If the request headers specifies a content-type, we assume that the body has been preprocessed
|
|
17
|
-
preprocessed: req.headers['content-type']
|
|
17
|
+
preprocessed: !!req.headers['content-type']?.startsWith('application/json')
|
|
18
18
|
});
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
@@ -45,7 +45,7 @@ async function getPostBody(opts) {
|
|
|
45
45
|
|
|
46
46
|
const nodeHTTPJSONContentTypeHandler = contentType.createNodeHTTPContentTypeHandler({
|
|
47
47
|
isMatch (opts) {
|
|
48
|
-
return opts.req.headers['content-type']
|
|
48
|
+
return !!opts.req.headers['content-type']?.startsWith('application/json');
|
|
49
49
|
},
|
|
50
50
|
getBody: getPostBody,
|
|
51
51
|
getInputs: contentType$1.getJsonContentTypeInputs
|
|
@@ -10,7 +10,7 @@ async function getPostBody(opts) {
|
|
|
10
10
|
ok: true,
|
|
11
11
|
data: req.body,
|
|
12
12
|
// If the request headers specifies a content-type, we assume that the body has been preprocessed
|
|
13
|
-
preprocessed: req.headers['content-type']
|
|
13
|
+
preprocessed: !!req.headers['content-type']?.startsWith('application/json')
|
|
14
14
|
});
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
@@ -41,7 +41,7 @@ async function getPostBody(opts) {
|
|
|
41
41
|
|
|
42
42
|
const nodeHTTPJSONContentTypeHandler = createNodeHTTPContentTypeHandler({
|
|
43
43
|
isMatch (opts) {
|
|
44
|
-
return opts.req.headers['content-type']
|
|
44
|
+
return !!opts.req.headers['content-type']?.startsWith('application/json');
|
|
45
45
|
},
|
|
46
46
|
getBody: getPostBody,
|
|
47
47
|
getInputs: getJsonContentTypeInputs
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-
|
|
5
|
+
var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-4ca02710.js');
|
|
6
6
|
require('../../index-784ff647.js');
|
|
7
7
|
require('../../codes-87f6824b.js');
|
|
8
8
|
require('../../resolveHTTPResponse-d21ca7c2.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-
|
|
1
|
+
export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-a3cc8c22.mjs';
|
|
2
2
|
import '../../index-f91d720c.mjs';
|
|
3
3
|
import '../../codes-c924c3db.mjs';
|
|
4
4
|
import '../../resolveHTTPResponse-67085326.mjs';
|
|
@@ -3,7 +3,7 @@
|
|
|
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-4ca02710.js');
|
|
7
7
|
require('../index-784ff647.js');
|
|
8
8
|
require('../codes-87f6824b.js');
|
|
9
9
|
require('../resolveHTTPResponse-d21ca7c2.js');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import http from 'node:http';
|
|
2
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
2
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-a3cc8c22.mjs';
|
|
3
3
|
import '../index-f91d720c.mjs';
|
|
4
4
|
import '../codes-c924c3db.mjs';
|
|
5
5
|
import '../resolveHTTPResponse-67085326.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "10.38.
|
|
3
|
+
"version": "10.38.2",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "rollup --config rollup.config.ts --configPlugin rollup-plugin-swc3",
|
|
34
34
|
"dev": "pnpm build --watch",
|
|
35
|
-
"codegen
|
|
35
|
+
"codegen-entrypoints": "tsx entrypoints.script.ts",
|
|
36
36
|
"benchmark": "tsc --project tsconfig.benchmark.json",
|
|
37
37
|
"lint": "eslint --cache --ext \".js,.ts,.tsx\" --ignore-path ../../.gitignore --report-unused-disable-directives src",
|
|
38
38
|
"ts-watch": "tsc --project tsconfig.watch.json"
|
|
@@ -174,5 +174,5 @@
|
|
|
174
174
|
"funding": [
|
|
175
175
|
"https://trpc.io/sponsor"
|
|
176
176
|
],
|
|
177
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "3ae64cc8b8c73306d6b022dec9eae769b246b0fb"
|
|
178
178
|
}
|
|
@@ -25,10 +25,9 @@ export async function fetchRequestHandler<TRouter extends AnyRouter>(
|
|
|
25
25
|
query: url.searchParams,
|
|
26
26
|
method: opts.req.method,
|
|
27
27
|
headers: Object.fromEntries(opts.req.headers),
|
|
28
|
-
body:
|
|
29
|
-
opts.req.
|
|
30
|
-
|
|
31
|
-
: '',
|
|
28
|
+
body: opts.req.headers.get('content-type')?.startsWith('application/json')
|
|
29
|
+
? await opts.req.text()
|
|
30
|
+
: '',
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
let resolve: (value: Response) => void;
|
|
@@ -13,7 +13,8 @@ export async function getPostBody(opts: {
|
|
|
13
13
|
ok: true,
|
|
14
14
|
data: req.body,
|
|
15
15
|
// If the request headers specifies a content-type, we assume that the body has been preprocessed
|
|
16
|
-
preprocessed:
|
|
16
|
+
preprocessed:
|
|
17
|
+
!!req.headers['content-type']?.startsWith('application/json'),
|
|
17
18
|
});
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
@@ -4,7 +4,7 @@ import { getPostBody } from './getPostBody';
|
|
|
4
4
|
|
|
5
5
|
export const nodeHTTPJSONContentTypeHandler = createNodeHTTPContentTypeHandler({
|
|
6
6
|
isMatch(opts) {
|
|
7
|
-
return opts.req.headers['content-type']
|
|
7
|
+
return !!opts.req.headers['content-type']?.startsWith('application/json');
|
|
8
8
|
},
|
|
9
9
|
getBody: getPostBody,
|
|
10
10
|
getInputs: getJsonContentTypeInputs,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|