rx-jupyter
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -25,5 +25,7 @@ "use strict"; | ||
url: url, | ||
responseType: "json", | ||
headers: headers | ||
}, serverConfig, opts); | ||
responseType: "json" | ||
}, serverConfig, opts, { | ||
// Make sure we merge in the auth headers with user given headers | ||
headers: Object.assign({}, headers, opts.headers) | ||
}); | ||
@@ -30,0 +32,0 @@ delete settings.endpoint; |
@@ -23,2 +23,4 @@ "use strict"; | ||
var _url = require("url"); | ||
/** | ||
@@ -43,2 +45,4 @@ * Creates an AjaxObservable for listing running kernels. | ||
*/ | ||
function get(serverConfig, id) { | ||
@@ -111,9 +115,19 @@ return (0, _ajax.ajax)((0, _base.createAJAXSettings)(serverConfig, "/api/kernels/" + id)); | ||
function formWebSocketURL(serverConfig, id) { | ||
var url = serverConfig.endpoint + "/api/kernels/" + id + "/channels"; | ||
function formWebSocketURL(serverConfig, kernelID, sessionID) { | ||
var params = new _url.URLSearchParams(); | ||
if (serverConfig.token) { | ||
params.append("token", serverConfig.token); | ||
} | ||
if (sessionID) { | ||
params.append("session_id", sessionID); | ||
} | ||
var q = params.toString(); | ||
var url = serverConfig.endpoint + "/api/kernels/" + kernelID + "/channels?" + q; | ||
return url.replace(/^http(s)?/, "ws$1"); | ||
} | ||
function connect(serverConfig, id) { | ||
return (0, _webSocket.webSocket)(formWebSocketURL(serverConfig, id)); | ||
function connect(serverConfig, kernelID, sessionID) { | ||
return (0, _webSocket.webSocket)(formWebSocketURL(serverConfig, kernelID, sessionID)); | ||
} |
{ | ||
"name": "rx-jupyter", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "RxJS 5 bindings for the Jupyter Notebook API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -22,7 +22,10 @@ // @flow | ||
url, | ||
responseType: "json", | ||
headers | ||
responseType: "json" | ||
}, | ||
serverConfig, | ||
opts | ||
opts, | ||
{ | ||
// Make sure we merge in the auth headers with user given headers | ||
headers: Object.assign({}, headers, opts.headers) | ||
} | ||
); | ||
@@ -29,0 +32,0 @@ |
@@ -9,2 +9,4 @@ // @flow | ||
import { URLSearchParams } from "url"; | ||
/** | ||
@@ -106,9 +108,27 @@ * Creates an AjaxObservable for listing running kernels. | ||
export function formWebSocketURL(serverConfig: Object, id: string): string { | ||
const url = `${serverConfig.endpoint}/api/kernels/${id}/channels`; | ||
export function formWebSocketURL( | ||
serverConfig: Object, | ||
kernelID: string, | ||
sessionID: ?string | ||
): string { | ||
const params = new URLSearchParams(); | ||
if (serverConfig.token) { | ||
params.append("token", serverConfig.token); | ||
} | ||
if (sessionID) { | ||
params.append("session_id", sessionID); | ||
} | ||
const q = params.toString(); | ||
const url = `${serverConfig.endpoint}/api/kernels/${kernelID}/channels?${q}`; | ||
return url.replace(/^http(s)?/, "ws$1"); | ||
} | ||
export function connect(serverConfig: Object, id: string): Observable<*> { | ||
return webSocket(formWebSocketURL(serverConfig, id)); | ||
export function connect( | ||
serverConfig: Object, | ||
kernelID: string, | ||
sessionID: ?string | ||
): Observable<*> { | ||
return webSocket(formWebSocketURL(serverConfig, kernelID, sessionID)); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
73294
29
1513
0