@therms/rpc-client
Advanced tools
Comparing version 2.17.0 to 2.18.0
@@ -1,2 +0,2 @@ | ||
export { RPCClient, RPCClientOptions } from './RPCClient'; | ||
export { CallOptions, RPCClient, RPCClientOptions } from './RPCClient'; | ||
import { CallRequestDTO } from './CallRequestDTO'; | ||
@@ -3,0 +3,0 @@ export type RPCRequest = CallRequestDTO | string; |
@@ -9,3 +9,3 @@ import { Cache } from '../cache/Cache'; | ||
import { UnsubscribeCallback } from '../types'; | ||
import { RPCRequestOptions } from '../RPCClient'; | ||
import { CallOptions } from '../RPCClient'; | ||
interface ClientManagerOptions { | ||
@@ -24,3 +24,3 @@ cache?: Cache; | ||
getInFlightCallCount(): number; | ||
manageClientRequest(request: CallRequestDTO, opts?: RPCRequestOptions): Promise<CallResponseDTO>; | ||
manageClientRequest(request: CallRequestDTO, opts?: CallOptions): Promise<CallResponseDTO>; | ||
setIdentity(identity?: RPCClientIdentity): void; | ||
@@ -40,3 +40,3 @@ } | ||
getInFlightCallCount: () => number; | ||
manageClientRequest: (request: CallRequestDTO<any>, opts?: RPCRequestOptions | undefined) => Promise<CallResponseDTO<any>>; | ||
manageClientRequest: (request: CallRequestDTO<any>, opts?: CallOptions | undefined) => Promise<CallResponseDTO<any>>; | ||
setIdentity: (identity?: RPCClientIdentity | undefined) => void; | ||
@@ -43,0 +43,0 @@ private interceptRequestMutator; |
@@ -10,3 +10,3 @@ import { CallRequestDTO } from './CallRequestDTO'; | ||
import { UnsubscribeCallback } from './types'; | ||
export interface RPCRequestOptions { | ||
export interface CallOptions { | ||
timeout?: number; | ||
@@ -16,3 +16,3 @@ transport?: 'http' | 'websocket' | TransportType; | ||
export interface RPCClient { | ||
call<Args = any, Data = any>(request: CallRequestDTO<Args> | string, args?: Args, opts?: RPCRequestOptions): Promise<CallResponseDTO<Data>>; | ||
call<Args = any, Data = any>(request: CallRequestDTO<Args> | string, args?: Args, opts?: CallOptions): Promise<CallResponseDTO<Data>>; | ||
clearCache(request?: CallRequestDTO): void; | ||
@@ -72,3 +72,3 @@ getCallCache<Args = any, Data = any>(request: CallRequestDTO<Args> | string, args?: Args): CallResponseDTO<Data> | undefined; | ||
private onWebSocketConnectionStatusChange; | ||
call: <Args = any, Data = any>(request: string | CallRequestDTO<Args>, args?: Args | undefined, opts?: RPCRequestOptions | undefined) => Promise<CallResponseDTO<Data>>; | ||
call: <Args = any, Data = any>(request: string | CallRequestDTO<Args>, args?: Args | undefined, opts?: CallOptions | undefined) => Promise<CallResponseDTO<Data>>; | ||
clearCache: (request?: CallRequestDTO<any> | undefined) => void; | ||
@@ -75,0 +75,0 @@ getCallCache: <Args = any, Data = any>(request: string | CallRequestDTO<Args>, args?: Args | undefined) => CallResponseDTO<Data> | undefined; |
@@ -5,3 +5,3 @@ import { Transport, TransportType } from "./Transport"; | ||
import { RPCClientIdentity } from '../RPCClientIdentity'; | ||
import { RPCClientOptions, RPCRequestOptions } from '../RPCClient'; | ||
import { RPCClientOptions, CallOptions } from '../RPCClient'; | ||
interface HTTPTransportOptions { | ||
@@ -20,3 +20,3 @@ host: string; | ||
isConnected: () => boolean; | ||
sendRequest: (call: CallRequestDTO, opts: RPCRequestOptions) => Promise<CallResponseDTO>; | ||
sendRequest: (call: CallRequestDTO, opts: CallOptions) => Promise<CallResponseDTO>; | ||
setIdentity: (identity?: RPCClientIdentity) => void; | ||
@@ -23,0 +23,0 @@ } |
import { CallRequestDTO } from '../CallRequestDTO'; | ||
import { CallResponseDTO } from '../CallResponseDTO'; | ||
import { RPCClientIdentity } from '../RPCClientIdentity'; | ||
import { RPCRequestOptions } from '../RPCClient'; | ||
import { CallOptions } from '../RPCClient'; | ||
export declare enum TransportType { | ||
@@ -13,5 +13,5 @@ 'http' = "http", | ||
type: TransportType; | ||
sendRequest(call: CallRequestDTO, opts: RPCRequestOptions): Promise<CallResponseDTO>; | ||
sendRequest(call: CallRequestDTO, opts: CallOptions): Promise<CallResponseDTO>; | ||
setIdentity(identity?: RPCClientIdentity): void; | ||
} | ||
//# sourceMappingURL=Transport.d.ts.map |
@@ -6,3 +6,3 @@ import { Transport, TransportType } from "./Transport"; | ||
import { UnsubscribeCallback } from '../types'; | ||
import { RPCClientOptions, RPCRequestOptions } from '../RPCClient'; | ||
import { RPCClientOptions, CallOptions } from '../RPCClient'; | ||
interface WebSocketTransportOptions { | ||
@@ -31,3 +31,3 @@ host: string; | ||
sendClientMessageToServer: (msg: any) => void; | ||
sendRequest: (call: CallRequestDTO, opts: RPCRequestOptions) => Promise<CallResponseDTO>; | ||
sendRequest: (call: CallRequestDTO, opts: CallOptions) => Promise<CallResponseDTO>; | ||
setIdentity: (identity?: RPCClientIdentity) => Promise<void>; | ||
@@ -34,0 +34,0 @@ subscribeToServerMessages: (handler: (msg: any) => void) => UnsubscribeCallback; |
{ | ||
"name": "@therms/rpc-client", | ||
"version": "2.17.0", | ||
"version": "2.18.0", | ||
"description": "RPC framework, browser client lib", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -1,2 +0,2 @@ | ||
export { RPCClient, RPCClientOptions } from './RPCClient' | ||
export { CallOptions, RPCClient, RPCClientOptions } from './RPCClient' | ||
@@ -3,0 +3,0 @@ import { CallRequestDTO } from './CallRequestDTO' |
@@ -15,3 +15,3 @@ import { Cache } from '../cache/Cache' | ||
import { UnsubscribeCallback } from '../types' | ||
import { RPCRequestOptions } from '../RPCClient' | ||
import { CallOptions } from '../RPCClient' | ||
@@ -40,3 +40,3 @@ const debug = GetDebugLogger('rpc:ClientManager') | ||
request: CallRequestDTO, | ||
opts?: RPCRequestOptions, | ||
opts?: CallOptions, | ||
): Promise<CallResponseDTO> | ||
@@ -122,3 +122,3 @@ setIdentity(identity?: RPCClientIdentity): void | ||
originalRequest: CallRequestDTO, | ||
opts?: RPCRequestOptions, | ||
opts?: CallOptions, | ||
) => { | ||
@@ -228,3 +228,3 @@ debug('manageClientRequest', originalRequest) | ||
request: CallRequestDTO, | ||
opts?: RPCRequestOptions, | ||
opts?: CallOptions, | ||
) => { | ||
@@ -231,0 +231,0 @@ debug('sendRequestWithTransport', request) |
@@ -23,3 +23,3 @@ import { CallRequestDTO } from './CallRequestDTO' | ||
export interface RPCRequestOptions { | ||
export interface CallOptions { | ||
/** Milliseconds before timeout, default is 10s if unspecified */ | ||
@@ -35,3 +35,3 @@ timeout?: number | ||
args?: Args, | ||
opts?: RPCRequestOptions, | ||
opts?: CallOptions, | ||
): Promise<CallResponseDTO<Data>> | ||
@@ -204,3 +204,3 @@ | ||
args?: Args, | ||
opts?: RPCRequestOptions, | ||
opts?: CallOptions, | ||
): Promise<CallResponseDTO<Data>> => { | ||
@@ -207,0 +207,0 @@ if (!request) |
@@ -6,3 +6,3 @@ import { Transport, TransportType } from "./Transport"; | ||
import { GetDebugLogger } from '../utils/debug-logger' | ||
import { RPCClientOptions, RPCRequestOptions } from '../RPCClient' | ||
import { RPCClientOptions, CallOptions } from '../RPCClient' | ||
@@ -40,3 +40,3 @@ const debug = GetDebugLogger('rpc:HTTPTransport') | ||
call: CallRequestDTO, | ||
opts: RPCRequestOptions, | ||
opts: CallOptions, | ||
): Promise<CallResponseDTO> => { | ||
@@ -43,0 +43,0 @@ debug('sendRequest', call) |
import { CallRequestDTO } from '../CallRequestDTO' | ||
import { CallResponseDTO } from '../CallResponseDTO' | ||
import { RPCClientIdentity } from '../RPCClientIdentity' | ||
import { RPCRequestOptions } from '../RPCClient' | ||
import { CallOptions } from '../RPCClient' | ||
@@ -20,3 +20,3 @@ export enum TransportType { | ||
call: CallRequestDTO, | ||
opts: RPCRequestOptions, | ||
opts: CallOptions, | ||
): Promise<CallResponseDTO> | ||
@@ -23,0 +23,0 @@ |
@@ -11,3 +11,3 @@ import { Transport, TransportType } from "./Transport"; | ||
import { getRequestShorthand } from '../utils/request' | ||
import { RPCClientOptions, RPCRequestOptions } from '../RPCClient' | ||
import { RPCClientOptions, CallOptions } from '../RPCClient' | ||
@@ -82,3 +82,3 @@ const debug = GetDebugLogger('rpc:WebSocketTransport') | ||
call: CallRequestDTO, | ||
opts: RPCRequestOptions, | ||
opts: CallOptions, | ||
): Promise<CallResponseDTO> => { | ||
@@ -294,3 +294,3 @@ debug('sendRequest', call) | ||
call: CallRequestDTO, | ||
opts: RPCRequestOptions, | ||
opts: CallOptions, | ||
): Promise<CallResponseDTO> => { | ||
@@ -297,0 +297,0 @@ debug('sendCall', call) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
333179