@orpc/client 0.0.0-next.e563486 → 0.0.0-next.e6490f2

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.
Files changed (33) hide show
  1. package/README.md +26 -22
  2. package/dist/adapters/fetch/index.d.mts +16 -13
  3. package/dist/adapters/fetch/index.d.ts +16 -13
  4. package/dist/adapters/fetch/index.mjs +5 -13
  5. package/dist/adapters/message-port/index.d.mts +59 -0
  6. package/dist/adapters/message-port/index.d.ts +59 -0
  7. package/dist/adapters/message-port/index.mjs +71 -0
  8. package/dist/adapters/standard/index.d.mts +8 -103
  9. package/dist/adapters/standard/index.d.ts +8 -103
  10. package/dist/adapters/standard/index.mjs +2 -3
  11. package/dist/adapters/websocket/index.d.mts +29 -0
  12. package/dist/adapters/websocket/index.d.ts +29 -0
  13. package/dist/adapters/websocket/index.mjs +44 -0
  14. package/dist/index.d.mts +33 -14
  15. package/dist/index.d.ts +33 -14
  16. package/dist/index.mjs +35 -33
  17. package/dist/plugins/index.d.mts +165 -25
  18. package/dist/plugins/index.d.ts +165 -25
  19. package/dist/plugins/index.mjs +313 -51
  20. package/dist/shared/client.4TS_0JaO.d.mts +29 -0
  21. package/dist/shared/client.4TS_0JaO.d.ts +29 -0
  22. package/dist/shared/client.7UM0t5o-.d.ts +91 -0
  23. package/dist/shared/client.BMoG_EdN.d.mts +46 -0
  24. package/dist/shared/{client.BacCdg3F.mjs → client.BX0_8bnM.mjs} +35 -35
  25. package/dist/shared/client.BdD8cpjs.d.mts +91 -0
  26. package/dist/shared/client.C0KbSWlC.d.ts +46 -0
  27. package/dist/shared/{client.CjUckqXO.mjs → client.CQCGVpTM.mjs} +54 -36
  28. package/package.json +16 -5
  29. package/dist/shared/client.CupM8eRP.d.mts +0 -30
  30. package/dist/shared/client.CupM8eRP.d.ts +0 -30
  31. package/dist/shared/client.CvnV7_uV.mjs +0 -12
  32. package/dist/shared/client.DrOAzyMB.d.mts +0 -45
  33. package/dist/shared/client.aGal-uGY.d.ts +0 -45
@@ -1,30 +0,0 @@
1
- type ClientContext = Record<string, any>;
2
- type ClientOptions<TClientContext extends ClientContext> = {
3
- signal?: AbortSignal;
4
- lastEventId?: string | undefined;
5
- } & (Record<never, never> extends TClientContext ? {
6
- context?: TClientContext;
7
- } : {
8
- context: TClientContext;
9
- });
10
- type ClientRest<TClientContext extends ClientContext, TInput> = Record<never, never> extends TClientContext ? undefined extends TInput ? [input?: TInput, options?: ClientOptions<TClientContext>] : [input: TInput, options?: ClientOptions<TClientContext>] : [input: TInput, options: ClientOptions<TClientContext>];
11
- type ClientPromiseResult<TOutput, TError extends Error> = Promise<TOutput> & {
12
- __error?: {
13
- type: TError;
14
- };
15
- };
16
- interface Client<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
17
- (...rest: ClientRest<TClientContext, TInput>): ClientPromiseResult<TOutput, TError>;
18
- }
19
- type NestedClient<TClientContext extends ClientContext> = Client<TClientContext, any, any, any> | {
20
- [k: string]: NestedClient<TClientContext>;
21
- };
22
- type InferClientContext<T extends NestedClient<any>> = T extends NestedClient<infer U> ? U : never;
23
- type ClientOptionsOut<TClientContext extends ClientContext> = ClientOptions<TClientContext> & {
24
- context: TClientContext;
25
- };
26
- interface ClientLink<TClientContext extends ClientContext> {
27
- call: (path: readonly string[], input: unknown, options: ClientOptionsOut<TClientContext>) => Promise<unknown>;
28
- }
29
-
30
- export type { ClientOptionsOut as C, InferClientContext as I, NestedClient as N, ClientContext as a, ClientLink as b, ClientPromiseResult as c, ClientOptions as d, ClientRest as e, Client as f };
@@ -1,12 +0,0 @@
1
- class CompositeClientPlugin {
2
- constructor(plugins = []) {
3
- this.plugins = plugins;
4
- }
5
- init(options) {
6
- for (const plugin of this.plugins) {
7
- plugin.init?.(options);
8
- }
9
- }
10
- }
11
-
12
- export { CompositeClientPlugin as C };
@@ -1,45 +0,0 @@
1
- import { Interceptor } from '@orpc/shared';
2
- import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
3
- import { a as ClientContext, C as ClientOptionsOut, b as ClientLink } from './client.CupM8eRP.mjs';
4
-
5
- interface StandardLinkCodec<T extends ClientContext> {
6
- encode(path: readonly string[], input: unknown, options: ClientOptionsOut<any>): Promise<StandardRequest>;
7
- decode(response: StandardLazyResponse, options: ClientOptionsOut<T>, path: readonly string[], input: unknown): Promise<unknown>;
8
- }
9
- interface StandardLinkClient<T extends ClientContext> {
10
- call(request: StandardRequest, options: ClientOptionsOut<T>, path: readonly string[], input: unknown): Promise<StandardLazyResponse>;
11
- }
12
-
13
- declare class InvalidEventIteratorRetryResponse extends Error {
14
- }
15
- interface StandardLinkOptions<T extends ClientContext> {
16
- interceptors?: Interceptor<{
17
- path: readonly string[];
18
- input: unknown;
19
- options: ClientOptionsOut<T>;
20
- }, unknown, unknown>[];
21
- clientInterceptors?: Interceptor<{
22
- request: StandardRequest;
23
- }, StandardLazyResponse, unknown>[];
24
- plugins?: ClientPlugin<T>[];
25
- }
26
- declare class StandardLink<T extends ClientContext> implements ClientLink<T> {
27
- #private;
28
- readonly codec: StandardLinkCodec<T>;
29
- readonly sender: StandardLinkClient<T>;
30
- private readonly interceptors;
31
- private readonly clientInterceptors;
32
- constructor(codec: StandardLinkCodec<T>, sender: StandardLinkClient<T>, options?: StandardLinkOptions<T>);
33
- call(path: readonly string[], input: unknown, options: ClientOptionsOut<T>): Promise<unknown>;
34
- }
35
-
36
- interface ClientPlugin<T extends ClientContext> {
37
- init?(options: StandardLinkOptions<T>): void;
38
- }
39
- declare class CompositeClientPlugin<T extends ClientContext> implements ClientPlugin<T> {
40
- private readonly plugins;
41
- constructor(plugins?: ClientPlugin<T>[]);
42
- init(options: StandardLinkOptions<T>): void;
43
- }
44
-
45
- export { type ClientPlugin as C, InvalidEventIteratorRetryResponse as I, type StandardLinkOptions as S, CompositeClientPlugin as a, type StandardLinkClient as b, type StandardLinkCodec as c, StandardLink as d };
@@ -1,45 +0,0 @@
1
- import { Interceptor } from '@orpc/shared';
2
- import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
3
- import { a as ClientContext, C as ClientOptionsOut, b as ClientLink } from './client.CupM8eRP.js';
4
-
5
- interface StandardLinkCodec<T extends ClientContext> {
6
- encode(path: readonly string[], input: unknown, options: ClientOptionsOut<any>): Promise<StandardRequest>;
7
- decode(response: StandardLazyResponse, options: ClientOptionsOut<T>, path: readonly string[], input: unknown): Promise<unknown>;
8
- }
9
- interface StandardLinkClient<T extends ClientContext> {
10
- call(request: StandardRequest, options: ClientOptionsOut<T>, path: readonly string[], input: unknown): Promise<StandardLazyResponse>;
11
- }
12
-
13
- declare class InvalidEventIteratorRetryResponse extends Error {
14
- }
15
- interface StandardLinkOptions<T extends ClientContext> {
16
- interceptors?: Interceptor<{
17
- path: readonly string[];
18
- input: unknown;
19
- options: ClientOptionsOut<T>;
20
- }, unknown, unknown>[];
21
- clientInterceptors?: Interceptor<{
22
- request: StandardRequest;
23
- }, StandardLazyResponse, unknown>[];
24
- plugins?: ClientPlugin<T>[];
25
- }
26
- declare class StandardLink<T extends ClientContext> implements ClientLink<T> {
27
- #private;
28
- readonly codec: StandardLinkCodec<T>;
29
- readonly sender: StandardLinkClient<T>;
30
- private readonly interceptors;
31
- private readonly clientInterceptors;
32
- constructor(codec: StandardLinkCodec<T>, sender: StandardLinkClient<T>, options?: StandardLinkOptions<T>);
33
- call(path: readonly string[], input: unknown, options: ClientOptionsOut<T>): Promise<unknown>;
34
- }
35
-
36
- interface ClientPlugin<T extends ClientContext> {
37
- init?(options: StandardLinkOptions<T>): void;
38
- }
39
- declare class CompositeClientPlugin<T extends ClientContext> implements ClientPlugin<T> {
40
- private readonly plugins;
41
- constructor(plugins?: ClientPlugin<T>[]);
42
- init(options: StandardLinkOptions<T>): void;
43
- }
44
-
45
- export { type ClientPlugin as C, InvalidEventIteratorRetryResponse as I, type StandardLinkOptions as S, CompositeClientPlugin as a, type StandardLinkClient as b, type StandardLinkCodec as c, StandardLink as d };