@difizen/libro-kernel 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/basemanager.js +2 -2
- package/es/contents/contents-drive.js +22 -12
- package/es/contents/contents-manager.js +2 -2
- package/es/kernel/comm.js +2 -2
- package/es/kernel/future.js +6 -5
- package/es/kernel/kernel-connection.js +18 -11
- package/es/kernel/libro-kernel-manager.js +8 -8
- package/es/kernel/libro-kernel-protocol.js +2 -2
- package/es/kernel/libro-kernel.js +2 -2
- package/es/kernel/messages.js +56 -0
- package/es/kernel/restapi.js +14 -9
- package/es/kernel/serialize.js +0 -1
- package/es/kernelspec/manager.js +6 -6
- package/es/kernelspec/restapi.js +4 -4
- package/es/kernelspec/validate.js +2 -1
- package/es/libro-kernel-connection-manager.js +2 -2
- package/es/page-config.js +2 -2
- package/es/server/connection-error.js +2 -2
- package/es/server/server-connection.js +2 -2
- package/es/server/server-manager.js +2 -2
- package/es/session/libro-session-manager.js +10 -9
- package/es/session/libro-session.js +2 -2
- package/es/session/restapi.js +6 -5
- package/es/session/validate.js +2 -1
- package/package.json +3 -3
package/es/basemanager.js
CHANGED
|
@@ -3,8 +3,8 @@ var _dec, _class;
|
|
|
3
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
4
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
-
function _toPropertyKey(
|
|
7
|
-
function _toPrimitive(
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
8
|
import { Emitter } from '@difizen/mana-app';
|
|
9
9
|
import { singleton } from '@difizen/mana-app';
|
|
10
10
|
|
|
@@ -16,8 +16,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
|
|
|
16
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
17
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
18
18
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
-
function _toPropertyKey(
|
|
20
|
-
function _toPrimitive(
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
20
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
21
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
22
22
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
23
23
|
import { URL as URLUtil } from '@difizen/libro-common';
|
|
@@ -115,7 +115,7 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
115
115
|
*/
|
|
116
116
|
}, {
|
|
117
117
|
key: "get",
|
|
118
|
-
value: function () {
|
|
118
|
+
value: (function () {
|
|
119
119
|
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(localPath, options) {
|
|
120
120
|
var url, settings, content, params, response, err, data;
|
|
121
121
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -178,6 +178,7 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
178
178
|
*
|
|
179
179
|
* The returned URL may include a query parameter.
|
|
180
180
|
*/
|
|
181
|
+
)
|
|
181
182
|
}, {
|
|
182
183
|
key: "getDownloadUrl",
|
|
183
184
|
value: function getDownloadUrl(localPath, options) {
|
|
@@ -205,7 +206,7 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
205
206
|
*/
|
|
206
207
|
}, {
|
|
207
208
|
key: "newUntitled",
|
|
208
|
-
value: function () {
|
|
209
|
+
value: (function () {
|
|
209
210
|
var _newUntitled = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
210
211
|
var _options$path;
|
|
211
212
|
var options,
|
|
@@ -283,9 +284,10 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
283
284
|
* #### Notes
|
|
284
285
|
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents).
|
|
285
286
|
*/
|
|
287
|
+
)
|
|
286
288
|
}, {
|
|
287
289
|
key: "delete",
|
|
288
|
-
value: function () {
|
|
290
|
+
value: (function () {
|
|
289
291
|
var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(localPath, options) {
|
|
290
292
|
var url, init, settings, response, err;
|
|
291
293
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
@@ -341,9 +343,10 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
341
343
|
* #### Notes
|
|
342
344
|
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.
|
|
343
345
|
*/
|
|
346
|
+
)
|
|
344
347
|
}, {
|
|
345
348
|
key: "rename",
|
|
346
|
-
value: function () {
|
|
349
|
+
value: (function () {
|
|
347
350
|
var _rename = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(oldLocalPath, newLocalPath, options) {
|
|
348
351
|
var url, init, settings, response, err, data;
|
|
349
352
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
@@ -410,9 +413,10 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
410
413
|
*
|
|
411
414
|
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.
|
|
412
415
|
*/
|
|
416
|
+
)
|
|
413
417
|
}, {
|
|
414
418
|
key: "save",
|
|
415
|
-
value: function () {
|
|
419
|
+
value: (function () {
|
|
416
420
|
var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(localPath) {
|
|
417
421
|
var options,
|
|
418
422
|
url,
|
|
@@ -488,9 +492,10 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
488
492
|
*
|
|
489
493
|
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.
|
|
490
494
|
*/
|
|
495
|
+
)
|
|
491
496
|
}, {
|
|
492
497
|
key: "copy",
|
|
493
|
-
value: function () {
|
|
498
|
+
value: (function () {
|
|
494
499
|
var _copy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(fromFile, toDir, options) {
|
|
495
500
|
var url, init, settings, response, err, data;
|
|
496
501
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
@@ -551,9 +556,10 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
551
556
|
* #### Notes
|
|
552
557
|
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.
|
|
553
558
|
*/
|
|
559
|
+
)
|
|
554
560
|
}, {
|
|
555
561
|
key: "createCheckpoint",
|
|
556
|
-
value: function () {
|
|
562
|
+
value: (function () {
|
|
557
563
|
var _createCheckpoint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(localPath, options) {
|
|
558
564
|
var url, init, settings, response, err, data;
|
|
559
565
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
@@ -606,9 +612,10 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
606
612
|
* #### Notes
|
|
607
613
|
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents) and validates the response model.
|
|
608
614
|
*/
|
|
615
|
+
)
|
|
609
616
|
}, {
|
|
610
617
|
key: "listCheckpoints",
|
|
611
|
-
value: function () {
|
|
618
|
+
value: (function () {
|
|
612
619
|
var _listCheckpoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(localPath, options) {
|
|
613
620
|
var url, settings, response, err, data, i;
|
|
614
621
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
@@ -667,9 +674,10 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
667
674
|
* #### Notes
|
|
668
675
|
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents).
|
|
669
676
|
*/
|
|
677
|
+
)
|
|
670
678
|
}, {
|
|
671
679
|
key: "restoreCheckpoint",
|
|
672
|
-
value: function () {
|
|
680
|
+
value: (function () {
|
|
673
681
|
var _restoreCheckpoint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(localPath, checkpointID, options) {
|
|
674
682
|
var url, settings, init, response, err;
|
|
675
683
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
@@ -716,9 +724,10 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
716
724
|
* #### Notes
|
|
717
725
|
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents).
|
|
718
726
|
*/
|
|
727
|
+
)
|
|
719
728
|
}, {
|
|
720
729
|
key: "deleteCheckpoint",
|
|
721
|
-
value: function () {
|
|
730
|
+
value: (function () {
|
|
722
731
|
var _deleteCheckpoint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(localPath, checkpointID, options) {
|
|
723
732
|
var url, init, settings, response, err;
|
|
724
733
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
@@ -756,6 +765,7 @@ export var Drive = (_dec = singleton(), _dec2 = inject(ServerConnection), _dec(_
|
|
|
756
765
|
/**
|
|
757
766
|
* Get a REST url for a file given a path.
|
|
758
767
|
*/
|
|
768
|
+
)
|
|
759
769
|
}, {
|
|
760
770
|
key: "getUrl",
|
|
761
771
|
value: function getUrl(base) {
|
|
@@ -17,8 +17,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
17
17
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
18
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
19
19
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
|
-
function _toPropertyKey(
|
|
21
|
-
function _toPrimitive(
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
22
22
|
import { PathExt } from '@difizen/libro-common';
|
|
23
23
|
import { inject, singleton } from '@difizen/mana-app';
|
|
24
24
|
import { Emitter } from '@difizen/mana-app';
|
package/es/kernel/comm.js
CHANGED
|
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
3
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _toPropertyKey(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import * as KernelMessage from "./messages.js";
|
|
8
8
|
|
|
9
9
|
/**
|
package/es/kernel/future.js
CHANGED
|
@@ -12,8 +12,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
12
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
13
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
14
14
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
|
-
function _toPropertyKey(
|
|
16
|
-
function _toPrimitive(
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
import { Deferred } from '@difizen/mana-app';
|
|
18
18
|
import { isStatusMsg } from "./libro-kernel-utils.js";
|
|
19
19
|
var Private;
|
|
@@ -84,7 +84,7 @@ var Private;
|
|
|
84
84
|
*/
|
|
85
85
|
}, {
|
|
86
86
|
key: "process",
|
|
87
|
-
value: function () {
|
|
87
|
+
value: (function () {
|
|
88
88
|
var _process = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(msg) {
|
|
89
89
|
var processing, continueHandling, i, hook;
|
|
90
90
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
@@ -150,6 +150,7 @@ var Private;
|
|
|
150
150
|
/**
|
|
151
151
|
* Schedule a cleanup of the list, removing any hooks that have been nulled out.
|
|
152
152
|
*/
|
|
153
|
+
)
|
|
153
154
|
}, {
|
|
154
155
|
key: "_scheduleCompact",
|
|
155
156
|
value: function _scheduleCompact() {
|
|
@@ -396,7 +397,7 @@ export var KernelFutureHandler = /*#__PURE__*/function () {
|
|
|
396
397
|
*/
|
|
397
398
|
}, {
|
|
398
399
|
key: "handleMsg",
|
|
399
|
-
value: function () {
|
|
400
|
+
value: (function () {
|
|
400
401
|
var _handleMsg = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(msg) {
|
|
401
402
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
402
403
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -435,7 +436,7 @@ export var KernelFutureHandler = /*#__PURE__*/function () {
|
|
|
435
436
|
return _handleMsg.apply(this, arguments);
|
|
436
437
|
}
|
|
437
438
|
return handleMsg;
|
|
438
|
-
}()
|
|
439
|
+
}())
|
|
439
440
|
}, {
|
|
440
441
|
key: "_handleReply",
|
|
441
442
|
value: function () {
|
|
@@ -10,8 +10,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
|
|
|
10
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
11
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
16
16
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
17
17
|
import { deepCopy, URL } from '@difizen/libro-common';
|
|
@@ -779,7 +779,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
779
779
|
*/
|
|
780
780
|
}, {
|
|
781
781
|
key: "interrupt",
|
|
782
|
-
value: function () {
|
|
782
|
+
value: (function () {
|
|
783
783
|
var _interrupt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
784
784
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
785
785
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -821,9 +821,10 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
821
821
|
* The promise will be rejected if the request fails or the response is
|
|
822
822
|
* invalid.
|
|
823
823
|
*/
|
|
824
|
+
)
|
|
824
825
|
}, {
|
|
825
826
|
key: "restart",
|
|
826
|
-
value: function () {
|
|
827
|
+
value: (function () {
|
|
827
828
|
var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
828
829
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
829
830
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -862,6 +863,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
862
863
|
* This may try multiple times to reconnect to a kernel, and will sever any
|
|
863
864
|
* existing connection.
|
|
864
865
|
*/
|
|
866
|
+
)
|
|
865
867
|
}, {
|
|
866
868
|
key: "reconnect",
|
|
867
869
|
value: function reconnect() {
|
|
@@ -915,7 +917,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
915
917
|
*/
|
|
916
918
|
}, {
|
|
917
919
|
key: "shutdown",
|
|
918
|
-
value: function () {
|
|
920
|
+
value: (function () {
|
|
919
921
|
var _shutdown = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
920
922
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
921
923
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -947,6 +949,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
947
949
|
* kernel is dead (for example, we cannot find the kernel model on the
|
|
948
950
|
* server).
|
|
949
951
|
*/
|
|
952
|
+
)
|
|
950
953
|
}, {
|
|
951
954
|
key: "handleShutdown",
|
|
952
955
|
value: function handleShutdown() {
|
|
@@ -965,7 +968,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
965
968
|
*/
|
|
966
969
|
}, {
|
|
967
970
|
key: "requestKernelInfo",
|
|
968
|
-
value: function () {
|
|
971
|
+
value: (function () {
|
|
969
972
|
var _requestKernelInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
970
973
|
var msg, reply;
|
|
971
974
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
@@ -1039,6 +1042,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
1039
1042
|
* Fulfills with the `complete_reply` content when the shell reply is
|
|
1040
1043
|
* received and validated.
|
|
1041
1044
|
*/
|
|
1045
|
+
)
|
|
1042
1046
|
}, {
|
|
1043
1047
|
key: "requestComplete",
|
|
1044
1048
|
value: function requestComplete(content) {
|
|
@@ -1374,7 +1378,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
1374
1378
|
*/
|
|
1375
1379
|
}, {
|
|
1376
1380
|
key: "_handleDisplayId",
|
|
1377
|
-
value: function () {
|
|
1381
|
+
value: (function () {
|
|
1378
1382
|
var _handleDisplayId2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(displayId, msg) {
|
|
1379
1383
|
var _this5 = this,
|
|
1380
1384
|
_this$_displayIdToPar,
|
|
@@ -1458,7 +1462,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
1458
1462
|
return _handleDisplayId2.apply(this, arguments);
|
|
1459
1463
|
}
|
|
1460
1464
|
return _handleDisplayId;
|
|
1461
|
-
}()
|
|
1465
|
+
}())
|
|
1462
1466
|
}, {
|
|
1463
1467
|
key: "_updateStatus",
|
|
1464
1468
|
value:
|
|
@@ -1540,7 +1544,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
1540
1544
|
*/
|
|
1541
1545
|
}, {
|
|
1542
1546
|
key: "_handleCommOpen",
|
|
1543
|
-
value: function () {
|
|
1547
|
+
value: (function () {
|
|
1544
1548
|
var _handleCommOpen2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(msg) {
|
|
1545
1549
|
var _this6 = this;
|
|
1546
1550
|
var content, comm, target;
|
|
@@ -1585,9 +1589,10 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
1585
1589
|
/**
|
|
1586
1590
|
* Handle 'comm_close' kernel message.
|
|
1587
1591
|
*/
|
|
1592
|
+
)
|
|
1588
1593
|
}, {
|
|
1589
1594
|
key: "_handleCommClose",
|
|
1590
|
-
value: function () {
|
|
1595
|
+
value: (function () {
|
|
1591
1596
|
var _handleCommClose2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(msg) {
|
|
1592
1597
|
var content, comm, onClose;
|
|
1593
1598
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
@@ -1627,9 +1632,10 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
1627
1632
|
/**
|
|
1628
1633
|
* Handle a 'comm_msg' kernel message.
|
|
1629
1634
|
*/
|
|
1635
|
+
)
|
|
1630
1636
|
}, {
|
|
1631
1637
|
key: "_handleCommMsg",
|
|
1632
|
-
value: function () {
|
|
1638
|
+
value: (function () {
|
|
1633
1639
|
var _handleCommMsg2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(msg) {
|
|
1634
1640
|
var content, comm, onMsg;
|
|
1635
1641
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
@@ -1665,6 +1671,7 @@ export var KernelConnection = (_dec = transient(), _dec2 = inject(KernelSpecRest
|
|
|
1665
1671
|
/**
|
|
1666
1672
|
* Unregister a comm instance.
|
|
1667
1673
|
*/
|
|
1674
|
+
)
|
|
1668
1675
|
}, {
|
|
1669
1676
|
key: "_unregisterComm",
|
|
1670
1677
|
value: function _unregisterComm(commId) {
|
|
@@ -7,8 +7,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
|
|
|
7
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
8
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
9
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
-
function _toPropertyKey(
|
|
11
|
-
function _toPrimitive(
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
12
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
13
13
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
14
14
|
import { Poll } from '@difizen/libro-common';
|
|
@@ -129,7 +129,7 @@ export var LibroKernelManager = (_dec = singleton(), _dec2 = inject(LibroKernelF
|
|
|
129
129
|
*/
|
|
130
130
|
}, {
|
|
131
131
|
key: "shutdown",
|
|
132
|
-
value: function () {
|
|
132
|
+
value: (function () {
|
|
133
133
|
var _shutdown = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(id) {
|
|
134
134
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
135
135
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -149,7 +149,7 @@ export var LibroKernelManager = (_dec = singleton(), _dec2 = inject(LibroKernelF
|
|
|
149
149
|
return _shutdown.apply(this, arguments);
|
|
150
150
|
}
|
|
151
151
|
return shutdown;
|
|
152
|
-
}()
|
|
152
|
+
}())
|
|
153
153
|
}, {
|
|
154
154
|
key: "connectToKernel",
|
|
155
155
|
value: function () {
|
|
@@ -262,7 +262,7 @@ export var LibroKernelManager = (_dec = singleton(), _dec2 = inject(LibroKernelF
|
|
|
262
262
|
*/
|
|
263
263
|
}, {
|
|
264
264
|
key: "refreshRunning",
|
|
265
|
-
value: function () {
|
|
265
|
+
value: (function () {
|
|
266
266
|
var _refreshRunning = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
267
267
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
268
268
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -282,10 +282,10 @@ export var LibroKernelManager = (_dec = singleton(), _dec2 = inject(LibroKernelF
|
|
|
282
282
|
return _refreshRunning.apply(this, arguments);
|
|
283
283
|
}
|
|
284
284
|
return refreshRunning;
|
|
285
|
-
}()
|
|
285
|
+
}())
|
|
286
286
|
}, {
|
|
287
287
|
key: "requestRunning",
|
|
288
|
-
value:
|
|
288
|
+
value: (
|
|
289
289
|
/**
|
|
290
290
|
* Execute a request to the server to poll running kernels and update state.
|
|
291
291
|
*/
|
|
@@ -321,7 +321,7 @@ export var LibroKernelManager = (_dec = singleton(), _dec2 = inject(LibroKernelF
|
|
|
321
321
|
return _requestRunning.apply(this, arguments);
|
|
322
322
|
}
|
|
323
323
|
return requestRunning;
|
|
324
|
-
}()
|
|
324
|
+
}())
|
|
325
325
|
}]);
|
|
326
326
|
return LibroKernelManager;
|
|
327
327
|
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "kernelfactory", [_dec2], {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
7
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -3,8 +3,8 @@ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _desc
|
|
|
3
3
|
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
4
4
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
-
function _toPropertyKey(
|
|
7
|
-
function _toPrimitive(
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
9
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
10
10
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|