@orpc/client 2.0.0-beta.47 → 2.0.0-beta.48
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 +2 -3
- package/dist/adapters/fetch/index.d.mts +2 -48
- package/dist/adapters/fetch/index.mjs +2 -77
- package/dist/adapters/fetch/rpc-link.d.mts +13 -0
- package/dist/adapters/fetch/rpc-link.mjs +10 -0
- package/dist/adapters/fetch/transport.d.mts +31 -0
- package/dist/adapters/fetch/transport.mjs +65 -0
- package/dist/adapters/message-port/index.d.mts +3 -80
- package/dist/adapters/message-port/index.mjs +3 -101
- package/dist/adapters/message-port/message-port.d.mts +29 -0
- package/dist/adapters/message-port/message-port.mjs +43 -0
- package/dist/adapters/message-port/rpc-link.d.mts +14 -0
- package/dist/adapters/message-port/rpc-link.mjs +10 -0
- package/dist/adapters/message-port/transport.d.mts +35 -0
- package/dist/adapters/message-port/transport.mjs +47 -0
- package/dist/adapters/standard/codec.d.mts +14 -0
- package/dist/adapters/standard/codec.mjs +1 -0
- package/dist/adapters/standard/index.d.mts +5 -60
- package/dist/adapters/standard/index.mjs +4 -6
- package/dist/adapters/standard/link.d.mts +40 -0
- package/dist/adapters/standard/link.mjs +79 -0
- package/dist/adapters/standard/plugin.d.mts +32 -0
- package/dist/adapters/standard/plugin.mjs +16 -0
- package/dist/adapters/standard/rpc-link-codec.d.mts +55 -0
- package/dist/adapters/standard/rpc-link-codec.mjs +104 -0
- package/dist/adapters/standard/transport.d.mts +14 -0
- package/dist/adapters/standard/transport.mjs +1 -0
- package/dist/adapters/websocket/index.d.mts +2 -136
- package/dist/adapters/websocket/index.mjs +2 -131
- package/dist/adapters/websocket/rpc-link.d.mts +13 -0
- package/dist/adapters/websocket/rpc-link.mjs +10 -0
- package/dist/adapters/websocket/transport.d.mts +119 -0
- package/dist/adapters/websocket/transport.mjs +123 -0
- package/dist/async-iterator-object.d.mts +7 -0
- package/dist/async-iterator-object.mjs +30 -0
- package/dist/client-safe.d.mts +16 -0
- package/dist/client-safe.mjs +23 -0
- package/dist/client.d.mts +51 -0
- package/dist/client.mjs +32 -0
- package/dist/consts.d.mts +10 -0
- package/dist/consts.mjs +10 -0
- package/dist/dynamic-link.d.mts +13 -0
- package/dist/dynamic-link.mjs +12 -0
- package/dist/error-utils.d.mts +24 -0
- package/dist/error-utils.mjs +44 -0
- package/dist/error.d.mts +138 -0
- package/dist/error.mjs +105 -0
- package/dist/index.d.mts +42 -137
- package/dist/index.mjs +18 -142
- package/dist/plugins/batch.d.mts +150 -0
- package/dist/plugins/batch.mjs +339 -0
- package/dist/plugins/cookie-jar.d.mts +82 -0
- package/dist/plugins/cookie-jar.mjs +229 -0
- package/dist/plugins/dedupe.d.mts +58 -0
- package/dist/plugins/dedupe.mjs +199 -0
- package/dist/plugins/index.d.mts +28 -420
- package/dist/plugins/index.mjs +17 -971
- package/dist/plugins/request-compression.d.mts +44 -0
- package/dist/plugins/request-compression.mjs +150 -0
- package/dist/plugins/response-compression.d.mts +28 -0
- package/dist/plugins/response-compression.mjs +78 -0
- package/dist/plugins/retry-after.d.mts +41 -0
- package/dist/plugins/retry-after.mjs +71 -0
- package/dist/plugins/retry.d.mts +82 -0
- package/dist/plugins/retry.mjs +127 -0
- package/dist/plugins/timeout.d.mts +25 -0
- package/dist/plugins/timeout.mjs +36 -0
- package/dist/rpc-json-serializer.d.mts +99 -0
- package/dist/rpc-json-serializer.mjs +365 -0
- package/dist/rpc-serializer.d.mts +32 -0
- package/dist/rpc-serializer.mjs +100 -0
- package/dist/types.d.mts +93 -0
- package/dist/types.mjs +1 -0
- package/dist/utils.d.mts +46 -0
- package/dist/utils.mjs +53 -0
- package/package.json +5 -5
- package/dist/adapters/fetch/index.d.ts +0 -48
- package/dist/adapters/message-port/index.d.ts +0 -80
- package/dist/adapters/standard/index.d.ts +0 -60
- package/dist/adapters/websocket/index.d.ts +0 -136
- package/dist/index.d.ts +0 -144
- package/dist/plugins/index.d.ts +0 -420
- package/dist/shared/client.BoHJeq15.d.mts +0 -233
- package/dist/shared/client.BoHJeq15.d.ts +0 -233
- package/dist/shared/client.CKQeJJ2U.mjs +0 -172
- package/dist/shared/client.DqIWeNhQ.d.mts +0 -131
- package/dist/shared/client.DqIWeNhQ.d.ts +0 -131
- package/dist/shared/client.JBJwBhR8.d.ts +0 -90
- package/dist/shared/client.LF04eOvL.mjs +0 -115
- package/dist/shared/client._wG5INmC.mjs +0 -505
- package/dist/shared/client.euYjjcFz.d.mts +0 -90
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Promisable, OrderablePlugin, Interceptor } from '@orpc/shared';
|
|
2
|
-
import { StandardRequest, StandardLazyResponse } from '@standard-server/core';
|
|
3
|
-
import { C as ClientContext, a as ClientOptions, A as AnyORPCError, b as ClientLink } from './client.BoHJeq15.mjs';
|
|
4
|
-
|
|
5
|
-
type StandardLinkCodecDecodedResponse = {
|
|
6
|
-
kind: 'output';
|
|
7
|
-
output: unknown;
|
|
8
|
-
} | {
|
|
9
|
-
kind: 'error';
|
|
10
|
-
error: AnyORPCError;
|
|
11
|
-
};
|
|
12
|
-
interface StandardLinkCodec<T extends ClientContext> {
|
|
13
|
-
encodeInput(input: unknown, path: string[], options: ClientOptions<T>): Promisable<StandardRequest>;
|
|
14
|
-
decodeResponse(response: StandardLazyResponse, path: string[], options: ClientOptions<T>): Promisable<StandardLinkCodecDecodedResponse>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface StandardLinkPlugin<T extends ClientContext> extends OrderablePlugin {
|
|
18
|
-
/**
|
|
19
|
-
* Initializes the plugin and returns new link options.
|
|
20
|
-
* Called once per plugin instance during composition.
|
|
21
|
-
*
|
|
22
|
-
* This method allows plugins to wrap, extend, or transform link options
|
|
23
|
-
* such as interceptors, or configuration.
|
|
24
|
-
*
|
|
25
|
-
* @param options - The current link options from previous plugins or base configuration
|
|
26
|
-
* @returns Transformed link options with plugin's modifications applied
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* init(options) {
|
|
31
|
-
* return {
|
|
32
|
-
* ...options,
|
|
33
|
-
* interceptors: [...(options.interceptors || []), myInterceptor]
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
init?(options: StandardLinkOptions<T>): StandardLinkOptions<T>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Handles the transport layer for sending requests and receiving responses.
|
|
43
|
-
*
|
|
44
|
-
* Implementations are responsible for the actual network communication,
|
|
45
|
-
* such as HTTP fetch, WebSocket, or other transport mechanisms.
|
|
46
|
-
*/
|
|
47
|
-
interface StandardLinkTransport<T extends ClientContext> {
|
|
48
|
-
/**
|
|
49
|
-
* @throws Transport-level errors (network failures, timeouts, etc.)
|
|
50
|
-
*/
|
|
51
|
-
send(request: StandardRequest, path: string[], options: ClientOptions<T>): Promise<StandardLazyResponse>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface StandardLinkInterceptorOptions<T extends ClientContext> extends ClientOptions<T> {
|
|
55
|
-
path: string[];
|
|
56
|
-
input: unknown;
|
|
57
|
-
}
|
|
58
|
-
type StandardLinkInterceptor<T extends ClientContext> = Interceptor<StandardLinkInterceptorOptions<T>, Promise<unknown>>;
|
|
59
|
-
interface StandardLinkTransportInterceptorOptions<T extends ClientContext> extends ClientOptions<T> {
|
|
60
|
-
path: string[];
|
|
61
|
-
request: StandardRequest;
|
|
62
|
-
}
|
|
63
|
-
type StandardLinkTransportInterceptor<T extends ClientContext> = Interceptor<StandardLinkTransportInterceptorOptions<T>, Promise<StandardLazyResponse>>;
|
|
64
|
-
interface StandardLinkOptions<T extends ClientContext> {
|
|
65
|
-
/**
|
|
66
|
-
* Interceptors that execute around the entire call, including transport and codec.
|
|
67
|
-
* Useful for error handling, logging, metrics, ...
|
|
68
|
-
*/
|
|
69
|
-
interceptors?: StandardLinkInterceptor<T>[] | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* Interceptors that execute around the transport layer, after encoding and before decoding.
|
|
72
|
-
* Useful for modifying the request or response, adding transport-level logging, ...
|
|
73
|
-
*/
|
|
74
|
-
transportInterceptors?: StandardLinkTransportInterceptor<T>[] | undefined;
|
|
75
|
-
plugins?: StandardLinkPlugin<T>[] | undefined;
|
|
76
|
-
}
|
|
77
|
-
declare class StandardLink<T extends ClientContext> implements ClientLink<T> {
|
|
78
|
-
private readonly codec;
|
|
79
|
-
private readonly transport;
|
|
80
|
-
private readonly interceptors;
|
|
81
|
-
private readonly transportInterceptors;
|
|
82
|
-
constructor(codec: StandardLinkCodec<T>, transport: StandardLinkTransport<T>, options?: StandardLinkOptions<T>);
|
|
83
|
-
/**
|
|
84
|
-
* @throws ORPCError, MalformedResponseError, transport-level errors (network failures, timeouts, etc.)
|
|
85
|
-
*/
|
|
86
|
-
call(path: string[], input: unknown, options: ClientOptions<T>): Promise<unknown>;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export { StandardLink as a };
|
|
90
|
-
export type { StandardLinkTransport as S, StandardLinkOptions as b, StandardLinkPlugin as c, StandardLinkTransportInterceptorOptions as d, StandardLinkInterceptorOptions as e, StandardLinkCodec as f, StandardLinkCodecDecodedResponse as g, StandardLinkInterceptor as h, StandardLinkTransportInterceptor as i };
|