@orpc/client 1.0.0-beta.6 → 1.0.0-beta.7

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.
@@ -1,8 +1,8 @@
1
1
  import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
2
2
  import { ToFetchRequestOptions } from '@orpc/standard-server-fetch';
3
3
  import { a as ClientContext, b as ClientOptions } from '../../shared/client.CipPQkhk.mjs';
4
- import { f as StandardLinkClient } from '../../shared/client.Bt2hFtM_.mjs';
5
- import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.DXvQo1nS.mjs';
4
+ import { f as StandardLinkClient } from '../../shared/client.FXep-a3a.mjs';
5
+ import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.BjJBZryq.mjs';
6
6
  import '@orpc/shared';
7
7
 
8
8
  interface LinkFetchClientOptions<T extends ClientContext> extends ToFetchRequestOptions {
@@ -23,4 +23,5 @@ declare class RPCLink<T extends ClientContext> extends StandardRPCLink<T> {
23
23
  constructor(options: RPCLinkOptions<T>);
24
24
  }
25
25
 
26
- export { LinkFetchClient, type LinkFetchClientOptions, RPCLink, type RPCLinkOptions };
26
+ export { LinkFetchClient, RPCLink };
27
+ export type { LinkFetchClientOptions, RPCLinkOptions };
@@ -1,8 +1,8 @@
1
1
  import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
2
2
  import { ToFetchRequestOptions } from '@orpc/standard-server-fetch';
3
3
  import { a as ClientContext, b as ClientOptions } from '../../shared/client.CipPQkhk.js';
4
- import { f as StandardLinkClient } from '../../shared/client.FvDtk0Vr.js';
5
- import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.Dc8eXpCj.js';
4
+ import { f as StandardLinkClient } from '../../shared/client.C9U9n1f3.js';
5
+ import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.8TjrVhkC.js';
6
6
  import '@orpc/shared';
7
7
 
8
8
  interface LinkFetchClientOptions<T extends ClientContext> extends ToFetchRequestOptions {
@@ -23,4 +23,5 @@ declare class RPCLink<T extends ClientContext> extends StandardRPCLink<T> {
23
23
  constructor(options: RPCLinkOptions<T>);
24
24
  }
25
25
 
26
- export { LinkFetchClient, type LinkFetchClientOptions, RPCLink, type RPCLinkOptions };
26
+ export { LinkFetchClient, RPCLink };
27
+ export type { LinkFetchClientOptions, RPCLinkOptions };
@@ -1,5 +1,5 @@
1
- export { C as CompositeStandardLinkPlugin, d as StandardLink, f as StandardLinkClient, S as StandardLinkClientInterceptorOptions, e as StandardLinkCodec, c as StandardLinkInterceptorOptions, b as StandardLinkOptions, a as StandardLinkPlugin } from '../../shared/client.Bt2hFtM_.mjs';
2
- export { S as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, c as StandardRPCCustomJsonSerializer, b as StandardRPCJsonSerialized, a as StandardRPCJsonSerializedMetaItem, e as StandardRPCJsonSerializer, d as StandardRPCJsonSerializerOptions, g as StandardRPCLink, i as StandardRPCLinkCodec, h as StandardRPCLinkCodecOptions, f as StandardRPCLinkOptions, j as StandardRPCSerializer } from '../../shared/client.DXvQo1nS.mjs';
1
+ export { C as CompositeStandardLinkPlugin, d as StandardLink, f as StandardLinkClient, S as StandardLinkClientInterceptorOptions, e as StandardLinkCodec, c as StandardLinkInterceptorOptions, b as StandardLinkOptions, a as StandardLinkPlugin } from '../../shared/client.FXep-a3a.mjs';
2
+ export { S as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, c as StandardRPCCustomJsonSerializer, b as StandardRPCJsonSerialized, a as StandardRPCJsonSerializedMetaItem, e as StandardRPCJsonSerializer, d as StandardRPCJsonSerializerOptions, g as StandardRPCLink, i as StandardRPCLinkCodec, h as StandardRPCLinkCodecOptions, f as StandardRPCLinkOptions, j as StandardRPCSerializer } from '../../shared/client.BjJBZryq.mjs';
3
3
  import { H as HTTPPath } from '../../shared/client.CipPQkhk.mjs';
4
4
  import '@orpc/shared';
5
5
  import '@orpc/standard-server';
@@ -1,5 +1,5 @@
1
- export { C as CompositeStandardLinkPlugin, d as StandardLink, f as StandardLinkClient, S as StandardLinkClientInterceptorOptions, e as StandardLinkCodec, c as StandardLinkInterceptorOptions, b as StandardLinkOptions, a as StandardLinkPlugin } from '../../shared/client.FvDtk0Vr.js';
2
- export { S as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, c as StandardRPCCustomJsonSerializer, b as StandardRPCJsonSerialized, a as StandardRPCJsonSerializedMetaItem, e as StandardRPCJsonSerializer, d as StandardRPCJsonSerializerOptions, g as StandardRPCLink, i as StandardRPCLinkCodec, h as StandardRPCLinkCodecOptions, f as StandardRPCLinkOptions, j as StandardRPCSerializer } from '../../shared/client.Dc8eXpCj.js';
1
+ export { C as CompositeStandardLinkPlugin, d as StandardLink, f as StandardLinkClient, S as StandardLinkClientInterceptorOptions, e as StandardLinkCodec, c as StandardLinkInterceptorOptions, b as StandardLinkOptions, a as StandardLinkPlugin } from '../../shared/client.C9U9n1f3.js';
2
+ export { S as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, c as StandardRPCCustomJsonSerializer, b as StandardRPCJsonSerialized, a as StandardRPCJsonSerializedMetaItem, e as StandardRPCJsonSerializer, d as StandardRPCJsonSerializerOptions, g as StandardRPCLink, i as StandardRPCLinkCodec, h as StandardRPCLinkCodecOptions, f as StandardRPCLinkOptions, j as StandardRPCSerializer } from '../../shared/client.8TjrVhkC.js';
3
3
  import { H as HTTPPath } from '../../shared/client.CipPQkhk.js';
4
4
  import '@orpc/shared';
5
5
  import '@orpc/standard-server';
package/dist/index.d.mts CHANGED
@@ -152,4 +152,5 @@ type SafeResult<TOutput, TError> = [error: null, data: TOutput, isDefined: false
152
152
  declare function safe<TOutput, TError = ThrowableError>(promise: ClientPromiseResult<TOutput, TError>): Promise<SafeResult<TOutput, TError>>;
153
153
  declare function resolveFriendlyClientOptions<T extends ClientContext>(options: FriendlyClientOptions<T>): ClientOptions<T>;
154
154
 
155
- export { COMMON_ORPC_ERROR_DEFS, ClientContext, ClientLink, ClientOptions, ClientPromiseResult, type CommonORPCErrorCode, DynamicLink, FriendlyClientOptions, InferClientContext, NestedClient, ORPCError, type ORPCErrorCode, type ORPCErrorJSON, type ORPCErrorOptions, type SafeResult, createORPCClient, type createORPCClientOptions, createORPCErrorFromJson, fallbackORPCErrorMessage, fallbackORPCErrorStatus, isDefinedError, isORPCErrorJson, isORPCErrorStatus, mapEventIterator, resolveFriendlyClientOptions, safe, toORPCError };
155
+ export { COMMON_ORPC_ERROR_DEFS, ClientContext, ClientLink, ClientOptions, ClientPromiseResult, DynamicLink, FriendlyClientOptions, InferClientContext, NestedClient, ORPCError, createORPCClient, createORPCErrorFromJson, fallbackORPCErrorMessage, fallbackORPCErrorStatus, isDefinedError, isORPCErrorJson, isORPCErrorStatus, mapEventIterator, resolveFriendlyClientOptions, safe, toORPCError };
156
+ export type { CommonORPCErrorCode, ORPCErrorCode, ORPCErrorJSON, ORPCErrorOptions, SafeResult, createORPCClientOptions };
package/dist/index.d.ts CHANGED
@@ -152,4 +152,5 @@ type SafeResult<TOutput, TError> = [error: null, data: TOutput, isDefined: false
152
152
  declare function safe<TOutput, TError = ThrowableError>(promise: ClientPromiseResult<TOutput, TError>): Promise<SafeResult<TOutput, TError>>;
153
153
  declare function resolveFriendlyClientOptions<T extends ClientContext>(options: FriendlyClientOptions<T>): ClientOptions<T>;
154
154
 
155
- export { COMMON_ORPC_ERROR_DEFS, ClientContext, ClientLink, ClientOptions, ClientPromiseResult, type CommonORPCErrorCode, DynamicLink, FriendlyClientOptions, InferClientContext, NestedClient, ORPCError, type ORPCErrorCode, type ORPCErrorJSON, type ORPCErrorOptions, type SafeResult, createORPCClient, type createORPCClientOptions, createORPCErrorFromJson, fallbackORPCErrorMessage, fallbackORPCErrorStatus, isDefinedError, isORPCErrorJson, isORPCErrorStatus, mapEventIterator, resolveFriendlyClientOptions, safe, toORPCError };
155
+ export { COMMON_ORPC_ERROR_DEFS, ClientContext, ClientLink, ClientOptions, ClientPromiseResult, DynamicLink, FriendlyClientOptions, InferClientContext, NestedClient, ORPCError, createORPCClient, createORPCErrorFromJson, fallbackORPCErrorMessage, fallbackORPCErrorStatus, isDefinedError, isORPCErrorJson, isORPCErrorStatus, mapEventIterator, resolveFriendlyClientOptions, safe, toORPCError };
156
+ export type { CommonORPCErrorCode, ORPCErrorCode, ORPCErrorJSON, ORPCErrorOptions, SafeResult, createORPCClientOptions };
@@ -1,6 +1,6 @@
1
1
  import { Value } from '@orpc/shared';
2
2
  import { StandardHeaders, StandardRequest } from '@orpc/standard-server';
3
- import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.Bt2hFtM_.mjs';
3
+ import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.FXep-a3a.mjs';
4
4
  import { a as ClientContext } from '../shared/client.CipPQkhk.mjs';
5
5
 
6
6
  interface BatchLinkPluginGroup<T extends ClientContext> {
@@ -94,7 +94,7 @@ interface ClientRetryPluginContext {
94
94
  /**
95
95
  * The hook called when retrying, and return the unsubscribe function.
96
96
  */
97
- onRetry?: (options: ClientRetryPluginAttemptOptions<ClientRetryPluginContext>) => void | (() => void);
97
+ onRetry?: (options: ClientRetryPluginAttemptOptions<ClientRetryPluginContext>) => void | ((isSuccess: boolean) => void);
98
98
  }
99
99
  declare class ClientRetryPluginInvalidEventIteratorRetryResponse extends Error {
100
100
  }
@@ -140,4 +140,5 @@ declare class SimpleCsrfProtectionLinkPlugin<T extends ClientContext> implements
140
140
  init(options: StandardLinkOptions<T>): void;
141
141
  }
142
142
 
143
- export { BatchLinkPlugin, type BatchLinkPluginGroup, type BatchLinkPluginOptions, ClientRetryPlugin, type ClientRetryPluginAttemptOptions, type ClientRetryPluginContext, ClientRetryPluginInvalidEventIteratorRetryResponse, type ClientRetryPluginOptions, SimpleCsrfProtectionLinkPlugin, type SimpleCsrfProtectionLinkPluginOptions };
143
+ export { BatchLinkPlugin, ClientRetryPlugin, ClientRetryPluginInvalidEventIteratorRetryResponse, SimpleCsrfProtectionLinkPlugin };
144
+ export type { BatchLinkPluginGroup, BatchLinkPluginOptions, ClientRetryPluginAttemptOptions, ClientRetryPluginContext, ClientRetryPluginOptions, SimpleCsrfProtectionLinkPluginOptions };
@@ -1,6 +1,6 @@
1
1
  import { Value } from '@orpc/shared';
2
2
  import { StandardHeaders, StandardRequest } from '@orpc/standard-server';
3
- import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.FvDtk0Vr.js';
3
+ import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.C9U9n1f3.js';
4
4
  import { a as ClientContext } from '../shared/client.CipPQkhk.js';
5
5
 
6
6
  interface BatchLinkPluginGroup<T extends ClientContext> {
@@ -94,7 +94,7 @@ interface ClientRetryPluginContext {
94
94
  /**
95
95
  * The hook called when retrying, and return the unsubscribe function.
96
96
  */
97
- onRetry?: (options: ClientRetryPluginAttemptOptions<ClientRetryPluginContext>) => void | (() => void);
97
+ onRetry?: (options: ClientRetryPluginAttemptOptions<ClientRetryPluginContext>) => void | ((isSuccess: boolean) => void);
98
98
  }
99
99
  declare class ClientRetryPluginInvalidEventIteratorRetryResponse extends Error {
100
100
  }
@@ -140,4 +140,5 @@ declare class SimpleCsrfProtectionLinkPlugin<T extends ClientContext> implements
140
140
  init(options: StandardLinkOptions<T>): void;
141
141
  }
142
142
 
143
- export { BatchLinkPlugin, type BatchLinkPluginGroup, type BatchLinkPluginOptions, ClientRetryPlugin, type ClientRetryPluginAttemptOptions, type ClientRetryPluginContext, ClientRetryPluginInvalidEventIteratorRetryResponse, type ClientRetryPluginOptions, SimpleCsrfProtectionLinkPlugin, type SimpleCsrfProtectionLinkPluginOptions };
143
+ export { BatchLinkPlugin, ClientRetryPlugin, ClientRetryPluginInvalidEventIteratorRetryResponse, SimpleCsrfProtectionLinkPlugin };
144
+ export type { BatchLinkPluginGroup, BatchLinkPluginOptions, ClientRetryPluginAttemptOptions, ClientRetryPluginContext, ClientRetryPluginOptions, SimpleCsrfProtectionLinkPluginOptions };
@@ -175,20 +175,20 @@ class ClientRetryPlugin {
175
175
  }
176
176
  let lastEventId = interceptorOptions.lastEventId;
177
177
  let lastEventRetry;
178
- let unsubscribe;
178
+ let callback;
179
179
  let attemptIndex = 0;
180
- const next = async (initial) => {
181
- let current = initial;
180
+ const next = async (initialError) => {
181
+ let currentError = initialError;
182
182
  while (true) {
183
183
  const updatedInterceptorOptions = { ...interceptorOptions, lastEventId };
184
- if (current) {
184
+ if (currentError) {
185
185
  if (attemptIndex >= maxAttempts) {
186
- throw current.error;
186
+ throw currentError.error;
187
187
  }
188
188
  const attemptOptions = {
189
189
  ...updatedInterceptorOptions,
190
190
  attemptIndex,
191
- error: current.error,
191
+ error: currentError.error,
192
192
  lastEventRetry
193
193
  };
194
194
  const shouldRetryBool = await value(
@@ -196,23 +196,24 @@ class ClientRetryPlugin {
196
196
  attemptOptions
197
197
  );
198
198
  if (!shouldRetryBool) {
199
- throw current.error;
199
+ throw currentError.error;
200
200
  }
201
- unsubscribe = onRetry?.(attemptOptions);
201
+ callback = onRetry?.(attemptOptions);
202
202
  const retryDelayMs = await value(retryDelay, attemptOptions);
203
203
  await new Promise((resolve) => setTimeout(resolve, retryDelayMs));
204
204
  attemptIndex++;
205
205
  }
206
206
  try {
207
+ currentError = void 0;
207
208
  return await interceptorOptions.next(updatedInterceptorOptions);
208
209
  } catch (error) {
210
+ currentError = { error };
209
211
  if (updatedInterceptorOptions.signal?.aborted === true) {
210
212
  throw error;
211
213
  }
212
- current = { error };
213
214
  } finally {
214
- unsubscribe?.();
215
- unsubscribe = void 0;
215
+ callback?.(!currentError);
216
+ callback = void 0;
216
217
  }
217
218
  }
218
219
  };
@@ -1,5 +1,5 @@
1
1
  import { a as ClientContext, b as ClientOptions, d as HTTPMethod } from './client.CipPQkhk.js';
2
- import { e as StandardLinkCodec, b as StandardLinkOptions, d as StandardLink, f as StandardLinkClient } from './client.FvDtk0Vr.js';
2
+ import { e as StandardLinkCodec, b as StandardLinkOptions, d as StandardLink, f as StandardLinkClient } from './client.C9U9n1f3.js';
3
3
  import { Segment, Value } from '@orpc/shared';
4
4
  import { StandardHeaders, StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
5
5
 
@@ -87,4 +87,5 @@ declare class StandardRPCLink<T extends ClientContext> extends StandardLink<T> {
87
87
  constructor(linkClient: StandardLinkClient<T>, options: StandardRPCLinkOptions<T>);
88
88
  }
89
89
 
90
- export { STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES as S, type StandardRPCJsonSerializedMetaItem as a, type StandardRPCJsonSerialized as b, type StandardRPCCustomJsonSerializer as c, type StandardRPCJsonSerializerOptions as d, StandardRPCJsonSerializer as e, type StandardRPCLinkOptions as f, StandardRPCLink as g, type StandardRPCLinkCodecOptions as h, StandardRPCLinkCodec as i, StandardRPCSerializer as j };
90
+ export { STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES as S, StandardRPCJsonSerializer as e, StandardRPCLink as g, StandardRPCLinkCodec as i, StandardRPCSerializer as j };
91
+ export type { StandardRPCJsonSerializedMetaItem as a, StandardRPCJsonSerialized as b, StandardRPCCustomJsonSerializer as c, StandardRPCJsonSerializerOptions as d, StandardRPCLinkOptions as f, StandardRPCLinkCodecOptions as h };
@@ -1,5 +1,5 @@
1
1
  import { a as ClientContext, b as ClientOptions, d as HTTPMethod } from './client.CipPQkhk.mjs';
2
- import { e as StandardLinkCodec, b as StandardLinkOptions, d as StandardLink, f as StandardLinkClient } from './client.Bt2hFtM_.mjs';
2
+ import { e as StandardLinkCodec, b as StandardLinkOptions, d as StandardLink, f as StandardLinkClient } from './client.FXep-a3a.mjs';
3
3
  import { Segment, Value } from '@orpc/shared';
4
4
  import { StandardHeaders, StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
5
5
 
@@ -87,4 +87,5 @@ declare class StandardRPCLink<T extends ClientContext> extends StandardLink<T> {
87
87
  constructor(linkClient: StandardLinkClient<T>, options: StandardRPCLinkOptions<T>);
88
88
  }
89
89
 
90
- export { STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES as S, type StandardRPCJsonSerializedMetaItem as a, type StandardRPCJsonSerialized as b, type StandardRPCCustomJsonSerializer as c, type StandardRPCJsonSerializerOptions as d, StandardRPCJsonSerializer as e, type StandardRPCLinkOptions as f, StandardRPCLink as g, type StandardRPCLinkCodecOptions as h, StandardRPCLinkCodec as i, StandardRPCSerializer as j };
90
+ export { STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES as S, StandardRPCJsonSerializer as e, StandardRPCLink as g, StandardRPCLinkCodec as i, StandardRPCSerializer as j };
91
+ export type { StandardRPCJsonSerializedMetaItem as a, StandardRPCJsonSerialized as b, StandardRPCCustomJsonSerializer as c, StandardRPCJsonSerializerOptions as d, StandardRPCLinkOptions as f, StandardRPCLinkCodecOptions as h };
@@ -2,14 +2,6 @@ import { Interceptor, ThrowableError } from '@orpc/shared';
2
2
  import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
3
3
  import { a as ClientContext, b as ClientOptions, C as ClientLink } from './client.CipPQkhk.js';
4
4
 
5
- interface StandardLinkCodec<T extends ClientContext> {
6
- encode(path: readonly string[], input: unknown, options: ClientOptions<T>): Promise<StandardRequest>;
7
- decode(response: StandardLazyResponse, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<unknown>;
8
- }
9
- interface StandardLinkClient<T extends ClientContext> {
10
- call(request: StandardRequest, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<StandardLazyResponse>;
11
- }
12
-
13
5
  interface StandardLinkPlugin<T extends ClientContext> {
14
6
  order?: number;
15
7
  init?(options: StandardLinkOptions<T>): void;
@@ -20,6 +12,14 @@ declare class CompositeStandardLinkPlugin<T extends ClientContext, TPlugin exten
20
12
  init(options: StandardLinkOptions<T>): void;
21
13
  }
22
14
 
15
+ interface StandardLinkCodec<T extends ClientContext> {
16
+ encode(path: readonly string[], input: unknown, options: ClientOptions<T>): Promise<StandardRequest>;
17
+ decode(response: StandardLazyResponse, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<unknown>;
18
+ }
19
+ interface StandardLinkClient<T extends ClientContext> {
20
+ call(request: StandardRequest, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<StandardLazyResponse>;
21
+ }
22
+
23
23
  interface StandardLinkInterceptorOptions<T extends ClientContext> extends ClientOptions<T> {
24
24
  path: readonly string[];
25
25
  input: unknown;
@@ -42,4 +42,5 @@ declare class StandardLink<T extends ClientContext> implements ClientLink<T> {
42
42
  call(path: readonly string[], input: unknown, options: ClientOptions<T>): Promise<unknown>;
43
43
  }
44
44
 
45
- export { CompositeStandardLinkPlugin as C, type StandardLinkClientInterceptorOptions as S, type StandardLinkPlugin as a, type StandardLinkOptions as b, type StandardLinkInterceptorOptions as c, StandardLink as d, type StandardLinkCodec as e, type StandardLinkClient as f };
45
+ export { CompositeStandardLinkPlugin as C, StandardLink as d };
46
+ export type { StandardLinkClientInterceptorOptions as S, StandardLinkPlugin as a, StandardLinkOptions as b, StandardLinkInterceptorOptions as c, StandardLinkCodec as e, StandardLinkClient as f };
@@ -2,14 +2,6 @@ import { Interceptor, ThrowableError } from '@orpc/shared';
2
2
  import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
3
3
  import { a as ClientContext, b as ClientOptions, C as ClientLink } from './client.CipPQkhk.mjs';
4
4
 
5
- interface StandardLinkCodec<T extends ClientContext> {
6
- encode(path: readonly string[], input: unknown, options: ClientOptions<T>): Promise<StandardRequest>;
7
- decode(response: StandardLazyResponse, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<unknown>;
8
- }
9
- interface StandardLinkClient<T extends ClientContext> {
10
- call(request: StandardRequest, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<StandardLazyResponse>;
11
- }
12
-
13
5
  interface StandardLinkPlugin<T extends ClientContext> {
14
6
  order?: number;
15
7
  init?(options: StandardLinkOptions<T>): void;
@@ -20,6 +12,14 @@ declare class CompositeStandardLinkPlugin<T extends ClientContext, TPlugin exten
20
12
  init(options: StandardLinkOptions<T>): void;
21
13
  }
22
14
 
15
+ interface StandardLinkCodec<T extends ClientContext> {
16
+ encode(path: readonly string[], input: unknown, options: ClientOptions<T>): Promise<StandardRequest>;
17
+ decode(response: StandardLazyResponse, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<unknown>;
18
+ }
19
+ interface StandardLinkClient<T extends ClientContext> {
20
+ call(request: StandardRequest, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<StandardLazyResponse>;
21
+ }
22
+
23
23
  interface StandardLinkInterceptorOptions<T extends ClientContext> extends ClientOptions<T> {
24
24
  path: readonly string[];
25
25
  input: unknown;
@@ -42,4 +42,5 @@ declare class StandardLink<T extends ClientContext> implements ClientLink<T> {
42
42
  call(path: readonly string[], input: unknown, options: ClientOptions<T>): Promise<unknown>;
43
43
  }
44
44
 
45
- export { CompositeStandardLinkPlugin as C, type StandardLinkClientInterceptorOptions as S, type StandardLinkPlugin as a, type StandardLinkOptions as b, type StandardLinkInterceptorOptions as c, StandardLink as d, type StandardLinkCodec as e, type StandardLinkClient as f };
45
+ export { CompositeStandardLinkPlugin as C, StandardLink as d };
46
+ export type { StandardLinkClientInterceptorOptions as S, StandardLinkPlugin as a, StandardLinkOptions as b, StandardLinkInterceptorOptions as c, StandardLinkCodec as e, StandardLinkClient as f };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/client",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.6",
4
+ "version": "1.0.0-beta.7",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -39,9 +39,9 @@
39
39
  "dist"
40
40
  ],
41
41
  "dependencies": {
42
- "@orpc/shared": "1.0.0-beta.6",
43
- "@orpc/standard-server-fetch": "1.0.0-beta.6",
44
- "@orpc/standard-server": "1.0.0-beta.6"
42
+ "@orpc/shared": "1.0.0-beta.7",
43
+ "@orpc/standard-server": "1.0.0-beta.7",
44
+ "@orpc/standard-server-fetch": "1.0.0-beta.7"
45
45
  },
46
46
  "devDependencies": {
47
47
  "zod": "^3.24.2"