@orpc/client 1.9.2 → 1.9.4
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.d.mts +3 -3
- package/dist/adapters/fetch/index.d.ts +3 -3
- package/dist/adapters/fetch/index.mjs +2 -2
- package/dist/adapters/message-port/index.d.mts +3 -3
- package/dist/adapters/message-port/index.d.ts +3 -3
- package/dist/adapters/message-port/index.mjs +2 -2
- package/dist/adapters/standard/index.d.mts +3 -3
- package/dist/adapters/standard/index.d.ts +3 -3
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/adapters/websocket/index.d.mts +3 -3
- package/dist/adapters/websocket/index.d.ts +3 -3
- package/dist/adapters/websocket/index.mjs +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/shared/client.BH1AYT_p.d.mts +83 -0
- package/dist/shared/client.BH1AYT_p.d.ts +83 -0
- package/dist/shared/{client.DHUDQ0GG.mjs → client.Bw9gQI4K.mjs} +1 -1
- package/dist/shared/{client.CVVVqf1Y.d.ts → client.BxV-mzeR.d.ts} +2 -2
- package/dist/shared/{client.Bwgm6dgk.d.mts → client.CPgZaUox.d.mts} +1 -1
- package/dist/shared/{client._Y_enhib.d.mts → client.D8lMmWVC.d.mts} +2 -2
- package/dist/shared/{client.BG98rYdO.d.ts → client.De8SW4Kw.d.ts} +1 -1
- package/dist/shared/{client.DVVKXLEa.mjs → client.UNvrboGS.mjs} +1 -1
- package/package.json +6 -6
- package/dist/shared/client.BOYsZIRq.d.mts +0 -29
- package/dist/shared/client.BOYsZIRq.d.ts +0 -29
@@ -1,9 +1,9 @@
|
|
1
1
|
import { Interceptor } from '@orpc/shared';
|
2
2
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
3
3
|
import { ToFetchRequestOptions } from '@orpc/standard-server-fetch';
|
4
|
-
import { b as ClientContext, c as ClientOptions } from '../../shared/client.
|
5
|
-
import { a as StandardLinkPlugin, f as StandardLinkClient } from '../../shared/client.
|
6
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
4
|
+
import { b as ClientContext, c as ClientOptions } from '../../shared/client.BH1AYT_p.mjs';
|
5
|
+
import { a as StandardLinkPlugin, f as StandardLinkClient } from '../../shared/client.CPgZaUox.mjs';
|
6
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.D8lMmWVC.mjs';
|
7
7
|
|
8
8
|
interface LinkFetchPlugin<T extends ClientContext> extends StandardLinkPlugin<T> {
|
9
9
|
initRuntimeAdapter?(options: LinkFetchClientOptions<T>): void;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { Interceptor } from '@orpc/shared';
|
2
2
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
3
3
|
import { ToFetchRequestOptions } from '@orpc/standard-server-fetch';
|
4
|
-
import { b as ClientContext, c as ClientOptions } from '../../shared/client.
|
5
|
-
import { a as StandardLinkPlugin, f as StandardLinkClient } from '../../shared/client.
|
6
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
4
|
+
import { b as ClientContext, c as ClientOptions } from '../../shared/client.BH1AYT_p.js';
|
5
|
+
import { a as StandardLinkPlugin, f as StandardLinkClient } from '../../shared/client.De8SW4Kw.js';
|
6
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.BxV-mzeR.js';
|
7
7
|
|
8
8
|
interface LinkFetchPlugin<T extends ClientContext> extends StandardLinkPlugin<T> {
|
9
9
|
initRuntimeAdapter?(options: LinkFetchClientOptions<T>): void;
|
@@ -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.Bw9gQI4K.mjs';
|
4
4
|
import '@orpc/standard-server';
|
5
|
-
import '../../shared/client.
|
5
|
+
import '../../shared/client.UNvrboGS.mjs';
|
6
6
|
|
7
7
|
class CompositeLinkFetchPlugin extends CompositeStandardLinkPlugin {
|
8
8
|
initRuntimeAdapter(options) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
2
|
-
import { b as ClientContext, c as ClientOptions } from '../../shared/client.
|
3
|
-
import { f as StandardLinkClient } from '../../shared/client.
|
4
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
2
|
+
import { b as ClientContext, c as ClientOptions } from '../../shared/client.BH1AYT_p.mjs';
|
3
|
+
import { f as StandardLinkClient } from '../../shared/client.CPgZaUox.mjs';
|
4
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.D8lMmWVC.mjs';
|
5
5
|
import '@orpc/shared';
|
6
6
|
|
7
7
|
/**
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
2
|
-
import { b as ClientContext, c as ClientOptions } from '../../shared/client.
|
3
|
-
import { f as StandardLinkClient } from '../../shared/client.
|
4
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
2
|
+
import { b as ClientContext, c as ClientOptions } from '../../shared/client.BH1AYT_p.js';
|
3
|
+
import { f as StandardLinkClient } from '../../shared/client.De8SW4Kw.js';
|
4
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.BxV-mzeR.js';
|
5
5
|
import '@orpc/shared';
|
6
6
|
|
7
7
|
/**
|
@@ -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.Bw9gQI4K.mjs';
|
4
4
|
import '@orpc/standard-server';
|
5
|
-
import '../../shared/client.
|
5
|
+
import '../../shared/client.UNvrboGS.mjs';
|
6
6
|
import '@orpc/standard-server-fetch';
|
7
7
|
|
8
8
|
function postMessagePortMessage(port, data) {
|
@@ -1,7 +1,7 @@
|
|
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.
|
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.
|
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.CPgZaUox.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.D8lMmWVC.mjs';
|
3
3
|
import { StandardHeaders } from '@orpc/standard-server';
|
4
|
-
import { H as HTTPPath } from '../../shared/client.
|
4
|
+
import { H as HTTPPath } from '../../shared/client.BH1AYT_p.mjs';
|
5
5
|
import '@orpc/shared';
|
6
6
|
|
7
7
|
declare function toHttpPath(path: readonly string[]): HTTPPath;
|
@@ -1,7 +1,7 @@
|
|
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.
|
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.
|
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.De8SW4Kw.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.BxV-mzeR.js';
|
3
3
|
import { StandardHeaders } from '@orpc/standard-server';
|
4
|
-
import { H as HTTPPath } from '../../shared/client.
|
4
|
+
import { H as HTTPPath } from '../../shared/client.BH1AYT_p.js';
|
5
5
|
import '@orpc/shared';
|
6
6
|
|
7
7
|
declare function toHttpPath(path: readonly string[]): HTTPPath;
|
@@ -1,5 +1,5 @@
|
|
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.Bw9gQI4K.mjs';
|
2
2
|
import '@orpc/shared';
|
3
3
|
import '@orpc/standard-server';
|
4
|
-
import '../../shared/client.
|
4
|
+
import '../../shared/client.UNvrboGS.mjs';
|
5
5
|
import '@orpc/standard-server-fetch';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
2
|
-
import { b as ClientContext, c as ClientOptions } from '../../shared/client.
|
3
|
-
import { f as StandardLinkClient } from '../../shared/client.
|
4
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
2
|
+
import { b as ClientContext, c as ClientOptions } from '../../shared/client.BH1AYT_p.mjs';
|
3
|
+
import { f as StandardLinkClient } from '../../shared/client.CPgZaUox.mjs';
|
4
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.D8lMmWVC.mjs';
|
5
5
|
import '@orpc/shared';
|
6
6
|
|
7
7
|
interface LinkWebsocketClientOptions {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
2
|
-
import { b as ClientContext, c as ClientOptions } from '../../shared/client.
|
3
|
-
import { f as StandardLinkClient } from '../../shared/client.
|
4
|
-
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.
|
2
|
+
import { b as ClientContext, c as ClientOptions } from '../../shared/client.BH1AYT_p.js';
|
3
|
+
import { f as StandardLinkClient } from '../../shared/client.De8SW4Kw.js';
|
4
|
+
import { f as StandardRPCLinkOptions, g as StandardRPCLink } from '../../shared/client.BxV-mzeR.js';
|
5
5
|
import '@orpc/shared';
|
6
6
|
|
7
7
|
interface LinkWebsocketClientOptions {
|
@@ -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.Bw9gQI4K.mjs';
|
4
4
|
import '@orpc/standard-server';
|
5
|
-
import '../../shared/client.
|
5
|
+
import '../../shared/client.UNvrboGS.mjs';
|
6
6
|
import '@orpc/standard-server-fetch';
|
7
7
|
|
8
8
|
const WEBSOCKET_CONNECTING = 0;
|
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { N as NestedClient, C as ClientLink, I as InferClientContext, a as ClientPromiseResult, b as ClientContext, F as FriendlyClientOptions, c as ClientOptions, d as Client, e as ClientRest } from './shared/client.
|
2
|
-
export { f as HTTPMethod, H as HTTPPath } from './shared/client.
|
1
|
+
import { N as NestedClient, C as ClientLink, I as InferClientContext, a as ClientPromiseResult, b as ClientContext, F as FriendlyClientOptions, c as ClientOptions, d as Client, e as ClientRest } from './shared/client.BH1AYT_p.mjs';
|
2
|
+
export { f as HTTPMethod, H as HTTPPath, h as InferClientBodyInputs, j as InferClientBodyOutputs, l as InferClientErrorUnion, k as InferClientErrors, g as InferClientInputs, i as InferClientOutputs } from './shared/client.BH1AYT_p.mjs';
|
3
3
|
import { MaybeOptionalOptions, ThrowableError, OnFinishState, Promisable, AsyncIteratorClass } from '@orpc/shared';
|
4
4
|
export { AsyncIteratorClass, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@orpc/shared';
|
5
5
|
export { ErrorEvent } from '@orpc/standard-server';
|
@@ -207,7 +207,7 @@ 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.9.
|
210
|
+
declare const ORPC_CLIENT_PACKAGE_VERSION = "1.9.4";
|
211
211
|
|
212
212
|
/**
|
213
213
|
* DynamicLink provides a way to dynamically resolve and delegate calls to other ClientLinks
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { N as NestedClient, C as ClientLink, I as InferClientContext, a as ClientPromiseResult, b as ClientContext, F as FriendlyClientOptions, c as ClientOptions, d as Client, e as ClientRest } from './shared/client.
|
2
|
-
export { f as HTTPMethod, H as HTTPPath } from './shared/client.
|
1
|
+
import { N as NestedClient, C as ClientLink, I as InferClientContext, a as ClientPromiseResult, b as ClientContext, F as FriendlyClientOptions, c as ClientOptions, d as Client, e as ClientRest } from './shared/client.BH1AYT_p.js';
|
2
|
+
export { f as HTTPMethod, H as HTTPPath, h as InferClientBodyInputs, j as InferClientBodyOutputs, l as InferClientErrorUnion, k as InferClientErrors, g as InferClientInputs, i as InferClientOutputs } from './shared/client.BH1AYT_p.js';
|
3
3
|
import { MaybeOptionalOptions, ThrowableError, OnFinishState, Promisable, AsyncIteratorClass } from '@orpc/shared';
|
4
4
|
export { AsyncIteratorClass, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@orpc/shared';
|
5
5
|
export { ErrorEvent } from '@orpc/standard-server';
|
@@ -207,7 +207,7 @@ 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.9.
|
210
|
+
declare const ORPC_CLIENT_PACKAGE_VERSION = "1.9.4";
|
211
211
|
|
212
212
|
/**
|
213
213
|
* DynamicLink provides a way to dynamically resolve and delegate calls to other ClientLinks
|
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, 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, m as mapEventIterator, t as toORPCError } from './shared/client.
|
3
|
+
import { i as isDefinedError } from './shared/client.UNvrboGS.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, m as mapEventIterator, t as toORPCError } from './shared/client.UNvrboGS.mjs';
|
5
5
|
export { ErrorEvent } from '@orpc/standard-server';
|
6
6
|
|
7
7
|
async function safe(promise) {
|
package/dist/plugins/index.d.mts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Value, Promisable } from '@orpc/shared';
|
2
2
|
import { StandardHeaders, StandardRequest } from '@orpc/standard-server';
|
3
3
|
import { BatchResponseMode } from '@orpc/standard-server/batch';
|
4
|
-
import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.
|
5
|
-
import { b as ClientContext } from '../shared/client.
|
4
|
+
import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.CPgZaUox.mjs';
|
5
|
+
import { b as ClientContext } from '../shared/client.BH1AYT_p.mjs';
|
6
6
|
|
7
7
|
interface BatchLinkPluginGroup<T extends ClientContext> {
|
8
8
|
condition(options: StandardLinkClientInterceptorOptions<T>): boolean;
|
package/dist/plugins/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Value, Promisable } from '@orpc/shared';
|
2
2
|
import { StandardHeaders, StandardRequest } from '@orpc/standard-server';
|
3
3
|
import { BatchResponseMode } from '@orpc/standard-server/batch';
|
4
|
-
import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.
|
5
|
-
import { b as ClientContext } from '../shared/client.
|
4
|
+
import { S as StandardLinkClientInterceptorOptions, a as StandardLinkPlugin, b as StandardLinkOptions, c as StandardLinkInterceptorOptions } from '../shared/client.De8SW4Kw.js';
|
5
|
+
import { b as ClientContext } from '../shared/client.BH1AYT_p.js';
|
6
6
|
|
7
7
|
interface BatchLinkPluginGroup<T extends ClientContext> {
|
8
8
|
condition(options: StandardLinkClientInterceptorOptions<T>): boolean;
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { PromiseWithError } from '@orpc/shared';
|
2
|
+
|
3
|
+
type HTTPPath = `/${string}`;
|
4
|
+
type HTTPMethod = 'HEAD' | 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
5
|
+
type ClientContext = Record<PropertyKey, any>;
|
6
|
+
interface ClientOptions<T extends ClientContext> {
|
7
|
+
signal?: AbortSignal;
|
8
|
+
lastEventId?: string | undefined;
|
9
|
+
context: T;
|
10
|
+
}
|
11
|
+
type FriendlyClientOptions<T extends ClientContext> = Omit<ClientOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
12
|
+
context?: T;
|
13
|
+
} : {
|
14
|
+
context: T;
|
15
|
+
});
|
16
|
+
type ClientRest<TClientContext extends ClientContext, TInput> = Record<never, never> extends TClientContext ? undefined extends TInput ? [input?: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options: FriendlyClientOptions<TClientContext>];
|
17
|
+
type ClientPromiseResult<TOutput, TError> = PromiseWithError<TOutput, TError>;
|
18
|
+
interface Client<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
19
|
+
(...rest: ClientRest<TClientContext, TInput>): ClientPromiseResult<TOutput, TError>;
|
20
|
+
}
|
21
|
+
type NestedClient<TClientContext extends ClientContext> = Client<TClientContext, any, any, any> | {
|
22
|
+
[k: string]: NestedClient<TClientContext>;
|
23
|
+
};
|
24
|
+
type InferClientContext<T extends NestedClient<any>> = T extends NestedClient<infer U> ? U : never;
|
25
|
+
interface ClientLink<TClientContext extends ClientContext> {
|
26
|
+
call: (path: readonly string[], input: unknown, options: ClientOptions<TClientContext>) => Promise<unknown>;
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* Recursively infers the **input types** from a client.
|
30
|
+
*
|
31
|
+
* Produces a nested map where each endpoint's input type is preserved.
|
32
|
+
*/
|
33
|
+
type InferClientInputs<T extends NestedClient<any>> = T extends Client<any, infer U, any, any> ? U : {
|
34
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientInputs<T[K]> : never;
|
35
|
+
};
|
36
|
+
/**
|
37
|
+
* Recursively infers the **body input types** from a client.
|
38
|
+
*
|
39
|
+
* If an endpoint's input includes `{ body: ... }`, only the `body` portion is extracted.
|
40
|
+
* Produces a nested map of body input types.
|
41
|
+
*/
|
42
|
+
type InferClientBodyInputs<T extends NestedClient<any>> = T extends Client<any, infer U, any, any> ? U extends {
|
43
|
+
body: infer UBody;
|
44
|
+
} ? UBody : U : {
|
45
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientBodyInputs<T[K]> : never;
|
46
|
+
};
|
47
|
+
/**
|
48
|
+
* Recursively infers the **output types** from a client.
|
49
|
+
*
|
50
|
+
* Produces a nested map where each endpoint's output type is preserved.
|
51
|
+
*/
|
52
|
+
type InferClientOutputs<T extends NestedClient<any>> = T extends Client<any, any, infer U, any> ? U : {
|
53
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientOutputs<T[K]> : never;
|
54
|
+
};
|
55
|
+
/**
|
56
|
+
* Recursively infers the **body output types** from a client.
|
57
|
+
*
|
58
|
+
* If an endpoint's output includes `{ body: ... }`, only the `body` portion is extracted.
|
59
|
+
* Produces a nested map of body output types.
|
60
|
+
*/
|
61
|
+
type InferClientBodyOutputs<T extends NestedClient<any>> = T extends Client<any, any, infer U, any> ? U extends {
|
62
|
+
body: infer UBody;
|
63
|
+
} ? UBody : U : {
|
64
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientBodyOutputs<T[K]> : never;
|
65
|
+
};
|
66
|
+
/**
|
67
|
+
* Recursively infers the **error types** from a client when you use [type-safe errors](https://orpc.unnoq.com/docs/error-handling#type‐safe-error-handling).
|
68
|
+
*
|
69
|
+
* Produces a nested map where each endpoint's error type is preserved.
|
70
|
+
*/
|
71
|
+
type InferClientErrors<T extends NestedClient<any>> = T extends Client<any, any, any, infer U> ? U : {
|
72
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientErrors<T[K]> : never;
|
73
|
+
};
|
74
|
+
/**
|
75
|
+
* Recursively infers a **union of all error types** from a client when you use [type-safe errors](https://orpc.unnoq.com/docs/error-handling#type‐safe-error-handling).
|
76
|
+
*
|
77
|
+
* Useful when you want to handle all possible errors from any endpoint at once.
|
78
|
+
*/
|
79
|
+
type InferClientErrorUnion<T extends NestedClient<any>> = T extends Client<any, any, any, infer U> ? U : {
|
80
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientErrorUnion<T[K]> : never;
|
81
|
+
}[keyof T];
|
82
|
+
|
83
|
+
export type { ClientLink as C, FriendlyClientOptions as F, HTTPPath as H, InferClientContext as I, NestedClient as N, ClientPromiseResult as a, ClientContext as b, ClientOptions as c, Client as d, ClientRest as e, HTTPMethod as f, InferClientInputs as g, InferClientBodyInputs as h, InferClientOutputs as i, InferClientBodyOutputs as j, InferClientErrors as k, InferClientErrorUnion as l };
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { PromiseWithError } from '@orpc/shared';
|
2
|
+
|
3
|
+
type HTTPPath = `/${string}`;
|
4
|
+
type HTTPMethod = 'HEAD' | 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
5
|
+
type ClientContext = Record<PropertyKey, any>;
|
6
|
+
interface ClientOptions<T extends ClientContext> {
|
7
|
+
signal?: AbortSignal;
|
8
|
+
lastEventId?: string | undefined;
|
9
|
+
context: T;
|
10
|
+
}
|
11
|
+
type FriendlyClientOptions<T extends ClientContext> = Omit<ClientOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
12
|
+
context?: T;
|
13
|
+
} : {
|
14
|
+
context: T;
|
15
|
+
});
|
16
|
+
type ClientRest<TClientContext extends ClientContext, TInput> = Record<never, never> extends TClientContext ? undefined extends TInput ? [input?: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options: FriendlyClientOptions<TClientContext>];
|
17
|
+
type ClientPromiseResult<TOutput, TError> = PromiseWithError<TOutput, TError>;
|
18
|
+
interface Client<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
19
|
+
(...rest: ClientRest<TClientContext, TInput>): ClientPromiseResult<TOutput, TError>;
|
20
|
+
}
|
21
|
+
type NestedClient<TClientContext extends ClientContext> = Client<TClientContext, any, any, any> | {
|
22
|
+
[k: string]: NestedClient<TClientContext>;
|
23
|
+
};
|
24
|
+
type InferClientContext<T extends NestedClient<any>> = T extends NestedClient<infer U> ? U : never;
|
25
|
+
interface ClientLink<TClientContext extends ClientContext> {
|
26
|
+
call: (path: readonly string[], input: unknown, options: ClientOptions<TClientContext>) => Promise<unknown>;
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* Recursively infers the **input types** from a client.
|
30
|
+
*
|
31
|
+
* Produces a nested map where each endpoint's input type is preserved.
|
32
|
+
*/
|
33
|
+
type InferClientInputs<T extends NestedClient<any>> = T extends Client<any, infer U, any, any> ? U : {
|
34
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientInputs<T[K]> : never;
|
35
|
+
};
|
36
|
+
/**
|
37
|
+
* Recursively infers the **body input types** from a client.
|
38
|
+
*
|
39
|
+
* If an endpoint's input includes `{ body: ... }`, only the `body` portion is extracted.
|
40
|
+
* Produces a nested map of body input types.
|
41
|
+
*/
|
42
|
+
type InferClientBodyInputs<T extends NestedClient<any>> = T extends Client<any, infer U, any, any> ? U extends {
|
43
|
+
body: infer UBody;
|
44
|
+
} ? UBody : U : {
|
45
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientBodyInputs<T[K]> : never;
|
46
|
+
};
|
47
|
+
/**
|
48
|
+
* Recursively infers the **output types** from a client.
|
49
|
+
*
|
50
|
+
* Produces a nested map where each endpoint's output type is preserved.
|
51
|
+
*/
|
52
|
+
type InferClientOutputs<T extends NestedClient<any>> = T extends Client<any, any, infer U, any> ? U : {
|
53
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientOutputs<T[K]> : never;
|
54
|
+
};
|
55
|
+
/**
|
56
|
+
* Recursively infers the **body output types** from a client.
|
57
|
+
*
|
58
|
+
* If an endpoint's output includes `{ body: ... }`, only the `body` portion is extracted.
|
59
|
+
* Produces a nested map of body output types.
|
60
|
+
*/
|
61
|
+
type InferClientBodyOutputs<T extends NestedClient<any>> = T extends Client<any, any, infer U, any> ? U extends {
|
62
|
+
body: infer UBody;
|
63
|
+
} ? UBody : U : {
|
64
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientBodyOutputs<T[K]> : never;
|
65
|
+
};
|
66
|
+
/**
|
67
|
+
* Recursively infers the **error types** from a client when you use [type-safe errors](https://orpc.unnoq.com/docs/error-handling#type‐safe-error-handling).
|
68
|
+
*
|
69
|
+
* Produces a nested map where each endpoint's error type is preserved.
|
70
|
+
*/
|
71
|
+
type InferClientErrors<T extends NestedClient<any>> = T extends Client<any, any, any, infer U> ? U : {
|
72
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientErrors<T[K]> : never;
|
73
|
+
};
|
74
|
+
/**
|
75
|
+
* Recursively infers a **union of all error types** from a client when you use [type-safe errors](https://orpc.unnoq.com/docs/error-handling#type‐safe-error-handling).
|
76
|
+
*
|
77
|
+
* Useful when you want to handle all possible errors from any endpoint at once.
|
78
|
+
*/
|
79
|
+
type InferClientErrorUnion<T extends NestedClient<any>> = T extends Client<any, any, any, infer U> ? U : {
|
80
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? InferClientErrorUnion<T[K]> : never;
|
81
|
+
}[keyof T];
|
82
|
+
|
83
|
+
export type { ClientLink as C, FriendlyClientOptions as F, HTTPPath as H, InferClientContext as I, NestedClient as N, ClientPromiseResult as a, ClientContext as b, ClientOptions as c, Client as d, ClientRest as e, HTTPMethod as f, InferClientInputs as g, InferClientBodyInputs as h, InferClientOutputs as i, InferClientBodyOutputs as j, InferClientErrors as k, InferClientErrorUnion as l };
|
@@ -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, m as mapEventIterator, 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, m as mapEventIterator, t as toORPCError } from './client.UNvrboGS.mjs';
|
4
4
|
import { toStandardHeaders as toStandardHeaders$1 } from '@orpc/standard-server-fetch';
|
5
5
|
|
6
6
|
class CompositeStandardLinkPlugin {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { b as ClientContext, c as ClientOptions, f as HTTPMethod } from './client.
|
2
|
-
import { e as StandardLinkCodec, b as StandardLinkOptions, d as StandardLink, f as StandardLinkClient } from './client.
|
1
|
+
import { b as ClientContext, c as ClientOptions, f as HTTPMethod } from './client.BH1AYT_p.js';
|
2
|
+
import { e as StandardLinkCodec, b as StandardLinkOptions, d as StandardLink, f as StandardLinkClient } from './client.De8SW4Kw.js';
|
3
3
|
import { Segment, Value, Promisable } from '@orpc/shared';
|
4
4
|
import { StandardHeaders, StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
5
5
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Interceptor } from '@orpc/shared';
|
2
2
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
3
|
-
import { b as ClientContext, c as ClientOptions, C as ClientLink } from './client.
|
3
|
+
import { b as ClientContext, c as ClientOptions, C as ClientLink } from './client.BH1AYT_p.mjs';
|
4
4
|
|
5
5
|
interface StandardLinkPlugin<T extends ClientContext> {
|
6
6
|
order?: number;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { b as ClientContext, c as ClientOptions, f as HTTPMethod } from './client.
|
2
|
-
import { e as StandardLinkCodec, b as StandardLinkOptions, d as StandardLink, f as StandardLinkClient } from './client.
|
1
|
+
import { b as ClientContext, c as ClientOptions, f as HTTPMethod } from './client.BH1AYT_p.mjs';
|
2
|
+
import { e as StandardLinkCodec, b as StandardLinkOptions, d as StandardLink, f as StandardLinkClient } from './client.CPgZaUox.mjs';
|
3
3
|
import { Segment, Value, Promisable } from '@orpc/shared';
|
4
4
|
import { StandardHeaders, StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
5
5
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Interceptor } from '@orpc/shared';
|
2
2
|
import { StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
3
|
-
import { b as ClientContext, c as ClientOptions, C as ClientLink } from './client.
|
3
|
+
import { b as ClientContext, c as ClientOptions, C as ClientLink } from './client.BH1AYT_p.js';
|
4
4
|
|
5
5
|
interface StandardLinkPlugin<T extends ClientContext> {
|
6
6
|
order?: number;
|
@@ -2,7 +2,7 @@ import { resolveMaybeOptionalOptions, getConstructor, isObject, AsyncIteratorCla
|
|
2
2
|
import { getEventMeta, withEventMeta } from '@orpc/standard-server';
|
3
3
|
|
4
4
|
const ORPC_CLIENT_PACKAGE_NAME = "@orpc/client";
|
5
|
-
const ORPC_CLIENT_PACKAGE_VERSION = "1.9.
|
5
|
+
const ORPC_CLIENT_PACKAGE_VERSION = "1.9.4";
|
6
6
|
|
7
7
|
const COMMON_ORPC_ERROR_DEFS = {
|
8
8
|
BAD_REQUEST: {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/client",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.9.
|
4
|
+
"version": "1.9.4",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -49,13 +49,13 @@
|
|
49
49
|
"dist"
|
50
50
|
],
|
51
51
|
"dependencies": {
|
52
|
-
"@orpc/shared": "1.9.
|
53
|
-
"@orpc/standard-server": "1.9.
|
54
|
-
"@orpc/standard-server-fetch": "1.9.
|
55
|
-
"@orpc/standard-server-peer": "1.9.
|
52
|
+
"@orpc/shared": "1.9.4",
|
53
|
+
"@orpc/standard-server": "1.9.4",
|
54
|
+
"@orpc/standard-server-fetch": "1.9.4",
|
55
|
+
"@orpc/standard-server-peer": "1.9.4"
|
56
56
|
},
|
57
57
|
"devDependencies": {
|
58
|
-
"zod": "^4.1.
|
58
|
+
"zod": "^4.1.12"
|
59
59
|
},
|
60
60
|
"scripts": {
|
61
61
|
"build": "unbuild",
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import { PromiseWithError } from '@orpc/shared';
|
2
|
-
|
3
|
-
type HTTPPath = `/${string}`;
|
4
|
-
type HTTPMethod = 'HEAD' | 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
5
|
-
type ClientContext = Record<PropertyKey, any>;
|
6
|
-
interface ClientOptions<T extends ClientContext> {
|
7
|
-
signal?: AbortSignal;
|
8
|
-
lastEventId?: string | undefined;
|
9
|
-
context: T;
|
10
|
-
}
|
11
|
-
type FriendlyClientOptions<T extends ClientContext> = Omit<ClientOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
12
|
-
context?: T;
|
13
|
-
} : {
|
14
|
-
context: T;
|
15
|
-
});
|
16
|
-
type ClientRest<TClientContext extends ClientContext, TInput> = Record<never, never> extends TClientContext ? undefined extends TInput ? [input?: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options: FriendlyClientOptions<TClientContext>];
|
17
|
-
type ClientPromiseResult<TOutput, TError> = PromiseWithError<TOutput, TError>;
|
18
|
-
interface Client<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
19
|
-
(...rest: ClientRest<TClientContext, TInput>): ClientPromiseResult<TOutput, TError>;
|
20
|
-
}
|
21
|
-
type NestedClient<TClientContext extends ClientContext> = Client<TClientContext, any, any, any> | {
|
22
|
-
[k: string]: NestedClient<TClientContext>;
|
23
|
-
};
|
24
|
-
type InferClientContext<T extends NestedClient<any>> = T extends NestedClient<infer U> ? U : never;
|
25
|
-
interface ClientLink<TClientContext extends ClientContext> {
|
26
|
-
call: (path: readonly string[], input: unknown, options: ClientOptions<TClientContext>) => Promise<unknown>;
|
27
|
-
}
|
28
|
-
|
29
|
-
export type { ClientLink as C, FriendlyClientOptions as F, HTTPPath as H, InferClientContext as I, NestedClient as N, ClientPromiseResult as a, ClientContext as b, ClientOptions as c, Client as d, ClientRest as e, HTTPMethod as f };
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import { PromiseWithError } from '@orpc/shared';
|
2
|
-
|
3
|
-
type HTTPPath = `/${string}`;
|
4
|
-
type HTTPMethod = 'HEAD' | 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
5
|
-
type ClientContext = Record<PropertyKey, any>;
|
6
|
-
interface ClientOptions<T extends ClientContext> {
|
7
|
-
signal?: AbortSignal;
|
8
|
-
lastEventId?: string | undefined;
|
9
|
-
context: T;
|
10
|
-
}
|
11
|
-
type FriendlyClientOptions<T extends ClientContext> = Omit<ClientOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
12
|
-
context?: T;
|
13
|
-
} : {
|
14
|
-
context: T;
|
15
|
-
});
|
16
|
-
type ClientRest<TClientContext extends ClientContext, TInput> = Record<never, never> extends TClientContext ? undefined extends TInput ? [input?: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options: FriendlyClientOptions<TClientContext>];
|
17
|
-
type ClientPromiseResult<TOutput, TError> = PromiseWithError<TOutput, TError>;
|
18
|
-
interface Client<TClientContext extends ClientContext, TInput, TOutput, TError> {
|
19
|
-
(...rest: ClientRest<TClientContext, TInput>): ClientPromiseResult<TOutput, TError>;
|
20
|
-
}
|
21
|
-
type NestedClient<TClientContext extends ClientContext> = Client<TClientContext, any, any, any> | {
|
22
|
-
[k: string]: NestedClient<TClientContext>;
|
23
|
-
};
|
24
|
-
type InferClientContext<T extends NestedClient<any>> = T extends NestedClient<infer U> ? U : never;
|
25
|
-
interface ClientLink<TClientContext extends ClientContext> {
|
26
|
-
call: (path: readonly string[], input: unknown, options: ClientOptions<TClientContext>) => Promise<unknown>;
|
27
|
-
}
|
28
|
-
|
29
|
-
export type { ClientLink as C, FriendlyClientOptions as F, HTTPPath as H, InferClientContext as I, NestedClient as N, ClientPromiseResult as a, ClientContext as b, ClientOptions as c, Client as d, ClientRest as e, HTTPMethod as f };
|