@difizen/libro-kernel 0.0.2-alpha.0

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.
Files changed (188) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/es/basemanager.d.ts +94 -0
  4. package/es/basemanager.d.ts.map +1 -0
  5. package/es/basemanager.js +110 -0
  6. package/es/contents/contents-drive.d.ts +189 -0
  7. package/es/contents/contents-drive.d.ts.map +1 -0
  8. package/es/contents/contents-drive.js +792 -0
  9. package/es/contents/contents-manager.d.ts +229 -0
  10. package/es/contents/contents-manager.d.ts.map +1 -0
  11. package/es/contents/contents-manager.js +551 -0
  12. package/es/contents/contents-module.d.ts +3 -0
  13. package/es/contents/contents-module.d.ts.map +1 -0
  14. package/es/contents/contents-module.js +4 -0
  15. package/es/contents/contents-protocol.d.ts +487 -0
  16. package/es/contents/contents-protocol.d.ts.map +1 -0
  17. package/es/contents/contents-protocol.js +1 -0
  18. package/es/contents/index.d.ts +6 -0
  19. package/es/contents/index.d.ts.map +1 -0
  20. package/es/contents/index.js +5 -0
  21. package/es/contents/validate.d.ts +10 -0
  22. package/es/contents/validate.d.ts.map +1 -0
  23. package/es/contents/validate.js +22 -0
  24. package/es/index.d.ts +10 -0
  25. package/es/index.d.ts.map +1 -0
  26. package/es/index.js +9 -0
  27. package/es/index.less +0 -0
  28. package/es/kernel/comm.d.ts +92 -0
  29. package/es/kernel/comm.d.ts.map +1 -0
  30. package/es/kernel/comm.js +216 -0
  31. package/es/kernel/future.d.ts +178 -0
  32. package/es/kernel/future.d.ts.map +1 -0
  33. package/es/kernel/future.js +587 -0
  34. package/es/kernel/index.d.ts +8 -0
  35. package/es/kernel/index.d.ts.map +1 -0
  36. package/es/kernel/index.js +8 -0
  37. package/es/kernel/kernel-connection.d.ts +550 -0
  38. package/es/kernel/kernel-connection.d.ts.map +1 -0
  39. package/es/kernel/kernel-connection.js +1957 -0
  40. package/es/kernel/kernel-module.d.ts +3 -0
  41. package/es/kernel/kernel-module.d.ts.map +1 -0
  42. package/es/kernel/kernel-module.js +32 -0
  43. package/es/kernel/libro-kernel-manager.d.ts +69 -0
  44. package/es/kernel/libro-kernel-manager.d.ts.map +1 -0
  45. package/es/kernel/libro-kernel-manager.js +349 -0
  46. package/es/kernel/libro-kernel-protocol.d.ts +675 -0
  47. package/es/kernel/libro-kernel-protocol.d.ts.map +1 -0
  48. package/es/kernel/libro-kernel-protocol.js +60 -0
  49. package/es/kernel/libro-kernel-utils.d.ts +95 -0
  50. package/es/kernel/libro-kernel-utils.d.ts.map +1 -0
  51. package/es/kernel/libro-kernel-utils.js +130 -0
  52. package/es/kernel/libro-kernel.d.ts +14 -0
  53. package/es/kernel/libro-kernel.d.ts.map +1 -0
  54. package/es/kernel/libro-kernel.js +54 -0
  55. package/es/kernel/messages.d.ts +845 -0
  56. package/es/kernel/messages.d.ts.map +1 -0
  57. package/es/kernel/messages.js +457 -0
  58. package/es/kernel/restapi.d.ts +78 -0
  59. package/es/kernel/restapi.d.ts.map +1 -0
  60. package/es/kernel/restapi.js +367 -0
  61. package/es/kernel/serialize.d.ts +10 -0
  62. package/es/kernel/serialize.d.ts.map +1 -0
  63. package/es/kernel/serialize.js +214 -0
  64. package/es/kernel/validate.d.ts +15 -0
  65. package/es/kernel/validate.d.ts.map +1 -0
  66. package/es/kernel/validate.js +125 -0
  67. package/es/kernelspec/index.d.ts +5 -0
  68. package/es/kernelspec/index.d.ts.map +1 -0
  69. package/es/kernelspec/index.js +4 -0
  70. package/es/kernelspec/kernelspec-module.d.ts +3 -0
  71. package/es/kernelspec/kernelspec-module.d.ts.map +1 -0
  72. package/es/kernelspec/kernelspec-module.js +4 -0
  73. package/es/kernelspec/kernelspec.d.ts +33 -0
  74. package/es/kernelspec/kernelspec.d.ts.map +1 -0
  75. package/es/kernelspec/kernelspec.js +1 -0
  76. package/es/kernelspec/manager.d.ts +81 -0
  77. package/es/kernelspec/manager.d.ts.map +1 -0
  78. package/es/kernelspec/manager.js +248 -0
  79. package/es/kernelspec/restapi.d.ts +71 -0
  80. package/es/kernelspec/restapi.d.ts.map +1 -0
  81. package/es/kernelspec/restapi.js +107 -0
  82. package/es/kernelspec/validate.d.ts +10 -0
  83. package/es/kernelspec/validate.d.ts.map +1 -0
  84. package/es/kernelspec/validate.js +69 -0
  85. package/es/libro-kernel-connection-manager.d.ts +19 -0
  86. package/es/libro-kernel-connection-manager.d.ts.map +1 -0
  87. package/es/libro-kernel-connection-manager.js +142 -0
  88. package/es/module.d.ts +3 -0
  89. package/es/module.d.ts.map +1 -0
  90. package/es/module.js +9 -0
  91. package/es/page-config.d.ts +36 -0
  92. package/es/page-config.d.ts.map +1 -0
  93. package/es/page-config.js +129 -0
  94. package/es/protocol.d.ts +13 -0
  95. package/es/protocol.d.ts.map +1 -0
  96. package/es/protocol.js +8 -0
  97. package/es/server/connection-error.d.ts +36 -0
  98. package/es/server/connection-error.d.ts.map +1 -0
  99. package/es/server/connection-error.js +109 -0
  100. package/es/server/index.d.ts +6 -0
  101. package/es/server/index.d.ts.map +1 -0
  102. package/es/server/index.js +5 -0
  103. package/es/server/server-connection-protocol.d.ts +49 -0
  104. package/es/server/server-connection-protocol.d.ts.map +1 -0
  105. package/es/server/server-connection-protocol.js +0 -0
  106. package/es/server/server-connection.d.ts +25 -0
  107. package/es/server/server-connection.d.ts.map +1 -0
  108. package/es/server/server-connection.js +159 -0
  109. package/es/server/server-manager.d.ts +22 -0
  110. package/es/server/server-manager.d.ts.map +1 -0
  111. package/es/server/server-manager.js +163 -0
  112. package/es/server/server-module.d.ts +3 -0
  113. package/es/server/server-module.d.ts.map +1 -0
  114. package/es/server/server-module.js +4 -0
  115. package/es/session/index.d.ts +5 -0
  116. package/es/session/index.d.ts.map +1 -0
  117. package/es/session/index.js +4 -0
  118. package/es/session/libro-session-manager.d.ts +71 -0
  119. package/es/session/libro-session-manager.d.ts.map +1 -0
  120. package/es/session/libro-session-manager.js +539 -0
  121. package/es/session/libro-session-protocol.d.ts +50 -0
  122. package/es/session/libro-session-protocol.d.ts.map +1 -0
  123. package/es/session/libro-session-protocol.js +21 -0
  124. package/es/session/libro-session.d.ts +12 -0
  125. package/es/session/libro-session.d.ts.map +1 -0
  126. package/es/session/libro-session.js +19 -0
  127. package/es/session/restapi.d.ts +28 -0
  128. package/es/session/restapi.d.ts.map +1 -0
  129. package/es/session/restapi.js +214 -0
  130. package/es/session/session-module.d.ts +3 -0
  131. package/es/session/session-module.d.ts.map +1 -0
  132. package/es/session/session-module.js +18 -0
  133. package/es/session/validate.d.ts +14 -0
  134. package/es/session/validate.d.ts.map +1 -0
  135. package/es/session/validate.js +37 -0
  136. package/es/utils.d.ts +4 -0
  137. package/es/utils.d.ts.map +1 -0
  138. package/es/utils.js +29 -0
  139. package/es/validate-property.d.ts +2 -0
  140. package/es/validate-property.d.ts.map +1 -0
  141. package/es/validate-property.js +35 -0
  142. package/package.json +62 -0
  143. package/src/basemanager.ts +133 -0
  144. package/src/contents/contents-drive.ts +495 -0
  145. package/src/contents/contents-manager.ts +465 -0
  146. package/src/contents/contents-module.ts +6 -0
  147. package/src/contents/contents-protocol.ts +604 -0
  148. package/src/contents/index.ts +5 -0
  149. package/src/contents/validate.ts +29 -0
  150. package/src/index.tsx +9 -0
  151. package/src/kernel/comm.ts +220 -0
  152. package/src/kernel/future.ts +474 -0
  153. package/src/kernel/index.ts +7 -0
  154. package/src/kernel/kernel-connection.ts +1770 -0
  155. package/src/kernel/kernel-module.ts +50 -0
  156. package/src/kernel/libro-kernel-manager.ts +199 -0
  157. package/src/kernel/libro-kernel-protocol.ts +858 -0
  158. package/src/kernel/libro-kernel-utils.ts +152 -0
  159. package/src/kernel/libro-kernel.ts +39 -0
  160. package/src/kernel/messages.ts +1104 -0
  161. package/src/kernel/restapi.ts +183 -0
  162. package/src/kernel/serialize.ts +262 -0
  163. package/src/kernel/validate.ts +101 -0
  164. package/src/kernelspec/index.ts +5 -0
  165. package/src/kernelspec/kernelspec-module.ts +9 -0
  166. package/src/kernelspec/kernelspec.ts +37 -0
  167. package/src/kernelspec/manager.ts +173 -0
  168. package/src/kernelspec/restapi.ts +104 -0
  169. package/src/kernelspec/validate.ts +80 -0
  170. package/src/libro-kernel-connection-manager.ts +73 -0
  171. package/src/module.ts +19 -0
  172. package/src/page-config.ts +106 -0
  173. package/src/protocol.ts +24 -0
  174. package/src/server/connection-error.ts +60 -0
  175. package/src/server/index.ts +5 -0
  176. package/src/server/server-connection-protocol.ts +57 -0
  177. package/src/server/server-connection.ts +144 -0
  178. package/src/server/server-manager.ts +76 -0
  179. package/src/server/server-module.ts +9 -0
  180. package/src/session/index.ts +4 -0
  181. package/src/session/libro-session-manager.ts +377 -0
  182. package/src/session/libro-session-protocol.ts +61 -0
  183. package/src/session/libro-session.ts +33 -0
  184. package/src/session/restapi.ts +126 -0
  185. package/src/session/session-module.ts +26 -0
  186. package/src/session/validate.ts +39 -0
  187. package/src/utils.ts +28 -0
  188. package/src/validate-property.ts +38 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present Difizen Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # libro-kernel
@@ -0,0 +1,94 @@
1
+ import type { Disposable, Event as ManaEvent } from '@difizen/mana-app';
2
+ import { Emitter } from '@difizen/mana-app';
3
+ import type { ISettings, NetworkError } from './server/index.js';
4
+ /**
5
+ * A disposable object with an observable `disposed` signal.
6
+ */
7
+ export interface ObservableDisposable extends Disposable {
8
+ /**
9
+ * A signal emitted when the object is disposed.
10
+ */
11
+ readonly onDisposed: ManaEvent<void>;
12
+ }
13
+ /**
14
+ * Object which manages kernel instances for a given base url.
15
+ *
16
+ * #### Notes
17
+ * The manager is responsible for maintaining the state of kernel specs.
18
+ */
19
+ export interface IManager extends ObservableDisposable {
20
+ /**
21
+ * A signal emitted when there is a connection failure.
22
+ */
23
+ connectionFailure: ManaEvent<NetworkError>;
24
+ /**
25
+ * The server settings for the manager.
26
+ */
27
+ readonly serverSettings: ISettings;
28
+ /**
29
+ * Whether the manager is ready.
30
+ */
31
+ readonly isReady: boolean;
32
+ /**
33
+ * A promise that resolves when the manager is initially ready.
34
+ */
35
+ readonly ready: Promise<void>;
36
+ /**
37
+ * Whether the manager is active.
38
+ */
39
+ readonly isActive: boolean;
40
+ }
41
+ export declare class BaseManager implements IManager {
42
+ /**
43
+ * A signal emitted when the delegate is disposed.
44
+ */
45
+ get onDisposed(): ManaEvent<void>;
46
+ /**
47
+ * A signal emitted when there is a connection failure.
48
+ */
49
+ get connectionFailure(): ManaEvent<Error>;
50
+ /**
51
+ * Test whether the delegate has been disposed.
52
+ */
53
+ get isDisposed(): boolean;
54
+ /**
55
+ * Test whether the manager is ready.
56
+ */
57
+ get isReady(): boolean;
58
+ /**
59
+ * A promise that fulfills when the manager is ready.
60
+ */
61
+ get ready(): Promise<void>;
62
+ /**
63
+ * Whether the manager is active.
64
+ */
65
+ get isActive(): boolean;
66
+ /**
67
+ * Dispose of the delegate and invoke the callback function.
68
+ */
69
+ dispose(): void;
70
+ /**
71
+ * The server settings of the manager.
72
+ */
73
+ readonly serverSettings: ISettings;
74
+ protected _isDisposed: boolean;
75
+ protected onDisposedEmitter: Emitter<void>;
76
+ protected connectionFailureEmitter: Emitter<Error>;
77
+ _isReady: boolean;
78
+ _ready: Promise<void>;
79
+ }
80
+ /**
81
+ * The namespace for `BaseManager` class statics.
82
+ */
83
+ export declare namespace BaseManager {
84
+ /**
85
+ * The options used to initialize a SessionManager.
86
+ */
87
+ interface IOptions {
88
+ /**
89
+ * The server settings for the manager.
90
+ */
91
+ serverSettings?: ISettings;
92
+ }
93
+ }
94
+ //# sourceMappingURL=basemanager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basemanager.d.ts","sourceRoot":"","sources":["../src/basemanager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjE;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;CACtC;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAS,SAAQ,oBAAoB;IACpD;;OAEG;IACH,iBAAiB,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,qBACa,WAAY,YAAW,QAAQ;IAI1C;;OAEG;IACH,IAAI,UAAU,IAAI,SAAS,CAAC,IAAI,CAAC,CAEhC;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,SAAS,CAAC,KAAK,CAAC,CAExC;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,OAAO,CAExB;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAEzB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;OAEG;IACH,OAAO,IAAI,IAAI;IAQf;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,CAAC;IAEnC,SAAS,CAAC,WAAW,UAAS;IAC9B,SAAS,CAAC,iBAAiB,gBAAuB;IAElD,SAAS,CAAC,wBAAwB,iBAAwB;IAC1D,QAAQ,UAAS;IACjB,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED;;GAEG;AACH,yBAAiB,WAAW,CAAC;IAC3B;;OAEG;IACH,UAAiB,QAAQ;QACvB;;WAEG;QACH,cAAc,CAAC,EAAE,SAAS,CAAC;KAC5B;CACF"}
@@ -0,0 +1,110 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _dec, _class;
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ 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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ import { Emitter } from '@difizen/mana-app';
9
+ import { singleton } from '@difizen/mana-app';
10
+
11
+ /**
12
+ * A disposable object with an observable `disposed` signal.
13
+ */
14
+
15
+ /**
16
+ * Object which manages kernel instances for a given base url.
17
+ *
18
+ * #### Notes
19
+ * The manager is responsible for maintaining the state of kernel specs.
20
+ */
21
+
22
+ export var BaseManager = (_dec = singleton(), _dec(_class = /*#__PURE__*/function () {
23
+ function BaseManager() {
24
+ _classCallCheck(this, BaseManager);
25
+ this._isDisposed = false;
26
+ this.onDisposedEmitter = new Emitter();
27
+ this.connectionFailureEmitter = new Emitter();
28
+ this._isReady = false;
29
+ }
30
+ _createClass(BaseManager, [{
31
+ key: "onDisposed",
32
+ get:
33
+ // constructor(options: BaseManager.IOptions) {
34
+ // this.serverSettings = options.serverSettings ?? ServerConnection.makeSettings();
35
+ // }
36
+ /**
37
+ * A signal emitted when the delegate is disposed.
38
+ */
39
+ function get() {
40
+ return this.onDisposedEmitter.event;
41
+ }
42
+
43
+ /**
44
+ * A signal emitted when there is a connection failure.
45
+ */
46
+ }, {
47
+ key: "connectionFailure",
48
+ get: function get() {
49
+ return this.connectionFailureEmitter.event;
50
+ }
51
+
52
+ /**
53
+ * Test whether the delegate has been disposed.
54
+ */
55
+ }, {
56
+ key: "isDisposed",
57
+ get: function get() {
58
+ return this._isDisposed;
59
+ }
60
+
61
+ /**
62
+ * Test whether the manager is ready.
63
+ */
64
+ }, {
65
+ key: "isReady",
66
+ get: function get() {
67
+ return this._isReady;
68
+ }
69
+
70
+ /**
71
+ * A promise that fulfills when the manager is ready.
72
+ */
73
+ }, {
74
+ key: "ready",
75
+ get: function get() {
76
+ return this._ready;
77
+ }
78
+
79
+ /**
80
+ * Whether the manager is active.
81
+ */
82
+ }, {
83
+ key: "isActive",
84
+ get: function get() {
85
+ return true;
86
+ }
87
+
88
+ /**
89
+ * Dispose of the delegate and invoke the callback function.
90
+ */
91
+ }, {
92
+ key: "dispose",
93
+ value: function dispose() {
94
+ if (this.isDisposed) {
95
+ return;
96
+ }
97
+ this.onDisposedEmitter.fire(undefined);
98
+ this.onDisposedEmitter.dispose();
99
+ }
100
+
101
+ /**
102
+ * The server settings of the manager.
103
+ */
104
+ }]);
105
+ return BaseManager;
106
+ }()) || _class);
107
+
108
+ /**
109
+ * The namespace for `BaseManager` class statics.
110
+ */
@@ -0,0 +1,189 @@
1
+ import type { Event as ManaEvent } from '@difizen/mana-app';
2
+ import { Emitter } from '@difizen/mana-app';
3
+ import type { ISettings } from '../server/index.js';
4
+ import { ServerConnection } from '../server/index.js';
5
+ import type { IContentsChangedArgs, IContentsCheckpointModel, IContentsCreateOptions, IContentsDrive, IContentsFetchOptions, IContentsModel, IContentsRequestOptions } from './contents-protocol.js';
6
+ /**
7
+ * A default implementation for an `IContentsDrive`, talking to the
8
+ * server using the Jupyter REST API.
9
+ */
10
+ export declare class Drive implements IContentsDrive {
11
+ serverConnection: ServerConnection;
12
+ /**
13
+ * Construct a new contents manager object.
14
+ *
15
+ * @param options - The options used to initialize the object.
16
+ */
17
+ constructor();
18
+ /**
19
+ * The name of the drive, which is used at the leading
20
+ * component of file paths.
21
+ */
22
+ readonly name: string;
23
+ /**
24
+ * A signal emitted when a file operation takes place.
25
+ */
26
+ get fileChanged(): ManaEvent<IContentsChangedArgs>;
27
+ /**
28
+ * The server settings of the drive.
29
+ */
30
+ /**
31
+ * Test whether the manager has been disposed.
32
+ */
33
+ get isDisposed(): boolean;
34
+ /**
35
+ * Dispose of the resources held by the manager.
36
+ */
37
+ dispose(): void;
38
+ /**
39
+ * Get a file or directory.
40
+ *
41
+ * @param localPath: The path to the file.
42
+ *
43
+ * @param options: The options used to fetch the file.
44
+ *
45
+ * @returns A promise which resolves with the file content.
46
+ *
47
+ * 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.
48
+ */
49
+ get(localPath: string, options?: IContentsFetchOptions): Promise<IContentsModel>;
50
+ /**
51
+ * Get an encoded download url given a file path.
52
+ *
53
+ * @param localPath - An absolute POSIX file path on the server.
54
+ *
55
+ * #### Notes
56
+ * It is expected that the path contains no relative paths.
57
+ *
58
+ * The returned URL may include a query parameter.
59
+ */
60
+ getDownloadUrl(localPath: string, options?: IContentsRequestOptions): Promise<string>;
61
+ /**
62
+ * Create a new untitled file or directory in the specified directory path.
63
+ *
64
+ * @param options: The options used to create the file.
65
+ *
66
+ * @returns A promise which resolves with the created file content when the
67
+ * file is created.
68
+ *
69
+ * #### Notes
70
+ * 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.
71
+ */
72
+ newUntitled(options?: IContentsCreateOptions): Promise<IContentsModel>;
73
+ /**
74
+ * Delete a file.
75
+ *
76
+ * @param localPath - The path to the file.
77
+ *
78
+ * @returns A promise which resolves when the file is deleted.
79
+ *
80
+ * #### Notes
81
+ * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents).
82
+ */
83
+ delete(localPath: string, options?: IContentsRequestOptions): Promise<void>;
84
+ /**
85
+ * Rename a file or directory.
86
+ *
87
+ * @param oldLocalPath - The original file path.
88
+ *
89
+ * @param newLocalPath - The new file path.
90
+ *
91
+ * @returns A promise which resolves with the new file contents model when
92
+ * the file is renamed.
93
+ *
94
+ * #### Notes
95
+ * 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.
96
+ */
97
+ rename(oldLocalPath: string, newLocalPath: string, options?: IContentsRequestOptions): Promise<IContentsModel>;
98
+ /**
99
+ * Save a file.
100
+ *
101
+ * @param localPath - The desired file path.
102
+ *
103
+ * @param options - Optional overrides to the model.
104
+ *
105
+ * @returns A promise which resolves with the file content model when the
106
+ * file is saved.
107
+ *
108
+ * #### Notes
109
+ * Ensure that `model.content` is populated for the file.
110
+ *
111
+ * 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.
112
+ */
113
+ save(localPath: string, options?: Partial<IContentsModel>): Promise<IContentsModel>;
114
+ /**
115
+ * Copy a file into a given directory.
116
+ *
117
+ * @param localPath - The original file path.
118
+ *
119
+ * @param toDir - The destination directory path.
120
+ *
121
+ * @returns A promise which resolves with the new contents model when the
122
+ * file is copied.
123
+ *
124
+ * #### Notes
125
+ * The server will select the name of the copied file.
126
+ *
127
+ * 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.
128
+ */
129
+ copy(fromFile: string, toDir: string, options?: IContentsRequestOptions): Promise<IContentsModel>;
130
+ /**
131
+ * Create a checkpoint for a file.
132
+ *
133
+ * @param localPath - The path of the file.
134
+ *
135
+ * @returns A promise which resolves with the new checkpoint model when the
136
+ * checkpoint is created.
137
+ *
138
+ * #### Notes
139
+ * 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.
140
+ */
141
+ createCheckpoint(localPath: string, options?: IContentsRequestOptions): Promise<IContentsCheckpointModel>;
142
+ /**
143
+ * List available checkpoints for a file.
144
+ *
145
+ * @param localPath - The path of the file.
146
+ *
147
+ * @returns A promise which resolves with a list of checkpoint models for
148
+ * the file.
149
+ *
150
+ * #### Notes
151
+ * 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.
152
+ */
153
+ listCheckpoints(localPath: string, options?: IContentsRequestOptions): Promise<IContentsCheckpointModel[]>;
154
+ /**
155
+ * Restore a file to a known checkpoint state.
156
+ *
157
+ * @param localPath - The path of the file.
158
+ *
159
+ * @param checkpointID - The id of the checkpoint to restore.
160
+ *
161
+ * @returns A promise which resolves when the checkpoint is restored.
162
+ *
163
+ * #### Notes
164
+ * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents).
165
+ */
166
+ restoreCheckpoint(localPath: string, checkpointID: string, options?: IContentsRequestOptions): Promise<void>;
167
+ /**
168
+ * Delete a checkpoint for a file.
169
+ *
170
+ * @param localPath - The path of the file.
171
+ *
172
+ * @param checkpointID - The id of the checkpoint to delete.
173
+ *
174
+ * @returns A promise which resolves when the checkpoint is deleted.
175
+ *
176
+ * #### Notes
177
+ * Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#!/contents).
178
+ */
179
+ deleteCheckpoint(localPath: string, checkpointID: string, options?: IContentsRequestOptions): Promise<void>;
180
+ /**
181
+ * Get a REST url for a file given a path.
182
+ */
183
+ protected getUrl(base?: string, ...args: string[]): string;
184
+ protected _getSettings(baseUrl?: string): ISettings;
185
+ protected apiEndpoint: string;
186
+ protected _isDisposed: boolean;
187
+ protected fileChangedEmitter: Emitter<IContentsChangedArgs>;
188
+ }
189
+ //# sourceMappingURL=contents-drive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contents-drive.d.ts","sourceRoot":"","sources":["../../src/contents/contents-drive.ts"],"names":[],"mappings":"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"}