@orpc/client 1.14.14 → 1.15.0
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.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.d.mts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.mjs +8 -8
- package/dist/plugins/index.mjs +1 -1
- package/dist/shared/{client.Neryp5z6.mjs → client.BtiuJPEa.mjs} +1 -1
- package/dist/shared/{client.RnCVAXCj.mjs → client.CZlviB0y.mjs} +21 -2
- package/package.json +5 -5
|
@@ -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.BtiuJPEa.mjs';
|
|
4
4
|
import '@orpc/standard-server';
|
|
5
|
-
import '../../shared/client.
|
|
5
|
+
import '../../shared/client.CZlviB0y.mjs';
|
|
6
6
|
import '../../shared/client.BLtwTQUg.mjs';
|
|
7
7
|
|
|
8
8
|
class CompositeLinkFetchPlugin extends CompositeStandardLinkPlugin {
|
|
@@ -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.BtiuJPEa.mjs';
|
|
4
4
|
import '@orpc/standard-server';
|
|
5
|
-
import '../../shared/client.
|
|
5
|
+
import '../../shared/client.CZlviB0y.mjs';
|
|
6
6
|
import '@orpc/standard-server-fetch';
|
|
7
7
|
import '../../shared/client.BLtwTQUg.mjs';
|
|
8
8
|
|
|
@@ -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.BtiuJPEa.mjs';
|
|
2
2
|
import '@orpc/shared';
|
|
3
3
|
import '@orpc/standard-server';
|
|
4
|
-
import '../../shared/client.
|
|
4
|
+
import '../../shared/client.CZlviB0y.mjs';
|
|
5
5
|
import '@orpc/standard-server-fetch';
|
|
6
6
|
import '../../shared/client.BLtwTQUg.mjs';
|
|
@@ -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.BtiuJPEa.mjs';
|
|
4
4
|
import '@orpc/standard-server';
|
|
5
|
-
import '../../shared/client.
|
|
5
|
+
import '../../shared/client.CZlviB0y.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,20 @@ 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.
|
|
210
|
+
declare const ORPC_CLIENT_PACKAGE_VERSION = "1.15.0";
|
|
211
|
+
/**
|
|
212
|
+
* Property names that should resolve to the underlying value instead of
|
|
213
|
+
* continuing recursive proxy traversal.
|
|
214
|
+
*
|
|
215
|
+
* These properties are commonly accessed automatically by JavaScript runtimes,
|
|
216
|
+
* language features, or third-party libraries. Returning another recursive
|
|
217
|
+
* proxy for them can cause unexpected behavior, compatibility issues, or
|
|
218
|
+
* infinite proxy chains.
|
|
219
|
+
*
|
|
220
|
+
* Unlike v2, `then` is not included here because v1 supports procedures
|
|
221
|
+
* named `then` and relies on `preventNativeAwait` to keep `await client` safe.
|
|
222
|
+
*/
|
|
223
|
+
declare const RECURSIVE_CLIENT_UNWRAP_KEYS: Set<string>;
|
|
211
224
|
|
|
212
225
|
/**
|
|
213
226
|
* DynamicLink provides a way to dynamically resolve and delegate calls to other ClientLinks
|
|
@@ -226,5 +239,5 @@ declare function mapEventIterator<TYield, TReturn, TNext, TMap = TYield | TRetur
|
|
|
226
239
|
error: (error: unknown) => Promise<unknown>;
|
|
227
240
|
}): AsyncIteratorClass<TMap, TMap, TNext>;
|
|
228
241
|
|
|
229
|
-
export { COMMON_ORPC_ERROR_DEFS, Client, ClientContext, ClientLink, ClientOptions, ClientPromiseResult, ClientRest, DynamicLink, FriendlyClientOptions, InferClientContext, NestedClient, ORPCError, ORPC_CLIENT_PACKAGE_NAME, ORPC_CLIENT_PACKAGE_VERSION, consumeEventIterator, createORPCClient, createORPCErrorFromJson, createSafeClient, fallbackORPCErrorMessage, fallbackORPCErrorStatus, isDefinedError, isORPCErrorJson, isORPCErrorStatus, mapEventIterator, resolveFriendlyClientOptions, safe, toORPCError };
|
|
242
|
+
export { COMMON_ORPC_ERROR_DEFS, Client, ClientContext, ClientLink, ClientOptions, ClientPromiseResult, ClientRest, DynamicLink, FriendlyClientOptions, InferClientContext, NestedClient, ORPCError, ORPC_CLIENT_PACKAGE_NAME, ORPC_CLIENT_PACKAGE_VERSION, RECURSIVE_CLIENT_UNWRAP_KEYS, consumeEventIterator, createORPCClient, createORPCErrorFromJson, createSafeClient, fallbackORPCErrorMessage, fallbackORPCErrorStatus, isDefinedError, isORPCErrorJson, isORPCErrorStatus, mapEventIterator, resolveFriendlyClientOptions, safe, toORPCError };
|
|
230
243
|
export type { CommonORPCErrorCode, ConsumeEventIteratorOptions, ORPCErrorCode, ORPCErrorJSON, ORPCErrorOptions, SafeClient, SafeResult, createORPCClientOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -207,7 +207,20 @@ 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.
|
|
210
|
+
declare const ORPC_CLIENT_PACKAGE_VERSION = "1.15.0";
|
|
211
|
+
/**
|
|
212
|
+
* Property names that should resolve to the underlying value instead of
|
|
213
|
+
* continuing recursive proxy traversal.
|
|
214
|
+
*
|
|
215
|
+
* These properties are commonly accessed automatically by JavaScript runtimes,
|
|
216
|
+
* language features, or third-party libraries. Returning another recursive
|
|
217
|
+
* proxy for them can cause unexpected behavior, compatibility issues, or
|
|
218
|
+
* infinite proxy chains.
|
|
219
|
+
*
|
|
220
|
+
* Unlike v2, `then` is not included here because v1 supports procedures
|
|
221
|
+
* named `then` and relies on `preventNativeAwait` to keep `await client` safe.
|
|
222
|
+
*/
|
|
223
|
+
declare const RECURSIVE_CLIENT_UNWRAP_KEYS: Set<string>;
|
|
211
224
|
|
|
212
225
|
/**
|
|
213
226
|
* DynamicLink provides a way to dynamically resolve and delegate calls to other ClientLinks
|
|
@@ -226,5 +239,5 @@ declare function mapEventIterator<TYield, TReturn, TNext, TMap = TYield | TRetur
|
|
|
226
239
|
error: (error: unknown) => Promise<unknown>;
|
|
227
240
|
}): AsyncIteratorClass<TMap, TMap, TNext>;
|
|
228
241
|
|
|
229
|
-
export { COMMON_ORPC_ERROR_DEFS, Client, ClientContext, ClientLink, ClientOptions, ClientPromiseResult, ClientRest, DynamicLink, FriendlyClientOptions, InferClientContext, NestedClient, ORPCError, ORPC_CLIENT_PACKAGE_NAME, ORPC_CLIENT_PACKAGE_VERSION, consumeEventIterator, createORPCClient, createORPCErrorFromJson, createSafeClient, fallbackORPCErrorMessage, fallbackORPCErrorStatus, isDefinedError, isORPCErrorJson, isORPCErrorStatus, mapEventIterator, resolveFriendlyClientOptions, safe, toORPCError };
|
|
242
|
+
export { COMMON_ORPC_ERROR_DEFS, Client, ClientContext, ClientLink, ClientOptions, ClientPromiseResult, ClientRest, DynamicLink, FriendlyClientOptions, InferClientContext, NestedClient, ORPCError, ORPC_CLIENT_PACKAGE_NAME, ORPC_CLIENT_PACKAGE_VERSION, RECURSIVE_CLIENT_UNWRAP_KEYS, consumeEventIterator, createORPCClient, createORPCErrorFromJson, createSafeClient, fallbackORPCErrorMessage, fallbackORPCErrorStatus, isDefinedError, isORPCErrorJson, isORPCErrorStatus, mapEventIterator, resolveFriendlyClientOptions, safe, toORPCError };
|
|
230
243
|
export type { CommonORPCErrorCode, ConsumeEventIteratorOptions, ORPCErrorCode, ORPCErrorJSON, ORPCErrorOptions, SafeClient, SafeResult, createORPCClientOptions };
|
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 } 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.CZlviB0y.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.CZlviB0y.mjs';
|
|
5
5
|
export { m as mapEventIterator } from './shared/client.BLtwTQUg.mjs';
|
|
6
6
|
export { ErrorEvent, getEventMeta, withEventMeta } from '@orpc/standard-server';
|
|
7
7
|
|
|
@@ -70,7 +70,7 @@ function createORPCClient(link, options = {}) {
|
|
|
70
70
|
};
|
|
71
71
|
const recursive = new Proxy(procedureClient, {
|
|
72
72
|
get(target, key) {
|
|
73
|
-
if (typeof key !== "string") {
|
|
73
|
+
if (typeof key !== "string" || RECURSIVE_CLIENT_UNWRAP_KEYS.has(key)) {
|
|
74
74
|
return Reflect.get(target, key);
|
|
75
75
|
}
|
|
76
76
|
return createORPCClient(link, {
|
|
@@ -84,11 +84,11 @@ function createORPCClient(link, options = {}) {
|
|
|
84
84
|
|
|
85
85
|
function createSafeClient(client) {
|
|
86
86
|
const proxy = new Proxy((...args) => safe(client(...args)), {
|
|
87
|
-
get(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return value;
|
|
87
|
+
get(target, prop, receiver) {
|
|
88
|
+
if (typeof prop !== "string" || RECURSIVE_CLIENT_UNWRAP_KEYS.has(prop)) {
|
|
89
|
+
return Reflect.get(target, prop);
|
|
91
90
|
}
|
|
91
|
+
const value = Reflect.get(client, prop, receiver);
|
|
92
92
|
if (!isTypescriptObject(value)) {
|
|
93
93
|
return value;
|
|
94
94
|
}
|
|
@@ -109,4 +109,4 @@ class DynamicLink {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
export { DynamicLink, consumeEventIterator, createORPCClient, createSafeClient, isDefinedError, resolveFriendlyClientOptions, safe };
|
|
112
|
+
export { DynamicLink, RECURSIVE_CLIENT_UNWRAP_KEYS, consumeEventIterator, createORPCClient, createSafeClient, isDefinedError, resolveFriendlyClientOptions, safe };
|
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.CZlviB0y.mjs';
|
|
5
5
|
|
|
6
6
|
class BatchLinkPlugin {
|
|
7
7
|
groups;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toArray, runWithSpan, ORPC_NAME, isAsyncIteratorObject, asyncIteratorWithSpan, intercept, getGlobalOtelConfig, isObject, 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.CZlviB0y.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
|
|
|
@@ -1,7 +1,26 @@
|
|
|
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.
|
|
4
|
+
const ORPC_CLIENT_PACKAGE_VERSION = "1.15.0";
|
|
5
|
+
const RECURSIVE_CLIENT_UNWRAP_KEYS = /* @__PURE__ */ new Set([
|
|
6
|
+
/**
|
|
7
|
+
* Commonly used by libraries to bind functions to a specific `this`
|
|
8
|
+
* context.
|
|
9
|
+
*/
|
|
10
|
+
"bind",
|
|
11
|
+
/**
|
|
12
|
+
* Commonly accessed during primitive conversion, inspection, and logging.
|
|
13
|
+
*/
|
|
14
|
+
"valueOf",
|
|
15
|
+
/**
|
|
16
|
+
* Commonly accessed during string conversion, inspection, and logging.
|
|
17
|
+
*/
|
|
18
|
+
"toString",
|
|
19
|
+
/**
|
|
20
|
+
* Commonly accessed by serializers such as `JSON.stringify`.
|
|
21
|
+
*/
|
|
22
|
+
"toJSON"
|
|
23
|
+
]);
|
|
5
24
|
|
|
6
25
|
const COMMON_ORPC_ERROR_DEFS = {
|
|
7
26
|
BAD_REQUEST: {
|
|
@@ -171,4 +190,4 @@ function createORPCErrorFromJson(json, options = {}) {
|
|
|
171
190
|
});
|
|
172
191
|
}
|
|
173
192
|
|
|
174
|
-
export { COMMON_ORPC_ERROR_DEFS as C, ORPC_CLIENT_PACKAGE_NAME as O, ORPC_CLIENT_PACKAGE_VERSION as a, fallbackORPCErrorMessage as b, ORPCError as c, isORPCErrorStatus as d, isORPCErrorJson as e, fallbackORPCErrorStatus as f, createORPCErrorFromJson as g, isDefinedError as i, toORPCError as t };
|
|
193
|
+
export { COMMON_ORPC_ERROR_DEFS as C, ORPC_CLIENT_PACKAGE_NAME as O, RECURSIVE_CLIENT_UNWRAP_KEYS as R, ORPC_CLIENT_PACKAGE_VERSION as a, fallbackORPCErrorMessage as b, ORPCError as c, isORPCErrorStatus as d, isORPCErrorJson as e, fallbackORPCErrorStatus as f, createORPCErrorFromJson as g, isDefinedError as i, toORPCError as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.15.0",
|
|
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.
|
|
53
|
-
"@orpc/standard-server
|
|
54
|
-
"@orpc/standard-server-
|
|
55
|
-
"@orpc/standard-server": "1.
|
|
52
|
+
"@orpc/shared": "1.15.0",
|
|
53
|
+
"@orpc/standard-server": "1.15.0",
|
|
54
|
+
"@orpc/standard-server-fetch": "1.15.0",
|
|
55
|
+
"@orpc/standard-server-peer": "1.15.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"zod": "^4.3.6"
|