@orpc/server 2.0.0-beta.40 → 2.0.0-beta.42
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/README.md +5 -5
- package/dist/adapters/aws-lambda/index.mjs +3 -3
- package/dist/adapters/crossws/index.mjs +3 -3
- package/dist/adapters/fastify/index.mjs +3 -3
- package/dist/adapters/fetch/index.d.mts +1 -1
- package/dist/adapters/fetch/index.d.ts +1 -1
- package/dist/adapters/fetch/index.mjs +3 -3
- package/dist/adapters/message-port/index.mjs +3 -3
- package/dist/adapters/node/index.d.mts +1 -1
- package/dist/adapters/node/index.d.ts +1 -1
- package/dist/adapters/node/index.mjs +3 -3
- package/dist/adapters/standard/index.d.mts +3 -3
- package/dist/adapters/standard/index.d.ts +3 -3
- package/dist/adapters/standard/index.mjs +3 -3
- package/dist/adapters/websocket/index.d.mts +1 -1
- package/dist/adapters/websocket/index.d.ts +1 -1
- package/dist/adapters/websocket/index.mjs +6 -4
- package/dist/extensions/callable.mjs +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +16 -22
- package/dist/plugins/index.d.mts +19 -7
- package/dist/plugins/index.d.ts +19 -7
- package/dist/plugins/index.mjs +92 -68
- package/dist/shared/{server.24nXyhbl.mjs → server.AVQWL-DI.mjs} +1 -1
- package/dist/shared/{server.BsujoJoF.d.ts → server.BEdOJs6S.d.mts} +3 -3
- package/dist/shared/{server.BsujoJoF.d.mts → server.BEdOJs6S.d.ts} +3 -3
- package/dist/shared/{server.C0lFtoHU.mjs → server.BFEVk-EI.mjs} +5 -5
- package/dist/shared/{server.BynNaBBA.mjs → server.BgvqVW_v.mjs} +3 -3
- package/dist/shared/{server.C7xllBNN.d.mts → server.BllfVJLm.d.mts} +2 -2
- package/dist/shared/{server.D0dr-F8u.d.ts → server.COfbQ0D8.d.ts} +2 -2
- package/dist/shared/{server.B5K1CViq.d.mts → server.CVO0hWyj.d.mts} +1 -1
- package/dist/shared/{server.BpmUhems.d.mts → server.DD1roZl9.d.mts} +1 -1
- package/dist/shared/{server.RRVK1xTV.d.ts → server.DFEuNUt4.d.ts} +2 -2
- package/dist/shared/{server.Cxranw-8.d.ts → server.DJNkZPfD.d.ts} +1 -1
- package/dist/shared/{server.CRwPbhLO.d.ts → server.DZeVx8K9.d.ts} +1 -1
- package/dist/shared/{server.Djb_ebJT.mjs → server.FEqy7Hrj.mjs} +2 -2
- package/dist/shared/{server.CFqSIFnT.d.mts → server.UG_xdTub.d.mts} +2 -2
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
85
85
|
|
|
86
86
|
<table>
|
|
87
87
|
<tr>
|
|
88
|
-
<td width="2000"><a href="https://screenshotone.com/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener" title="The screenshot API for developers"><img src="https://avatars.githubusercontent.com/u/97035603?v=4" width="64" align="left" hspace="12" alt="ScreenshotOne.com"/><b>ScreenshotOne.com</b></a><br /><sub>The screenshot API for developers</sub></td>
|
|
88
|
+
<td width="2000"><a href="https://screenshotone.com/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="The screenshot API for developers"><img src="https://avatars.githubusercontent.com/u/97035603?v=4" width="64" align="left" hspace="12" alt="ScreenshotOne.com"/><b>ScreenshotOne.com</b></a><br /><sub>The screenshot API for developers</sub></td>
|
|
89
89
|
</tr>
|
|
90
90
|
<tr>
|
|
91
91
|
<td width="2000"><a href="https://yuzu.health/careers?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="We're hiring NYC based engineers"><img src="https://avatars.githubusercontent.com/u/102488956?v=4" width="64" align="left" hspace="12" alt="Yuzu"/><b>Yuzu</b></a><br /><sub>We're hiring NYC based engineers</sub></td>
|
|
@@ -127,19 +127,18 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
127
127
|
<td align="center"><a href="https://soymilk.party/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="あわわわとーにゅ"><img src="https://avatars.githubusercontent.com/u/17376330?u=de3353804be889f009f7e0a1582daf04d0ab292d&v=4" width="139" alt="あわわわとーにゅ"/><br />あわわわとーにゅ</a></td>
|
|
128
128
|
<td align="center"><a href="https://github.com/nicognaW?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="nk"><img src="https://avatars.githubusercontent.com/u/66731869?u=4699bda3a9092d3ec34fbd959450767bcc8b8b6d&v=4" width="139" alt="nk"/><br />nk</a></td>
|
|
129
129
|
<td align="center"><a href="https://supastarter.dev/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="supastarter"><img src="https://avatars.githubusercontent.com/u/110960143?v=4" width="139" alt="supastarter"/><br />supastarter</a></td>
|
|
130
|
-
<td align="center"><a href="https://github.com/divmgl?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Dexter Miguel"><img src="https://avatars.githubusercontent.com/u/5452298?u=645993204be8696c085ecf0d228c3062efe2ed65&v=4" width="139" alt="Dexter Miguel"/><br />Dexter Miguel</a></td>
|
|
131
130
|
<td align="center"><a href="https://github.com/herrfugbaum?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="herrfugbaum"><img src="https://avatars.githubusercontent.com/u/12859776?u=644dc1666d0220bc0468eb0de3c56b919f635b16&v=4" width="139" alt="herrfugbaum"/><br />herrfugbaum</a></td>
|
|
131
|
+
<td align="center"><a href="https://laststance.io/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ryota Murakami"><img src="https://avatars.githubusercontent.com/u/5501268?u=599389e03340734325726ca3f8f423c021d47d7f&v=4" width="139" alt="Ryota Murakami"/><br />Ryota Murakami</a></td>
|
|
132
132
|
</tr>
|
|
133
133
|
<tr>
|
|
134
|
-
<td align="center"><a href="https://laststance.io/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ryota Murakami"><img src="https://avatars.githubusercontent.com/u/5501268?u=599389e03340734325726ca3f8f423c021d47d7f&v=4" width="139" alt="Ryota Murakami"/><br />Ryota Murakami</a></td>
|
|
135
134
|
<td align="center"><a href="https://cra.mr/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="David Cramer"><img src="https://avatars.githubusercontent.com/u/23610?v=4" width="139" alt="David Cramer"/><br />David Cramer</a></td>
|
|
136
135
|
<td align="center"><a href="https://valerii15298.github.io/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Valerii Petryniak"><img src="https://avatars.githubusercontent.com/u/44531564?u=88ac74d9bacd20401518441907acad21063cd397&v=4" width="139" alt="Valerii Petryniak"/><br />Valerii Petryniak</a></td>
|
|
137
136
|
<td align="center"><a href="https://letstri.dev/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Valerii Strilets"><img src="https://avatars.githubusercontent.com/u/13253748?u=c7b10399ccc8f8081e24db94ec32cd9858e86ac3&v=4" width="139" alt="Valerii Strilets"/><br />Valerii Strilets</a></td>
|
|
138
137
|
<td align="center"><a href="https://blacklight.sh/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Kyle Mistele"><img src="https://avatars.githubusercontent.com/u/18430555?u=3afebeb81de666e35aaac3ed46f14159d7603ffb&v=4" width="139" alt="Kyle Mistele"/><br />Kyle Mistele</a></td>
|
|
139
138
|
<td align="center"><a href="https://github.com/christ12938?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="christ12938"><img src="https://avatars.githubusercontent.com/u/25758598?v=4" width="139" alt="christ12938"/><br />christ12938</a></td>
|
|
139
|
+
<td align="center"><a href="https://github.com/Ryanjso?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
|
|
140
140
|
</tr>
|
|
141
141
|
<tr>
|
|
142
|
-
<td align="center"><a href="https://github.com/Ryanjso?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
|
|
143
142
|
<td align="center"><a href="https://github.com/itigoore01?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="shota"><img src="https://avatars.githubusercontent.com/u/11831107?u=c976a6dc7e055eb026304c46c99100ed22b0c8e0&v=4" width="139" alt="shota"/><br />shota</a></td>
|
|
144
143
|
<td align="center"><a href="https://github.com/ellis-driscoll?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ellis Driscoll"><img src="https://avatars.githubusercontent.com/u/70685966?u=c5f95bc33b5991d9744abe00052542e4a2ed3cb9&v=4" width="139" alt="Ellis Driscoll"/><br />Ellis Driscoll</a></td>
|
|
145
144
|
<td align="center"><a href="https://github.com/hoangbn?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Hoang Nguyen"><img src="https://avatars.githubusercontent.com/u/38968280?u=c90084c6de65c56facabab7ba13a72a49ddbc3e4&v=4" width="139" alt="Hoang Nguyen"/><br />Hoang Nguyen</a></td>
|
|
@@ -173,12 +172,13 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
173
172
|
<td align="center"><a href="https://kellychan.im/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Kelly Peilin Chan"><img src="https://avatars.githubusercontent.com/u/520852?u=6b0f7105f694e7b5cacf410a3f04c7044b469dc8&v=4" width="119" alt="Kelly Peilin Chan"/><br />Kelly Peilin Chan</a></td>
|
|
174
173
|
<td align="center"><a href="https://guyariely.com/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Guy Ariely"><img src="https://avatars.githubusercontent.com/u/42813496?u=edb6b7f563bf28e160a290832e7da57c0506f8ca&v=4" width="119" alt="Guy Ariely"/><br />Guy Ariely</a></td>
|
|
175
174
|
<td align="center"><a href="https://paulsenon.com/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="PaulSenon"><img src="https://avatars.githubusercontent.com/u/19531087?u=6385741eb91d200b8c513ec6045482e301767ca6&v=4" width="119" alt="PaulSenon"/><br />PaulSenon</a></td>
|
|
175
|
+
<td align="center"><a href="https://nakasyou.how/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Shotaro Nakamura"><img src="https://avatars.githubusercontent.com/u/79000684?u=f644df3f29f0e8677a90967115774564f1d9d6ab&v=4" width="119" alt="Shotaro Nakamura"/><br />Shotaro Nakamura</a></td>
|
|
176
176
|
<td align="center"><a href="https://piscis.dev/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Alex"><img src="https://avatars.githubusercontent.com/u/326163?u=b245f368bd940cf51d08c0b6bf55f8257f359437&v=4" width="119" alt="Alex"/><br />Alex</a></td>
|
|
177
177
|
<td align="center"><a href="https://opensource.gubanov.eu/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Andrey Gubanov"><img src="https://avatars.githubusercontent.com/u/1082083?u=c5f2daf7ebece498e85c83367bb37b4e10e2649d&v=4" width="119" alt="Andrey Gubanov"/><br />Andrey Gubanov</a></td>
|
|
178
178
|
</tr>
|
|
179
179
|
</table>
|
|
180
180
|
|
|
181
|
-
With thanks to [
|
|
181
|
+
With thanks to [38 past sponsors](https://orpc.dev/sponsors#past-sponsors) who helped get oRPC here.
|
|
182
182
|
|
|
183
183
|
## References
|
|
184
184
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
2
2
|
import { toStandardLazyRequest, sendStandardResponse } from '@standard-server/aws-lambda';
|
|
3
3
|
import { r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.W91HSRkE.mjs';
|
|
4
|
-
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.
|
|
4
|
+
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.BFEVk-EI.mjs';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@standard-server/core';
|
|
7
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.FEqy7Hrj.mjs';
|
|
8
8
|
import '@orpc/contract';
|
|
9
|
-
import '../../shared/server.
|
|
9
|
+
import '../../shared/server.BgvqVW_v.mjs';
|
|
10
10
|
|
|
11
11
|
class AwsLambdaHandler {
|
|
12
12
|
constructor(standardHandler, options = {}) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
2
2
|
import { ServerPeer, encodePeerMessage, decodePeerMessage, isClientPeerSendMessage } from '@standard-server/peer';
|
|
3
3
|
import { createStandardPeerRequestHandler } from '../standard-peer/index.mjs';
|
|
4
|
-
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.
|
|
4
|
+
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.BFEVk-EI.mjs';
|
|
5
5
|
import '../../shared/server.W91HSRkE.mjs';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@standard-server/core';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.FEqy7Hrj.mjs';
|
|
9
9
|
import '@orpc/contract';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.BgvqVW_v.mjs';
|
|
11
11
|
|
|
12
12
|
class experimental_CrosswsHandler {
|
|
13
13
|
constructor(handler, options = {}) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
2
2
|
import { toStandardLazyRequest, sendStandardResponse } from '@standard-server/fastify';
|
|
3
3
|
import { r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.W91HSRkE.mjs';
|
|
4
|
-
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.
|
|
4
|
+
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.BFEVk-EI.mjs';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@standard-server/core';
|
|
7
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.FEqy7Hrj.mjs';
|
|
8
8
|
import '@orpc/contract';
|
|
9
|
-
import '../../shared/server.
|
|
9
|
+
import '../../shared/server.BgvqVW_v.mjs';
|
|
10
10
|
|
|
11
11
|
class FastifyHandler {
|
|
12
12
|
constructor(standardHandler, options = {}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { R as BodyLimitPlugin } from '../../shared/server.
|
|
1
|
+
export { R as BodyLimitPlugin } from '../../shared/server.BllfVJLm.mjs';
|
|
2
2
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
3
3
|
import { ToFetchResponseOptions } from '@standard-server/fetch';
|
|
4
4
|
import { Context } from '../../index.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { R as BodyLimitPlugin } from '../../shared/server.
|
|
1
|
+
export { R as BodyLimitPlugin } from '../../shared/server.COfbQ0D8.js';
|
|
2
2
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
3
3
|
import { ToFetchResponseOptions } from '@standard-server/fetch';
|
|
4
4
|
import { Context } from '../../index.js';
|
|
@@ -2,12 +2,12 @@ export { R as BodyLimitPlugin } from '../../shared/server.1ExWFMze.mjs';
|
|
|
2
2
|
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
3
3
|
import { toStandardLazyRequest, toFetchResponse } from '@standard-server/fetch';
|
|
4
4
|
import { r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.W91HSRkE.mjs';
|
|
5
|
-
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.
|
|
5
|
+
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.BFEVk-EI.mjs';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@standard-server/core';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.FEqy7Hrj.mjs';
|
|
9
9
|
import '@orpc/contract';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.BgvqVW_v.mjs';
|
|
11
11
|
|
|
12
12
|
class FetchHandler {
|
|
13
13
|
constructor(standardHandler, options = {}) {
|
|
@@ -2,13 +2,13 @@ import { onMessagePortMessage, onMessagePortClose, postMessagePortMessage } from
|
|
|
2
2
|
import { value, resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
3
3
|
import { ServerPeer, encodePeerMessage, decodePeerMessage, isClientPeerSendMessage, isPeerMessage } from '@standard-server/peer';
|
|
4
4
|
import { createStandardPeerRequestHandler } from '../standard-peer/index.mjs';
|
|
5
|
-
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.
|
|
5
|
+
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.BFEVk-EI.mjs';
|
|
6
6
|
import '../../shared/server.W91HSRkE.mjs';
|
|
7
7
|
import '@orpc/client';
|
|
8
8
|
import '@standard-server/core';
|
|
9
|
-
import '../../shared/server.
|
|
9
|
+
import '../../shared/server.FEqy7Hrj.mjs';
|
|
10
10
|
import '@orpc/contract';
|
|
11
|
-
import '../../shared/server.
|
|
11
|
+
import '../../shared/server.BgvqVW_v.mjs';
|
|
12
12
|
|
|
13
13
|
class MessagePortHandler {
|
|
14
14
|
constructor(handler, options = {}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { R as BodyLimitPlugin } from '../../shared/server.
|
|
1
|
+
export { R as BodyLimitPlugin } from '../../shared/server.BllfVJLm.mjs';
|
|
2
2
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@standard-server/node';
|
|
4
4
|
import { Context } from '../../index.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { R as BodyLimitPlugin } from '../../shared/server.
|
|
1
|
+
export { R as BodyLimitPlugin } from '../../shared/server.COfbQ0D8.js';
|
|
2
2
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@standard-server/node';
|
|
4
4
|
import { Context } from '../../index.js';
|
|
@@ -2,13 +2,13 @@ export { R as BodyLimitPlugin } from '../../shared/server.1ExWFMze.mjs';
|
|
|
2
2
|
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
3
3
|
import { toStandardLazyRequest, sendStandardResponse } from '@standard-server/node';
|
|
4
4
|
import { r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.W91HSRkE.mjs';
|
|
5
|
-
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.
|
|
5
|
+
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.BFEVk-EI.mjs';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@standard-server/core';
|
|
8
8
|
import '@standard-server/fetch';
|
|
9
|
-
import '../../shared/server.
|
|
9
|
+
import '../../shared/server.FEqy7Hrj.mjs';
|
|
10
10
|
import '@orpc/contract';
|
|
11
|
-
import '../../shared/server.
|
|
11
|
+
import '../../shared/server.BgvqVW_v.mjs';
|
|
12
12
|
|
|
13
13
|
class NodeHttpHandler {
|
|
14
14
|
constructor(standardHandler, options = {}) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { R as ResolvedStandardHandlerHandleOptions, f as StandardHandlerCodec, g as StandardHandlerCodecResolvedProcedure } from '../../shared/server.
|
|
2
|
-
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, a as StandardHandlerHandleOptions, h as StandardHandlerHandleResult, i as StandardHandlerInterceptor, e as StandardHandlerInterceptorOptions, c as StandardHandlerOptions, b as StandardHandlerPlugin, j as StandardHandlerRoutingInterceptor, d as StandardHandlerRoutingInterceptorOptions, T as TracingHandlerPlugin } from '../../shared/server.
|
|
1
|
+
import { R as ResolvedStandardHandlerHandleOptions, f as StandardHandlerCodec, g as StandardHandlerCodecResolvedProcedure } from '../../shared/server.CVO0hWyj.mjs';
|
|
2
|
+
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, a as StandardHandlerHandleOptions, h as StandardHandlerHandleResult, i as StandardHandlerInterceptor, e as StandardHandlerInterceptorOptions, c as StandardHandlerOptions, b as StandardHandlerPlugin, j as StandardHandlerRoutingInterceptor, d as StandardHandlerRoutingInterceptorOptions, T as TracingHandlerPlugin } from '../../shared/server.CVO0hWyj.mjs';
|
|
3
3
|
import { RPCSerializer, AnyORPCError } from '@orpc/client';
|
|
4
4
|
import { Value, Public, Promisable } from '@orpc/shared';
|
|
5
5
|
import { StandardMethod, StandardLazyRequest, StandardResponse } from '@standard-server/core';
|
|
6
6
|
import { AnyProcedure, Context } from '../../index.mjs';
|
|
7
7
|
import { AnyRouter } from '../../index.mjs';
|
|
8
8
|
import { AnyProcedureContract } from '@orpc/contract';
|
|
9
|
-
export { F as FriendlyStandardHandlerHandleOptions, r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.
|
|
9
|
+
export { F as FriendlyStandardHandlerHandleOptions, r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.UG_xdTub.mjs';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Methods that can invoke procedures by default. Browsers cannot trigger them
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { R as ResolvedStandardHandlerHandleOptions, f as StandardHandlerCodec, g as StandardHandlerCodecResolvedProcedure } from '../../shared/server.
|
|
2
|
-
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, a as StandardHandlerHandleOptions, h as StandardHandlerHandleResult, i as StandardHandlerInterceptor, e as StandardHandlerInterceptorOptions, c as StandardHandlerOptions, b as StandardHandlerPlugin, j as StandardHandlerRoutingInterceptor, d as StandardHandlerRoutingInterceptorOptions, T as TracingHandlerPlugin } from '../../shared/server.
|
|
1
|
+
import { R as ResolvedStandardHandlerHandleOptions, f as StandardHandlerCodec, g as StandardHandlerCodecResolvedProcedure } from '../../shared/server.DJNkZPfD.js';
|
|
2
|
+
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, a as StandardHandlerHandleOptions, h as StandardHandlerHandleResult, i as StandardHandlerInterceptor, e as StandardHandlerInterceptorOptions, c as StandardHandlerOptions, b as StandardHandlerPlugin, j as StandardHandlerRoutingInterceptor, d as StandardHandlerRoutingInterceptorOptions, T as TracingHandlerPlugin } from '../../shared/server.DJNkZPfD.js';
|
|
3
3
|
import { RPCSerializer, AnyORPCError } from '@orpc/client';
|
|
4
4
|
import { Value, Public, Promisable } from '@orpc/shared';
|
|
5
5
|
import { StandardMethod, StandardLazyRequest, StandardResponse } from '@standard-server/core';
|
|
6
6
|
import { AnyProcedure, Context } from '../../index.js';
|
|
7
7
|
import { AnyRouter } from '../../index.js';
|
|
8
8
|
import { AnyProcedureContract } from '@orpc/contract';
|
|
9
|
-
export { F as FriendlyStandardHandlerHandleOptions, r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.
|
|
9
|
+
export { F as FriendlyStandardHandlerHandleOptions, r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.DFEuNUt4.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Methods that can invoke procedures by default. Browsers cannot trigger them
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, R as RPCHandlerCodec, a as RPCMatcher, b as RPC_DEFAULT_ALLOW_METHODS, S as StandardHandler, T as TracingHandlerPlugin } from '../../shared/server.
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, R as RPCHandlerCodec, a as RPCMatcher, b as RPC_DEFAULT_ALLOW_METHODS, S as StandardHandler, T as TracingHandlerPlugin } from '../../shared/server.BFEVk-EI.mjs';
|
|
2
2
|
export { r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.W91HSRkE.mjs';
|
|
3
3
|
import '@orpc/client';
|
|
4
4
|
import '@orpc/shared';
|
|
5
5
|
import '@standard-server/core';
|
|
6
|
-
import '../../shared/server.
|
|
6
|
+
import '../../shared/server.FEqy7Hrj.mjs';
|
|
7
7
|
import '@orpc/contract';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.BgvqVW_v.mjs';
|
|
@@ -54,7 +54,7 @@ declare class WebSocketHandler<T extends Context> {
|
|
|
54
54
|
*/
|
|
55
55
|
close(ws: WebSocketLike): Promise<void>;
|
|
56
56
|
/**
|
|
57
|
-
* Attaches message and
|
|
57
|
+
* Attaches message, close, and error event listeners to a WebSocket.
|
|
58
58
|
*
|
|
59
59
|
* Prefer this over calling `.message()` and `.close()` manually.
|
|
60
60
|
*/
|
|
@@ -54,7 +54,7 @@ declare class WebSocketHandler<T extends Context> {
|
|
|
54
54
|
*/
|
|
55
55
|
close(ws: WebSocketLike): Promise<void>;
|
|
56
56
|
/**
|
|
57
|
-
* Attaches message and
|
|
57
|
+
* Attaches message, close, and error event listeners to a WebSocket.
|
|
58
58
|
*
|
|
59
59
|
* Prefer this over calling `.message()` and `.close()` manually.
|
|
60
60
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { toStringOrBytes, resolveMaybeOptionalOptions, sequential, loadBytes } from '@orpc/shared';
|
|
2
2
|
import { ServerPeer, encodePeerMessage, decodePeerMessage, isClientPeerSendMessage } from '@standard-server/peer';
|
|
3
3
|
import { createStandardPeerRequestHandler } from '../standard-peer/index.mjs';
|
|
4
|
-
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.
|
|
4
|
+
import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.BFEVk-EI.mjs';
|
|
5
5
|
import '../../shared/server.W91HSRkE.mjs';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@standard-server/core';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.FEqy7Hrj.mjs';
|
|
9
9
|
import '@orpc/contract';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.BgvqVW_v.mjs';
|
|
11
11
|
|
|
12
12
|
class WebSocketHandler {
|
|
13
13
|
constructor(handler, options = {}) {
|
|
@@ -61,7 +61,7 @@ class WebSocketHandler {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* Attaches message and
|
|
64
|
+
* Attaches message, close, and error event listeners to a WebSocket.
|
|
65
65
|
*
|
|
66
66
|
* Prefer this over calling `.message()` and `.close()` manually.
|
|
67
67
|
*/
|
|
@@ -71,6 +71,8 @@ class WebSocketHandler {
|
|
|
71
71
|
this.message(ws, data, ...rest);
|
|
72
72
|
}));
|
|
73
73
|
ws.addEventListener("close", () => this.close(ws));
|
|
74
|
+
ws.addEventListener("error", () => {
|
|
75
|
+
});
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createProcedureClient } from '../shared/server.
|
|
2
|
-
import { D as DecoratedProcedure } from '../shared/server.
|
|
1
|
+
import { c as createProcedureClient } from '../shared/server.FEqy7Hrj.mjs';
|
|
2
|
+
import { D as DecoratedProcedure } from '../shared/server.AVQWL-DI.mjs';
|
|
3
3
|
import '@orpc/client';
|
|
4
4
|
import '@orpc/contract';
|
|
5
5
|
import '@orpc/shared';
|
package/dist/index.d.mts
CHANGED
|
@@ -2,10 +2,10 @@ import { ErrorMap, MergedErrorMap, AnySchema, MetaPlugin, InferSchemaOutput, Inf
|
|
|
2
2
|
export { AnyMetaPlugin, AnySchema, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InitialInputSchema, InitialOutputSchema, MergedErrorMap, Meta, MetaPlugin, MetaPluginDefinition, ORPCErrorConstructorMap, ORPCErrorConstructorMapItem, ORPCErrorConstructorMapItemOptions, ORPCErrorFactory, ORPCErrorFactoryOptions, ORPCErrorFromErrorMap, ProcedureContract, ProcedureContractDefinition, RouterContract, Schema, ValidationError, asyncIteratorObject, defineMeta, error, eventIterator, reconcileORPCError, type } from '@orpc/contract';
|
|
3
3
|
import { IntersectPick, Promisable, Public, PromiseWithError, ThrowableError, MaybeOptionalOptions } from '@orpc/shared';
|
|
4
4
|
export { AsyncCleanupFn, AsyncIteratorClass, AsyncIteratorClassNextFn, MaybeOptionalOptions, PromiseWithError, Registry, ThrowableError, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, asyncIteratorToStream as eventIteratorToStream, asyncIteratorToUnproxiedDataStream as eventIteratorToUnproxiedDataStream, onAsyncIteratorObjectError, onError, onFinish, onReadableStreamError, onStart, onSuccess, streamToAsyncIteratorObject, streamToAsyncIteratorObject as streamToEventIterator } from '@orpc/shared';
|
|
5
|
-
import { C as Context, d as Middleware, M as MergedContext, e as MergedInitialContext, a as Procedure, f as ProcedureConfig, g as AnyMiddleware, h as Lazy, A as AnyProcedure, L as Lazyable, i as ProcedureHandler, O as OrderedMiddleware, P as ProcedureClientOptions, b as ProcedureClient } from './shared/server.
|
|
6
|
-
export { j as LazyDefinition, k as MiddlewareDefinition, l as MiddlewareDone, m as MiddlewareDoneOptions, n as MiddlewareNext, o as MiddlewareNextOptions, p as MiddlewareOptions, q as MiddlewareResult, c as ProcedureClientInterceptor, r as ProcedureClientInterceptorOptions, s as ProcedureDefinition, t as ProcedureHandlerOptions, u as createProcedureClient, v as unlazy } from './shared/server.
|
|
7
|
-
import { A as AnyRouter, R as Router, C as ContractedRouter, I as InferRouterInitialContext } from './shared/server.
|
|
8
|
-
export { a as InferRouterCurrentContexts, b as InferRouterError, c as InferRouterErrors, a as InferRouterFinalContexts, d as InferRouterInitialContexts, e as InferRouterInputs, f as InferRouterOutputs } from './shared/server.
|
|
5
|
+
import { C as Context, d as Middleware, M as MergedContext, e as MergedInitialContext, a as Procedure, f as ProcedureConfig, g as AnyMiddleware, h as Lazy, A as AnyProcedure, L as Lazyable, i as ProcedureHandler, O as OrderedMiddleware, P as ProcedureClientOptions, b as ProcedureClient } from './shared/server.BEdOJs6S.mjs';
|
|
6
|
+
export { j as LazyDefinition, k as MiddlewareDefinition, l as MiddlewareDone, m as MiddlewareDoneOptions, n as MiddlewareNext, o as MiddlewareNextOptions, p as MiddlewareOptions, q as MiddlewareResult, c as ProcedureClientInterceptor, r as ProcedureClientInterceptorOptions, s as ProcedureDefinition, t as ProcedureHandlerOptions, u as createProcedureClient, v as unlazy } from './shared/server.BEdOJs6S.mjs';
|
|
7
|
+
import { A as AnyRouter, R as Router, C as ContractedRouter, I as InferRouterInitialContext } from './shared/server.DD1roZl9.mjs';
|
|
8
|
+
export { a as InferRouterCurrentContexts, b as InferRouterError, c as InferRouterErrors, a as InferRouterFinalContexts, d as InferRouterInitialContexts, e as InferRouterInputs, f as InferRouterOutputs } from './shared/server.DD1roZl9.mjs';
|
|
9
9
|
import { ClientOptions, ClientContext } from '@orpc/client';
|
|
10
10
|
export { AnyORPCError, AnyORPCErrorJSON, COMMON_ERROR_STATUS_MAP, Client, ClientContext, ClientOptions, ClientRest, FriendlyClientOptions, ORPCError, ORPCErrorCode, ORPCErrorJSON, ORPCErrorOptions, RPCJsonSerialization, RPCJsonSerializationMeta, RPCJsonSerializer, RPCJsonSerializerHandler, RPCJsonSerializerOptions, RPCSerializer, RPCSerializerOptions, RPCSerializerSerializeOptions, SafeResult, cloneORPCError, isDefinedError, safe, toORPCError } from '@orpc/client';
|
|
11
11
|
export { ErrorEvent, EventMeta, StandardBody, StandardBodyHint, StandardHeaders, StandardLazyRequest, StandardLazyResponse, StandardMethod, StandardRequest, StandardResponse, StandardUrl, getEventMeta, unwrapEvent, withEventMeta } from '@standard-server/core';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { ErrorMap, MergedErrorMap, AnySchema, MetaPlugin, InferSchemaOutput, Inf
|
|
|
2
2
|
export { AnyMetaPlugin, AnySchema, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InitialInputSchema, InitialOutputSchema, MergedErrorMap, Meta, MetaPlugin, MetaPluginDefinition, ORPCErrorConstructorMap, ORPCErrorConstructorMapItem, ORPCErrorConstructorMapItemOptions, ORPCErrorFactory, ORPCErrorFactoryOptions, ORPCErrorFromErrorMap, ProcedureContract, ProcedureContractDefinition, RouterContract, Schema, ValidationError, asyncIteratorObject, defineMeta, error, eventIterator, reconcileORPCError, type } from '@orpc/contract';
|
|
3
3
|
import { IntersectPick, Promisable, Public, PromiseWithError, ThrowableError, MaybeOptionalOptions } from '@orpc/shared';
|
|
4
4
|
export { AsyncCleanupFn, AsyncIteratorClass, AsyncIteratorClassNextFn, MaybeOptionalOptions, PromiseWithError, Registry, ThrowableError, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, asyncIteratorToStream as eventIteratorToStream, asyncIteratorToUnproxiedDataStream as eventIteratorToUnproxiedDataStream, onAsyncIteratorObjectError, onError, onFinish, onReadableStreamError, onStart, onSuccess, streamToAsyncIteratorObject, streamToAsyncIteratorObject as streamToEventIterator } from '@orpc/shared';
|
|
5
|
-
import { C as Context, d as Middleware, M as MergedContext, e as MergedInitialContext, a as Procedure, f as ProcedureConfig, g as AnyMiddleware, h as Lazy, A as AnyProcedure, L as Lazyable, i as ProcedureHandler, O as OrderedMiddleware, P as ProcedureClientOptions, b as ProcedureClient } from './shared/server.
|
|
6
|
-
export { j as LazyDefinition, k as MiddlewareDefinition, l as MiddlewareDone, m as MiddlewareDoneOptions, n as MiddlewareNext, o as MiddlewareNextOptions, p as MiddlewareOptions, q as MiddlewareResult, c as ProcedureClientInterceptor, r as ProcedureClientInterceptorOptions, s as ProcedureDefinition, t as ProcedureHandlerOptions, u as createProcedureClient, v as unlazy } from './shared/server.
|
|
7
|
-
import { A as AnyRouter, R as Router, C as ContractedRouter, I as InferRouterInitialContext } from './shared/server.
|
|
8
|
-
export { a as InferRouterCurrentContexts, b as InferRouterError, c as InferRouterErrors, a as InferRouterFinalContexts, d as InferRouterInitialContexts, e as InferRouterInputs, f as InferRouterOutputs } from './shared/server.
|
|
5
|
+
import { C as Context, d as Middleware, M as MergedContext, e as MergedInitialContext, a as Procedure, f as ProcedureConfig, g as AnyMiddleware, h as Lazy, A as AnyProcedure, L as Lazyable, i as ProcedureHandler, O as OrderedMiddleware, P as ProcedureClientOptions, b as ProcedureClient } from './shared/server.BEdOJs6S.js';
|
|
6
|
+
export { j as LazyDefinition, k as MiddlewareDefinition, l as MiddlewareDone, m as MiddlewareDoneOptions, n as MiddlewareNext, o as MiddlewareNextOptions, p as MiddlewareOptions, q as MiddlewareResult, c as ProcedureClientInterceptor, r as ProcedureClientInterceptorOptions, s as ProcedureDefinition, t as ProcedureHandlerOptions, u as createProcedureClient, v as unlazy } from './shared/server.BEdOJs6S.js';
|
|
7
|
+
import { A as AnyRouter, R as Router, C as ContractedRouter, I as InferRouterInitialContext } from './shared/server.DZeVx8K9.js';
|
|
8
|
+
export { a as InferRouterCurrentContexts, b as InferRouterError, c as InferRouterErrors, a as InferRouterFinalContexts, d as InferRouterInitialContexts, e as InferRouterInputs, f as InferRouterOutputs } from './shared/server.DZeVx8K9.js';
|
|
9
9
|
import { ClientOptions, ClientContext } from '@orpc/client';
|
|
10
10
|
export { AnyORPCError, AnyORPCErrorJSON, COMMON_ERROR_STATUS_MAP, Client, ClientContext, ClientOptions, ClientRest, FriendlyClientOptions, ORPCError, ORPCErrorCode, ORPCErrorJSON, ORPCErrorOptions, RPCJsonSerialization, RPCJsonSerializationMeta, RPCJsonSerializer, RPCJsonSerializerHandler, RPCJsonSerializerOptions, RPCSerializer, RPCSerializerOptions, RPCSerializerSerializeOptions, SafeResult, cloneORPCError, isDefinedError, safe, toORPCError } from '@orpc/client';
|
|
11
11
|
export { ErrorEvent, EventMeta, StandardBody, StandardBodyHint, StandardHeaders, StandardLazyRequest, StandardLazyResponse, StandardMethod, StandardRequest, StandardResponse, StandardUrl, getEventMeta, unwrapEvent, withEventMeta } from '@standard-server/core';
|
package/dist/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import { mergeErrorMap, resolveMetaPlugins, getHiddenMetaPlugins, ProcedureContr
|
|
|
2
2
|
export { ValidationError, asyncIteratorObject, defineMeta, error, eventIterator, reconcileORPCError, type } from '@orpc/contract';
|
|
3
3
|
import { toArray, bindMethods, isTypescriptObject, resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
4
4
|
export { AsyncIteratorClass, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, asyncIteratorToStream as eventIteratorToStream, asyncIteratorToUnproxiedDataStream as eventIteratorToUnproxiedDataStream, onAsyncIteratorObjectError, onError, onFinish, onReadableStreamError, onStart, onSuccess, streamToAsyncIteratorObject, streamToAsyncIteratorObject as streamToEventIterator } from '@orpc/shared';
|
|
5
|
-
import { L as Lazy, P as Procedure, c as createProcedureClient } from './shared/server.
|
|
6
|
-
export { u as unlazy } from './shared/server.
|
|
7
|
-
import { D as DecoratedProcedure } from './shared/server.
|
|
8
|
-
import { b as augmentRouter, d as augmentImplementedRouter, e as withHiddenRouterContract, f as createGuardedProcedureLazy, g as getRouter } from './shared/server.
|
|
9
|
-
export { a as DEFAULT_ERROR_STATUS, D as DEFAULT_SUCCESS_STATUS, h as call, c as createContractProcedure, i as getHiddenRouterContract, u as unlazyRouter, j as walkProcedureContractsAsync, w as walkProcedureContractsSync } from './shared/server.
|
|
5
|
+
import { L as Lazy, P as Procedure, c as createProcedureClient } from './shared/server.FEqy7Hrj.mjs';
|
|
6
|
+
export { u as unlazy } from './shared/server.FEqy7Hrj.mjs';
|
|
7
|
+
import { D as DecoratedProcedure } from './shared/server.AVQWL-DI.mjs';
|
|
8
|
+
import { b as augmentRouter, d as augmentImplementedRouter, e as withHiddenRouterContract, f as createGuardedProcedureLazy, g as getRouter } from './shared/server.BgvqVW_v.mjs';
|
|
9
|
+
export { a as DEFAULT_ERROR_STATUS, D as DEFAULT_SUCCESS_STATUS, h as call, c as createContractProcedure, i as getHiddenRouterContract, u as unlazyRouter, j as walkProcedureContractsAsync, w as walkProcedureContractsSync } from './shared/server.BgvqVW_v.mjs';
|
|
10
10
|
import { RECURSIVE_CLIENT_UNWRAP_KEYS } from '@orpc/client';
|
|
11
11
|
export { COMMON_ERROR_STATUS_MAP, ORPCError, RPCJsonSerializer, RPCSerializer, cloneORPCError, isDefinedError, safe, toORPCError } from '@orpc/client';
|
|
12
12
|
export { ErrorEvent, getEventMeta, unwrapEvent, withEventMeta } from '@standard-server/core';
|
|
@@ -23,9 +23,9 @@ function decorateMiddleware(middleware) {
|
|
|
23
23
|
return middleware(opts, adapt(input), ...args);
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
|
-
mapped["~orpc"] =
|
|
26
|
+
mapped["~orpc"] = decorated["~orpc"];
|
|
27
27
|
Object.defineProperty(mapped, "name", {
|
|
28
|
-
value:
|
|
28
|
+
value: decorated.name
|
|
29
29
|
});
|
|
30
30
|
return mapped;
|
|
31
31
|
};
|
|
@@ -72,12 +72,12 @@ function decorateMiddleware(middleware) {
|
|
|
72
72
|
...decorated["~orpc"],
|
|
73
73
|
errorMap: mergeErrorMap(usedMiddleware["~orpc"]?.errorMap, decorated["~orpc"]?.errorMap),
|
|
74
74
|
metaPlugins: [
|
|
75
|
-
...toArray(
|
|
75
|
+
...toArray(decorated["~orpc"]?.metaPlugins),
|
|
76
76
|
...toArray(usedMiddleware["~orpc"]?.metaPlugins)
|
|
77
77
|
]
|
|
78
78
|
};
|
|
79
79
|
Object.defineProperty(merged, "name", {
|
|
80
|
-
value: `${
|
|
80
|
+
value: `${decorated.name} + ${usedMiddleware.name}`
|
|
81
81
|
});
|
|
82
82
|
return merged;
|
|
83
83
|
};
|
|
@@ -361,19 +361,13 @@ class SharedRouterImplementer {
|
|
|
361
361
|
return withHiddenRouterContract(router, this.contract);
|
|
362
362
|
}
|
|
363
363
|
lazy(loader) {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
middlewares: this.middlewares
|
|
372
|
-
})
|
|
373
|
-
};
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
return new Lazy({ loader, meta: {} });
|
|
364
|
+
return new Lazy({
|
|
365
|
+
loader: async () => {
|
|
366
|
+
const { default: router } = await loader();
|
|
367
|
+
return { default: this.router(router) };
|
|
368
|
+
},
|
|
369
|
+
meta: {}
|
|
370
|
+
});
|
|
377
371
|
}
|
|
378
372
|
}
|
|
379
373
|
function createRouterImplementer(contract, config) {
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Value, Promisable, ThrowableError } from '@orpc/shared';
|
|
2
|
-
import { StandardLazyRequest, StandardHeaders, StandardMethod } from '@standard-server/core';
|
|
2
|
+
import { StandardLazyRequest, StandardHeaders, StandardMethod, StandardResponse } from '@standard-server/core';
|
|
3
3
|
import { Context } from '../index.mjs';
|
|
4
4
|
import { StandardHandlerPlugin, StandardHandlerRoutingInterceptorOptions, StandardHandlerOptions, StandardHandlerInterceptorOptions } from '../adapters/standard/index.mjs';
|
|
5
|
-
export { R as RequestLimitHandlerPlugin, a as RequestLimitHandlerPluginOptions } from '../shared/server.
|
|
5
|
+
export { R as RequestLimitHandlerPlugin, a as RequestLimitHandlerPluginOptions } from '../shared/server.BllfVJLm.mjs';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@orpc/contract';
|
|
8
8
|
|
|
@@ -221,10 +221,11 @@ declare class PrototypePollutionProtectionHandlerPlugin<T extends Context> imple
|
|
|
221
221
|
private rejectPollutingInput;
|
|
222
222
|
/**
|
|
223
223
|
* Walks the containers the built-in codecs can produce: arrays, maps, sets, and plain
|
|
224
|
-
* objects, including null-prototype ones.
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
224
|
+
* objects, including null-prototype ones. Arrays get the same key checks as plain objects,
|
|
225
|
+
* since structured clone, as used over MessagePort, keeps named keys like `__proto__` on
|
|
226
|
+
* them. Other objects, such as files and dates, carry no attacker-authored keys and are
|
|
227
|
+
* left alone. The walk is iterative, so input nested deeper than the call stack allows
|
|
228
|
+
* still gets the intended verdict instead of a `RangeError`.
|
|
228
229
|
*/
|
|
229
230
|
private containsPollutingKey;
|
|
230
231
|
}
|
|
@@ -311,6 +312,17 @@ declare class ResponseCompressionHandlerPlugin<T extends Context> implements Sta
|
|
|
311
312
|
constructor(options?: ResponseCompressionHandlerPluginOptions<T>);
|
|
312
313
|
init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
|
|
313
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* Picks the first of `encodings` the client accepts, or `undefined` when the response
|
|
317
|
+
* must be sent as is because it is already encoded, partial, or forbids transforms.
|
|
318
|
+
* Shared by the response compression plugins so they agree on when to compress.
|
|
319
|
+
*/
|
|
320
|
+
declare function negotiateResponseCompressionEncoding<TEncoding extends string>(response: StandardResponse, requestHeaders: StandardHeaders, encodings: readonly TEncoding[]): TEncoding | undefined;
|
|
321
|
+
/**
|
|
322
|
+
* The headers of a response whose body is compressed with `encoding`.
|
|
323
|
+
* Shared by the response compression plugins so compressed responses carry the same headers.
|
|
324
|
+
*/
|
|
325
|
+
declare function toCompressedHeaders(headers: StandardHeaders, encoding: string): StandardHeaders;
|
|
314
326
|
|
|
315
327
|
/**
|
|
316
328
|
* The context shape into which the Response Headers Plugin injects `resHeaders`.
|
|
@@ -405,5 +417,5 @@ declare class TimeoutHandlerPlugin<T extends Context> implements StandardHandler
|
|
|
405
417
|
init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
|
|
406
418
|
}
|
|
407
419
|
|
|
408
|
-
export { BATCH_CONTENT_TYPE, BatchHandlerPlugin, CORSHandlerPlugin, CORSHandlerPlugin as CORSPlugin, GetMethodCsrfProtectionHandlerPlugin, MethodOverrideHandlerPlugin, PrototypePollutionProtectionHandlerPlugin, RequestCompressionHandlerPlugin, RequestHeadersHandlerPlugin, RequestHeadersHandlerPlugin as RequestHeadersPlugin, ResponseCompressionHandlerPlugin, ResponseHeadersHandlerPlugin, ResponseHeadersHandlerPlugin as ResponseHeadersPlugin, RethrowHandlerPlugin, TimeoutHandlerPlugin };
|
|
420
|
+
export { BATCH_CONTENT_TYPE, BatchHandlerPlugin, CORSHandlerPlugin, CORSHandlerPlugin as CORSPlugin, GetMethodCsrfProtectionHandlerPlugin, MethodOverrideHandlerPlugin, PrototypePollutionProtectionHandlerPlugin, RequestCompressionHandlerPlugin, RequestHeadersHandlerPlugin, RequestHeadersHandlerPlugin as RequestHeadersPlugin, ResponseCompressionHandlerPlugin, ResponseHeadersHandlerPlugin, ResponseHeadersHandlerPlugin as ResponseHeadersPlugin, RethrowHandlerPlugin, TimeoutHandlerPlugin, negotiateResponseCompressionEncoding, toCompressedHeaders };
|
|
409
421
|
export type { BatchHandlerPluginOptions, CORSHandlerPluginOptions, MethodOverrideHandlerPluginOptions, RequestHeadersHandlerPluginContext, RequestHeadersHandlerPluginContext as RequestHeadersPluginContext, ResponseCompressionHandlerPluginOptions, ResponseHeadersHandlerPluginContext, ResponseHeadersHandlerPluginContext as ResponseHeadersPluginContext, RethrowHandlerPluginOptions, TimeoutHandlerPluginOptions };
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Value, Promisable, ThrowableError } from '@orpc/shared';
|
|
2
|
-
import { StandardLazyRequest, StandardHeaders, StandardMethod } from '@standard-server/core';
|
|
2
|
+
import { StandardLazyRequest, StandardHeaders, StandardMethod, StandardResponse } from '@standard-server/core';
|
|
3
3
|
import { Context } from '../index.js';
|
|
4
4
|
import { StandardHandlerPlugin, StandardHandlerRoutingInterceptorOptions, StandardHandlerOptions, StandardHandlerInterceptorOptions } from '../adapters/standard/index.js';
|
|
5
|
-
export { R as RequestLimitHandlerPlugin, a as RequestLimitHandlerPluginOptions } from '../shared/server.
|
|
5
|
+
export { R as RequestLimitHandlerPlugin, a as RequestLimitHandlerPluginOptions } from '../shared/server.COfbQ0D8.js';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@orpc/contract';
|
|
8
8
|
|
|
@@ -221,10 +221,11 @@ declare class PrototypePollutionProtectionHandlerPlugin<T extends Context> imple
|
|
|
221
221
|
private rejectPollutingInput;
|
|
222
222
|
/**
|
|
223
223
|
* Walks the containers the built-in codecs can produce: arrays, maps, sets, and plain
|
|
224
|
-
* objects, including null-prototype ones.
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
224
|
+
* objects, including null-prototype ones. Arrays get the same key checks as plain objects,
|
|
225
|
+
* since structured clone, as used over MessagePort, keeps named keys like `__proto__` on
|
|
226
|
+
* them. Other objects, such as files and dates, carry no attacker-authored keys and are
|
|
227
|
+
* left alone. The walk is iterative, so input nested deeper than the call stack allows
|
|
228
|
+
* still gets the intended verdict instead of a `RangeError`.
|
|
228
229
|
*/
|
|
229
230
|
private containsPollutingKey;
|
|
230
231
|
}
|
|
@@ -311,6 +312,17 @@ declare class ResponseCompressionHandlerPlugin<T extends Context> implements Sta
|
|
|
311
312
|
constructor(options?: ResponseCompressionHandlerPluginOptions<T>);
|
|
312
313
|
init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
|
|
313
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* Picks the first of `encodings` the client accepts, or `undefined` when the response
|
|
317
|
+
* must be sent as is because it is already encoded, partial, or forbids transforms.
|
|
318
|
+
* Shared by the response compression plugins so they agree on when to compress.
|
|
319
|
+
*/
|
|
320
|
+
declare function negotiateResponseCompressionEncoding<TEncoding extends string>(response: StandardResponse, requestHeaders: StandardHeaders, encodings: readonly TEncoding[]): TEncoding | undefined;
|
|
321
|
+
/**
|
|
322
|
+
* The headers of a response whose body is compressed with `encoding`.
|
|
323
|
+
* Shared by the response compression plugins so compressed responses carry the same headers.
|
|
324
|
+
*/
|
|
325
|
+
declare function toCompressedHeaders(headers: StandardHeaders, encoding: string): StandardHeaders;
|
|
314
326
|
|
|
315
327
|
/**
|
|
316
328
|
* The context shape into which the Response Headers Plugin injects `resHeaders`.
|
|
@@ -405,5 +417,5 @@ declare class TimeoutHandlerPlugin<T extends Context> implements StandardHandler
|
|
|
405
417
|
init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
|
|
406
418
|
}
|
|
407
419
|
|
|
408
|
-
export { BATCH_CONTENT_TYPE, BatchHandlerPlugin, CORSHandlerPlugin, CORSHandlerPlugin as CORSPlugin, GetMethodCsrfProtectionHandlerPlugin, MethodOverrideHandlerPlugin, PrototypePollutionProtectionHandlerPlugin, RequestCompressionHandlerPlugin, RequestHeadersHandlerPlugin, RequestHeadersHandlerPlugin as RequestHeadersPlugin, ResponseCompressionHandlerPlugin, ResponseHeadersHandlerPlugin, ResponseHeadersHandlerPlugin as ResponseHeadersPlugin, RethrowHandlerPlugin, TimeoutHandlerPlugin };
|
|
420
|
+
export { BATCH_CONTENT_TYPE, BatchHandlerPlugin, CORSHandlerPlugin, CORSHandlerPlugin as CORSPlugin, GetMethodCsrfProtectionHandlerPlugin, MethodOverrideHandlerPlugin, PrototypePollutionProtectionHandlerPlugin, RequestCompressionHandlerPlugin, RequestHeadersHandlerPlugin, RequestHeadersHandlerPlugin as RequestHeadersPlugin, ResponseCompressionHandlerPlugin, ResponseHeadersHandlerPlugin, ResponseHeadersHandlerPlugin as ResponseHeadersPlugin, RethrowHandlerPlugin, TimeoutHandlerPlugin, negotiateResponseCompressionEncoding, toCompressedHeaders };
|
|
409
421
|
export type { BatchHandlerPluginOptions, CORSHandlerPluginOptions, MethodOverrideHandlerPluginOptions, RequestHeadersHandlerPluginContext, RequestHeadersHandlerPluginContext as RequestHeadersPluginContext, ResponseCompressionHandlerPluginOptions, ResponseHeadersHandlerPluginContext, ResponseHeadersHandlerPluginContext as ResponseHeadersPluginContext, RethrowHandlerPluginOptions, TimeoutHandlerPluginOptions };
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ORPCError } from '@orpc/client';
|
|
2
|
+
import { toArray, value, isPlainObject, isTypescriptObject, isAsyncIteratorObject, override, wrapAsyncIterator, isCompressibleContentType, isNoTransformCacheControl, parseAcceptEncodingQualities, isAcceptableEncoding, varyByAcceptEncoding, stringifyJSON, anyAbortSignal, wrapReadableStream, AbortError } from '@orpc/shared';
|
|
2
3
|
import { flattenStandardHeader, parseStandardUrl, generateContentDisposition, mergeStandardHeaders } from '@standard-server/core';
|
|
3
4
|
import { isClientPeerSendMessage, ServerPeer, encodePeerMessage } from '@standard-server/peer';
|
|
4
|
-
import { ORPCError } from '@orpc/client';
|
|
5
5
|
import { toFetchHeaders, toStandardBody, toStandardHeaders } from '@standard-server/fetch';
|
|
6
6
|
export { R as RequestLimitHandlerPlugin } from '../shared/server.1ExWFMze.mjs';
|
|
7
7
|
|
|
@@ -77,10 +77,14 @@ class BatchHandlerPlugin {
|
|
|
77
77
|
}
|
|
78
78
|
messages = mightBeMessages;
|
|
79
79
|
}
|
|
80
|
-
} catch {
|
|
80
|
+
} catch (error) {
|
|
81
81
|
return {
|
|
82
82
|
matched: true,
|
|
83
|
-
response: {
|
|
83
|
+
response: {
|
|
84
|
+
status: 400,
|
|
85
|
+
headers: {},
|
|
86
|
+
body: error instanceof ORPCError ? error.message : "Invalid batch request"
|
|
87
|
+
}
|
|
84
88
|
};
|
|
85
89
|
}
|
|
86
90
|
const outerMethod = interceptorOptions.request.method;
|
|
@@ -110,6 +114,20 @@ class BatchHandlerPlugin {
|
|
|
110
114
|
return { status: 500, headers: {}, body: "Internal server error" };
|
|
111
115
|
}
|
|
112
116
|
};
|
|
117
|
+
const runSubrequests = async (peer2) => {
|
|
118
|
+
const promise = Promise.all(messages.map((msg) => peer2.message(msg, handleIndividualRequest)));
|
|
119
|
+
const signal = interceptorOptions.request.signal;
|
|
120
|
+
const closePeer = () => peer2.close(signal?.reason);
|
|
121
|
+
if (signal?.aborted) {
|
|
122
|
+
closePeer();
|
|
123
|
+
}
|
|
124
|
+
signal?.addEventListener("abort", closePeer);
|
|
125
|
+
try {
|
|
126
|
+
await promise;
|
|
127
|
+
} finally {
|
|
128
|
+
signal?.removeEventListener("abort", closePeer);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
113
131
|
const status = await value(this.successStatus, interceptorOptions);
|
|
114
132
|
const headers = await value(this.headers, interceptorOptions);
|
|
115
133
|
if (mode === "buffered") {
|
|
@@ -117,7 +135,7 @@ class BatchHandlerPlugin {
|
|
|
117
135
|
const peer2 = new ServerPeer(async (message) => {
|
|
118
136
|
responseMessages.push(message);
|
|
119
137
|
});
|
|
120
|
-
await
|
|
138
|
+
await runSubrequests(peer2);
|
|
121
139
|
await peer2.close();
|
|
122
140
|
if (responseMessages.some((msg) => msg.binary !== void 0)) {
|
|
123
141
|
const chunks = [];
|
|
@@ -166,15 +184,6 @@ class BatchHandlerPlugin {
|
|
|
166
184
|
}
|
|
167
185
|
}, this.keepAliveInterval);
|
|
168
186
|
};
|
|
169
|
-
const stream = new ReadableStream({
|
|
170
|
-
start(controller) {
|
|
171
|
-
streamController = controller;
|
|
172
|
-
scheduleKeepAlive();
|
|
173
|
-
},
|
|
174
|
-
cancel() {
|
|
175
|
-
clearKeepAlive();
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
187
|
const peer = new ServerPeer(async (message) => {
|
|
179
188
|
const encoded = await encodePeerMessage(message);
|
|
180
189
|
const bytes = typeof encoded === "string" ? new TextEncoder().encode(encoded) : encoded;
|
|
@@ -184,7 +193,17 @@ class BatchHandlerPlugin {
|
|
|
184
193
|
streamController.enqueue(bytes);
|
|
185
194
|
scheduleKeepAlive();
|
|
186
195
|
});
|
|
187
|
-
|
|
196
|
+
const stream = new ReadableStream({
|
|
197
|
+
start(controller) {
|
|
198
|
+
streamController = controller;
|
|
199
|
+
scheduleKeepAlive();
|
|
200
|
+
},
|
|
201
|
+
async cancel(reason) {
|
|
202
|
+
clearKeepAlive();
|
|
203
|
+
await peer.close(reason);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
runSubrequests(peer).then(async () => {
|
|
188
207
|
clearKeepAlive();
|
|
189
208
|
streamController.close();
|
|
190
209
|
await peer.close();
|
|
@@ -415,10 +434,11 @@ class PrototypePollutionProtectionHandlerPlugin {
|
|
|
415
434
|
}
|
|
416
435
|
/**
|
|
417
436
|
* Walks the containers the built-in codecs can produce: arrays, maps, sets, and plain
|
|
418
|
-
* objects, including null-prototype ones.
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
437
|
+
* objects, including null-prototype ones. Arrays get the same key checks as plain objects,
|
|
438
|
+
* since structured clone, as used over MessagePort, keeps named keys like `__proto__` on
|
|
439
|
+
* them. Other objects, such as files and dates, carry no attacker-authored keys and are
|
|
440
|
+
* left alone. The walk is iterative, so input nested deeper than the call stack allows
|
|
441
|
+
* still gets the intended verdict instead of a `RangeError`.
|
|
422
442
|
*/
|
|
423
443
|
containsPollutingKey(root) {
|
|
424
444
|
const visited = /* @__PURE__ */ new WeakSet();
|
|
@@ -429,19 +449,13 @@ class PrototypePollutionProtectionHandlerPlugin {
|
|
|
429
449
|
continue;
|
|
430
450
|
}
|
|
431
451
|
visited.add(value);
|
|
432
|
-
if (Array.isArray(value)) {
|
|
433
|
-
for (const item of value) {
|
|
434
|
-
stack.push(item);
|
|
435
|
-
}
|
|
436
|
-
continue;
|
|
437
|
-
}
|
|
438
452
|
if (value instanceof Map || value instanceof Set) {
|
|
439
453
|
for (const entry of value) {
|
|
440
454
|
stack.push(entry);
|
|
441
455
|
}
|
|
442
456
|
continue;
|
|
443
457
|
}
|
|
444
|
-
if (!isPlainObject(value)) {
|
|
458
|
+
if (!Array.isArray(value) && !isPlainObject(value)) {
|
|
445
459
|
continue;
|
|
446
460
|
}
|
|
447
461
|
if (Object.hasOwn(value, "__proto__")) {
|
|
@@ -450,14 +464,17 @@ class PrototypePollutionProtectionHandlerPlugin {
|
|
|
450
464
|
if (Object.hasOwn(value, "constructor") && isTypescriptObject(value.constructor) && Object.hasOwn(value.constructor, "prototype")) {
|
|
451
465
|
return true;
|
|
452
466
|
}
|
|
453
|
-
for (const
|
|
454
|
-
|
|
467
|
+
for (const item of Object.values(value)) {
|
|
468
|
+
if (typeof item === "object" && item !== null) {
|
|
469
|
+
stack.push(item);
|
|
470
|
+
}
|
|
455
471
|
}
|
|
456
472
|
}
|
|
457
473
|
return false;
|
|
458
474
|
}
|
|
459
475
|
}
|
|
460
476
|
|
|
477
|
+
const MAX_CONTENT_ENCODINGS = 5;
|
|
461
478
|
class RequestCompressionHandlerPlugin {
|
|
462
479
|
name = "~request-compression";
|
|
463
480
|
/**
|
|
@@ -487,6 +504,9 @@ class RequestCompressionHandlerPlugin {
|
|
|
487
504
|
if (!(stream instanceof ReadableStream)) {
|
|
488
505
|
return stream;
|
|
489
506
|
}
|
|
507
|
+
if (encodings.length > MAX_CONTENT_ENCODINGS) {
|
|
508
|
+
throw new ORPCError("UNSUPPORTED_MEDIA_TYPE", { message: "Too many content encodings." });
|
|
509
|
+
}
|
|
490
510
|
let decompressedStream = stream;
|
|
491
511
|
for (let i = encodings.length - 1; i >= 0; i--) {
|
|
492
512
|
decompressedStream = decompressedStream.pipeThrough(
|
|
@@ -566,20 +586,7 @@ class ResponseCompressionHandlerPlugin {
|
|
|
566
586
|
return result;
|
|
567
587
|
}
|
|
568
588
|
const response = result.response;
|
|
569
|
-
const
|
|
570
|
-
if (contentEncoding !== void 0) {
|
|
571
|
-
return result;
|
|
572
|
-
}
|
|
573
|
-
if (response.status === 206 || response.headers["content-range"] !== void 0) {
|
|
574
|
-
return result;
|
|
575
|
-
}
|
|
576
|
-
if (isNoTransformCacheControl(flattenStandardHeader(response.headers["cache-control"]))) {
|
|
577
|
-
return result;
|
|
578
|
-
}
|
|
579
|
-
const acceptEncodings = parseAcceptEncodingQualities(
|
|
580
|
-
flattenStandardHeader(interceptorOptions.request.headers["accept-encoding"])
|
|
581
|
-
);
|
|
582
|
-
const encoding = this.encodings.find((enc) => (acceptEncodings.get(enc) ?? 0) > 0);
|
|
589
|
+
const encoding = negotiateResponseCompressionEncoding(response, interceptorOptions.request.headers, this.encodings);
|
|
583
590
|
if (encoding === void 0) {
|
|
584
591
|
return result;
|
|
585
592
|
}
|
|
@@ -594,11 +601,8 @@ class ResponseCompressionHandlerPlugin {
|
|
|
594
601
|
...response,
|
|
595
602
|
body: body.pipeThrough(new CompressionStream(encoding)),
|
|
596
603
|
headers: {
|
|
597
|
-
...headers,
|
|
598
|
-
"standard-server": "octet-stream"
|
|
599
|
-
"content-length": [],
|
|
600
|
-
"content-encoding": encoding,
|
|
601
|
-
"vary": varyByAcceptEncoding(flattenStandardHeader(headers.vary))
|
|
604
|
+
...toCompressedHeaders(headers, encoding),
|
|
605
|
+
"standard-server": "octet-stream"
|
|
602
606
|
}
|
|
603
607
|
}
|
|
604
608
|
};
|
|
@@ -614,13 +618,10 @@ class ResponseCompressionHandlerPlugin {
|
|
|
614
618
|
...response,
|
|
615
619
|
body: body.stream().pipeThrough(new CompressionStream(encoding)),
|
|
616
620
|
headers: {
|
|
617
|
-
...headers,
|
|
621
|
+
...toCompressedHeaders(headers, encoding),
|
|
618
622
|
"standard-server": "file",
|
|
619
623
|
"content-type": body.type,
|
|
620
|
-
"content-
|
|
621
|
-
"content-disposition": contentDisposition,
|
|
622
|
-
"content-encoding": encoding,
|
|
623
|
-
"vary": varyByAcceptEncoding(flattenStandardHeader(headers.vary))
|
|
624
|
+
"content-disposition": contentDisposition
|
|
624
625
|
}
|
|
625
626
|
}
|
|
626
627
|
};
|
|
@@ -653,12 +654,9 @@ class ResponseCompressionHandlerPlugin {
|
|
|
653
654
|
...response,
|
|
654
655
|
body: compressedStream,
|
|
655
656
|
headers: {
|
|
656
|
-
...headers,
|
|
657
|
+
...toCompressedHeaders(headers, encoding),
|
|
657
658
|
"standard-server": [],
|
|
658
|
-
"content-type": res.headers.get("content-type")
|
|
659
|
-
"content-length": [],
|
|
660
|
-
"content-encoding": encoding,
|
|
661
|
-
"vary": varyByAcceptEncoding(flattenStandardHeader(headers.vary))
|
|
659
|
+
"content-type": res.headers.get("content-type")
|
|
662
660
|
}
|
|
663
661
|
}
|
|
664
662
|
};
|
|
@@ -672,12 +670,9 @@ class ResponseCompressionHandlerPlugin {
|
|
|
672
670
|
...response,
|
|
673
671
|
body: new Blob([string]).stream().pipeThrough(new CompressionStream(encoding)),
|
|
674
672
|
headers: {
|
|
675
|
-
...headers,
|
|
673
|
+
...toCompressedHeaders(headers, encoding),
|
|
676
674
|
"standard-server": [],
|
|
677
|
-
"content-type": "application/x-www-form-urlencoded"
|
|
678
|
-
"content-length": [],
|
|
679
|
-
"content-encoding": encoding,
|
|
680
|
-
"vary": varyByAcceptEncoding(flattenStandardHeader(headers.vary))
|
|
675
|
+
"content-type": "application/x-www-form-urlencoded"
|
|
681
676
|
}
|
|
682
677
|
}
|
|
683
678
|
};
|
|
@@ -691,12 +686,9 @@ class ResponseCompressionHandlerPlugin {
|
|
|
691
686
|
...response,
|
|
692
687
|
body: new Blob([string]).stream().pipeThrough(new CompressionStream(encoding)),
|
|
693
688
|
headers: {
|
|
694
|
-
...headers,
|
|
689
|
+
...toCompressedHeaders(headers, encoding),
|
|
695
690
|
"standard-server": [],
|
|
696
|
-
"content-type": "application/json"
|
|
697
|
-
"content-length": [],
|
|
698
|
-
"content-encoding": encoding,
|
|
699
|
-
"vary": varyByAcceptEncoding(flattenStandardHeader(headers.vary))
|
|
691
|
+
"content-type": "application/json"
|
|
700
692
|
}
|
|
701
693
|
}
|
|
702
694
|
};
|
|
@@ -713,6 +705,38 @@ class ResponseCompressionHandlerPlugin {
|
|
|
713
705
|
};
|
|
714
706
|
}
|
|
715
707
|
}
|
|
708
|
+
function negotiateResponseCompressionEncoding(response, requestHeaders, encodings) {
|
|
709
|
+
if (flattenStandardHeader(response.headers["content-encoding"]) !== void 0) {
|
|
710
|
+
return void 0;
|
|
711
|
+
}
|
|
712
|
+
if (response.status === 206 || flattenStandardHeader(response.headers["content-range"]) !== void 0) {
|
|
713
|
+
return void 0;
|
|
714
|
+
}
|
|
715
|
+
if (isNoTransformCacheControl(flattenStandardHeader(response.headers["cache-control"]))) {
|
|
716
|
+
return void 0;
|
|
717
|
+
}
|
|
718
|
+
const acceptEncodings = parseAcceptEncodingQualities(flattenStandardHeader(requestHeaders["accept-encoding"]));
|
|
719
|
+
return encodings.find((encoding) => isAcceptableEncoding(acceptEncodings, encoding));
|
|
720
|
+
}
|
|
721
|
+
function toCompressedHeaders(headers, encoding) {
|
|
722
|
+
return {
|
|
723
|
+
...headers,
|
|
724
|
+
"content-length": [],
|
|
725
|
+
"content-encoding": encoding,
|
|
726
|
+
"vary": varyByAcceptEncoding(flattenStandardHeader(headers.vary)),
|
|
727
|
+
/**
|
|
728
|
+
* A strong tag shared with the identity bytes would let `If-Range` splice them after compressed ones.
|
|
729
|
+
* A weak tag still revalidates through `If-None-Match`, and the compressed body serves no ranges.
|
|
730
|
+
*
|
|
731
|
+
* @see https://www.rfc-editor.org/rfc/rfc9110.html#name-etag
|
|
732
|
+
*/
|
|
733
|
+
"etag": weakenEtag(flattenStandardHeader(headers.etag)),
|
|
734
|
+
"accept-ranges": []
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
function weakenEtag(etag) {
|
|
738
|
+
return etag === void 0 || etag.startsWith("W/") ? etag : `W/${etag}`;
|
|
739
|
+
}
|
|
716
740
|
|
|
717
741
|
class ResponseHeadersHandlerPlugin {
|
|
718
742
|
name = "~response-headers";
|
|
@@ -851,4 +875,4 @@ class TimeoutHandlerPlugin {
|
|
|
851
875
|
}
|
|
852
876
|
}
|
|
853
877
|
|
|
854
|
-
export { BATCH_CONTENT_TYPE, BatchHandlerPlugin, CORSHandlerPlugin, CORSHandlerPlugin as CORSPlugin, GetMethodCsrfProtectionHandlerPlugin, MethodOverrideHandlerPlugin, PrototypePollutionProtectionHandlerPlugin, RequestCompressionHandlerPlugin, RequestHeadersHandlerPlugin, RequestHeadersHandlerPlugin as RequestHeadersPlugin, ResponseCompressionHandlerPlugin, ResponseHeadersHandlerPlugin, ResponseHeadersHandlerPlugin as ResponseHeadersPlugin, RethrowHandlerPlugin, TimeoutHandlerPlugin };
|
|
878
|
+
export { BATCH_CONTENT_TYPE, BatchHandlerPlugin, CORSHandlerPlugin, CORSHandlerPlugin as CORSPlugin, GetMethodCsrfProtectionHandlerPlugin, MethodOverrideHandlerPlugin, PrototypePollutionProtectionHandlerPlugin, RequestCompressionHandlerPlugin, RequestHeadersHandlerPlugin, RequestHeadersHandlerPlugin as RequestHeadersPlugin, ResponseCompressionHandlerPlugin, ResponseHeadersHandlerPlugin, ResponseHeadersHandlerPlugin as ResponseHeadersPlugin, RethrowHandlerPlugin, TimeoutHandlerPlugin, negotiateResponseCompressionEncoding, toCompressedHeaders };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveMetaPlugins, mergeErrorMap, getHiddenMetaPlugins } from '@orpc/contract';
|
|
2
|
-
import { P as Procedure } from './server.
|
|
2
|
+
import { P as Procedure } from './server.FEqy7Hrj.mjs';
|
|
3
3
|
|
|
4
4
|
class DecoratedProcedure extends Procedure {
|
|
5
5
|
meta(...plugins) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ClientContext, Client } from '@orpc/client';
|
|
2
2
|
import { ErrorMap, AnyMetaPlugin, ORPCErrorConstructorMap, AnySchema, ProcedureContractDefinition, Meta, InferSchemaOutput, ORPCErrorFromErrorMap, InferSchemaInput } from '@orpc/contract';
|
|
3
|
-
import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, ThrowableError, Value } from '@orpc/shared';
|
|
3
|
+
import { DistributiveOmit, MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, ThrowableError, Value } from '@orpc/shared';
|
|
4
4
|
|
|
5
5
|
interface Context {
|
|
6
6
|
[key: PropertyKey]: any;
|
|
7
7
|
}
|
|
8
|
-
type MergedInitialContext<TInitial extends Context, TOutContext extends Context, TInContext extends Context> = Exclude<keyof TInContext, keyof TInitial | keyof TOutContext> extends never ? TInitial : TInitial &
|
|
9
|
-
type MergedContext<TCurrent extends Context, TOutContext extends Context> = keyof TOutContext extends never ? TCurrent :
|
|
8
|
+
type MergedInitialContext<TInitial extends Context, TOutContext extends Context, TInContext extends Context> = TInContext extends any ? Exclude<keyof TInContext, keyof TInitial | keyof TOutContext> extends never ? TInitial : TInitial & DistributiveOmit<TInContext, keyof TInitial | keyof TOutContext> : never;
|
|
9
|
+
type MergedContext<TCurrent extends Context, TOutContext extends Context> = keyof TOutContext extends never ? TCurrent : DistributiveOmit<TCurrent, keyof TOutContext> & TOutContext;
|
|
10
10
|
|
|
11
11
|
type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
|
12
12
|
output: TOutput;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ClientContext, Client } from '@orpc/client';
|
|
2
2
|
import { ErrorMap, AnyMetaPlugin, ORPCErrorConstructorMap, AnySchema, ProcedureContractDefinition, Meta, InferSchemaOutput, ORPCErrorFromErrorMap, InferSchemaInput } from '@orpc/contract';
|
|
3
|
-
import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, ThrowableError, Value } from '@orpc/shared';
|
|
3
|
+
import { DistributiveOmit, MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, ThrowableError, Value } from '@orpc/shared';
|
|
4
4
|
|
|
5
5
|
interface Context {
|
|
6
6
|
[key: PropertyKey]: any;
|
|
7
7
|
}
|
|
8
|
-
type MergedInitialContext<TInitial extends Context, TOutContext extends Context, TInContext extends Context> = Exclude<keyof TInContext, keyof TInitial | keyof TOutContext> extends never ? TInitial : TInitial &
|
|
9
|
-
type MergedContext<TCurrent extends Context, TOutContext extends Context> = keyof TOutContext extends never ? TCurrent :
|
|
8
|
+
type MergedInitialContext<TInitial extends Context, TOutContext extends Context, TInContext extends Context> = TInContext extends any ? Exclude<keyof TInContext, keyof TInitial | keyof TOutContext> extends never ? TInitial : TInitial & DistributiveOmit<TInContext, keyof TInitial | keyof TOutContext> : never;
|
|
9
|
+
type MergedContext<TCurrent extends Context, TOutContext extends Context> = keyof TOutContext extends never ? TCurrent : DistributiveOmit<TCurrent, keyof TOutContext> & TOutContext;
|
|
10
10
|
|
|
11
11
|
type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
|
12
12
|
output: TOutput;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ORPCError, toORPCError, RPCSerializer, COMMON_ERROR_STATUS_MAP } from '@orpc/client';
|
|
2
2
|
import { sortPlugins, toArray, matchesHttpPathPrefix, value, intercept, getTracer, runWithSpan, ORPC_NAME, isAsyncIteratorObject, override, traceAsyncIterator, traceReadableStream, recordSpanError, wrapAsyncIterator, toTracingException, wrapReadableStream, pathToHttpPath, normalizeHttpPath, parseEmptyableJSON, getOwn } from '@orpc/shared';
|
|
3
3
|
import { flattenStandardHeader, parseStandardUrl, ErrorEvent } from '@standard-server/core';
|
|
4
|
-
import { c as createProcedureClient, u as unlazy, P as Procedure } from './server.
|
|
5
|
-
import { w as walkProcedureContractsSync, g as getRouter, c as createContractProcedure, D as DEFAULT_SUCCESS_STATUS, a as DEFAULT_ERROR_STATUS } from './server.
|
|
4
|
+
import { c as createProcedureClient, u as unlazy, P as Procedure } from './server.FEqy7Hrj.mjs';
|
|
5
|
+
import { w as walkProcedureContractsSync, g as getRouter, c as createContractProcedure, D as DEFAULT_SUCCESS_STATUS, a as DEFAULT_ERROR_STATUS } from './server.BgvqVW_v.mjs';
|
|
6
6
|
|
|
7
7
|
class CompositeStandardHandlerPlugin {
|
|
8
8
|
name = "~composite";
|
|
@@ -221,9 +221,6 @@ class RPCMatcher {
|
|
|
221
221
|
if (this.allowMethodsSet && !this.allowMethodsSet.has(method)) {
|
|
222
222
|
return void 0;
|
|
223
223
|
}
|
|
224
|
-
if (pathname.length > 1 && pathname.endsWith("/")) {
|
|
225
|
-
pathname = pathname.slice(0, -1);
|
|
226
|
-
}
|
|
227
224
|
if (prefix) {
|
|
228
225
|
if (!pathname.startsWith(prefix)) {
|
|
229
226
|
return void 0;
|
|
@@ -239,6 +236,9 @@ class RPCMatcher {
|
|
|
239
236
|
return void 0;
|
|
240
237
|
}
|
|
241
238
|
}
|
|
239
|
+
if (pathname.length > 1 && pathname.endsWith("/")) {
|
|
240
|
+
pathname = pathname.slice(0, -1);
|
|
241
|
+
}
|
|
242
242
|
const loading = this.resolvePendingLazyRouters(pathname);
|
|
243
243
|
if (loading !== void 0) {
|
|
244
244
|
await loading;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createProcedureClient, P as Procedure, L as Lazy, u as unlazy } from './server.
|
|
1
|
+
import { c as createProcedureClient, P as Procedure, L as Lazy, u as unlazy } from './server.FEqy7Hrj.mjs';
|
|
2
2
|
import { resolveMetaPlugins, mergeErrorMap, ProcedureContract } from '@orpc/contract';
|
|
3
|
-
import { omit, isTypescriptObject } from '@orpc/shared';
|
|
3
|
+
import { omit, isTypescriptObject, getOwn } from '@orpc/shared';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_SUCCESS_STATUS = 200;
|
|
6
6
|
const DEFAULT_ERROR_STATUS = 500;
|
|
@@ -141,7 +141,7 @@ function getRouter(router, path) {
|
|
|
141
141
|
return void 0;
|
|
142
142
|
}
|
|
143
143
|
if (!(current instanceof Lazy)) {
|
|
144
|
-
current = current
|
|
144
|
+
current = getOwn(current, segment);
|
|
145
145
|
continue;
|
|
146
146
|
}
|
|
147
147
|
const lazied = current;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Context } from './server.
|
|
2
|
-
import { b as StandardHandlerPlugin, c as StandardHandlerOptions } from './server.
|
|
1
|
+
import { C as Context } from './server.BEdOJs6S.mjs';
|
|
2
|
+
import { b as StandardHandlerPlugin, c as StandardHandlerOptions } from './server.CVO0hWyj.mjs';
|
|
3
3
|
|
|
4
4
|
interface RequestLimitHandlerPluginOptions {
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Context } from './server.
|
|
2
|
-
import { b as StandardHandlerPlugin, c as StandardHandlerOptions } from './server.
|
|
1
|
+
import { C as Context } from './server.BEdOJs6S.js';
|
|
2
|
+
import { b as StandardHandlerPlugin, c as StandardHandlerOptions } from './server.DJNkZPfD.js';
|
|
3
3
|
|
|
4
4
|
interface RequestLimitHandlerPluginOptions {
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyORPCError } from '@orpc/client';
|
|
2
2
|
import { OrderablePlugin, Value, Promisable, Interceptor } from '@orpc/shared';
|
|
3
3
|
import { StandardLazyRequest, StandardResponse } from '@standard-server/core';
|
|
4
|
-
import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.
|
|
4
|
+
import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.BEdOJs6S.mjs';
|
|
5
5
|
import { Schema, ErrorMap } from '@orpc/contract';
|
|
6
6
|
|
|
7
7
|
interface StandardHandlerPlugin<T extends Context> extends OrderablePlugin {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RouterContract, ProcedureContract, ORPCErrorFromErrorMap, ThrowableError, InferSchemaInput, InferSchemaOutput } from '@orpc/contract';
|
|
2
|
-
import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.
|
|
2
|
+
import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.BEdOJs6S.mjs';
|
|
3
3
|
|
|
4
4
|
type Router<TInitialContext extends Context> = Procedure<TInitialContext, any, any, any, any> | {
|
|
5
5
|
[k: string]: Lazyable<Router<TInitialContext>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Value, Promisable } from '@orpc/shared';
|
|
2
2
|
import { StandardLazyRequest } from '@standard-server/core';
|
|
3
|
-
import { C as Context } from './server.
|
|
4
|
-
import { a as StandardHandlerHandleOptions } from './server.
|
|
3
|
+
import { C as Context } from './server.BEdOJs6S.js';
|
|
4
|
+
import { a as StandardHandlerHandleOptions } from './server.DJNkZPfD.js';
|
|
5
5
|
|
|
6
6
|
type FriendlyStandardHandlerHandleOptions<T extends Context> = Omit<StandardHandlerHandleOptions<T>, 'context'> & (object extends T ? {
|
|
7
7
|
context?: Value<Promisable<T>, [request: StandardLazyRequest]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyORPCError } from '@orpc/client';
|
|
2
2
|
import { OrderablePlugin, Value, Promisable, Interceptor } from '@orpc/shared';
|
|
3
3
|
import { StandardLazyRequest, StandardResponse } from '@standard-server/core';
|
|
4
|
-
import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.
|
|
4
|
+
import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.BEdOJs6S.js';
|
|
5
5
|
import { Schema, ErrorMap } from '@orpc/contract';
|
|
6
6
|
|
|
7
7
|
interface StandardHandlerPlugin<T extends Context> extends OrderablePlugin {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RouterContract, ProcedureContract, ORPCErrorFromErrorMap, ThrowableError, InferSchemaInput, InferSchemaOutput } from '@orpc/contract';
|
|
2
|
-
import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.
|
|
2
|
+
import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.BEdOJs6S.js';
|
|
3
3
|
|
|
4
4
|
type Router<TInitialContext extends Context> = Procedure<TInitialContext, any, any, any, any> | {
|
|
5
5
|
[k: string]: Lazyable<Router<TInitialContext>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { wrapAsyncIteratorPreservingEventMeta, ORPCError } from '@orpc/client';
|
|
2
2
|
import { createORPCErrorConstructorMap, reconcileORPCError, ValidationError, ProcedureContract } from '@orpc/contract';
|
|
3
|
-
import { getConstructor, isTypescriptObject, resolveMaybeOptionalOptions, toArray, value, runWithSpan, intercept, isAsyncIteratorObject, override, getTracer, traceAsyncIterator, traceReadableStream,
|
|
3
|
+
import { getConstructor, isTypescriptObject, resolveMaybeOptionalOptions, toArray, value, runWithSpan, intercept, isAsyncIteratorObject, override, getTracer, traceAsyncIterator, traceReadableStream, mergeTwoLevels } from '@orpc/shared';
|
|
4
4
|
|
|
5
5
|
class Lazy {
|
|
6
6
|
"~orpc";
|
|
@@ -130,7 +130,7 @@ async function executeProcedureInternal(procedure, options) {
|
|
|
130
130
|
const validated = await validateInput(
|
|
131
131
|
i,
|
|
132
132
|
inputSchemas[i],
|
|
133
|
-
|
|
133
|
+
i !== 0 ? mergeTwoLevels(options.input, currentInput) : currentInput
|
|
134
134
|
);
|
|
135
135
|
currentInput = i !== 0 ? mergeTwoLevels(currentInput, validated) : validated;
|
|
136
136
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Value, Promisable } from '@orpc/shared';
|
|
2
2
|
import { StandardLazyRequest } from '@standard-server/core';
|
|
3
|
-
import { C as Context } from './server.
|
|
4
|
-
import { a as StandardHandlerHandleOptions } from './server.
|
|
3
|
+
import { C as Context } from './server.BEdOJs6S.mjs';
|
|
4
|
+
import { a as StandardHandlerHandleOptions } from './server.CVO0hWyj.mjs';
|
|
5
5
|
|
|
6
6
|
type FriendlyStandardHandlerHandleOptions<T extends Context> = Omit<StandardHandlerHandleOptions<T>, 'context'> & (object extends T ? {
|
|
7
7
|
context?: Value<Promisable<T>, [request: StandardLazyRequest]>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.42",
|
|
5
5
|
"description": "Build typesafe APIs with oRPC: RPC and OpenAPI support, middleware, and adapters for Node.js, Bun, Deno, Fetch, Fastify, WebSocket, AWS Lambda, and more",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": [
|
|
@@ -117,21 +117,22 @@
|
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
|
-
"@orpc/client": "2.0.0-beta.
|
|
121
|
-
"@orpc/contract": "2.0.0-beta.
|
|
122
|
-
"@orpc/shared": "2.0.0-beta.
|
|
123
|
-
"@standard-server/aws-lambda": "~0.
|
|
124
|
-
"@standard-server/core": "~0.
|
|
125
|
-
"@standard-server/fastify": "~0.
|
|
126
|
-
"@standard-server/fetch": "~0.
|
|
127
|
-
"@standard-server/node": "~0.
|
|
128
|
-
"@standard-server/peer": "~0.
|
|
120
|
+
"@orpc/client": "2.0.0-beta.42",
|
|
121
|
+
"@orpc/contract": "2.0.0-beta.42",
|
|
122
|
+
"@orpc/shared": "2.0.0-beta.42",
|
|
123
|
+
"@standard-server/aws-lambda": "~0.10.1",
|
|
124
|
+
"@standard-server/core": "~0.10.1",
|
|
125
|
+
"@standard-server/fastify": "~0.10.1",
|
|
126
|
+
"@standard-server/fetch": "~0.10.1",
|
|
127
|
+
"@standard-server/node": "~0.10.1",
|
|
128
|
+
"@standard-server/peer": "~0.10.1",
|
|
129
129
|
"cookie": "^2.0.1"
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
132
|
"crossws": "^0.4.6",
|
|
133
133
|
"fastify": "^5.12.1",
|
|
134
134
|
"supertest": "^7.2.2",
|
|
135
|
+
"ws": "^8.21.3",
|
|
135
136
|
"zod": "^4.5.4"
|
|
136
137
|
},
|
|
137
138
|
"scripts": {
|