Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rx-jupyter

Package Overview
Dependencies
Maintainers
4
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx-jupyter - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

test/contents-spec.js

8

lib/base.js

@@ -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

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