@difizen/libro-terminal 0.1.7 → 0.1.9
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/connection.d.ts +2 -2
- package/es/connection.d.ts.map +1 -1
- package/es/connection.js +9 -4
- package/es/manager.d.ts +2 -2
- package/es/manager.d.ts.map +1 -1
- package/es/manager.js +9 -5
- package/package.json +5 -5
- package/src/connection.ts +5 -3
- package/src/manager.ts +6 -4
package/es/connection.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import type { ISettings } from '@difizen/libro-kernel';
|
|
3
2
|
import { ServerConnection } from '@difizen/libro-kernel';
|
|
4
3
|
import type { Disposable, Disposed, Event } from '@difizen/mana-app';
|
|
5
4
|
import { Emitter } from '@difizen/mana-app';
|
|
@@ -19,6 +18,7 @@ export declare class TerminalConnection implements Disposable, Disposed {
|
|
|
19
18
|
protected _reconnectAttempt: number;
|
|
20
19
|
protected _pendingMessages: TerminalMessage[];
|
|
21
20
|
terminalRestAPI: TerminalRestAPI;
|
|
21
|
+
serverConnection: ServerConnection;
|
|
22
22
|
disposed: boolean;
|
|
23
23
|
/**
|
|
24
24
|
* Construct a new terminal session.
|
|
@@ -42,7 +42,7 @@ export declare class TerminalConnection implements Disposable, Disposed {
|
|
|
42
42
|
/**
|
|
43
43
|
* The server settings for the session.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
get serverSettings(): import("@difizen/libro-kernel").ISettings;
|
|
46
46
|
/**
|
|
47
47
|
* Dispose of the resources held by the session.
|
|
48
48
|
*/
|
package/es/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";A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AED;;OAEG;IACH,IAAI,KAAK,IAAI,aAAa,CAEzB;IAED;;OAEG;IACH,IAAI,cAAc,8CAEjB;IAED;;OAEG;IACH,OAAO,IAAI,IAAI;IAUf;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAIpC;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,UAAO,GAAG,IAAI;IAc1D;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAa9B,oBAAoB,EAAE,UAAU,GAAG,SAAS,CAAC;IAC7C;;OAEG;IACH,SAAS,QAAO,QAAQ,IAAI,CAAC,CA2B3B;IAEF;;OAEG;IACH,UAAU,IAAI,IAAI;IA+BlB;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAY9B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B;;;;;OAKG;IACH,SAAS,CAAC,aAAa,aAiCrB;IAGF,SAAS,CAAC,YAAY,UAAW,YAAY,UAsB3C;IAEF,SAAS,CAAC,UAAU,UAAW,UAAU,UAKvC;IAEF;;OAEG;IACH,SAAS,CAAC,uBAAuB,CAAC,gBAAgB,EAAE,wBAAwB,GAAG,IAAI;IAsBnF,SAAS,CAAC,gBAAgB;IAM1B,IAAI,uBAAuB,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAE7D;IAED,IAAI,gBAAgB,IAAI,wBAAwB,CAE/C;CACF;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAItE"}
|
package/es/connection.js
CHANGED
|
@@ -135,8 +135,8 @@ export var TerminalConnection = (_dec = transient(), _dec2 = inject(TerminalRest
|
|
|
135
135
|
_this._reconnect();
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
this.serverSettings = serverConnection.settings;
|
|
139
138
|
this._name = options.name;
|
|
139
|
+
this.serverConnection = serverConnection;
|
|
140
140
|
this._createSocket();
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -180,12 +180,17 @@ export var TerminalConnection = (_dec = transient(), _dec2 = inject(TerminalRest
|
|
|
180
180
|
* The server settings for the session.
|
|
181
181
|
*/
|
|
182
182
|
}, {
|
|
183
|
-
key: "
|
|
184
|
-
|
|
183
|
+
key: "serverSettings",
|
|
184
|
+
get: function get() {
|
|
185
|
+
return this.serverConnection.settings;
|
|
186
|
+
}
|
|
187
|
+
|
|
185
188
|
/**
|
|
186
189
|
* Dispose of the resources held by the session.
|
|
187
190
|
*/
|
|
188
|
-
|
|
191
|
+
}, {
|
|
192
|
+
key: "dispose",
|
|
193
|
+
value: function dispose() {
|
|
189
194
|
if (this.disposed) {
|
|
190
195
|
return;
|
|
191
196
|
}
|
package/es/manager.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Poll } from '@difizen/libro-common';
|
|
2
|
-
import type { ISettings } from '@difizen/libro-kernel';
|
|
3
2
|
import { ServerConnection } from '@difizen/libro-kernel';
|
|
4
3
|
import type { Disposable, Disposed, Event } from '@difizen/mana-app';
|
|
5
4
|
import { Emitter } from '@difizen/mana-app';
|
|
@@ -19,6 +18,7 @@ export declare class TerminalManager implements Disposable, Disposed {
|
|
|
19
18
|
protected get _models(): TerminalModel[];
|
|
20
19
|
terminalRestAPI: TerminalRestAPI;
|
|
21
20
|
terminalConnectionFactory: TerminalConnectionFactory;
|
|
21
|
+
serverConnection: ServerConnection;
|
|
22
22
|
/**
|
|
23
23
|
* Construct a new terminal manager.
|
|
24
24
|
*/
|
|
@@ -26,7 +26,7 @@ export declare class TerminalManager implements Disposable, Disposed {
|
|
|
26
26
|
/**
|
|
27
27
|
* The server settings of the manager.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
get serverSettings(): import("@difizen/libro-kernel").ISettings;
|
|
30
30
|
/**
|
|
31
31
|
* Test whether the manager is ready.
|
|
32
32
|
*/
|
package/es/manager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAgB,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,OAAO,EAAU,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,qBACa,eAAgB,YAAW,UAAU,EAAE,QAAQ;IAC1D,QAAQ,UAAS;IACjB,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC;IAC5B,SAAS,CAAC,oBAAoB,0BAAiC;IAC/D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,SAAS,CAAC,eAAe,2BAAkC;IAC3D,SAAS,CAAC,kBAAkB,iBAAwB;IAEpD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAM;IAChC,SAAS,KAAK,OAAO,IAAI,aAAa,EAAE,CAIvC;IAEwB,eAAe,EAAE,eAAe,CAAC;IAG1D,yBAAyB,EAAE,yBAAyB,CAAC;IACrD,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;gBACmC,gBAAgB,EAAE,gBAAgB;IAwBxE;;OAEG;IACH,IAAI,cAAc,8CAEjB;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAEzB;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC,CAE3C;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,KAAK,CAAC,KAAK,CAAC,CAEpC;IAED;;OAEG;IACH,OAAO,IAAI,IAAI;IAoBf,SAAS,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,kBAAkB;IAaxD;;;;OAIG;IACH,OAAO,IAAI,gBAAgB,CAAC,aAAa,CAAC;IAI1C;;;;;;;;OAQG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAKrC;;;;;;;;;;OAUG;IACG,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMpE;;OAEG;IACG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3C;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAelC;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCrC;;OAEG;IACH,SAAS,CAAC,UAAU,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI;IAOlE;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI;IAQnE,WAAW,YAAmB,cAAc,iCAoB1C;CACH"}
|
package/es/manager.js
CHANGED
|
@@ -98,8 +98,7 @@ export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI
|
|
|
98
98
|
return _ref.apply(this, arguments);
|
|
99
99
|
};
|
|
100
100
|
}();
|
|
101
|
-
this.
|
|
102
|
-
|
|
101
|
+
this.serverConnection = serverConnection;
|
|
103
102
|
//
|
|
104
103
|
// Start polling with exponential backoff.
|
|
105
104
|
this._pollModels = new Poll({
|
|
@@ -150,12 +149,17 @@ export var TerminalManager = (_dec = singleton(), _dec2 = inject(TerminalRestAPI
|
|
|
150
149
|
});
|
|
151
150
|
}
|
|
152
151
|
}, {
|
|
153
|
-
key: "
|
|
154
|
-
get:
|
|
152
|
+
key: "serverSettings",
|
|
153
|
+
get: function get() {
|
|
154
|
+
return this.serverConnection.settings;
|
|
155
|
+
}
|
|
156
|
+
|
|
155
157
|
/**
|
|
156
158
|
* Test whether the manager is ready.
|
|
157
159
|
*/
|
|
158
|
-
|
|
160
|
+
}, {
|
|
161
|
+
key: "isReady",
|
|
162
|
+
get: function get() {
|
|
159
163
|
return this._isReady;
|
|
160
164
|
}
|
|
161
165
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-terminal",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro"
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"src"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@difizen/libro-core": "^0.1.
|
|
35
|
-
"@difizen/libro-common": "^0.1.
|
|
36
|
-
"@difizen/libro-kernel": "^0.1.
|
|
34
|
+
"@difizen/libro-core": "^0.1.9",
|
|
35
|
+
"@difizen/libro-common": "^0.1.9",
|
|
36
|
+
"@difizen/libro-kernel": "^0.1.9",
|
|
37
37
|
"@difizen/mana-app": "latest",
|
|
38
38
|
"@ant-design/icons": "^5.1.0",
|
|
39
39
|
"xterm-addon-search": "^0.13.0",
|
|
@@ -63,6 +63,6 @@
|
|
|
63
63
|
"coverage:jest": "jest --coverage",
|
|
64
64
|
"lint": ": Note: lint task is delegated to lint:* scripts",
|
|
65
65
|
"lint:eslint": "eslint src",
|
|
66
|
-
"
|
|
66
|
+
"typecheck:tsc": "tsc --noEmit"
|
|
67
67
|
}
|
|
68
68
|
}
|
package/src/connection.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { JSONPrimitive } from '@difizen/libro-common';
|
|
2
2
|
import { URL } from '@difizen/libro-common';
|
|
3
|
-
import type { ISettings } from '@difizen/libro-kernel';
|
|
4
3
|
import { ServerConnection } from '@difizen/libro-kernel';
|
|
5
4
|
import type { Disposable, Disposed, Event } from '@difizen/mana-app';
|
|
6
5
|
import { transient } from '@difizen/mana-app';
|
|
@@ -33,6 +32,7 @@ export class TerminalConnection implements Disposable, Disposed {
|
|
|
33
32
|
protected _reconnectAttempt = 0;
|
|
34
33
|
protected _pendingMessages: TerminalMessage[] = [];
|
|
35
34
|
@inject(TerminalRestAPI) terminalRestAPI: TerminalRestAPI;
|
|
35
|
+
serverConnection: ServerConnection;
|
|
36
36
|
|
|
37
37
|
disposed = false;
|
|
38
38
|
|
|
@@ -43,8 +43,8 @@ export class TerminalConnection implements Disposable, Disposed {
|
|
|
43
43
|
@inject(TerminalOption) options: TerminalOption & { name: string },
|
|
44
44
|
@inject(ServerConnection) serverConnection: ServerConnection,
|
|
45
45
|
) {
|
|
46
|
-
this.serverSettings = serverConnection.settings;
|
|
47
46
|
this._name = options.name;
|
|
47
|
+
this.serverConnection = serverConnection;
|
|
48
48
|
this._createSocket();
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -76,7 +76,9 @@ export class TerminalConnection implements Disposable, Disposed {
|
|
|
76
76
|
/**
|
|
77
77
|
* The server settings for the session.
|
|
78
78
|
*/
|
|
79
|
-
|
|
79
|
+
get serverSettings() {
|
|
80
|
+
return this.serverConnection.settings;
|
|
81
|
+
}
|
|
80
82
|
|
|
81
83
|
/**
|
|
82
84
|
* Dispose of the resources held by the session.
|
package/src/manager.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
|
|
4
4
|
import { Poll } from '@difizen/libro-common';
|
|
5
|
-
import type { ISettings } from '@difizen/libro-kernel';
|
|
6
5
|
import { NetworkError, ServerConnection } from '@difizen/libro-kernel';
|
|
7
6
|
import type { Disposable, Disposed, Event } from '@difizen/mana-app';
|
|
8
7
|
import { singleton } from '@difizen/mana-app';
|
|
@@ -34,12 +33,13 @@ export class TerminalManager implements Disposable, Disposed {
|
|
|
34
33
|
// @inject(ServerConnection) serverConnection: ServerConnection;
|
|
35
34
|
@inject(TerminalConnectionFactory)
|
|
36
35
|
terminalConnectionFactory: TerminalConnectionFactory;
|
|
36
|
+
serverConnection: ServerConnection;
|
|
37
|
+
|
|
37
38
|
/**
|
|
38
39
|
* Construct a new terminal manager.
|
|
39
40
|
*/
|
|
40
41
|
constructor(@inject(ServerConnection) serverConnection: ServerConnection) {
|
|
41
|
-
this.
|
|
42
|
-
|
|
42
|
+
this.serverConnection = serverConnection;
|
|
43
43
|
//
|
|
44
44
|
// Start polling with exponential backoff.
|
|
45
45
|
this._pollModels = new Poll({
|
|
@@ -65,7 +65,9 @@ export class TerminalManager implements Disposable, Disposed {
|
|
|
65
65
|
/**
|
|
66
66
|
* The server settings of the manager.
|
|
67
67
|
*/
|
|
68
|
-
|
|
68
|
+
get serverSettings() {
|
|
69
|
+
return this.serverConnection.settings;
|
|
70
|
+
}
|
|
69
71
|
|
|
70
72
|
/**
|
|
71
73
|
* Test whether the manager is ready.
|