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AAI;KACjB,CAAC,CAAC;CACN;AAEuB","sources":["webpack://signalR/webpack/universalModuleDefinition","webpack://signalR/webpack/bootstrap","webpack://signalR/webpack/runtime/define property getters","webpack://signalR/webpack/runtime/global","webpack://signalR/webpack/runtime/hasOwnProperty shorthand","webpack://signalR/webpack/runtime/make namespace object","webpack://signalR/src/Errors.ts","webpack://signalR/src/HttpClient.ts","webpack://signalR/src/ILogger.ts","webpack://signalR/src/Loggers.ts","webpack://signalR/src/Utils.ts","webpack://signalR/src/FetchHttpClient.ts","webpack://signalR/src/XhrHttpClient.ts","webpack://signalR/src/DefaultHttpClient.ts","webpack://signalR/src/TextMessageFormat.ts","webpack://signalR/src/HandshakeProtocol.ts","webpack://signalR/src/IHubProtocol.ts","webpack://signalR/src/Subject.ts","webpack://signalR/src/HubConnection.ts","webpack://signalR/src/DefaultReconnectPolicy.ts","webpack://signalR/src/HeaderNames.ts","webpack://signalR/src/AccessTokenHttpClient.ts","webpack://signalR/src/ITransport.ts","webpack://signalR/src/AbortController.ts","webpack://signalR/src/LongPollingTransport.ts","webpack://signalR/src/ServerSentEventsTransport.ts","webpack://signalR/src/WebSocketTransport.ts","webpack://signalR/src/HttpConnection.ts","webpack://signalR/src/JsonHubProtocol.ts","webpack://signalR/src/HubConnectionBuilder.ts","webpack://signalR/src/index.ts","webpack://signalR/src/browser-index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\tif(typeof exports === 'object' && typeof module === 'object')\t\tmodule.exports = factory();\telse if(typeof define === 'function' && define.amd)\t\tdefine([], factory);\telse if(typeof exports === 'object')\t\texports[\"signalR\"] = factory();\telse\t\troot[\"signalR\"] = factory();})(self, () => {return ","// The require scopevar __webpack_require__ = {};","// define getter functions for harmony exports__webpack_require__.d = (exports, definition) => {\tfor(var key in definition) {\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\t\t}\t}};","__webpack_require__.g = (function() {\tif (typeof globalThis === 'object') return globalThis;\ttry {\t\treturn this || new Function('return this')();\t} catch (e) {\t\tif (typeof window === 'object') return window;\t}})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports__webpack_require__.r = (exports) => {\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\t}\tObject.defineProperty(exports, '__esModule', { value: true });};","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { HttpTransportType } from \"./ITransport\";\r\r/** Error thrown when an HTTP request fails. */\rexport class HttpError extends Error {\r // @ts-ignore: Intentionally unused.\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private __proto__: Error;\r\r /** The HTTP status code represented by this error. */\r public statusCode: number;\r\r /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.\r *\r * @param {string} errorMessage A descriptive error message.\r * @param {number} statusCode The HTTP status code represented by this error.\r */\r constructor(errorMessage: string, statusCode: number) {\r const trueProto = new.target.prototype;\r super(`${errorMessage}: Status code '${statusCode}'`);\r this.statusCode = statusCode;\r\r // Workaround issue in Typescript compiler\r // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r this.__proto__ = trueProto;\r }\r}\r\r/** Error thrown when a timeout elapses. */\rexport class TimeoutError extends Error {\r // @ts-ignore: Intentionally unused.\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private __proto__: Error;\r\r /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.\r *\r * @param {string} errorMessage A descriptive error message.\r */\r constructor(errorMessage: string = \"A timeout occurred.\") {\r const trueProto = new.target.prototype;\r super(errorMessage);\r\r // Workaround issue in Typescript compiler\r // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r this.__proto__ = trueProto;\r }\r}\r\r/** Error thrown when an action is aborted. */\rexport class AbortError extends Error {\r // @ts-ignore: Intentionally unused.\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private __proto__: Error;\r\r /** Constructs a new instance of {@link AbortError}.\r *\r * @param {string} errorMessage A descriptive error message.\r */\r constructor(errorMessage: string = \"An abort occurred.\") {\r const trueProto = new.target.prototype;\r super(errorMessage);\r\r // Workaround issue in Typescript compiler\r // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r this.__proto__ = trueProto;\r }\r}\r\r/** Error thrown when the selected transport is unsupported by the browser. */\r/** @private */\rexport class UnsupportedTransportError extends Error {\r // @ts-ignore: Intentionally unused.\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private __proto__: Error;\r\r /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r public transport: HttpTransportType;\r\r /** The type name of this error. */\r public errorType: string;\r\r /** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}.\r *\r * @param {string} message A descriptive error message.\r * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r */\r constructor(message: string, transport: HttpTransportType) {\r const trueProto = new.target.prototype;\r super(message);\r this.transport = transport;\r this.errorType = 'UnsupportedTransportError';\r\r // Workaround issue in Typescript compiler\r // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r this.__proto__ = trueProto;\r }\r}\r\r/** Error thrown when the selected transport is disabled by the browser. */\r/** @private */\rexport class DisabledTransportError extends Error {\r // @ts-ignore: Intentionally unused.\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private __proto__: Error;\r\r /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r public transport: HttpTransportType;\r\r /** The type name of this error. */\r public errorType: string;\r\r /** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}.\r *\r * @param {string} message A descriptive error message.\r * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r */\r constructor(message: string, transport: HttpTransportType) {\r const trueProto = new.target.prototype;\r super(message);\r this.transport = transport;\r this.errorType = 'DisabledTransportError';\r\r // Workaround issue in Typescript compiler\r // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r this.__proto__ = trueProto;\r }\r}\r\r/** Error thrown when the selected transport cannot be started. */\r/** @private */\rexport class FailedToStartTransportError extends Error {\r // @ts-ignore: Intentionally unused.\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private __proto__: Error;\r\r /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r public transport: HttpTransportType;\r\r /** The type name of this error. */\r public errorType: string;\r\r /** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}.\r *\r * @param {string} message A descriptive error message.\r * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r */\r constructor(message: string, transport: HttpTransportType) {\r const trueProto = new.target.prototype;\r super(message);\r this.transport = transport;\r this.errorType = 'FailedToStartTransportError';\r\r // Workaround issue in Typescript compiler\r // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r this.__proto__ = trueProto;\r }\r}\r\r/** Error thrown when the negotiation with the server failed to complete. */\r/** @private */\rexport class FailedToNegotiateWithServerError extends Error {\r // @ts-ignore: Intentionally unused.\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private __proto__: Error;\r\r /** The type name of this error. */\r public errorType: string;\r\r /** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}.\r *\r * @param {string} message A descriptive error message.\r */\r constructor(message: string) {\r const trueProto = new.target.prototype;\r super(message);\r this.errorType = 'FailedToNegotiateWithServerError';\r\r // Workaround issue in Typescript compiler\r // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r this.__proto__ = trueProto;\r }\r}\r\r/** Error thrown when multiple errors have occurred. */\r/** @private */\rexport class AggregateErrors extends Error {\r // @ts-ignore: Intentionally unused.\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private __proto__: Error;\r\r /** The collection of errors this error is aggregating. */\r public innerErrors: Error[];\r\r /** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}.\r *\r * @param {string} message A descriptive error message.\r * @param {Error[]} innerErrors The collection of errors this error is aggregating.\r */\r constructor(message: string, innerErrors: Error[]) {\r const trueProto = new.target.prototype;\r super(message);\r\r this.innerErrors = innerErrors;\r\r // Workaround issue in Typescript compiler\r // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r this.__proto__ = trueProto;\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { AbortSignal } from \"./AbortController\";\rimport { MessageHeaders } from \"./IHubProtocol\";\r\r/** Represents an HTTP request. */\rexport interface HttpRequest {\r /** The HTTP method to use for the request. */\r method?: string;\r\r /** The URL for the request. */\r url?: string;\r\r /** The body content for the request. May be a string or an ArrayBuffer (for binary data). */\r content?: string | ArrayBuffer;\r\r /** An object describing headers to apply to the request. */\r headers?: MessageHeaders;\r\r /** The XMLHttpRequestResponseType to apply to the request. */\r responseType?: XMLHttpRequestResponseType;\r\r /** An AbortSignal that can be monitored for cancellation. */\r abortSignal?: AbortSignal;\r\r /** The time to wait for the request to complete before throwing a TimeoutError. Measured in milliseconds. */\r timeout?: number;\r\r /** This controls whether credentials such as cookies are sent in cross-site requests. */\r withCredentials?: boolean;\r}\r\r/** Represents an HTTP response. */\rexport class HttpResponse {\r /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code.\r *\r * @param {number} statusCode The status code of the response.\r */\r constructor(statusCode: number);\r\r /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code and message.\r *\r * @param {number} statusCode The status code of the response.\r * @param {string} statusText The status message of the response.\r */\r constructor(statusCode: number, statusText: string);\r\r /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and string content.\r *\r * @param {number} statusCode The status code of the response.\r * @param {string} statusText The status message of the response.\r * @param {string} content The content of the response.\r */\r constructor(statusCode: number, statusText: string, content: string);\r\r /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and binary content.\r *\r * @param {number} statusCode The status code of the response.\r * @param {string} statusText The status message of the response.\r * @param {ArrayBuffer} content The content of the response.\r */\r constructor(statusCode: number, statusText: string, content: ArrayBuffer);\r\r /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and binary content.\r *\r * @param {number} statusCode The status code of the response.\r * @param {string} statusText The status message of the response.\r * @param {string | ArrayBuffer} content The content of the response.\r */\r constructor(statusCode: number, statusText: string, content: string | ArrayBuffer);\r constructor(\r public readonly statusCode: number,\r public readonly statusText?: string,\r public readonly content?: string | ArrayBuffer) {\r }\r}\r\r/** Abstraction over an HTTP client.\r *\r * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.\r */\rexport abstract class HttpClient {\r /** Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r *\r * @param {string} url The URL for the request.\r * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r */\r public get(url: string): Promise;\r\r /** Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r *\r * @param {string} url The URL for the request.\r * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r */\r public get(url: string, options: HttpRequest): Promise;\r public get(url: string, options?: HttpRequest): Promise {\r return this.send({\r ...options,\r method: \"GET\",\r url,\r });\r }\r\r /** Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r *\r * @param {string} url The URL for the request.\r * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r */\r public post(url: string): Promise;\r\r /** Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r *\r * @param {string} url The URL for the request.\r * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r */\r public post(url: string, options: HttpRequest): Promise;\r public post(url: string, options?: HttpRequest): Promise {\r return this.send({\r ...options,\r method: \"POST\",\r url,\r });\r }\r\r /** Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r *\r * @param {string} url The URL for the request.\r * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r */\r public delete(url: string): Promise;\r\r /** Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r *\r * @param {string} url The URL for the request.\r * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r */\r public delete(url: string, options: HttpRequest): Promise;\r public delete(url: string, options?: HttpRequest): Promise {\r return this.send({\r ...options,\r method: \"DELETE\",\r url,\r });\r }\r\r /** Issues an HTTP request to the specified URL, returning a {@link Promise} that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r *\r * @param {HttpRequest} request An {@link @microsoft/signalr.HttpRequest} describing the request to send.\r * @returns {Promise} A Promise that resolves with an HttpResponse describing the response, or rejects with an Error indicating a failure.\r */\r public abstract send(request: HttpRequest): Promise;\r\r /** Gets all cookies that apply to the specified URL.\r *\r * @param url The URL that the cookies are valid for.\r * @returns {string} A string containing all the key-value cookie pairs for the specified URL.\r */\r // @ts-ignore\r public getCookieString(url: string): string {\r return \"\";\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\r// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.\r/** Indicates the severity of a log message.\r *\r * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.\r */\rexport enum LogLevel {\r /** Log level for very low severity diagnostic messages. */\r Trace = 0,\r /** Log level for low severity diagnostic messages. */\r Debug = 1,\r /** Log level for informational diagnostic messages. */\r Information = 2,\r /** Log level for diagnostic messages that indicate a non-fatal problem. */\r Warning = 3,\r /** Log level for diagnostic messages that indicate a failure in the current operation. */\r Error = 4,\r /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */\r Critical = 5,\r /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */\r None = 6,\r}\r\r/** An abstraction that provides a sink for diagnostic messages. */\rexport interface ILogger {\r /** Called by the framework to emit a diagnostic message.\r *\r * @param {LogLevel} logLevel The severity level of the message.\r * @param {string} message The message.\r */\r log(logLevel: LogLevel, message: string): void;\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { ILogger, LogLevel } from \"./ILogger\";\r\r/** A logger that does nothing when log messages are sent to it. */\rexport class NullLogger implements ILogger {\r /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */\r public static instance: ILogger = new NullLogger();\r\r private constructor() {}\r\r /** @inheritDoc */\r // eslint-disable-next-line\r public log(_logLevel: LogLevel, _message: string): void {\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { HttpClient } from \"./HttpClient\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { NullLogger } from \"./Loggers\";\rimport { IStreamSubscriber, ISubscription } from \"./Stream\";\rimport { Subject } from \"./Subject\";\rimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\r// Version token that will be replaced by the prepack command\r/** The version of the SignalR client. */\r\rexport const VERSION: string = \"0.0.0-DEV_BUILD\";\r/** @private */\rexport class Arg {\r public static isRequired(val: any, name: string): void {\r if (val === null || val === undefined) {\r throw new Error(`The '${name}' argument is required.`);\r }\r }\r public static isNotEmpty(val: string, name: string): void {\r if (!val || val.match(/^\\s*$/)) {\r throw new Error(`The '${name}' argument should not be empty.`);\r }\r }\r\r public static isIn(val: any, values: any, name: string): void {\r // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.\r if (!(val in values)) {\r throw new Error(`Unknown ${name} value: ${val}.`);\r }\r }\r}\r\r/** @private */\rexport class Platform {\r // react-native has a window but no document so we should check both\r public static get isBrowser(): boolean {\r return typeof window === \"object\" && typeof window.document === \"object\";\r }\r\r // WebWorkers don't have a window object so the isBrowser check would fail\r public static get isWebWorker(): boolean {\r return typeof self === \"object\" && \"importScripts\" in self;\r }\r\r // react-native has a window but no document\r static get isReactNative(): boolean {\r return typeof window === \"object\" && typeof window.document === \"undefined\";\r }\r\r // Node apps shouldn't have a window object, but WebWorkers don't either\r // so we need to check for both WebWorker and window\r public static get isNode(): boolean {\r return !this.isBrowser && !this.isWebWorker && !this.isReactNative;\r }\r}\r\r/** @private */\rexport function getDataDetail(data: any, includeContent: boolean): string {\r let detail = \"\";\r if (isArrayBuffer(data)) {\r detail = `Binary data of length ${data.byteLength}`;\r if (includeContent) {\r detail += `. Content: '${formatArrayBuffer(data)}'`;\r }\r } else if (typeof data === \"string\") {\r detail = `String data of length ${data.length}`;\r if (includeContent) {\r detail += `. Content: '${data}'`;\r }\r }\r return detail;\r}\r\r/** @private */\rexport function formatArrayBuffer(data: ArrayBuffer): string {\r const view = new Uint8Array(data);\r\r // Uint8Array.map only supports returning another Uint8Array?\r let str = \"\";\r view.forEach((num) => {\r const pad = num < 16 ? \"0\" : \"\";\r str += `0x${pad}${num.toString(16)} `;\r });\r\r // Trim of trailing space.\r return str.substr(0, str.length - 1);\r}\r\r// Also in signalr-protocol-msgpack/Utils.ts\r/** @private */\rexport function isArrayBuffer(val: any): val is ArrayBuffer {\r return val && typeof ArrayBuffer !== \"undefined\" &&\r (val instanceof ArrayBuffer ||\r // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof\r (val.constructor && val.constructor.name === \"ArrayBuffer\"));\r}\r\r/** @private */\rexport async function sendMessage(logger: ILogger, transportName: string, httpClient: HttpClient, url: string,\r content: string | ArrayBuffer, options: IHttpConnectionOptions): Promise {\r const headers: {[k: string]: string} = {};\r\r const [name, value] = getUserAgentHeader();\r headers[name] = value;\r\r logger.log(LogLevel.Trace, `(${transportName} transport) sending data. ${getDataDetail(content, options.logMessageContent!)}.`);\r\r const responseType = isArrayBuffer(content) ? \"arraybuffer\" : \"text\";\r const response = await httpClient.post(url, {\r content,\r headers: { ...headers, ...options.headers},\r responseType,\r timeout: options.timeout,\r withCredentials: options.withCredentials,\r });\r\r logger.log(LogLevel.Trace, `(${transportName} transport) request complete. Response status: ${response.statusCode}.`);\r}\r\r/** @private */\rexport function createLogger(logger?: ILogger | LogLevel): ILogger {\r if (logger === undefined) {\r return new ConsoleLogger(LogLevel.Information);\r }\r\r if (logger === null) {\r return NullLogger.instance;\r }\r\r if ((logger as ILogger).log !== undefined) {\r return logger as ILogger;\r }\r\r return new ConsoleLogger(logger as LogLevel);\r}\r\r/** @private */\rexport class SubjectSubscription implements ISubscription {\r private _subject: Subject;\r private _observer: IStreamSubscriber;\r\r constructor(subject: Subject, observer: IStreamSubscriber) {\r this._subject = subject;\r this._observer = observer;\r }\r\r public dispose(): void {\r const index: number = this._subject.observers.indexOf(this._observer);\r if (index > -1) {\r this._subject.observers.splice(index, 1);\r }\r\r if (this._subject.observers.length === 0 && this._subject.cancelCallback) {\r this._subject.cancelCallback().catch((_) => { });\r }\r }\r}\r\r/** @private */\rexport class ConsoleLogger implements ILogger {\r private readonly _minLevel: LogLevel;\r\r // Public for testing purposes.\r public out: {\r error(message: any): void,\r warn(message: any): void,\r info(message: any): void,\r log(message: any): void,\r };\r\r constructor(minimumLogLevel: LogLevel) {\r this._minLevel = minimumLogLevel;\r this.out = console;\r }\r\r public log(logLevel: LogLevel, message: string): void {\r if (logLevel >= this._minLevel) {\r const msg = `[${new Date().toISOString()}] ${LogLevel[logLevel]}: ${message}`;\r switch (logLevel) {\r case LogLevel.Critical:\r case LogLevel.Error:\r this.out.error(msg);\r break;\r case LogLevel.Warning:\r this.out.warn(msg);\r break;\r case LogLevel.Information:\r this.out.info(msg);\r break;\r default:\r // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug\r this.out.log(msg);\r break;\r }\r }\r }\r}\r\r/** @private */\rexport function getUserAgentHeader(): [string, string] {\r let userAgentHeaderName = \"X-SignalR-User-Agent\";\r if (Platform.isNode) {\r userAgentHeaderName = \"User-Agent\";\r }\r return [ userAgentHeaderName, constructUserAgent(VERSION, getOsName(), getRuntime(), getRuntimeVersion()) ];\r}\r\r/** @private */\rexport function constructUserAgent(version: string, os: string, runtime: string, runtimeVersion: string | undefined): string {\r // Microsoft SignalR/[Version] ([Detailed Version]; [Operating System]; [Runtime]; [Runtime Version])\r let userAgent: string = \"Microsoft SignalR/\";\r\r const majorAndMinor = version.split(\".\");\r userAgent += `${majorAndMinor[0]}.${majorAndMinor[1]}`;\r userAgent += ` (${version}; `;\r\r if (os && os !== \"\") {\r userAgent += `${os}; `;\r } else {\r userAgent += \"Unknown OS; \";\r }\r\r userAgent += `${runtime}`;\r\r if (runtimeVersion) {\r userAgent += `; ${runtimeVersion}`;\r } else {\r userAgent += \"; Unknown Runtime Version\";\r }\r\r userAgent += \")\";\r return userAgent;\r}\r\r// eslint-disable-next-line spaced-comment\r/*#__PURE__*/ function getOsName(): string {\r if (Platform.isNode) {\r switch (process.platform) {\r case \"win32\":\r return \"Windows NT\";\r case \"darwin\":\r return \"macOS\";\r case \"linux\":\r return \"Linux\";\r default:\r return process.platform;\r }\r } else {\r return \"\";\r }\r}\r\r// eslint-disable-next-line spaced-comment\r/*#__PURE__*/ function getRuntimeVersion(): string | undefined {\r if (Platform.isNode) {\r return process.versions.node;\r }\r return undefined;\r}\r\rfunction getRuntime(): string {\r if (Platform.isNode) {\r return \"NodeJS\";\r } else {\r return \"Browser\";\r }\r}\r\r/** @private */\rexport function getErrorString(e: any): string {\r if (e.stack) {\r return e.stack;\r } else if (e.message) {\r return e.message;\r }\r return `${e}`;\r}\r\r/** @private */\rexport function getGlobalThis(): unknown {\r // globalThis is semi-new and not available in Node until v12\r if (typeof globalThis !== \"undefined\") {\r return globalThis;\r }\r if (typeof self !== \"undefined\") {\r return self;\r }\r if (typeof window !== \"undefined\") {\r return window;\r }\r if (typeof global !== \"undefined\") {\r return global;\r }\r throw new Error(\"could not find global\");\r}","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\r// @ts-ignore: This will be removed from built files and is here to make the types available during dev work\rimport { CookieJar } from \"@types/tough-cookie\";\r\rimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\rimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { Platform, getGlobalThis, isArrayBuffer } from \"./Utils\";\r\rexport class FetchHttpClient extends HttpClient {\r private readonly _abortControllerType: { prototype: AbortController, new(): AbortController };\r private readonly _fetchType: (input: RequestInfo, init?: RequestInit) => Promise;\r private readonly _jar?: CookieJar;\r\r private readonly _logger: ILogger;\r\r public constructor(logger: ILogger) {\r super();\r this._logger = logger;\r\r if (typeof fetch === \"undefined\") {\r // In order to ignore the dynamic require in webpack builds we need to do this magic\r // @ts-ignore: TS doesn't know about these names\r const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\r // Cookies aren't automatically handled in Node so we need to add a CookieJar to preserve cookies across requests\r this._jar = new (requireFunc(\"tough-cookie\")).CookieJar();\r this._fetchType = requireFunc(\"node-fetch\");\r\r // node-fetch doesn't have a nice API for getting and setting cookies\r // fetch-cookie will wrap a fetch implementation with a default CookieJar or a provided one\r this._fetchType = requireFunc(\"fetch-cookie\")(this._fetchType, this._jar);\r } else {\r this._fetchType = fetch.bind(getGlobalThis());\r }\r if (typeof AbortController === \"undefined\") {\r // In order to ignore the dynamic require in webpack builds we need to do this magic\r // @ts-ignore: TS doesn't know about these names\r const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\r // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide\r this._abortControllerType = requireFunc(\"abort-controller\");\r } else {\r this._abortControllerType = AbortController;\r }\r }\r\r /** @inheritDoc */\r public async send(request: HttpRequest): Promise {\r // Check that abort was not signaled before calling send\r if (request.abortSignal && request.abortSignal.aborted) {\r throw new AbortError();\r }\r\r if (!request.method) {\r throw new Error(\"No method defined.\");\r }\r if (!request.url) {\r throw new Error(\"No url defined.\");\r }\r\r const abortController = new this._abortControllerType();\r\r let error: any;\r // Hook our abortSignal into the abort controller\r if (request.abortSignal) {\r request.abortSignal.onabort = () => {\r abortController.abort();\r error = new AbortError();\r };\r }\r\r // If a timeout has been passed in, setup a timeout to call abort\r // Type needs to be any to fit window.setTimeout and NodeJS.setTimeout\r let timeoutId: any = null;\r if (request.timeout) {\r const msTimeout = request.timeout!;\r timeoutId = setTimeout(() => {\r abortController.abort();\r this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r error = new TimeoutError();\r }, msTimeout);\r }\r\r if (request.content === \"\") {\r request.content = undefined;\r }\r if (request.content) {\r // Explicitly setting the Content-Type header for React Native on Android platform.\r request.headers = request.headers || {};\r if (isArrayBuffer(request.content)) {\r request.headers[\"Content-Type\"] = \"application/octet-stream\";\r } else {\r request.headers[\"Content-Type\"] = \"text/plain;charset=UTF-8\";\r }\r }\r\r let response: Response;\r try {\r response = await this._fetchType(request.url!, {\r body: request.content,\r cache: \"no-cache\",\r credentials: request.withCredentials === true ? \"include\" : \"same-origin\",\r headers: {\r \"X-Requested-With\": \"XMLHttpRequest\",\r ...request.headers,\r },\r method: request.method!,\r mode: \"cors\",\r redirect: \"follow\",\r signal: abortController.signal,\r });\r } catch (e) {\r if (error) {\r throw error;\r }\r this._logger.log(\r LogLevel.Warning,\r `Error from HTTP request. ${e}.`,\r );\r throw e;\r } finally {\r if (timeoutId) {\r clearTimeout(timeoutId);\r }\r if (request.abortSignal) {\r request.abortSignal.onabort = null;\r }\r }\r\r if (!response.ok) {\r const errorMessage = await deserializeContent(response, \"text\") as string;\r throw new HttpError(errorMessage || response.statusText, response.status);\r }\r\r const content = deserializeContent(response, request.responseType);\r const payload = await content;\r\r return new HttpResponse(\r response.status,\r response.statusText,\r payload,\r );\r }\r\r public getCookieString(url: string): string {\r let cookies: string = \"\";\r if (Platform.isNode && this._jar) {\r // @ts-ignore: unused variable\r this._jar.getCookies(url, (e, c) => cookies = c.join(\"; \"));\r }\r return cookies;\r }\r}\r\rfunction deserializeContent(response: Response, responseType?: XMLHttpRequestResponseType): Promise {\r let content;\r switch (responseType) {\r case \"arraybuffer\":\r content = response.arrayBuffer();\r break;\r case \"text\":\r content = response.text();\r break;\r case \"blob\":\r case \"document\":\r case \"json\":\r throw new Error(`${responseType} is not supported.`);\r default:\r content = response.text();\r break;\r }\r\r return content;\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\rimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { isArrayBuffer } from \"./Utils\";\r\rexport class XhrHttpClient extends HttpClient {\r private readonly _logger: ILogger;\r\r public constructor(logger: ILogger) {\r super();\r this._logger = logger;\r }\r\r /** @inheritDoc */\r public send(request: HttpRequest): Promise {\r // Check that abort was not signaled before calling send\r if (request.abortSignal && request.abortSignal.aborted) {\r return Promise.reject(new AbortError());\r }\r\r if (!request.method) {\r return Promise.reject(new Error(\"No method defined.\"));\r }\r if (!request.url) {\r return Promise.reject(new Error(\"No url defined.\"));\r }\r\r return new Promise((resolve, reject) => {\r const xhr = new XMLHttpRequest();\r\r xhr.open(request.method!, request.url!, true);\r xhr.withCredentials = request.withCredentials === undefined ? true : request.withCredentials;\r xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r if (request.content === \"\") {\r request.content = undefined;\r }\r if (request.content) {\r // Explicitly setting the Content-Type header for React Native on Android platform.\r if (isArrayBuffer(request.content)) {\r xhr.setRequestHeader(\"Content-Type\", \"application/octet-stream\");\r } else {\r xhr.setRequestHeader(\"Content-Type\", \"text/plain;charset=UTF-8\");\r }\r }\r\r const headers = request.headers;\r if (headers) {\r Object.keys(headers)\r .forEach((header) => {\r xhr.setRequestHeader(header, headers[header]);\r });\r }\r\r if (request.responseType) {\r xhr.responseType = request.responseType;\r }\r\r if (request.abortSignal) {\r request.abortSignal.onabort = () => {\r xhr.abort();\r reject(new AbortError());\r };\r }\r\r if (request.timeout) {\r xhr.timeout = request.timeout;\r }\r\r xhr.onload = () => {\r if (request.abortSignal) {\r request.abortSignal.onabort = null;\r }\r\r if (xhr.status >= 200 && xhr.status < 300) {\r resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));\r } else {\r reject(new HttpError(xhr.response || xhr.responseText || xhr.statusText, xhr.status));\r }\r };\r\r xhr.onerror = () => {\r this._logger.log(LogLevel.Warning, `Error from HTTP request. ${xhr.status}: ${xhr.statusText}.`);\r reject(new HttpError(xhr.statusText, xhr.status));\r };\r\r xhr.ontimeout = () => {\r this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r reject(new TimeoutError());\r };\r\r xhr.send(request.content);\r });\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { AbortError } from \"./Errors\";\rimport { FetchHttpClient } from \"./FetchHttpClient\";\rimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\rimport { ILogger } from \"./ILogger\";\rimport { Platform } from \"./Utils\";\rimport { XhrHttpClient } from \"./XhrHttpClient\";\r\r/** Default implementation of {@link @microsoft/signalr.HttpClient}. */\rexport class DefaultHttpClient extends HttpClient {\r private readonly _httpClient: HttpClient;\r\r /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */\r public constructor(logger: ILogger) {\r super();\r\r if (typeof fetch !== \"undefined\" || Platform.isNode) {\r this._httpClient = new FetchHttpClient(logger);\r } else if (typeof XMLHttpRequest !== \"undefined\") {\r this._httpClient = new XhrHttpClient(logger);\r } else {\r throw new Error(\"No usable HttpClient found.\");\r }\r }\r\r /** @inheritDoc */\r public send(request: HttpRequest): Promise {\r // Check that abort was not signaled before calling send\r if (request.abortSignal && request.abortSignal.aborted) {\r return Promise.reject(new AbortError());\r }\r\r if (!request.method) {\r return Promise.reject(new Error(\"No method defined.\"));\r }\r if (!request.url) {\r return Promise.reject(new Error(\"No url defined.\"));\r }\r\r return this._httpClient.send(request);\r }\r\r public getCookieString(url: string): string {\r return this._httpClient.getCookieString(url);\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\r// Not exported from index\r/** @private */\rexport class TextMessageFormat {\r public static RecordSeparatorCode = 0x1e;\r public static RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\r public static write(output: string): string {\r return `${output}${TextMessageFormat.RecordSeparator}`;\r }\r\r public static parse(input: string): string[] {\r if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r throw new Error(\"Message is incomplete.\");\r }\r\r const messages = input.split(TextMessageFormat.RecordSeparator);\r messages.pop();\r return messages;\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { TextMessageFormat } from \"./TextMessageFormat\";\rimport { isArrayBuffer } from \"./Utils\";\r\r/** @private */\rexport interface HandshakeRequestMessage {\r readonly protocol: string;\r readonly version: number;\r}\r\r/** @private */\rexport interface HandshakeResponseMessage {\r readonly error: string;\r readonly minorVersion: number;\r}\r\r/** @private */\rexport class HandshakeProtocol {\r // Handshake request is always JSON\r public writeHandshakeRequest(handshakeRequest: HandshakeRequestMessage): string {\r return TextMessageFormat.write(JSON.stringify(handshakeRequest));\r }\r\r public parseHandshakeResponse(data: any): [any, HandshakeResponseMessage] {\r let messageData: string;\r let remainingData: any;\r\r if (isArrayBuffer(data)) {\r // Format is binary but still need to read JSON text from handshake response\r const binaryData = new Uint8Array(data);\r const separatorIndex = binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);\r if (separatorIndex === -1) {\r throw new Error(\"Message is incomplete.\");\r }\r\r // content before separator is handshake response\r // optional content after is additional messages\r const responseLength = separatorIndex + 1;\r messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));\r remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;\r } else {\r const textData: string = data;\r const separatorIndex = textData.indexOf(TextMessageFormat.RecordSeparator);\r if (separatorIndex === -1) {\r throw new Error(\"Message is incomplete.\");\r }\r\r // content before separator is handshake response\r // optional content after is additional messages\r const responseLength = separatorIndex + 1;\r messageData = textData.substring(0, responseLength);\r remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null;\r }\r\r // At this point we should have just the single handshake message\r const messages = TextMessageFormat.parse(messageData);\r const response = JSON.parse(messages[0]);\r if (response.type) {\r throw new Error(\"Expected a handshake response from the server.\");\r }\r const responseMessage: HandshakeResponseMessage = response;\r\r // multiple messages could have arrived with handshake\r // return additional data to be parsed as usual, or null if all parsed\r return [remainingData, responseMessage];\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { ILogger } from \"./ILogger\";\rimport { TransferFormat } from \"./ITransport\";\r\r/** Defines the type of a Hub Message. */\rexport enum MessageType {\r /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */\r Invocation = 1,\r /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */\r StreamItem = 2,\r /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */\r Completion = 3,\r /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */\r StreamInvocation = 4,\r /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */\r CancelInvocation = 5,\r /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */\r Ping = 6,\r /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */\r Close = 7,\r}\r\r/** Defines a dictionary of string keys and string values representing headers attached to a Hub message. */\rexport interface MessageHeaders {\r /** Gets or sets the header with the specified key. */\r [key: string]: string;\r}\r\r/** Union type of all known Hub messages. */\rexport type HubMessage =\r InvocationMessage |\r StreamInvocationMessage |\r StreamItemMessage |\r CompletionMessage |\r CancelInvocationMessage |\r PingMessage |\r CloseMessage;\r\r/** Defines properties common to all Hub messages. */\rexport interface HubMessageBase {\r /** A {@link @microsoft/signalr.MessageType} value indicating the type of this message. */\r readonly type: MessageType;\r}\r\r/** Defines properties common to all Hub messages relating to a specific invocation. */\rexport interface HubInvocationMessage extends HubMessageBase {\r /** A {@link @microsoft/signalr.MessageHeaders} dictionary containing headers attached to the message. */\r readonly headers?: MessageHeaders;\r /** The ID of the invocation relating to this message.\r *\r * This is expected to be present for {@link @microsoft/signalr.StreamInvocationMessage} and {@link @microsoft/signalr.CompletionMessage}. It may\r * be 'undefined' for an {@link @microsoft/signalr.InvocationMessage} if the sender does not expect a response.\r */\r readonly invocationId?: string;\r}\r\r/** A hub message representing a non-streaming invocation. */\rexport interface InvocationMessage extends HubInvocationMessage {\r /** @inheritDoc */\r readonly type: MessageType.Invocation;\r /** The target method name. */\r readonly target: string;\r /** The target method arguments. */\r readonly arguments: any[];\r /** The target methods stream IDs. */\r readonly streamIds?: string[];\r}\r\r/** A hub message representing a streaming invocation. */\rexport interface StreamInvocationMessage extends HubInvocationMessage {\r /** @inheritDoc */\r readonly type: MessageType.StreamInvocation;\r\r /** The invocation ID. */\r readonly invocationId: string;\r /** The target method name. */\r readonly target: string;\r /** The target method arguments. */\r readonly arguments: any[];\r /** The target methods stream IDs. */\r readonly streamIds?: string[];\r}\r\r/** A hub message representing a single item produced as part of a result stream. */\rexport interface StreamItemMessage extends HubInvocationMessage {\r /** @inheritDoc */\r readonly type: MessageType.StreamItem;\r\r /** The invocation ID. */\r readonly invocationId: string;\r\r /** The item produced by the server. */\r readonly item?: any;\r}\r\r/** A hub message representing the result of an invocation. */\rexport interface CompletionMessage extends HubInvocationMessage {\r /** @inheritDoc */\r readonly type: MessageType.Completion;\r /** The invocation ID. */\r readonly invocationId: string;\r /** The error produced by the invocation, if any.\r *\r * Either {@link @microsoft/signalr.CompletionMessage.error} or {@link @microsoft/signalr.CompletionMessage.result} must be defined, but not both.\r */\r readonly error?: string;\r /** The result produced by the invocation, if any.\r *\r * Either {@link @microsoft/signalr.CompletionMessage.error} or {@link @microsoft/signalr.CompletionMessage.result} must be defined, but not both.\r */\r readonly result?: any;\r}\r\r/** A hub message indicating that the sender is still active. */\rexport interface PingMessage extends HubMessageBase {\r /** @inheritDoc */\r readonly type: MessageType.Ping;\r}\r\r/** A hub message indicating that the sender is closing the connection.\r *\r * If {@link @microsoft/signalr.CloseMessage.error} is defined, the sender is closing the connection due to an error.\r */\rexport interface CloseMessage extends HubMessageBase {\r /** @inheritDoc */\r readonly type: MessageType.Close;\r /** The error that triggered the close, if any.\r *\r * If this property is undefined, the connection was closed normally and without error.\r */\r readonly error?: string;\r\r /** If true, clients with automatic reconnects enabled should attempt to reconnect after receiving the CloseMessage. Otherwise, they should not. */\r readonly allowReconnect?: boolean;\r}\r\r/** A hub message sent to request that a streaming invocation be canceled. */\rexport interface CancelInvocationMessage extends HubInvocationMessage {\r /** @inheritDoc */\r readonly type: MessageType.CancelInvocation;\r /** The invocation ID. */\r readonly invocationId: string;\r}\r\r/** A protocol abstraction for communicating with SignalR Hubs. */\rexport interface IHubProtocol {\r /** The name of the protocol. This is used by SignalR to resolve the protocol between the client and server. */\r readonly name: string;\r /** The version of the protocol. */\r readonly version: number;\r /** The {@link @microsoft/signalr.TransferFormat} of the protocol. */\r readonly transferFormat: TransferFormat;\r\r /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r *\r * If {@link @microsoft/signalr.IHubProtocol.transferFormat} is 'Text', the `input` parameter must be a string, otherwise it must be an ArrayBuffer.\r *\r * @param {string | ArrayBuffer} input A string or ArrayBuffer containing the serialized representation.\r * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r */\r parseMessages(input: string | ArrayBuffer, logger: ILogger): HubMessage[];\r\r /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string or ArrayBuffer and returns it.\r *\r * If {@link @microsoft/signalr.IHubProtocol.transferFormat} is 'Text', the result of this method will be a string, otherwise it will be an ArrayBuffer.\r *\r * @param {HubMessage} message The message to write.\r * @returns {string | ArrayBuffer} A string or ArrayBuffer containing the serialized representation of the message.\r */\r writeMessage(message: HubMessage): string | ArrayBuffer;\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { IStreamResult, IStreamSubscriber, ISubscription } from \"./Stream\";\rimport { SubjectSubscription } from \"./Utils\";\r\r/** Stream implementation to stream items to the server. */\rexport class Subject implements IStreamResult {\r /** @internal */\r public observers: IStreamSubscriber[];\r\r /** @internal */\r public cancelCallback?: () => Promise;\r\r constructor() {\r this.observers = [];\r }\r\r public next(item: T): void {\r for (const observer of this.observers) {\r observer.next(item);\r }\r }\r\r public error(err: any): void {\r for (const observer of this.observers) {\r if (observer.error) {\r observer.error(err);\r }\r }\r }\r\r public complete(): void {\r for (const observer of this.observers) {\r if (observer.complete) {\r observer.complete();\r }\r }\r }\r\r public subscribe(observer: IStreamSubscriber): ISubscription {\r this.observers.push(observer);\r return new SubjectSubscription(this, observer);\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { HandshakeProtocol, HandshakeRequestMessage, HandshakeResponseMessage } from \"./HandshakeProtocol\";\rimport { IConnection } from \"./IConnection\";\rimport { AbortError } from \"./Errors\";\rimport { CancelInvocationMessage, CompletionMessage, IHubProtocol, InvocationMessage, MessageType, StreamInvocationMessage, StreamItemMessage } from \"./IHubProtocol\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { IRetryPolicy } from \"./IRetryPolicy\";\rimport { IStreamResult } from \"./Stream\";\rimport { Subject } from \"./Subject\";\rimport { Arg, getErrorString, Platform } from \"./Utils\";\r\rconst DEFAULT_TIMEOUT_IN_MS: number = 30 * 1000;\rconst DEFAULT_PING_INTERVAL_IN_MS: number = 15 * 1000;\r\r/** Describes the current state of the {@link HubConnection} to the server. */\rexport enum HubConnectionState {\r /** The hub connection is disconnected. */\r Disconnected = \"Disconnected\",\r /** The hub connection is connecting. */\r Connecting = \"Connecting\",\r /** The hub connection is connected. */\r Connected = \"Connected\",\r /** The hub connection is disconnecting. */\r Disconnecting = \"Disconnecting\",\r /** The hub connection is reconnecting. */\r Reconnecting = \"Reconnecting\",\r}\r\r/** Represents a connection to a SignalR Hub. */\rexport class HubConnection {\r private readonly _cachedPingMessage: string | ArrayBuffer;\r // Needs to not start with _ for tests\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private readonly connection: IConnection;\r private readonly _logger: ILogger;\r private readonly _reconnectPolicy?: IRetryPolicy;\r private _protocol: IHubProtocol;\r private _handshakeProtocol: HandshakeProtocol;\r private _callbacks: { [invocationId: string]: (invocationEvent: StreamItemMessage | CompletionMessage | null, error?: Error) => void };\r private _methods: { [name: string]: (((...args: any[]) => void) | ((...args: any[]) => any))[] };\r private _invocationId: number;\r\r private _closedCallbacks: ((error?: Error) => void)[];\r private _reconnectingCallbacks: ((error?: Error) => void)[];\r private _reconnectedCallbacks: ((connectionId?: string) => void)[];\r\r private _receivedHandshakeResponse: boolean;\r private _handshakeResolver!: (value?: PromiseLike<{}>) => void;\r private _handshakeRejecter!: (reason?: any) => void;\r private _stopDuringStartError?: Error;\r\r private _connectionState: HubConnectionState;\r // connectionStarted is tracked independently from connectionState, so we can check if the\r // connection ever did successfully transition from connecting to connected before disconnecting.\r private _connectionStarted: boolean;\r private _startPromise?: Promise;\r private _stopPromise?: Promise;\r private _nextKeepAlive: number = 0;\r\r // The type of these a) doesn't matter and b) varies when building in browser and node contexts\r // Since we're building the WebPack bundle directly from the TypeScript, this matters (previously\r // we built the bundle from the compiled JavaScript).\r private _reconnectDelayHandle?: any;\r private _timeoutHandle?: any;\r private _pingServerHandle?: any;\r\r private _freezeEventListener = () =>\r {\r this._logger.log(LogLevel.Warning, \"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep\");\r };\r\r /** The server timeout in milliseconds.\r *\r * If this timeout elapses without receiving any messages from the server, the connection will be terminated with an error.\r * The default timeout value is 30,000 milliseconds (30 seconds).\r */\r public serverTimeoutInMilliseconds: number;\r\r /** Default interval at which to ping the server.\r *\r * The default value is 15,000 milliseconds (15 seconds).\r * Allows the server to detect hard disconnects (like when a client unplugs their computer).\r * The ping will happen at most as often as the server pings.\r * If the server pings every 5 seconds, a value lower than 5 will ping every 5 seconds.\r */\r public keepAliveIntervalInMilliseconds: number;\r\r /** @internal */\r // Using a public static factory method means we can have a private constructor and an _internal_\r // create method that can be used by HubConnectionBuilder. An \"internal\" constructor would just\r // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a\r // public parameter-less constructor.\r public static create(connection: IConnection, logger: ILogger, protocol: IHubProtocol, reconnectPolicy?: IRetryPolicy): HubConnection {\r return new HubConnection(connection, logger, protocol, reconnectPolicy);\r }\r\r private constructor(connection: IConnection, logger: ILogger, protocol: IHubProtocol, reconnectPolicy?: IRetryPolicy) {\r Arg.isRequired(connection, \"connection\");\r Arg.isRequired(logger, \"logger\");\r Arg.isRequired(protocol, \"protocol\");\r\r this.serverTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MS;\r this.keepAliveIntervalInMilliseconds = DEFAULT_PING_INTERVAL_IN_MS;\r\r this._logger = logger;\r this._protocol = protocol;\r this.connection = connection;\r this._reconnectPolicy = reconnectPolicy;\r this._handshakeProtocol = new HandshakeProtocol();\r\r this.connection.onreceive = (data: any) => this._processIncomingData(data);\r this.connection.onclose = (error?: Error) => this._connectionClosed(error);\r\r this._callbacks = {};\r this._methods = {};\r this._closedCallbacks = [];\r this._reconnectingCallbacks = [];\r this._reconnectedCallbacks = [];\r this._invocationId = 0;\r this._receivedHandshakeResponse = false;\r this._connectionState = HubConnectionState.Disconnected;\r this._connectionStarted = false;\r\r this._cachedPingMessage = this._protocol.writeMessage({ type: MessageType.Ping });\r }\r\r /** Indicates the state of the {@link HubConnection} to the server. */\r get state(): HubConnectionState {\r return this._connectionState;\r }\r\r /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either\r * in the disconnected state or if the negotiation step was skipped.\r */\r get connectionId(): string | null {\r return this.connection ? (this.connection.connectionId || null) : null;\r }\r\r /** Indicates the url of the {@link HubConnection} to the server. */\r get baseUrl(): string {\r return this.connection.baseUrl || \"\";\r }\r\r /**\r * Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or\r * Reconnecting states.\r * @param {string} url The url to connect to.\r */\r set baseUrl(url: string) {\r if (this._connectionState !== HubConnectionState.Disconnected && this._connectionState !== HubConnectionState.Reconnecting) {\r throw new Error(\"The HubConnection must be in the Disconnected or Reconnecting state to change the url.\");\r }\r\r if (!url) {\r throw new Error(\"The HubConnection url must be a valid url.\");\r }\r\r this.connection.baseUrl = url;\r }\r\r /** Starts the connection.\r *\r * @returns {Promise} A Promise that resolves when the connection has been successfully established, or rejects with an error.\r */\r public start(): Promise {\r this._startPromise = this._startWithStateTransitions();\r return this._startPromise;\r }\r\r private async _startWithStateTransitions(): Promise {\r if (this._connectionState !== HubConnectionState.Disconnected) {\r return Promise.reject(new Error(\"Cannot start a HubConnection that is not in the 'Disconnected' state.\"));\r }\r\r this._connectionState = HubConnectionState.Connecting;\r this._logger.log(LogLevel.Debug, \"Starting HubConnection.\");\r\r try {\r await this._startInternal();\r\r if (Platform.isBrowser) {\r // Log when the browser freezes the tab so users know why their connection unexpectedly stopped working\r window.document.addEventListener(\"freeze\", this._freezeEventListener);\r }\r\r this._connectionState = HubConnectionState.Connected;\r this._connectionStarted = true;\r this._logger.log(LogLevel.Debug, \"HubConnection connected successfully.\");\r } catch (e) {\r this._connectionState = HubConnectionState.Disconnected;\r this._logger.log(LogLevel.Debug, `HubConnection failed to start successfully because of error '${e}'.`);\r return Promise.reject(e);\r }\r }\r\r private async _startInternal() {\r this._stopDuringStartError = undefined;\r this._receivedHandshakeResponse = false;\r // Set up the promise before any connection is (re)started otherwise it could race with received messages\r const handshakePromise = new Promise((resolve, reject) => {\r this._handshakeResolver = resolve;\r this._handshakeRejecter = reject;\r });\r\r await this.connection.start(this._protocol.transferFormat);\r\r try {\r const handshakeRequest: HandshakeRequestMessage = {\r protocol: this._protocol.name,\r version: this._protocol.version,\r };\r\r this._logger.log(LogLevel.Debug, \"Sending handshake request.\");\r\r await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(handshakeRequest));\r\r this._logger.log(LogLevel.Information, `Using HubProtocol '${this._protocol.name}'.`);\r\r // defensively cleanup timeout in case we receive a message from the server before we finish start\r this._cleanupTimeout();\r this._resetTimeoutPeriod();\r this._resetKeepAliveInterval();\r\r await handshakePromise;\r\r // It's important to check the stopDuringStartError instead of just relying on the handshakePromise\r // being rejected on close, because this continuation can run after both the handshake completed successfully\r // and the connection was closed.\r if (this._stopDuringStartError) {\r // It's important to throw instead of returning a rejected promise, because we don't want to allow any state\r // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise\r // will cause the calling continuation to get scheduled to run later.\r // eslint-disable-next-line @typescript-eslint/no-throw-literal\r throw this._stopDuringStartError;\r }\r\r if (!this.connection.features.inherentKeepAlive) {\r await this._sendMessage(this._cachedPingMessage);\r }\r } catch (e) {\r this._logger.log(LogLevel.Debug, `Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`);\r\r this._cleanupTimeout();\r this._cleanupPingTimer();\r\r // HttpConnection.stop() should not complete until after the onclose callback is invoked.\r // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes.\r await this.connection.stop(e);\r throw e;\r }\r }\r\r /** Stops the connection.\r *\r * @returns {Promise} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.\r */\r public async stop(): Promise {\r // Capture the start promise before the connection might be restarted in an onclose callback.\r const startPromise = this._startPromise;\r\r this._stopPromise = this._stopInternal();\r await this._stopPromise;\r\r try {\r // Awaiting undefined continues immediately\r await startPromise;\r } catch (e) {\r // This exception is returned to the user as a rejected Promise from the start method.\r }\r }\r\r private _stopInternal(error?: Error): Promise {\r if (this._connectionState === HubConnectionState.Disconnected) {\r this._logger.log(LogLevel.Debug, `Call to HubConnection.stop(${error}) ignored because it is already in the disconnected state.`);\r return Promise.resolve();\r }\r\r if (this._connectionState === HubConnectionState.Disconnecting) {\r this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r return this._stopPromise!;\r }\r\r this._connectionState = HubConnectionState.Disconnecting;\r\r this._logger.log(LogLevel.Debug, \"Stopping HubConnection.\");\r\r if (this._reconnectDelayHandle) {\r // We're in a reconnect delay which means the underlying connection is currently already stopped.\r // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and\r // fire the onclose callbacks.\r this._logger.log(LogLevel.Debug, \"Connection stopped during reconnect delay. Done reconnecting.\");\r\r clearTimeout(this._reconnectDelayHandle);\r this._reconnectDelayHandle = undefined;\r\r this._completeClose();\r return Promise.resolve();\r }\r\r this._cleanupTimeout();\r this._cleanupPingTimer();\r this._stopDuringStartError = error || new AbortError(\"The connection was stopped before the hub handshake could complete.\");\r\r // HttpConnection.stop() should not complete until after either HttpConnection.start() fails\r // or the onclose callback is invoked. The onclose callback will transition the HubConnection\r // to the disconnected state if need be before HttpConnection.stop() completes.\r return this.connection.stop(error);\r }\r\r /** Invokes a streaming hub method on the server using the specified name and arguments.\r *\r * @typeparam T The type of the items returned by the server.\r * @param {string} methodName The name of the server method to invoke.\r * @param {any[]} args The arguments used to invoke the server method.\r * @returns {IStreamResult} An object that yields results from the server as they are received.\r */\r public stream(methodName: string, ...args: any[]): IStreamResult {\r const [streams, streamIds] = this._replaceStreamingParams(args);\r const invocationDescriptor = this._createStreamInvocation(methodName, args, streamIds);\r\r // eslint-disable-next-line prefer-const\r let promiseQueue: Promise;\r\r const subject = new Subject();\r subject.cancelCallback = () => {\r const cancelInvocation: CancelInvocationMessage = this._createCancelInvocation(invocationDescriptor.invocationId);\r\r delete this._callbacks[invocationDescriptor.invocationId];\r\r return promiseQueue.then(() => {\r return this._sendWithProtocol(cancelInvocation);\r });\r };\r\r this._callbacks[invocationDescriptor.invocationId] = (invocationEvent: CompletionMessage | StreamItemMessage | null, error?: Error) => {\r if (error) {\r subject.error(error);\r return;\r } else if (invocationEvent) {\r // invocationEvent will not be null when an error is not passed to the callback\r if (invocationEvent.type === MessageType.Completion) {\r if (invocationEvent.error) {\r subject.error(new Error(invocationEvent.error));\r } else {\r subject.complete();\r }\r } else {\r subject.next((invocationEvent.item) as T);\r }\r }\r };\r\r promiseQueue = this._sendWithProtocol(invocationDescriptor)\r .catch((e) => {\r subject.error(e);\r delete this._callbacks[invocationDescriptor.invocationId];\r });\r\r this._launchStreams(streams, promiseQueue);\r\r return subject;\r }\r\r private _sendMessage(message: any) {\r this._resetKeepAliveInterval();\r return this.connection.send(message);\r }\r\r /**\r * Sends a js object to the server.\r * @param message The js object to serialize and send.\r */\r private _sendWithProtocol(message: any) {\r return this._sendMessage(this._protocol.writeMessage(message));\r }\r\r /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.\r *\r * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still\r * be processing the invocation.\r *\r * @param {string} methodName The name of the server method to invoke.\r * @param {any[]} args The arguments used to invoke the server method.\r * @returns {Promise} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.\r */\r public send(methodName: string, ...args: any[]): Promise {\r const [streams, streamIds] = this._replaceStreamingParams(args);\r const sendPromise = this._sendWithProtocol(this._createInvocation(methodName, args, true, streamIds));\r\r this._launchStreams(streams, sendPromise);\r\r return sendPromise;\r }\r\r /** Invokes a hub method on the server using the specified name and arguments.\r *\r * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise\r * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of\r * resolving the Promise.\r *\r * @typeparam T The expected return type.\r * @param {string} methodName The name of the server method to invoke.\r * @param {any[]} args The arguments used to invoke the server method.\r * @returns {Promise} A Promise that resolves with the result of the server method (if any), or rejects with an error.\r */\r public invoke(methodName: string, ...args: any[]): Promise {\r const [streams, streamIds] = this._replaceStreamingParams(args);\r const invocationDescriptor = this._createInvocation(methodName, args, false, streamIds);\r\r const p = new Promise((resolve, reject) => {\r // invocationId will always have a value for a non-blocking invocation\r this._callbacks[invocationDescriptor.invocationId!] = (invocationEvent: StreamItemMessage | CompletionMessage | null, error?: Error) => {\r if (error) {\r reject(error);\r return;\r } else if (invocationEvent) {\r // invocationEvent will not be null when an error is not passed to the callback\r if (invocationEvent.type === MessageType.Completion) {\r if (invocationEvent.error) {\r reject(new Error(invocationEvent.error));\r } else {\r resolve(invocationEvent.result);\r }\r } else {\r reject(new Error(`Unexpected message type: ${invocationEvent.type}`));\r }\r }\r };\r\r const promiseQueue = this._sendWithProtocol(invocationDescriptor)\r .catch((e) => {\r reject(e);\r // invocationId will always have a value for a non-blocking invocation\r delete this._callbacks[invocationDescriptor.invocationId!];\r });\r\r this._launchStreams(streams, promiseQueue);\r });\r\r return p;\r }\r\r /** Registers a handler that will be invoked when the hub method with the specified method name is invoked.\r *\r * @param {string} methodName The name of the hub method to define.\r * @param {Function} newMethod The handler that will be raised when the hub method is invoked.\r */\r public on(methodName: string, newMethod: (...args: any[]) => any): void\r public on(methodName: string, newMethod: (...args: any[]) => void): void {\r if (!methodName || !newMethod) {\r return;\r }\r\r methodName = methodName.toLowerCase();\r if (!this._methods[methodName]) {\r this._methods[methodName] = [];\r }\r\r // Preventing adding the same handler multiple times.\r if (this._methods[methodName].indexOf(newMethod) !== -1) {\r return;\r }\r\r this._methods[methodName].push(newMethod);\r }\r\r /** Removes all handlers for the specified hub method.\r *\r * @param {string} methodName The name of the method to remove handlers for.\r */\r public off(methodName: string): void;\r\r /** Removes the specified handler for the specified hub method.\r *\r * You must pass the exact same Function instance as was previously passed to {@link @microsoft/signalr.HubConnection.on}. Passing a different instance (even if the function\r * body is the same) will not remove the handler.\r *\r * @param {string} methodName The name of the method to remove handlers for.\r * @param {Function} method The handler to remove. This must be the same Function instance as the one passed to {@link @microsoft/signalr.HubConnection.on}.\r */\r public off(methodName: string, method: (...args: any[]) => void): void;\r public off(methodName: string, method?: (...args: any[]) => void): void {\r if (!methodName) {\r return;\r }\r\r methodName = methodName.toLowerCase();\r const handlers = this._methods[methodName];\r if (!handlers) {\r return;\r }\r if (method) {\r const removeIdx = handlers.indexOf(method);\r if (removeIdx !== -1) {\r handlers.splice(removeIdx, 1);\r if (handlers.length === 0) {\r delete this._methods[methodName];\r }\r }\r } else {\r delete this._methods[methodName];\r }\r\r }\r\r /** Registers a handler that will be invoked when the connection is closed.\r *\r * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).\r */\r public onclose(callback: (error?: Error) => void): void {\r if (callback) {\r this._closedCallbacks.push(callback);\r }\r }\r\r /** Registers a handler that will be invoked when the connection starts reconnecting.\r *\r * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any).\r */\r public onreconnecting(callback: (error?: Error) => void): void {\r if (callback) {\r this._reconnectingCallbacks.push(callback);\r }\r }\r\r /** Registers a handler that will be invoked when the connection successfully reconnects.\r *\r * @param {Function} callback The handler that will be invoked when the connection successfully reconnects.\r */\r public onreconnected(callback: (connectionId?: string) => void): void {\r if (callback) {\r this._reconnectedCallbacks.push(callback);\r }\r }\r\r private _processIncomingData(data: any) {\r this._cleanupTimeout();\r\r if (!this._receivedHandshakeResponse) {\r data = this._processHandshakeResponse(data);\r this._receivedHandshakeResponse = true;\r }\r\r // Data may have all been read when processing handshake response\r if (data) {\r // Parse the messages\r const messages = this._protocol.parseMessages(data, this._logger);\r\r for (const message of messages) {\r switch (message.type) {\r case MessageType.Invocation:\r // eslint-disable-next-line @typescript-eslint/no-floating-promises\r this._invokeClientMethod(message);\r break;\r case MessageType.StreamItem:\r case MessageType.Completion: {\r const callback = this._callbacks[message.invocationId];\r if (callback) {\r if (message.type === MessageType.Completion) {\r delete this._callbacks[message.invocationId];\r }\r try {\r callback(message);\r } catch (e) {\r this._logger.log(LogLevel.Error, `Stream callback threw error: ${getErrorString(e)}`);\r }\r }\r break;\r }\r case MessageType.Ping:\r // Don't care about pings\r break;\r case MessageType.Close: {\r this._logger.log(LogLevel.Information, \"Close message received from server.\");\r\r const error = message.error ? new Error(\"Server returned an error on close: \" + message.error) : undefined;\r\r if (message.allowReconnect === true) {\r // It feels wrong not to await connection.stop() here, but processIncomingData is called as part of an onreceive callback which is not async,\r // this is already the behavior for serverTimeout(), and HttpConnection.Stop() should catch and log all possible exceptions.\r\r // eslint-disable-next-line @typescript-eslint/no-floating-promises\r this.connection.stop(error);\r } else {\r // We cannot await stopInternal() here, but subsequent calls to stop() will await this if stopInternal() is still ongoing.\r this._stopPromise = this._stopInternal(error);\r }\r\r break;\r }\r default:\r this._logger.log(LogLevel.Warning, `Invalid message type: ${message.type}.`);\r break;\r }\r }\r }\r\r this._resetTimeoutPeriod();\r }\r\r private _processHandshakeResponse(data: any): any {\r let responseMessage: HandshakeResponseMessage;\r let remainingData: any;\r\r try {\r [remainingData, responseMessage] = this._handshakeProtocol.parseHandshakeResponse(data);\r } catch (e) {\r const message = \"Error parsing handshake response: \" + e;\r this._logger.log(LogLevel.Error, message);\r\r const error = new Error(message);\r this._handshakeRejecter(error);\r throw error;\r }\r if (responseMessage.error) {\r const message = \"Server returned handshake error: \" + responseMessage.error;\r this._logger.log(LogLevel.Error, message);\r\r const error = new Error(message);\r this._handshakeRejecter(error);\r throw error;\r } else {\r this._logger.log(LogLevel.Debug, \"Server handshake complete.\");\r }\r\r this._handshakeResolver();\r return remainingData;\r }\r\r private _resetKeepAliveInterval() {\r if (this.connection.features.inherentKeepAlive) {\r return;\r }\r\r // Set the time we want the next keep alive to be sent\r // Timer will be setup on next message receive\r this._nextKeepAlive = new Date().getTime() + this.keepAliveIntervalInMilliseconds;\r\r this._cleanupPingTimer();\r }\r\r private _resetTimeoutPeriod() {\r if (!this.connection.features || !this.connection.features.inherentKeepAlive) {\r // Set the timeout timer\r this._timeoutHandle = setTimeout(() => this.serverTimeout(), this.serverTimeoutInMilliseconds);\r\r // Set keepAlive timer if there isn't one\r if (this._pingServerHandle === undefined)\r {\r let nextPing = this._nextKeepAlive - new Date().getTime();\r if (nextPing < 0) {\r nextPing = 0;\r }\r\r // The timer needs to be set from a networking callback to avoid Chrome timer throttling from causing timers to run once a minute\r this._pingServerHandle = setTimeout(async () => {\r if (this._connectionState === HubConnectionState.Connected) {\r try {\r await this._sendMessage(this._cachedPingMessage);\r } catch {\r // We don't care about the error. It should be seen elsewhere in the client.\r // The connection is probably in a bad or closed state now, cleanup the timer so it stops triggering\r this._cleanupPingTimer();\r }\r }\r }, nextPing);\r }\r }\r }\r\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private serverTimeout() {\r // The server hasn't talked to us in a while. It doesn't like us anymore ... :(\r // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting.\r // eslint-disable-next-line @typescript-eslint/no-floating-promises\r this.connection.stop(new Error(\"Server timeout elapsed without receiving a message from the server.\"));\r }\r\r private async _invokeClientMethod(invocationMessage: InvocationMessage) {\r const methodName = invocationMessage.target.toLowerCase();\r const methods = this._methods[methodName];\r if (!methods) {\r this._logger.log(LogLevel.Warning, `No client method with the name '${methodName}' found.`);\r\r // No handlers provided by client but the server is expecting a response still, so we send an error\r if (invocationMessage.invocationId) {\r this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r await this._sendWithProtocol(this._createCompletionMessage(invocationMessage.invocationId, \"Client didn't provide a result.\", null));\r }\r return;\r }\r\r // Avoid issues with handlers removing themselves thus modifying the list while iterating through it\r const methodsCopy = methods.slice();\r\r // Server expects a response\r const expectsResponse = invocationMessage.invocationId ? true : false;\r // We preserve the last result or exception but still call all handlers\r let res;\r let exception;\r let completionMessage;\r for (const m of methodsCopy) {\r try {\r const prevRes = res;\r res = await m.apply(this, invocationMessage.arguments);\r if (expectsResponse && res && prevRes) {\r this._logger.log(LogLevel.Error, `Multiple results provided for '${methodName}'. Sending error to server.`);\r completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, `Client provided multiple results.`, null);\r }\r // Ignore exception if we got a result after, the exception will be logged\r exception = undefined;\r } catch (e) {\r exception = e;\r this._logger.log(LogLevel.Error, `A callback for the method '${methodName}' threw error '${e}'.`);\r }\r }\r if (completionMessage) {\r await this._sendWithProtocol(completionMessage);\r } else if (expectsResponse) {\r // If there is an exception that means either no result was given or a handler after a result threw\r if (exception) {\r completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, `${exception}`, null);\r } else if (res !== undefined) {\r completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, null, res);\r } else {\r this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r // Client didn't provide a result or throw from a handler, server expects a response so we send an error\r completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, \"Client didn't provide a result.\", null);\r }\r await this._sendWithProtocol(completionMessage);\r } else {\r if (res) {\r this._logger.log(LogLevel.Error, `Result given for '${methodName}' method but server is not expecting a result.`);\r }\r }\r }\r\r private _connectionClosed(error?: Error) {\r this._logger.log(LogLevel.Debug, `HubConnection.connectionClosed(${error}) called while in state ${this._connectionState}.`);\r\r // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet.\r this._stopDuringStartError = this._stopDuringStartError || error || new AbortError(\"The underlying connection was closed before the hub handshake could complete.\");\r\r // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it.\r // If it has already completed, this should just noop.\r if (this._handshakeResolver) {\r this._handshakeResolver();\r }\r\r this._cancelCallbacksWithError(error || new Error(\"Invocation canceled due to the underlying connection being closed.\"));\r\r this._cleanupTimeout();\r this._cleanupPingTimer();\r\r if (this._connectionState === HubConnectionState.Disconnecting) {\r this._completeClose(error);\r } else if (this._connectionState === HubConnectionState.Connected && this._reconnectPolicy) {\r // eslint-disable-next-line @typescript-eslint/no-floating-promises\r this._reconnect(error);\r } else if (this._connectionState === HubConnectionState.Connected) {\r this._completeClose(error);\r }\r\r // If none of the above if conditions were true were called the HubConnection must be in either:\r // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it.\r // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt\r // and potentially continue the reconnect() loop.\r // 3. The Disconnected state in which case we're already done.\r }\r\r private _completeClose(error?: Error) {\r if (this._connectionStarted) {\r this._connectionState = HubConnectionState.Disconnected;\r this._connectionStarted = false;\r\r if (Platform.isBrowser) {\r window.document.removeEventListener(\"freeze\", this._freezeEventListener);\r }\r\r try {\r this._closedCallbacks.forEach((c) => c.apply(this, [error]));\r } catch (e) {\r this._logger.log(LogLevel.Error, `An onclose callback called with error '${error}' threw error '${e}'.`);\r }\r }\r }\r\r private async _reconnect(error?: Error) {\r const reconnectStartTime = Date.now();\r let previousReconnectAttempts = 0;\r let retryError = error !== undefined ? error : new Error(\"Attempting to reconnect due to a unknown error.\");\r\r let nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, 0, retryError);\r\r if (nextRetryDelay === null) {\r this._logger.log(LogLevel.Debug, \"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.\");\r this._completeClose(error);\r return;\r }\r\r this._connectionState = HubConnectionState.Reconnecting;\r\r if (error) {\r this._logger.log(LogLevel.Information, `Connection reconnecting because of error '${error}'.`);\r } else {\r this._logger.log(LogLevel.Information, \"Connection reconnecting.\");\r }\r\r if (this._reconnectingCallbacks.length !== 0) {\r try {\r this._reconnectingCallbacks.forEach((c) => c.apply(this, [error]));\r } catch (e) {\r this._logger.log(LogLevel.Error, `An onreconnecting callback called with error '${error}' threw error '${e}'.`);\r }\r\r // Exit early if an onreconnecting callback called connection.stop().\r if (this._connectionState !== HubConnectionState.Reconnecting) {\r this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.\");\r return;\r }\r }\r\r while (nextRetryDelay !== null) {\r this._logger.log(LogLevel.Information, `Reconnect attempt number ${previousReconnectAttempts} will start in ${nextRetryDelay} ms.`);\r\r await new Promise((resolve) => {\r this._reconnectDelayHandle = setTimeout(resolve, nextRetryDelay!);\r });\r this._reconnectDelayHandle = undefined;\r\r if (this._connectionState !== HubConnectionState.Reconnecting) {\r this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state during reconnect delay. Done reconnecting.\");\r return;\r }\r\r try {\r await this._startInternal();\r\r this._connectionState = HubConnectionState.Connected;\r this._logger.log(LogLevel.Information, \"HubConnection reconnected successfully.\");\r\r if (this._reconnectedCallbacks.length !== 0) {\r try {\r this._reconnectedCallbacks.forEach((c) => c.apply(this, [this.connection.connectionId]));\r } catch (e) {\r this._logger.log(LogLevel.Error, `An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`);\r }\r }\r\r return;\r } catch (e) {\r this._logger.log(LogLevel.Information, `Reconnect attempt failed because of error '${e}'.`);\r\r if (this._connectionState !== HubConnectionState.Reconnecting) {\r this._logger.log(LogLevel.Debug, `Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`);\r // The TypeScript compiler thinks that connectionState must be Connected here. The TypeScript compiler is wrong.\r if (this._connectionState as any === HubConnectionState.Disconnecting) {\r this._completeClose();\r }\r return;\r }\r\r retryError = e instanceof Error ? e : new Error(e.toString());\r nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime, retryError);\r }\r }\r\r this._logger.log(LogLevel.Information, `Reconnect retries have been exhausted after ${Date.now() - reconnectStartTime} ms and ${previousReconnectAttempts} failed attempts. Connection disconnecting.`);\r\r this._completeClose();\r }\r\r private _getNextRetryDelay(previousRetryCount: number, elapsedMilliseconds: number, retryReason: Error) {\r try {\r return this._reconnectPolicy!.nextRetryDelayInMilliseconds({\r elapsedMilliseconds,\r previousRetryCount,\r retryReason,\r });\r } catch (e) {\r this._logger.log(LogLevel.Error, `IRetryPolicy.nextRetryDelayInMilliseconds(${previousRetryCount}, ${elapsedMilliseconds}) threw error '${e}'.`);\r return null;\r }\r }\r\r private _cancelCallbacksWithError(error: Error) {\r const callbacks = this._callbacks;\r this._callbacks = {};\r\r Object.keys(callbacks)\r .forEach((key) => {\r const callback = callbacks[key];\r try {\r callback(null, error);\r } catch (e) {\r this._logger.log(LogLevel.Error, `Stream 'error' callback called with '${error}' threw error: ${getErrorString(e)}`);\r }\r });\r }\r\r private _cleanupPingTimer(): void {\r if (this._pingServerHandle) {\r clearTimeout(this._pingServerHandle);\r this._pingServerHandle = undefined;\r }\r }\r\r private _cleanupTimeout(): void {\r if (this._timeoutHandle) {\r clearTimeout(this._timeoutHandle);\r }\r }\r\r private _createInvocation(methodName: string, args: any[], nonblocking: boolean, streamIds: string[]): InvocationMessage {\r if (nonblocking) {\r if (streamIds.length !== 0) {\r return {\r arguments: args,\r streamIds,\r target: methodName,\r type: MessageType.Invocation,\r };\r } else {\r return {\r arguments: args,\r target: methodName,\r type: MessageType.Invocation,\r };\r }\r } else {\r const invocationId = this._invocationId;\r this._invocationId++;\r\r if (streamIds.length !== 0) {\r return {\r arguments: args,\r invocationId: invocationId.toString(),\r streamIds,\r target: methodName,\r type: MessageType.Invocation,\r };\r } else {\r return {\r arguments: args,\r invocationId: invocationId.toString(),\r target: methodName,\r type: MessageType.Invocation,\r };\r }\r }\r }\r\r private _launchStreams(streams: IStreamResult[], promiseQueue: Promise): void {\r if (streams.length === 0) {\r return;\r }\r\r // Synchronize stream data so they arrive in-order on the server\r if (!promiseQueue) {\r promiseQueue = Promise.resolve();\r }\r\r // We want to iterate over the keys, since the keys are the stream ids\r // eslint-disable-next-line guard-for-in\r for (const streamId in streams) {\r streams[streamId].subscribe({\r complete: () => {\r promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId)));\r },\r error: (err) => {\r let message: string;\r if (err instanceof Error) {\r message = err.message;\r } else if (err && err.toString) {\r message = err.toString();\r } else {\r message = \"Unknown error\";\r }\r\r promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId, message)));\r },\r next: (item) => {\r promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createStreamItemMessage(streamId, item)));\r },\r });\r }\r }\r\r private _replaceStreamingParams(args: any[]): [IStreamResult[], string[]] {\r const streams: IStreamResult[] = [];\r const streamIds: string[] = [];\r for (let i = 0; i < args.length; i++) {\r const argument = args[i];\r if (this._isObservable(argument)) {\r const streamId = this._invocationId;\r this._invocationId++;\r // Store the stream for later use\r streams[streamId] = argument;\r streamIds.push(streamId.toString());\r\r // remove stream from args\r args.splice(i, 1);\r }\r }\r\r return [streams, streamIds];\r }\r\r private _isObservable(arg: any): arg is IStreamResult {\r // This allows other stream implementations to just work (like rxjs)\r return arg && arg.subscribe && typeof arg.subscribe === \"function\";\r }\r\r private _createStreamInvocation(methodName: string, args: any[], streamIds: string[]): StreamInvocationMessage {\r const invocationId = this._invocationId;\r this._invocationId++;\r\r if (streamIds.length !== 0) {\r return {\r arguments: args,\r invocationId: invocationId.toString(),\r streamIds,\r target: methodName,\r type: MessageType.StreamInvocation,\r };\r } else {\r return {\r arguments: args,\r invocationId: invocationId.toString(),\r target: methodName,\r type: MessageType.StreamInvocation,\r };\r }\r }\r\r private _createCancelInvocation(id: string): CancelInvocationMessage {\r return {\r invocationId: id,\r type: MessageType.CancelInvocation,\r };\r }\r\r private _createStreamItemMessage(id: string, item: any): StreamItemMessage {\r return {\r invocationId: id,\r item,\r type: MessageType.StreamItem,\r };\r }\r\r private _createCompletionMessage(id: string, error?: any, result?: any): CompletionMessage {\r if (error) {\r return {\r error,\r invocationId: id,\r type: MessageType.Completion,\r };\r }\r\r return {\r invocationId: id,\r result,\r type: MessageType.Completion,\r };\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { IRetryPolicy, RetryContext } from \"./IRetryPolicy\";\r\r// 0, 2, 10, 30 second delays before reconnect attempts.\rconst DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\r/** @private */\rexport class DefaultReconnectPolicy implements IRetryPolicy {\r private readonly _retryDelays: (number | null)[];\r\r constructor(retryDelays?: number[]) {\r this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r }\r\r public nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null {\r return this._retryDelays[retryContext.previousRetryCount];\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rexport abstract class HeaderNames {\r static readonly Authorization = \"Authorization\";\r static readonly Cookie = \"Cookie\";\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { HeaderNames } from \"./HeaderNames\";\rimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\r/** @private */\rexport class AccessTokenHttpClient extends HttpClient {\r private _innerClient: HttpClient;\r _accessToken: string | undefined;\r _accessTokenFactory: (() => string | Promise) | undefined;\r\r constructor(innerClient: HttpClient, accessTokenFactory: (() => string | Promise) | undefined) {\r super();\r\r this._innerClient = innerClient;\r this._accessTokenFactory = accessTokenFactory;\r }\r\r public async send(request: HttpRequest): Promise {\r let allowRetry = true;\r if (this._accessTokenFactory && (!this._accessToken || (request.url && request.url.indexOf(\"/negotiate?\") > 0))) {\r // don't retry if the request is a negotiate or if we just got a potentially new token from the access token factory\r allowRetry = false;\r this._accessToken = await this._accessTokenFactory();\r }\r this._setAuthorizationHeader(request);\r const response = await this._innerClient.send(request);\r\r if (allowRetry && response.statusCode === 401 && this._accessTokenFactory) {\r this._accessToken = await this._accessTokenFactory();\r this._setAuthorizationHeader(request);\r return await this._innerClient.send(request);\r }\r return response;\r }\r\r private _setAuthorizationHeader(request: HttpRequest) {\r if (!request.headers) {\r request.headers = {};\r }\r if (this._accessToken) {\r request.headers[HeaderNames.Authorization] = `Bearer ${this._accessToken}`\r }\r // don't remove the header if there isn't an access token factory, the user manually added the header in this case\r else if (this._accessTokenFactory) {\r if (request.headers[HeaderNames.Authorization]) {\r delete request.headers[HeaderNames.Authorization];\r }\r }\r }\r\r public getCookieString(url: string): string {\r return this._innerClient.getCookieString(url);\r }\r}","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\r// This will be treated as a bit flag in the future, so we keep it using power-of-two values.\r/** Specifies a specific HTTP transport type. */\rexport enum HttpTransportType {\r /** Specifies no transport preference. */\r None = 0,\r /** Specifies the WebSockets transport. */\r WebSockets = 1,\r /** Specifies the Server-Sent Events transport. */\r ServerSentEvents = 2,\r /** Specifies the Long Polling transport. */\r LongPolling = 4,\r}\r\r/** Specifies the transfer format for a connection. */\rexport enum TransferFormat {\r /** Specifies that only text data will be transmitted over the connection. */\r Text = 1,\r /** Specifies that binary data will be transmitted over the connection. */\r Binary = 2,\r}\r\r/** An abstraction over the behavior of transports. This is designed to support the framework and not intended for use by applications. */\rexport interface ITransport {\r connect(url: string, transferFormat: TransferFormat): Promise;\r send(data: any): Promise;\r stop(): Promise;\r onreceive: ((data: string | ArrayBuffer) => void) | null;\r onclose: ((error?: Error) => void) | null;\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\r// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r// We don't actually ever use the API being polyfilled, we always use the polyfill because\r// it's a very new API right now.\r\r// Not exported from index.\r/** @private */\rexport class AbortController implements AbortSignal {\r private _isAborted: boolean = false;\r public onabort: (() => void) | null = null;\r\r public abort(): void {\r if (!this._isAborted) {\r this._isAborted = true;\r if (this.onabort) {\r this.onabort();\r }\r }\r }\r\r get signal(): AbortSignal {\r return this;\r }\r\r get aborted(): boolean {\r return this._isAborted;\r }\r}\r\r/** Represents a signal that can be monitored to determine if a request has been aborted. */\rexport interface AbortSignal {\r /** Indicates if the request has been aborted. */\r aborted: boolean;\r /** Set this to a handler that will be invoked when the request is aborted. */\r onabort: (() => void) | null;\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { AbortController } from \"./AbortController\";\rimport { HttpError, TimeoutError } from \"./Errors\";\rimport { HttpClient, HttpRequest } from \"./HttpClient\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { ITransport, TransferFormat } from \"./ITransport\";\rimport { Arg, getDataDetail, getUserAgentHeader, sendMessage } from \"./Utils\";\rimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\r// Not exported from 'index', this type is internal.\r/** @private */\rexport class LongPollingTransport implements ITransport {\r private readonly _httpClient: HttpClient;\r private readonly _logger: ILogger;\r private readonly _options: IHttpConnectionOptions;\r private readonly _pollAbort: AbortController;\r\r private _url?: string;\r private _running: boolean;\r private _receiving?: Promise;\r private _closeError?: Error;\r\r public onreceive: ((data: string | ArrayBuffer) => void) | null;\r public onclose: ((error?: Error) => void) | null;\r\r // This is an internal type, not exported from 'index' so this is really just internal.\r public get pollAborted(): boolean {\r return this._pollAbort.aborted;\r }\r\r constructor(httpClient: HttpClient, logger: ILogger, options: IHttpConnectionOptions) {\r this._httpClient = httpClient;\r this._logger = logger;\r this._pollAbort = new AbortController();\r this._options = options;\r\r this._running = false;\r\r this.onreceive = null;\r this.onclose = null;\r }\r\r public async connect(url: string, transferFormat: TransferFormat): Promise {\r Arg.isRequired(url, \"url\");\r Arg.isRequired(transferFormat, \"transferFormat\");\r Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\r this._url = url;\r\r this._logger.log(LogLevel.Trace, \"(LongPolling transport) Connecting.\");\r\r // Allow binary format on Node and Browsers that support binary content (indicated by the presence of responseType property)\r if (transferFormat === TransferFormat.Binary &&\r (typeof XMLHttpRequest !== \"undefined\" && typeof new XMLHttpRequest().responseType !== \"string\")) {\r throw new Error(\"Binary protocols over XmlHttpRequest not implementing advanced features are not supported.\");\r }\r\r const [name, value] = getUserAgentHeader();\r const headers = { [name]: value, ...this._options.headers };\r\r const pollOptions: HttpRequest = {\r abortSignal: this._pollAbort.signal,\r headers,\r timeout: 100000,\r withCredentials: this._options.withCredentials,\r };\r\r if (transferFormat === TransferFormat.Binary) {\r pollOptions.responseType = \"arraybuffer\";\r }\r\r // Make initial long polling request\r // Server uses first long polling request to finish initializing connection and it returns without data\r const pollUrl = `${url}&_=${Date.now()}`;\r this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r const response = await this._httpClient.get(pollUrl, pollOptions);\r if (response.statusCode !== 200) {\r this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\r // Mark running as false so that the poll immediately ends and runs the close logic\r this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r this._running = false;\r } else {\r this._running = true;\r }\r\r this._receiving = this._poll(this._url, pollOptions);\r }\r\r private async _poll(url: string, pollOptions: HttpRequest): Promise {\r try {\r while (this._running) {\r try {\r const pollUrl = `${url}&_=${Date.now()}`;\r this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r const response = await this._httpClient.get(pollUrl, pollOptions);\r\r if (response.statusCode === 204) {\r this._logger.log(LogLevel.Information, \"(LongPolling transport) Poll terminated by server.\");\r\r this._running = false;\r } else if (response.statusCode !== 200) {\r this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\r // Unexpected status code\r this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r this._running = false;\r } else {\r // Process the response\r if (response.content) {\r this._logger.log(LogLevel.Trace, `(LongPolling transport) data received. ${getDataDetail(response.content, this._options.logMessageContent!)}.`);\r if (this.onreceive) {\r this.onreceive(response.content);\r }\r } else {\r // This is another way timeout manifest.\r this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r }\r }\r } catch (e) {\r if (!this._running) {\r // Log but disregard errors that occur after stopping\r this._logger.log(LogLevel.Trace, `(LongPolling transport) Poll errored after shutdown: ${e.message}`);\r } else {\r if (e instanceof TimeoutError) {\r // Ignore timeouts and reissue the poll.\r this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r } else {\r // Close the connection with the error as the result.\r this._closeError = e;\r this._running = false;\r }\r }\r }\r }\r } finally {\r this._logger.log(LogLevel.Trace, \"(LongPolling transport) Polling complete.\");\r\r // We will reach here with pollAborted==false when the server returned a response causing the transport to stop.\r // If pollAborted==true then client initiated the stop and the stop method will raise the close event after DELETE is sent.\r if (!this.pollAborted) {\r this._raiseOnClose();\r }\r }\r }\r\r public async send(data: any): Promise {\r if (!this._running) {\r return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r }\r return sendMessage(this._logger, \"LongPolling\", this._httpClient, this._url!, data, this._options);\r }\r\r public async stop(): Promise {\r this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stopping polling.\");\r\r // Tell receiving loop to stop, abort any current request, and then wait for it to finish\r this._running = false;\r this._pollAbort.abort();\r\r try {\r await this._receiving;\r\r // Send DELETE to clean up long polling on the server\r this._logger.log(LogLevel.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);\r\r const headers: {[k: string]: string} = {};\r const [name, value] = getUserAgentHeader();\r headers[name] = value;\r\r const deleteOptions: HttpRequest = {\r headers: { ...headers, ...this._options.headers },\r timeout: this._options.timeout,\r withCredentials: this._options.withCredentials,\r };\r await this._httpClient.delete(this._url!, deleteOptions);\r\r this._logger.log(LogLevel.Trace, \"(LongPolling transport) DELETE request sent.\");\r } finally {\r this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stop finished.\");\r\r // Raise close event here instead of in polling\r // It needs to happen after the DELETE request is sent\r this._raiseOnClose();\r }\r }\r\r private _raiseOnClose() {\r if (this.onclose) {\r let logMessage = \"(LongPolling transport) Firing onclose event.\";\r if (this._closeError) {\r logMessage += \" Error: \" + this._closeError;\r }\r this._logger.log(LogLevel.Trace, logMessage);\r this.onclose(this._closeError);\r }\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { HttpClient } from \"./HttpClient\";\rimport { MessageHeaders } from \"./IHubProtocol\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { ITransport, TransferFormat } from \"./ITransport\";\rimport { Arg, getDataDetail, getUserAgentHeader, Platform, sendMessage } from \"./Utils\";\rimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\r/** @private */\rexport class ServerSentEventsTransport implements ITransport {\r private readonly _httpClient: HttpClient;\r private readonly _accessToken: string | undefined;\r private readonly _logger: ILogger;\r private readonly _options: IHttpConnectionOptions;\r private _eventSource?: EventSource;\r private _url?: string;\r\r public onreceive: ((data: string | ArrayBuffer) => void) | null;\r public onclose: ((error?: Error) => void) | null;\r\r constructor(httpClient: HttpClient, accessToken: string | undefined, logger: ILogger,\r options: IHttpConnectionOptions) {\r this._httpClient = httpClient;\r this._accessToken = accessToken;\r this._logger = logger;\r this._options = options;\r\r this.onreceive = null;\r this.onclose = null;\r }\r\r public async connect(url: string, transferFormat: TransferFormat): Promise {\r Arg.isRequired(url, \"url\");\r Arg.isRequired(transferFormat, \"transferFormat\");\r Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\r this._logger.log(LogLevel.Trace, \"(SSE transport) Connecting.\");\r\r // set url before accessTokenFactory because this._url is only for send and we set the auth header instead of the query string for send\r this._url = url;\r\r if (this._accessToken) {\r url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(this._accessToken)}`;\r }\r\r return new Promise((resolve, reject) => {\r let opened = false;\r if (transferFormat !== TransferFormat.Text) {\r reject(new Error(\"The Server-Sent Events transport only supports the 'Text' transfer format\"));\r return;\r }\r\r let eventSource: EventSource;\r if (Platform.isBrowser || Platform.isWebWorker) {\r eventSource = new this._options.EventSource!(url, { withCredentials: this._options.withCredentials });\r } else {\r // Non-browser passes cookies via the dictionary\r const cookies = this._httpClient.getCookieString(url);\r const headers: MessageHeaders = {};\r headers.Cookie = cookies;\r const [name, value] = getUserAgentHeader();\r headers[name] = value;\r\r eventSource = new this._options.EventSource!(url, { withCredentials: this._options.withCredentials, headers: { ...headers, ...this._options.headers} } as EventSourceInit);\r }\r\r try {\r eventSource.onmessage = (e: MessageEvent) => {\r if (this.onreceive) {\r try {\r this._logger.log(LogLevel.Trace, `(SSE transport) data received. ${getDataDetail(e.data, this._options.logMessageContent!)}.`);\r this.onreceive(e.data);\r } catch (error) {\r this._close(error);\r return;\r }\r }\r };\r\r // @ts-ignore: not using event on purpose\r eventSource.onerror = (e: Event) => {\r // EventSource doesn't give any useful information about server side closes.\r if (opened) {\r this._close();\r } else {\r reject(new Error(\"EventSource failed to connect. The connection could not be found on the server,\"\r + \" either the connection ID is not present on the server, or a proxy is refusing/buffering the connection.\"\r + \" If you have multiple servers check that sticky sessions are enabled.\"));\r }\r };\r\r eventSource.onopen = () => {\r this._logger.log(LogLevel.Information, `SSE connected to ${this._url}`);\r this._eventSource = eventSource;\r opened = true;\r resolve();\r };\r } catch (e) {\r reject(e);\r return;\r }\r });\r }\r\r public async send(data: any): Promise {\r if (!this._eventSource) {\r return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r }\r return sendMessage(this._logger, \"SSE\", this._httpClient, this._url!, data, this._options);\r }\r\r public stop(): Promise {\r this._close();\r return Promise.resolve();\r }\r\r private _close(e?: Error) {\r if (this._eventSource) {\r this._eventSource.close();\r this._eventSource = undefined;\r\r if (this.onclose) {\r this.onclose(e);\r }\r }\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { HeaderNames } from \"./HeaderNames\";\rimport { HttpClient } from \"./HttpClient\";\rimport { MessageHeaders } from \"./IHubProtocol\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { ITransport, TransferFormat } from \"./ITransport\";\rimport { WebSocketConstructor } from \"./Polyfills\";\rimport { Arg, getDataDetail, getUserAgentHeader, Platform } from \"./Utils\";\r\r/** @private */\rexport class WebSocketTransport implements ITransport {\r private readonly _logger: ILogger;\r private readonly _accessTokenFactory: (() => string | Promise) | undefined;\r private readonly _logMessageContent: boolean;\r private readonly _webSocketConstructor: WebSocketConstructor;\r private readonly _httpClient: HttpClient;\r private _webSocket?: WebSocket;\r private _headers: MessageHeaders;\r\r public onreceive: ((data: string | ArrayBuffer) => void) | null;\r public onclose: ((error?: Error) => void) | null;\r\r constructor(httpClient: HttpClient, accessTokenFactory: (() => string | Promise) | undefined, logger: ILogger,\r logMessageContent: boolean, webSocketConstructor: WebSocketConstructor, headers: MessageHeaders) {\r this._logger = logger;\r this._accessTokenFactory = accessTokenFactory;\r this._logMessageContent = logMessageContent;\r this._webSocketConstructor = webSocketConstructor;\r this._httpClient = httpClient;\r\r this.onreceive = null;\r this.onclose = null;\r this._headers = headers;\r }\r\r public async connect(url: string, transferFormat: TransferFormat): Promise {\r Arg.isRequired(url, \"url\");\r Arg.isRequired(transferFormat, \"transferFormat\");\r Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r this._logger.log(LogLevel.Trace, \"(WebSockets transport) Connecting.\");\r\r let token: string;\r if (this._accessTokenFactory) {\r token = await this._accessTokenFactory();\r }\r\r return new Promise((resolve, reject) => {\r url = url.replace(/^http/, \"ws\");\r let webSocket: WebSocket | undefined;\r const cookies = this._httpClient.getCookieString(url);\r let opened = false;\r\r if (Platform.isNode || Platform.isReactNative) {\r const headers: {[k: string]: string} = {};\r const [name, value] = getUserAgentHeader();\r headers[name] = value;\r if (token) {\r headers[HeaderNames.Authorization] = `Bearer ${token}`;\r }\r\r if (cookies) {\r headers[HeaderNames.Cookie] = cookies;\r }\r\r // Only pass headers when in non-browser environments\r webSocket = new this._webSocketConstructor(url, undefined, {\r headers: { ...headers, ...this._headers },\r });\r }\r else\r {\r if (token) {\r url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(token)}`;\r }\r }\r\r if (!webSocket) {\r // Chrome is not happy with passing 'undefined' as protocol\r webSocket = new this._webSocketConstructor(url);\r }\r\r if (transferFormat === TransferFormat.Binary) {\r webSocket.binaryType = \"arraybuffer\";\r }\r\r webSocket.onopen = (_event: Event) => {\r this._logger.log(LogLevel.Information, `WebSocket connected to ${url}.`);\r this._webSocket = webSocket;\r opened = true;\r resolve();\r };\r\r webSocket.onerror = (event: Event) => {\r let error: any = null;\r // ErrorEvent is a browser only type we need to check if the type exists before using it\r if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r error = event.error;\r } else {\r error = \"There was an error with the transport\";\r }\r\r this._logger.log(LogLevel.Information, `(WebSockets transport) ${error}.`);\r };\r\r webSocket.onmessage = (message: MessageEvent) => {\r this._logger.log(LogLevel.Trace, `(WebSockets transport) data received. ${getDataDetail(message.data, this._logMessageContent)}.`);\r if (this.onreceive) {\r try {\r this.onreceive(message.data);\r } catch (error) {\r this._close(error);\r return;\r }\r }\r };\r\r webSocket.onclose = (event: CloseEvent) => {\r // Don't call close handler if connection was never established\r // We'll reject the connect call instead\r if (opened) {\r this._close(event);\r } else {\r let error: any = null;\r // ErrorEvent is a browser only type we need to check if the type exists before using it\r if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r error = event.error;\r } else {\r error = \"WebSocket failed to connect. The connection could not be found on the server,\"\r + \" either the endpoint may not be a SignalR endpoint,\"\r + \" the connection ID is not present on the server, or there is a proxy blocking WebSockets.\"\r + \" If you have multiple servers check that sticky sessions are enabled.\";\r }\r\r reject(new Error(error));\r }\r };\r });\r }\r\r public send(data: any): Promise {\r if (this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN) {\r this._logger.log(LogLevel.Trace, `(WebSockets transport) sending data. ${getDataDetail(data, this._logMessageContent)}.`);\r this._webSocket.send(data);\r return Promise.resolve();\r }\r\r return Promise.reject(\"WebSocket is not in the OPEN state\");\r }\r\r public stop(): Promise {\r if (this._webSocket) {\r // Manually invoke onclose callback inline so we know the HttpConnection was closed properly before returning\r // This also solves an issue where websocket.onclose could take 18+ seconds to trigger during network disconnects\r this._close(undefined);\r }\r\r return Promise.resolve();\r }\r\r private _close(event?: CloseEvent | Error): void {\r // webSocket will be null if the transport did not start successfully\r if (this._webSocket) {\r // Clear websocket handlers because we are considering the socket closed now\r this._webSocket.onclose = () => {};\r this._webSocket.onmessage = () => {};\r this._webSocket.onerror = () => {};\r this._webSocket.close();\r this._webSocket = undefined;\r }\r\r this._logger.log(LogLevel.Trace, \"(WebSockets transport) socket closed.\");\r if (this.onclose) {\r if (this._isCloseEvent(event) && (event.wasClean === false || event.code !== 1000)) {\r this.onclose(new Error(`WebSocket closed with status code: ${event.code} (${event.reason || \"no reason given\"}).`));\r } else if (event instanceof Error) {\r this.onclose(event);\r } else {\r this.onclose();\r }\r }\r }\r\r private _isCloseEvent(event?: any): event is CloseEvent {\r return event && typeof event.wasClean === \"boolean\" && typeof event.code === \"number\";\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { AccessTokenHttpClient } from \"./AccessTokenHttpClient\";\rimport { DefaultHttpClient } from \"./DefaultHttpClient\";\rimport { AggregateErrors, DisabledTransportError, FailedToNegotiateWithServerError, FailedToStartTransportError, HttpError, UnsupportedTransportError, AbortError } from \"./Errors\";\rimport { IConnection } from \"./IConnection\";\rimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { HttpTransportType, ITransport, TransferFormat } from \"./ITransport\";\rimport { LongPollingTransport } from \"./LongPollingTransport\";\rimport { ServerSentEventsTransport } from \"./ServerSentEventsTransport\";\rimport { Arg, createLogger, getUserAgentHeader, Platform } from \"./Utils\";\rimport { WebSocketTransport } from \"./WebSocketTransport\";\r\r/** @private */\rconst enum ConnectionState {\r Connecting = \"Connecting\",\r Connected = \"Connected\",\r Disconnected = \"Disconnected\",\r Disconnecting = \"Disconnecting\",\r}\r\r/** @private */\rexport interface INegotiateResponse {\r connectionId?: string;\r connectionToken?: string;\r negotiateVersion?: number;\r availableTransports?: IAvailableTransport[];\r url?: string;\r accessToken?: string;\r error?: string;\r}\r\r/** @private */\rexport interface IAvailableTransport {\r transport: keyof typeof HttpTransportType;\r transferFormats: (keyof typeof TransferFormat)[];\r}\r\rconst MAX_REDIRECTS = 100;\r\r/** @private */\rexport class HttpConnection implements IConnection {\r private _connectionState: ConnectionState;\r // connectionStarted is tracked independently from connectionState, so we can check if the\r // connection ever did successfully transition from connecting to connected before disconnecting.\r private _connectionStarted: boolean;\r private readonly _httpClient: AccessTokenHttpClient;\r private readonly _logger: ILogger;\r private readonly _options: IHttpConnectionOptions;\r // Needs to not start with _ to be available for tests\r // eslint-disable-next-line @typescript-eslint/naming-convention\r private transport?: ITransport;\r private _startInternalPromise?: Promise;\r private _stopPromise?: Promise;\r private _stopPromiseResolver: (value?: PromiseLike) => void = () => {};\r private _stopError?: Error;\r private _accessTokenFactory?: () => string | Promise;\r private _sendQueue?: TransportSendQueue;\r\r public readonly features: any = {};\r public baseUrl: string;\r public connectionId?: string;\r public onreceive: ((data: string | ArrayBuffer) => void) | null;\r public onclose: ((e?: Error) => void) | null;\r\r private readonly _negotiateVersion: number = 1;\r\r constructor(url: string, options: IHttpConnectionOptions = {}) {\r Arg.isRequired(url, \"url\");\r\r this._logger = createLogger(options.logger);\r this.baseUrl = this._resolveUrl(url);\r\r options = options || {};\r options.logMessageContent = options.logMessageContent === undefined ? false : options.logMessageContent;\r if (typeof options.withCredentials === \"boolean\" || options.withCredentials === undefined) {\r options.withCredentials = options.withCredentials === undefined ? true : options.withCredentials;\r } else {\r throw new Error(\"withCredentials option was not a 'boolean' or 'undefined' value\");\r }\r options.timeout = options.timeout === undefined ? 100 * 1000 : options.timeout;\r\r let webSocketModule: any = null;\r let eventSourceModule: any = null;\r\r if (Platform.isNode && typeof require !== \"undefined\") {\r // In order to ignore the dynamic require in webpack builds we need to do this magic\r // @ts-ignore: TS doesn't know about these names\r const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r webSocketModule = requireFunc(\"ws\");\r eventSourceModule = requireFunc(\"eventsource\");\r }\r\r if (!Platform.isNode && typeof WebSocket !== \"undefined\" && !options.WebSocket) {\r options.WebSocket = WebSocket;\r } else if (Platform.isNode && !options.WebSocket) {\r if (webSocketModule) {\r options.WebSocket = webSocketModule;\r }\r }\r\r if (!Platform.isNode && typeof EventSource !== \"undefined\" && !options.EventSource) {\r options.EventSource = EventSource;\r } else if (Platform.isNode && !options.EventSource) {\r if (typeof eventSourceModule !== \"undefined\") {\r options.EventSource = eventSourceModule;\r }\r }\r\r this._httpClient = new AccessTokenHttpClient(options.httpClient || new DefaultHttpClient(this._logger), options.accessTokenFactory);\r this._connectionState = ConnectionState.Disconnected;\r this._connectionStarted = false;\r this._options = options;\r\r this.onreceive = null;\r this.onclose = null;\r }\r\r public start(): Promise;\r public start(transferFormat: TransferFormat): Promise;\r public async start(transferFormat?: TransferFormat): Promise {\r transferFormat = transferFormat || TransferFormat.Binary;\r\r Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\r this._logger.log(LogLevel.Debug, `Starting connection with transfer format '${TransferFormat[transferFormat]}'.`);\r\r if (this._connectionState !== ConnectionState.Disconnected) {\r return Promise.reject(new Error(\"Cannot start an HttpConnection that is not in the 'Disconnected' state.\"));\r }\r\r this._connectionState = ConnectionState.Connecting;\r\r this._startInternalPromise = this._startInternal(transferFormat);\r await this._startInternalPromise;\r\r // The TypeScript compiler thinks that connectionState must be Connecting here. The TypeScript compiler is wrong.\r if (this._connectionState as any === ConnectionState.Disconnecting) {\r // stop() was called and transitioned the client into the Disconnecting state.\r const message = \"Failed to start the HttpConnection before stop() was called.\";\r this._logger.log(LogLevel.Error, message);\r\r // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise.\r await this._stopPromise;\r\r return Promise.reject(new AbortError(message));\r } else if (this._connectionState as any !== ConnectionState.Connected) {\r // stop() was called and transitioned the client into the Disconnecting state.\r const message = \"HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!\";\r this._logger.log(LogLevel.Error, message);\r return Promise.reject(new AbortError(message));\r }\r\r this._connectionStarted = true;\r }\r\r public send(data: string | ArrayBuffer): Promise {\r if (this._connectionState !== ConnectionState.Connected) {\r return Promise.reject(new Error(\"Cannot send data if the connection is not in the 'Connected' State.\"));\r }\r\r if (!this._sendQueue) {\r this._sendQueue = new TransportSendQueue(this.transport!);\r }\r\r // Transport will not be null if state is connected\r return this._sendQueue.send(data);\r }\r\r public async stop(error?: Error): Promise {\r if (this._connectionState === ConnectionState.Disconnected) {\r this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnected state.`);\r return Promise.resolve();\r }\r\r if (this._connectionState === ConnectionState.Disconnecting) {\r this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r return this._stopPromise;\r }\r\r this._connectionState = ConnectionState.Disconnecting;\r\r this._stopPromise = new Promise((resolve) => {\r // Don't complete stop() until stopConnection() completes.\r this._stopPromiseResolver = resolve;\r });\r\r // stopInternal should never throw so just observe it.\r await this._stopInternal(error);\r await this._stopPromise;\r }\r\r private async _stopInternal(error?: Error): Promise {\r // Set error as soon as possible otherwise there is a race between\r // the transport closing and providing an error and the error from a close message\r // We would prefer the close message error.\r this._stopError = error;\r\r try {\r await this._startInternalPromise;\r } catch (e) {\r // This exception is returned to the user as a rejected Promise from the start method.\r }\r\r // The transport's onclose will trigger stopConnection which will run our onclose event.\r // The transport should always be set if currently connected. If it wasn't set, it's likely because\r // stop was called during start() and start() failed.\r if (this.transport) {\r try {\r await this.transport.stop();\r } catch (e) {\r this._logger.log(LogLevel.Error, `HttpConnection.transport.stop() threw error '${e}'.`);\r this._stopConnection();\r }\r\r this.transport = undefined;\r } else {\r this._logger.log(LogLevel.Debug, \"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.\");\r }\r }\r\r private async _startInternal(transferFormat: TransferFormat): Promise {\r // Store the original base url and the access token factory since they may change\r // as part of negotiating\r let url = this.baseUrl;\r this._accessTokenFactory = this._options.accessTokenFactory;\r this._httpClient._accessTokenFactory = this._accessTokenFactory;\r\r try {\r if (this._options.skipNegotiation) {\r if (this._options.transport === HttpTransportType.WebSockets) {\r // No need to add a connection ID in this case\r this.transport = this._constructTransport(HttpTransportType.WebSockets);\r // We should just call connect directly in this case.\r // No fallback or negotiate in this case.\r await this._startTransport(url, transferFormat);\r } else {\r throw new Error(\"Negotiation can only be skipped when using the WebSocket transport directly.\");\r }\r } else {\r let negotiateResponse: INegotiateResponse | null = null;\r let redirects = 0;\r\r do {\r negotiateResponse = await this._getNegotiationResponse(url);\r // the user tries to stop the connection when it is being started\r if (this._connectionState === ConnectionState.Disconnecting || this._connectionState === ConnectionState.Disconnected) {\r throw new AbortError(\"The connection was stopped during negotiation.\");\r }\r\r if (negotiateResponse.error) {\r throw new Error(negotiateResponse.error);\r }\r\r if ((negotiateResponse as any).ProtocolVersion) {\r throw new Error(\"Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.\");\r }\r\r if (negotiateResponse.url) {\r url = negotiateResponse.url;\r }\r\r if (negotiateResponse.accessToken) {\r // Replace the current access token factory with one that uses\r // the returned access token\r const accessToken = negotiateResponse.accessToken;\r this._accessTokenFactory = () => accessToken;\r // set the factory to undefined so the AccessTokenHttpClient won't retry with the same token, since we know it won't change until a connection restart\r this._httpClient._accessToken = accessToken;\r this._httpClient._accessTokenFactory = undefined;\r }\r\r redirects++;\r }\r while (negotiateResponse.url && redirects < MAX_REDIRECTS);\r\r if (redirects === MAX_REDIRECTS && negotiateResponse.url) {\r throw new Error(\"Negotiate redirection limit exceeded.\");\r }\r\r await this._createTransport(url, this._options.transport, negotiateResponse, transferFormat);\r }\r\r if (this.transport instanceof LongPollingTransport) {\r this.features.inherentKeepAlive = true;\r }\r\r if (this._connectionState === ConnectionState.Connecting) {\r // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise.\r // start() will handle the case when stop was called and startInternal exits still in the disconnecting state.\r this._logger.log(LogLevel.Debug, \"The HttpConnection connected successfully.\");\r this._connectionState = ConnectionState.Connected;\r }\r\r // stop() is waiting on us via this.startInternalPromise so keep this.transport around so it can clean up.\r // This is the only case startInternal can exit in neither the connected nor disconnected state because stopConnection()\r // will transition to the disconnected state. start() will wait for the transition using the stopPromise.\r } catch (e) {\r this._logger.log(LogLevel.Error, \"Failed to start the connection: \" + e);\r this._connectionState = ConnectionState.Disconnected;\r this.transport = undefined;\r\r // if start fails, any active calls to stop assume that start will complete the stop promise\r this._stopPromiseResolver();\r return Promise.reject(e);\r }\r }\r\r private async _getNegotiationResponse(url: string): Promise {\r const headers: {[k: string]: string} = {};\r const [name, value] = getUserAgentHeader();\r headers[name] = value;\r\r const negotiateUrl = this._resolveNegotiateUrl(url);\r this._logger.log(LogLevel.Debug, `Sending negotiation request: ${negotiateUrl}.`);\r try {\r const response = await this._httpClient.post(negotiateUrl, {\r content: \"\",\r headers: { ...headers, ...this._options.headers },\r timeout: this._options.timeout,\r withCredentials: this._options.withCredentials,\r });\r\r if (response.statusCode !== 200) {\r return Promise.reject(new Error(`Unexpected status code returned from negotiate '${response.statusCode}'`));\r }\r\r const negotiateResponse = JSON.parse(response.content as string) as INegotiateResponse;\r if (!negotiateResponse.negotiateVersion || negotiateResponse.negotiateVersion < 1) {\r // Negotiate version 0 doesn't use connectionToken\r // So we set it equal to connectionId so all our logic can use connectionToken without being aware of the negotiate version\r negotiateResponse.connectionToken = negotiateResponse.connectionId;\r }\r return negotiateResponse;\r } catch (e) {\r let errorMessage = \"Failed to complete negotiation with the server: \" + e;\r if (e instanceof HttpError) {\r if (e.statusCode === 404) {\r errorMessage = errorMessage + \" Either this is not a SignalR endpoint or there is a proxy blocking the connection.\";\r }\r }\r this._logger.log(LogLevel.Error, errorMessage);\r\r return Promise.reject(new FailedToNegotiateWithServerError(errorMessage));\r }\r }\r\r private _createConnectUrl(url: string, connectionToken: string | null | undefined) {\r if (!connectionToken) {\r return url;\r }\r\r return url + (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + `id=${connectionToken}`;\r }\r\r private async _createTransport(url: string, requestedTransport: HttpTransportType | ITransport | undefined, negotiateResponse: INegotiateResponse, requestedTransferFormat: TransferFormat): Promise {\r let connectUrl = this._createConnectUrl(url, negotiateResponse.connectionToken);\r if (this._isITransport(requestedTransport)) {\r this._logger.log(LogLevel.Debug, \"Connection was provided an instance of ITransport, using that directly.\");\r this.transport = requestedTransport;\r await this._startTransport(connectUrl, requestedTransferFormat);\r\r this.connectionId = negotiateResponse.connectionId;\r return;\r }\r\r const transportExceptions: any[] = [];\r const transports = negotiateResponse.availableTransports || [];\r let negotiate: INegotiateResponse | undefined = negotiateResponse;\r for (const endpoint of transports) {\r const transportOrError = this._resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat);\r if (transportOrError instanceof Error) {\r // Store the error and continue, we don't want to cause a re-negotiate in these cases\r transportExceptions.push(`${endpoint.transport} failed:`);\r transportExceptions.push(transportOrError);\r } else if (this._isITransport(transportOrError)) {\r this.transport = transportOrError;\r if (!negotiate) {\r try {\r negotiate = await this._getNegotiationResponse(url);\r } catch (ex) {\r return Promise.reject(ex);\r }\r connectUrl = this._createConnectUrl(url, negotiate.connectionToken);\r }\r try {\r await this._startTransport(connectUrl, requestedTransferFormat);\r this.connectionId = negotiate.connectionId;\r return;\r } catch (ex) {\r this._logger.log(LogLevel.Error, `Failed to start the transport '${endpoint.transport}': ${ex}`);\r negotiate = undefined;\r transportExceptions.push(new FailedToStartTransportError(`${endpoint.transport} failed: ${ex}`, HttpTransportType[endpoint.transport]));\r\r if (this._connectionState !== ConnectionState.Connecting) {\r const message = \"Failed to select transport before stop() was called.\";\r this._logger.log(LogLevel.Debug, message);\r return Promise.reject(new AbortError(message));\r }\r }\r }\r }\r\r if (transportExceptions.length > 0) {\r return Promise.reject(new AggregateErrors(`Unable to connect to the server with any of the available transports. ${transportExceptions.join(\" \")}`, transportExceptions));\r }\r return Promise.reject(new Error(\"None of the transports supported by the client are supported by the server.\"));\r }\r\r private _constructTransport(transport: HttpTransportType): ITransport {\r switch (transport) {\r case HttpTransportType.WebSockets:\r if (!this._options.WebSocket) {\r throw new Error(\"'WebSocket' is not supported in your environment.\");\r }\r return new WebSocketTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent!, this._options.WebSocket, this._options.headers || {});\r case HttpTransportType.ServerSentEvents:\r if (!this._options.EventSource) {\r throw new Error(\"'EventSource' is not supported in your environment.\");\r }\r return new ServerSentEventsTransport(this._httpClient, this._httpClient._accessToken, this._logger, this._options);\r case HttpTransportType.LongPolling:\r return new LongPollingTransport(this._httpClient, this._logger, this._options);\r default:\r throw new Error(`Unknown transport: ${transport}.`);\r }\r }\r\r private _startTransport(url: string, transferFormat: TransferFormat): Promise {\r this.transport!.onreceive = this.onreceive;\r this.transport!.onclose = (e) => this._stopConnection(e);\r return this.transport!.connect(url, transferFormat);\r }\r\r private _resolveTransportOrError(endpoint: IAvailableTransport, requestedTransport: HttpTransportType | undefined, requestedTransferFormat: TransferFormat): ITransport | Error {\r const transport = HttpTransportType[endpoint.transport];\r if (transport === null || transport === undefined) {\r this._logger.log(LogLevel.Debug, `Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r return new Error(`Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r } else {\r if (transportMatches(requestedTransport, transport)) {\r const transferFormats = endpoint.transferFormats.map((s) => TransferFormat[s]);\r if (transferFormats.indexOf(requestedTransferFormat) >= 0) {\r if ((transport === HttpTransportType.WebSockets && !this._options.WebSocket) ||\r (transport === HttpTransportType.ServerSentEvents && !this._options.EventSource)) {\r this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it is not supported in your environment.'`);\r return new UnsupportedTransportError(`'${HttpTransportType[transport]}' is not supported in your environment.`, transport);\r } else {\r this._logger.log(LogLevel.Debug, `Selecting transport '${HttpTransportType[transport]}'.`);\r try {\r return this._constructTransport(transport);\r } catch (ex) {\r return ex;\r }\r }\r } else {\r this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it does not support the requested transfer format '${TransferFormat[requestedTransferFormat]}'.`);\r return new Error(`'${HttpTransportType[transport]}' does not support ${TransferFormat[requestedTransferFormat]}.`);\r }\r } else {\r this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it was disabled by the client.`);\r return new DisabledTransportError(`'${HttpTransportType[transport]}' is disabled by the client.`, transport);\r }\r }\r }\r\r private _isITransport(transport: any): transport is ITransport {\r return transport && typeof (transport) === \"object\" && \"connect\" in transport;\r }\r\r private _stopConnection(error?: Error): void {\r this._logger.log(LogLevel.Debug, `HttpConnection.stopConnection(${error}) called while in state ${this._connectionState}.`);\r\r this.transport = undefined;\r\r // If we have a stopError, it takes precedence over the error from the transport\r error = this._stopError || error;\r this._stopError = undefined;\r\r if (this._connectionState === ConnectionState.Disconnected) {\r this._logger.log(LogLevel.Debug, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is already in the disconnected state.`);\r return;\r }\r\r if (this._connectionState === ConnectionState.Connecting) {\r this._logger.log(LogLevel.Warning, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is still in the connecting state.`);\r throw new Error(`HttpConnection.stopConnection(${error}) was called while the connection is still in the connecting state.`);\r }\r\r if (this._connectionState === ConnectionState.Disconnecting) {\r // A call to stop() induced this call to stopConnection and needs to be completed.\r // Any stop() awaiters will be scheduled to continue after the onclose callback fires.\r this._stopPromiseResolver();\r }\r\r if (error) {\r this._logger.log(LogLevel.Error, `Connection disconnected with error '${error}'.`);\r } else {\r this._logger.log(LogLevel.Information, \"Connection disconnected.\");\r }\r\r if (this._sendQueue) {\r this._sendQueue.stop().catch((e) => {\r this._logger.log(LogLevel.Error, `TransportSendQueue.stop() threw error '${e}'.`);\r });\r this._sendQueue = undefined;\r }\r\r this.connectionId = undefined;\r this._connectionState = ConnectionState.Disconnected;\r\r if (this._connectionStarted) {\r this._connectionStarted = false;\r try {\r if (this.onclose) {\r this.onclose(error);\r }\r } catch (e) {\r this._logger.log(LogLevel.Error, `HttpConnection.onclose(${error}) threw error '${e}'.`);\r }\r }\r }\r\r private _resolveUrl(url: string): string {\r // startsWith is not supported in IE\r if (url.lastIndexOf(\"https://\", 0) === 0 || url.lastIndexOf(\"http://\", 0) === 0) {\r return url;\r }\r\r if (!Platform.isBrowser) {\r throw new Error(`Cannot resolve '${url}'.`);\r }\r\r // Setting the url to the href propery of an anchor tag handles normalization\r // for us. There are 3 main cases.\r // 1. Relative path normalization e.g \"b\" -> \"http://localhost:5000/a/b\"\r // 2. Absolute path normalization e.g \"/a/b\" -> \"http://localhost:5000/a/b\"\r // 3. Networkpath reference normalization e.g \"//localhost:5000/a/b\" -> \"http://localhost:5000/a/b\"\r const aTag = window.document.createElement(\"a\");\r aTag.href = url;\r\r this._logger.log(LogLevel.Information, `Normalizing '${url}' to '${aTag.href}'.`);\r return aTag.href;\r }\r\r private _resolveNegotiateUrl(url: string): string {\r const index = url.indexOf(\"?\");\r let negotiateUrl = url.substring(0, index === -1 ? url.length : index);\r if (negotiateUrl[negotiateUrl.length - 1] !== \"/\") {\r negotiateUrl += \"/\";\r }\r negotiateUrl += \"negotiate\";\r negotiateUrl += index === -1 ? \"\" : url.substring(index);\r\r if (negotiateUrl.indexOf(\"negotiateVersion\") === -1) {\r negotiateUrl += index === -1 ? \"?\" : \"&\";\r negotiateUrl += \"negotiateVersion=\" + this._negotiateVersion;\r }\r return negotiateUrl;\r }\r}\r\rfunction transportMatches(requestedTransport: HttpTransportType | undefined, actualTransport: HttpTransportType) {\r return !requestedTransport || ((actualTransport & requestedTransport) !== 0);\r}\r\r/** @private */\rexport class TransportSendQueue {\r private _buffer: any[] = [];\r private _sendBufferedData: PromiseSource;\r private _executing: boolean = true;\r private _transportResult?: PromiseSource;\r private _sendLoopPromise: Promise;\r\r constructor(private readonly _transport: ITransport) {\r this._sendBufferedData = new PromiseSource();\r this._transportResult = new PromiseSource();\r\r this._sendLoopPromise = this._sendLoop();\r }\r\r public send(data: string | ArrayBuffer): Promise {\r this._bufferData(data);\r if (!this._transportResult) {\r this._transportResult = new PromiseSource();\r }\r return this._transportResult.promise;\r }\r\r public stop(): Promise {\r this._executing = false;\r this._sendBufferedData.resolve();\r return this._sendLoopPromise;\r }\r\r private _bufferData(data: string | ArrayBuffer): void {\r if (this._buffer.length && typeof(this._buffer[0]) !== typeof(data)) {\r throw new Error(`Expected data to be of type ${typeof(this._buffer)} but was of type ${typeof(data)}`);\r }\r\r this._buffer.push(data);\r this._sendBufferedData.resolve();\r }\r\r private async _sendLoop(): Promise {\r while (true) {\r await this._sendBufferedData.promise;\r\r if (!this._executing) {\r if (this._transportResult) {\r this._transportResult.reject(\"Connection stopped.\");\r }\r\r break;\r }\r\r this._sendBufferedData = new PromiseSource();\r\r const transportResult = this._transportResult!;\r this._transportResult = undefined;\r\r const data = typeof(this._buffer[0]) === \"string\" ?\r this._buffer.join(\"\") :\r TransportSendQueue._concatBuffers(this._buffer);\r\r this._buffer.length = 0;\r\r try {\r await this._transport.send(data);\r transportResult.resolve();\r } catch (error) {\r transportResult.reject(error);\r }\r }\r }\r\r private static _concatBuffers(arrayBuffers: ArrayBuffer[]): ArrayBuffer {\r const totalLength = arrayBuffers.map((b) => b.byteLength).reduce((a, b) => a + b);\r const result = new Uint8Array(totalLength);\r let offset = 0;\r for (const item of arrayBuffers) {\r result.set(new Uint8Array(item), offset);\r offset += item.byteLength;\r }\r\r return result.buffer;\r }\r}\r\rclass PromiseSource {\r private _resolver?: () => void;\r private _rejecter!: (reason?: any) => void;\r public promise: Promise;\r\r constructor() {\r this.promise = new Promise((resolve, reject) => [this._resolver, this._rejecter] = [resolve, reject]);\r }\r\r public resolve(): void {\r this._resolver!();\r }\r\r public reject(reason?: any): void {\r this._rejecter!(reason);\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { CompletionMessage, HubMessage, IHubProtocol, InvocationMessage, MessageType, StreamItemMessage } from \"./IHubProtocol\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { TransferFormat } from \"./ITransport\";\rimport { NullLogger } from \"./Loggers\";\rimport { TextMessageFormat } from \"./TextMessageFormat\";\r\rconst JSON_HUB_PROTOCOL_NAME: string = \"json\";\r\r/** Implements the JSON Hub Protocol. */\rexport class JsonHubProtocol implements IHubProtocol {\r\r /** @inheritDoc */\r public readonly name: string = JSON_HUB_PROTOCOL_NAME;\r /** @inheritDoc */\r public readonly version: number = 1;\r\r /** @inheritDoc */\r public readonly transferFormat: TransferFormat = TransferFormat.Text;\r\r /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r *\r * @param {string} input A string containing the serialized representation.\r * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r */\r public parseMessages(input: string, logger: ILogger): HubMessage[] {\r // The interface does allow \"ArrayBuffer\" to be passed in, but this implementation does not. So let's throw a useful error.\r if (typeof input !== \"string\") {\r throw new Error(\"Invalid input for JSON hub protocol. Expected a string.\");\r }\r\r if (!input) {\r return [];\r }\r\r if (logger === null) {\r logger = NullLogger.instance;\r }\r\r // Parse the messages\r const messages = TextMessageFormat.parse(input);\r\r const hubMessages = [];\r for (const message of messages) {\r const parsedMessage = JSON.parse(message) as HubMessage;\r if (typeof parsedMessage.type !== \"number\") {\r throw new Error(\"Invalid payload.\");\r }\r switch (parsedMessage.type) {\r case MessageType.Invocation:\r this._isInvocationMessage(parsedMessage);\r break;\r case MessageType.StreamItem:\r this._isStreamItemMessage(parsedMessage);\r break;\r case MessageType.Completion:\r this._isCompletionMessage(parsedMessage);\r break;\r case MessageType.Ping:\r // Single value, no need to validate\r break;\r case MessageType.Close:\r // All optional values, no need to validate\r break;\r default:\r // Future protocol changes can add message types, old clients can ignore them\r logger.log(LogLevel.Information, \"Unknown message type '\" + parsedMessage.type + \"' ignored.\");\r continue;\r }\r hubMessages.push(parsedMessage);\r }\r\r return hubMessages;\r }\r\r /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.\r *\r * @param {HubMessage} message The message to write.\r * @returns {string} A string containing the serialized representation of the message.\r */\r public writeMessage(message: HubMessage): string {\r return TextMessageFormat.write(JSON.stringify(message));\r }\r\r private _isInvocationMessage(message: InvocationMessage): void {\r this._assertNotEmptyString(message.target, \"Invalid payload for Invocation message.\");\r\r if (message.invocationId !== undefined) {\r this._assertNotEmptyString(message.invocationId, \"Invalid payload for Invocation message.\");\r }\r }\r\r private _isStreamItemMessage(message: StreamItemMessage): void {\r this._assertNotEmptyString(message.invocationId, \"Invalid payload for StreamItem message.\");\r\r if (message.item === undefined) {\r throw new Error(\"Invalid payload for StreamItem message.\");\r }\r }\r\r private _isCompletionMessage(message: CompletionMessage): void {\r if (message.result && message.error) {\r throw new Error(\"Invalid payload for Completion message.\");\r }\r\r if (!message.result && message.error) {\r this._assertNotEmptyString(message.error, \"Invalid payload for Completion message.\");\r }\r\r this._assertNotEmptyString(message.invocationId, \"Invalid payload for Completion message.\");\r }\r\r private _assertNotEmptyString(value: any, errorMessage: string): void {\r if (typeof value !== \"string\" || value === \"\") {\r throw new Error(errorMessage);\r }\r }\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\rimport { DefaultReconnectPolicy } from \"./DefaultReconnectPolicy\";\rimport { HttpConnection } from \"./HttpConnection\";\rimport { HubConnection } from \"./HubConnection\";\rimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\rimport { IHubProtocol } from \"./IHubProtocol\";\rimport { ILogger, LogLevel } from \"./ILogger\";\rimport { IRetryPolicy } from \"./IRetryPolicy\";\rimport { HttpTransportType } from \"./ITransport\";\rimport { JsonHubProtocol } from \"./JsonHubProtocol\";\rimport { NullLogger } from \"./Loggers\";\rimport { Arg, ConsoleLogger } from \"./Utils\";\r\rconst LogLevelNameMapping: {[k: string]: LogLevel} = {\r trace: LogLevel.Trace,\r debug: LogLevel.Debug,\r info: LogLevel.Information,\r information: LogLevel.Information,\r warn: LogLevel.Warning,\r warning: LogLevel.Warning,\r error: LogLevel.Error,\r critical: LogLevel.Critical,\r none: LogLevel.None,\r};\r\rfunction parseLogLevel(name: string): LogLevel {\r // Case-insensitive matching via lower-casing\r // Yes, I know case-folding is a complicated problem in Unicode, but we only support\r // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse.\r const mapping = LogLevelNameMapping[name.toLowerCase()];\r if (typeof mapping !== \"undefined\") {\r return mapping;\r } else {\r throw new Error(`Unknown log level: ${name}`);\r }\r}\r\r/** A builder for configuring {@link @microsoft/signalr.HubConnection} instances. */\rexport class HubConnectionBuilder {\r /** @internal */\r public protocol?: IHubProtocol;\r /** @internal */\r public httpConnectionOptions?: IHttpConnectionOptions;\r /** @internal */\r public url?: string;\r /** @internal */\r public logger?: ILogger;\r\r /** If defined, this indicates the client should automatically attempt to reconnect if the connection is lost. */\r /** @internal */\r public reconnectPolicy?: IRetryPolicy;\r\r /** Configures console logging for the {@link @microsoft/signalr.HubConnection}.\r *\r * @param {LogLevel} logLevel The minimum level of messages to log. Anything at this level, or a more severe level, will be logged.\r * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r */\r public configureLogging(logLevel: LogLevel): HubConnectionBuilder;\r\r /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r *\r * @param {ILogger} logger An object implementing the {@link @microsoft/signalr.ILogger} interface, which will be used to write all log messages.\r * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r */\r public configureLogging(logger: ILogger): HubConnectionBuilder;\r\r /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r *\r * @param {string} logLevel A string representing a LogLevel setting a minimum level of messages to log.\r * See {@link https://docs.microsoft.com/aspnet/core/signalr/configuration#configure-logging|the documentation for client logging configuration} for more details.\r */\r public configureLogging(logLevel: string): HubConnectionBuilder;\r\r /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r *\r * @param {LogLevel | string | ILogger} logging A {@link @microsoft/signalr.LogLevel}, a string representing a LogLevel, or an object implementing the {@link @microsoft/signalr.ILogger} interface.\r * See {@link https://docs.microsoft.com/aspnet/core/signalr/configuration#configure-logging|the documentation for client logging configuration} for more details.\r * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r */\r public configureLogging(logging: LogLevel | string | ILogger): HubConnectionBuilder;\r public configureLogging(logging: LogLevel | string | ILogger): HubConnectionBuilder {\r Arg.isRequired(logging, \"logging\");\r\r if (isLogger(logging)) {\r this.logger = logging;\r } else if (typeof logging === \"string\") {\r const logLevel = parseLogLevel(logging);\r this.logger = new ConsoleLogger(logLevel);\r } else {\r this.logger = new ConsoleLogger(logging);\r }\r\r return this;\r }\r\r /** Configures the {@link @microsoft/signalr.HubConnection} to use HTTP-based transports to connect to the specified URL.\r *\r * The transport will be selected automatically based on what the server and client support.\r *\r * @param {string} url The URL the connection will use.\r * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r */\r public withUrl(url: string): HubConnectionBuilder;\r\r /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified HTTP-based transport to connect to the specified URL.\r *\r * @param {string} url The URL the connection will use.\r * @param {HttpTransportType} transportType The specific transport to use.\r * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r */\r public withUrl(url: string, transportType: HttpTransportType): HubConnectionBuilder;\r\r /** Configures the {@link @microsoft/signalr.HubConnection} to use HTTP-based transports to connect to the specified URL.\r *\r * @param {string} url The URL the connection will use.\r * @param {IHttpConnectionOptions} options An options object used to configure the connection.\r * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r */\r public withUrl(url: string, options: IHttpConnectionOptions): HubConnectionBuilder;\r public withUrl(url: string, transportTypeOrOptions?: IHttpConnectionOptions | HttpTransportType): HubConnectionBuilder {\r Arg.isRequired(url, \"url\");\r Arg.isNotEmpty(url, \"url\");\r\r this.url = url;\r\r // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed\r // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called.\r if (typeof transportTypeOrOptions === \"object\") {\r this.httpConnectionOptions = { ...this.httpConnectionOptions, ...transportTypeOrOptions };\r } else {\r this.httpConnectionOptions = {\r ...this.httpConnectionOptions,\r transport: transportTypeOrOptions,\r };\r }\r\r return this;\r }\r\r /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.\r *\r * @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.\r */\r public withHubProtocol(protocol: IHubProtocol): HubConnectionBuilder {\r Arg.isRequired(protocol, \"protocol\");\r\r this.protocol = protocol;\r return this;\r }\r\r /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r * By default, the client will wait 0, 2, 10 and 30 seconds respectively before trying up to 4 reconnect attempts.\r */\r public withAutomaticReconnect(): HubConnectionBuilder;\r\r /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r *\r * @param {number[]} retryDelays An array containing the delays in milliseconds before trying each reconnect attempt.\r * The length of the array represents how many failed reconnect attempts it takes before the client will stop attempting to reconnect.\r */\r public withAutomaticReconnect(retryDelays: number[]): HubConnectionBuilder;\r\r /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r *\r * @param {IRetryPolicy} reconnectPolicy An {@link @microsoft/signalR.IRetryPolicy} that controls the timing and number of reconnect attempts.\r */\r public withAutomaticReconnect(reconnectPolicy: IRetryPolicy): HubConnectionBuilder;\r public withAutomaticReconnect(retryDelaysOrReconnectPolicy?: number[] | IRetryPolicy): HubConnectionBuilder {\r if (this.reconnectPolicy) {\r throw new Error(\"A reconnectPolicy has already been set.\");\r }\r\r if (!retryDelaysOrReconnectPolicy) {\r this.reconnectPolicy = new DefaultReconnectPolicy();\r } else if (Array.isArray(retryDelaysOrReconnectPolicy)) {\r this.reconnectPolicy = new DefaultReconnectPolicy(retryDelaysOrReconnectPolicy);\r } else {\r this.reconnectPolicy = retryDelaysOrReconnectPolicy;\r }\r\r return this;\r }\r\r /** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.\r *\r * @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.\r */\r public build(): HubConnection {\r // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one\r // provided to configureLogger\r const httpConnectionOptions = this.httpConnectionOptions || {};\r\r // If it's 'null', the user **explicitly** asked for null, don't mess with it.\r if (httpConnectionOptions.logger === undefined) {\r // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it.\r httpConnectionOptions.logger = this.logger;\r }\r\r // Now create the connection\r if (!this.url) {\r throw new Error(\"The 'HubConnectionBuilder.withUrl' method must be called before building the connection.\");\r }\r const connection = new HttpConnection(this.url, httpConnectionOptions);\r\r return HubConnection.create(\r connection,\r this.logger || NullLogger.instance,\r this.protocol || new JsonHubProtocol(),\r this.reconnectPolicy);\r }\r}\r\rfunction isLogger(logger: any): logger is ILogger {\r return logger.log !== undefined;\r}\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\r// Everything that users need to access must be exported here. Including interfaces.\rexport { AbortSignal } from \"./AbortController\";\rexport { AbortError, HttpError, TimeoutError } from \"./Errors\";\rexport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\rexport { DefaultHttpClient } from \"./DefaultHttpClient\";\rexport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\rexport { HubConnection, HubConnectionState } from \"./HubConnection\";\rexport { HubConnectionBuilder } from \"./HubConnectionBuilder\";\rexport { MessageType, MessageHeaders, HubMessage, HubMessageBase, HubInvocationMessage, InvocationMessage, StreamInvocationMessage, StreamItemMessage, CompletionMessage,\r PingMessage, CloseMessage, CancelInvocationMessage, IHubProtocol } from \"./IHubProtocol\";\rexport { ILogger, LogLevel } from \"./ILogger\";\rexport { HttpTransportType, TransferFormat, ITransport } from \"./ITransport\";\rexport { IStreamSubscriber, IStreamResult, ISubscription } from \"./Stream\";\rexport { NullLogger } from \"./Loggers\";\rexport { JsonHubProtocol } from \"./JsonHubProtocol\";\rexport { Subject } from \"./Subject\";\rexport { IRetryPolicy, RetryContext } from \"./IRetryPolicy\";\rexport { VERSION } from \"./Utils\";\r","// Licensed to the .NET Foundation under one or more agreements.\r// The .NET Foundation licenses this file to you under the MIT license.\r\r// This is where we add any polyfills we'll need for the browser. It is the entry module for browser-specific builds.\r\r// Copy from Array.prototype into Uint8Array to polyfill on IE. It's OK because the implementations of indexOf and slice use properties\r// that exist on Uint8Array with the same name, and JavaScript is magic.\r// We make them 'writable' because the Buffer polyfill messes with it as well.\rif (!Uint8Array.prototype.indexOf) {\r Object.defineProperty(Uint8Array.prototype, \"indexOf\", {\r value: Array.prototype.indexOf,\r writable: true,\r });\r}\rif (!Uint8Array.prototype.slice) {\r Object.defineProperty(Uint8Array.prototype, \"slice\", {\r // wrap the slice in Uint8Array so it looks like a Uint8Array.slice call\r // eslint-disable-next-line object-shorthand\r value: function(start?: number, end?: number) { return new Uint8Array(Array.prototype.slice.call(this, start, end)); },\r writable: true,\r });\r}\rif (!Uint8Array.prototype.forEach) {\r Object.defineProperty(Uint8Array.prototype, \"forEach\", {\r value: Array.prototype.forEach,\r writable: true,\r });\r}\r\rexport * from \"./index\";\r"],"names":[],"sourceRoot":""}