askui 0.1.4 → 0.2.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.
- package/README.md +6 -0
- package/dist/cjs/core/model/test-case-dto/custom-element.d.ts +2 -2
- package/dist/cjs/core/model/test-case-dto/custom-element.js +2 -2
- package/dist/cjs/core/model/test-case-dto/custom-element.spec.js +7 -6
- package/dist/cjs/execution/dsl.d.ts +6 -17
- package/dist/cjs/execution/dsl.js +4 -21
- package/dist/cjs/execution/execution-runtime.d.ts +5 -5
- package/dist/cjs/execution/execution-runtime.js +14 -14
- package/dist/cjs/execution/index.d.ts +2 -1
- package/dist/cjs/execution/index.js +5 -3
- package/dist/cjs/execution/{control-your-ui-api.d.ts → inference-client.d.ts} +3 -3
- package/dist/cjs/execution/{control-your-ui-api.js → inference-client.js} +8 -8
- package/dist/cjs/execution/ui-control-client-error.d.ts +2 -0
- package/dist/cjs/execution/ui-control-client-error.js +6 -0
- package/dist/cjs/execution/ui-control-client.d.ts +34 -0
- package/dist/cjs/execution/{client.js → ui-control-client.js} +48 -29
- package/dist/cjs/execution/{client-connection-state.d.ts → ui-controller-client-connection-state.d.ts} +1 -1
- package/dist/cjs/execution/ui-controller-client-connection-state.js +10 -0
- package/dist/cjs/execution/ui-controller-client-interface.d.ts +27 -0
- package/dist/cjs/execution/{client-interface.js → ui-controller-client-interface.js} +0 -0
- package/dist/cjs/execution/{control-your-ui-client.d.ts → ui-controller-client.d.ts} +6 -6
- package/dist/cjs/execution/{control-your-ui-client.js → ui-controller-client.js} +28 -28
- package/dist/cjs/lib/download-binaries.js +8 -8
- package/dist/cjs/lib/index.d.ts +1 -1
- package/dist/cjs/lib/index.js +3 -3
- package/dist/cjs/lib/libfuse-error.d.ts +2 -0
- package/dist/cjs/lib/libfuse-error.js +6 -0
- package/dist/cjs/lib/logger.js +1 -1
- package/dist/cjs/lib/timeout-error.d.ts +0 -2
- package/dist/cjs/lib/timeout-error.js +0 -5
- package/dist/cjs/lib/ui-controller-args.d.ts +47 -0
- package/dist/cjs/lib/{control-ui-server-args.js → ui-controller-args.js} +0 -0
- package/dist/cjs/lib/{control-ui-server-args.spec.d.ts → ui-controller-args.spec.d.ts} +0 -0
- package/dist/cjs/lib/{control-ui-server-args.spec.js → ui-controller-args.spec.js} +7 -7
- package/dist/cjs/lib/ui-controller-darwin.d.ts +6 -0
- package/dist/cjs/lib/{control-ui-server-darwin.js → ui-controller-darwin.js} +8 -8
- package/dist/cjs/lib/ui-controller-facade.d.ts +17 -0
- package/dist/cjs/lib/{control-ui-server-facade.js → ui-controller-facade.js} +22 -16
- package/dist/cjs/lib/ui-controller-linux.d.ts +5 -0
- package/dist/cjs/lib/ui-controller-linux.js +52 -0
- package/dist/cjs/lib/ui-controller-win32.d.ts +3 -0
- package/dist/cjs/lib/ui-controller-win32.js +7 -0
- package/dist/cjs/lib/ui-controller.d.ts +8 -0
- package/dist/cjs/lib/{askui-control-server.js → ui-controller.js} +9 -9
- package/dist/cjs/lib/unkown-error.d.ts +0 -2
- package/dist/cjs/lib/unkown-error.js +0 -5
- package/dist/cjs/lib/wayland-error.d.ts +2 -0
- package/dist/cjs/lib/wayland-error.js +6 -0
- package/dist/cjs/main.d.ts +3 -2
- package/dist/cjs/main.js +6 -3
- package/dist/cjs/shared/index.d.ts +1 -0
- package/dist/cjs/shared/index.js +5 -0
- package/dist/cjs/utils/analytics/analytics-interface.d.ts +3 -0
- package/dist/cjs/utils/analytics/analytics-interface.js +2 -0
- package/dist/cjs/utils/analytics/analytics.d.ts +5 -0
- package/dist/cjs/utils/analytics/analytics.js +32 -0
- package/dist/cjs/utils/analytics/index.d.ts +1 -0
- package/dist/cjs/utils/analytics/index.js +5 -0
- package/dist/cjs/utils/analytics/user-identifier-interface.d.ts +3 -0
- package/dist/cjs/utils/analytics/user-identifier-interface.js +2 -0
- package/dist/cjs/utils/analytics/user-identifier.d.ts +4 -0
- package/dist/cjs/utils/analytics/user-identifier.js +22 -0
- package/dist/cjs/utils/base_64_image/base-64-image-error.d.ts +2 -0
- package/dist/cjs/utils/base_64_image/base-64-image-error.js +6 -0
- package/dist/cjs/utils/base_64_image/base-64-image-path-error.d.ts +4 -0
- package/dist/cjs/utils/base_64_image/base-64-image-path-error.js +11 -0
- package/dist/cjs/utils/base_64_image/base-64-image-string-error.d.ts +4 -0
- package/dist/cjs/utils/base_64_image/base-64-image-string-error.js +11 -0
- package/dist/cjs/utils/base_64_image/base-64-image.d.ts +18 -0
- package/dist/cjs/utils/base_64_image/base-64-image.js +86 -0
- package/dist/cjs/utils/http/custom-errors/http-client-error.d.ts +0 -2
- package/dist/cjs/utils/http/custom-errors/http-client-error.js +0 -5
- package/dist/cjs/utils/http/http-client-got.d.ts +6 -5
- package/dist/cjs/utils/http/http-client-got.js +11 -11
- package/dist/cjs/utils/image-resize-errors/image-resizing-base-error.d.ts +0 -2
- package/dist/cjs/utils/image-resize-errors/image-resizing-base-error.js +0 -5
- package/dist/cjs/utils/image-resize-errors/index.d.ts +0 -1
- package/dist/cjs/utils/image-resize-errors/index.js +1 -3
- package/dist/cjs/utils/transformations.d.ts +0 -2
- package/dist/cjs/utils/transformations.js +11 -44
- package/dist/esm/core/model/test-case-dto/custom-element.d.ts +2 -2
- package/dist/esm/core/model/test-case-dto/custom-element.js +2 -2
- package/dist/esm/core/model/test-case-dto/custom-element.spec.js +7 -6
- package/dist/esm/execution/dsl.d.ts +6 -17
- package/dist/esm/execution/dsl.js +3 -21
- package/dist/esm/execution/execution-runtime.d.ts +5 -5
- package/dist/esm/execution/execution-runtime.js +14 -14
- package/dist/esm/execution/index.d.ts +2 -1
- package/dist/esm/execution/index.js +2 -1
- package/dist/esm/execution/{control-your-ui-api.d.ts → inference-client.d.ts} +3 -3
- package/dist/esm/execution/{control-your-ui-api.js → inference-client.js} +6 -6
- package/dist/esm/execution/ui-control-client-error.d.ts +2 -0
- package/dist/esm/execution/ui-control-client-error.js +2 -0
- package/dist/esm/execution/ui-control-client.d.ts +34 -0
- package/dist/esm/execution/{client.js → ui-control-client.js} +46 -27
- package/dist/esm/execution/{client-connection-state.d.ts → ui-controller-client-connection-state.d.ts} +1 -1
- package/dist/esm/execution/ui-controller-client-connection-state.js +7 -0
- package/dist/esm/execution/ui-controller-client-interface.d.ts +27 -0
- package/dist/esm/execution/{client-interface.js → ui-controller-client-interface.js} +0 -0
- package/dist/esm/execution/{control-your-ui-client.d.ts → ui-controller-client.d.ts} +6 -6
- package/dist/esm/execution/{control-your-ui-client.js → ui-controller-client.js} +26 -26
- package/dist/esm/lib/download-binaries.js +8 -8
- package/dist/esm/lib/index.d.ts +1 -1
- package/dist/esm/lib/index.js +1 -1
- package/dist/esm/lib/libfuse-error.d.ts +2 -0
- package/dist/esm/lib/libfuse-error.js +2 -0
- package/dist/esm/lib/logger.js +1 -1
- package/dist/esm/lib/timeout-error.d.ts +0 -2
- package/dist/esm/lib/timeout-error.js +0 -5
- package/dist/esm/lib/ui-controller-args.d.ts +47 -0
- package/dist/esm/lib/{control-ui-server-args.js → ui-controller-args.js} +0 -0
- package/dist/esm/lib/{control-ui-server-args.spec.d.ts → ui-controller-args.spec.d.ts} +0 -0
- package/dist/esm/lib/{control-ui-server-args.spec.js → ui-controller-args.spec.js} +1 -1
- package/dist/esm/lib/ui-controller-darwin.d.ts +6 -0
- package/dist/esm/lib/{control-ui-server-darwin.js → ui-controller-darwin.js} +6 -6
- package/dist/esm/lib/ui-controller-facade.d.ts +17 -0
- package/dist/esm/lib/{control-ui-server-facade.js → ui-controller-facade.js} +17 -11
- package/dist/esm/lib/ui-controller-linux.d.ts +5 -0
- package/dist/esm/lib/ui-controller-linux.js +48 -0
- package/dist/esm/lib/ui-controller-win32.d.ts +3 -0
- package/dist/esm/lib/ui-controller-win32.js +3 -0
- package/dist/esm/lib/ui-controller.d.ts +8 -0
- package/dist/esm/lib/{askui-control-server.js → ui-controller.js} +7 -7
- package/dist/esm/lib/unkown-error.d.ts +0 -2
- package/dist/esm/lib/unkown-error.js +0 -5
- package/dist/esm/lib/wayland-error.d.ts +2 -0
- package/dist/esm/lib/wayland-error.js +2 -0
- package/dist/esm/main.d.ts +3 -2
- package/dist/esm/main.js +3 -2
- package/dist/esm/shared/index.d.ts +1 -0
- package/dist/esm/shared/index.js +1 -0
- package/dist/esm/utils/analytics/analytics-interface.d.ts +3 -0
- package/dist/esm/utils/analytics/analytics-interface.js +1 -0
- package/dist/esm/utils/analytics/analytics.d.ts +5 -0
- package/dist/esm/utils/analytics/analytics.js +25 -0
- package/dist/esm/utils/analytics/index.d.ts +1 -0
- package/dist/esm/utils/analytics/index.js +1 -0
- package/dist/esm/utils/analytics/user-identifier-interface.d.ts +3 -0
- package/dist/esm/utils/analytics/user-identifier-interface.js +1 -0
- package/dist/esm/utils/analytics/user-identifier.d.ts +4 -0
- package/dist/esm/utils/analytics/user-identifier.js +18 -0
- package/dist/esm/utils/base_64_image/base-64-image-error.d.ts +2 -0
- package/dist/esm/utils/base_64_image/base-64-image-error.js +2 -0
- package/dist/esm/utils/base_64_image/base-64-image-path-error.d.ts +4 -0
- package/dist/esm/utils/base_64_image/base-64-image-path-error.js +7 -0
- package/dist/esm/utils/base_64_image/base-64-image-string-error.d.ts +4 -0
- package/dist/esm/utils/base_64_image/base-64-image-string-error.js +7 -0
- package/dist/esm/utils/base_64_image/base-64-image.d.ts +18 -0
- package/dist/esm/utils/base_64_image/base-64-image.js +79 -0
- package/dist/esm/utils/http/custom-errors/http-client-error.d.ts +0 -2
- package/dist/esm/utils/http/custom-errors/http-client-error.js +0 -5
- package/dist/esm/utils/http/http-client-got.d.ts +6 -5
- package/dist/esm/utils/http/http-client-got.js +11 -11
- package/dist/esm/utils/image-resize-errors/image-resizing-base-error.d.ts +0 -2
- package/dist/esm/utils/image-resize-errors/image-resizing-base-error.js +0 -5
- package/dist/esm/utils/image-resize-errors/index.d.ts +0 -1
- package/dist/esm/utils/image-resize-errors/index.js +0 -1
- package/dist/esm/utils/transformations.d.ts +0 -2
- package/dist/esm/utils/transformations.js +11 -39
- package/dist/example_projects_templates/typescript_jest/test/helper/jest.setup.ts +7 -7
- package/dist/example_projects_templates/typescript_jest/test/jest.config.ts +3 -0
- package/package.json +9 -6
- package/dist/cjs/execution/client-connection-state.js +0 -10
- package/dist/cjs/execution/client-error.d.ts +0 -2
- package/dist/cjs/execution/client-error.js +0 -6
- package/dist/cjs/execution/client-interface.d.ts +0 -13
- package/dist/cjs/execution/client.d.ts +0 -25
- package/dist/cjs/lib/askui-control-server.d.ts +0 -8
- package/dist/cjs/lib/control-ui-server-args.d.ts +0 -21
- package/dist/cjs/lib/control-ui-server-darwin.d.ts +0 -6
- package/dist/cjs/lib/control-ui-server-facade.d.ts +0 -16
- package/dist/cjs/lib/control-ui-server-linux.d.ts +0 -4
- package/dist/cjs/lib/control-ui-server-linux.js +0 -13
- package/dist/cjs/lib/control-ui-server-win32.d.ts +0 -3
- package/dist/cjs/lib/control-ui-server-win32.js +0 -7
- package/dist/esm/execution/client-connection-state.js +0 -7
- package/dist/esm/execution/client-error.d.ts +0 -2
- package/dist/esm/execution/client-error.js +0 -2
- package/dist/esm/execution/client-interface.d.ts +0 -13
- package/dist/esm/execution/client.d.ts +0 -25
- package/dist/esm/lib/askui-control-server.d.ts +0 -8
- package/dist/esm/lib/control-ui-server-args.d.ts +0 -21
- package/dist/esm/lib/control-ui-server-darwin.d.ts +0 -6
- package/dist/esm/lib/control-ui-server-facade.d.ts +0 -16
- package/dist/esm/lib/control-ui-server-linux.d.ts +0 -4
- package/dist/esm/lib/control-ui-server-linux.js +0 -9
- package/dist/esm/lib/control-ui-server-win32.d.ts +0 -3
- package/dist/esm/lib/control-ui-server-win32.js +0 -3
|
File without changes
|
|
@@ -2,21 +2,21 @@ import WebSocket from 'ws';
|
|
|
2
2
|
import { DetectedElement } from '../core/model/annotation-result/detected-element';
|
|
3
3
|
import { CaptureScreenshotResponse, ControlResponse, StartRecordingResponse, StopRecordingResponse, ReadRecordingPartResponse, InteractiveAnnotationResponse, GetProcessPidResponse } from '../core/runner-protocol';
|
|
4
4
|
import { ControlCommand } from '../core/ui-control-commands';
|
|
5
|
-
import {
|
|
6
|
-
export declare class
|
|
7
|
-
|
|
5
|
+
import { UiControllerClientConnectionState } from './ui-controller-client-connection-state';
|
|
6
|
+
export declare class UiControllerClient {
|
|
7
|
+
url: string;
|
|
8
8
|
private static readonly EMPTY_REJECT;
|
|
9
9
|
private static readonly EMPTY_RESOLVE;
|
|
10
10
|
private static readonly REQUEST_TIMEOUT_IN_MS;
|
|
11
11
|
ws: WebSocket;
|
|
12
|
-
connectionState:
|
|
12
|
+
connectionState: UiControllerClientConnectionState;
|
|
13
13
|
private timeout?;
|
|
14
14
|
private currentReject;
|
|
15
15
|
private currentResolve;
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(url: string);
|
|
17
17
|
private clearResponse;
|
|
18
18
|
private onMessage;
|
|
19
|
-
connect(): Promise<
|
|
19
|
+
connect(): Promise<UiControllerClientConnectionState>;
|
|
20
20
|
close(): void;
|
|
21
21
|
private sendAndReceive;
|
|
22
22
|
private send;
|
|
@@ -3,23 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.UiControllerClient = void 0;
|
|
7
7
|
const ws_1 = __importDefault(require("ws"));
|
|
8
8
|
const runner_protocol_1 = require("../core/runner-protocol");
|
|
9
9
|
const logger_1 = require("../lib/logger");
|
|
10
|
-
const
|
|
10
|
+
const ui_controller_client_connection_state_1 = require("./ui-controller-client-connection-state");
|
|
11
11
|
const read_recording_response_stream_handler_1 = require("./read-recording-response-stream-handler");
|
|
12
|
-
const
|
|
13
|
-
class
|
|
14
|
-
constructor(
|
|
15
|
-
this.
|
|
16
|
-
this.connectionState =
|
|
17
|
-
this.currentReject =
|
|
18
|
-
this.currentResolve =
|
|
12
|
+
const ui_control_client_error_1 = require("./ui-control-client-error");
|
|
13
|
+
class UiControllerClient {
|
|
14
|
+
constructor(url) {
|
|
15
|
+
this.url = url;
|
|
16
|
+
this.connectionState = ui_controller_client_connection_state_1.UiControllerClientConnectionState.NOT_CONNECTED;
|
|
17
|
+
this.currentReject = UiControllerClient.EMPTY_REJECT;
|
|
18
|
+
this.currentResolve = UiControllerClient.EMPTY_RESOLVE;
|
|
19
19
|
}
|
|
20
20
|
clearResponse() {
|
|
21
|
-
this.currentReject =
|
|
22
|
-
this.currentResolve =
|
|
21
|
+
this.currentReject = UiControllerClient.EMPTY_REJECT;
|
|
22
|
+
this.currentResolve = UiControllerClient.EMPTY_RESOLVE;
|
|
23
23
|
}
|
|
24
24
|
onMessage(data) {
|
|
25
25
|
clearTimeout(this.timeout);
|
|
@@ -36,24 +36,24 @@ class ControlYourUiClient {
|
|
|
36
36
|
this.clearResponse();
|
|
37
37
|
}
|
|
38
38
|
connect() {
|
|
39
|
-
this.connectionState =
|
|
39
|
+
this.connectionState = ui_controller_client_connection_state_1.UiControllerClientConnectionState.CONNECTING;
|
|
40
40
|
return new Promise((resolve, reject) => {
|
|
41
41
|
try {
|
|
42
|
-
this.ws = new ws_1.default(this.
|
|
42
|
+
this.ws = new ws_1.default(this.url);
|
|
43
43
|
this.ws.on('message', (data) => { this.onMessage(data); });
|
|
44
44
|
this.ws.on('open', () => {
|
|
45
|
-
this.connectionState =
|
|
45
|
+
this.connectionState = ui_controller_client_connection_state_1.UiControllerClientConnectionState.CONNECTED;
|
|
46
46
|
resolve(this.connectionState);
|
|
47
47
|
});
|
|
48
48
|
this.ws.on('error', (error) => {
|
|
49
|
-
this.connectionState =
|
|
50
|
-
reject(new
|
|
51
|
-
Probably it was not started. Makse sure you started
|
|
52
|
-
Url ${this.
|
|
49
|
+
this.connectionState = ui_controller_client_connection_state_1.UiControllerClientConnectionState.ERROR;
|
|
50
|
+
reject(new ui_control_client_error_1.UiControlClientError(`Connection to UI Controller cannot be established,
|
|
51
|
+
Probably it was not started. Makse sure you started UI Controller with this
|
|
52
|
+
Url ${this.url}. Error message ${error.message}`));
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
catch (error) {
|
|
56
|
-
reject(new
|
|
56
|
+
reject(new ui_control_client_error_1.UiControlClientError(`Connection to UI Controller cannot be established. Reason: ${error}`));
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
}
|
|
@@ -61,21 +61,21 @@ class ControlYourUiClient {
|
|
|
61
61
|
var _a;
|
|
62
62
|
(_a = this.ws) === null || _a === void 0 ? void 0 : _a.close();
|
|
63
63
|
}
|
|
64
|
-
sendAndReceive(msg, requestTimeout =
|
|
64
|
+
sendAndReceive(msg, requestTimeout = UiControllerClient.REQUEST_TIMEOUT_IN_MS) {
|
|
65
65
|
return new Promise((resolve, reject) => {
|
|
66
66
|
this.currentResolve = resolve;
|
|
67
67
|
this.currentReject = reject;
|
|
68
68
|
try {
|
|
69
69
|
this.send(msg, requestTimeout);
|
|
70
|
-
this.timeout = setTimeout(() => this.currentReject(`Request to
|
|
71
|
-
|
|
70
|
+
this.timeout = setTimeout(() => this.currentReject(`Request to UI Controller timed out.
|
|
71
|
+
It seems that the UI Controller is not running. Please, make sure that it is running when executing tests.`), UiControllerClient.REQUEST_TIMEOUT_IN_MS);
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
74
|
-
this.currentReject(`The communication to the
|
|
74
|
+
this.currentReject(`The communication to the UI Controller is broken. Reason: ${error}`);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
send(msg, _requestTimeout =
|
|
78
|
+
send(msg, _requestTimeout = UiControllerClient.REQUEST_TIMEOUT_IN_MS) {
|
|
79
79
|
if (!this.currentReject || !this.currentResolve) {
|
|
80
80
|
throw Error('Request is not finished! It is not possible to have multiple requests at the same time.');
|
|
81
81
|
}
|
|
@@ -113,7 +113,7 @@ class ControlYourUiClient {
|
|
|
113
113
|
return this.sendAndReceive(new runner_protocol_1.ControlRequest(controlCommand));
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
exports.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
exports.UiControllerClient = UiControllerClient;
|
|
117
|
+
UiControllerClient.EMPTY_REJECT = (_reason) => { };
|
|
118
|
+
UiControllerClient.EMPTY_RESOLVE = (_value) => { };
|
|
119
|
+
UiControllerClient.REQUEST_TIMEOUT_IN_MS = 30000;
|
|
@@ -16,9 +16,9 @@ var SupportedPlatform;
|
|
|
16
16
|
SupportedPlatform["WIN32"] = "win32";
|
|
17
17
|
})(SupportedPlatform || (SupportedPlatform = {}));
|
|
18
18
|
const binarySubPathsByPlatform = {
|
|
19
|
-
linux: ['linux', '
|
|
20
|
-
darwin: ['darwin', '
|
|
21
|
-
win32: ['windows', '
|
|
19
|
+
linux: ['linux', 'askui-ui-controller.AppImage'],
|
|
20
|
+
darwin: ['darwin', 'askui-ui-controller.dmg'],
|
|
21
|
+
win32: ['windows', 'askui-ui-controller.exe'],
|
|
22
22
|
};
|
|
23
23
|
function isSupportedPlatform(value) {
|
|
24
24
|
return Object.values(SupportedPlatform).includes(value);
|
|
@@ -32,14 +32,14 @@ function platform() {
|
|
|
32
32
|
}
|
|
33
33
|
exports.platform = platform;
|
|
34
34
|
function buildBinaryNotAvailbleError(binaryVersion) {
|
|
35
|
-
return new Error(`It seems that the
|
|
35
|
+
return new Error(`It seems that the UI Controller version "${binaryVersion}" for your system "${platform()} ${os_1.default.arch}" is not availble, Please contact as at info@askui.com for more information`);
|
|
36
36
|
}
|
|
37
37
|
function getBinaryPath(version) {
|
|
38
38
|
return path_1.default.join(__dirname, '..', '..', 'release', version, ...binarySubPathsByPlatform[platform()]);
|
|
39
39
|
}
|
|
40
40
|
exports.getBinaryPath = getBinaryPath;
|
|
41
41
|
function getBinaryDownloadUrl(binaryVersion) {
|
|
42
|
-
const baseUrl = `https://askui-public.s3.eu-central-1.amazonaws.com/releases/
|
|
42
|
+
const baseUrl = `https://askui-public.s3.eu-central-1.amazonaws.com/releases/askui-ui-controller/${binaryVersion}`;
|
|
43
43
|
const arch = os_1.default.arch();
|
|
44
44
|
return `${baseUrl}/${platform()}/${arch}/${binarySubPathsByPlatform[platform()][1]}`;
|
|
45
45
|
}
|
|
@@ -48,7 +48,7 @@ function downloadServerBinaries(binaryVersion) {
|
|
|
48
48
|
const url = getBinaryDownloadUrl(binaryVersion);
|
|
49
49
|
const binaryOutputPath = getBinaryPath(binaryVersion);
|
|
50
50
|
const binaryFolder = path_1.default.dirname(binaryOutputPath);
|
|
51
|
-
logger_1.logger.info(`Start downloading
|
|
51
|
+
logger_1.logger.info(`Start downloading UI Controller version "${binaryVersion}"`);
|
|
52
52
|
if (!(fs_1.default.existsSync(binaryFolder))) {
|
|
53
53
|
fs_1.default.mkdirSync(binaryFolder, { recursive: true });
|
|
54
54
|
}
|
|
@@ -65,8 +65,8 @@ function downloadServerBinaries(binaryVersion) {
|
|
|
65
65
|
reject(new Error('oops, an error during the downloaded occurred, try again with fresh install'));
|
|
66
66
|
})
|
|
67
67
|
.on('finish', () => {
|
|
68
|
-
logger_1.logger.info(`
|
|
69
|
-
logger_1.logger.debug(`Binary of
|
|
68
|
+
logger_1.logger.info(`UI Controller version ${binaryVersion} for your system "${platform()} ${os_1.default.arch}" was downloaded`);
|
|
69
|
+
logger_1.logger.debug(`Binary of UI Controller is located at "${binaryOutputPath}".`);
|
|
70
70
|
resolve();
|
|
71
71
|
});
|
|
72
72
|
downloadStream.pipe(fileWriterStream);
|
package/dist/cjs/lib/index.d.ts
CHANGED
package/dist/cjs/lib/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logger = exports.
|
|
3
|
+
exports.logger = exports.UiController = exports.TimeoutError = exports.UnkownError = void 0;
|
|
4
4
|
var unkown_error_1 = require("./unkown-error");
|
|
5
5
|
Object.defineProperty(exports, "UnkownError", { enumerable: true, get: function () { return unkown_error_1.UnkownError; } });
|
|
6
6
|
var timeout_error_1 = require("./timeout-error");
|
|
7
7
|
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return timeout_error_1.TimeoutError; } });
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "
|
|
8
|
+
var ui_controller_1 = require("./ui-controller");
|
|
9
|
+
Object.defineProperty(exports, "UiController", { enumerable: true, get: function () { return ui_controller_1.UiController; } });
|
|
10
10
|
var logger_1 = require("./logger");
|
|
11
11
|
Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
|
package/dist/cjs/lib/logger.js
CHANGED
|
@@ -23,7 +23,7 @@ const stream = (0, pino_pretty_1.default)({
|
|
|
23
23
|
const defaultLogLevel = 'info';
|
|
24
24
|
const pinoLevel = isProcessEnvLogLevelValid() ? process.env['LOG_LEVEL'] : defaultLogLevel;
|
|
25
25
|
const logger = (0, pino_1.default)({
|
|
26
|
-
name: '
|
|
26
|
+
name: 'askuiUiControlClient',
|
|
27
27
|
level: pinoLevel,
|
|
28
28
|
customLevels: {
|
|
29
29
|
verbose: 5,
|
|
@@ -2,10 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimeoutError = void 0;
|
|
4
4
|
class TimeoutError extends Error {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.contructorName = this.constructor.name;
|
|
8
|
-
this.name = this.contructorName;
|
|
9
|
-
}
|
|
10
5
|
}
|
|
11
6
|
exports.TimeoutError = TimeoutError;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LogLevels } from '../shared/log-levels';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for the askui UI Controller
|
|
4
|
+
*
|
|
5
|
+
* @param {number} display - Default: `0`
|
|
6
|
+
* You can choose on which display you want to excecute all tests.
|
|
7
|
+
* 0 is your main monitor.
|
|
8
|
+
* If you want to use your second monitor you can change
|
|
9
|
+
* the value to `1` (`2` for your third monitor etc.).
|
|
10
|
+
* @param {string} binaryVersion - Default: `'latest'`
|
|
11
|
+
* Choose the version of the askui UI Controller Server.
|
|
12
|
+
* @param {number} port - Default: `6769`
|
|
13
|
+
* The port the askui UI Controller is running on.
|
|
14
|
+
* @param {string} host - Default: `'127.0.0.1'`
|
|
15
|
+
* The host the askui UI Controller is running on.
|
|
16
|
+
* @param {boolean} minimize - Default: `true`
|
|
17
|
+
* askui UI Controller will be started as minimized window.
|
|
18
|
+
* @param {boolean} overWriteBinary - Default: `false`
|
|
19
|
+
* Download the provided Version of askui UI Controller.
|
|
20
|
+
* If a version is already downloaded. This version will be overwritten
|
|
21
|
+
* @param {LogLevels} logLevel - Default: `'debug'`
|
|
22
|
+
* You can use different types of Log Level.
|
|
23
|
+
* Options: "fatal", "error", "warn", "info", "debug", "trace", "silent", "verbose".
|
|
24
|
+
* @param {string} logFilePath - Default: `'<temp-dir>/askui/askui-server.log'`
|
|
25
|
+
* It is possible to specify a path for your log files.
|
|
26
|
+
* Per default we create the askui-server.log file and askui folder in your temp folder.
|
|
27
|
+
*/
|
|
28
|
+
export interface UiControllerArgs {
|
|
29
|
+
readonly display?: number;
|
|
30
|
+
readonly binaryVersion?: string;
|
|
31
|
+
readonly port?: number;
|
|
32
|
+
readonly host?: string;
|
|
33
|
+
readonly minimize?: boolean;
|
|
34
|
+
readonly overWriteBinary?: boolean;
|
|
35
|
+
readonly logLevel?: LogLevels;
|
|
36
|
+
readonly logFilePath?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface UiControllerArgsWithDefaults extends UiControllerArgs {
|
|
39
|
+
readonly display: number;
|
|
40
|
+
readonly binaryVersion: string;
|
|
41
|
+
readonly overWriteBinary: boolean;
|
|
42
|
+
readonly port: number;
|
|
43
|
+
readonly host: string;
|
|
44
|
+
readonly logLevel?: LogLevels;
|
|
45
|
+
}
|
|
46
|
+
export declare function createArgsWithDefaults(args?: UiControllerArgs): UiControllerArgsWithDefaults;
|
|
47
|
+
export declare function createCliFlagsFromArgs(args: UiControllerArgsWithDefaults): string[];
|
|
File without changes
|
|
File without changes
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const ui_controller_args_1 = require("./ui-controller-args");
|
|
4
4
|
describe('createCliFlagsFromArgs()', () => {
|
|
5
5
|
test('test createCliFlagsFromArgs should return -d 0 as default output', () => {
|
|
6
6
|
const expected = ['-d 0', '-p 6769', '--host 127.0.0.1', '-m ', '--log-level debug'];
|
|
7
|
-
const argsWithDefaults = (0,
|
|
8
|
-
const actual = (0,
|
|
7
|
+
const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)();
|
|
8
|
+
const actual = (0, ui_controller_args_1.createCliFlagsFromArgs)(argsWithDefaults);
|
|
9
9
|
expect(actual).toStrictEqual(expected);
|
|
10
10
|
});
|
|
11
11
|
test('test createCliFlagsFromArgs output should include -d 0 when no display was selected', () => {
|
|
12
12
|
const expected = ['-d 0', '-p 6777', '--host 0.0.0.0', '-m ', '--log-level debug'];
|
|
13
|
-
const argsWithDefaults = (0,
|
|
14
|
-
const actual = (0,
|
|
13
|
+
const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)({ port: 6777, host: '0.0.0.0' });
|
|
14
|
+
const actual = (0, ui_controller_args_1.createCliFlagsFromArgs)(argsWithDefaults);
|
|
15
15
|
expect(actual).toStrictEqual(expected);
|
|
16
16
|
});
|
|
17
17
|
test('test createCliFlagsFromArgs output should include the display that was selected ', () => {
|
|
18
18
|
const expected = ['-d 99', '-p 6777', '--host 0.0.0.0', '-m ', '--log-level debug'];
|
|
19
|
-
const argsWithDefaults = (0,
|
|
20
|
-
const actual = (0,
|
|
19
|
+
const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)({ port: 6777, host: '0.0.0.0', display: 99 });
|
|
20
|
+
const actual = (0, ui_controller_args_1.createCliFlagsFromArgs)(argsWithDefaults);
|
|
21
21
|
expect(actual).toStrictEqual(expected);
|
|
22
22
|
});
|
|
23
23
|
});
|
|
@@ -3,18 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.UiControllerDarwin = void 0;
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const
|
|
10
|
+
const ui_controller_facade_1 = require("./ui-controller-facade");
|
|
11
11
|
const logger_1 = require("./logger");
|
|
12
|
-
class
|
|
12
|
+
class UiControllerDarwin extends ui_controller_facade_1.UiControllerFacade {
|
|
13
13
|
makeBinaryExecutable() {
|
|
14
14
|
this.makeDiskImageExecutable();
|
|
15
15
|
}
|
|
16
16
|
getStartingCommand() {
|
|
17
|
-
return
|
|
17
|
+
return `"${path_1.default.dirname(this.binaryPath)}/controlui-server.app/Contents/MacOS/controlui-server"`;
|
|
18
18
|
}
|
|
19
19
|
makeDiskImageExecutable() {
|
|
20
20
|
const mountPoint = '/Volumes/controlui-server.dmg';
|
|
@@ -24,15 +24,15 @@ class ControlUiServerDarwin extends control_ui_server_facade_1.ControlUiServerFa
|
|
|
24
24
|
'-quiet',
|
|
25
25
|
'-noautofsck',
|
|
26
26
|
'-noautoopen',
|
|
27
|
-
`-mountpoint ${mountPoint}`,
|
|
28
|
-
this.binaryPath
|
|
27
|
+
`-mountpoint "${mountPoint}"`,
|
|
28
|
+
`"${this.binaryPath}"`,
|
|
29
29
|
].join(' '));
|
|
30
30
|
const appBaseName = 'controlui-server.app';
|
|
31
31
|
const appSrcPath = `${mountPoint}/${appBaseName}`;
|
|
32
32
|
const appDestPath = `${path_1.default.dirname(this.binaryPath)}/${appBaseName}`;
|
|
33
33
|
fs_extra_1.default.removeSync(appDestPath);
|
|
34
34
|
fs_extra_1.default.copySync(appSrcPath, appDestPath);
|
|
35
|
-
(0, child_process_1.exec)(`hdiutil detach ${mountPoint}`, (_exception, stdout) => logger_1.logger.debug(stdout));
|
|
35
|
+
(0, child_process_1.exec)(`hdiutil detach "${mountPoint}"`, (_exception, stdout) => logger_1.logger.debug(stdout));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
exports.
|
|
38
|
+
exports.UiControllerDarwin = UiControllerDarwin;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UiControllerArgs, UiControllerArgsWithDefaults } from './ui-controller-args';
|
|
2
|
+
export declare abstract class UiControllerFacade {
|
|
3
|
+
protected binaryPath: string;
|
|
4
|
+
protected serverLogFile: string;
|
|
5
|
+
protected readonly DefaultmaxWaitingForStartingInMs: number;
|
|
6
|
+
start(args?: UiControllerArgs, maxWaitingForStartingInSeconds?: number): Promise<void>;
|
|
7
|
+
stop(args?: UiControllerArgs, forceStop?: boolean): Promise<void>;
|
|
8
|
+
protected serverLogFilePath(args?: UiControllerArgsWithDefaults): UiControllerArgsWithDefaults;
|
|
9
|
+
protected killPort(port: number, forceStop?: boolean): Promise<void>;
|
|
10
|
+
protected getStartingCommand(): string;
|
|
11
|
+
protected makeBinaryExecutable(): void;
|
|
12
|
+
protected runPreStartChecks(): Promise<void>;
|
|
13
|
+
protected waitUntilStarted(args: UiControllerArgsWithDefaults, maxWaitingForStartingInSeconds?: number): Promise<void>;
|
|
14
|
+
private isBinaryValid;
|
|
15
|
+
private getBinary;
|
|
16
|
+
private startWithDefaults;
|
|
17
|
+
}
|
|
@@ -12,42 +12,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.UiControllerFacade = void 0;
|
|
16
16
|
const child_process_1 = require("child_process");
|
|
17
17
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
18
18
|
const wait_port_1 = __importDefault(require("wait-port"));
|
|
19
19
|
const fkill_1 = __importDefault(require("fkill"));
|
|
20
20
|
const os_1 = __importDefault(require("os"));
|
|
21
21
|
const path_1 = __importDefault(require("path"));
|
|
22
|
-
const
|
|
22
|
+
const ui_controller_args_1 = require("./ui-controller-args");
|
|
23
23
|
const download_binaries_1 = require("./download-binaries");
|
|
24
24
|
const logger_1 = require("./logger");
|
|
25
25
|
const timeout_error_1 = require("./timeout-error");
|
|
26
26
|
const unkown_error_1 = require("./unkown-error");
|
|
27
|
-
class
|
|
27
|
+
class UiControllerFacade {
|
|
28
28
|
constructor() {
|
|
29
29
|
this.binaryPath = (0, download_binaries_1.getBinaryPath)('latest');
|
|
30
30
|
this.DefaultmaxWaitingForStartingInMs = 30 * 1000;
|
|
31
31
|
}
|
|
32
32
|
start(args, maxWaitingForStartingInSeconds) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
|
|
34
|
+
yield this.runPreStartChecks();
|
|
35
|
+
const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)(args);
|
|
35
36
|
const argsWithLogPath = this.serverLogFilePath(argsWithDefaults);
|
|
36
37
|
this.binaryPath = (0, download_binaries_1.getBinaryPath)(argsWithLogPath.binaryVersion);
|
|
37
38
|
yield this.getBinary(argsWithLogPath.binaryVersion, argsWithLogPath.overWriteBinary);
|
|
38
39
|
this.makeBinaryExecutable();
|
|
39
|
-
logger_1.logger.debug(`
|
|
40
|
+
logger_1.logger.debug(`UI Controller log path "${this.serverLogFile}"`);
|
|
40
41
|
yield this.startWithDefaults(argsWithLogPath, maxWaitingForStartingInSeconds);
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
stop(args, forceStop) {
|
|
44
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
46
|
try {
|
|
46
|
-
const argsWithDefaults = (0,
|
|
47
|
+
const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)(args);
|
|
47
48
|
yield this.killPort(argsWithDefaults.port, forceStop);
|
|
48
49
|
}
|
|
49
50
|
catch (err) {
|
|
50
|
-
throw new Error(`An unknown error occured while closing of the
|
|
51
|
+
throw new Error(`An unknown error occured while closing of the UI Controller. Log file: "${this.serverLogFile}". ErrorReason: ${err}`);
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
54
|
}
|
|
@@ -57,7 +58,7 @@ class ControlUiServerFacade {
|
|
|
57
58
|
return args;
|
|
58
59
|
}
|
|
59
60
|
const tmpDir = fs_extra_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'askui'));
|
|
60
|
-
this.serverLogFile = path_1.default.join(tmpDir, 'askui-
|
|
61
|
+
this.serverLogFile = path_1.default.join(tmpDir, 'askui-ui-controller.log');
|
|
61
62
|
const argPath = { logFilePath: this.serverLogFile };
|
|
62
63
|
return Object.assign(argPath, args);
|
|
63
64
|
}
|
|
@@ -69,13 +70,17 @@ class ControlUiServerFacade {
|
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
72
|
getStartingCommand() {
|
|
72
|
-
return this.binaryPath
|
|
73
|
+
return `"${this.binaryPath}"`;
|
|
73
74
|
}
|
|
74
75
|
// eslint-disable-next-line class-methods-use-this
|
|
75
76
|
makeBinaryExecutable() {
|
|
76
77
|
/* Executable out of the box */
|
|
77
78
|
}
|
|
78
79
|
// eslint-disable-next-line class-methods-use-this
|
|
80
|
+
runPreStartChecks() {
|
|
81
|
+
return Promise.resolve();
|
|
82
|
+
}
|
|
83
|
+
// eslint-disable-next-line class-methods-use-this
|
|
79
84
|
waitUntilStarted(args, maxWaitingForStartingInSeconds) {
|
|
80
85
|
return new Promise((resolve, reject) => {
|
|
81
86
|
try {
|
|
@@ -95,7 +100,7 @@ class ControlUiServerFacade {
|
|
|
95
100
|
});
|
|
96
101
|
}
|
|
97
102
|
catch (err) {
|
|
98
|
-
reject(new unkown_error_1.UnkownError(`An unknown error occured while waiting for the
|
|
103
|
+
reject(new unkown_error_1.UnkownError(`An unknown error occured while waiting for the UI Controller: ${err}`));
|
|
99
104
|
}
|
|
100
105
|
});
|
|
101
106
|
}
|
|
@@ -107,25 +112,26 @@ class ControlUiServerFacade {
|
|
|
107
112
|
getBinary(binaryVersion, overWriteBinary = false) {
|
|
108
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
114
|
if (!fs_extra_1.default.existsSync(this.binaryPath) || overWriteBinary || !this.isBinaryValid()) {
|
|
110
|
-
logger_1.logger.debug(`Currently, no binary of the
|
|
115
|
+
logger_1.logger.debug(`Currently, no binary of the UI Controller is available at "${this.binaryPath}"`);
|
|
111
116
|
yield (0, download_binaries_1.downloadServerBinaries)(binaryVersion);
|
|
112
117
|
}
|
|
113
118
|
else {
|
|
114
|
-
logger_1.logger.debug(`Binary of
|
|
119
|
+
logger_1.logger.debug(`Binary of UI Controller is already present at "${this.binaryPath}".`);
|
|
115
120
|
}
|
|
116
121
|
});
|
|
117
122
|
}
|
|
118
123
|
startWithDefaults(args, maxWaitingForStartingInSeconds) {
|
|
119
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
125
|
try {
|
|
121
|
-
logger_1.logger.debug('Starting the
|
|
122
|
-
(0, child_process_1.spawn)(this.getStartingCommand(), (0,
|
|
126
|
+
logger_1.logger.debug('Starting the UI Controller...');
|
|
127
|
+
(0, child_process_1.spawn)(this.getStartingCommand(), (0, ui_controller_args_1.createCliFlagsFromArgs)(args), { shell: true });
|
|
123
128
|
yield this.waitUntilStarted(args, maxWaitingForStartingInSeconds);
|
|
124
129
|
}
|
|
125
130
|
catch (err) {
|
|
126
|
-
throw new Error(`The
|
|
131
|
+
throw new Error(`The UI Controller could not be started. Log file : ${this.serverLogFile}. ErrorReason: ${err}
|
|
132
|
+
Check this website for more information: https://docs.askui.com/docs/general/Troubleshooting/askui-ui-controller-starting-problems`);
|
|
127
133
|
}
|
|
128
134
|
});
|
|
129
135
|
}
|
|
130
136
|
}
|
|
131
|
-
exports.
|
|
137
|
+
exports.UiControllerFacade = UiControllerFacade;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UiControllerLinux = void 0;
|
|
13
|
+
const child_process_1 = require("child_process");
|
|
14
|
+
const util_1 = require("util");
|
|
15
|
+
const ui_controller_facade_1 = require("./ui-controller-facade");
|
|
16
|
+
const logger_1 = require("./logger");
|
|
17
|
+
const wayland_error_1 = require("./wayland-error");
|
|
18
|
+
const libfuse_error_1 = require("./libfuse-error");
|
|
19
|
+
class UiControllerLinux extends ui_controller_facade_1.UiControllerFacade {
|
|
20
|
+
// eslint-disable-next-line class-methods-use-this
|
|
21
|
+
makeBinaryExecutable() {
|
|
22
|
+
(0, child_process_1.exec)(`chmod +x "${this.binaryPath}"`, (_exception, stdout) => logger_1.logger.debug(stdout));
|
|
23
|
+
}
|
|
24
|
+
// eslint-disable-next-line class-methods-use-this
|
|
25
|
+
runPreStartChecks() {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const runCommand = (0, util_1.promisify)(child_process_1.exec);
|
|
28
|
+
const waylandStatus = yield runCommand('echo $WAYLAND_DISPLAY');
|
|
29
|
+
if (waylandStatus.stdout.trim().includes('wayland')) {
|
|
30
|
+
throw new wayland_error_1.WaylandError('Wayland is not supported: https://docs.askui.com/docs/general/Troubleshooting/askui-ui-controller-starting-problems#wayland');
|
|
31
|
+
}
|
|
32
|
+
/* First we want to check if the user is using a debian distribution.
|
|
33
|
+
* and in the following if libfuse2 is installed.
|
|
34
|
+
* With Ubunutu 22.04 libfuse2 is not installed per default.
|
|
35
|
+
* For more information: https://discourse.joplinapp.org/t/appimage-incompatibility-in-ubuntu-22-04/25173
|
|
36
|
+
*/
|
|
37
|
+
try {
|
|
38
|
+
yield runCommand('dpkg --version');
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
yield runCommand('dpkg -s libfuse2 | grep Status');
|
|
45
|
+
}
|
|
46
|
+
catch (_a) {
|
|
47
|
+
throw new libfuse_error_1.LibfuseError('Libfuse2 package is missing: https://docs.askui.com/docs/general/Troubleshooting/askui-ui-controller-starting-problems#libfuse2');
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.UiControllerLinux = UiControllerLinux;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UiControllerWin32 = void 0;
|
|
4
|
+
const ui_controller_facade_1 = require("./ui-controller-facade");
|
|
5
|
+
class UiControllerWin32 extends ui_controller_facade_1.UiControllerFacade {
|
|
6
|
+
}
|
|
7
|
+
exports.UiControllerWin32 = UiControllerWin32;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UiControllerArgs } from './ui-controller-args';
|
|
2
|
+
export declare class UiController {
|
|
3
|
+
private args?;
|
|
4
|
+
private server;
|
|
5
|
+
constructor(args?: UiControllerArgs | undefined);
|
|
6
|
+
start(timeoutInSeconds?: number): Promise<void>;
|
|
7
|
+
stop(forceStop?: boolean): Promise<void>;
|
|
8
|
+
}
|