@orpc/server 2.0.0-beta.21 → 2.0.0-beta.22

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 CHANGED
@@ -109,11 +109,10 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
109
109
  <td align="center"><a href="https://github.com/valerii15298?ref=orpc" target="_blank" rel="noopener" title="Valerii Petryniak"><img src="https://avatars.githubusercontent.com/u/44531564?u=88ac74d9bacd20401518441907acad21063cd397&amp;v=4" width="139" alt="Valerii Petryniak"/><br />Valerii Petryniak</a></td>
110
110
  <td align="center"><a href="https://github.com/letstri?ref=orpc" target="_blank" rel="noopener" title="Valerii Strilets"><img src="https://avatars.githubusercontent.com/u/13253748?u=c7b10399ccc8f8081e24db94ec32cd9858e86ac3&amp;v=4" width="139" alt="Valerii Strilets"/><br />Valerii Strilets</a></td>
111
111
  <td align="center"><a href="https://github.com/K-Mistele?ref=orpc" target="_blank" rel="noopener" title="Kyle Mistele"><img src="https://avatars.githubusercontent.com/u/18430555?u=3afebeb81de666e35aaac3ed46f14159d7603ffb&amp;v=4" width="139" alt="Kyle Mistele"/><br />Kyle Mistele</a></td>
112
- <td align="center"><a href="https://github.com/R44VC0RP?ref=orpc" target="_blank" rel="noopener" title="Ryan Vogel"><img src="https://avatars.githubusercontent.com/u/89211796?u=1857347b9787d8d8a7ea5bfc333f96be92d5a683&amp;v=4" width="139" alt="Ryan Vogel"/><br />Ryan Vogel</a></td>
113
112
  <td align="center"><a href="https://github.com/christ12938?ref=orpc" target="_blank" rel="noopener" title="christ12938"><img src="https://avatars.githubusercontent.com/u/25758598?v=4" width="139" alt="christ12938"/><br />christ12938</a></td>
113
+ <td align="center"><a href="https://github.com/Ryanjso?ref=orpc" target="_blank" rel="noopener" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&amp;v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
114
114
  </tr>
115
115
  <tr>
116
- <td align="center"><a href="https://github.com/Ryanjso?ref=orpc" target="_blank" rel="noopener" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&amp;v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
117
116
  <td align="center"><a href="https://github.com/itigoore01?ref=orpc" target="_blank" rel="noopener" title="shota"><img src="https://avatars.githubusercontent.com/u/11831107?u=c976a6dc7e055eb026304c46c99100ed22b0c8e0&amp;v=4" width="139" alt="shota"/><br />shota</a></td>
118
117
  </tr>
119
118
  </table>
@@ -123,24 +122,23 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
123
122
  <table>
124
123
  <tr>
125
124
  <td align="center"><a href="https://github.com/rhinodavid?ref=orpc" target="_blank" rel="noopener" title="David Walsh"><img src="https://avatars.githubusercontent.com/u/5778036?u=b5521f07d2f88c3db2a0dae62b5f2f8357214af0&amp;v=4" width="119" alt="David Walsh"/><br />David Walsh</a></td>
126
- <td align="center"><a href="https://github.com/Nic13Gamer?ref=orpc" target="_blank" rel="noopener" title="Nicholas"><img src="https://avatars.githubusercontent.com/u/54724556?u=56a7ab430ce7a80d648ab6eba051d454a818ed0b&amp;v=4" width="119" alt="Nicholas"/><br />Nicholas</a></td>
127
125
  <td align="center"><a href="https://github.com/Robbe95?ref=orpc" target="_blank" rel="noopener" title="Robbe Vaes"><img src="https://avatars.githubusercontent.com/u/44748019?u=e0232402c045ad4eac7cbd217f1f47e083103b89&amp;v=4" width="119" alt="Robbe Vaes"/><br />Robbe Vaes</a></td>
128
126
  <td align="center"><a href="https://github.com/aidansunbury?ref=orpc" target="_blank" rel="noopener" title="Aidan Sunbury"><img src="https://avatars.githubusercontent.com/u/64103161?v=4" width="119" alt="Aidan Sunbury"/><br />Aidan Sunbury</a></td>
129
127
  <td align="center"><a href="https://github.com/soonoo?ref=orpc" target="_blank" rel="noopener" title="soonoo"><img src="https://avatars.githubusercontent.com/u/5436405?u=5d0b4aa955c87e30e6bda7f0cccae5402da99528&amp;v=4" width="119" alt="soonoo"/><br />soonoo</a></td>
130
128
  <td align="center"><a href="https://github.com/kporten?ref=orpc" target="_blank" rel="noopener" title="Kevin Porten"><img src="https://avatars.githubusercontent.com/u/1839345?u=dc2263d5cfe0d927ce1a0be04a1d55dd6b55405c&amp;v=4" width="119" alt="Kevin Porten"/><br />Kevin Porten</a></td>
131
129
  <td align="center"><a href="https://github.com/pumpkinlink?ref=orpc" target="_blank" rel="noopener" title="Denis"><img src="https://avatars.githubusercontent.com/u/11864620?u=5f47bbe6c65d0f6f5cf011021490238e4b0593d0&amp;v=4" width="119" alt="Denis"/><br />Denis</a></td>
130
+ <td align="center"><a href="https://github.com/christopher-kapic?ref=orpc" target="_blank" rel="noopener" title="Christopher Kapic"><img src="https://avatars.githubusercontent.com/u/59740769?u=e7ad4b72b5bf6c9eb1644c26dbf3332a8f987377&amp;v=4" width="119" alt="Christopher Kapic"/><br />Christopher Kapic</a></td>
132
131
  </tr>
133
132
  <tr>
134
- <td align="center"><a href="https://github.com/christopher-kapic?ref=orpc" target="_blank" rel="noopener" title="Christopher Kapic"><img src="https://avatars.githubusercontent.com/u/59740769?u=e7ad4b72b5bf6c9eb1644c26dbf3332a8f987377&amp;v=4" width="119" alt="Christopher Kapic"/><br />Christopher Kapic</a></td>
135
133
  <td align="center"><a href="https://github.com/thomasballinger?ref=orpc" target="_blank" rel="noopener" title="Tom Ballinger"><img src="https://avatars.githubusercontent.com/u/458879?u=4b045ac75d721b6ac2b42a74d7d37f61f0414031&amp;v=4" width="119" alt="Tom Ballinger"/><br />Tom Ballinger</a></td>
136
134
  <td align="center"><a href="https://github.com/SSam0419?ref=orpc" target="_blank" rel="noopener" title="Sam"><img src="https://avatars.githubusercontent.com/u/102863520?u=3c89611f549d5070be232eb4532f690c8f2e7a65&amp;v=4" width="119" alt="Sam"/><br />Sam</a></td>
137
135
  <td align="center"><a href="https://github.com/Titoine?ref=orpc" target="_blank" rel="noopener" title="Titoine"><img src="https://avatars.githubusercontent.com/u/3514286?u=1bb1e86b0c99c8a1121372e56d51a177eea12191&amp;v=4" width="119" alt="Titoine"/><br />Titoine</a></td>
138
136
  <td align="center"><a href="https://github.com/Mnigos?ref=orpc" target="_blank" rel="noopener" title="Igor Makowski"><img src="https://avatars.githubusercontent.com/u/56691628?u=ee8c879478f7c151b9156aef6c74243fa3e247a8&amp;v=4" width="119" alt="Igor Makowski"/><br />Igor Makowski</a></td>
139
137
  <td align="center"><a href="https://github.com/hanayashiki?ref=orpc" target="_blank" rel="noopener" title="hanayashiki"><img src="https://avatars.githubusercontent.com/u/26056783?u=06c3b9205a16fd41a871e82da1cc2a09306d53f5&amp;v=4" width="119" alt="hanayashiki"/><br />hanayashiki</a></td>
140
138
  <td align="center"><a href="https://github.com/ldub?ref=orpc" target="_blank" rel="noopener" title="Lev Dubinets"><img src="https://avatars.githubusercontent.com/u/3114081?u=f547f5d5012cab54851f1b1ad72d10e537f78fc2&amp;v=4" width="119" alt="Lev Dubinets"/><br />Lev Dubinets</a></td>
139
+ <td align="center"><a href="https://github.com/mr-kelly?ref=orpc" target="_blank" rel="noopener" title="Kelly Peilin Chan"><img src="https://avatars.githubusercontent.com/u/520852?u=6b0f7105f694e7b5cacf410a3f04c7044b469dc8&amp;v=4" width="119" alt="Kelly Peilin Chan"/><br />Kelly Peilin Chan</a></td>
141
140
  </tr>
142
141
  <tr>
143
- <td align="center"><a href="https://github.com/mr-kelly?ref=orpc" target="_blank" rel="noopener" title="Kelly Peilin Chan"><img src="https://avatars.githubusercontent.com/u/520852?u=6b0f7105f694e7b5cacf410a3f04c7044b469dc8&amp;v=4" width="119" alt="Kelly Peilin Chan"/><br />Kelly Peilin Chan</a></td>
144
142
  <td align="center"><a href="https://github.com/piscis?ref=orpc" target="_blank" rel="noopener" title="Alex"><img src="https://avatars.githubusercontent.com/u/326163?u=b245f368bd940cf51d08c0b6bf55f8257f359437&amp;v=4" width="119" alt="Alex"/><br />Alex</a></td>
145
143
  <td align="center"><a href="https://github.com/finom?ref=orpc" target="_blank" rel="noopener" title="Andrey Gubanov"><img src="https://avatars.githubusercontent.com/u/1082083?u=29e91400dbd4a9c217048a8f59562c4f740498e6&amp;v=4" width="119" alt="Andrey Gubanov"/><br />Andrey Gubanov</a></td>
146
144
  </tr>
@@ -173,6 +171,7 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
173
171
  <a href="https://github.com/nguyenlc1993?ref=orpc" target="_blank" rel="noopener" title="Lê Cao Nguyên"><img src="https://avatars.githubusercontent.com/u/13871971?u=83c8b69d9e35b589c4e1f066cc113b1d9461386f&amp;v=4" width="32" height="32" alt="Lê Cao Nguyên" /></a>
174
172
  <a href="https://github.com/wobsoriano?ref=orpc" target="_blank" rel="noopener" title="Robert Soriano"><img src="https://avatars.githubusercontent.com/u/13049130?u=6d72104182e7c9ed25934815313fb69107332111&amp;v=4" width="32" height="32" alt="Robert Soriano" /></a>
175
173
  <a href="https://github.com/andrewpeters9?ref=orpc" target="_blank" rel="noopener" title="Andrew Peters"><img src="https://avatars.githubusercontent.com/u/36251325?v=4" width="32" height="32" alt="Andrew Peters" /></a>
174
+ <a href="https://github.com/R44VC0RP?ref=orpc" target="_blank" rel="noopener" title="Ryan Vogel"><img src="https://avatars.githubusercontent.com/u/89211796?u=1857347b9787d8d8a7ea5bfc333f96be92d5a683&amp;v=4" width="32" height="32" alt="Ryan Vogel" /></a>
176
175
  <a href="https://github.com/SKostyukovich?ref=orpc" target="_blank" rel="noopener" title="SKostyukovich"><img src="https://avatars.githubusercontent.com/u/10700067?v=4" width="32" height="32" alt="SKostyukovich" /></a>
177
176
  <a href="https://github.com/peter-adam-dy?ref=orpc" target="_blank" rel="noopener" title="Peter Adam"><img src="https://avatars.githubusercontent.com/u/132129459?u=4f3dbbb3b443990b56acb7d6a5d11ed2c555f6db&amp;v=4" width="32" height="32" alt="Peter Adam" /></a>
178
177
  <a href="https://github.com/FabworksHQ?ref=orpc" target="_blank" rel="noopener" title="Fabworks"><img src="https://avatars.githubusercontent.com/u/160179500?v=4" width="32" height="32" alt="Fabworks" /></a>
@@ -185,6 +184,7 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
185
184
  <a href="https://github.com/nattstack?ref=orpc" target="_blank" rel="noopener" title="natt"><img src="https://avatars.githubusercontent.com/u/31426677?u=fa9dbb8b3e66eb0ea3c88db5dc07f31c8c5418fe&amp;v=4" width="32" height="32" alt="natt" /></a>
186
185
  <a href="https://github.com/ChromeGG?ref=orpc" target="_blank" rel="noopener" title="Adam Tkaczyk"><img src="https://avatars.githubusercontent.com/u/39050595?u=a58ca6042a6950e94e6e92442db76ef584279bc0&amp;v=4" width="32" height="32" alt="Adam Tkaczyk" /></a>
187
186
  <a href="https://github.com/plancraft?ref=orpc" target="_blank" rel="noopener" title="plancraft"><img src="https://avatars.githubusercontent.com/u/46482287?v=4" width="32" height="32" alt="plancraft" /></a>
187
+ <a href="https://github.com/Nic13Gamer?ref=orpc" target="_blank" rel="noopener" title="Nicholas"><img src="https://avatars.githubusercontent.com/u/54724556?u=56a7ab430ce7a80d648ab6eba051d454a818ed0b&amp;v=4" width="32" height="32" alt="Nicholas" /></a>
188
188
  </p>
189
189
 
190
190
  ## References
@@ -5,7 +5,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.mjs';
5
5
  import { S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.DDFizwfU.mjs';
6
6
  import { StandardPeerRequestHandlerOptions } from '../standard-peer/index.mjs';
7
7
  import { R as Router } from '../../shared/server.15O7oC1p.mjs';
8
- import { R as RPCHandlerCodecOptions } from '../../shared/server.B4BnEWWm.mjs';
8
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.omY4cUs0.mjs';
9
9
  import '@orpc/client';
10
10
  import '@orpc/contract';
11
11
  import '@standardserver/core';
@@ -5,7 +5,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.js';
5
5
  import { S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.BhsVw7m7.js';
6
6
  import { StandardPeerRequestHandlerOptions } from '../standard-peer/index.js';
7
7
  import { R as Router } from '../../shared/server.m3szVJGU.js';
8
- import { R as RPCHandlerCodecOptions } from '../../shared/server.CnN50DHH.js';
8
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.DG9aQpJK.js';
9
9
  import '@orpc/client';
10
10
  import '@orpc/contract';
11
11
  import '@standardserver/core';
@@ -1,12 +1,12 @@
1
1
  import { resolveMaybeOptionalOptions } from '@orpc/shared';
2
2
  import { ServerPeer, encodePeerMessage, decodePeerMessage, isClientPeerSendMessage } from '@standardserver/peer';
3
3
  import { c as createStandardPeerRequestHandler } from '../../shared/server.CX4vUnDk.mjs';
4
- import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.COPVXhDG.mjs';
4
+ import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.A8J9H8OE.mjs';
5
5
  import '@orpc/client';
6
6
  import '@standardserver/core';
7
7
  import '../../shared/server.DofEOwf-.mjs';
8
8
  import '@orpc/contract';
9
- import '../../shared/server.BoiFpNT7.mjs';
9
+ import '../../shared/server.D4cnq66J.mjs';
10
10
 
11
11
  class experimental_CrosswsHandler {
12
12
  constructor(handler, options = {}) {
@@ -4,7 +4,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.mjs';
4
4
  import { e as StandardHandlerPlugin, b as StandardHandlerHandleOptions, S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.DDFizwfU.mjs';
5
5
  import { FriendlyStandardHandlerHandleOptions } from '../standard/index.mjs';
6
6
  import { R as Router } from '../../shared/server.15O7oC1p.mjs';
7
- import { R as RPCHandlerCodecOptions } from '../../shared/server.B4BnEWWm.mjs';
7
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.omY4cUs0.mjs';
8
8
  import '@orpc/client';
9
9
  import '@orpc/contract';
10
10
  import '@standardserver/core';
@@ -4,7 +4,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.js';
4
4
  import { e as StandardHandlerPlugin, b as StandardHandlerHandleOptions, S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.BhsVw7m7.js';
5
5
  import { FriendlyStandardHandlerHandleOptions } from '../standard/index.js';
6
6
  import { R as Router } from '../../shared/server.m3szVJGU.js';
7
- import { R as RPCHandlerCodecOptions } from '../../shared/server.CnN50DHH.js';
7
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.DG9aQpJK.js';
8
8
  import '@orpc/client';
9
9
  import '@orpc/contract';
10
10
  import '@standardserver/core';
@@ -2,12 +2,12 @@ import { sortPlugins, intercept, resolveMaybeOptionalOptions, toArray } from '@o
2
2
  import { toStandardLazyRequest, toFetchResponse } from '@standardserver/fetch';
3
3
  import { r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.W91HSRkE.mjs';
4
4
  import { C as CSRFGuardHandlerPlugin } from '../../shared/server.D_QauotT.mjs';
5
- import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.COPVXhDG.mjs';
5
+ import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.A8J9H8OE.mjs';
6
6
  import '@orpc/client';
7
7
  import '@standardserver/core';
8
8
  import '../../shared/server.DofEOwf-.mjs';
9
9
  import '@orpc/contract';
10
- import '../../shared/server.BoiFpNT7.mjs';
10
+ import '../../shared/server.D4cnq66J.mjs';
11
11
 
12
12
  class CompositeFetchHandlerPlugin {
13
13
  name = "~composite/fetch-handler";
@@ -5,7 +5,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.mjs';
5
5
  import { S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.DDFizwfU.mjs';
6
6
  import { StandardPeerRequestHandlerOptions } from '../standard-peer/index.mjs';
7
7
  import { R as Router } from '../../shared/server.15O7oC1p.mjs';
8
- import { R as RPCHandlerCodecOptions } from '../../shared/server.B4BnEWWm.mjs';
8
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.omY4cUs0.mjs';
9
9
  import '@orpc/client';
10
10
  import '@orpc/contract';
11
11
  import '@standardserver/core';
@@ -5,7 +5,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.js';
5
5
  import { S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.BhsVw7m7.js';
6
6
  import { StandardPeerRequestHandlerOptions } from '../standard-peer/index.js';
7
7
  import { R as Router } from '../../shared/server.m3szVJGU.js';
8
- import { R as RPCHandlerCodecOptions } from '../../shared/server.CnN50DHH.js';
8
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.DG9aQpJK.js';
9
9
  import '@orpc/client';
10
10
  import '@orpc/contract';
11
11
  import '@standardserver/core';
@@ -2,12 +2,12 @@ import { onMessagePortMessage, onMessagePortClose, postMessagePortMessage } from
2
2
  import { value, resolveMaybeOptionalOptions } from '@orpc/shared';
3
3
  import { ServerPeer, encodePeerMessage, decodePeerMessage, isClientPeerSendMessage, isPeerMessage } from '@standardserver/peer';
4
4
  import { c as createStandardPeerRequestHandler } from '../../shared/server.CX4vUnDk.mjs';
5
- import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.COPVXhDG.mjs';
5
+ import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.A8J9H8OE.mjs';
6
6
  import '@orpc/client';
7
7
  import '@standardserver/core';
8
8
  import '../../shared/server.DofEOwf-.mjs';
9
9
  import '@orpc/contract';
10
- import '../../shared/server.BoiFpNT7.mjs';
10
+ import '../../shared/server.D4cnq66J.mjs';
11
11
 
12
12
  class MessagePortHandler {
13
13
  constructor(handler, options = {}) {
@@ -4,7 +4,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.mjs';
4
4
  import { e as StandardHandlerPlugin, b as StandardHandlerHandleOptions, S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.DDFizwfU.mjs';
5
5
  import { FriendlyStandardHandlerHandleOptions } from '../standard/index.mjs';
6
6
  import { R as Router } from '../../shared/server.15O7oC1p.mjs';
7
- import { R as RPCHandlerCodecOptions } from '../../shared/server.B4BnEWWm.mjs';
7
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.omY4cUs0.mjs';
8
8
  import '@orpc/client';
9
9
  import '@orpc/contract';
10
10
  import '@standardserver/core';
@@ -4,7 +4,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.js';
4
4
  import { e as StandardHandlerPlugin, b as StandardHandlerHandleOptions, S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.BhsVw7m7.js';
5
5
  import { FriendlyStandardHandlerHandleOptions } from '../standard/index.js';
6
6
  import { R as Router } from '../../shared/server.m3szVJGU.js';
7
- import { R as RPCHandlerCodecOptions } from '../../shared/server.CnN50DHH.js';
7
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.DG9aQpJK.js';
8
8
  import '@orpc/client';
9
9
  import '@orpc/contract';
10
10
  import '@standardserver/core';
@@ -2,12 +2,12 @@ import { sortPlugins, intercept, resolveMaybeOptionalOptions, toArray } from '@o
2
2
  import { toStandardLazyRequest, sendStandardResponse } from '@standardserver/node';
3
3
  import { r as resolveFriendlyStandardHandlerHandleOptions } from '../../shared/server.W91HSRkE.mjs';
4
4
  import { C as CSRFGuardHandlerPlugin } from '../../shared/server.D_QauotT.mjs';
5
- import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.COPVXhDG.mjs';
5
+ import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.A8J9H8OE.mjs';
6
6
  import '@orpc/client';
7
7
  import '@standardserver/core';
8
8
  import '../../shared/server.DofEOwf-.mjs';
9
9
  import '@orpc/contract';
10
- import '../../shared/server.BoiFpNT7.mjs';
10
+ import '../../shared/server.D4cnq66J.mjs';
11
11
 
12
12
  class CompositeNodeHttpHandlerPlugin {
13
13
  name = "~composite/node-http-handler";
@@ -1,6 +1,6 @@
1
1
  import { b as StandardHandlerHandleOptions } from '../../shared/server.DDFizwfU.mjs';
2
2
  export { C as CompositeStandardHandlerPlugin, O as OtelHandlerPlugin, S as StandardHandler, c as StandardHandlerCodec, d as StandardHandlerCodecResolvedProcedure, h as StandardHandlerHandleResult, i as StandardHandlerInterceptor, g as StandardHandlerInterceptorOptions, a as StandardHandlerOptions, e as StandardHandlerPlugin, j as StandardHandlerRoutingInterceptor, f as StandardHandlerRoutingInterceptorOptions } from '../../shared/server.DDFizwfU.mjs';
3
- export { a as RPCHandlerCodec, R as RPCHandlerCodecOptions, b as RPCMatcher, c as RPCMatcherOptions } from '../../shared/server.B4BnEWWm.mjs';
3
+ export { a as RPCHandlerCodec, R as RPCHandlerCodecOptions, b as RPCMatcher, c as RPCMatcherOptions } from '../../shared/server.omY4cUs0.mjs';
4
4
  import { C as Context } from '../../shared/server.CcR4kgje.mjs';
5
5
  export { StandardBody, StandardBodyHint, StandardHeaders, StandardLazyRequest, StandardLazyResponse, StandardMethod, StandardRequest, StandardResponse, StandardUrl } from '@standardserver/core';
6
6
  import '@orpc/client';
@@ -1,6 +1,6 @@
1
1
  import { b as StandardHandlerHandleOptions } from '../../shared/server.BhsVw7m7.js';
2
2
  export { C as CompositeStandardHandlerPlugin, O as OtelHandlerPlugin, S as StandardHandler, c as StandardHandlerCodec, d as StandardHandlerCodecResolvedProcedure, h as StandardHandlerHandleResult, i as StandardHandlerInterceptor, g as StandardHandlerInterceptorOptions, a as StandardHandlerOptions, e as StandardHandlerPlugin, j as StandardHandlerRoutingInterceptor, f as StandardHandlerRoutingInterceptorOptions } from '../../shared/server.BhsVw7m7.js';
3
- export { a as RPCHandlerCodec, R as RPCHandlerCodecOptions, b as RPCMatcher, c as RPCMatcherOptions } from '../../shared/server.CnN50DHH.js';
3
+ export { a as RPCHandlerCodec, R as RPCHandlerCodecOptions, b as RPCMatcher, c as RPCMatcherOptions } from '../../shared/server.DG9aQpJK.js';
4
4
  import { C as Context } from '../../shared/server.CcR4kgje.js';
5
5
  export { StandardBody, StandardBodyHint, StandardHeaders, StandardLazyRequest, StandardLazyResponse, StandardMethod, StandardRequest, StandardResponse, StandardUrl } from '@standardserver/core';
6
6
  import '@orpc/client';
@@ -1,8 +1,8 @@
1
- export { C as CompositeStandardHandlerPlugin, O as OtelHandlerPlugin, R as RPCHandlerCodec, a as RPCMatcher, S as StandardHandler } from '../../shared/server.COPVXhDG.mjs';
1
+ export { C as CompositeStandardHandlerPlugin, O as OtelHandlerPlugin, R as RPCHandlerCodec, a as RPCMatcher, S as StandardHandler } from '../../shared/server.A8J9H8OE.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 '@standardserver/core';
6
6
  import '../../shared/server.DofEOwf-.mjs';
7
7
  import '@orpc/contract';
8
- import '../../shared/server.BoiFpNT7.mjs';
8
+ import '../../shared/server.D4cnq66J.mjs';
@@ -4,7 +4,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.mjs';
4
4
  import { S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.DDFizwfU.mjs';
5
5
  import { StandardPeerRequestHandlerOptions } from '../standard-peer/index.mjs';
6
6
  import { R as Router } from '../../shared/server.15O7oC1p.mjs';
7
- import { R as RPCHandlerCodecOptions } from '../../shared/server.B4BnEWWm.mjs';
7
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.omY4cUs0.mjs';
8
8
  import '@orpc/client';
9
9
  import '@orpc/contract';
10
10
  import '@standardserver/core';
@@ -4,7 +4,7 @@ import { C as Context } from '../../shared/server.CcR4kgje.js';
4
4
  import { S as StandardHandler, a as StandardHandlerOptions } from '../../shared/server.BhsVw7m7.js';
5
5
  import { StandardPeerRequestHandlerOptions } from '../standard-peer/index.js';
6
6
  import { R as Router } from '../../shared/server.m3szVJGU.js';
7
- import { R as RPCHandlerCodecOptions } from '../../shared/server.CnN50DHH.js';
7
+ import { R as RPCHandlerCodecOptions } from '../../shared/server.DG9aQpJK.js';
8
8
  import '@orpc/client';
9
9
  import '@orpc/contract';
10
10
  import '@standardserver/core';
@@ -1,12 +1,12 @@
1
1
  import { toStringOrBytes, resolveMaybeOptionalOptions, sequential, loadBytes } from '@orpc/shared';
2
2
  import { ServerPeer, encodePeerMessage, decodePeerMessage, isClientPeerSendMessage } from '@standardserver/peer';
3
3
  import { c as createStandardPeerRequestHandler } from '../../shared/server.CX4vUnDk.mjs';
4
- import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.COPVXhDG.mjs';
4
+ import { R as RPCHandlerCodec, S as StandardHandler } from '../../shared/server.A8J9H8OE.mjs';
5
5
  import '@orpc/client';
6
6
  import '@standardserver/core';
7
7
  import '../../shared/server.DofEOwf-.mjs';
8
8
  import '@orpc/contract';
9
- import '../../shared/server.BoiFpNT7.mjs';
9
+ import '../../shared/server.D4cnq66J.mjs';
10
10
 
11
11
  class WebSocketHandler {
12
12
  constructor(handler, options = {}) {
package/dist/index.mjs CHANGED
@@ -5,8 +5,8 @@ export { AsyncIteratorClass, asyncIteratorToStream, asyncIteratorToUnproxiedData
5
5
  import { L as Lazy, P as Procedure, c as createProcedureClient } from './shared/server.DofEOwf-.mjs';
6
6
  export { a as createORPCErrorConstructorMap, u as unlazy } from './shared/server.DofEOwf-.mjs';
7
7
  import { D as DecoratedProcedure } from './shared/server.DBs0rrf9.mjs';
8
- import { b as augmentRouter, d as augmentImplementedRouter, e as withHiddenRouterContract, f as createGuardedProcedureLazy, g as getRouter } from './shared/server.BoiFpNT7.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.BoiFpNT7.mjs';
8
+ import { b as augmentRouter, d as augmentImplementedRouter, e as withHiddenRouterContract, f as createGuardedProcedureLazy, g as getRouter } from './shared/server.D4cnq66J.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.D4cnq66J.mjs';
10
10
  import { RECURSIVE_CLIENT_UNWRAP_KEYS } from '@orpc/client';
11
11
  export { COMMON_ERROR_STATUS_MAP, ORPCError, RPCJsonSerializer, RPCSerializer, cloneORPCError, isDefinedError, isInferableError, safe, toORPCError } from '@orpc/client';
12
12
  export { ErrorEvent, getEventMeta, unwrapEvent, withEventMeta } from '@standardserver/core';
@@ -2,7 +2,7 @@ import { ORPCError, toORPCError, RPCSerializer, COMMON_ERROR_STATUS_MAP } from '
2
2
  import { sortPlugins, getOpenTelemetryConfig, runWithSpan, toArray, matchesHttpPathPrefix, intercept, ORPC_NAME, isAsyncIteratorObject, override, traceAsyncIterator, recordSpanError, pathToHttpPath, normalizeHttpPath, value, parseEmptyableJSON } from '@orpc/shared';
3
3
  import { flattenStandardHeader, parseStandardUrl } from '@standardserver/core';
4
4
  import { c as createProcedureClient, u as unlazy, P as Procedure } from './server.DofEOwf-.mjs';
5
- import { w as walkProcedureContractsSync, g as getRouter, c as createContractProcedure, D as DEFAULT_SUCCESS_STATUS, a as DEFAULT_ERROR_STATUS } from './server.BoiFpNT7.mjs';
5
+ import { w as walkProcedureContractsSync, g as getRouter, c as createContractProcedure, D as DEFAULT_SUCCESS_STATUS, a as DEFAULT_ERROR_STATUS } from './server.D4cnq66J.mjs';
6
6
 
7
7
  class CompositeStandardHandlerPlugin {
8
8
  name = "~composite";
@@ -125,7 +125,7 @@ class RPCMatcher {
125
125
  filter;
126
126
  rootRouter;
127
127
  tree = /* @__PURE__ */ new Map();
128
- pendingLazyRouters = [];
128
+ pendingLazyRouters = /* @__PURE__ */ new Map();
129
129
  constructor(router, options = {}) {
130
130
  this.filter = options.filter ?? true;
131
131
  this.rootRouter = router;
@@ -136,26 +136,16 @@ class RPCMatcher {
136
136
  if (!value(this.filter, procedure, procedurePath)) {
137
137
  return;
138
138
  }
139
- const httpPath = pathToHttpPath(procedurePath);
140
- if (procedure instanceof Procedure) {
141
- this.tree.set(httpPath, {
142
- path: procedurePath,
143
- contract: procedure,
144
- procedure
145
- });
146
- } else {
147
- this.tree.set(httpPath, {
148
- path: procedurePath,
149
- contract: procedure
150
- });
151
- }
139
+ this.tree.set(pathToHttpPath(procedurePath), {
140
+ path: procedurePath,
141
+ contract: procedure,
142
+ // contract-first entries have no implementation yet, resolveProcedure fills it in on demand
143
+ procedure: procedure instanceof Procedure ? procedure : void 0
144
+ });
152
145
  }, path);
153
- this.pendingLazyRouters.push(
154
- ...lazyResults.map((result) => ({
155
- ...result,
156
- httpPathPrefix: pathToHttpPath(result.path)
157
- }))
158
- );
146
+ for (const result of lazyResults) {
147
+ this.pendingLazyRouters.set(pathToHttpPath(result.path), result);
148
+ }
159
149
  }
160
150
  async match(_method, pathname, prefix) {
161
151
  if (pathname.length > 1 && pathname.endsWith("/")) {
@@ -176,40 +166,67 @@ class RPCMatcher {
176
166
  return void 0;
177
167
  }
178
168
  }
179
- const result = await this.matchPathname(pathname);
180
- if (!result && pathname.includes("%")) {
181
- return this.matchPathname(normalizeHttpPath(pathname));
169
+ const loading = this.resolvePendingLazyRouters(pathname);
170
+ if (loading !== void 0) {
171
+ await loading;
182
172
  }
183
- return result;
184
- }
185
- async matchPathname(pathname) {
186
- await this.resolvePendingLazyRouters(pathname);
187
- const entry = this.tree.get(pathname);
188
- if (!entry) {
173
+ let entry = this.tree.get(pathname);
174
+ if (entry === void 0 && pathname.includes("%")) {
175
+ const normalizedPathname = normalizeHttpPath(pathname);
176
+ const normalizedLoading = this.resolvePendingLazyRouters(normalizedPathname);
177
+ if (normalizedLoading !== void 0) {
178
+ await normalizedLoading;
179
+ }
180
+ entry = this.tree.get(normalizedPathname);
181
+ }
182
+ if (entry === void 0) {
189
183
  return void 0;
190
184
  }
191
- const procedure = await this.resolveProcedure(entry);
192
- return { path: entry.path, procedure };
185
+ return {
186
+ path: entry.path,
187
+ procedure: entry.procedure ?? await this.resolveProcedure(entry)
188
+ };
193
189
  }
194
- async resolvePendingLazyRouters(pathname) {
195
- if (!this.pendingLazyRouters.length) {
190
+ resolvePendingLazyRouters(pathname) {
191
+ if (this.pendingLazyRouters.size === 0) {
196
192
  return;
197
193
  }
198
- const stillPending = [];
199
- for (const pending of this.pendingLazyRouters) {
200
- if (pathname.startsWith(pending.httpPathPrefix)) {
201
- const { default: router } = await unlazy(pending.router);
202
- this.index(router, pending.path);
203
- } else {
204
- stillPending.push(pending);
194
+ let slashIndex = 0;
195
+ while (slashIndex !== -1) {
196
+ const nextSlashIndex = pathname.indexOf("/", slashIndex + 1);
197
+ const httpPathPrefix = nextSlashIndex === -1 ? pathname : pathname.slice(0, nextSlashIndex);
198
+ if (this.pendingLazyRouters.has(httpPathPrefix)) {
199
+ return this.loadPendingLazyRouters(pathname, slashIndex);
205
200
  }
201
+ slashIndex = nextSlashIndex;
206
202
  }
207
- this.pendingLazyRouters = stillPending;
208
203
  }
209
- async resolveProcedure(entry) {
210
- if (entry.procedure) {
211
- return entry.procedure;
204
+ async loadPendingLazyRouters(pathname, slashIndex) {
205
+ while (slashIndex !== -1) {
206
+ const nextSlashIndex = pathname.indexOf("/", slashIndex + 1);
207
+ const httpPathPrefix = nextSlashIndex === -1 ? pathname : pathname.slice(0, nextSlashIndex);
208
+ const pending = this.pendingLazyRouters.get(httpPathPrefix);
209
+ if (pending !== void 0) {
210
+ await this.loadPendingLazyRouter(httpPathPrefix, pending);
211
+ }
212
+ slashIndex = nextSlashIndex;
213
+ }
214
+ }
215
+ loadPendingLazyRouter(httpPathPrefix, pending) {
216
+ if (pending.loading === void 0) {
217
+ pending.loading = this.indexPendingLazyRouter(httpPathPrefix, pending).catch((error) => {
218
+ pending.loading = void 0;
219
+ throw error;
220
+ });
212
221
  }
222
+ return pending.loading;
223
+ }
224
+ async indexPendingLazyRouter(httpPathPrefix, pending) {
225
+ const { default: router } = await unlazy(pending.router);
226
+ this.index(router, pending.path);
227
+ this.pendingLazyRouters.delete(httpPathPrefix);
228
+ }
229
+ async resolveProcedure(entry) {
213
230
  const { default: maybeProcedure } = await unlazy(getRouter(this.rootRouter, entry.path));
214
231
  if (!(maybeProcedure instanceof Procedure)) {
215
232
  throw new TypeError(
@@ -161,27 +161,32 @@ function getRouter(router, path) {
161
161
  return current;
162
162
  }
163
163
  function walkProcedureContractsSync(router, callback, path = []) {
164
+ const lazyResults = [];
165
+ walkProcedureContractsSyncInternal(router, callback, path.slice(), lazyResults);
166
+ return lazyResults;
167
+ }
168
+ function walkProcedureContractsSyncInternal(router, callback, path, lazyResults) {
164
169
  const hiddenContract = getHiddenRouterContract(router);
165
170
  if (hiddenContract !== void 0) {
166
171
  router = hiddenContract;
167
172
  }
168
173
  if (router instanceof ProcedureContract) {
169
- callback(router, path);
170
- return [];
174
+ callback(router, path.slice());
175
+ return;
171
176
  }
172
177
  if (!isTypescriptObject(router)) {
173
- return [];
178
+ return;
174
179
  }
175
- const lazyResults = [];
176
180
  for (const key in router) {
177
181
  const value = router[key];
182
+ path.push(key);
178
183
  if (value instanceof Lazy) {
179
- lazyResults.push({ router: value, path: [...path, key] });
184
+ lazyResults.push({ router: value, path: path.slice() });
180
185
  } else {
181
- lazyResults.push(...walkProcedureContractsSync(value, callback, [...path, key]));
186
+ walkProcedureContractsSyncInternal(value, callback, path, lazyResults);
182
187
  }
188
+ path.pop();
183
189
  }
184
- return lazyResults;
185
190
  }
186
191
  async function walkProcedureContractsAsync(router, callback, path = []) {
187
192
  const hiddenContract = getHiddenRouterContract(router);
@@ -18,15 +18,17 @@ declare class RPCMatcher {
18
18
  private readonly filter;
19
19
  private readonly rootRouter;
20
20
  private readonly tree;
21
- private pendingLazyRouters;
21
+ private readonly pendingLazyRouters;
22
22
  constructor(router: AnyRouter, options?: RPCMatcherOptions);
23
23
  private index;
24
24
  match(_method: StandardMethod, pathname: `/${string}`, prefix: `/${string}` | undefined): Promise<{
25
25
  path: string[];
26
26
  procedure: AnyProcedure;
27
27
  } | undefined>;
28
- private matchPathname;
29
28
  private resolvePendingLazyRouters;
29
+ private loadPendingLazyRouters;
30
+ private loadPendingLazyRouter;
31
+ private indexPendingLazyRouter;
30
32
  private resolveProcedure;
31
33
  }
32
34
 
@@ -18,15 +18,17 @@ declare class RPCMatcher {
18
18
  private readonly filter;
19
19
  private readonly rootRouter;
20
20
  private readonly tree;
21
- private pendingLazyRouters;
21
+ private readonly pendingLazyRouters;
22
22
  constructor(router: AnyRouter, options?: RPCMatcherOptions);
23
23
  private index;
24
24
  match(_method: StandardMethod, pathname: `/${string}`, prefix: `/${string}` | undefined): Promise<{
25
25
  path: string[];
26
26
  procedure: AnyProcedure;
27
27
  } | undefined>;
28
- private matchPathname;
29
28
  private resolvePendingLazyRouters;
29
+ private loadPendingLazyRouters;
30
+ private loadPendingLazyRouter;
31
+ private indexPendingLazyRouter;
30
32
  private resolveProcedure;
31
33
  }
32
34
 
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.21",
4
+ "version": "2.0.0-beta.22",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.dev",
7
7
  "repository": {
@@ -85,14 +85,14 @@
85
85
  }
86
86
  },
87
87
  "dependencies": {
88
- "@standardserver/core": "^0.5.0",
89
- "@standardserver/fetch": "^0.5.0",
90
- "@standardserver/node": "^0.5.0",
91
- "@standardserver/peer": "^0.5.0",
88
+ "@standardserver/core": "^0.6.0",
89
+ "@standardserver/fetch": "^0.6.0",
90
+ "@standardserver/node": "^0.6.0",
91
+ "@standardserver/peer": "^0.6.0",
92
92
  "cookie": "^2.0.1",
93
- "@orpc/client": "2.0.0-beta.21",
94
- "@orpc/shared": "2.0.0-beta.21",
95
- "@orpc/contract": "2.0.0-beta.21"
93
+ "@orpc/client": "2.0.0-beta.22",
94
+ "@orpc/contract": "2.0.0-beta.22",
95
+ "@orpc/shared": "2.0.0-beta.22"
96
96
  },
97
97
  "devDependencies": {
98
98
  "crossws": "^0.4.6",