Socket
Socket
Sign inDemoInstall

@jupyterlab/services

Package Overview
Dependencies
Maintainers
4
Versions
387
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jupyterlab/services - npm Package Compare versions

Comparing version 0.40.3 to 0.41.0

1

lib/config/index.js
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var utils = require("../utils");

@@ -5,0 +6,0 @@ /**

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var signaling_1 = require("@phosphor/signaling");

@@ -5,0 +6,0 @@ var utils = require("../utils");

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -5,0 +6,0 @@ * Validate a property as being on an object, and optionally

1

lib/index.d.ts

@@ -7,3 +7,2 @@ import { Token } from '@phosphor/coreutils';

export * from './manager';
export * from './nbformat';
export * from './session';

@@ -10,0 +9,0 @@ export * from './terminal';

@@ -7,2 +7,3 @@ // Copyright (c) Jupyter Development Team.

}
Object.defineProperty(exports, "__esModule", { value: true });
var coreutils_1 = require("@phosphor/coreutils");

@@ -13,3 +14,2 @@ __export(require("./config"));

__export(require("./manager"));
__export(require("./nbformat"));
__export(require("./session"));

@@ -16,0 +16,0 @@ __export(require("./terminal"));

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
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]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var disposable_1 = require("@phosphor/disposable");

@@ -10,0 +16,0 @@ var messages_1 = require("./messages");

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var algorithm_1 = require("@phosphor/algorithm");

@@ -395,2 +396,3 @@ var coreutils_1 = require("@phosphor/coreutils");

DefaultKernel.prototype.shutdown = function () {
var _this = this;
if (this.status === 'dead') {

@@ -400,3 +402,5 @@ return Promise.reject(new Error('Kernel is dead'));

this._clearState();
return Private.shutdownKernel(this.id, this._baseUrl, this.ajaxSettings);
return this.ready.then(function () {
return Private.shutdownKernel(_this.id, _this._baseUrl, _this.ajaxSettings);
});
};

@@ -403,0 +407,0 @@ /**

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
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]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var disposable_1 = require("@phosphor/disposable");

@@ -10,0 +16,0 @@ var messages_1 = require("./messages");

@@ -7,4 +7,5 @@ // Copyright (c) Jupyter Development Team.

}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./kernel"));
__export(require("./manager"));
__export(require("./messages"));

@@ -12,3 +12,3 @@ import { IIterator } from '@phosphor/algorithm';

/**
* Interface of a Kernel object.
* Interface of a Kernel connection that is managed by a session.
*

@@ -22,20 +22,4 @@ * #### Notes

*/
interface IKernel extends IDisposable {
interface IKernelConnection extends IDisposable {
/**
* A signal emitted when the kernel is shut down.
*/
terminated: ISignal<this, void>;
/**
* A signal emitted when the kernel status changes.
*/
statusChanged: ISignal<this, Kernel.Status>;
/**
* A signal emitted for iopub kernel messages.
*/
iopubMessage: ISignal<this, KernelMessage.IIOPubMessage>;
/**
* A signal emitted for unhandled kernel message.
*/
unhandledMessage: ISignal<this, KernelMessage.IMessage>;
/**
* The id of the server-side kernel.

@@ -61,10 +45,2 @@ */

/**
* The base url of the kernel.
*/
readonly baseUrl: string;
/**
* The Ajax settings used for server requests.
*/
ajaxSettings: IAjaxSettings;
/**
* The current status of the kernel.

@@ -122,2 +98,13 @@ */

/**
* Reconnect to a disconnected kernel.
*
* @returns A promise that resolves when the kernel has reconnected.
*
* #### Notes
* This is not actually a standard HTTP request, but useful function
* nonetheless for reconnecting to the kernel if the connection is somehow
* lost.
*/
reconnect(): Promise<void>;
/**
* Interrupt a kernel.

@@ -155,31 +142,2 @@ *

/**
* Reconnect to a disconnected kernel.
*
* @returns A promise that resolves when the kernel has reconnected.
*
* #### Notes
* This is not actually a standard HTTP request, but useful function
* nonetheless for reconnecting to the kernel if the connection is somehow
* lost.
*/
reconnect(): Promise<void>;
/**
* Shutdown a kernel.
*
* @returns A promise that resolves when the kernel has shut down.
*
* #### Notes
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels).
*
* On a valid response, closes the websocket and disposes of the kernel
* object, and fulfills the promise.
*
* The promise will be rejected if the kernel status is `'dead'` or if the
* request fails or the response is invalid.
*
* If the server call is successful, the [[terminated]] signal will be
* emitted.
*/
shutdown(): Promise<void>;
/**
* Send a `kernel_info_request` message.

@@ -345,2 +303,49 @@ *

/**
* The full interface of a kernel.
*/
interface IKernel extends IKernelConnection {
/**
* A signal emitted when the kernel is shut down.
*/
terminated: ISignal<this, void>;
/**
* A signal emitted when the kernel status changes.
*/
statusChanged: ISignal<this, Kernel.Status>;
/**
* A signal emitted for iopub kernel messages.
*/
iopubMessage: ISignal<this, KernelMessage.IIOPubMessage>;
/**
* A signal emitted for unhandled kernel message.
*/
unhandledMessage: ISignal<this, KernelMessage.IMessage>;
/**
* The base url of the kernel.
*/
readonly baseUrl: string;
/**
* The Ajax settings used for server requests.
*/
ajaxSettings: IAjaxSettings;
/**
* Shutdown a kernel.
*
* @returns A promise that resolves when the kernel has shut down.
*
* #### Notes
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/kernels).
*
* On a valid response, closes the websocket and disposes of the kernel
* object, and fulfills the promise.
*
* The promise will be rejected if the kernel status is `'dead'` or if the
* request fails or the response is invalid.
*
* If the server call is successful, the [[terminated]] signal will be
* emitted.
*/
shutdown(): Promise<void>;
}
/**
* Find a kernel by id.

@@ -408,2 +413,4 @@ *

/**
* The interface of a kernel
/**
* The options object used to initialize a kernel.

@@ -410,0 +417,0 @@ */

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var default_1 = require("./default");

@@ -5,0 +6,0 @@ /**

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var algorithm_1 = require("@phosphor/algorithm");

@@ -5,0 +6,0 @@ var coreutils_1 = require("@phosphor/coreutils");

@@ -0,3 +1,3 @@

import { nbformat } from '@jupyterlab/coreutils';
import { JSONObject, JSONValue } from '@phosphor/coreutils';
import { nbformat } from '../nbformat';
import { Kernel } from './kernel';

@@ -4,0 +4,0 @@ /**

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var utils = require("../utils");

@@ -5,0 +6,0 @@ /**

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -59,4 +60,4 @@ * Deserialize and return the unpacked message.

var start = offsets[i];
var stop = offsets[i + 1] || buf.byteLength;
msg.buffers.push(new DataView(buf.slice(start, stop)));
var stop_1 = offsets[i + 1] || buf.byteLength;
msg.buffers.push(new DataView(buf.slice(start, stop_1)));
}

@@ -63,0 +64,0 @@ return msg;

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -5,0 +6,0 @@ * Required fields for `IKernelHeader`.

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var signaling_1 = require("@phosphor/signaling");

@@ -5,0 +6,0 @@ var contents_1 = require("./contents");

@@ -22,3 +22,3 @@ import { ISignal, Signal } from '@phosphor/signaling';

*/
readonly kernelChanged: ISignal<this, Kernel.IKernel>;
readonly kernelChanged: ISignal<this, Kernel.IKernelConnection>;
/**

@@ -52,3 +52,3 @@ * A signal emitted when the kernel status changes.

*/
readonly kernel: Kernel.IKernel;
readonly kernel: Kernel.IKernelConnection;
/**

@@ -115,3 +115,3 @@ * Get the session path.

*/
changeKernel(options: Kernel.IModel): Promise<Kernel.IKernel>;
changeKernel(options: Kernel.IModel): Promise<Kernel.IKernelConnection>;
/**

@@ -118,0 +118,0 @@ * Kill the kernel and shutdown the session.

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var algorithm_1 = require("@phosphor/algorithm");

@@ -284,7 +285,10 @@ var signaling_1 = require("@phosphor/signaling");

}
this._kernel.dispose();
var data = JSON.stringify({ kernel: options });
return this._patch(data).then(function () {
return _this.kernel;
});
if (this._kernel) {
return this._kernel.ready.then(function () {
_this._kernel.dispose();
return _this._patch(data);
}).then(function () { return _this.kernel; });
}
return this._patch(data).then(function () { return _this.kernel; });
};

@@ -301,5 +305,11 @@ /**

DefaultSession.prototype.shutdown = function () {
var _this = this;
if (this.isDisposed) {
return Promise.reject(new Error('Session is disposed'));
}
if (this._kernel) {
return this._kernel.ready.then(function () {
return Private.shutdownSession(_this.id, _this._baseUrl, _this.ajaxSettings);
});
}
return Private.shutdownSession(this.id, this._baseUrl, this.ajaxSettings);

@@ -306,0 +316,0 @@ };

@@ -7,3 +7,4 @@ // Copyright (c) Jupyter Development Team.

}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./manager"));
__export(require("./session"));
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var algorithm_1 = require("@phosphor/algorithm");

@@ -5,0 +6,0 @@ var coreutils_1 = require("@phosphor/coreutils");

@@ -22,3 +22,3 @@ import { IIterator } from '@phosphor/algorithm';

*/
kernelChanged: ISignal<ISession, Kernel.IKernel>;
kernelChanged: ISignal<ISession, Kernel.IKernelConnection>;
/**

@@ -61,6 +61,4 @@ * A signal emitted when the session status changes.

* This is a read-only property, and can be altered by [changeKernel].
* Use the [statusChanged] and [unhandledMessage] signals on the session
* instead of the ones on the kernel.
*/
readonly kernel: Kernel.IKernel;
readonly kernel: Kernel.IKernelConnection;
/**

@@ -67,0 +65,0 @@ * The current status of the session.

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var default_1 = require("./default");

@@ -5,0 +6,0 @@ /**

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var validate_1 = require("../kernel/validate");

@@ -5,0 +6,0 @@ /**

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var algorithm_1 = require("@phosphor/algorithm");

@@ -272,9 +273,6 @@ var signaling_1 = require("@phosphor/signaling");

*
* Otherwise, if `options` are given, we attempt to connect to the existing
* session.
* The promise is fulfilled when the session is ready on the server,
* otherwise the promise is rejected.
* Otherwise, if `options` are given, we resolve the promise after
* confirming that the session exists on the server.
*
* If the session was not already started and no `options` are given,
* the promise is rejected.
* If the session does not exist on the server, the promise is rejected.
*/

@@ -291,4 +289,12 @@ function connectTo(name, options) {

}
var session = new DefaultTerminalSession(name, options);
return Promise.resolve(session);
return listRunning(options).then(function (models) {
var index = algorithm_1.ArrayExt.findFirstIndex(models, function (model) {
return model.name === name;
});
if (index !== -1) {
var session = new DefaultTerminalSession(name, options);
return Promise.resolve(session);
}
return Promise.reject('Could not find session');
});
}

@@ -295,0 +301,0 @@ DefaultTerminalSession.connectTo = connectTo;

@@ -7,3 +7,4 @@ // Copyright (c) Jupyter Development Team.

}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./manager"));
__export(require("./terminal"));
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var algorithm_1 = require("@phosphor/algorithm");

@@ -5,0 +6,0 @@ var coreutils_1 = require("@phosphor/coreutils");

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var default_1 = require("./default");

@@ -41,9 +42,6 @@ /**

*
* Otherwise, if `options` are given, we attempt to connect to the existing
* session.
* The promise is fulfilled when the session is ready on the server,
* otherwise the promise is rejected.
* Otherwise, if `options` are given, we resolve the promise after
* confirming that the session exists on the server.
*
* If the session was not already started and no `options` are given,
* the promise is rejected.
* If the session does not exist on the server, the promise is rejected.
*/

@@ -50,0 +48,0 @@ function connectTo(name, options) {

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
var minimist = require("minimist");

@@ -170,2 +171,3 @@ var path = require("path-posix");

catch (err) {
// no-op
}

@@ -172,0 +174,0 @@ resolve({ xhr: xhr, ajaxSettings: ajaxSettings, data: data, event: event });

{
"name": "@jupyterlab/services",
"version": "0.40.3",
"version": "0.41.0",
"description": "Client APIs for the Jupyter services REST APIs",

@@ -8,6 +8,7 @@ "main": "lib/index.js",

"dependencies": {
"@phosphor/algorithm": "^0.1.0",
"@phosphor/coreutils": "^0.1.5",
"@phosphor/disposable": "^0.1.0",
"@phosphor/signaling": "^0.1.1",
"@jupyterlab/coreutils": "^0.2.0",
"@phosphor/algorithm": "^1.0.0",
"@phosphor/coreutils": "^1.0.0",
"@phosphor/disposable": "^1.0.0",
"@phosphor/signaling": "^1.0.0",
"@types/minimist": "^1.2.0",

@@ -21,12 +22,12 @@ "@types/text-encoding": "0.0.30",

"@types/expect.js": "^0.3.29",
"@types/mocha": "^2.2.39",
"@types/mocha": "^2.2.32",
"@types/ws": "0.0.39",
"expect.js": "^0.3.1",
"istanbul": "^0.3.18",
"mocha": "^2.2.5",
"rimraf": "^2.4.2",
"mocha": "^3.2.0",
"rimraf": "^2.5.2",
"text-encoding": "^0.5.2",
"typedoc": "^0.5.7",
"typescript": "~2.1.6",
"webpack": "^1.13.1",
"typedoc": "^0.5.0",
"typescript": "^2.2.1",
"webpack": "^2.2.1",
"ws": "^1.0.1",

@@ -39,3 +40,3 @@ "xmlhttprequest": "^1.8.0"

"build:test": "tsc --project test/src",
"build": "npm run build:src && npm run build:test",
"build": "npm run build:src",
"example:browser": "cd examples/browser && npm run update && npm run build",

@@ -45,3 +46,2 @@ "example:node": "cd examples/node && npm install",

"docs": "typedoc --options typedoc.json src",
"prepublish": "npm run build && webpack",
"test:coverage": "istanbul cover --dir test/coverage _mocha -- --retries 3 test/build/**/*.spec.js --foo bar --terminalsAvailable True",

@@ -55,3 +55,3 @@ "test:integration": "cd test && python integration_test.py",

"type": "git",
"url": "https://github.com/jupyter/jupyter-js-services"
"url": "https://github.com/jupyterlab/jupyterlab"
},

@@ -74,5 +74,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/jupyterlab/services/issues"
"url": "https://github.com/jupyterlab/jupyterlab/issues"
},
"homepage": "https://github.com/jupyterlab/services"
"homepage": "https://github.com/jupyterlab/jupyterlab"
}
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