@microsoft/signalr
Advanced tools
Comparing version 3.0.0-preview7.19365.7 to 3.0.0-preview8.19405.7
@@ -237,3 +237,2 @@ "use strict"; | ||
var url, negotiateResponse, redirects, _loop_1, this_1, e_4; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
@@ -253,3 +252,3 @@ switch (_a.label) { | ||
// No fallback or negotiate in this case. | ||
return [4 /*yield*/, this.transport.connect(url, transferFormat)]; | ||
return [4 /*yield*/, this.startTransport(url, transferFormat)]; | ||
case 2: | ||
@@ -316,4 +315,2 @@ // We should just call connect directly in this case. | ||
} | ||
this.transport.onreceive = this.onreceive; | ||
this.transport.onclose = function (e) { return _this.stopConnection(e); }; | ||
if (this.connectionState === "Connecting " /* Connecting */) { | ||
@@ -394,3 +391,3 @@ // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise. | ||
this.transport = requestedTransport; | ||
return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; | ||
return [4 /*yield*/, this.startTransport(connectUrl, requestedTransferFormat)]; | ||
case 1: | ||
@@ -431,3 +428,3 @@ _a.sent(); | ||
_a.trys.push([9, 11, , 12]); | ||
return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; | ||
return [4 /*yield*/, this.startTransport(connectUrl, requestedTransferFormat)]; | ||
case 10: | ||
@@ -477,2 +474,8 @@ _a.sent(); | ||
}; | ||
HttpConnection.prototype.startTransport = function (url, transferFormat) { | ||
var _this = this; | ||
this.transport.onreceive = this.onreceive; | ||
this.transport.onclose = function (e) { return _this.stopConnection(e); }; | ||
return this.transport.connect(url, transferFormat); | ||
}; | ||
HttpConnection.prototype.resolveTransportOrError = function (endpoint, requestedTransport, requestedTransferFormat) { | ||
@@ -479,0 +482,0 @@ var transport = ITransport_1.HttpTransportType[endpoint.transport]; |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** The version of the SignalR client. */ | ||
exports.VERSION = "3.0.0-preview7.19365.7"; | ||
exports.VERSION = "3.0.0-preview8.19405.7"; | ||
var Errors_1 = require("./Errors"); | ||
@@ -10,0 +10,0 @@ exports.AbortError = Errors_1.AbortError; |
@@ -104,2 +104,5 @@ "use strict"; | ||
} | ||
else { | ||
error = new Error("There was an error with the transport."); | ||
} | ||
reject(error); | ||
@@ -106,0 +109,0 @@ }; |
@@ -47,2 +47,3 @@ import { IConnection } from "./IConnection"; | ||
private constructTransport; | ||
private startTransport; | ||
private resolveTransportOrError; | ||
@@ -49,0 +50,0 @@ private isITransport; |
@@ -235,3 +235,2 @@ // Copyright (c) .NET Foundation. All rights reserved. | ||
var url, negotiateResponse, redirects, _loop_1, this_1, e_4; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
@@ -251,3 +250,3 @@ switch (_a.label) { | ||
// No fallback or negotiate in this case. | ||
return [4 /*yield*/, this.transport.connect(url, transferFormat)]; | ||
return [4 /*yield*/, this.startTransport(url, transferFormat)]; | ||
case 2: | ||
@@ -314,4 +313,2 @@ // We should just call connect directly in this case. | ||
} | ||
this.transport.onreceive = this.onreceive; | ||
this.transport.onclose = function (e) { return _this.stopConnection(e); }; | ||
if (this.connectionState === "Connecting " /* Connecting */) { | ||
@@ -392,3 +389,3 @@ // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise. | ||
this.transport = requestedTransport; | ||
return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; | ||
return [4 /*yield*/, this.startTransport(connectUrl, requestedTransferFormat)]; | ||
case 1: | ||
@@ -429,3 +426,3 @@ _a.sent(); | ||
_a.trys.push([9, 11, , 12]); | ||
return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; | ||
return [4 /*yield*/, this.startTransport(connectUrl, requestedTransferFormat)]; | ||
case 10: | ||
@@ -475,2 +472,8 @@ _a.sent(); | ||
}; | ||
HttpConnection.prototype.startTransport = function (url, transferFormat) { | ||
var _this = this; | ||
this.transport.onreceive = this.onreceive; | ||
this.transport.onclose = function (e) { return _this.stopConnection(e); }; | ||
return this.transport.connect(url, transferFormat); | ||
}; | ||
HttpConnection.prototype.resolveTransportOrError = function (endpoint, requestedTransport, requestedTransferFormat) { | ||
@@ -477,0 +480,0 @@ var transport = HttpTransportType[endpoint.transport]; |
@@ -5,3 +5,3 @@ // Copyright (c) .NET Foundation. All rights reserved. | ||
/** The version of the SignalR client. */ | ||
export var VERSION = "3.0.0-preview7.19365.7"; | ||
export var VERSION = "3.0.0-preview8.19405.7"; | ||
export { AbortError, HttpError, TimeoutError } from "./Errors"; | ||
@@ -8,0 +8,0 @@ export { HttpClient, HttpResponse } from "./HttpClient"; |
@@ -102,2 +102,5 @@ // Copyright (c) .NET Foundation. All rights reserved. | ||
} | ||
else { | ||
error = new Error("There was an error with the transport."); | ||
} | ||
reject(error); | ||
@@ -104,0 +107,0 @@ }; |
{ | ||
"name": "@microsoft/signalr", | ||
"version": "3.0.0-preview7.19365.7", | ||
"version": "3.0.0-preview8.19405.7", | ||
"description": "ASP.NET Core SignalR Client", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
@@ -233,3 +233,3 @@ // Copyright (c) .NET Foundation. All rights reserved. | ||
// No fallback or negotiate in this case. | ||
await this.transport!.connect(url, transferFormat); | ||
await this.startTransport(url, transferFormat); | ||
} else { | ||
@@ -285,5 +285,2 @@ throw new Error("Negotiation can only be skipped when using the WebSocket transport directly."); | ||
this.transport!.onreceive = this.onreceive; | ||
this.transport!.onclose = (e) => this.stopConnection(e); | ||
if (this.connectionState === ConnectionState.Connecting) { | ||
@@ -349,3 +346,3 @@ // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise. | ||
this.transport = requestedTransport; | ||
await this.transport.connect(connectUrl, requestedTransferFormat); | ||
await this.startTransport(connectUrl, requestedTransferFormat); | ||
@@ -373,3 +370,3 @@ return; | ||
try { | ||
await this.transport!.connect(connectUrl, requestedTransferFormat); | ||
await this.startTransport(connectUrl, requestedTransferFormat); | ||
return; | ||
@@ -415,2 +412,8 @@ } catch (ex) { | ||
private startTransport(url: string, transferFormat: TransferFormat): Promise<void> { | ||
this.transport!.onreceive = this.onreceive; | ||
this.transport!.onclose = (e) => this.stopConnection(e); | ||
return this.transport!.connect(url, transferFormat); | ||
} | ||
private resolveTransportOrError(endpoint: IAvailableTransport, requestedTransport: HttpTransportType | undefined, requestedTransferFormat: TransferFormat): ITransport | Error { | ||
@@ -417,0 +420,0 @@ const transport = HttpTransportType[endpoint.transport]; |
@@ -83,3 +83,6 @@ // Copyright (c) .NET Foundation. All rights reserved. | ||
error = event.error; | ||
} else { | ||
error = new Error("There was an error with the transport."); | ||
} | ||
reject(error); | ||
@@ -86,0 +89,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 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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2454546
20787
9