@orpc/client 2.0.0-beta.37 → 2.0.0-beta.38
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/fetch/index.mjs +2 -2
- package/dist/adapters/message-port/index.mjs +2 -2
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/adapters/websocket/index.mjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/shared/{client.BtJ-utP9.mjs → client.CpjCcPAo.mjs} +1 -1
- package/dist/shared/{client.CUxLdmiH.mjs → client.p8hOqj5H.mjs} +11 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -38,11 +38,11 @@ You can read the documentation [here](https://orpc.dev).
|
|
|
38
38
|
|
|
39
39
|
**Schema validation**
|
|
40
40
|
|
|
41
|
-
| Package | Purpose
|
|
42
|
-
| ------------------------------------------------------------ |
|
|
43
|
-
| [@orpc/zod](https://www.npmjs.com/package/@orpc/zod) |
|
|
44
|
-
| [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot) |
|
|
45
|
-
| [@orpc/arktype](https://www.npmjs.com/package/@orpc/arktype) |
|
|
41
|
+
| Package | Purpose | Docs |
|
|
42
|
+
| ------------------------------------------------------------ | ---------------------------------------------------------- | ----------------------------------------------------- |
|
|
43
|
+
| [@orpc/zod](https://www.npmjs.com/package/@orpc/zod) | JSON Schema converter for [Zod](https://zod.dev/). | [Zod](https://orpc.dev/docs/integrations/zod) |
|
|
44
|
+
| [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot) | JSON Schema converter for [Valibot](https://valibot.dev/). | [Valibot](https://orpc.dev/docs/integrations/valibot) |
|
|
45
|
+
| [@orpc/arktype](https://www.npmjs.com/package/@orpc/arktype) | JSON Schema converter for [ArkType](https://arktype.io/). | [ArkType](https://orpc.dev/docs/integrations/arktype) |
|
|
46
46
|
|
|
47
47
|
**Built-in features**
|
|
48
48
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { value, once } from '@orpc/shared';
|
|
2
2
|
import { toFetchBody, toFetchHeaders, toStandardLazyResponse } from '@standard-server/fetch';
|
|
3
|
-
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.
|
|
3
|
+
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.CpjCcPAo.mjs';
|
|
4
4
|
import '@standard-server/core';
|
|
5
|
-
import '../../shared/client.
|
|
5
|
+
import '../../shared/client.p8hOqj5H.mjs';
|
|
6
6
|
import '../../shared/client.Dtv1JPkU.mjs';
|
|
7
7
|
|
|
8
8
|
const GET_SUPPORTED_DUPLEX_MODE = once(() => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { value } from '@orpc/shared';
|
|
2
2
|
import { ClientPeer, encodePeerMessage, decodePeerMessage, isServerPeerSendMessage, isPeerMessage } from '@standard-server/peer';
|
|
3
|
-
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.
|
|
3
|
+
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.CpjCcPAo.mjs';
|
|
4
4
|
import '@standard-server/core';
|
|
5
5
|
import '@standard-server/fetch';
|
|
6
|
-
import '../../shared/client.
|
|
6
|
+
import '../../shared/client.p8hOqj5H.mjs';
|
|
7
7
|
import '../../shared/client.Dtv1JPkU.mjs';
|
|
8
8
|
|
|
9
9
|
function postMessagePortMessage(port, data, transfer) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CompositeStandardLinkPlugin, R as RPCLinkCodec, S as StandardLink } from '../../shared/client.
|
|
1
|
+
export { C as CompositeStandardLinkPlugin, R as RPCLinkCodec, S as StandardLink } from '../../shared/client.CpjCcPAo.mjs';
|
|
2
2
|
import '@orpc/shared';
|
|
3
3
|
import '@standard-server/core';
|
|
4
4
|
import '@standard-server/fetch';
|
|
5
|
-
import '../../shared/client.
|
|
5
|
+
import '../../shared/client.p8hOqj5H.mjs';
|
|
6
6
|
import '../../shared/client.Dtv1JPkU.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { runWithSignal, AbortError, sleep, promiseWithResolvers, sequential, loadBytes, toStringOrBytes } from '@orpc/shared';
|
|
2
2
|
import { ClientPeer, encodePeerMessage, decodePeerMessage, isServerPeerSendMessage } from '@standard-server/peer';
|
|
3
|
-
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.
|
|
3
|
+
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.CpjCcPAo.mjs';
|
|
4
4
|
import '@standard-server/core';
|
|
5
5
|
import '@standard-server/fetch';
|
|
6
|
-
import '../../shared/client.
|
|
6
|
+
import '../../shared/client.p8hOqj5H.mjs';
|
|
7
7
|
import '../../shared/client.Dtv1JPkU.mjs';
|
|
8
8
|
|
|
9
9
|
const WEBSOCKET_CONNECTING = 0;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as isDefinedError } from './shared/client.
|
|
2
|
-
export { d as RPCJsonSerializer, R as RPCSerializer, e as cloneORPCError, a as createORPCErrorFromJson, c as createORPCErrorFromMalformedResponse, i as isORPCErrorJson, t as toORPCError, w as wrapAsyncIteratorPreservingEventMeta } from './shared/client.
|
|
1
|
+
import { b as isDefinedError } from './shared/client.p8hOqj5H.mjs';
|
|
2
|
+
export { d as RPCJsonSerializer, R as RPCSerializer, e as cloneORPCError, a as createORPCErrorFromJson, c as createORPCErrorFromMalformedResponse, i as isORPCErrorJson, t as toORPCError, w as wrapAsyncIteratorPreservingEventMeta } from './shared/client.p8hOqj5H.mjs';
|
|
3
3
|
import { toArray, intercept, isTypescriptObject } from '@orpc/shared';
|
|
4
4
|
export { AsyncIteratorClass, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, consumeAsyncIterator, consumeAsyncIterator as consumeEventIterator, asyncIteratorToStream as eventIteratorToStream, asyncIteratorToUnproxiedDataStream as eventIteratorToUnproxiedDataStream, onAsyncIteratorObjectError, onError, onFinish, onReadableStreamError, onStart, onSuccess, streamToAsyncIteratorObject, streamToAsyncIteratorObject as streamToEventIterator } from '@orpc/shared';
|
|
5
5
|
export { C as COMMON_ERROR_STATUS_MAP, M as MalformedResponseError, O as ORPCError } from './shared/client.Dtv1JPkU.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { sortPlugins, runWithSpan, ORPC_NAME, getTracer, isAsyncIteratorObject, override, traceAsyncIterator, traceReadableStream, intercept, value, pathToHttpPath, stringifyJSON } from '@orpc/shared';
|
|
2
2
|
import { mergeStandardHeaders, parseStandardUrl } from '@standard-server/core';
|
|
3
3
|
import { toStandardHeaders } from '@standard-server/fetch';
|
|
4
|
-
import { R as RPCSerializer, c as createORPCErrorFromMalformedResponse, i as isORPCErrorJson, a as createORPCErrorFromJson } from './client.
|
|
4
|
+
import { R as RPCSerializer, c as createORPCErrorFromMalformedResponse, i as isORPCErrorJson, a as createORPCErrorFromJson } from './client.p8hOqj5H.mjs';
|
|
5
5
|
|
|
6
6
|
class CompositeStandardLinkPlugin {
|
|
7
7
|
name = "~composite";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPlainObject, wrapAsyncIterator, isTypescriptObject, NullProtoObj, isAsyncIteratorObject, stringifyJSON } from '@orpc/shared';
|
|
1
|
+
import { isPlainObject, wrapAsyncIterator, isTypescriptObject, NullProtoObj, copyOnWrite, isAsyncIteratorObject, stringifyJSON } from '@orpc/shared';
|
|
2
2
|
import { getEventMeta, withEventMeta, ErrorEvent } from '@standard-server/core';
|
|
3
3
|
import { O as ORPCError, M as MalformedResponseError, C as COMMON_ERROR_STATUS_MAP } from './client.Dtv1JPkU.mjs';
|
|
4
4
|
|
|
@@ -338,14 +338,16 @@ class RPCJsonSerializer {
|
|
|
338
338
|
return data;
|
|
339
339
|
}
|
|
340
340
|
deserialize(serialized) {
|
|
341
|
-
const ref = {
|
|
341
|
+
const ref = { json: serialized.json };
|
|
342
342
|
if (serialized.blobs?.length) {
|
|
343
343
|
for (let i = 0; i < serialized.maps.length; i++) {
|
|
344
344
|
const segments = serialized.maps[i];
|
|
345
|
+
let original = serialized;
|
|
345
346
|
let currentRef = ref;
|
|
346
|
-
let preSegment = "
|
|
347
|
+
let preSegment = "json";
|
|
347
348
|
for (let j = 0; j < segments.length; j++) {
|
|
348
|
-
|
|
349
|
+
original = original[preSegment];
|
|
350
|
+
currentRef = copyOnWrite(currentRef, preSegment, original);
|
|
349
351
|
preSegment = segments[j];
|
|
350
352
|
if (!Object.hasOwn(currentRef, preSegment)) {
|
|
351
353
|
throw invalidSerializedData(`segment "${preSegment}" does not exist.`);
|
|
@@ -361,10 +363,12 @@ class RPCJsonSerializer {
|
|
|
361
363
|
if (handler === void 0) {
|
|
362
364
|
throw invalidSerializedData(`type "${type}" is not supported.`);
|
|
363
365
|
}
|
|
366
|
+
let original = serialized;
|
|
364
367
|
let currentRef = ref;
|
|
365
|
-
let preSegment = "
|
|
368
|
+
let preSegment = "json";
|
|
366
369
|
for (let i = 1; i < item.length; i++) {
|
|
367
|
-
|
|
370
|
+
original = original[preSegment];
|
|
371
|
+
currentRef = copyOnWrite(currentRef, preSegment, original);
|
|
368
372
|
preSegment = item[i];
|
|
369
373
|
if (!Object.hasOwn(currentRef, preSegment)) {
|
|
370
374
|
throw invalidSerializedData(`segment "${preSegment}" does not exist.`);
|
|
@@ -373,7 +377,7 @@ class RPCJsonSerializer {
|
|
|
373
377
|
currentRef[preSegment] = handler.deserialize(currentRef[preSegment]);
|
|
374
378
|
}
|
|
375
379
|
}
|
|
376
|
-
return ref.
|
|
380
|
+
return ref.json;
|
|
377
381
|
}
|
|
378
382
|
}
|
|
379
383
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.38",
|
|
5
5
|
"description": "Consume oRPC and OpenAPI APIs with end-to-end type safety over HTTP, WebSocket, or message ports",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": [
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"dist"
|
|
64
64
|
],
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@orpc/shared": "2.0.0-beta.
|
|
66
|
+
"@orpc/shared": "2.0.0-beta.38",
|
|
67
67
|
"@standard-server/core": "~0.9.2",
|
|
68
68
|
"@standard-server/fetch": "~0.9.2",
|
|
69
69
|
"@standard-server/peer": "~0.9.2"
|