@orpc/client 1.7.4 → 1.7.5
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.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.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/shared/{client.DHOfWE0c.mjs → client.BngOL3Ai.mjs} +8 -7
- package/dist/shared/{client.DwfV9Oyl.mjs → client.BvXDSBF5.mjs} +1 -1
- package/package.json +5 -5
@@ -1,8 +1,8 @@
|
|
1
1
|
import { toFetchRequest, toStandardLazyResponse } from '@orpc/standard-server-fetch';
|
2
2
|
import '@orpc/shared';
|
3
|
-
import { c as StandardRPCLink } from '../../shared/client.
|
3
|
+
import { c as StandardRPCLink } from '../../shared/client.BvXDSBF5.mjs';
|
4
4
|
import '@orpc/standard-server';
|
5
|
-
import '../../shared/client.
|
5
|
+
import '../../shared/client.BngOL3Ai.mjs';
|
6
6
|
|
7
7
|
class LinkFetchClient {
|
8
8
|
fetch;
|
@@ -43,7 +43,7 @@ declare class LinkMessagePortClient<T extends ClientContext> implements Standard
|
|
43
43
|
call(request: StandardRequest, _options: ClientOptions<T>, _path: readonly string[], _input: unknown): Promise<StandardLazyResponse>;
|
44
44
|
}
|
45
45
|
|
46
|
-
interface RPCLinkOptions<T extends ClientContext> extends Omit<StandardRPCLinkOptions<T>, 'url' | '
|
46
|
+
interface RPCLinkOptions<T extends ClientContext> extends Omit<StandardRPCLinkOptions<T>, 'url' | 'method' | 'fallbackMethod' | 'maxUrlLength'>, LinkMessagePortClientOptions {
|
47
47
|
}
|
48
48
|
/**
|
49
49
|
* The RPC Link for common message port implementations.
|
@@ -43,7 +43,7 @@ declare class LinkMessagePortClient<T extends ClientContext> implements Standard
|
|
43
43
|
call(request: StandardRequest, _options: ClientOptions<T>, _path: readonly string[], _input: unknown): Promise<StandardLazyResponse>;
|
44
44
|
}
|
45
45
|
|
46
|
-
interface RPCLinkOptions<T extends ClientContext> extends Omit<StandardRPCLinkOptions<T>, 'url' | '
|
46
|
+
interface RPCLinkOptions<T extends ClientContext> extends Omit<StandardRPCLinkOptions<T>, 'url' | 'method' | 'fallbackMethod' | 'maxUrlLength'>, LinkMessagePortClientOptions {
|
47
47
|
}
|
48
48
|
/**
|
49
49
|
* The RPC Link for common message port implementations.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { ClientPeer } from '@orpc/standard-server-peer';
|
2
2
|
import '@orpc/shared';
|
3
|
-
import { c as StandardRPCLink } from '../../shared/client.
|
3
|
+
import { c as StandardRPCLink } from '../../shared/client.BvXDSBF5.mjs';
|
4
4
|
import '@orpc/standard-server';
|
5
|
-
import '../../shared/client.
|
5
|
+
import '../../shared/client.BngOL3Ai.mjs';
|
6
6
|
|
7
7
|
function postMessagePortMessage(port, data) {
|
8
8
|
port.postMessage(data);
|
@@ -1,4 +1,4 @@
|
|
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 } 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 } from '../../shared/client.BvXDSBF5.mjs';
|
2
2
|
import '@orpc/shared';
|
3
3
|
import '@orpc/standard-server';
|
4
|
-
import '../../shared/client.
|
4
|
+
import '../../shared/client.BngOL3Ai.mjs';
|
@@ -13,7 +13,7 @@ declare class LinkWebsocketClient<T extends ClientContext> implements StandardLi
|
|
13
13
|
call(request: StandardRequest, _options: ClientOptions<T>, _path: readonly string[], _input: unknown): Promise<StandardLazyResponse>;
|
14
14
|
}
|
15
15
|
|
16
|
-
interface RPCLinkOptions<T extends ClientContext> extends Omit<StandardRPCLinkOptions<T>, 'url' | '
|
16
|
+
interface RPCLinkOptions<T extends ClientContext> extends Omit<StandardRPCLinkOptions<T>, 'url' | 'method' | 'fallbackMethod' | 'maxUrlLength'>, LinkWebsocketClientOptions {
|
17
17
|
}
|
18
18
|
/**
|
19
19
|
* The RPC Link communicates with the server using the RPC protocol over WebSocket.
|
@@ -13,7 +13,7 @@ declare class LinkWebsocketClient<T extends ClientContext> implements StandardLi
|
|
13
13
|
call(request: StandardRequest, _options: ClientOptions<T>, _path: readonly string[], _input: unknown): Promise<StandardLazyResponse>;
|
14
14
|
}
|
15
15
|
|
16
|
-
interface RPCLinkOptions<T extends ClientContext> extends Omit<StandardRPCLinkOptions<T>, 'url' | '
|
16
|
+
interface RPCLinkOptions<T extends ClientContext> extends Omit<StandardRPCLinkOptions<T>, 'url' | 'method' | 'fallbackMethod' | 'maxUrlLength'>, LinkWebsocketClientOptions {
|
17
17
|
}
|
18
18
|
/**
|
19
19
|
* The RPC Link communicates with the server using the RPC protocol over WebSocket.
|
@@ -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.BvXDSBF5.mjs';
|
4
4
|
import '@orpc/standard-server';
|
5
|
-
import '../../shared/client.
|
5
|
+
import '../../shared/client.BngOL3Ai.mjs';
|
6
6
|
|
7
7
|
class LinkWebsocketClient {
|
8
8
|
peer;
|
package/dist/index.d.mts
CHANGED
@@ -113,7 +113,7 @@ declare class ORPCError<TCode extends ORPCErrorCode, TData> extends Error {
|
|
113
113
|
readonly code: TCode;
|
114
114
|
readonly status: number;
|
115
115
|
readonly data: TData;
|
116
|
-
constructor(code: TCode, ...
|
116
|
+
constructor(code: TCode, ...rest: MaybeOptionalOptions<ORPCErrorOptions<TData>>);
|
117
117
|
toJSON(): ORPCErrorJSON<TCode, TData>;
|
118
118
|
}
|
119
119
|
type ORPCErrorJSON<TCode extends string, TData> = Pick<ORPCError<TCode, TData>, 'defined' | 'code' | 'status' | 'message' | 'data'>;
|
package/dist/index.d.ts
CHANGED
@@ -113,7 +113,7 @@ declare class ORPCError<TCode extends ORPCErrorCode, TData> extends Error {
|
|
113
113
|
readonly code: TCode;
|
114
114
|
readonly status: number;
|
115
115
|
readonly data: TData;
|
116
|
-
constructor(code: TCode, ...
|
116
|
+
constructor(code: TCode, ...rest: MaybeOptionalOptions<ORPCErrorOptions<TData>>);
|
117
117
|
toJSON(): ORPCErrorJSON<TCode, TData>;
|
118
118
|
}
|
119
119
|
type ORPCErrorJSON<TCode extends string, TData> = Pick<ORPCError<TCode, TData>, 'defined' | 'code' | 'status' | 'message' | 'data'>;
|
package/dist/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { i as isDefinedError } from './shared/client.
|
2
|
-
export { C as COMMON_ORPC_ERROR_DEFS, O as ORPCError, d as createORPCErrorFromJson, a as fallbackORPCErrorMessage, f as fallbackORPCErrorStatus, c as isORPCErrorJson, b as isORPCErrorStatus, m as mapEventIterator, t as toORPCError } from './shared/client.
|
1
|
+
import { i as isDefinedError } from './shared/client.BngOL3Ai.mjs';
|
2
|
+
export { C as COMMON_ORPC_ERROR_DEFS, O as ORPCError, d as createORPCErrorFromJson, a as fallbackORPCErrorMessage, f as fallbackORPCErrorStatus, c as isORPCErrorJson, b as isORPCErrorStatus, m as mapEventIterator, t as toORPCError } from './shared/client.BngOL3Ai.mjs';
|
3
3
|
import { isTypescriptObject } from '@orpc/shared';
|
4
4
|
export { EventPublisher, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@orpc/shared';
|
5
5
|
export { ErrorEvent } from '@orpc/standard-server';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { isObject, AsyncIteratorClass, isTypescriptObject } from '@orpc/shared';
|
1
|
+
import { resolveMaybeOptionalOptions, isObject, AsyncIteratorClass, isTypescriptObject } from '@orpc/shared';
|
2
2
|
import { getEventMeta, withEventMeta } from '@orpc/standard-server';
|
3
3
|
|
4
4
|
const COMMON_ORPC_ERROR_DEFS = {
|
@@ -90,16 +90,17 @@ class ORPCError extends Error {
|
|
90
90
|
code;
|
91
91
|
status;
|
92
92
|
data;
|
93
|
-
constructor(code, ...
|
94
|
-
|
93
|
+
constructor(code, ...rest) {
|
94
|
+
const options = resolveMaybeOptionalOptions(rest);
|
95
|
+
if (options.status !== void 0 && !isORPCErrorStatus(options.status)) {
|
95
96
|
throw new Error("[ORPCError] Invalid error status code.");
|
96
97
|
}
|
97
|
-
const message = fallbackORPCErrorMessage(code, options
|
98
|
+
const message = fallbackORPCErrorMessage(code, options.message);
|
98
99
|
super(message, options);
|
99
100
|
this.code = code;
|
100
|
-
this.status = fallbackORPCErrorStatus(code, options
|
101
|
-
this.defined = options
|
102
|
-
this.data = options
|
101
|
+
this.status = fallbackORPCErrorStatus(code, options.status);
|
102
|
+
this.defined = options.defined ?? false;
|
103
|
+
this.data = options.data;
|
103
104
|
}
|
104
105
|
toJSON() {
|
105
106
|
return {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { toArray, intercept, isObject, value, isAsyncIteratorObject, stringifyJSON } from '@orpc/shared';
|
2
2
|
import { mergeStandardHeaders, ErrorEvent } from '@orpc/standard-server';
|
3
|
-
import { C as COMMON_ORPC_ERROR_DEFS, b as isORPCErrorStatus, c as isORPCErrorJson, d as createORPCErrorFromJson, O as ORPCError, m as mapEventIterator, t as toORPCError } from './client.
|
3
|
+
import { C as COMMON_ORPC_ERROR_DEFS, b as isORPCErrorStatus, c as isORPCErrorJson, d as createORPCErrorFromJson, O as ORPCError, m as mapEventIterator, t as toORPCError } from './client.BngOL3Ai.mjs';
|
4
4
|
|
5
5
|
class CompositeStandardLinkPlugin {
|
6
6
|
plugins;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/client",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.7.
|
4
|
+
"version": "1.7.5",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -49,10 +49,10 @@
|
|
49
49
|
"dist"
|
50
50
|
],
|
51
51
|
"dependencies": {
|
52
|
-
"@orpc/shared": "1.7.
|
53
|
-
"@orpc/standard-server": "1.7.
|
54
|
-
"@orpc/standard-server-
|
55
|
-
"@orpc/standard-server-
|
52
|
+
"@orpc/shared": "1.7.5",
|
53
|
+
"@orpc/standard-server": "1.7.5",
|
54
|
+
"@orpc/standard-server-peer": "1.7.5",
|
55
|
+
"@orpc/standard-server-fetch": "1.7.5"
|
56
56
|
},
|
57
57
|
"devDependencies": {
|
58
58
|
"zod": "^4.0.5"
|