@orpc/client 0.0.0-next.bc564a6 → 0.0.0-next.bf323bf

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.
@@ -0,0 +1,105 @@
1
+ // src/event-iterator-state.ts
2
+ var iteratorStates = /* @__PURE__ */ new WeakMap();
3
+ function registerEventIteratorState(iterator, state) {
4
+ iteratorStates.set(iterator, state);
5
+ }
6
+ function updateEventIteratorStatus(state, status) {
7
+ if (state.status !== status) {
8
+ state.status = status;
9
+ state.listeners.forEach((cb) => cb(status));
10
+ }
11
+ }
12
+ function onEventIteratorStatusChange(iterator, callback, notifyImmediately = true) {
13
+ const state = iteratorStates.get(iterator);
14
+ if (!state) {
15
+ throw new Error("Iterator is not registered.");
16
+ }
17
+ if (notifyImmediately) {
18
+ callback(state.status);
19
+ }
20
+ state.listeners.push(callback);
21
+ return () => {
22
+ const index = state.listeners.indexOf(callback);
23
+ if (index !== -1) {
24
+ state.listeners.splice(index, 1);
25
+ }
26
+ };
27
+ }
28
+
29
+ // src/event-iterator.ts
30
+ import { getEventMeta } from "@orpc/server-standard";
31
+ import { retry } from "@orpc/shared";
32
+ var MAX_ALLOWED_RETRY_TIMES = 99;
33
+ function createAutoRetryEventIterator(initial, reconnect, initialLastEventId) {
34
+ const state = {
35
+ status: "connected",
36
+ listeners: []
37
+ };
38
+ const iterator = async function* () {
39
+ let current = initial;
40
+ let lastEventId = initialLastEventId;
41
+ let lastRetry;
42
+ let retryTimes = 0;
43
+ try {
44
+ while (true) {
45
+ try {
46
+ updateEventIteratorStatus(state, "connected");
47
+ const { done, value } = await current.next();
48
+ const meta = getEventMeta(value);
49
+ lastEventId = meta?.id ?? lastEventId;
50
+ lastRetry = meta?.retry ?? lastRetry;
51
+ retryTimes = 0;
52
+ if (done) {
53
+ return value;
54
+ }
55
+ yield value;
56
+ } catch (e) {
57
+ updateEventIteratorStatus(state, "reconnecting");
58
+ const meta = getEventMeta(e);
59
+ lastEventId = meta?.id ?? lastEventId;
60
+ lastRetry = meta?.retry ?? lastRetry;
61
+ let currentError = e;
62
+ current = await retry({ times: MAX_ALLOWED_RETRY_TIMES }, async (exit) => {
63
+ retryTimes += 1;
64
+ if (retryTimes > MAX_ALLOWED_RETRY_TIMES) {
65
+ throw exit(new Error(
66
+ `Exceeded maximum retry attempts (${MAX_ALLOWED_RETRY_TIMES}) for event source. Possible infinite retry loop detected. Please review the retry logic.`,
67
+ { cause: currentError }
68
+ ));
69
+ }
70
+ const reconnected = await (async () => {
71
+ try {
72
+ return await reconnect({
73
+ lastRetry,
74
+ lastEventId,
75
+ retryTimes,
76
+ error: currentError
77
+ });
78
+ } catch (e2) {
79
+ currentError = e2;
80
+ throw e2;
81
+ }
82
+ })();
83
+ if (!reconnected) {
84
+ throw exit(currentError);
85
+ }
86
+ return reconnected;
87
+ });
88
+ }
89
+ }
90
+ } finally {
91
+ updateEventIteratorStatus(state, "closed");
92
+ await current.return?.();
93
+ }
94
+ }();
95
+ registerEventIteratorState(iterator, state);
96
+ return iterator;
97
+ }
98
+
99
+ export {
100
+ registerEventIteratorState,
101
+ updateEventIteratorStatus,
102
+ onEventIteratorStatusChange,
103
+ createAutoRetryEventIterator
104
+ };
105
+ //# sourceMappingURL=chunk-HYT35LXG.js.map
package/dist/fetch.js CHANGED
@@ -1,87 +1,126 @@
1
+ import {
2
+ createAutoRetryEventIterator
3
+ } from "./chunk-HYT35LXG.js";
4
+
1
5
  // src/adapters/fetch/orpc-link.ts
2
6
  import { ORPCError } from "@orpc/contract";
3
- import { ORPCPayloadCodec } from "@orpc/server/fetch";
4
- import { ORPC_HANDLER_HEADER, ORPC_HANDLER_VALUE, trim } from "@orpc/shared";
7
+ import { isAsyncIteratorObject } from "@orpc/server-standard";
8
+ import { toFetchBody, toStandardBody } from "@orpc/server-standard-fetch";
9
+ import { RPCSerializer } from "@orpc/server/standard";
10
+ import { trim, value } from "@orpc/shared";
11
+ var InvalidEventSourceRetryResponse = class extends Error {
12
+ };
5
13
  var RPCLink = class {
6
14
  fetch;
7
- payloadCodec;
8
- maxURLLength;
15
+ rpcSerializer;
16
+ maxUrlLength;
9
17
  fallbackMethod;
10
- getMethod;
11
- getHeaders;
18
+ method;
19
+ headers;
12
20
  url;
21
+ eventSourceMaxNumberOfRetries;
22
+ eventSourceRetryDelay;
23
+ eventSourceRetry;
13
24
  constructor(options) {
14
25
  this.fetch = options.fetch ?? globalThis.fetch.bind(globalThis);
15
- this.payloadCodec = options.payloadCodec ?? new ORPCPayloadCodec();
16
- this.maxURLLength = options.maxURLLength ?? 2083;
26
+ this.rpcSerializer = options.rpcSerializer ?? new RPCSerializer();
27
+ this.maxUrlLength = options.maxUrlLength ?? 2083;
17
28
  this.fallbackMethod = options.fallbackMethod ?? "POST";
18
29
  this.url = options.url;
19
- this.getMethod = async (path, input, context) => {
20
- return await options.method?.(path, input, context) ?? this.fallbackMethod;
21
- };
22
- this.getHeaders = async (path, input, context) => {
23
- return new Headers(await options.headers?.(path, input, context));
24
- };
30
+ this.eventSourceMaxNumberOfRetries = options.eventSourceMaxNumberOfRetries ?? 5;
31
+ this.method = options.method ?? this.fallbackMethod;
32
+ this.headers = options.headers ?? {};
33
+ this.eventSourceRetry = options.eventSourceRetry ?? true;
34
+ this.eventSourceRetryDelay = options.eventSourceRetryDelay ?? (({ retryTimes, lastRetry }) => lastRetry ?? 1e3 * 2 ** retryTimes);
25
35
  }
26
36
  async call(path, input, options) {
27
- const clientContext = options.context;
28
- const encoded = await this.encode(path, input, options);
37
+ const output = await this.performCall(path, input, options);
38
+ if (!isAsyncIteratorObject(output)) {
39
+ return output;
40
+ }
41
+ return createAutoRetryEventIterator(output, async (reconnectOptions) => {
42
+ if (options.signal?.aborted || reconnectOptions.retryTimes > this.eventSourceMaxNumberOfRetries) {
43
+ return null;
44
+ }
45
+ if (!await value(this.eventSourceRetry, reconnectOptions, options, path, input)) {
46
+ return null;
47
+ }
48
+ const delay = await value(this.eventSourceRetryDelay, reconnectOptions, options, path, input);
49
+ await new Promise((resolve) => setTimeout(resolve, delay));
50
+ const updatedOptions = { ...options, lastEventId: reconnectOptions.lastEventId };
51
+ const maybeIterator = await this.performCall(path, input, updatedOptions);
52
+ if (!isAsyncIteratorObject(maybeIterator)) {
53
+ throw new InvalidEventSourceRetryResponse("Invalid EventSource retry response");
54
+ }
55
+ return maybeIterator;
56
+ }, void 0);
57
+ }
58
+ async performCall(path, input, options) {
59
+ const encoded = await this.encodeRequest(path, input, options);
60
+ const fetchBody = toFetchBody(encoded.body, encoded.headers);
61
+ if (options.lastEventId !== void 0) {
62
+ encoded.headers.set("last-event-id", options.lastEventId);
63
+ }
29
64
  const response = await this.fetch(encoded.url, {
30
65
  method: encoded.method,
31
66
  headers: encoded.headers,
32
- body: encoded.body,
67
+ body: fetchBody,
33
68
  signal: options.signal
34
- }, clientContext);
35
- const decoded = await this.payloadCodec.decode(response);
69
+ }, options, path, input);
70
+ const body = await toStandardBody(response);
71
+ const deserialized = (() => {
72
+ try {
73
+ return this.rpcSerializer.deserialize(body);
74
+ } catch (error) {
75
+ if (response.ok) {
76
+ throw new ORPCError("INTERNAL_SERVER_ERROR", {
77
+ message: "Invalid RPC response",
78
+ cause: error
79
+ });
80
+ }
81
+ throw new ORPCError(response.status.toString(), {
82
+ message: response.statusText
83
+ });
84
+ }
85
+ })();
36
86
  if (!response.ok) {
37
- if (ORPCError.isValidJSON(decoded)) {
38
- throw ORPCError.fromJSON(decoded);
87
+ if (ORPCError.isValidJSON(deserialized)) {
88
+ throw ORPCError.fromJSON(deserialized);
39
89
  }
40
90
  throw new ORPCError("INTERNAL_SERVER_ERROR", {
41
- status: response.status,
42
- message: "Internal server error",
43
- cause: decoded
91
+ message: "Invalid RPC error response",
92
+ cause: deserialized
44
93
  });
45
94
  }
46
- return decoded;
95
+ return deserialized;
47
96
  }
48
- async encode(path, input, options) {
49
- const clientContext = options.context;
50
- const expectMethod = await this.getMethod(path, input, clientContext);
51
- const methods = /* @__PURE__ */ new Set([expectMethod, this.fallbackMethod]);
52
- const baseHeaders = await this.getHeaders(path, input, clientContext);
53
- const baseUrl = new URL(`${trim(this.url, "/")}/${path.map(encodeURIComponent).join("/")}`);
54
- baseHeaders.append(ORPC_HANDLER_HEADER, ORPC_HANDLER_VALUE);
55
- for (const method of methods) {
56
- const url = new URL(baseUrl);
57
- const headers = new Headers(baseHeaders);
58
- const encoded = this.payloadCodec.encode(input, method, this.fallbackMethod);
59
- if (encoded.query) {
60
- for (const [key, value] of encoded.query.entries()) {
61
- url.searchParams.append(key, value);
62
- }
97
+ async encodeRequest(path, input, options) {
98
+ const expectedMethod = await value(this.method, options, path, input);
99
+ const headers = new Headers(await value(this.headers, options, path, input));
100
+ const url = new URL(`${trim(this.url, "/")}/${path.map(encodeURIComponent).join("/")}`);
101
+ const serialized = this.rpcSerializer.serialize(input);
102
+ if (expectedMethod === "GET" && !(serialized instanceof FormData) && !isAsyncIteratorObject(serialized)) {
103
+ const getUrl = new URL(url);
104
+ getUrl.searchParams.append("data", JSON.stringify(serialized));
105
+ if (getUrl.toString().length <= this.maxUrlLength) {
106
+ return {
107
+ body: void 0,
108
+ method: expectedMethod,
109
+ headers,
110
+ url: getUrl
111
+ };
63
112
  }
64
- if (url.toString().length > this.maxURLLength) {
65
- continue;
66
- }
67
- if (encoded.headers) {
68
- for (const [key, value] of encoded.headers.entries()) {
69
- headers.append(key, value);
70
- }
71
- }
72
- return {
73
- url,
74
- headers,
75
- method: encoded.method,
76
- body: encoded.body
77
- };
78
113
  }
79
- throw new ORPCError("BAD_REQUEST", {
80
- message: "Cannot encode the request, please check the url length or payload."
81
- });
114
+ return {
115
+ url,
116
+ method: expectedMethod === "GET" ? this.fallbackMethod : expectedMethod,
117
+ headers,
118
+ body: serialized
119
+ };
82
120
  }
83
121
  };
84
122
  export {
123
+ InvalidEventSourceRetryResponse,
85
124
  RPCLink
86
125
  };
87
126
  //# sourceMappingURL=fetch.js.map
package/dist/index.js CHANGED
@@ -1,8 +1,20 @@
1
+ import {
2
+ createAutoRetryEventIterator,
3
+ onEventIteratorStatusChange,
4
+ registerEventIteratorState,
5
+ updateEventIteratorStatus
6
+ } from "./chunk-HYT35LXG.js";
7
+
1
8
  // src/client.ts
2
9
  function createORPCClient(link, options) {
3
10
  const path = options?.path ?? [];
4
11
  const procedureClient = async (...[input, options2]) => {
5
- return await link.call(path, input, options2 ?? {});
12
+ const optionsOut = {
13
+ ...options2,
14
+ context: options2?.context ?? {}
15
+ // options.context can be undefined when all field is optional
16
+ };
17
+ return await link.call(path, input, optionsOut);
6
18
  };
7
19
  const recursive = new Proxy(procedureClient, {
8
20
  get(target, key) {
@@ -24,7 +36,7 @@ var DynamicLink = class {
24
36
  this.linkResolver = linkResolver;
25
37
  }
26
38
  async call(path, input, options) {
27
- const resolvedLink = await this.linkResolver(path, input, options.context);
39
+ const resolvedLink = await this.linkResolver(options, path, input);
28
40
  const output = await resolvedLink.call(path, input, options);
29
41
  return output;
30
42
  }
@@ -35,8 +47,12 @@ import { isDefinedError, ORPCError, safe } from "@orpc/contract";
35
47
  export {
36
48
  DynamicLink,
37
49
  ORPCError,
50
+ createAutoRetryEventIterator,
38
51
  createORPCClient,
39
52
  isDefinedError,
40
- safe
53
+ onEventIteratorStatusChange,
54
+ registerEventIteratorState,
55
+ safe,
56
+ updateEventIteratorStatus
41
57
  };
42
58
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,12 @@
1
- import type { ClientOptions, HTTPMethod } from '@orpc/contract';
2
- import type { Promisable } from '@orpc/shared';
3
- import type { ClientLink } from '../../types';
1
+ import type { ClientContext, HTTPMethod } from '@orpc/contract';
2
+ import type { Value } from '@orpc/shared';
3
+ import type { ClientLink, ClientOptionsOut } from '../../types';
4
4
  import type { FetchWithContext } from './types';
5
- import { type PublicORPCPayloadCodec } from '@orpc/server/fetch';
6
- export interface RPCLinkOptions<TClientContext> {
5
+ import { RPCSerializer } from '@orpc/server/standard';
6
+ import { type EventIteratorReconnectOptions } from '../../event-iterator';
7
+ export declare class InvalidEventSourceRetryResponse extends Error {
8
+ }
9
+ export interface RPCLinkOptions<TClientContext extends ClientContext> {
7
10
  /**
8
11
  * Base url for all requests.
9
12
  */
@@ -13,34 +16,82 @@ export interface RPCLinkOptions<TClientContext> {
13
16
  *
14
17
  * @default 2083
15
18
  */
16
- maxURLLength?: number;
19
+ maxUrlLength?: number;
17
20
  /**
18
21
  * The method used to make the request.
19
22
  *
20
23
  * @default 'POST'
21
24
  */
22
- method?(path: readonly string[], input: unknown, context: TClientContext): Promisable<HTTPMethod | undefined>;
25
+ method?: Value<HTTPMethod, [
26
+ options: ClientOptionsOut<TClientContext>,
27
+ path: readonly string[],
28
+ input: unknown
29
+ ]>;
23
30
  /**
24
31
  * The method to use when the payload cannot safely pass to the server with method return from method function.
25
- * Do not use GET as fallback method, it's very dangerous.
32
+ * GET is not allowed, it's very dangerous.
26
33
  *
27
34
  * @default 'POST'
28
35
  */
29
- fallbackMethod?: HTTPMethod;
30
- headers?(path: readonly string[], input: unknown, context: TClientContext): Promisable<Headers | Record<string, string>>;
36
+ fallbackMethod?: Exclude<HTTPMethod, 'GET'>;
37
+ /**
38
+ * Inject headers to the request.
39
+ */
40
+ headers?: Value<[string, string][] | Record<string, string> | Headers, [
41
+ options: ClientOptionsOut<TClientContext>,
42
+ path: readonly string[],
43
+ input: unknown
44
+ ]>;
45
+ /**
46
+ * Custom fetch implementation.
47
+ *
48
+ * @default globalThis.fetch.bind(globalThis)
49
+ */
31
50
  fetch?: FetchWithContext<TClientContext>;
32
- payloadCodec?: PublicORPCPayloadCodec;
51
+ rpcSerializer?: RPCSerializer;
52
+ /**
53
+ * Maximum number of retry attempts for EventSource errors before throwing.
54
+ *
55
+ * @default 5
56
+ */
57
+ eventSourceMaxNumberOfRetries?: number;
58
+ /**
59
+ * Delay (in ms) before retrying an EventSource call.
60
+ *
61
+ * @default ({retryTimes, lastRetry}) => lastRetry ?? (1000 * 2 ** retryTimes)
62
+ */
63
+ eventSourceRetryDelay?: Value<number, [
64
+ reconnectOptions: EventIteratorReconnectOptions,
65
+ options: ClientOptionsOut<TClientContext>,
66
+ path: readonly string[],
67
+ input: unknown
68
+ ]>;
69
+ /**
70
+ * Function to determine if an error is retryable.
71
+ *
72
+ * @default true
73
+ */
74
+ eventSourceRetry?: Value<boolean, [
75
+ reconnectOptions: EventIteratorReconnectOptions,
76
+ options: ClientOptionsOut<TClientContext>,
77
+ path: readonly string[],
78
+ input: unknown
79
+ ]>;
33
80
  }
34
- export declare class RPCLink<TClientContext> implements ClientLink<TClientContext> {
81
+ export declare class RPCLink<TClientContext extends ClientContext> implements ClientLink<TClientContext> {
35
82
  private readonly fetch;
36
- private readonly payloadCodec;
37
- private readonly maxURLLength;
83
+ private readonly rpcSerializer;
84
+ private readonly maxUrlLength;
38
85
  private readonly fallbackMethod;
39
- private readonly getMethod;
40
- private readonly getHeaders;
86
+ private readonly method;
87
+ private readonly headers;
41
88
  private readonly url;
89
+ private readonly eventSourceMaxNumberOfRetries;
90
+ private readonly eventSourceRetryDelay;
91
+ private readonly eventSourceRetry;
42
92
  constructor(options: RPCLinkOptions<TClientContext>);
43
- call(path: readonly string[], input: unknown, options: ClientOptions<TClientContext>): Promise<unknown>;
44
- private encode;
93
+ call(path: readonly string[], input: unknown, options: ClientOptionsOut<TClientContext>): Promise<unknown>;
94
+ private performCall;
95
+ private encodeRequest;
45
96
  }
46
97
  //# sourceMappingURL=orpc-link.d.ts.map
@@ -1,4 +1,6 @@
1
- export interface FetchWithContext<TClientContext> {
2
- (input: RequestInfo | URL, init: RequestInit | undefined, context: TClientContext): Promise<Response>;
1
+ import type { ClientContext } from '@orpc/contract';
2
+ import type { ClientOptionsOut } from '../../types';
3
+ export interface FetchWithContext<TClientContext extends ClientContext> {
4
+ (url: URL, init: RequestInit, options: ClientOptionsOut<TClientContext>, path: readonly string[], input: unknown): Promise<Response>;
3
5
  }
4
6
  //# sourceMappingURL=types.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { ContractRouter, ContractRouterClient } from '@orpc/contract';
1
+ import type { AnyContractRouter, ClientContext, ContractRouterClient } from '@orpc/contract';
2
2
  import type { AnyRouter, RouterClient } from '@orpc/server';
3
3
  import type { ClientLink } from './types';
4
4
  export interface createORPCClientOptions {
@@ -7,5 +7,5 @@ export interface createORPCClientOptions {
7
7
  */
8
8
  path?: string[];
9
9
  }
10
- export declare function createORPCClient<TRouter extends AnyRouter | ContractRouter<any>, TClientContext = unknown>(link: ClientLink<TClientContext>, options?: createORPCClientOptions): TRouter extends ContractRouter<any> ? ContractRouterClient<TRouter, TClientContext> : TRouter extends AnyRouter ? RouterClient<TRouter, TClientContext> : never;
10
+ export declare function createORPCClient<TRouter extends AnyRouter | AnyContractRouter, TClientContext extends ClientContext = Record<never, never>>(link: ClientLink<TClientContext>, options?: createORPCClientOptions): TRouter extends AnyRouter ? RouterClient<TRouter, TClientContext> : TRouter extends AnyContractRouter ? ContractRouterClient<TRouter, TClientContext> : never;
11
11
  //# sourceMappingURL=client.d.ts.map
@@ -1,13 +1,13 @@
1
- import type { ClientOptions } from '@orpc/contract';
1
+ import type { ClientContext } from '@orpc/contract';
2
2
  import type { Promisable } from '@orpc/shared';
3
- import type { ClientLink } from './types';
3
+ import type { ClientLink, ClientOptionsOut } from './types';
4
4
  /**
5
5
  * DynamicLink provides a way to dynamically resolve and delegate calls to other ClientLinks
6
6
  * based on the request path, input, and context.
7
7
  */
8
- export declare class DynamicLink<TClientContext> implements ClientLink<TClientContext> {
8
+ export declare class DynamicLink<TClientContext extends ClientContext> implements ClientLink<TClientContext> {
9
9
  private readonly linkResolver;
10
- constructor(linkResolver: (path: readonly string[], input: unknown, context: TClientContext) => Promisable<ClientLink<TClientContext>>);
11
- call(path: readonly string[], input: unknown, options: ClientOptions<TClientContext>): Promise<unknown>;
10
+ constructor(linkResolver: (options: ClientOptionsOut<TClientContext>, path: readonly string[], input: unknown) => Promisable<ClientLink<TClientContext>>);
11
+ call(path: readonly string[], input: unknown, options: ClientOptionsOut<TClientContext>): Promise<unknown>;
12
12
  }
13
13
  //# sourceMappingURL=dynamic-link.d.ts.map
@@ -0,0 +1,9 @@
1
+ export type ConnectionStatus = 'reconnecting' | 'connected' | 'closed';
2
+ export interface EventIteratorState {
3
+ status: ConnectionStatus;
4
+ listeners: Array<(newStatus: ConnectionStatus) => void>;
5
+ }
6
+ export declare function registerEventIteratorState(iterator: AsyncIteratorObject<unknown, unknown, void>, state: EventIteratorState): void;
7
+ export declare function updateEventIteratorStatus(state: EventIteratorState, status: ConnectionStatus): void;
8
+ export declare function onEventIteratorStatusChange(iterator: AsyncIteratorObject<unknown, unknown, void>, callback: (status: ConnectionStatus) => void, notifyImmediately?: boolean): () => void;
9
+ //# sourceMappingURL=event-iterator-state.d.ts.map
@@ -0,0 +1,8 @@
1
+ export interface EventIteratorReconnectOptions {
2
+ lastRetry: number | undefined;
3
+ lastEventId: string | undefined;
4
+ retryTimes: number;
5
+ error: unknown;
6
+ }
7
+ export declare function createAutoRetryEventIterator<TYield, TReturn>(initial: AsyncIterator<TYield, TReturn, void>, reconnect: (options: EventIteratorReconnectOptions) => Promise<AsyncIterator<TYield, TReturn, void> | null>, initialLastEventId: string | undefined): AsyncGenerator<TYield, TReturn, void>;
8
+ //# sourceMappingURL=event-iterator.d.ts.map
@@ -1,6 +1,8 @@
1
1
  /** unnoq */
2
2
  export * from './client';
3
3
  export * from './dynamic-link';
4
+ export * from './event-iterator';
5
+ export * from './event-iterator-state';
4
6
  export * from './types';
5
7
  export { isDefinedError, ORPCError, safe } from '@orpc/contract';
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,8 @@
1
- import type { ClientOptions } from '@orpc/contract';
2
- export interface ClientLink<TClientContext> {
3
- call(path: readonly string[], input: unknown, options: ClientOptions<TClientContext>): Promise<unknown>;
1
+ import type { ClientContext, ClientOptions } from '@orpc/contract';
2
+ export type ClientOptionsOut<TClientContext extends ClientContext> = ClientOptions<TClientContext> & {
3
+ context: TClientContext;
4
+ };
5
+ export interface ClientLink<TClientContext extends ClientContext> {
6
+ call(path: readonly string[], input: unknown, options: ClientOptionsOut<TClientContext>): Promise<unknown>;
4
7
  }
5
8
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/client",
3
3
  "type": "module",
4
- "version": "0.0.0-next.bc564a6",
4
+ "version": "0.0.0-next.bf323bf",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -34,16 +34,18 @@
34
34
  "dist"
35
35
  ],
36
36
  "dependencies": {
37
- "@orpc/shared": "0.0.0-next.bc564a6",
38
- "@orpc/contract": "0.0.0-next.bc564a6",
39
- "@orpc/server": "0.0.0-next.bc564a6"
37
+ "@orpc/server-standard": "^0.4.0",
38
+ "@orpc/server-standard-fetch": "^0.4.0",
39
+ "@orpc/server": "0.0.0-next.bf323bf",
40
+ "@orpc/contract": "0.0.0-next.bf323bf",
41
+ "@orpc/shared": "0.0.0-next.bf323bf"
40
42
  },
41
43
  "devDependencies": {
42
44
  "zod": "^3.24.1",
43
- "@orpc/openapi": "0.0.0-next.bc564a6"
45
+ "@orpc/openapi": "0.0.0-next.bf323bf"
44
46
  },
45
47
  "scripts": {
46
- "build": "tsup --clean --sourcemap --entry.index=src/index.ts --entry.fetch=src/adapters/fetch/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
48
+ "build": "tsup --onSuccess='tsc -b --noCheck'",
47
49
  "build:watch": "pnpm run build --watch",
48
50
  "type:check": "tsc -b"
49
51
  }