@orpc/client 2.0.0-beta.39 → 2.0.0-beta.40

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.
@@ -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.CpjCcPAo.mjs';
3
+ import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.VXsLhJtT.mjs';
4
4
  import '@standard-server/core';
5
- import '../../shared/client.p8hOqj5H.mjs';
5
+ import '../../shared/client.BYHnU_Z3.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.CpjCcPAo.mjs';
3
+ import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.VXsLhJtT.mjs';
4
4
  import '@standard-server/core';
5
5
  import '@standard-server/fetch';
6
- import '../../shared/client.p8hOqj5H.mjs';
6
+ import '../../shared/client.BYHnU_Z3.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.CpjCcPAo.mjs';
1
+ export { C as CompositeStandardLinkPlugin, R as RPCLinkCodec, S as StandardLink } from '../../shared/client.VXsLhJtT.mjs';
2
2
  import '@orpc/shared';
3
3
  import '@standard-server/core';
4
4
  import '@standard-server/fetch';
5
- import '../../shared/client.p8hOqj5H.mjs';
5
+ import '../../shared/client.BYHnU_Z3.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.CpjCcPAo.mjs';
3
+ import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.VXsLhJtT.mjs';
4
4
  import '@standard-server/core';
5
5
  import '@standard-server/fetch';
6
- import '../../shared/client.p8hOqj5H.mjs';
6
+ import '../../shared/client.BYHnU_Z3.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.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';
1
+ import { b as isDefinedError } from './shared/client.BYHnU_Z3.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.BYHnU_Z3.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';
@@ -341,6 +341,10 @@ class RPCJsonSerializer {
341
341
  const ref = { json: serialized.json };
342
342
  if (serialized.blobs?.length) {
343
343
  for (let i = 0; i < serialized.maps.length; i++) {
344
+ const blob = serialized.blobs[i];
345
+ if (!(blob instanceof Blob)) {
346
+ throw invalidSerializedData(`blob ${i} is not a Blob.`);
347
+ }
344
348
  const segments = serialized.maps[i];
345
349
  let original = serialized;
346
350
  let currentRef = ref;
@@ -353,7 +357,7 @@ class RPCJsonSerializer {
353
357
  throw invalidSerializedData(`segment "${preSegment}" does not exist.`);
354
358
  }
355
359
  }
356
- currentRef[preSegment] = serialized.blobs[i];
360
+ currentRef[preSegment] = blob;
357
361
  }
358
362
  }
359
363
  if (serialized.meta) {
@@ -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.p8hOqj5H.mjs';
4
+ import { R as RPCSerializer, c as createORPCErrorFromMalformedResponse, i as isORPCErrorJson, a as createORPCErrorFromJson } from './client.BYHnU_Z3.mjs';
5
5
 
6
6
  class CompositeStandardLinkPlugin {
7
7
  name = "~composite";
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.39",
4
+ "version": "2.0.0-beta.40",
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.39",
66
+ "@orpc/shared": "2.0.0-beta.40",
67
67
  "@standard-server/core": "~0.9.2",
68
68
  "@standard-server/fetch": "~0.9.2",
69
69
  "@standard-server/peer": "~0.9.2"