@orpc/client 0.0.0-next.d0e429d → 0.0.0-next.d16a1b6
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 +1 -1
- package/dist/adapters/fetch/index.d.mts +29 -0
- package/dist/adapters/fetch/index.d.ts +29 -0
- package/dist/adapters/fetch/index.mjs +32 -0
- package/dist/adapters/standard/index.d.mts +149 -0
- package/dist/adapters/standard/index.d.ts +149 -0
- package/dist/adapters/standard/index.mjs +4 -0
- package/dist/index.d.mts +153 -0
- package/dist/index.d.ts +153 -0
- package/dist/{index.js → index.mjs} +7 -38
- package/dist/shared/client.D_CzLDyB.d.mts +42 -0
- package/dist/shared/client.D_CzLDyB.d.ts +42 -0
- package/dist/{chunk-7F3XVLRJ.js → shared/client.DcaJQZfy.mjs} +11 -27
- package/dist/{chunk-I4MCMTJ2.js → shared/client.MkoaGU3v.mjs} +137 -23
- package/package.json +15 -25
- package/dist/fetch.js +0 -129
- package/dist/openapi.js +0 -226
- package/dist/rpc.js +0 -10
- package/dist/src/adapters/fetch/index.d.ts +0 -3
- package/dist/src/adapters/fetch/rpc-link.d.ts +0 -100
- package/dist/src/adapters/fetch/types.d.ts +0 -5
- package/dist/src/client.d.ts +0 -9
- package/dist/src/dynamic-link.d.ts +0 -12
- package/dist/src/error.d.ts +0 -106
- package/dist/src/event-iterator-state.d.ts +0 -9
- package/dist/src/event-iterator.d.ts +0 -12
- package/dist/src/index.d.ts +0 -10
- package/dist/src/openapi/bracket-notation.d.ts +0 -9
- package/dist/src/openapi/index.d.ts +0 -4
- package/dist/src/openapi/json-serializer.d.ts +0 -7
- package/dist/src/openapi/serializer.d.ts +0 -11
- package/dist/src/rpc/index.d.ts +0 -3
- package/dist/src/rpc/json-serializer.d.ts +0 -12
- package/dist/src/rpc/serializer.d.ts +0 -9
- package/dist/src/types.d.ts +0 -29
- package/dist/src/utils.d.ts +0 -17
package/dist/src/rpc/index.d.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
import { type Segment } from '@orpc/shared';
|
2
|
-
export type RPCJsonSerializedMeta = [
|
3
|
-
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7,
|
4
|
-
Segment[]
|
5
|
-
][];
|
6
|
-
export type RPCJsonSerialized = [json: unknown, meta: RPCJsonSerializedMeta, maps: Segment[][], blobs: Blob[]];
|
7
|
-
export declare class RPCJsonSerializer {
|
8
|
-
serialize(data: unknown, segments?: Segment[], meta?: RPCJsonSerializedMeta, maps?: Segment[][], blobs?: Blob[]): RPCJsonSerialized;
|
9
|
-
deserialize(json: unknown, meta: RPCJsonSerializedMeta): unknown;
|
10
|
-
deserialize(json: unknown, meta: RPCJsonSerializedMeta, maps: Segment[][], getBlob: (index: number) => Blob): unknown;
|
11
|
-
}
|
12
|
-
//# sourceMappingURL=json-serializer.d.ts.map
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { RPCJsonSerializer } from './json-serializer';
|
2
|
-
export declare class RPCSerializer {
|
3
|
-
#private;
|
4
|
-
private readonly jsonSerializer;
|
5
|
-
constructor(jsonSerializer?: RPCJsonSerializer);
|
6
|
-
serialize(data: unknown): unknown;
|
7
|
-
deserialize(data: unknown): unknown;
|
8
|
-
}
|
9
|
-
//# sourceMappingURL=serializer.d.ts.map
|
package/dist/src/types.d.ts
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
export type ClientContext = Record<string, any>;
|
2
|
-
export 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
|
-
export 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
|
-
export type ClientPromiseResult<TOutput, TError extends Error> = Promise<TOutput> & {
|
12
|
-
__error?: {
|
13
|
-
type: TError;
|
14
|
-
};
|
15
|
-
};
|
16
|
-
export interface Client<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
|
17
|
-
(...rest: ClientRest<TClientContext, TInput>): ClientPromiseResult<TOutput, TError>;
|
18
|
-
}
|
19
|
-
export type NestedClient<TClientContext extends ClientContext> = Client<TClientContext, any, any, any> | {
|
20
|
-
[k: string]: NestedClient<TClientContext>;
|
21
|
-
};
|
22
|
-
export type InferClientContext<T extends NestedClient<any>> = T extends NestedClient<infer U> ? U : never;
|
23
|
-
export type ClientOptionsOut<TClientContext extends ClientContext> = ClientOptions<TClientContext> & {
|
24
|
-
context: TClientContext;
|
25
|
-
};
|
26
|
-
export interface ClientLink<TClientContext extends ClientContext> {
|
27
|
-
call: (path: readonly string[], input: unknown, options: ClientOptionsOut<TClientContext>) => Promise<unknown>;
|
28
|
-
}
|
29
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/utils.d.ts
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
import type { ORPCError } from './error';
|
2
|
-
import type { ClientPromiseResult } from './types';
|
3
|
-
export type SafeResult<TOutput, TError extends Error> = [error: null, data: TOutput, isDefined: false] & {
|
4
|
-
error: null;
|
5
|
-
data: TOutput;
|
6
|
-
isDefined: false;
|
7
|
-
} | [error: Exclude<TError, ORPCError<any, any>>, data: undefined, isDefined: false] & {
|
8
|
-
error: Exclude<TError, ORPCError<any, any>>;
|
9
|
-
data: undefined;
|
10
|
-
isDefined: false;
|
11
|
-
} | [error: Extract<TError, ORPCError<any, any>>, data: undefined, isDefined: true] & {
|
12
|
-
error: Extract<TError, ORPCError<any, any>>;
|
13
|
-
data: undefined;
|
14
|
-
isDefined: true;
|
15
|
-
};
|
16
|
-
export declare function safe<TOutput, TError extends Error>(promise: ClientPromiseResult<TOutput, TError>): Promise<SafeResult<TOutput, TError>>;
|
17
|
-
//# sourceMappingURL=utils.d.ts.map
|