@trpc/server 10.38.0 → 10.38.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/http/index.js +1 -1
- package/dist/http/index.mjs +1 -1
- package/dist/{nodeHTTPRequestHandler-842a1461.mjs → nodeHTTPRequestHandler-2503a117.mjs} +1 -1
- package/dist/{nodeHTTPRequestHandler-34adf7b8.js → nodeHTTPRequestHandler-70149627.js} +1 -1
- package/dist/{nodeHTTPRequestHandler-b7bc691f.js → nodeHTTPRequestHandler-ec69aab4.js} +1 -1
- package/dist/{resolveHTTPResponse-3aef2178.mjs → resolveHTTPResponse-67085326.mjs} +10 -1
- package/dist/{resolveHTTPResponse-d6110ed7.js → resolveHTTPResponse-a885ce7b.js} +10 -1
- package/dist/{resolveHTTPResponse-11792475.js → resolveHTTPResponse-d21ca7c2.js} +10 -1
- package/package.json +2 -2
- package/src/http/resolveHTTPResponse.ts +11 -1
- package/adapters/zodFileSchema/index.d.ts +0 -1
- package/adapters/zodFileSchema/index.js +0 -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-d21ca7c2.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-67085326.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-70149627.js');
|
|
6
6
|
require('../index-784ff647.js');
|
|
7
7
|
require('../codes-87f6824b.js');
|
|
8
|
-
require('../resolveHTTPResponse-
|
|
8
|
+
require('../resolveHTTPResponse-d21ca7c2.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-2503a117.mjs';
|
|
2
2
|
import '../index-f91d720c.mjs';
|
|
3
3
|
import '../codes-c924c3db.mjs';
|
|
4
|
-
import '../resolveHTTPResponse-
|
|
4
|
+
import '../resolveHTTPResponse-67085326.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-d21ca7c2.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-67085326.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-d21ca7c2.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-67085326.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-70149627.js');
|
|
8
8
|
require('../index-784ff647.js');
|
|
9
9
|
require('../codes-87f6824b.js');
|
|
10
|
-
require('../resolveHTTPResponse-
|
|
10
|
+
require('../resolveHTTPResponse-d21ca7c2.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-2503a117.mjs';
|
|
4
4
|
import '../index-f91d720c.mjs';
|
|
5
5
|
import '../codes-c924c3db.mjs';
|
|
6
|
-
import '../resolveHTTPResponse-
|
|
6
|
+
import '../resolveHTTPResponse-67085326.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-70149627.js');
|
|
6
6
|
require('../../index-784ff647.js');
|
|
7
7
|
require('../../codes-87f6824b.js');
|
|
8
|
-
require('../../resolveHTTPResponse-
|
|
8
|
+
require('../../resolveHTTPResponse-d21ca7c2.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-2503a117.mjs';
|
|
2
2
|
import '../../index-f91d720c.mjs';
|
|
3
3
|
import '../../codes-c924c3db.mjs';
|
|
4
|
-
import '../../resolveHTTPResponse-
|
|
4
|
+
import '../../resolveHTTPResponse-67085326.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-70149627.js');
|
|
7
7
|
require('../index-784ff647.js');
|
|
8
8
|
require('../codes-87f6824b.js');
|
|
9
|
-
require('../resolveHTTPResponse-
|
|
9
|
+
require('../resolveHTTPResponse-d21ca7c2.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-2503a117.mjs';
|
|
3
3
|
import '../index-f91d720c.mjs';
|
|
4
4
|
import '../codes-c924c3db.mjs';
|
|
5
|
-
import '../resolveHTTPResponse-
|
|
5
|
+
import '../resolveHTTPResponse-67085326.mjs';
|
|
6
6
|
import '../config-cd32070b.mjs';
|
|
7
7
|
import '../TRPCError-6a1653a4.mjs';
|
|
8
8
|
import '../transformTRPCResponse-1153b421.mjs';
|
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-d21ca7c2.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-67085326.mjs';
|
|
3
3
|
export { g as getBatchStreamFormatter } from '../batchStreamFormatter-fc1ffb26.mjs';
|
|
4
4
|
import '../codes-c924c3db.mjs';
|
|
5
5
|
import '../config-cd32070b.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './index-f91d720c.mjs';
|
|
2
|
-
import { r as resolveHTTPResponse } from './resolveHTTPResponse-
|
|
2
|
+
import { r as resolveHTTPResponse } from './resolveHTTPResponse-67085326.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,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-d21ca7c2.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-46cb3130.js';
|
|
2
|
-
import { r as resolveHTTPResponse } from './resolveHTTPResponse-
|
|
2
|
+
import { r as resolveHTTPResponse } from './resolveHTTPResponse-a885ce7b.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
|
|
|
@@ -129,6 +129,16 @@ async function resolveHTTPResponse(opts) {
|
|
|
129
129
|
const isBatchCall = !!req.query.get('batch');
|
|
130
130
|
const isStreamCall = isBatchCall && unstable_onHead && unstable_onChunk && req.headers['trpc-batch-mode'] === 'stream';
|
|
131
131
|
try {
|
|
132
|
+
// we create context first so that (unless `createContext()` throws)
|
|
133
|
+
// error handler may access context information
|
|
134
|
+
//
|
|
135
|
+
// this way even if the client sends malformed input that might cause an exception:
|
|
136
|
+
// - `opts.error` has value,
|
|
137
|
+
// - batching is not enabled,
|
|
138
|
+
// - `type` is unknown,
|
|
139
|
+
// - `getInputs` throws because of malformed JSON,
|
|
140
|
+
// context value is still available to the error handler
|
|
141
|
+
ctx = await opts.createContext();
|
|
132
142
|
if (opts.error) {
|
|
133
143
|
throw opts.error;
|
|
134
144
|
}
|
|
@@ -156,7 +166,6 @@ async function resolveHTTPResponse(opts) {
|
|
|
156
166
|
paths = isBatchCall ? decodeURIComponent(opts.path).split(',') : [
|
|
157
167
|
opts.path
|
|
158
168
|
];
|
|
159
|
-
ctx = await opts.createContext();
|
|
160
169
|
const promises = paths.map((path, index)=>inputToProcedureCall({
|
|
161
170
|
opts,
|
|
162
171
|
ctx,
|
|
@@ -125,6 +125,16 @@ async function resolveHTTPResponse(opts) {
|
|
|
125
125
|
unstable_onChunk &&
|
|
126
126
|
req.headers['trpc-batch-mode'] === 'stream';
|
|
127
127
|
try {
|
|
128
|
+
// we create context first so that (unless `createContext()` throws)
|
|
129
|
+
// error handler may access context information
|
|
130
|
+
//
|
|
131
|
+
// this way even if the client sends malformed input that might cause an exception:
|
|
132
|
+
// - `opts.error` has value,
|
|
133
|
+
// - batching is not enabled,
|
|
134
|
+
// - `type` is unknown,
|
|
135
|
+
// - `getInputs` throws because of malformed JSON,
|
|
136
|
+
// context value is still available to the error handler
|
|
137
|
+
ctx = await opts.createContext();
|
|
128
138
|
if (opts.error) {
|
|
129
139
|
throw opts.error;
|
|
130
140
|
}
|
|
@@ -153,7 +163,6 @@ async function resolveHTTPResponse(opts) {
|
|
|
153
163
|
paths = isBatchCall
|
|
154
164
|
? decodeURIComponent(opts.path).split(',')
|
|
155
165
|
: [opts.path];
|
|
156
|
-
ctx = await opts.createContext();
|
|
157
166
|
const promises = paths.map((path, index) => inputToProcedureCall({ opts, ctx, type, input: inputs[index], path }));
|
|
158
167
|
if (!isStreamCall) {
|
|
159
168
|
/**
|
|
@@ -131,6 +131,16 @@ async function resolveHTTPResponse(opts) {
|
|
|
131
131
|
const isBatchCall = !!req.query.get('batch');
|
|
132
132
|
const isStreamCall = isBatchCall && unstable_onHead && unstable_onChunk && req.headers['trpc-batch-mode'] === 'stream';
|
|
133
133
|
try {
|
|
134
|
+
// we create context first so that (unless `createContext()` throws)
|
|
135
|
+
// error handler may access context information
|
|
136
|
+
//
|
|
137
|
+
// this way even if the client sends malformed input that might cause an exception:
|
|
138
|
+
// - `opts.error` has value,
|
|
139
|
+
// - batching is not enabled,
|
|
140
|
+
// - `type` is unknown,
|
|
141
|
+
// - `getInputs` throws because of malformed JSON,
|
|
142
|
+
// context value is still available to the error handler
|
|
143
|
+
ctx = await opts.createContext();
|
|
134
144
|
if (opts.error) {
|
|
135
145
|
throw opts.error;
|
|
136
146
|
}
|
|
@@ -158,7 +168,6 @@ async function resolveHTTPResponse(opts) {
|
|
|
158
168
|
paths = isBatchCall ? decodeURIComponent(opts.path).split(',') : [
|
|
159
169
|
opts.path
|
|
160
170
|
];
|
|
161
|
-
ctx = await opts.createContext();
|
|
162
171
|
const promises = paths.map((path, index)=>inputToProcedureCall({
|
|
163
172
|
opts,
|
|
164
173
|
ctx,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "10.38.
|
|
3
|
+
"version": "10.38.1",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -174,5 +174,5 @@
|
|
|
174
174
|
"funding": [
|
|
175
175
|
"https://trpc.io/sponsor"
|
|
176
176
|
],
|
|
177
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "c48811ab55efbec8d1a9db778c46be2dc5c25818"
|
|
178
178
|
}
|
|
@@ -287,6 +287,17 @@ export async function resolveHTTPResponse<
|
|
|
287
287
|
req.headers['trpc-batch-mode'] === 'stream';
|
|
288
288
|
|
|
289
289
|
try {
|
|
290
|
+
// we create context first so that (unless `createContext()` throws)
|
|
291
|
+
// error handler may access context information
|
|
292
|
+
//
|
|
293
|
+
// this way even if the client sends malformed input that might cause an exception:
|
|
294
|
+
// - `opts.error` has value,
|
|
295
|
+
// - batching is not enabled,
|
|
296
|
+
// - `type` is unknown,
|
|
297
|
+
// - `getInputs` throws because of malformed JSON,
|
|
298
|
+
// context value is still available to the error handler
|
|
299
|
+
ctx = await opts.createContext();
|
|
300
|
+
|
|
290
301
|
if (opts.error) {
|
|
291
302
|
throw opts.error;
|
|
292
303
|
}
|
|
@@ -317,7 +328,6 @@ export async function resolveHTTPResponse<
|
|
|
317
328
|
paths = isBatchCall
|
|
318
329
|
? decodeURIComponent(opts.path).split(',')
|
|
319
330
|
: [opts.path];
|
|
320
|
-
ctx = await opts.createContext();
|
|
321
331
|
const promises = paths.map((path, index) =>
|
|
322
332
|
inputToProcedureCall({ opts, ctx, type, input: inputs[index], path }),
|
|
323
333
|
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/adapters/zodFileSchema';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../dist/adapters/zodFileSchema');
|