@orpc/client 1.15.1 → 1.15.3
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 +1 -80
- package/dist/adapters/fetch/index.d.mts +1 -1
- package/dist/adapters/fetch/index.d.ts +1 -1
- package/dist/adapters/fetch/index.mjs +2 -2
- package/dist/adapters/message-port/index.d.mts +1 -1
- package/dist/adapters/message-port/index.d.ts +1 -1
- package/dist/adapters/message-port/index.mjs +2 -2
- package/dist/adapters/standard/index.d.mts +1 -1
- package/dist/adapters/standard/index.d.ts +1 -1
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/adapters/websocket/index.d.mts +1 -1
- package/dist/adapters/websocket/index.d.ts +1 -1
- package/dist/adapters/websocket/index.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/plugins/index.mjs +1 -1
- package/dist/shared/{client.lSRQX-Yb.mjs → client.BZfetktb.mjs} +1 -1
- package/dist/shared/{client.BFAVy68H.d.mts → client.DfYtAZrm.d.mts} +3 -0
- package/dist/shared/{client.B3pNRBih.d.ts → client.Ssn6VTjO.d.ts} +3 -0
- package/dist/shared/{client.B4gi67kE.mjs → client.taWlwxQ4.mjs} +61 -18
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -92,86 +92,7 @@ const client: ContractRouterClient<typeof contract> = createORPCClient(link)
|
|
|
92
92
|
|
|
93
93
|
If you find oRPC valuable and would like to support its development, you can do so here: [GitHub Sponsors](https://github.com/sponsors/dinwwwh).
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
<table>
|
|
98
|
-
<tr>
|
|
99
|
-
<td align="center"><a href="https://screenshotone.com/?ref=orpc" target="_blank" rel="sponsored noopener" title="ScreenshotOne.com"><img src="https://avatars.githubusercontent.com/u/97035603?v=4" width="279" alt="ScreenshotOne.com"/><br />ScreenshotOne.com</a></td>
|
|
100
|
-
</tr>
|
|
101
|
-
</table>
|
|
102
|
-
|
|
103
|
-
### 🥈 Silver Sponsor
|
|
104
|
-
|
|
105
|
-
<table>
|
|
106
|
-
<tr>
|
|
107
|
-
<td align="center"><a href="https://misskey.io/?ref=orpc" target="_blank" rel="sponsored noopener" title="村上さん"><img src="https://avatars.githubusercontent.com/u/37681609?u=0dd4c7e4ba937cbb52b068c55914b1d8164dc0c7&v=4" width="209" alt="村上さん"/><br />村上さん</a></td>
|
|
108
|
-
</tr>
|
|
109
|
-
</table>
|
|
110
|
-
|
|
111
|
-
### Generous Sponsors
|
|
112
|
-
|
|
113
|
-
<table>
|
|
114
|
-
<tr>
|
|
115
|
-
<td align="center"><a href="https://github.com/ln-markets?ref=orpc" target="_blank" rel="sponsored noopener" title="LN Markets"><img src="https://avatars.githubusercontent.com/u/70597625?v=4" width="167" alt="LN Markets"/><br />LN Markets</a></td>
|
|
116
|
-
</tr>
|
|
117
|
-
</table>
|
|
118
|
-
|
|
119
|
-
### Sponsors
|
|
120
|
-
|
|
121
|
-
<table>
|
|
122
|
-
<tr>
|
|
123
|
-
<td align="center"><a href="https://github.com/hrmcdonald?ref=orpc" target="_blank" rel="sponsored noopener" title="Reece McDonald"><img src="https://avatars.githubusercontent.com/u/39349270?v=4" width="139" alt="Reece McDonald"/><br />Reece McDonald</a></td>
|
|
124
|
-
<td align="center"><a href="https://github.com/u1-liquid?ref=orpc" target="_blank" rel="sponsored noopener" title="あわわわとーにゅ"><img src="https://avatars.githubusercontent.com/u/17376330?u=de3353804be889f009f7e0a1582daf04d0ab292d&v=4" width="139" alt="あわわわとーにゅ"/><br />あわわわとーにゅ</a></td>
|
|
125
|
-
<td align="center"><a href="https://github.com/nicognaW?ref=orpc" target="_blank" rel="sponsored noopener" title="nk"><img src="https://avatars.githubusercontent.com/u/66731869?u=4699bda3a9092d3ec34fbd959450767bcc8b8b6d&v=4" width="139" alt="nk"/><br />nk</a></td>
|
|
126
|
-
<td align="center"><a href="https://github.com/supastarter?ref=orpc" target="_blank" rel="sponsored noopener" title="supastarter"><img src="https://avatars.githubusercontent.com/u/110960143?v=4" width="139" alt="supastarter"/><br />supastarter</a></td>
|
|
127
|
-
<td align="center"><a href="https://github.com/divmgl?ref=orpc" target="_blank" rel="sponsored noopener" 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>
|
|
128
|
-
<td align="center"><a href="https://github.com/herrfugbaum?ref=orpc" target="_blank" rel="sponsored noopener" title="herrfugbaum"><img src="https://avatars.githubusercontent.com/u/12859776?u=644dc1666d0220bc0468eb0de3c56b919f635b16&v=4" width="139" alt="herrfugbaum"/><br />herrfugbaum</a></td>
|
|
129
|
-
</tr>
|
|
130
|
-
<tr>
|
|
131
|
-
<td align="center"><a href="https://github.com/ryota-murakami?ref=orpc" target="_blank" rel="sponsored noopener" 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
|
-
<td align="center"><a href="https://github.com/dcramer?ref=orpc" target="_blank" rel="sponsored noopener" title="David Cramer"><img src="https://avatars.githubusercontent.com/u/23610?v=4" width="139" alt="David Cramer"/><br />David Cramer</a></td>
|
|
133
|
-
<td align="center"><a href="https://github.com/valerii15298?ref=orpc" target="_blank" rel="sponsored noopener" 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>
|
|
134
|
-
<td align="center"><a href="https://github.com/letstri?ref=orpc" target="_blank" rel="sponsored noopener" 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>
|
|
135
|
-
<td align="center"><a href="https://github.com/K-Mistele?ref=orpc" target="_blank" rel="sponsored noopener" 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>
|
|
136
|
-
<td align="center"><a href="https://github.com/christ12938?ref=orpc" target="_blank" rel="sponsored noopener" title="christ12938"><img src="https://avatars.githubusercontent.com/u/25758598?v=4" width="139" alt="christ12938"/><br />christ12938</a></td>
|
|
137
|
-
</tr>
|
|
138
|
-
<tr>
|
|
139
|
-
<td align="center"><a href="https://github.com/Ryanjso?ref=orpc" target="_blank" rel="sponsored noopener" 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
|
-
<td align="center"><a href="https://github.com/itigoore01?ref=orpc" target="_blank" rel="sponsored noopener" title="shota"><img src="https://avatars.githubusercontent.com/u/11831107?u=c976a6dc7e055eb026304c46c99100ed22b0c8e0&v=4" width="139" alt="shota"/><br />shota</a></td>
|
|
141
|
-
<td align="center"><a href="https://github.com/ellis-driscoll?ref=orpc" target="_blank" rel="sponsored noopener" 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>
|
|
142
|
-
<td align="center"><a href="https://github.com/hoangbn?ref=orpc" target="_blank" rel="sponsored noopener" 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>
|
|
143
|
-
</tr>
|
|
144
|
-
</table>
|
|
145
|
-
|
|
146
|
-
### Backers
|
|
147
|
-
|
|
148
|
-
<table>
|
|
149
|
-
<tr>
|
|
150
|
-
<td align="center"><a href="https://github.com/rhinodavid?ref=orpc" target="_blank" rel="sponsored noopener" title="David Walsh"><img src="https://avatars.githubusercontent.com/u/5778036?u=b5521f07d2f88c3db2a0dae62b5f2f8357214af0&v=4" width="119" alt="David Walsh"/><br />David Walsh</a></td>
|
|
151
|
-
<td align="center"><a href="https://github.com/Robbe95?ref=orpc" target="_blank" rel="sponsored noopener" title="Robbe Vaes"><img src="https://avatars.githubusercontent.com/u/44748019?u=e0232402c045ad4eac7cbd217f1f47e083103b89&v=4" width="119" alt="Robbe Vaes"/><br />Robbe Vaes</a></td>
|
|
152
|
-
<td align="center"><a href="https://github.com/aidansunbury?ref=orpc" target="_blank" rel="sponsored noopener" title="Aidan Sunbury"><img src="https://avatars.githubusercontent.com/u/64103161?v=4" width="119" alt="Aidan Sunbury"/><br />Aidan Sunbury</a></td>
|
|
153
|
-
<td align="center"><a href="https://github.com/soonoo?ref=orpc" target="_blank" rel="sponsored noopener" title="soonoo"><img src="https://avatars.githubusercontent.com/u/5436405?u=5d0b4aa955c87e30e6bda7f0cccae5402da99528&v=4" width="119" alt="soonoo"/><br />soonoo</a></td>
|
|
154
|
-
<td align="center"><a href="https://github.com/kporten?ref=orpc" target="_blank" rel="sponsored noopener" title="Kevin Porten"><img src="https://avatars.githubusercontent.com/u/1839345?u=dc2263d5cfe0d927ce1a0be04a1d55dd6b55405c&v=4" width="119" alt="Kevin Porten"/><br />Kevin Porten</a></td>
|
|
155
|
-
<td align="center"><a href="https://github.com/pumpkinlink?ref=orpc" target="_blank" rel="sponsored noopener" title="Denis"><img src="https://avatars.githubusercontent.com/u/11864620?u=5f47bbe6c65d0f6f5cf011021490238e4b0593d0&v=4" width="119" alt="Denis"/><br />Denis</a></td>
|
|
156
|
-
<td align="center"><a href="https://github.com/christopher-kapic?ref=orpc" target="_blank" rel="sponsored noopener" title="Christopher Kapic"><img src="https://avatars.githubusercontent.com/u/59740769?u=e7ad4b72b5bf6c9eb1644c26dbf3332a8f987377&v=4" width="119" alt="Christopher Kapic"/><br />Christopher Kapic</a></td>
|
|
157
|
-
</tr>
|
|
158
|
-
<tr>
|
|
159
|
-
<td align="center"><a href="https://github.com/thomasballinger?ref=orpc" target="_blank" rel="sponsored noopener" title="Tom Ballinger"><img src="https://avatars.githubusercontent.com/u/458879?u=4b045ac75d721b6ac2b42a74d7d37f61f0414031&v=4" width="119" alt="Tom Ballinger"/><br />Tom Ballinger</a></td>
|
|
160
|
-
<td align="center"><a href="https://github.com/SSam0419?ref=orpc" target="_blank" rel="sponsored noopener" title="Sam"><img src="https://avatars.githubusercontent.com/u/102863520?u=3c89611f549d5070be232eb4532f690c8f2e7a65&v=4" width="119" alt="Sam"/><br />Sam</a></td>
|
|
161
|
-
<td align="center"><a href="https://github.com/Titoine?ref=orpc" target="_blank" rel="sponsored noopener" title="Titoine"><img src="https://avatars.githubusercontent.com/u/3514286?u=1bb1e86b0c99c8a1121372e56d51a177eea12191&v=4" width="119" alt="Titoine"/><br />Titoine</a></td>
|
|
162
|
-
<td align="center"><a href="https://github.com/Mnigos?ref=orpc" target="_blank" rel="sponsored noopener" title="Igor Makowski"><img src="https://avatars.githubusercontent.com/u/56691628?u=ee8c879478f7c151b9156aef6c74243fa3e247a8&v=4" width="119" alt="Igor Makowski"/><br />Igor Makowski</a></td>
|
|
163
|
-
<td align="center"><a href="https://github.com/hanayashiki?ref=orpc" target="_blank" rel="sponsored noopener" title="hanayashiki"><img src="https://avatars.githubusercontent.com/u/26056783?u=06c3b9205a16fd41a871e82da1cc2a09306d53f5&v=4" width="119" alt="hanayashiki"/><br />hanayashiki</a></td>
|
|
164
|
-
<td align="center"><a href="https://github.com/ldub?ref=orpc" target="_blank" rel="sponsored noopener" title="Lev Dubinets"><img src="https://avatars.githubusercontent.com/u/3114081?u=f547f5d5012cab54851f1b1ad72d10e537f78fc2&v=4" width="119" alt="Lev Dubinets"/><br />Lev Dubinets</a></td>
|
|
165
|
-
<td align="center"><a href="https://github.com/mr-kelly?ref=orpc" target="_blank" rel="sponsored noopener" 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>
|
|
166
|
-
</tr>
|
|
167
|
-
<tr>
|
|
168
|
-
<td align="center"><a href="https://github.com/guyariely?ref=orpc" target="_blank" rel="sponsored noopener" 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>
|
|
169
|
-
<td align="center"><a href="https://github.com/piscis?ref=orpc" target="_blank" rel="sponsored noopener" title="Alex"><img src="https://avatars.githubusercontent.com/u/326163?u=b245f368bd940cf51d08c0b6bf55f8257f359437&v=4" width="119" alt="Alex"/><br />Alex</a></td>
|
|
170
|
-
<td align="center"><a href="https://github.com/finom?ref=orpc" target="_blank" rel="sponsored noopener" 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>
|
|
171
|
-
</tr>
|
|
172
|
-
</table>
|
|
173
|
-
|
|
174
|
-
With thanks to 37 past sponsors who helped get oRPC here.
|
|
95
|
+
[](https://htmlpreview.github.io/?https://github.com/middleapi/static/blob/main/sponsors.svg)
|
|
175
96
|
|
|
176
97
|
## License
|
|
177
98
|
|
|
@@ -3,7 +3,7 @@ import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
|
|
3
3
|
import { ToFetchRequestOptions } from '@orpc/standard-server-fetch';
|
|
4
4
|
import { b as ClientContext, c as ClientOptions } from '../../shared/client.i2uoJbEp.mjs';
|
|
5
5
|
import { a as StandardLinkPlugin, f as StandardLinkClient } from '../../shared/client.CpCa3si8.mjs';
|
|
6
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
|
6
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.DfYtAZrm.mjs';
|
|
7
7
|
|
|
8
8
|
interface LinkFetchPlugin<T extends ClientContext> extends StandardLinkPlugin<T> {
|
|
9
9
|
initRuntimeAdapter?(options: LinkFetchClientOptions<T>): void;
|
|
@@ -3,7 +3,7 @@ import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
|
|
3
3
|
import { ToFetchRequestOptions } from '@orpc/standard-server-fetch';
|
|
4
4
|
import { b as ClientContext, c as ClientOptions } from '../../shared/client.i2uoJbEp.js';
|
|
5
5
|
import { a as StandardLinkPlugin, f as StandardLinkClient } from '../../shared/client.2jUAqzYU.js';
|
|
6
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
|
6
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.Ssn6VTjO.js';
|
|
7
7
|
|
|
8
8
|
interface LinkFetchPlugin<T extends ClientContext> extends StandardLinkPlugin<T> {
|
|
9
9
|
initRuntimeAdapter?(options: LinkFetchClientOptions<T>): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { toArray, intercept } from '@orpc/shared';
|
|
2
2
|
import { toFetchRequest, toStandardLazyResponse } from '@orpc/standard-server-fetch';
|
|
3
|
-
import { C as CompositeStandardLinkPlugin, c as StandardRPCLink } from '../../shared/client.
|
|
3
|
+
import { C as CompositeStandardLinkPlugin, c as StandardRPCLink } from '../../shared/client.taWlwxQ4.mjs';
|
|
4
4
|
import '@orpc/standard-server';
|
|
5
|
-
import '../../shared/client.
|
|
5
|
+
import '../../shared/client.BZfetktb.mjs';
|
|
6
6
|
import '../../shared/client.BLtwTQUg.mjs';
|
|
7
7
|
|
|
8
8
|
class CompositeLinkFetchPlugin extends CompositeStandardLinkPlugin {
|
|
@@ -3,7 +3,7 @@ import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
|
|
3
3
|
import { DecodedRequestMessage } from '@orpc/standard-server-peer';
|
|
4
4
|
import { b as ClientContext, c as ClientOptions } from '../../shared/client.i2uoJbEp.mjs';
|
|
5
5
|
import { f as StandardLinkClient } from '../../shared/client.CpCa3si8.mjs';
|
|
6
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
|
6
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.DfYtAZrm.mjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The message port used by electron in main process
|
|
@@ -3,7 +3,7 @@ import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
|
|
3
3
|
import { DecodedRequestMessage } from '@orpc/standard-server-peer';
|
|
4
4
|
import { b as ClientContext, c as ClientOptions } from '../../shared/client.i2uoJbEp.js';
|
|
5
5
|
import { f as StandardLinkClient } from '../../shared/client.2jUAqzYU.js';
|
|
6
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
|
6
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.Ssn6VTjO.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The message port used by electron in main process
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { value, isObject } from '@orpc/shared';
|
|
2
2
|
import { experimental_ClientPeerWithoutCodec, serializeRequestMessage, encodeRequestMessage, deserializeResponseMessage, decodeResponseMessage } from '@orpc/standard-server-peer';
|
|
3
|
-
import { c as StandardRPCLink } from '../../shared/client.
|
|
3
|
+
import { c as StandardRPCLink } from '../../shared/client.taWlwxQ4.mjs';
|
|
4
4
|
import '@orpc/standard-server';
|
|
5
|
-
import '../../shared/client.
|
|
5
|
+
import '../../shared/client.BZfetktb.mjs';
|
|
6
6
|
import '@orpc/standard-server-fetch';
|
|
7
7
|
import '../../shared/client.BLtwTQUg.mjs';
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { C as CompositeStandardLinkPlugin, d as StandardLink, f as StandardLinkClient, S as StandardLinkClientInterceptorOptions, e as StandardLinkCodec, c as StandardLinkInterceptorOptions, b as StandardLinkOptions, a as StandardLinkPlugin } from '../../shared/client.CpCa3si8.mjs';
|
|
2
|
-
export { S as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, c as StandardRPCCustomJsonSerializer, b as StandardRPCJsonSerialized, a as StandardRPCJsonSerializedMetaItem, e as StandardRPCJsonSerializer, d as StandardRPCJsonSerializerOptions, g as StandardRPCLink, i as StandardRPCLinkCodec, h as StandardRPCLinkCodecOptions, f as StandardRPCLinkOptions, j as StandardRPCSerializer } from '../../shared/client.
|
|
2
|
+
export { S as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, c as StandardRPCCustomJsonSerializer, b as StandardRPCJsonSerialized, a as StandardRPCJsonSerializedMetaItem, e as StandardRPCJsonSerializer, d as StandardRPCJsonSerializerOptions, g as StandardRPCLink, i as StandardRPCLinkCodec, h as StandardRPCLinkCodecOptions, f as StandardRPCLinkOptions, j as StandardRPCSerializer } from '../../shared/client.DfYtAZrm.mjs';
|
|
3
3
|
import { StandardHeaders } from '@orpc/standard-server';
|
|
4
4
|
import { H as HTTPPath } from '../../shared/client.i2uoJbEp.mjs';
|
|
5
5
|
import '@orpc/shared';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { C as CompositeStandardLinkPlugin, d as StandardLink, f as StandardLinkClient, S as StandardLinkClientInterceptorOptions, e as StandardLinkCodec, c as StandardLinkInterceptorOptions, b as StandardLinkOptions, a as StandardLinkPlugin } from '../../shared/client.2jUAqzYU.js';
|
|
2
|
-
export { S as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, c as StandardRPCCustomJsonSerializer, b as StandardRPCJsonSerialized, a as StandardRPCJsonSerializedMetaItem, e as StandardRPCJsonSerializer, d as StandardRPCJsonSerializerOptions, g as StandardRPCLink, i as StandardRPCLinkCodec, h as StandardRPCLinkCodecOptions, f as StandardRPCLinkOptions, j as StandardRPCSerializer } from '../../shared/client.
|
|
2
|
+
export { S as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, c as StandardRPCCustomJsonSerializer, b as StandardRPCJsonSerialized, a as StandardRPCJsonSerializedMetaItem, e as StandardRPCJsonSerializer, d as StandardRPCJsonSerializerOptions, g as StandardRPCLink, i as StandardRPCLinkCodec, h as StandardRPCLinkCodecOptions, f as StandardRPCLinkOptions, j as StandardRPCSerializer } from '../../shared/client.Ssn6VTjO.js';
|
|
3
3
|
import { StandardHeaders } from '@orpc/standard-server';
|
|
4
4
|
import { H as HTTPPath } from '../../shared/client.i2uoJbEp.js';
|
|
5
5
|
import '@orpc/shared';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CompositeStandardLinkPlugin, a as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, S as StandardLink, b as StandardRPCJsonSerializer, c as StandardRPCLink, d as StandardRPCLinkCodec, e as StandardRPCSerializer, g as getMalformedResponseErrorCode, t as toHttpPath, f as toStandardHeaders } from '../../shared/client.
|
|
1
|
+
export { C as CompositeStandardLinkPlugin, a as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, S as StandardLink, b as StandardRPCJsonSerializer, c as StandardRPCLink, d as StandardRPCLinkCodec, e as StandardRPCSerializer, g as getMalformedResponseErrorCode, t as toHttpPath, f as toStandardHeaders } from '../../shared/client.taWlwxQ4.mjs';
|
|
2
2
|
import '@orpc/shared';
|
|
3
3
|
import '@orpc/standard-server';
|
|
4
|
-
import '../../shared/client.
|
|
4
|
+
import '../../shared/client.BZfetktb.mjs';
|
|
5
5
|
import '@orpc/standard-server-fetch';
|
|
6
6
|
import '../../shared/client.BLtwTQUg.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
|
2
2
|
import { b as ClientContext, c as ClientOptions } from '../../shared/client.i2uoJbEp.mjs';
|
|
3
3
|
import { f as StandardLinkClient } from '../../shared/client.CpCa3si8.mjs';
|
|
4
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
|
4
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.DfYtAZrm.mjs';
|
|
5
5
|
import '@orpc/shared';
|
|
6
6
|
|
|
7
7
|
interface LinkWebsocketClientOptions {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
|
2
2
|
import { b as ClientContext, c as ClientOptions } from '../../shared/client.i2uoJbEp.js';
|
|
3
3
|
import { f as StandardLinkClient } from '../../shared/client.2jUAqzYU.js';
|
|
4
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
|
4
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.Ssn6VTjO.js';
|
|
5
5
|
import '@orpc/shared';
|
|
6
6
|
|
|
7
7
|
interface LinkWebsocketClientOptions {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { readAsBuffer } from '@orpc/shared';
|
|
2
2
|
import { ClientPeer } from '@orpc/standard-server-peer';
|
|
3
|
-
import { c as StandardRPCLink } from '../../shared/client.
|
|
3
|
+
import { c as StandardRPCLink } from '../../shared/client.taWlwxQ4.mjs';
|
|
4
4
|
import '@orpc/standard-server';
|
|
5
|
-
import '../../shared/client.
|
|
5
|
+
import '../../shared/client.BZfetktb.mjs';
|
|
6
6
|
import '@orpc/standard-server-fetch';
|
|
7
7
|
import '../../shared/client.BLtwTQUg.mjs';
|
|
8
8
|
|
package/dist/index.d.mts
CHANGED
|
@@ -207,7 +207,7 @@ type SafeClient<T extends NestedClient<any>> = T extends Client<infer UContext,
|
|
|
207
207
|
declare function createSafeClient<T extends NestedClient<any>>(client: T): SafeClient<T>;
|
|
208
208
|
|
|
209
209
|
declare const ORPC_CLIENT_PACKAGE_NAME = "@orpc/client";
|
|
210
|
-
declare const ORPC_CLIENT_PACKAGE_VERSION = "1.15.
|
|
210
|
+
declare const ORPC_CLIENT_PACKAGE_VERSION = "1.15.3";
|
|
211
211
|
/**
|
|
212
212
|
* Property names that should resolve to the underlying value instead of
|
|
213
213
|
* continuing recursive proxy traversal.
|
package/dist/index.d.ts
CHANGED
|
@@ -207,7 +207,7 @@ type SafeClient<T extends NestedClient<any>> = T extends Client<infer UContext,
|
|
|
207
207
|
declare function createSafeClient<T extends NestedClient<any>>(client: T): SafeClient<T>;
|
|
208
208
|
|
|
209
209
|
declare const ORPC_CLIENT_PACKAGE_NAME = "@orpc/client";
|
|
210
|
-
declare const ORPC_CLIENT_PACKAGE_VERSION = "1.15.
|
|
210
|
+
declare const ORPC_CLIENT_PACKAGE_VERSION = "1.15.3";
|
|
211
211
|
/**
|
|
212
212
|
* Property names that should resolve to the underlying value instead of
|
|
213
213
|
* continuing recursive proxy traversal.
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { preventNativeAwait, isTypescriptObject } from '@orpc/shared';
|
|
2
2
|
export { AsyncIteratorClass, EventPublisher, asyncIteratorToStream as eventIteratorToStream, asyncIteratorToUnproxiedDataStream as eventIteratorToUnproxiedDataStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@orpc/shared';
|
|
3
|
-
import { i as isDefinedError, R as RECURSIVE_CLIENT_UNWRAP_KEYS } from './shared/client.
|
|
4
|
-
export { C as COMMON_ORPC_ERROR_DEFS, c as ORPCError, O as ORPC_CLIENT_PACKAGE_NAME, a as ORPC_CLIENT_PACKAGE_VERSION, g as createORPCErrorFromJson, b as fallbackORPCErrorMessage, f as fallbackORPCErrorStatus, e as isORPCErrorJson, d as isORPCErrorStatus, t as toORPCError } from './shared/client.
|
|
3
|
+
import { i as isDefinedError, R as RECURSIVE_CLIENT_UNWRAP_KEYS } from './shared/client.BZfetktb.mjs';
|
|
4
|
+
export { C as COMMON_ORPC_ERROR_DEFS, c as ORPCError, O as ORPC_CLIENT_PACKAGE_NAME, a as ORPC_CLIENT_PACKAGE_VERSION, g as createORPCErrorFromJson, b as fallbackORPCErrorMessage, f as fallbackORPCErrorStatus, e as isORPCErrorJson, d as isORPCErrorStatus, t as toORPCError } from './shared/client.BZfetktb.mjs';
|
|
5
5
|
export { m as mapEventIterator } from './shared/client.BLtwTQUg.mjs';
|
|
6
6
|
export { ErrorEvent, getEventMeta, withEventMeta } from '@orpc/standard-server';
|
|
7
7
|
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isAsyncIteratorObject, defer, value, splitInHalf, toArray, stringifyJSON, overlayProxy, AsyncIteratorClass } from '@orpc/shared';
|
|
2
2
|
import { toBatchRequest, parseBatchResponse, toBatchAbortSignal } from '@orpc/standard-server/batch';
|
|
3
3
|
import { replicateStandardLazyResponse, getEventMeta, flattenHeader } from '@orpc/standard-server';
|
|
4
|
-
import { C as COMMON_ORPC_ERROR_DEFS } from '../shared/client.
|
|
4
|
+
import { C as COMMON_ORPC_ERROR_DEFS } from '../shared/client.BZfetktb.mjs';
|
|
5
5
|
|
|
6
6
|
class BatchLinkPlugin {
|
|
7
7
|
groups;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions, getConstructor, isObject } from '@orpc/shared';
|
|
2
2
|
|
|
3
3
|
const ORPC_CLIENT_PACKAGE_NAME = "@orpc/client";
|
|
4
|
-
const ORPC_CLIENT_PACKAGE_VERSION = "1.15.
|
|
4
|
+
const ORPC_CLIENT_PACKAGE_VERSION = "1.15.3";
|
|
5
5
|
const RECURSIVE_CLIENT_UNWRAP_KEYS = /* @__PURE__ */ new Set([
|
|
6
6
|
/**
|
|
7
7
|
* Commonly used by libraries to bind functions to a specific `this`
|
|
@@ -19,6 +19,9 @@ interface StandardRPCCustomJsonSerializer {
|
|
|
19
19
|
type: number;
|
|
20
20
|
condition(data: unknown): boolean;
|
|
21
21
|
serialize(data: any): unknown;
|
|
22
|
+
/**
|
|
23
|
+
* `serialized` comes from the wire, so validate its type and throw on mismatch.
|
|
24
|
+
*/
|
|
22
25
|
deserialize(serialized: any): unknown;
|
|
23
26
|
}
|
|
24
27
|
interface StandardRPCJsonSerializerOptions {
|
|
@@ -19,6 +19,9 @@ interface StandardRPCCustomJsonSerializer {
|
|
|
19
19
|
type: number;
|
|
20
20
|
condition(data: unknown): boolean;
|
|
21
21
|
serialize(data: any): unknown;
|
|
22
|
+
/**
|
|
23
|
+
* `serialized` comes from the wire, so validate its type and throw on mismatch.
|
|
24
|
+
*/
|
|
22
25
|
deserialize(serialized: any): unknown;
|
|
23
26
|
}
|
|
24
27
|
interface StandardRPCJsonSerializerOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toArray, runWithSpan, ORPC_NAME, isAsyncIteratorObject, asyncIteratorWithSpan, intercept, getGlobalOtelConfig, isObject, value, stringifyJSON } from '@orpc/shared';
|
|
1
|
+
import { toArray, runWithSpan, ORPC_NAME, isAsyncIteratorObject, asyncIteratorWithSpan, intercept, getGlobalOtelConfig, isObject, copyOnWrite, isValidRegExpFlags, createLazyRegExp, value, stringifyJSON } from '@orpc/shared';
|
|
2
2
|
import { mergeStandardHeaders, ErrorEvent } from '@orpc/standard-server';
|
|
3
|
-
import { C as COMMON_ORPC_ERROR_DEFS, d as isORPCErrorStatus, e as isORPCErrorJson, g as createORPCErrorFromJson, c as ORPCError, t as toORPCError } from './client.
|
|
3
|
+
import { C as COMMON_ORPC_ERROR_DEFS, d as isORPCErrorStatus, e as isORPCErrorJson, g as createORPCErrorFromJson, c as ORPCError, t as toORPCError } from './client.BZfetktb.mjs';
|
|
4
4
|
import { toStandardHeaders as toStandardHeaders$1 } from '@orpc/standard-server-fetch';
|
|
5
5
|
import { m as mapEventIterator } from './client.BLtwTQUg.mjs';
|
|
6
6
|
|
|
@@ -87,6 +87,14 @@ const STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES = {
|
|
|
87
87
|
SET: 6,
|
|
88
88
|
MAP: 7
|
|
89
89
|
};
|
|
90
|
+
const BUILT_IN_TYPES = new Set(Object.values(STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES));
|
|
91
|
+
const SERIALIZED_REGEXP_FORMAT = /^\/(.*)\/([a-z]*)$/;
|
|
92
|
+
function invalidSerializedData(detail) {
|
|
93
|
+
return new TypeError(`Invalid RPC serialized data: ${detail}`);
|
|
94
|
+
}
|
|
95
|
+
function invalidSerializedType(type, name, expected) {
|
|
96
|
+
return invalidSerializedData(`type ${type} (${name}) expects ${expected}.`);
|
|
97
|
+
}
|
|
90
98
|
class StandardRPCJsonSerializer {
|
|
91
99
|
customSerializers;
|
|
92
100
|
constructor(options = {}) {
|
|
@@ -165,15 +173,18 @@ class StandardRPCJsonSerializer {
|
|
|
165
173
|
}
|
|
166
174
|
deserialize(json, meta, maps, getBlob) {
|
|
167
175
|
const ref = { data: json };
|
|
176
|
+
const input = { data: json };
|
|
168
177
|
if (maps && getBlob) {
|
|
169
178
|
maps.forEach((segments, i) => {
|
|
179
|
+
let original = input;
|
|
170
180
|
let currentRef = ref;
|
|
171
181
|
let preSegment = "data";
|
|
172
182
|
segments.forEach((segment) => {
|
|
173
|
-
|
|
183
|
+
original = original[preSegment];
|
|
184
|
+
currentRef = copyOnWrite(currentRef, preSegment, original);
|
|
174
185
|
preSegment = segment;
|
|
175
186
|
if (!Object.hasOwn(currentRef, preSegment)) {
|
|
176
|
-
throw
|
|
187
|
+
throw invalidSerializedData(`segment "${preSegment}" does not exist.`);
|
|
177
188
|
}
|
|
178
189
|
});
|
|
179
190
|
currentRef[preSegment] = getBlob(i);
|
|
@@ -181,47 +192,79 @@ class StandardRPCJsonSerializer {
|
|
|
181
192
|
}
|
|
182
193
|
for (const item of meta) {
|
|
183
194
|
const type = item[0];
|
|
195
|
+
const custom = this.customSerializers.find((custom2) => custom2.type === type);
|
|
196
|
+
if (custom === void 0 && !BUILT_IN_TYPES.has(type)) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
let original = input;
|
|
184
200
|
let currentRef = ref;
|
|
185
201
|
let preSegment = "data";
|
|
186
202
|
for (let i = 1; i < item.length; i++) {
|
|
187
|
-
|
|
203
|
+
original = original[preSegment];
|
|
204
|
+
currentRef = copyOnWrite(currentRef, preSegment, original);
|
|
188
205
|
preSegment = item[i];
|
|
189
206
|
if (!Object.hasOwn(currentRef, preSegment)) {
|
|
190
|
-
throw
|
|
207
|
+
throw invalidSerializedData(`segment "${preSegment}" does not exist.`);
|
|
191
208
|
}
|
|
192
209
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
210
|
+
if (custom !== void 0) {
|
|
211
|
+
currentRef[preSegment] = custom.deserialize(currentRef[preSegment]);
|
|
212
|
+
continue;
|
|
198
213
|
}
|
|
214
|
+
const serialized = currentRef[preSegment];
|
|
199
215
|
switch (type) {
|
|
200
216
|
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.BIGINT:
|
|
201
|
-
|
|
217
|
+
if (typeof serialized !== "string") {
|
|
218
|
+
throw invalidSerializedType(type, "bigint", "a string");
|
|
219
|
+
}
|
|
220
|
+
currentRef[preSegment] = BigInt(serialized);
|
|
202
221
|
break;
|
|
203
222
|
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.DATE:
|
|
204
|
-
|
|
223
|
+
if (typeof serialized !== "string" && serialized !== null) {
|
|
224
|
+
throw invalidSerializedType(type, "date", "a string or null");
|
|
225
|
+
}
|
|
226
|
+
currentRef[preSegment] = new Date(serialized ?? Number.NaN);
|
|
205
227
|
break;
|
|
206
228
|
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.NAN:
|
|
229
|
+
if (serialized !== null) {
|
|
230
|
+
throw invalidSerializedType(type, "nan", "null");
|
|
231
|
+
}
|
|
207
232
|
currentRef[preSegment] = Number.NaN;
|
|
208
233
|
break;
|
|
209
234
|
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.UNDEFINED:
|
|
235
|
+
if (serialized !== null) {
|
|
236
|
+
throw invalidSerializedType(type, "undefined", "null");
|
|
237
|
+
}
|
|
210
238
|
currentRef[preSegment] = void 0;
|
|
211
239
|
break;
|
|
212
240
|
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.URL:
|
|
213
|
-
|
|
241
|
+
if (typeof serialized !== "string") {
|
|
242
|
+
throw invalidSerializedType(type, "url", "a string");
|
|
243
|
+
}
|
|
244
|
+
currentRef[preSegment] = new URL(serialized);
|
|
214
245
|
break;
|
|
215
246
|
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.REGEXP: {
|
|
216
|
-
|
|
217
|
-
|
|
247
|
+
if (typeof serialized !== "string") {
|
|
248
|
+
throw invalidSerializedType(type, "regexp", "a string");
|
|
249
|
+
}
|
|
250
|
+
const match = serialized.match(SERIALIZED_REGEXP_FORMAT);
|
|
251
|
+
if (match === null || !isValidRegExpFlags(match[2])) {
|
|
252
|
+
throw invalidSerializedData(`type ${type} (regexp) expects a "/pattern/flags" string.`);
|
|
253
|
+
}
|
|
254
|
+
currentRef[preSegment] = createLazyRegExp(match[1], match[2]);
|
|
218
255
|
break;
|
|
219
256
|
}
|
|
220
257
|
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.SET:
|
|
221
|
-
|
|
258
|
+
if (!Array.isArray(serialized)) {
|
|
259
|
+
throw invalidSerializedType(type, "set", "an array");
|
|
260
|
+
}
|
|
261
|
+
currentRef[preSegment] = new Set(serialized);
|
|
222
262
|
break;
|
|
223
263
|
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.MAP:
|
|
224
|
-
|
|
264
|
+
if (!Array.isArray(serialized)) {
|
|
265
|
+
throw invalidSerializedType(type, "map", "an array");
|
|
266
|
+
}
|
|
267
|
+
currentRef[preSegment] = new Map(serialized);
|
|
225
268
|
break;
|
|
226
269
|
}
|
|
227
270
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.15.
|
|
4
|
+
"version": "1.15.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.dev",
|
|
7
7
|
"repository": {
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"dist"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@orpc/shared": "1.15.
|
|
53
|
-
"@orpc/standard-server
|
|
54
|
-
"@orpc/standard-server": "1.15.
|
|
55
|
-
"@orpc/standard-server-
|
|
52
|
+
"@orpc/shared": "1.15.3",
|
|
53
|
+
"@orpc/standard-server": "1.15.3",
|
|
54
|
+
"@orpc/standard-server-peer": "1.15.3",
|
|
55
|
+
"@orpc/standard-server-fetch": "1.15.3"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"zod": "^4.6.2"
|