@orpc/client 2.0.0-beta.25 → 2.0.0-beta.26
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/dist/adapters/fetch/index.d.mts +2 -2
- package/dist/adapters/fetch/index.d.ts +2 -2
- package/dist/adapters/fetch/index.mjs +2 -2
- package/dist/adapters/message-port/index.d.mts +2 -2
- package/dist/adapters/message-port/index.d.ts +2 -2
- package/dist/adapters/message-port/index.mjs +2 -2
- package/dist/adapters/standard/index.d.mts +3 -3
- package/dist/adapters/standard/index.d.ts +3 -3
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/adapters/websocket/index.d.mts +2 -2
- package/dist/adapters/websocket/index.d.ts +2 -2
- package/dist/adapters/websocket/index.mjs +2 -2
- package/dist/index.d.mts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.mjs +2 -2
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/shared/{client.BpRn9TAI.d.mts → client.BkoxWb8f.d.mts} +1 -1
- package/dist/shared/{client.BGShxYPR.d.ts → client.ByTd6BR5.d.ts} +1 -1
- package/dist/shared/{client.BZMJyvQd.mjs → client.COv0qq2C.mjs} +2 -3
- package/dist/shared/{client.EMUKnkap.d.mts → client.l_EYklFG.d.mts} +2 -2
- package/dist/shared/{client.EMUKnkap.d.ts → client.l_EYklFG.d.ts} +2 -2
- package/dist/shared/{client.B6ItE3bt.mjs → client.uztMy1KD.mjs} +1 -1
- package/package.json +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ClientContext, a as ClientOptions } from '../../shared/client.
|
|
1
|
+
import { C as ClientContext, a as ClientOptions } from '../../shared/client.l_EYklFG.mjs';
|
|
2
2
|
import { Value, Promisable, Interceptor } from '@orpc/shared';
|
|
3
3
|
import { StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
4
4
|
import { ToFetchBodyOptions } from '@standardserver/fetch';
|
|
5
|
-
import { S as StandardLinkTransport, c as StandardLinkPlugin, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.
|
|
5
|
+
import { S as StandardLinkTransport, c as StandardLinkPlugin, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.BkoxWb8f.mjs';
|
|
6
6
|
import { RPCLinkCodecOptions } from '../standard/index.mjs';
|
|
7
7
|
import '../../shared/client.B8tCfDzm.mjs';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ClientContext, a as ClientOptions } from '../../shared/client.
|
|
1
|
+
import { C as ClientContext, a as ClientOptions } from '../../shared/client.l_EYklFG.js';
|
|
2
2
|
import { Value, Promisable, Interceptor } from '@orpc/shared';
|
|
3
3
|
import { StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
4
4
|
import { ToFetchBodyOptions } from '@standardserver/fetch';
|
|
5
|
-
import { S as StandardLinkTransport, c as StandardLinkPlugin, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.
|
|
5
|
+
import { S as StandardLinkTransport, c as StandardLinkPlugin, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.ByTd6BR5.js';
|
|
6
6
|
import { RPCLinkCodecOptions } from '../standard/index.js';
|
|
7
7
|
import '../../shared/client.B8tCfDzm.js';
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { sortPlugins, value, intercept, once } from '@orpc/shared';
|
|
2
2
|
import { toFetchBody, toFetchHeaders, toStandardLazyResponse } from '@standardserver/fetch';
|
|
3
|
-
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.
|
|
3
|
+
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.uztMy1KD.mjs';
|
|
4
4
|
import '@standardserver/core';
|
|
5
5
|
import '../../shared/client.CPcOxSex.mjs';
|
|
6
|
-
import '../../shared/client.
|
|
6
|
+
import '../../shared/client.COv0qq2C.mjs';
|
|
7
7
|
|
|
8
8
|
class CompositeFetchLinkTransportPlugin {
|
|
9
9
|
constructor(plugins = []) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ClientContext, a as ClientOptions } from '../../shared/client.
|
|
1
|
+
import { C as ClientContext, a as ClientOptions } from '../../shared/client.l_EYklFG.mjs';
|
|
2
2
|
import { Value, Promisable } from '@orpc/shared';
|
|
3
3
|
import { StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
4
4
|
import { ClientPeer, EncodePeerMessageOptions, DecodePeerMessageOptions } from '@standardserver/peer';
|
|
5
|
-
import { S as StandardLinkTransport, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.
|
|
5
|
+
import { S as StandardLinkTransport, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.BkoxWb8f.mjs';
|
|
6
6
|
import { RPCLinkCodecOptions } from '../standard/index.mjs';
|
|
7
7
|
import '../../shared/client.B8tCfDzm.mjs';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ClientContext, a as ClientOptions } from '../../shared/client.
|
|
1
|
+
import { C as ClientContext, a as ClientOptions } from '../../shared/client.l_EYklFG.js';
|
|
2
2
|
import { Value, Promisable } from '@orpc/shared';
|
|
3
3
|
import { StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
4
4
|
import { ClientPeer, EncodePeerMessageOptions, DecodePeerMessageOptions } from '@standardserver/peer';
|
|
5
|
-
import { S as StandardLinkTransport, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.
|
|
5
|
+
import { S as StandardLinkTransport, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.ByTd6BR5.js';
|
|
6
6
|
import { RPCLinkCodecOptions } from '../standard/index.js';
|
|
7
7
|
import '../../shared/client.B8tCfDzm.js';
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { value } from '@orpc/shared';
|
|
2
2
|
import { ClientPeer, encodePeerMessage, decodePeerMessage, isServerPeerSendMessage, isPeerMessage } from '@standardserver/peer';
|
|
3
|
-
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.
|
|
3
|
+
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.uztMy1KD.mjs';
|
|
4
4
|
import '@standardserver/core';
|
|
5
5
|
import '@standardserver/fetch';
|
|
6
6
|
import '../../shared/client.CPcOxSex.mjs';
|
|
7
|
-
import '../../shared/client.
|
|
7
|
+
import '../../shared/client.COv0qq2C.mjs';
|
|
8
8
|
|
|
9
9
|
function postMessagePortMessage(port, data, transfer) {
|
|
10
10
|
if (transfer) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { f as StandardLinkCodec, g as StandardLinkCodecDecodedResponse } from '../../shared/client.
|
|
2
|
-
export { C as CompositeStandardLinkPlugin, a as StandardLink, h as StandardLinkInterceptor, e as StandardLinkInterceptorOptions, b as StandardLinkOptions, c as StandardLinkPlugin, S as StandardLinkTransport, i as StandardLinkTransportInterceptor, d as StandardLinkTransportInterceptorOptions } from '../../shared/client.
|
|
1
|
+
import { f as StandardLinkCodec, g as StandardLinkCodecDecodedResponse } from '../../shared/client.BkoxWb8f.mjs';
|
|
2
|
+
export { C as CompositeStandardLinkPlugin, a as StandardLink, h as StandardLinkInterceptor, e as StandardLinkInterceptorOptions, b as StandardLinkOptions, c as StandardLinkPlugin, S as StandardLinkTransport, i as StandardLinkTransportInterceptor, d as StandardLinkTransportInterceptorOptions } from '../../shared/client.BkoxWb8f.mjs';
|
|
3
3
|
import { Value, Promisable } from '@orpc/shared';
|
|
4
4
|
import { StandardUrl, StandardHeaders, StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
5
5
|
export { StandardBody, StandardBodyHint, StandardHeaders, StandardLazyRequest, StandardLazyResponse, StandardMethod, StandardRequest, StandardResponse, StandardUrl } from '@standardserver/core';
|
|
6
|
-
import { C as ClientContext, a as ClientOptions } from '../../shared/client.
|
|
6
|
+
import { C as ClientContext, a as ClientOptions } from '../../shared/client.l_EYklFG.mjs';
|
|
7
7
|
import { e as RPCSerializer } from '../../shared/client.B8tCfDzm.mjs';
|
|
8
8
|
|
|
9
9
|
interface RPCLinkCodecOptions<T extends ClientContext> {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { f as StandardLinkCodec, g as StandardLinkCodecDecodedResponse } from '../../shared/client.
|
|
2
|
-
export { C as CompositeStandardLinkPlugin, a as StandardLink, h as StandardLinkInterceptor, e as StandardLinkInterceptorOptions, b as StandardLinkOptions, c as StandardLinkPlugin, S as StandardLinkTransport, i as StandardLinkTransportInterceptor, d as StandardLinkTransportInterceptorOptions } from '../../shared/client.
|
|
1
|
+
import { f as StandardLinkCodec, g as StandardLinkCodecDecodedResponse } from '../../shared/client.ByTd6BR5.js';
|
|
2
|
+
export { C as CompositeStandardLinkPlugin, a as StandardLink, h as StandardLinkInterceptor, e as StandardLinkInterceptorOptions, b as StandardLinkOptions, c as StandardLinkPlugin, S as StandardLinkTransport, i as StandardLinkTransportInterceptor, d as StandardLinkTransportInterceptorOptions } from '../../shared/client.ByTd6BR5.js';
|
|
3
3
|
import { Value, Promisable } from '@orpc/shared';
|
|
4
4
|
import { StandardUrl, StandardHeaders, StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
5
5
|
export { StandardBody, StandardBodyHint, StandardHeaders, StandardLazyRequest, StandardLazyResponse, StandardMethod, StandardRequest, StandardResponse, StandardUrl } from '@standardserver/core';
|
|
6
|
-
import { C as ClientContext, a as ClientOptions } from '../../shared/client.
|
|
6
|
+
import { C as ClientContext, a as ClientOptions } from '../../shared/client.l_EYklFG.js';
|
|
7
7
|
import { e as RPCSerializer } from '../../shared/client.B8tCfDzm.js';
|
|
8
8
|
|
|
9
9
|
interface RPCLinkCodecOptions<T extends ClientContext> {
|
|
@@ -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.uztMy1KD.mjs';
|
|
2
2
|
import '@orpc/shared';
|
|
3
3
|
import '@standardserver/core';
|
|
4
4
|
import '@standardserver/fetch';
|
|
5
5
|
import '../../shared/client.CPcOxSex.mjs';
|
|
6
|
-
import '../../shared/client.
|
|
6
|
+
import '../../shared/client.COv0qq2C.mjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ClientContext, a as ClientOptions } from '../../shared/client.
|
|
1
|
+
import { C as ClientContext, a as ClientOptions } from '../../shared/client.l_EYklFG.mjs';
|
|
2
2
|
import { Promisable } from '@orpc/shared';
|
|
3
3
|
import { StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
4
4
|
import { EncodePeerMessageOptions, DecodePeerMessageOptions } from '@standardserver/peer';
|
|
5
|
-
import { S as StandardLinkTransport, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.
|
|
5
|
+
import { S as StandardLinkTransport, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.BkoxWb8f.mjs';
|
|
6
6
|
import { RPCLinkCodecOptions } from '../standard/index.mjs';
|
|
7
7
|
import '../../shared/client.B8tCfDzm.mjs';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ClientContext, a as ClientOptions } from '../../shared/client.
|
|
1
|
+
import { C as ClientContext, a as ClientOptions } from '../../shared/client.l_EYklFG.js';
|
|
2
2
|
import { Promisable } from '@orpc/shared';
|
|
3
3
|
import { StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
4
4
|
import { EncodePeerMessageOptions, DecodePeerMessageOptions } from '@standardserver/peer';
|
|
5
|
-
import { S as StandardLinkTransport, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.
|
|
5
|
+
import { S as StandardLinkTransport, a as StandardLink, b as StandardLinkOptions } from '../../shared/client.ByTd6BR5.js';
|
|
6
6
|
import { RPCLinkCodecOptions } from '../standard/index.js';
|
|
7
7
|
import '../../shared/client.B8tCfDzm.js';
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { runWithSignal, AbortError, sleep, promiseWithResolvers, sequential, loadBytes, toStringOrBytes } from '@orpc/shared';
|
|
2
2
|
import { ClientPeer, encodePeerMessage, decodePeerMessage, isServerPeerSendMessage } from '@standardserver/peer';
|
|
3
|
-
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.
|
|
3
|
+
import { S as StandardLink, R as RPCLinkCodec } from '../../shared/client.uztMy1KD.mjs';
|
|
4
4
|
import '@standardserver/core';
|
|
5
5
|
import '@standardserver/fetch';
|
|
6
6
|
import '../../shared/client.CPcOxSex.mjs';
|
|
7
|
-
import '../../shared/client.
|
|
7
|
+
import '../../shared/client.COv0qq2C.mjs';
|
|
8
8
|
|
|
9
9
|
const WEBSOCKET_CONNECTING = 0;
|
|
10
10
|
const WEBSOCKET_OPEN = 1;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WrapAsyncIteratorOptions, AsyncIteratorClass, Interceptor, PromiseWithError, ThrowableError, Promisable } from '@orpc/shared';
|
|
2
2
|
export { AsyncCleanupFn, AsyncIteratorClass, AsyncIteratorClassNextFn, PromiseWithError as ClientPromiseResult, MaybeOptionalOptions, PromiseWithError, Registry, ThrowableError, 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';
|
|
3
|
-
import { C as ClientContext, a as ClientOptions, c as AnyNestedClient, I as InferClientContext, d as InferClientError, e as Client, b as ClientLink, A as AnyORPCError, f as ClientRest, F as FriendlyClientOptions, O as ORPCErrorCode, g as
|
|
4
|
-
export { i as AnyORPCErrorJSON, j as COMMON_ERROR_STATUS_MAP, k as InferClientBodyInputs, l as InferClientBodyOutputs, m as InferClientErrors, n as InferClientInputs, o as InferClientOutputs, N as NestedClient, p as ORPCErrorOptions } from './shared/client.
|
|
3
|
+
import { C as ClientContext, a as ClientOptions, c as AnyNestedClient, I as InferClientContext, d as InferClientError, e as Client, b as ClientLink, A as AnyORPCError, f as ClientRest, F as FriendlyClientOptions, O as ORPCErrorCode, g as ORPCErrorJSON, h as ORPCError } from './shared/client.l_EYklFG.mjs';
|
|
4
|
+
export { i as AnyORPCErrorJSON, j as COMMON_ERROR_STATUS_MAP, k as InferClientBodyInputs, l as InferClientBodyOutputs, m as InferClientErrors, n as InferClientInputs, o as InferClientOutputs, N as NestedClient, p as ORPCErrorOptions } from './shared/client.l_EYklFG.mjs';
|
|
5
5
|
export { R as RPCJsonSerialization, a as RPCJsonSerializationMeta, b as RPCJsonSerializer, c as RPCJsonSerializerHandler, d as RPCJsonSerializerOptions, e as RPCSerializer, f as RPCSerializerOptions, g as RPCSerializerSerializeOptions } from './shared/client.B8tCfDzm.mjs';
|
|
6
6
|
export { ErrorEvent, EventMeta, getEventMeta, unwrapEvent, withEventMeta } from '@standardserver/core';
|
|
7
7
|
|
|
@@ -131,7 +131,15 @@ declare function isInferableError<T>(error: T): error is Extract<T, AnyORPCError
|
|
|
131
131
|
declare function toORPCError<T>(error: T): Extract<T, AnyORPCError> | ORPCError<'INTERNAL_SERVER_ERROR', undefined>;
|
|
132
132
|
declare function isORPCErrorJson(json: unknown): json is ORPCErrorJSON<ORPCErrorCode, unknown>;
|
|
133
133
|
declare function createORPCErrorFromJson<TCode extends ORPCErrorCode, TData>(json: ORPCErrorJSON<TCode, TData>, options?: ErrorOptions): ORPCError<TCode, TData>;
|
|
134
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Clones an `ORPCError` while preserving its prototype chain, so instances of
|
|
136
|
+
* `ORPCError` subclasses remain `instanceof` their class.
|
|
137
|
+
*
|
|
138
|
+
* Limitation: subclass constructors are not re-run, so private fields
|
|
139
|
+
* (`#field`) are not carried over and subclass members that read them
|
|
140
|
+
* will throw on the clone.
|
|
141
|
+
*/
|
|
142
|
+
declare function cloneORPCError<T extends AnyORPCError>(error: T): T;
|
|
135
143
|
|
|
136
144
|
export { AnyNestedClient, AnyORPCError, Client, ClientContext, ClientLink, ClientOptions, ClientRest, DynamicLink, FriendlyClientOptions, InferClientContext, InferClientError, InferClientError as InferClientErrorUnion, ORPCError, ORPCErrorCode, ORPCErrorJSON, RECURSIVE_CLIENT_UNWRAP_KEYS, cloneORPCError, createORPCClient, createORPCErrorFromJson, createSafeClient, isInferableError as isDefinedError, isInferableError, isORPCErrorJson, resolveClientRest, resolveFriendlyClientOptions, safe, toORPCError, wrapAsyncIteratorPreservingEventMeta };
|
|
137
145
|
export type { ORPCClientInterceptor, ORPCClientInterceptorOptions, ORPCClientOptions, ORPCClientScoped, ORPCClientScopedOptions, SafeClient, SafeResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WrapAsyncIteratorOptions, AsyncIteratorClass, Interceptor, PromiseWithError, ThrowableError, Promisable } from '@orpc/shared';
|
|
2
2
|
export { AsyncCleanupFn, AsyncIteratorClass, AsyncIteratorClassNextFn, PromiseWithError as ClientPromiseResult, MaybeOptionalOptions, PromiseWithError, Registry, ThrowableError, 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';
|
|
3
|
-
import { C as ClientContext, a as ClientOptions, c as AnyNestedClient, I as InferClientContext, d as InferClientError, e as Client, b as ClientLink, A as AnyORPCError, f as ClientRest, F as FriendlyClientOptions, O as ORPCErrorCode, g as
|
|
4
|
-
export { i as AnyORPCErrorJSON, j as COMMON_ERROR_STATUS_MAP, k as InferClientBodyInputs, l as InferClientBodyOutputs, m as InferClientErrors, n as InferClientInputs, o as InferClientOutputs, N as NestedClient, p as ORPCErrorOptions } from './shared/client.
|
|
3
|
+
import { C as ClientContext, a as ClientOptions, c as AnyNestedClient, I as InferClientContext, d as InferClientError, e as Client, b as ClientLink, A as AnyORPCError, f as ClientRest, F as FriendlyClientOptions, O as ORPCErrorCode, g as ORPCErrorJSON, h as ORPCError } from './shared/client.l_EYklFG.js';
|
|
4
|
+
export { i as AnyORPCErrorJSON, j as COMMON_ERROR_STATUS_MAP, k as InferClientBodyInputs, l as InferClientBodyOutputs, m as InferClientErrors, n as InferClientInputs, o as InferClientOutputs, N as NestedClient, p as ORPCErrorOptions } from './shared/client.l_EYklFG.js';
|
|
5
5
|
export { R as RPCJsonSerialization, a as RPCJsonSerializationMeta, b as RPCJsonSerializer, c as RPCJsonSerializerHandler, d as RPCJsonSerializerOptions, e as RPCSerializer, f as RPCSerializerOptions, g as RPCSerializerSerializeOptions } from './shared/client.B8tCfDzm.js';
|
|
6
6
|
export { ErrorEvent, EventMeta, getEventMeta, unwrapEvent, withEventMeta } from '@standardserver/core';
|
|
7
7
|
|
|
@@ -131,7 +131,15 @@ declare function isInferableError<T>(error: T): error is Extract<T, AnyORPCError
|
|
|
131
131
|
declare function toORPCError<T>(error: T): Extract<T, AnyORPCError> | ORPCError<'INTERNAL_SERVER_ERROR', undefined>;
|
|
132
132
|
declare function isORPCErrorJson(json: unknown): json is ORPCErrorJSON<ORPCErrorCode, unknown>;
|
|
133
133
|
declare function createORPCErrorFromJson<TCode extends ORPCErrorCode, TData>(json: ORPCErrorJSON<TCode, TData>, options?: ErrorOptions): ORPCError<TCode, TData>;
|
|
134
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Clones an `ORPCError` while preserving its prototype chain, so instances of
|
|
136
|
+
* `ORPCError` subclasses remain `instanceof` their class.
|
|
137
|
+
*
|
|
138
|
+
* Limitation: subclass constructors are not re-run, so private fields
|
|
139
|
+
* (`#field`) are not carried over and subclass members that read them
|
|
140
|
+
* will throw on the clone.
|
|
141
|
+
*/
|
|
142
|
+
declare function cloneORPCError<T extends AnyORPCError>(error: T): T;
|
|
135
143
|
|
|
136
144
|
export { AnyNestedClient, AnyORPCError, Client, ClientContext, ClientLink, ClientOptions, ClientRest, DynamicLink, FriendlyClientOptions, InferClientContext, InferClientError, InferClientError as InferClientErrorUnion, ORPCError, ORPCErrorCode, ORPCErrorJSON, RECURSIVE_CLIENT_UNWRAP_KEYS, cloneORPCError, createORPCClient, createORPCErrorFromJson, createSafeClient, isInferableError as isDefinedError, isInferableError, isORPCErrorJson, resolveClientRest, resolveFriendlyClientOptions, safe, toORPCError, wrapAsyncIteratorPreservingEventMeta };
|
|
137
145
|
export type { ORPCClientInterceptor, ORPCClientInterceptorOptions, ORPCClientOptions, ORPCClientScoped, ORPCClientScopedOptions, SafeClient, SafeResult };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as isInferableError } from './shared/client.
|
|
2
|
-
export { b as RPCJsonSerializer, R as RPCSerializer, d as cloneORPCError, c as createORPCErrorFromJson, i as isORPCErrorJson, t as toORPCError, w as wrapAsyncIteratorPreservingEventMeta } from './shared/client.
|
|
1
|
+
import { a as isInferableError } from './shared/client.COv0qq2C.mjs';
|
|
2
|
+
export { b as RPCJsonSerializer, R as RPCSerializer, d as cloneORPCError, c as createORPCErrorFromJson, i as isORPCErrorJson, t as toORPCError, w as wrapAsyncIteratorPreservingEventMeta } from './shared/client.COv0qq2C.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, O as ORPCError } from './shared/client.CPcOxSex.mjs';
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Value, Promisable } from '@orpc/shared';
|
|
2
2
|
import { StandardUrl, StandardHeaders, StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
3
|
-
import { C as ClientContext } from '../shared/client.
|
|
4
|
-
import { c as StandardLinkPlugin, d as StandardLinkTransportInterceptorOptions, b as StandardLinkOptions, e as StandardLinkInterceptorOptions } from '../shared/client.
|
|
3
|
+
import { C as ClientContext } from '../shared/client.l_EYklFG.mjs';
|
|
4
|
+
import { c as StandardLinkPlugin, d as StandardLinkTransportInterceptorOptions, b as StandardLinkOptions, e as StandardLinkInterceptorOptions } from '../shared/client.BkoxWb8f.mjs';
|
|
5
5
|
|
|
6
6
|
type BatchLinkPluginMode = 'streaming' | 'buffered';
|
|
7
7
|
interface BatchLinkPluginGroup<T extends ClientContext> {
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Value, Promisable } from '@orpc/shared';
|
|
2
2
|
import { StandardUrl, StandardHeaders, StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
3
|
-
import { C as ClientContext } from '../shared/client.
|
|
4
|
-
import { c as StandardLinkPlugin, d as StandardLinkTransportInterceptorOptions, b as StandardLinkOptions, e as StandardLinkInterceptorOptions } from '../shared/client.
|
|
3
|
+
import { C as ClientContext } from '../shared/client.l_EYklFG.js';
|
|
4
|
+
import { c as StandardLinkPlugin, d as StandardLinkTransportInterceptorOptions, b as StandardLinkOptions, e as StandardLinkInterceptorOptions } from '../shared/client.ByTd6BR5.js';
|
|
5
5
|
|
|
6
6
|
type BatchLinkPluginMode = 'streaming' | 'buffered';
|
|
7
7
|
interface BatchLinkPluginGroup<T extends ClientContext> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Promisable, OrderablePlugin, Interceptor } from '@orpc/shared';
|
|
2
2
|
import { StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
3
|
-
import { C as ClientContext, a as ClientOptions, A as AnyORPCError, b as ClientLink } from './client.
|
|
3
|
+
import { C as ClientContext, a as ClientOptions, A as AnyORPCError, b as ClientLink } from './client.l_EYklFG.mjs';
|
|
4
4
|
|
|
5
5
|
type StandardLinkCodecDecodedResponse = {
|
|
6
6
|
kind: 'output';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Promisable, OrderablePlugin, Interceptor } from '@orpc/shared';
|
|
2
2
|
import { StandardRequest, StandardLazyResponse } from '@standardserver/core';
|
|
3
|
-
import { C as ClientContext, a as ClientOptions, A as AnyORPCError, b as ClientLink } from './client.
|
|
3
|
+
import { C as ClientContext, a as ClientOptions, A as AnyORPCError, b as ClientLink } from './client.l_EYklFG.js';
|
|
4
4
|
|
|
5
5
|
type StandardLinkCodecDecodedResponse = {
|
|
6
6
|
kind: 'output';
|
|
@@ -29,14 +29,13 @@ function createORPCErrorFromJson(json, options = {}) {
|
|
|
29
29
|
}
|
|
30
30
|
function cloneORPCError(error) {
|
|
31
31
|
const cloned = new ORPCError(error.code, {
|
|
32
|
-
...error,
|
|
33
32
|
message: error.message,
|
|
34
33
|
data: error.data,
|
|
35
34
|
cause: error.cause
|
|
36
35
|
});
|
|
36
|
+
Object.setPrototypeOf(cloned, Object.getPrototypeOf(error));
|
|
37
|
+
Object.defineProperties(cloned, Object.getOwnPropertyDescriptors(error));
|
|
37
38
|
cloned.stack = error.stack;
|
|
38
|
-
cloned.defined = error.defined;
|
|
39
|
-
cloned.inferable = error.inferable;
|
|
40
39
|
return cloned;
|
|
41
40
|
}
|
|
42
41
|
|
|
@@ -193,5 +193,5 @@ interface ORPCErrorJSON<TCode extends string, TData> extends Pick<ORPCError<TCod
|
|
|
193
193
|
type AnyORPCError = ORPCError<any, any>;
|
|
194
194
|
type AnyORPCErrorJSON = ORPCErrorJSON<any, any>;
|
|
195
195
|
|
|
196
|
-
export { ORPCError as
|
|
197
|
-
export type { AnyORPCError as A, ClientContext as C, FriendlyClientOptions as F, InferClientContext as I, NestedClient as N, ORPCErrorCode as O, ClientOptions as a, ClientLink as b, AnyNestedClient as c, InferClientError as d, Client as e, ClientRest as f, ORPCErrorJSON as
|
|
196
|
+
export { ORPCError as h, COMMON_ERROR_STATUS_MAP as j };
|
|
197
|
+
export type { AnyORPCError as A, ClientContext as C, FriendlyClientOptions as F, InferClientContext as I, NestedClient as N, ORPCErrorCode as O, ClientOptions as a, ClientLink as b, AnyNestedClient as c, InferClientError as d, Client as e, ClientRest as f, ORPCErrorJSON as g, AnyORPCErrorJSON as i, InferClientBodyInputs as k, InferClientBodyOutputs as l, InferClientErrors as m, InferClientInputs as n, InferClientOutputs as o, ORPCErrorOptions as p };
|
|
@@ -193,5 +193,5 @@ interface ORPCErrorJSON<TCode extends string, TData> extends Pick<ORPCError<TCod
|
|
|
193
193
|
type AnyORPCError = ORPCError<any, any>;
|
|
194
194
|
type AnyORPCErrorJSON = ORPCErrorJSON<any, any>;
|
|
195
195
|
|
|
196
|
-
export { ORPCError as
|
|
197
|
-
export type { AnyORPCError as A, ClientContext as C, FriendlyClientOptions as F, InferClientContext as I, NestedClient as N, ORPCErrorCode as O, ClientOptions as a, ClientLink as b, AnyNestedClient as c, InferClientError as d, Client as e, ClientRest as f, ORPCErrorJSON as
|
|
196
|
+
export { ORPCError as h, COMMON_ERROR_STATUS_MAP as j };
|
|
197
|
+
export type { AnyORPCError as A, ClientContext as C, FriendlyClientOptions as F, InferClientContext as I, NestedClient as N, ORPCErrorCode as O, ClientOptions as a, ClientLink as b, AnyNestedClient as c, InferClientError as d, Client as e, ClientRest as f, ORPCErrorJSON as g, AnyORPCErrorJSON as i, InferClientBodyInputs as k, InferClientBodyOutputs as l, InferClientErrors as m, InferClientInputs as n, InferClientOutputs as o, ORPCErrorOptions as p };
|
|
@@ -2,7 +2,7 @@ import { sortPlugins, runWithSpan, ORPC_NAME, isAsyncIteratorObject, override, t
|
|
|
2
2
|
import { mergeStandardHeaders, parseStandardUrl } from '@standardserver/core';
|
|
3
3
|
import { toStandardHeaders } from '@standardserver/fetch';
|
|
4
4
|
import { O as ORPCError } from './client.CPcOxSex.mjs';
|
|
5
|
-
import { R as RPCSerializer, i as isORPCErrorJson, c as createORPCErrorFromJson } from './client.
|
|
5
|
+
import { R as RPCSerializer, i as isORPCErrorJson, c as createORPCErrorFromJson } from './client.COv0qq2C.mjs';
|
|
6
6
|
|
|
7
7
|
class CompositeStandardLinkPlugin {
|
|
8
8
|
name = "~composite";
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.26",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"funding": "https://github.com/sponsors/dinwwwh",
|
|
6
7
|
"homepage": "https://orpc.dev",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
"@standardserver/core": "^0.7.1",
|
|
54
55
|
"@standardserver/fetch": "^0.7.1",
|
|
55
56
|
"@standardserver/peer": "^0.7.1",
|
|
56
|
-
"@orpc/shared": "2.0.0-beta.
|
|
57
|
+
"@orpc/shared": "2.0.0-beta.26"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"zod": "^4.4.3"
|