@exhumer/signalr-client 2.0.0 → 2.1.0

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/index.d.mts CHANGED
@@ -3,7 +3,6 @@ import { Dispatcher, Dispatcher as Dispatcher$1 } from "undici";
3
3
  import { CookieAgent, cookie } from "@exhumer/undici-cookie-agent";
4
4
  import { CookieJar, CookieJar as CookieJar$1 } from "tough-cookie";
5
5
  import { EventEmitter } from "node:events";
6
-
7
6
  //#region src/constants.d.ts
8
7
  /**
9
8
  * constants.ts
@@ -12,7 +11,7 @@ import { EventEmitter } from "node:events";
12
11
  * Uses `as const satisfies` (TS 4.9+) so values carry their narrow literal
13
12
  * types while being verified against a constraint at compile time.
14
13
  */
15
- declare const MessageType: Readonly<{
14
+ export declare const MessageType: Readonly<{
16
15
  readonly Invocation: 1;
17
16
  readonly StreamItem: 2;
18
17
  readonly Completion: 3;
@@ -23,16 +22,16 @@ declare const MessageType: Readonly<{
23
22
  }>;
24
23
  /** Union of all valid message type numbers. */
25
24
  type MessageTypeValue = (typeof MessageType)[keyof typeof MessageType];
26
- declare const HubConnectionState: Readonly<{
27
- readonly Disconnected: "Disconnected";
28
- readonly Connecting: "Connecting";
29
- readonly Connected: "Connected";
30
- readonly Disconnecting: "Disconnecting";
31
- readonly Reconnecting: "Reconnecting";
25
+ export declare const HubConnectionState: Readonly<{
26
+ readonly Disconnected: 'Disconnected';
27
+ readonly Connecting: 'Connecting';
28
+ readonly Connected: 'Connected';
29
+ readonly Disconnecting: 'Disconnecting';
30
+ readonly Reconnecting: 'Reconnecting';
32
31
  }>;
33
32
  /** Union of all valid connection state strings. */
34
- type HubConnectionState = (typeof HubConnectionState)[keyof typeof HubConnectionState];
35
- declare const LogLevel: {
33
+ export type HubConnectionState = (typeof HubConnectionState)[keyof typeof HubConnectionState];
34
+ export declare const LogLevel: {
36
35
  readonly Trace: 0;
37
36
  readonly Debug: 1;
38
37
  readonly Information: 2;
@@ -41,27 +40,27 @@ declare const LogLevel: {
41
40
  readonly Critical: 5;
42
41
  readonly None: 6;
43
42
  };
44
- type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
45
- declare const HttpTransportType: {
43
+ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
44
+ export declare const HttpTransportType: {
46
45
  readonly None: 0;
47
46
  readonly WebSockets: 1;
48
47
  readonly ServerSentEvents: 2;
49
48
  readonly LongPolling: 4;
50
49
  };
51
50
  /** Bitmask of enabled transports - values can be OR-ed together. */
52
- type HttpTransportType = (typeof HttpTransportType)[keyof typeof HttpTransportType];
53
- declare const TransferFormat: {
51
+ export type HttpTransportType = (typeof HttpTransportType)[keyof typeof HttpTransportType];
52
+ export declare const TransferFormat: {
54
53
  readonly Text: 1;
55
54
  readonly Binary: 2;
56
55
  };
57
- type TransferFormat = (typeof TransferFormat)[keyof typeof TransferFormat];
56
+ export type TransferFormat = (typeof TransferFormat)[keyof typeof TransferFormat];
58
57
  /** ASCII 30 - the byte that terminates every SignalR JSON message. */
59
- declare const RECORD_SEPARATOR: "\u001E";
58
+ export declare const RECORD_SEPARATOR: '';
60
59
  /** Negotiate version we advertise to the server. */
61
- declare const NEGOTIATE_VERSION: 1;
62
- declare const DEFAULT_TIMEOUT_IN_MS: 30000;
63
- declare const DEFAULT_PING_INTERVAL_IN_MS: 15000;
64
- declare const DEFAULT_SERVER_TIMEOUT_IN_MS: 30000;
60
+ export declare const NEGOTIATE_VERSION: 1;
61
+ export declare const DEFAULT_TIMEOUT_IN_MS: 30000;
62
+ export declare const DEFAULT_PING_INTERVAL_IN_MS: 15000;
63
+ export declare const DEFAULT_SERVER_TIMEOUT_IN_MS: 30000;
65
64
  //#endregion
66
65
  //#region src/http-client.d.ts
67
66
  type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
@@ -144,7 +143,7 @@ declare abstract class BaseUndiciClient implements IHttpClient {
144
143
  * access to the response stream.
145
144
  *
146
145
  */
147
- declare class RequestHttpClient extends BaseUndiciClient {
146
+ export declare class RequestHttpClient extends BaseUndiciClient {
148
147
  /**
149
148
  * Buffered request - collects the entire response body as a string.
150
149
  *
@@ -174,7 +173,7 @@ declare class RequestHttpClient extends BaseUndiciClient {
174
173
  * For `stream()` we convert the WHATWG `ReadableStream<Uint8Array>` body to a
175
174
  * Node.js `Readable` via `Readable.fromWeb()` (Node 17+).
176
175
  */
177
- declare class FetchHttpClient extends BaseUndiciClient {
176
+ export declare class FetchHttpClient extends BaseUndiciClient {
178
177
  request(method: HttpMethod, url: string, options?: RequestOptions): Promise<HttpResponse>;
179
178
  stream(method: HttpMethod, url: string, options?: RequestOptions): Promise<StreamResult>;
180
179
  }
@@ -193,7 +192,7 @@ declare class FetchHttpClient extends BaseUndiciClient {
193
192
  * its output. For streaming `stream()` we expose the PassThrough's
194
193
  * readable side as `StreamResult.body`.
195
194
  */
196
- declare class StreamHttpClient extends BaseUndiciClient {
195
+ export declare class StreamHttpClient extends BaseUndiciClient {
197
196
  request(method: HttpMethod, url: string, options?: RequestOptions): Promise<HttpResponse>;
198
197
  stream(method: HttpMethod, url: string, options?: RequestOptions): Promise<StreamResult>;
199
198
  }
@@ -216,7 +215,7 @@ declare class StreamHttpClient extends BaseUndiciClient {
216
215
  * For `stream()` we return the raw body from the handler and give the caller
217
216
  * the duplex's readable side directly - zero extra buffering.
218
217
  */
219
- declare class PipelineHttpClient extends BaseUndiciClient {
218
+ export declare class PipelineHttpClient extends BaseUndiciClient {
220
219
  request(method: HttpMethod, url: string, options?: RequestOptions): Promise<HttpResponse>;
221
220
  stream(method: HttpMethod, url: string, options?: RequestOptions): Promise<StreamResult>;
222
221
  }
@@ -243,7 +242,7 @@ declare class PipelineHttpClient extends BaseUndiciClient {
243
242
  * (for `Agent` / `Pool`) or just `path` (for `Client` whose origin is
244
243
  * already bound). We always pass `origin` for maximum compatibility.
245
244
  */
246
- declare class DispatchHttpClient extends BaseUndiciClient {
245
+ export declare class DispatchHttpClient extends BaseUndiciClient {
247
246
  request(method: HttpMethod, url: string, options?: RequestOptions): Promise<HttpResponse>;
248
247
  stream(method: HttpMethod, url: string, options?: RequestOptions): Promise<StreamResult>;
249
248
  }
@@ -258,7 +257,7 @@ type InvocationId = string & {
258
257
  readonly [__invocationIdBrand]: void;
259
258
  };
260
259
  /** Cast a plain string to an InvocationId (only used inside the library). */
261
- declare function toInvocationId(s: string): InvocationId;
260
+ export declare function toInvocationId(s: string): InvocationId;
262
261
  /** Optional headers that may appear on any hub message. */
263
262
  type MessageHeaders = Readonly<Record<string, string>>;
264
263
  interface BaseMessage {
@@ -316,14 +315,14 @@ type HubMessage = InvocationMessage | StreamItemMessage | CompletionMessage | St
316
315
  * Asserts a code path is unreachable at compile time.
317
316
  * Use at the `default` branch of a `switch` over `HubMessage['type']`.
318
317
  */
319
- declare function assertNever(_x: never, label?: string): never;
320
- declare function isInvocationMessage(msg: HubMessage): msg is InvocationMessage;
321
- declare function isStreamItemMessage(msg: HubMessage): msg is StreamItemMessage;
322
- declare function isCompletionMessage(msg: HubMessage): msg is CompletionMessage;
323
- declare function isStreamInvocationMessage(msg: HubMessage): msg is StreamInvocationMessage;
324
- declare function isCancelInvocationMessage(msg: HubMessage): msg is CancelInvocationMessage;
325
- declare function isPingMessage(msg: HubMessage): msg is PingMessage;
326
- declare function isCloseMessage(msg: HubMessage): msg is CloseMessage;
318
+ export declare function assertNever(_x: never, label?: string): never;
319
+ export declare function isInvocationMessage(msg: HubMessage): msg is InvocationMessage;
320
+ export declare function isStreamItemMessage(msg: HubMessage): msg is StreamItemMessage;
321
+ export declare function isCompletionMessage(msg: HubMessage): msg is CompletionMessage;
322
+ export declare function isStreamInvocationMessage(msg: HubMessage): msg is StreamInvocationMessage;
323
+ export declare function isCancelInvocationMessage(msg: HubMessage): msg is CancelInvocationMessage;
324
+ export declare function isPingMessage(msg: HubMessage): msg is PingMessage;
325
+ export declare function isCloseMessage(msg: HubMessage): msg is CloseMessage;
327
326
  //#endregion
328
327
  //#region src/interfaces.d.ts
329
328
  /** Minimal logger contract. Implement this to plug in any logging framework. */
@@ -487,7 +486,7 @@ interface HubConnectionOptions {
487
486
  /** Internal: close a builder-created dispatcher when the connection ends. */
488
487
  readonly ownsDispatcher?: boolean;
489
488
  }
490
- declare class HubConnection {
489
+ export declare class HubConnection {
491
490
  #private;
492
491
  constructor(url: string, options?: HubConnectionOptions);
493
492
  get state(): HubConnectionState;
@@ -562,7 +561,7 @@ interface UrlOptions {
562
561
  /** Maximum accepted transport payload size (default: 32 MiB). */
563
562
  readonly maximumReceiveMessageSize?: number;
564
563
  }
565
- declare class HubConnectionBuilder {
564
+ export declare class HubConnectionBuilder {
566
565
  #private;
567
566
  withUrl(url: string, options?: UrlOptions): this;
568
567
  /**
@@ -698,14 +697,14 @@ declare class HubConnectionBuilder {
698
697
  withAutomaticReconnect(policy: IRetryPolicy): this;
699
698
  build(): HubConnection;
700
699
  }
701
- declare class DefaultReconnectPolicy implements IRetryPolicy {
700
+ export declare class DefaultReconnectPolicy implements IRetryPolicy {
702
701
  #private;
703
702
  constructor(retryDelays?: readonly number[]);
704
703
  nextRetryDelayInMilliseconds(context: RetryContext): number | null;
705
704
  }
706
705
  //#endregion
707
706
  //#region src/protocols/json-hub-protocol.d.ts
708
- declare const HANDSHAKE_REQUEST: string;
707
+ export declare const HANDSHAKE_REQUEST: string;
709
708
  interface HandshakeResponse {
710
709
  readonly error?: string;
711
710
  readonly minorVersion?: number;
@@ -718,10 +717,10 @@ interface HandshakeParseResult {
718
717
  * Parse the first record from `data` as the server handshake response.
719
718
  * @throws {Error} if the record separator is missing or the server returned an error.
720
719
  */
721
- declare function parseHandshakeResponse(data: string): HandshakeParseResult;
722
- declare class JsonHubProtocol implements IHubProtocol {
720
+ export declare function parseHandshakeResponse(data: string): HandshakeParseResult;
721
+ export declare class JsonHubProtocol implements IHubProtocol {
723
722
  #private;
724
- readonly name: "json";
723
+ readonly name: 'json';
725
724
  readonly version: 1;
726
725
  readonly transferFormat: 1;
727
726
  parseMessages(input: string | ArrayBuffer, logger: ILogger): HubMessage[];
@@ -745,9 +744,9 @@ declare class JsonHubProtocol implements IHubProtocol {
745
744
  * of the chosen hub protocol.
746
745
  */
747
746
  declare const HANDSHAKE_REQUEST$1: string;
748
- declare class MsgpackHubProtocol implements IHubProtocol {
747
+ export declare class MsgpackHubProtocol implements IHubProtocol {
749
748
  #private;
750
- readonly name: "messagepack";
749
+ readonly name: 'messagepack';
751
750
  readonly version: 1;
752
751
  readonly transferFormat: 2;
753
752
  parseMessages(input: string | ArrayBuffer, logger: ILogger): HubMessage[];
@@ -763,12 +762,12 @@ declare class MsgpackHubProtocol implements IHubProtocol {
763
762
  }
764
763
  //#endregion
765
764
  //#region src/logger.d.ts
766
- declare class ConsoleLogger implements ILogger {
765
+ export declare class ConsoleLogger implements ILogger {
767
766
  #private;
768
767
  constructor(minimumLevel?: LogLevel);
769
768
  log(level: LogLevel, message: string): void;
770
769
  }
771
- declare class NullLogger implements ILogger {
770
+ export declare class NullLogger implements ILogger {
772
771
  /** Singleton - no state, so one instance is enough. */
773
772
  static readonly instance: NullLogger;
774
773
  log(_logLevel: LogLevel, _message: string): void;
@@ -783,40 +782,40 @@ declare class NullLogger implements ILogger {
783
782
  * error categories at runtime.
784
783
  */
785
784
  /** Thrown when a hub method invocation fails with a server-side error. */
786
- declare class HubError extends Error {
787
- readonly name: "HubError";
785
+ export declare class HubError extends Error {
786
+ readonly name: 'HubError';
788
787
  constructor(message: string);
789
788
  }
790
789
  /** Thrown when an in-flight operation is cancelled (e.g. connection closed). */
791
- declare class AbortError extends Error {
792
- readonly name: "AbortError";
790
+ export declare class AbortError extends Error {
791
+ readonly name: 'AbortError';
793
792
  constructor(message?: string);
794
793
  }
795
794
  /** Thrown on network-level transport failures. */
796
- declare class TransportError extends Error {
797
- readonly name: "TransportError";
795
+ export declare class TransportError extends Error {
796
+ readonly name: 'TransportError';
798
797
  readonly statusCode: number | undefined;
799
798
  constructor(message: string, statusCode?: number);
800
799
  }
801
800
  /** Thrown when the SignalR protocol handshake is rejected by the server. */
802
- declare class HandshakeError extends Error {
803
- readonly name: "HandshakeError";
801
+ export declare class HandshakeError extends Error {
802
+ readonly name: 'HandshakeError';
804
803
  constructor(message: string);
805
804
  }
806
805
  /** Thrown when no acceptable transport could be negotiated. */
807
- declare class UnsupportedTransportError extends Error {
808
- readonly name: "UnsupportedTransportError";
806
+ export declare class UnsupportedTransportError extends Error {
807
+ readonly name: 'UnsupportedTransportError';
809
808
  readonly transport: number | null;
810
809
  constructor(message: string, transport: number | null);
811
810
  }
812
- declare function isHubError(e: unknown): e is HubError;
813
- declare function isAbortError(e: unknown): e is AbortError;
814
- declare function isTransportError(e: unknown): e is TransportError;
811
+ export declare function isHubError(e: unknown): e is HubError;
812
+ export declare function isAbortError(e: unknown): e is AbortError;
813
+ export declare function isTransportError(e: unknown): e is TransportError;
815
814
  //#endregion
816
815
  //#region src/transports/websocket-transport.d.ts
817
- declare class WebSocketTransport implements ITransport {
816
+ export declare class WebSocketTransport implements ITransport {
818
817
  #private;
819
- readonly name: "WebSockets";
818
+ readonly name: 'WebSockets';
820
819
  onclose: ((error?: Error) => void) | null;
821
820
  get onreceive(): ((data: string | Uint8Array) => void) | null;
822
821
  set onreceive(handler: ((data: string | Uint8Array) => void) | null);
@@ -836,9 +835,9 @@ declare class WebSocketTransport implements ITransport {
836
835
  }
837
836
  //#endregion
838
837
  //#region src/transports/sse-transport.d.ts
839
- declare class ServerSentEventsTransport implements ITransport {
838
+ export declare class ServerSentEventsTransport implements ITransport {
840
839
  #private;
841
- readonly name: "ServerSentEvents";
840
+ readonly name: 'ServerSentEvents';
842
841
  onreceive: ((data: string | Uint8Array) => void) | null;
843
842
  onclose: ((error?: Error) => void) | null;
844
843
  constructor(httpClient: IHttpClient, accessTokenFactory: (() => Promise<string | null>) | null, logger: ILogger, extraHeaders?: Record<string, string>);
@@ -848,9 +847,9 @@ declare class ServerSentEventsTransport implements ITransport {
848
847
  }
849
848
  //#endregion
850
849
  //#region src/transports/long-polling-transport.d.ts
851
- declare class LongPollingTransport implements ITransport {
850
+ export declare class LongPollingTransport implements ITransport {
852
851
  #private;
853
- readonly name: "LongPolling";
852
+ readonly name: 'LongPolling';
854
853
  onreceive: ((data: string | Uint8Array) => void) | null;
855
854
  onclose: ((error?: Error) => void) | null;
856
855
  constructor(httpClient: IHttpClient, accessTokenFactory: (() => Promise<string | null>) | null, logger: ILogger, extraHeaders?: Record<string, string>);
@@ -860,13 +859,13 @@ declare class LongPollingTransport implements ITransport {
860
859
  }
861
860
  //#endregion
862
861
  //#region src/ws-client.d.ts
863
- declare const enum WebSocketReadyState {
862
+ export declare const enum WebSocketReadyState {
864
863
  Connecting = 0,
865
864
  Open = 1,
866
865
  Closing = 2,
867
866
  Closed = 3
868
867
  }
869
- interface WebSocketClient {
868
+ export interface WebSocketClient {
870
869
  on(event: 'open', listener: () => void): this;
871
870
  on(event: 'message', listener: (data: string) => void): this;
872
871
  on(event: 'binary', listener: (data: Buffer) => void): this;
@@ -887,7 +886,7 @@ interface WebSocketClient {
887
886
  emit(event: 'error', err: Error): boolean;
888
887
  removeAllListeners(event?: string): this;
889
888
  }
890
- declare class WebSocketClient extends EventEmitter {
889
+ export declare class WebSocketClient extends EventEmitter {
891
890
  #private;
892
891
  get readyState(): WebSocketReadyState;
893
892
  /**
@@ -909,5 +908,5 @@ declare class WebSocketClient extends EventEmitter {
909
908
  close(code?: number, reason?: string): void;
910
909
  }
911
910
  //#endregion
912
- export { AbortError, type AvailableTransport, type CancelInvocationMessage, type CloseMessage, type CompletionMessage, ConsoleLogger, CookieAgent, CookieJar, DEFAULT_PING_INTERVAL_IN_MS, DEFAULT_SERVER_TIMEOUT_IN_MS, DEFAULT_TIMEOUT_IN_MS, DefaultReconnectPolicy, DispatchHttpClient, DispatchHttpClient as HttpClient, type Dispatcher, FetchHttpClient, HANDSHAKE_REQUEST, HandshakeError, type HandshakeParseResult, type HandshakeResponse, type HttpClientOptions, type HttpMethod, type HttpResponse, HttpTransportType, HubConnection, HubConnectionBuilder, type HubConnectionOptions, HubConnectionState, HubError, type HubMessage, type IHttpClient, type IHubProtocol, type ILogger, type IRetryPolicy, type IStreamResult, type IStreamSubscriber, type ISubscription, type ITransport, type InvocationId, type InvocationMessage, JsonHubProtocol, LogLevel, LongPollingTransport, HANDSHAKE_REQUEST$1 as MSGPACK_HANDSHAKE_REQUEST, type MessageHeaders, MessageType, type MessageTypeValue, MsgpackHubProtocol, NEGOTIATE_VERSION, type NegotiateResponse, NullLogger, type PingMessage, PipelineHttpClient, RECORD_SEPARATOR, RequestHttpClient, type RequestOptions, type RetryContext, ServerSentEventsTransport, StreamHttpClient, type StreamInvocationMessage, type StreamItemMessage, type StreamResult, TransferFormat, TransportError, UnsupportedTransportError, type UrlOptions, WebSocketClient, WebSocketReadyState, WebSocketTransport, assertNever, cookie, isAbortError, isCancelInvocationMessage, isCloseMessage, isCompletionMessage, isHubError, isInvocationMessage, isPingMessage, isStreamInvocationMessage, isStreamItemMessage, isTransportError, parseHandshakeResponse, toInvocationId };
911
+ export { type AvailableTransport, type CancelInvocationMessage, type CloseMessage, type CompletionMessage, CookieAgent, CookieJar, DispatchHttpClient as HttpClient, type Dispatcher, type HandshakeParseResult, type HandshakeResponse, type HttpClientOptions, type HttpMethod, type HttpResponse, type HubConnectionOptions, type HubMessage, type IHttpClient, type IHubProtocol, type ILogger, type IRetryPolicy, type IStreamResult, type IStreamSubscriber, type ISubscription, type ITransport, type InvocationId, type InvocationMessage, HANDSHAKE_REQUEST$1 as MSGPACK_HANDSHAKE_REQUEST, type MessageHeaders, type MessageTypeValue, type NegotiateResponse, type PingMessage, type RequestOptions, type RetryContext, type StreamInvocationMessage, type StreamItemMessage, type StreamResult, type UrlOptions, cookie };
913
912
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/constants.ts","../src/http-client.ts","../src/messages.ts","../src/interfaces.ts","../src/hub-connection.ts","../src/hub-connection-builder.ts","../src/protocols/json-hub-protocol.ts","../src/protocols/msgpack-hub-protocol.ts","../src/logger.ts","../src/errors.ts","../src/transports/websocket-transport.ts","../src/transports/sse-transport.ts","../src/transports/long-polling-transport.ts","../src/ws-client.ts"],"mappings":";;;;;;;;;;;;;;cAYa,WAAA,EAAW,QAAA;EAAA;;;;;;;;;KAWZ,gBAAA,WAA2B,WAAA,eAA0B,WAAW;AAAA,cAI/D,kBAAA,EAAkB,QAAA;EAAA;;;;;;AAJ6C;AAAA,KAahE,kBAAA,WAA6B,kBAAA,eAAiC,kBAAkB;AAAA,cAI/E,QAAA;EAAA;;;;;;;;KAUD,QAAA,WAAmB,QAAA,eAAuB,QAAQ;AAAA,cAIjD,iBAAA;EAAA;;;;;AAdb;AAAA,KAsBY,iBAAA,WAA4B,iBAAA,eAAgC,iBAAiB;AAAA,cAI5E,cAAA;EAAA,SAG8B,IAAA;EAAA,SAAA,MAAA;AAAA;AAAA,KAE/B,cAAA,WAAyB,cAAA,eAA6B,cAAc;;cAKnE,gBAAA;;cAGA,iBAAA;AAAA,cAIA,qBAAA;AAAA,cACA,2BAAA;AAAA,cACA,4BAAA;;;KC1CD,UAAA;;;;;;UAOK,cAAA;;WAEN,OAAA,GAAU,MAAA;EDhBS;;;AAA8D;AAI5F;EAJ8B,SCsBnB,IAAA,YAAmB,UAAA,GAAa,MAAA;;WAEhC,OAAA;AAAA;;;;UAMM,iBAAA;;WAEN,OAAA,GAAa,MAAA;;WAEb,OAAA;EDpBC;;;;AAAkD;AAI9D;;;;;;;;EAJY,SCkCD,UAAA,GAAa,YAAU;;WAEvB,uBAAA;AAAA;;;ADxB8E;AAIzF;;;uBC6Fe,gBAAA,YAA4B,WAAA;;qBAEtB,cAAA,EAAgB,MAAA;ED1FX;EAAA,mBC4FL,cAAA;ED5FgB;AAA2C;AAKhF;;EALqC,mBCiGhB,UAAA,EAAY,YAAA;EAAA,mBACZ,uBAAA;cAEP,OAAA,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D9D;;Ea4HE,IAAA,CAAK,IAAA,WAAe,MAAA,GAAS,UAAA;Eb5HA;AAA+B;AAI9D;;;EawIE,KAAA,CAAM,IAAA,WAAa,MAAA;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":["Dispatcher","_$__http_client_js0.RequestOptions","_$__http_client_js0.HttpMethod","CookieJar","HANDSHAKE_REQUEST","Dispatcher"],"sources":["../src/constants.ts","../src/http-client.ts","../src/messages.ts","../src/interfaces.ts","../src/hub-connection.ts","../src/hub-connection-builder.ts","../src/protocols/json-hub-protocol.ts","../src/protocols/msgpack-hub-protocol.ts","../src/logger.ts","../src/errors.ts","../src/transports/websocket-transport.ts","../src/transports/sse-transport.ts","../src/transports/long-polling-transport.ts","../src/ws-client.ts"],"mappings":";;;;;;;;;;;;;qBAYa,aAAW;WACJ;WACA;WACA;WACA;WACA;WACA;WACA;;;KAIR,2BAA2B,0BAA0B;qBAIpD,oBAAkB;WACd;WACA;WACA;WACA;WACA;;;YAIL,6BAA6B,iCAAiC;qBAI7D;WACE;WACA;WACA;WACA;WACA;WACA;WACA;;YAGH,mBAAmB,uBAAuB;qBAIzC;WACO;WACA;WACA;WACA;;;YAIR,4BAA4B,gCAAgC;qBAI3D;WACH;WACA;;YAGE,yBAAyB,6BAA6B;;qBAKrD;;qBAGA;qBAIA;qBACA;qBACA;;;KC1CD;;;;;;UAOK;;WAEN,UAAU;;;;;;WAMV,gBAAmB,aAAa;;WAEhC;;;;;UAMM;;WAEN,UAAa;;WAEb;;;;;;;;;;;;;;WAcA,aAAaA;;WAEb;;;;;;;;uBAyEI,4BAA4B;;qBAEtB,gBAAgB;;qBAEhB;;;;;qBAKA,YAAYA;qBACZ;EAEnB,YAAY,UAAS;EASrB,IAAI,aAAa,UAAU,iBAAiB,QAAQ;EAIpD,KAAK,aAAa,UAAU,iBAAiB,QAAQ;EAIrD,OAAO,aAAa,UAAU,iBAAiB,QAAQ;WAM9C,QACP,QAAS,YACT,aACA,UAAU,iBACT,QAAQ;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QjB,QAAQ,aAAa,gBAAgB,iBAAiB;EAmDtD,KAAK,eAAe,aAAa;EAsBvC,QAAQ;;;;qBCjGG,gCAAgC;;WAClC;EAaT,aAAa,eAAe;EAC5B,WAAa,QAAQ;EAErB,YACE,YAAqB,aACrB,2BAA4B,gCAC5B,QAAqB,SACrB,eAAqB;EAQjB,QAAQ,aAAa,gBAAgB,iBAAiB;EActD,KAAK,eAAe,aAAa;EAkBjC,QAAQ;;;;0BC/CE;EAChB;EACA;EACA;EACA;;iBAOe;EACf,GAAG,eAAkB;EACrB,GAAG,kBAAkB,WAAW;EAChC,GAAG,iBAAkB,WAAW,MAAM;EACtC,GAAG,eAAkB,WAAW,MAAM;EACtC,GAAG,eAAkB,WAAW,MAAM;EACtC,GAAG,gBAAkB;EACrB,GAAG,gBAAkB,WAAW,KAAK;EAErC,KAAK,eAAkB;EACvB,KAAK,kBAAkB,WAAW;EAClC,KAAK,gBAAkB;EACvB,KAAK,gBAAkB,WAAW,KAAK;EAEvC,KAAK;EACL,KAAK,kBAAkB;EACvB,KAAK,iBAAkB,MAAM;EAC7B,KAAK,eAAkB,MAAM;EAC7B,KAAK,eAAkB,MAAM;EAC7B,KAAK;EACL,KAAK,gBAAkB,KAAK;EAE5B,mBAAmB;;qBAiBR,wBAAwB;;MAU/B,cAAc;;;;;;EASlB,QAAQ,aAAa,UAAS,yBAA8B;;;;;EAuE5D,KAAK,eAAe,SAAS;;;;;;EAgB7B,MAAM,eAAa"}
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { PassThrough, Readable } from "node:stream";
2
2
  import { WebSocket, fetch, getGlobalDispatcher, pipeline, request, stream } from "undici";
3
3
  import { CookieAgent, CookieAgent as CookieAgent$1, cookie } from "@exhumer/undici-cookie-agent";
4
4
  import { CookieJar, CookieJar as CookieJar$1 } from "tough-cookie";
5
- import { decode, encode } from "@msgpack/msgpack";
5
+ import { Encoder, decode } from "@msgpack/msgpack";
6
6
  import * as net from "node:net";
7
7
  import * as tls from "node:tls";
8
8
  import * as crypto from "node:crypto";
@@ -107,7 +107,7 @@ var BaseUndiciClient = class {
107
107
  this.defaultHeaders = options.headers ?? {};
108
108
  this.defaultTimeout = options.timeout ?? 3e4;
109
109
  this.dispatcher = options.dispatcher ?? getGlobalDispatcher();
110
- this.maximumResponseBodySize = options.maximumResponseBodySize ?? 32 * 1024 * 1024;
110
+ this.maximumResponseBodySize = options.maximumResponseBodySize ?? 33554432;
111
111
  }
112
112
  get(url, options) {
113
113
  return this.request("GET", url, options);
@@ -167,9 +167,10 @@ var RequestHttpClient = class extends BaseUndiciClient {
167
167
  */
168
168
  async stream(method, url, options = {}) {
169
169
  const { buf, inferredContentType } = prepareBody(options.body);
170
+ const headers = buildHeaders(this.defaultHeaders, options.headers, buf, inferredContentType);
170
171
  const { statusCode, headers: respHeaders, body } = await request(url, {
171
172
  method,
172
- headers: buildHeaders(this.defaultHeaders, options.headers, buf, inferredContentType),
173
+ headers,
173
174
  ...buf !== null && { body: buf },
174
175
  headersTimeout: options.timeout ?? this.defaultTimeout,
175
176
  dispatcher: this.dispatcher
@@ -902,7 +903,8 @@ var WebSocketTransport = class {
902
903
  const token = await this.#accessTokenFactory();
903
904
  if (token) headers["Authorization"] = `Bearer ${token}`;
904
905
  }
905
- const ws = new WebSocket(url.replace(/^http/, "ws"), {
906
+ const wsUrl = url.replace(/^http/, "ws");
907
+ const ws = new WebSocket(wsUrl, {
906
908
  headers,
907
909
  ...this.#dispatcher !== void 0 && { dispatcher: this.#dispatcher }
908
910
  });
@@ -1260,9 +1262,7 @@ var ConsoleLogger = class {
1260
1262
  case LogLevel.Critical:
1261
1263
  console.error(line);
1262
1264
  break;
1263
- default:
1264
- console.log(line);
1265
- break;
1265
+ default: console.log(line);
1266
1266
  }
1267
1267
  }
1268
1268
  };
@@ -1432,7 +1432,7 @@ var HubConnection = class {
1432
1432
  this.#protocol = options.protocol ?? new JsonHubProtocol();
1433
1433
  this.#dispatcher = options.dispatcher;
1434
1434
  this.#ownsDispatcher = options.ownsDispatcher ?? false;
1435
- this.#maximumReceiveMessageSize = options.maximumReceiveMessageSize ?? 32 * 1024 * 1024;
1435
+ this.#maximumReceiveMessageSize = options.maximumReceiveMessageSize ?? 33554432;
1436
1436
  this.#http = options.httpClient ?? new DispatchHttpClient({
1437
1437
  headers: this.#extraHeaders,
1438
1438
  ...options.dispatcher !== void 0 && { dispatcher: options.dispatcher }
@@ -1842,9 +1842,7 @@ var HubConnection = class {
1842
1842
  } else this.#stopWithError(closeErr);
1843
1843
  break;
1844
1844
  }
1845
- default:
1846
- this.#logger.log(LogLevel.Warning, `Unknown message type: ${msg.type}`);
1847
- break;
1845
+ default: this.#logger.log(LogLevel.Warning, `Unknown message type: ${msg.type}`);
1848
1846
  }
1849
1847
  }
1850
1848
  async #invokeClientMethod(msg) {
@@ -2280,16 +2278,27 @@ const ResultKind = Object.freeze({
2280
2278
  Void: 2,
2281
2279
  NonVoid: 3
2282
2280
  });
2283
- /** Write `n` as a base-128 VarInt (little-endian groups of 7 bits). */
2284
- function writeVarInt(n) {
2285
- const bytes = [];
2286
- do {
2287
- let b = n & 127;
2281
+ /** Number of bytes needed to write `n` as a base-128 VarInt. */
2282
+ function varIntLength(n) {
2283
+ let len = 1;
2284
+ while (n >= 128) {
2288
2285
  n >>>= 7;
2289
- if (n > 0) b |= 128;
2290
- bytes.push(b);
2291
- } while (n > 0);
2292
- return new Uint8Array(bytes);
2286
+ len++;
2287
+ }
2288
+ return len;
2289
+ }
2290
+ /**
2291
+ * Write `n` as a base-128 VarInt (little-endian groups of 7 bits) into
2292
+ * `out`, returning the offset just past the last byte written.
2293
+ */
2294
+ function writeVarInt(n, out) {
2295
+ let i = 0;
2296
+ while (n >= 128) {
2297
+ out[i++] = n & 127 | 128;
2298
+ n >>>= 7;
2299
+ }
2300
+ out[i++] = n;
2301
+ return i;
2293
2302
  }
2294
2303
  /** Read a VarInt from `data` starting at `offset`. Returns value + bytes consumed. */
2295
2304
  function readVarInt(data, offset) {
@@ -2312,13 +2321,17 @@ function readVarInt(data, offset) {
2312
2321
  bytesRead
2313
2322
  };
2314
2323
  }
2324
+ /**
2325
+ * One encoder reused for every frame. `encode()` from @msgpack/msgpack builds
2326
+ * a new Encoder (and a fresh 2 KB buffer) per call, which dominates the cost of
2327
+ * encoding small hub messages. Encoding is synchronous, so sharing is safe.
2328
+ */
2329
+ const encoder = new Encoder();
2315
2330
  function pack(arr) {
2316
- const payload = encode(arr);
2317
- const lenPrefix = writeVarInt(payload.length);
2318
- const result = new Uint8Array(lenPrefix.length + payload.length);
2319
- result.set(lenPrefix, 0);
2320
- result.set(payload, lenPrefix.length);
2321
- return result.buffer.slice(0, result.byteLength);
2331
+ const payload = encoder.encodeSharedRef(arr);
2332
+ const frame = new Uint8Array(varIntLength(payload.length) + payload.length);
2333
+ frame.set(payload, writeVarInt(payload.length, frame));
2334
+ return frame.buffer;
2322
2335
  }
2323
2336
  var MsgpackHubProtocol = class {
2324
2337
  name = "messagepack";
@@ -2800,8 +2813,6 @@ var WebSocketClient = class extends EventEmitter {
2800
2813
  this.#state = 3;
2801
2814
  this.#socket?.destroy();
2802
2815
  this.emit("close");
2803
- break;
2804
- default: break;
2805
2816
  }
2806
2817
  }
2807
2818
  #emitData(opcode, payload) {