New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/signalr

Package Overview
Dependencies
Maintainers
6
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/signalr - npm Package Compare versions

Comparing version 6.0.0-preview.1.21103.6 to 6.0.0-preview.2.21154.6

5

dist/cjs/AbortController.js

@@ -5,2 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.AbortController = void 0;
// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController

@@ -28,3 +29,3 @@ // We don't actually ever use the API being polyfilled, we always use the polyfill because

},
enumerable: true,
enumerable: false,
configurable: true

@@ -36,3 +37,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -39,0 +40,0 @@ });

15

dist/cjs/browser-index.js
"use strict";
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -33,3 +40,3 @@ // This is where we add any polyfills we'll need for the browser. It is the entry module for browser-specific builds.

}
__export(require("./index"));
__exportStar(require("./index"), exports);
//# sourceMappingURL=browser-index.js.map

@@ -5,5 +5,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -16,2 +19,3 @@ extendStatics(d, b);

Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultHttpClient = void 0;
var Errors_1 = require("./Errors");

@@ -18,0 +22,0 @@ var FetchHttpClient_1 = require("./FetchHttpClient");

"use strict";
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultReconnectPolicy = void 0;
// 0, 2, 10, 30 second delays before reconnect attempts.

@@ -10,3 +18,3 @@ var DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];

function DefaultReconnectPolicy(retryDelays) {
this.retryDelays = retryDelays !== undefined ? retryDelays.concat([null]) : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;
this.retryDelays = retryDelays !== undefined ? __spreadArrays(retryDelays, [null]) : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;
}

@@ -13,0 +21,0 @@ DefaultReconnectPolicy.prototype.nextRetryDelayInMilliseconds = function (retryContext) {

@@ -5,5 +5,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -16,2 +19,3 @@ extendStatics(d, b);

Object.defineProperty(exports, "__esModule", { value: true });
exports.AbortError = exports.TimeoutError = exports.HttpError = void 0;
/** Error thrown when an HTTP request fails. */

@@ -18,0 +22,0 @@ var HttpError = /** @class */ (function (_super) {

@@ -5,5 +5,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -15,15 +18,19 @@ extendStatics(d, b);

})();
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -60,2 +67,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.FetchHttpClient = void 0;
var Errors_1 = require("./Errors");

@@ -62,0 +70,0 @@ var HttpClient_1 = require("./HttpClient");

@@ -5,2 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.HandshakeProtocol = void 0;
var TextMessageFormat_1 = require("./TextMessageFormat");

@@ -30,3 +31,3 @@ var Utils_1 = require("./Utils");

var responseLength = separatorIndex + 1;
messageData = String.fromCharCode.apply(null, binaryData.slice(0, responseLength));
messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));
remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;

@@ -33,0 +34,0 @@ }

"use strict";
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpClient = exports.HttpResponse = void 0;
/** Represents an HTTP response. */

@@ -31,9 +35,9 @@ var HttpResponse = /** @class */ (function () {

HttpClient.prototype.get = function (url, options) {
return this.send(__assign({}, options, { method: "GET", url: url }));
return this.send(__assign(__assign({}, options), { method: "GET", url: url }));
};
HttpClient.prototype.post = function (url, options) {
return this.send(__assign({}, options, { method: "POST", url: url }));
return this.send(__assign(__assign({}, options), { method: "POST", url: url }));
};
HttpClient.prototype.delete = function (url, options) {
return this.send(__assign({}, options, { method: "DELETE", url: url }));
return this.send(__assign(__assign({}, options), { method: "DELETE", url: url }));
};

@@ -40,0 +44,0 @@ /** Gets all cookies that apply to the specified URL.

"use strict";
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -48,2 +52,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.TransportSendQueue = exports.HttpConnection = void 0;
var DefaultHttpClient_1 = require("./DefaultHttpClient");

@@ -355,3 +360,3 @@ var ILogger_1 = require("./ILogger");

content: "",
headers: __assign({}, headers, this.options.headers),
headers: __assign(__assign({}, headers), this.options.headers),
withCredentials: this.options.withCredentials,

@@ -358,0 +363,0 @@ })];

@@ -5,6 +5,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -41,2 +42,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.HubConnection = exports.HubConnectionState = void 0;
var HandshakeProtocol_1 = require("./HandshakeProtocol");

@@ -103,3 +105,3 @@ var IHubProtocol_1 = require("./IHubProtocol");

},
enumerable: true,
enumerable: false,
configurable: true

@@ -114,3 +116,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -137,3 +139,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -712,3 +714,3 @@ });

}
if (this.onreconnecting) {
if (this.reconnectingCallbacks.length !== 0) {
try {

@@ -748,3 +750,3 @@ this.reconnectingCallbacks.forEach(function (c) { return c.apply(_this, [error]); });

this.logger.log(ILogger_1.LogLevel.Information, "HubConnection reconnected successfully.");
if (this.onreconnected) {
if (this.reconnectedCallbacks.length !== 0) {
try {

@@ -751,0 +753,0 @@ this.reconnectedCallbacks.forEach(function (c) { return c.apply(_this, [_this.connection.connectionId]); });

"use strict";
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HubConnectionBuilder = void 0;
var DefaultReconnectPolicy_1 = require("./DefaultReconnectPolicy");

@@ -69,6 +73,6 @@ var HttpConnection_1 = require("./HttpConnection");

if (typeof transportTypeOrOptions === "object") {
this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, transportTypeOrOptions);
this.httpConnectionOptions = __assign(__assign({}, this.httpConnectionOptions), transportTypeOrOptions);
}
else {
this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, { transport: transportTypeOrOptions });
this.httpConnectionOptions = __assign(__assign({}, this.httpConnectionOptions), { transport: transportTypeOrOptions });
}

@@ -75,0 +79,0 @@ return this;

@@ -5,2 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageType = void 0;
/** Defines the type of a Hub Message. */

@@ -7,0 +8,0 @@ var MessageType;

@@ -5,2 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.LogLevel = void 0;
// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.

@@ -7,0 +8,0 @@ /** Indicates the severity of a log message.

@@ -5,31 +5,32 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = exports.Subject = exports.JsonHubProtocol = exports.NullLogger = exports.TransferFormat = exports.HttpTransportType = exports.LogLevel = exports.MessageType = exports.HubConnectionBuilder = exports.HubConnectionState = exports.HubConnection = exports.DefaultHttpClient = exports.HttpResponse = exports.HttpClient = exports.TimeoutError = exports.HttpError = exports.AbortError = void 0;
var Errors_1 = require("./Errors");
exports.AbortError = Errors_1.AbortError;
exports.HttpError = Errors_1.HttpError;
exports.TimeoutError = Errors_1.TimeoutError;
Object.defineProperty(exports, "AbortError", { enumerable: true, get: function () { return Errors_1.AbortError; } });
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return Errors_1.HttpError; } });
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return Errors_1.TimeoutError; } });
var HttpClient_1 = require("./HttpClient");
exports.HttpClient = HttpClient_1.HttpClient;
exports.HttpResponse = HttpClient_1.HttpResponse;
Object.defineProperty(exports, "HttpClient", { enumerable: true, get: function () { return HttpClient_1.HttpClient; } });
Object.defineProperty(exports, "HttpResponse", { enumerable: true, get: function () { return HttpClient_1.HttpResponse; } });
var DefaultHttpClient_1 = require("./DefaultHttpClient");
exports.DefaultHttpClient = DefaultHttpClient_1.DefaultHttpClient;
Object.defineProperty(exports, "DefaultHttpClient", { enumerable: true, get: function () { return DefaultHttpClient_1.DefaultHttpClient; } });
var HubConnection_1 = require("./HubConnection");
exports.HubConnection = HubConnection_1.HubConnection;
exports.HubConnectionState = HubConnection_1.HubConnectionState;
Object.defineProperty(exports, "HubConnection", { enumerable: true, get: function () { return HubConnection_1.HubConnection; } });
Object.defineProperty(exports, "HubConnectionState", { enumerable: true, get: function () { return HubConnection_1.HubConnectionState; } });
var HubConnectionBuilder_1 = require("./HubConnectionBuilder");
exports.HubConnectionBuilder = HubConnectionBuilder_1.HubConnectionBuilder;
Object.defineProperty(exports, "HubConnectionBuilder", { enumerable: true, get: function () { return HubConnectionBuilder_1.HubConnectionBuilder; } });
var IHubProtocol_1 = require("./IHubProtocol");
exports.MessageType = IHubProtocol_1.MessageType;
Object.defineProperty(exports, "MessageType", { enumerable: true, get: function () { return IHubProtocol_1.MessageType; } });
var ILogger_1 = require("./ILogger");
exports.LogLevel = ILogger_1.LogLevel;
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return ILogger_1.LogLevel; } });
var ITransport_1 = require("./ITransport");
exports.HttpTransportType = ITransport_1.HttpTransportType;
exports.TransferFormat = ITransport_1.TransferFormat;
Object.defineProperty(exports, "HttpTransportType", { enumerable: true, get: function () { return ITransport_1.HttpTransportType; } });
Object.defineProperty(exports, "TransferFormat", { enumerable: true, get: function () { return ITransport_1.TransferFormat; } });
var Loggers_1 = require("./Loggers");
exports.NullLogger = Loggers_1.NullLogger;
Object.defineProperty(exports, "NullLogger", { enumerable: true, get: function () { return Loggers_1.NullLogger; } });
var JsonHubProtocol_1 = require("./JsonHubProtocol");
exports.JsonHubProtocol = JsonHubProtocol_1.JsonHubProtocol;
Object.defineProperty(exports, "JsonHubProtocol", { enumerable: true, get: function () { return JsonHubProtocol_1.JsonHubProtocol; } });
var Subject_1 = require("./Subject");
exports.Subject = Subject_1.Subject;
Object.defineProperty(exports, "Subject", { enumerable: true, get: function () { return Subject_1.Subject; } });
var Utils_1 = require("./Utils");
exports.VERSION = Utils_1.VERSION;
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return Utils_1.VERSION; } });
//# sourceMappingURL=index.js.map

@@ -5,2 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.TransferFormat = exports.HttpTransportType = void 0;
// This will be treated as a bit flag in the future, so we keep it using power-of-two values.

@@ -7,0 +8,0 @@ /** Specifies a specific HTTP transport type. */

@@ -5,2 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonHubProtocol = void 0;
var IHubProtocol_1 = require("./IHubProtocol");

@@ -7,0 +8,0 @@ var ILogger_1 = require("./ILogger");

@@ -5,2 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.NullLogger = void 0;
/** A logger that does nothing when log messages are sent to it. */

@@ -7,0 +8,0 @@ var NullLogger = /** @class */ (function () {

"use strict";
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -48,2 +52,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.LongPollingTransport = void 0;
var AbortController_1 = require("./AbortController");

@@ -74,3 +79,3 @@ var Errors_1 = require("./Errors");

},
enumerable: true,
enumerable: false,
configurable: true

@@ -80,3 +85,4 @@ });

return __awaiter(this, void 0, void 0, function () {
var _a, _b, name, value, headers, pollOptions, token, pollUrl, response;
var _a, name, value, headers, pollOptions, token, pollUrl, response;
var _b;
return __generator(this, function (_c) {

@@ -95,4 +101,4 @@ switch (_c.label) {

}
_b = Utils_1.getUserAgentHeader(), name = _b[0], value = _b[1];
headers = __assign((_a = {}, _a[name] = value, _a), this.headers);
_a = Utils_1.getUserAgentHeader(), name = _a[0], value = _a[1];
headers = __assign((_b = {}, _b[name] = value, _b), this.headers);
pollOptions = {

@@ -270,3 +276,3 @@ abortSignal: this.pollAbort.signal,

deleteOptions = {
headers: __assign({}, headers, this.headers),
headers: __assign(__assign({}, headers), this.headers),
withCredentials: this.withCredentials,

@@ -273,0 +279,0 @@ };

"use strict";
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -48,2 +52,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.ServerSentEventsTransport = void 0;
var ILogger_1 = require("./ILogger");

@@ -103,3 +108,3 @@ var ITransport_1 = require("./ITransport");

headers[name_1] = value;
eventSource = new _this.eventSourceConstructor(url, { withCredentials: _this.withCredentials, headers: __assign({}, headers, _this.headers) });
eventSource = new _this.eventSourceConstructor(url, { withCredentials: _this.withCredentials, headers: __assign(__assign({}, headers), _this.headers) });
}

@@ -119,4 +124,5 @@ try {

};
// @ts-ignore: not using event on purpose
eventSource.onerror = function (e) {
var error = new Error(e.data || "Error occurred");
var error = new Error("Error occurred while starting EventSource");
if (opened) {

@@ -123,0 +129,0 @@ _this.close(error);

@@ -5,2 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Subject = void 0;
var Utils_1 = require("./Utils");

@@ -7,0 +8,0 @@ /** Stream implementation to stream items to the server. */

@@ -5,2 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.TextMessageFormat = void 0;
// Not exported from index

@@ -7,0 +8,0 @@ /** @private */

"use strict";
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -48,2 +52,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.constructUserAgent = exports.getUserAgentHeader = exports.ConsoleLogger = exports.SubjectSubscription = exports.createLogger = exports.sendMessage = exports.isArrayBuffer = exports.formatArrayBuffer = exports.getDataDetail = exports.Platform = exports.Arg = exports.VERSION = void 0;
var ILogger_1 = require("./ILogger");

@@ -53,3 +58,3 @@ var Loggers_1 = require("./Loggers");

/** The version of the SignalR client. */
exports.VERSION = "6.0.0-preview.1.21103.6";
exports.VERSION = "6.0.0-preview.2.21154.6";
/** @private */

@@ -86,3 +91,3 @@ var Arg = /** @class */ (function () {

},
enumerable: true,
enumerable: false,
configurable: true

@@ -94,3 +99,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -102,3 +107,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -152,3 +157,4 @@ });

return __awaiter(this, void 0, void 0, function () {
var _a, headers, token, _b, name, value, responseType, response;
var headers, token, _a, name, value, responseType, response;
var _b;
return __generator(this, function (_c) {

@@ -163,9 +169,9 @@ switch (_c.label) {

if (token) {
headers = (_a = {},
_a["Authorization"] = "Bearer " + token,
_a);
headers = (_b = {},
_b["Authorization"] = "Bearer " + token,
_b);
}
_c.label = 2;
case 2:
_b = getUserAgentHeader(), name = _b[0], value = _b[1];
_a = getUserAgentHeader(), name = _a[0], value = _a[1];
headers[name] = value;

@@ -176,3 +182,3 @@ logger.log(ILogger_1.LogLevel.Trace, "(" + transportName + " transport) sending data. " + getDataDetail(content, logMessageContent) + ".");

content: content,
headers: __assign({}, headers, defaultHeaders),
headers: __assign(__assign({}, headers), defaultHeaders),
responseType: responseType,

@@ -198,3 +204,3 @@ withCredentials: withCredentials,

}
if (logger.log) {
if (logger.log !== undefined) {
return logger;

@@ -201,0 +207,0 @@ }

"use strict";
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -48,2 +52,3 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.WebSocketTransport = void 0;
var ILogger_1 = require("./ILogger");

@@ -97,3 +102,3 @@ var ITransport_1 = require("./ITransport");

webSocket = new _this.webSocketConstructor(url, undefined, {
headers: __assign({}, headers, _this.headers),
headers: __assign(__assign({}, headers), _this.headers),
});

@@ -100,0 +105,0 @@ }

@@ -5,5 +5,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -16,2 +19,3 @@ extendStatics(d, b);

Object.defineProperty(exports, "__esModule", { value: true });
exports.XhrHttpClient = void 0;
var Errors_1 = require("./Errors");

@@ -18,0 +22,0 @@ var HttpClient_1 = require("./HttpClient");

@@ -6,4 +6,4 @@ /** @private */

abort(): void;
readonly signal: AbortSignal;
readonly aborted: boolean;
get signal(): AbortSignal;
get aborted(): boolean;
}

@@ -10,0 +10,0 @@ /** Represents a signal that can be monitored to determine if a request has been aborted. */

@@ -25,3 +25,3 @@ // Copyright (c) .NET Foundation. All rights reserved.

},
enumerable: true,
enumerable: false,
configurable: true

@@ -33,3 +33,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -36,0 +36,0 @@ });

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -8,0 +11,0 @@ extendStatics(d, b);

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
// 0, 2, 10, 30 second delays before reconnect attempts.

@@ -8,3 +15,3 @@ var DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];

function DefaultReconnectPolicy(retryDelays) {
this.retryDelays = retryDelays !== undefined ? retryDelays.concat([null]) : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;
this.retryDelays = retryDelays !== undefined ? __spreadArrays(retryDelays, [null]) : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;
}

@@ -11,0 +18,0 @@ DefaultReconnectPolicy.prototype.nextRetryDelayInMilliseconds = function (retryContext) {

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -8,0 +11,0 @@ extendStatics(d, b);

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -13,15 +16,19 @@ extendStatics(d, b);

})();
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -28,0 +35,0 @@ });

@@ -27,3 +27,3 @@ // Copyright (c) .NET Foundation. All rights reserved.

var responseLength = separatorIndex + 1;
messageData = String.fromCharCode.apply(null, binaryData.slice(0, responseLength));
messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));
remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;

@@ -30,0 +30,0 @@ }

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};

@@ -29,9 +32,9 @@ /** Represents an HTTP response. */

HttpClient.prototype.get = function (url, options) {
return this.send(__assign({}, options, { method: "GET", url: url }));
return this.send(__assign(__assign({}, options), { method: "GET", url: url }));
};
HttpClient.prototype.post = function (url, options) {
return this.send(__assign({}, options, { method: "POST", url: url }));
return this.send(__assign(__assign({}, options), { method: "POST", url: url }));
};
HttpClient.prototype.delete = function (url, options) {
return this.send(__assign({}, options, { method: "DELETE", url: url }));
return this.send(__assign(__assign({}, options), { method: "DELETE", url: url }));
};

@@ -38,0 +41,0 @@ /** Gets all cookies that apply to the specified URL.

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -352,3 +356,3 @@ });

content: "",
headers: __assign({}, headers, this.options.headers),
headers: __assign(__assign({}, headers), this.options.headers),
withCredentials: this.options.withCredentials,

@@ -355,0 +359,0 @@ })];

@@ -54,14 +54,15 @@ import { IStreamResult } from "./Stream";

/** Indicates the state of the {@link HubConnection} to the server. */
readonly state: HubConnectionState;
get state(): HubConnectionState;
/** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either
* in the disconnected state or if the negotiation step was skipped.
*/
readonly connectionId: string | null;
get connectionId(): string | null;
/** Indicates the url of the {@link HubConnection} to the server. */
get baseUrl(): string;
/**
* Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or
* Reconnecting states.
* @param {string} url The url to connect to.
*/
baseUrl: string;
* Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or
* Reconnecting states.
* @param {string} url The url to connect to.
*/
set baseUrl(url: string);
/** Starts the connection.

@@ -68,0 +69,0 @@ *

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -99,3 +100,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -110,3 +111,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -133,3 +134,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -708,3 +709,3 @@ });

}
if (this.onreconnecting) {
if (this.reconnectingCallbacks.length !== 0) {
try {

@@ -744,3 +745,3 @@ this.reconnectingCallbacks.forEach(function (c) { return c.apply(_this, [error]); });

this.logger.log(LogLevel.Information, "HubConnection reconnected successfully.");
if (this.onreconnected) {
if (this.reconnectedCallbacks.length !== 0) {
try {

@@ -747,0 +748,0 @@ this.reconnectedCallbacks.forEach(function (c) { return c.apply(_this, [_this.connection.connectionId]); });

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};

@@ -67,6 +70,6 @@ import { DefaultReconnectPolicy } from "./DefaultReconnectPolicy";

if (typeof transportTypeOrOptions === "object") {
this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, transportTypeOrOptions);
this.httpConnectionOptions = __assign(__assign({}, this.httpConnectionOptions), transportTypeOrOptions);
}
else {
this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, { transport: transportTypeOrOptions });
this.httpConnectionOptions = __assign(__assign({}, this.httpConnectionOptions), { transport: transportTypeOrOptions });
}

@@ -73,0 +76,0 @@ return this;

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
export {};
//# sourceMappingURL=IConnection.js.map
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
export {};
//# sourceMappingURL=IHttpConnectionOptions.js.map
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
export {};
//# sourceMappingURL=IRetryPolicy.js.map

@@ -20,3 +20,3 @@ import { HttpClient } from "./HttpClient";

onclose: ((error?: Error) => void) | null;
readonly pollAborted: boolean;
get pollAborted(): boolean;
constructor(httpClient: HttpClient, accessTokenFactory: (() => string | Promise<string>) | undefined, logger: ILogger, logMessageContent: boolean, withCredentials: boolean, headers: MessageHeaders);

@@ -23,0 +23,0 @@ connect(url: string, transferFormat: TransferFormat): Promise<void>;

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -71,3 +75,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -77,3 +81,4 @@ });

return __awaiter(this, void 0, void 0, function () {
var _a, _b, name, value, headers, pollOptions, token, pollUrl, response;
var _a, name, value, headers, pollOptions, token, pollUrl, response;
var _b;
return __generator(this, function (_c) {

@@ -92,4 +97,4 @@ switch (_c.label) {

}
_b = getUserAgentHeader(), name = _b[0], value = _b[1];
headers = __assign((_a = {}, _a[name] = value, _a), this.headers);
_a = getUserAgentHeader(), name = _a[0], value = _a[1];
headers = __assign((_b = {}, _b[name] = value, _b), this.headers);
pollOptions = {

@@ -267,3 +272,3 @@ abortSignal: this.pollAbort.signal,

deleteOptions = {
headers: __assign({}, headers, this.headers),
headers: __assign(__assign({}, headers), this.headers),
withCredentials: this.withCredentials,

@@ -270,0 +275,0 @@ };

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
export {};
//# sourceMappingURL=Polyfills.js.map
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -100,3 +104,3 @@ });

headers[name_1] = value;
eventSource = new _this.eventSourceConstructor(url, { withCredentials: _this.withCredentials, headers: __assign({}, headers, _this.headers) });
eventSource = new _this.eventSourceConstructor(url, { withCredentials: _this.withCredentials, headers: __assign(__assign({}, headers), _this.headers) });
}

@@ -116,4 +120,5 @@ try {

};
// @ts-ignore: not using event on purpose
eventSource.onerror = function (e) {
var error = new Error(e.data || "Error occurred");
var error = new Error("Error occurred while starting EventSource");
if (opened) {

@@ -120,0 +125,0 @@ _this.close(error);

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
export {};
//# sourceMappingURL=Stream.js.map

@@ -16,5 +16,5 @@ import { HttpClient } from "./HttpClient";

export declare class Platform {
static readonly isBrowser: boolean;
static readonly isWebWorker: boolean;
static readonly isNode: boolean;
static get isBrowser(): boolean;
static get isWebWorker(): boolean;
static get isNode(): boolean;
}

@@ -21,0 +21,0 @@ /** @private */

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -50,3 +54,3 @@ });

/** The version of the SignalR client. */
export var VERSION = "6.0.0-preview.1.21103.6";
export var VERSION = "6.0.0-preview.2.21154.6";
/** @private */

@@ -83,3 +87,3 @@ var Arg = /** @class */ (function () {

},
enumerable: true,
enumerable: false,
configurable: true

@@ -91,3 +95,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -99,3 +103,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -146,3 +150,4 @@ });

return __awaiter(this, void 0, void 0, function () {
var _a, headers, token, _b, name, value, responseType, response;
var headers, token, _a, name, value, responseType, response;
var _b;
return __generator(this, function (_c) {

@@ -157,9 +162,9 @@ switch (_c.label) {

if (token) {
headers = (_a = {},
_a["Authorization"] = "Bearer " + token,
_a);
headers = (_b = {},
_b["Authorization"] = "Bearer " + token,
_b);
}
_c.label = 2;
case 2:
_b = getUserAgentHeader(), name = _b[0], value = _b[1];
_a = getUserAgentHeader(), name = _a[0], value = _a[1];
headers[name] = value;

@@ -170,3 +175,3 @@ logger.log(LogLevel.Trace, "(" + transportName + " transport) sending data. " + getDataDetail(content, logMessageContent) + ".");

content: content,
headers: __assign({}, headers, defaultHeaders),
headers: __assign(__assign({}, headers), defaultHeaders),
responseType: responseType,

@@ -191,3 +196,3 @@ withCredentials: withCredentials,

}
if (logger.log) {
if (logger.log !== undefined) {
return logger;

@@ -194,0 +199,0 @@ }

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -94,3 +98,3 @@ });

webSocket = new _this.webSocketConstructor(url, undefined, {
headers: __assign({}, headers, _this.headers),
headers: __assign(__assign({}, headers), _this.headers),
});

@@ -97,0 +101,0 @@ }

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -8,0 +11,0 @@ extendStatics(d, b);

{
"name": "@microsoft/signalr",
"version": "6.0.0-preview.1.21103.6",
"version": "6.0.0-preview.2.21154.6",
"description": "ASP.NET Core SignalR Client",

@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js",

@@ -42,3 +42,3 @@ // Copyright (c) .NET Foundation. All rights reserved.

const responseLength = separatorIndex + 1;
messageData = String.fromCharCode.apply(null, binaryData.slice(0, responseLength));
messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));
remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;

@@ -45,0 +45,0 @@ } else {

@@ -723,3 +723,3 @@ // Copyright (c) .NET Foundation. All rights reserved.

if (this.onreconnecting) {
if (this.reconnectingCallbacks.length !== 0) {
try {

@@ -757,3 +757,3 @@ this.reconnectingCallbacks.forEach((c) => c.apply(this, [error]));

if (this.onreconnected) {
if (this.reconnectedCallbacks.length !== 0) {
try {

@@ -760,0 +760,0 @@ this.reconnectedCallbacks.forEach((c) => c.apply(this, [this.connection.connectionId]));

@@ -91,4 +91,5 @@ // Copyright (c) .NET Foundation. All rights reserved.

eventSource.onerror = (e: MessageEvent) => {
const error = new Error(e.data || "Error occurred");
// @ts-ignore: not using event on purpose
eventSource.onerror = (e: Event) => {
const error = new Error("Error occurred while starting EventSource");
if (opened) {

@@ -95,0 +96,0 @@ this.close(error);

@@ -131,3 +131,3 @@ // Copyright (c) .NET Foundation. All rights reserved.

if ((logger as ILogger).log) {
if ((logger as ILogger).log !== undefined) {
return logger as ILogger;

@@ -134,0 +134,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc