@signageos/front-applet 8.0.2 → 8.1.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/dist/bundle.js +5 -5
- package/dist/bundle.js.map +1 -1
- package/docs/fpath/index.md +1 -1
- package/docs/sos/browser.md +27 -17
- package/docs/sos/command.md +21 -9
- package/docs/sos/debug.md +17 -0
- package/docs/sos/deviceInfo.md +26 -0
- package/docs/sos/display.md +17 -0
- package/docs/sos/fileSystem.md +62 -1
- package/docs/sos/hardware/index.md +36 -1
- package/docs/sos/hardware/led.md +11 -0
- package/docs/sos/index.md +14 -12
- package/docs/sos/input.md +13 -0
- package/docs/sos/monitors.md +16 -1
- package/docs/sos/native/mdc.md +0 -9
- package/docs/sos/offline/index.md +0 -14
- package/docs/sos/osd.md +15 -0
- package/docs/sos/proofOfPlay.md +14 -21
- package/docs/sos/sync.md +3 -17
- package/docs/sos_management/audio.md +14 -1
- package/docs/sos_management/firmware.md +26 -0
- package/docs/sos_management/index.md +1 -1
- package/docs/sos_management/network.md +3 -3
- package/docs/sos_management/package.md +7 -16
- package/docs/sos_management/power.md +154 -1
- package/docs/sos_management/proxy.md +25 -0
- package/docs/sos_management/remoteControl.md +36 -0
- package/docs/sos_management/screen.md +35 -20
- package/docs/sos_management/time.md +45 -5
- package/docs/sos_management/wifi.md +82 -18
- package/es6/FrontApplet/DeviceInfo/IDeviceInfo.d.ts +1 -0
- package/es6/FrontApplet/FileSystem/FileSystem.d.ts +9 -0
- package/es6/FrontApplet/FileSystem/FileSystem.js +13 -0
- package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
- package/es6/FrontApplet/FileSystem/IFileSystem.d.ts +1 -0
- package/es6/FrontApplet/FrontApplet.d.ts +8 -2
- package/es6/FrontApplet/FrontApplet.js +8 -2
- package/es6/FrontApplet/FrontApplet.js.map +1 -1
- package/es6/FrontApplet/Management/Firmware/Firmware.d.ts +14 -0
- package/es6/FrontApplet/Management/Firmware/Firmware.js +8 -0
- package/es6/FrontApplet/Management/Firmware/Firmware.js.map +1 -1
- package/es6/FrontApplet/Management/Package/Package.d.ts +0 -8
- package/es6/FrontApplet/Management/Package/Package.js +0 -8
- package/es6/FrontApplet/Management/Package/Package.js.map +1 -1
- package/es6/FrontApplet/Management/Power/IPower.d.ts +35 -0
- package/es6/FrontApplet/Management/Power/IPower.js +25 -0
- package/es6/FrontApplet/Management/Power/IPower.js.map +1 -1
- package/es6/FrontApplet/Management/Power/Power.d.ts +80 -2
- package/es6/FrontApplet/Management/Power/Power.js +125 -1
- package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
- package/es6/FrontApplet/Management/Power/PowerHelper.d.ts +3 -0
- package/es6/FrontApplet/Management/Power/PowerHelper.js +12 -0
- package/es6/FrontApplet/Management/Power/PowerHelper.js.map +1 -0
- package/es6/FrontApplet/Management/Proxy/Proxy.d.ts +13 -0
- package/es6/FrontApplet/Management/Proxy/Proxy.js +13 -0
- package/es6/FrontApplet/Management/Proxy/Proxy.js.map +1 -1
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.d.ts +18 -0
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js +18 -0
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js.map +1 -1
- package/es6/FrontApplet/Management/Screen/IScreen.d.ts +5 -0
- package/es6/FrontApplet/Management/Screen/Screen.d.ts +18 -2
- package/es6/FrontApplet/Management/Screen/Screen.js +32 -23
- package/es6/FrontApplet/Management/Screen/Screen.js.map +1 -1
- package/es6/FrontApplet/Management/Time/Time.d.ts +15 -3
- package/es6/FrontApplet/Management/Time/Time.js +9 -0
- package/es6/FrontApplet/Management/Time/Time.js.map +1 -1
- package/es6/FrontApplet/Management/Wifi/IWifi.d.ts +3 -0
- package/es6/FrontApplet/Management/Wifi/IWifi.js +1 -0
- package/es6/FrontApplet/Management/Wifi/IWifi.js.map +1 -1
- package/es6/FrontApplet/Management/Wifi/Wifi.d.ts +56 -19
- package/es6/FrontApplet/Management/Wifi/Wifi.js +59 -20
- package/es6/FrontApplet/Management/Wifi/Wifi.js.map +1 -1
- package/es6/FrontApplet/Monitors/Monitors.d.ts +1 -1
- package/es6/FrontApplet/Monitors/Monitors.js +1 -1
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.d.ts +0 -10
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js +0 -10
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -1
- package/es6/Monitoring/DeviceInfo/deviceInfoCommands.d.ts +29 -0
- package/es6/Monitoring/DeviceInfo/deviceInfoCommands.js +10 -0
- package/es6/Monitoring/DeviceInfo/deviceInfoCommands.js.map +1 -0
- package/es6/Monitoring/DeviceInfo/handleDeviceInfoRequests.d.ts +5 -0
- package/es6/Monitoring/DeviceInfo/handleDeviceInfoRequests.js +30 -0
- package/es6/Monitoring/DeviceInfo/handleDeviceInfoRequests.js.map +1 -0
- package/es6/Monitoring/FileSystem/fileSystemCommands.d.ts +21 -1
- package/es6/Monitoring/FileSystem/fileSystemCommands.js +5 -1
- package/es6/Monitoring/FileSystem/fileSystemCommands.js.map +1 -1
- package/es6/Monitoring/FileSystem/handleFileSystemRequests.js +14 -0
- package/es6/Monitoring/FileSystem/handleFileSystemRequests.js.map +1 -1
- package/es6/Monitoring/Management/Power/handlePowerRequests.js +27 -0
- package/es6/Monitoring/Management/Power/handlePowerRequests.js.map +1 -1
- package/es6/Monitoring/Management/Power/powerCommands.d.ts +41 -1
- package/es6/Monitoring/Management/Power/powerCommands.js +9 -1
- package/es6/Monitoring/Management/Power/powerCommands.js.map +1 -1
- package/es6/Monitoring/Management/Screen/handleScreenRequests.js +3 -1
- package/es6/Monitoring/Management/Screen/handleScreenRequests.js.map +1 -1
- package/es6/Monitoring/Management/Screen/screenCommands.d.ts +2 -0
- package/es6/Monitoring/Management/Screen/screenCommands.js.map +1 -1
- package/es6/Monitoring/Monitoring.js +2 -0
- package/es6/Monitoring/Monitoring.js.map +1 -1
- package/es6/fpath.d.ts +1 -1
- package/es6/fpath.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import IPostMessage from '../../IPostMessage';
|
|
2
|
-
import {
|
|
2
|
+
import { ITimer, TimerType } from '../helpers/TimerHelper';
|
|
3
3
|
import { IProprietaryTimer, ProprietaryTimerType } from '../helpers/ProprietaryTimerHelper';
|
|
4
|
-
import IPower from './IPower';
|
|
4
|
+
import IPower, { IScheduledRebootActions, WeekdayType } from './IPower';
|
|
5
5
|
/**
|
|
6
6
|
* The `sos.management.power` API groups together methods related to the power state of the device. Such as rebooting, shutting down,
|
|
7
7
|
* setting timers.
|
|
@@ -15,18 +15,27 @@ export default class Power implements IPower {
|
|
|
15
15
|
* The `systemReboot()` method initializes a system reboot.
|
|
16
16
|
*
|
|
17
17
|
* @since 3.0.0
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* await sos.management.power.systemReboot();
|
|
18
21
|
*/
|
|
19
22
|
systemReboot(): Promise<void>;
|
|
20
23
|
/**
|
|
21
24
|
* The `appRestart()` method initializes a restart of the signageOS app.
|
|
22
25
|
*
|
|
23
26
|
* @since 3.0.0
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await sos.management.power.appRestart();
|
|
24
30
|
*/
|
|
25
31
|
appRestart(): Promise<void>;
|
|
26
32
|
/**
|
|
27
33
|
* The `getTimers()` method returns a list of currently set native timers.
|
|
28
34
|
*
|
|
29
35
|
* @since 4.0.0
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* const timers = await sos.management.power.getTimers();
|
|
30
39
|
*/
|
|
31
40
|
getTimers(): Promise<ITimer[]>;
|
|
32
41
|
/**
|
|
@@ -39,6 +48,9 @@ export default class Power implements IPower {
|
|
|
39
48
|
* @param volume The volume level set when the device is turned on.
|
|
40
49
|
*
|
|
41
50
|
* @since 3.0.0
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* await sos.management.power.setTimer("TIMER_1", "08:00", "22:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
42
54
|
*/
|
|
43
55
|
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays: string[], volume: number): Promise<void>;
|
|
44
56
|
/**
|
|
@@ -47,6 +59,9 @@ export default class Power implements IPower {
|
|
|
47
59
|
* @param type The type of the timer (`TIMER_1`, ..., `TIMER_7`).
|
|
48
60
|
*
|
|
49
61
|
* @since 4.0.0
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* await sos.management.power.unsetTimer("TIMER_2");
|
|
50
65
|
*/
|
|
51
66
|
unsetTimer(type: keyof typeof TimerType): Promise<void>;
|
|
52
67
|
/**
|
|
@@ -54,6 +69,9 @@ export default class Power implements IPower {
|
|
|
54
69
|
* [proprietary timers](https://docs.signageos.io/hc/en-us/articles/4416384202642-Timers#h_01HCD14GEDP96AZV58NRSN2HNQ).
|
|
55
70
|
*
|
|
56
71
|
* @since 5.10.0
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* const timers = await sos.management.power.getProprietaryTimers();
|
|
57
75
|
*/
|
|
58
76
|
getProprietaryTimers(): Promise<IProprietaryTimer[]>;
|
|
59
77
|
/**
|
|
@@ -67,6 +85,9 @@ export default class Power implements IPower {
|
|
|
67
85
|
* @param keepAppletRunning If `true`, the applet will be kept running when the timer is active on certain devices.
|
|
68
86
|
*
|
|
69
87
|
* @since 5.10.0
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* await sos.management.power.setProprietaryTimer("TIMER_20", "08:00", "22:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
70
91
|
*/
|
|
71
92
|
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays: string[], keepAppletRunning?: boolean): Promise<void>;
|
|
72
93
|
/**
|
|
@@ -76,7 +97,64 @@ export default class Power implements IPower {
|
|
|
76
97
|
* @param type The type of the timer (`TIMER_1`, ..., `TIMER_7`).
|
|
77
98
|
*
|
|
78
99
|
* @since 5.10.0
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* await sos.management.power.unsetProprietaryTimer("TIMER_2");
|
|
79
103
|
*/
|
|
80
104
|
unsetProprietaryTimer(type: ProprietaryTimerType): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Removes all scheduled reboot rules from the device.
|
|
107
|
+
*
|
|
108
|
+
* @since 8.1.0
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* await sos.management.power.clearScheduledReboots();
|
|
112
|
+
*/
|
|
113
|
+
clearScheduledReboots(): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Returns all scheduled reboot rules on the device.
|
|
116
|
+
*
|
|
117
|
+
* @since 8.1.0
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* await sos.management.power.getScheduledReboots();
|
|
121
|
+
*/
|
|
122
|
+
getScheduledReboots(): Promise<IScheduledRebootActions[]>;
|
|
123
|
+
/**
|
|
124
|
+
* Removes scheduled reboot rule from the device.
|
|
125
|
+
* @param id {string} - ID of the rule to be removed.
|
|
126
|
+
*
|
|
127
|
+
* @since 8.1.0
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* // Get scheduled reboots
|
|
131
|
+
* const scheduledReboots = await sos.management.power.getScheduledReboots();
|
|
132
|
+
*
|
|
133
|
+
* // Remove scheduled reboot
|
|
134
|
+
* await sos.management.power.removeScheduledReboot(scheduledReboots[0].id);
|
|
135
|
+
*/
|
|
136
|
+
removeScheduledReboot(id: string): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Schedule automatic reboot on the device. Calling this function will create one rule.
|
|
139
|
+
* It is possible to set multiple rules, which can be later obtained by `getScheduledReboots` function.
|
|
140
|
+
*
|
|
141
|
+
* :::note
|
|
142
|
+
* - Setting new scheduled reboot on device might take up to 10 minutes to show in Box.
|
|
143
|
+
* - Every new scheduled reboot rule gets unique identifier generated by device, it might be later returned by `getScheduledReboots()`.
|
|
144
|
+
* :::
|
|
145
|
+
*
|
|
146
|
+
* @param weekdays {@link WeekdayType[]} - Array of weekdays when the reboot should be executed.
|
|
147
|
+
* @param time {string} - Time when the reboot should be executed. Format is `HH:mm:ss`.
|
|
148
|
+
*
|
|
149
|
+
* @since 8.1.0
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* // Schedule reboot every Monday at 3:00 AM
|
|
153
|
+
* await sos.management.power.setScheduledReboot(["MONDAY"], "03:00:00");
|
|
154
|
+
*
|
|
155
|
+
* // Schedule reboot every Monday and Friday at 7:30 PM / 19:30
|
|
156
|
+
* await sos.management.power.setScheduledReboot(["MONDAY", "FRIDAY"], "19:30:00");
|
|
157
|
+
*/
|
|
158
|
+
setScheduledReboot(weekdays: WeekdayType[], time: string): Promise<void>;
|
|
81
159
|
private getMessage;
|
|
82
160
|
}
|
|
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const TimerHelper_1 = require("../helpers/TimerHelper");
|
|
7
7
|
const Validate_1 = __importDefault(require("../../Validate/Validate"));
|
|
8
|
+
const IPower_1 = require("./IPower");
|
|
9
|
+
const PowerHelper_1 = require("./PowerHelper");
|
|
8
10
|
// TODO: maybe a better description
|
|
9
11
|
/**
|
|
10
12
|
* The `sos.management.power` API groups together methods related to the power state of the device. Such as rebooting, shutting down,
|
|
@@ -22,6 +24,9 @@ class Power {
|
|
|
22
24
|
* The `systemReboot()` method initializes a system reboot.
|
|
23
25
|
*
|
|
24
26
|
* @since 3.0.0
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await sos.management.power.systemReboot();
|
|
25
30
|
*/
|
|
26
31
|
async systemReboot() {
|
|
27
32
|
await this.postMessage({
|
|
@@ -32,6 +37,9 @@ class Power {
|
|
|
32
37
|
* The `appRestart()` method initializes a restart of the signageOS app.
|
|
33
38
|
*
|
|
34
39
|
* @since 3.0.0
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await sos.management.power.appRestart();
|
|
35
43
|
*/
|
|
36
44
|
async appRestart() {
|
|
37
45
|
await this.postMessage({
|
|
@@ -42,6 +50,9 @@ class Power {
|
|
|
42
50
|
* The `getTimers()` method returns a list of currently set native timers.
|
|
43
51
|
*
|
|
44
52
|
* @since 4.0.0
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* const timers = await sos.management.power.getTimers();
|
|
45
56
|
*/
|
|
46
57
|
async getTimers() {
|
|
47
58
|
const { timers } = await this.postMessage({
|
|
@@ -59,6 +70,9 @@ class Power {
|
|
|
59
70
|
* @param volume The volume level set when the device is turned on.
|
|
60
71
|
*
|
|
61
72
|
* @since 3.0.0
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await sos.management.power.setTimer("TIMER_1", "08:00", "22:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
62
76
|
*/
|
|
63
77
|
async setTimer(type, timeOn, timeOff, weekdays, volume) {
|
|
64
78
|
if (typeof TimerHelper_1.TimerType[type] === 'undefined') {
|
|
@@ -98,6 +112,9 @@ class Power {
|
|
|
98
112
|
* @param type The type of the timer (`TIMER_1`, ..., `TIMER_7`).
|
|
99
113
|
*
|
|
100
114
|
* @since 4.0.0
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* await sos.management.power.unsetTimer("TIMER_2");
|
|
101
118
|
*/
|
|
102
119
|
async unsetTimer(type) {
|
|
103
120
|
if (typeof TimerHelper_1.TimerType[type] === 'undefined') {
|
|
@@ -110,6 +127,9 @@ class Power {
|
|
|
110
127
|
* [proprietary timers](https://docs.signageos.io/hc/en-us/articles/4416384202642-Timers#h_01HCD14GEDP96AZV58NRSN2HNQ).
|
|
111
128
|
*
|
|
112
129
|
* @since 5.10.0
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* const timers = await sos.management.power.getProprietaryTimers();
|
|
113
133
|
*/
|
|
114
134
|
async getProprietaryTimers() {
|
|
115
135
|
const { timers } = await this.postMessage({
|
|
@@ -128,6 +148,9 @@ class Power {
|
|
|
128
148
|
* @param keepAppletRunning If `true`, the applet will be kept running when the timer is active on certain devices.
|
|
129
149
|
*
|
|
130
150
|
* @since 5.10.0
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* await sos.management.power.setProprietaryTimer("TIMER_20", "08:00", "22:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
131
154
|
*/
|
|
132
155
|
async setProprietaryTimer(type, timeOn, timeOff, weekdays, keepAppletRunning = false) {
|
|
133
156
|
(0, Validate_1.default)({ type })
|
|
@@ -169,6 +192,9 @@ class Power {
|
|
|
169
192
|
* @param type The type of the timer (`TIMER_1`, ..., `TIMER_7`).
|
|
170
193
|
*
|
|
171
194
|
* @since 5.10.0
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* await sos.management.power.unsetProprietaryTimer("TIMER_2");
|
|
172
198
|
*/
|
|
173
199
|
async unsetProprietaryTimer(type) {
|
|
174
200
|
try {
|
|
@@ -179,10 +205,108 @@ class Power {
|
|
|
179
205
|
}
|
|
180
206
|
catch (error) {
|
|
181
207
|
// Use failover method if delete fails that is supported in older front-display versions
|
|
182
|
-
// It can be removed in some front-applet
|
|
208
|
+
// It can be removed in some front-applet major version
|
|
183
209
|
await this.setProprietaryTimer(type, null, null, []);
|
|
184
210
|
}
|
|
185
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Removes all scheduled reboot rules from the device.
|
|
214
|
+
*
|
|
215
|
+
* @since 8.1.0
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* await sos.management.power.clearScheduledReboots();
|
|
219
|
+
*/
|
|
220
|
+
async clearScheduledReboots() {
|
|
221
|
+
await this.postMessage({
|
|
222
|
+
type: this.getMessage('clear_scheduled_reboots'),
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Returns all scheduled reboot rules on the device.
|
|
227
|
+
*
|
|
228
|
+
* @since 8.1.0
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* await sos.management.power.getScheduledReboots();
|
|
232
|
+
*/
|
|
233
|
+
async getScheduledReboots() {
|
|
234
|
+
const { actions } = await this.postMessage({
|
|
235
|
+
type: this.getMessage('get_scheduled_reboots'),
|
|
236
|
+
});
|
|
237
|
+
// We need to convert values of days back to string representation
|
|
238
|
+
for (const action of actions) {
|
|
239
|
+
action.rule.weekdays = action.rule.weekdays.map((weekday) => {
|
|
240
|
+
return (0, PowerHelper_1.convertNumberToWeekday)(weekday); // Can be only number from device
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
return actions;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Removes scheduled reboot rule from the device.
|
|
247
|
+
* @param id {string} - ID of the rule to be removed.
|
|
248
|
+
*
|
|
249
|
+
* @since 8.1.0
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* // Get scheduled reboots
|
|
253
|
+
* const scheduledReboots = await sos.management.power.getScheduledReboots();
|
|
254
|
+
*
|
|
255
|
+
* // Remove scheduled reboot
|
|
256
|
+
* await sos.management.power.removeScheduledReboot(scheduledReboots[0].id);
|
|
257
|
+
*/
|
|
258
|
+
async removeScheduledReboot(id) {
|
|
259
|
+
(0, Validate_1.default)({ id }).required().string();
|
|
260
|
+
await this.postMessage({
|
|
261
|
+
type: this.getMessage('remove_scheduled_reboot'),
|
|
262
|
+
id,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Schedule automatic reboot on the device. Calling this function will create one rule.
|
|
267
|
+
* It is possible to set multiple rules, which can be later obtained by `getScheduledReboots` function.
|
|
268
|
+
*
|
|
269
|
+
* :::note
|
|
270
|
+
* - Setting new scheduled reboot on device might take up to 10 minutes to show in Box.
|
|
271
|
+
* - Every new scheduled reboot rule gets unique identifier generated by device, it might be later returned by `getScheduledReboots()`.
|
|
272
|
+
* :::
|
|
273
|
+
*
|
|
274
|
+
* @param weekdays {@link WeekdayType[]} - Array of weekdays when the reboot should be executed.
|
|
275
|
+
* @param time {string} - Time when the reboot should be executed. Format is `HH:mm:ss`.
|
|
276
|
+
*
|
|
277
|
+
* @since 8.1.0
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* // Schedule reboot every Monday at 3:00 AM
|
|
281
|
+
* await sos.management.power.setScheduledReboot(["MONDAY"], "03:00:00");
|
|
282
|
+
*
|
|
283
|
+
* // Schedule reboot every Monday and Friday at 7:30 PM / 19:30
|
|
284
|
+
* await sos.management.power.setScheduledReboot(["MONDAY", "FRIDAY"], "19:30:00");
|
|
285
|
+
*/
|
|
286
|
+
async setScheduledReboot(weekdays, time) {
|
|
287
|
+
(0, Validate_1.default)({ weekdays }).required().array('string');
|
|
288
|
+
// Validate if day is in weekday enum
|
|
289
|
+
for (const weekday of weekdays) {
|
|
290
|
+
if (typeof IPower_1.WeekdayNamed[weekday] === 'undefined') {
|
|
291
|
+
throw new Error('Invalid weekday');
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
// Days in week needs to be converted to specific numbers to work properly
|
|
295
|
+
const weekdayAsNumbers = weekdays.map(PowerHelper_1.convertWeekdayToNumber);
|
|
296
|
+
(0, Validate_1.default)({ time })
|
|
297
|
+
.required()
|
|
298
|
+
.string()
|
|
299
|
+
.matchRegExp(/\d{2}:\d{2}:\d{2}/)
|
|
300
|
+
.timerTime();
|
|
301
|
+
const rule = {
|
|
302
|
+
weekdays: weekdayAsNumbers,
|
|
303
|
+
time,
|
|
304
|
+
};
|
|
305
|
+
await this.postMessage({
|
|
306
|
+
type: this.getMessage('set_scheduled_reboot'),
|
|
307
|
+
rule,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
186
310
|
getMessage(name) {
|
|
187
311
|
return this.messagePrefix + '.' + name;
|
|
188
312
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Power.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/Power.ts"],"names":[],"mappings":";;;;;AACA,wDAAyE;AACzE,uEAA+C;
|
|
1
|
+
{"version":3,"file":"Power.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/Power.ts"],"names":[],"mappings":";;;;;AACA,wDAAyE;AACzE,uEAA+C;AAE/C,qCAA4G;AAC5G,+CAA+E;AAE/E,mCAAmC;AACnC;;;GAGG;AACH,MAAqB,KAAK;IAGhB;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ;;;;;;;OAOG;IACI,KAAK,CAAC,YAAY;QACxB,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;SACtC,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,UAAU;QACtB,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;SACpC,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,SAAS;QACrB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YACzC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;SACnC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,KAAK,CAAC,QAAQ,CACpB,IAA4B,EAC5B,MAAqB,EACrB,OAAsB,EACtB,QAAkB,EAClB,MAAc;QAEd,IAAI,OAAO,uBAAS,CAAC,IAA8B,CAAC,KAAK,WAAW,EA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AAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;CACD;AAvUD,wBAuUC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertWeekdayToNumber = convertWeekdayToNumber;
|
|
4
|
+
exports.convertNumberToWeekday = convertNumberToWeekday;
|
|
5
|
+
const IPower_1 = require("./IPower");
|
|
6
|
+
function convertWeekdayToNumber(weekday) {
|
|
7
|
+
return IPower_1.WeekdayNumbered[weekday];
|
|
8
|
+
}
|
|
9
|
+
function convertNumberToWeekday(weekday) {
|
|
10
|
+
return IPower_1.WeekdayNumbered[weekday];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=PowerHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PowerHelper.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/PowerHelper.ts"],"names":[],"mappings":";;AAEA,wDAEC;AAED,wDAEC;AARD,qCAAwD;AAExD,SAAgB,sBAAsB,CAAC,OAAoB;IAC1D,OAAO,wBAAe,CAAC,OAAuC,CAAC,CAAC;AACjE,CAAC;AAED,SAAgB,sBAAsB,CAAC,OAAe;IACrD,OAAO,wBAAe,CAAC,OAAO,CAAiC,CAAC;AACjE,CAAC"}
|
|
@@ -9,24 +9,37 @@ export default class Proxy implements IProxy {
|
|
|
9
9
|
* The `isEnabled()` method returns whether the proxy is enabled on the device.
|
|
10
10
|
*
|
|
11
11
|
* @since 5.4.0
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const enabled = await sos.management.proxy.isEnabled();
|
|
12
15
|
*/
|
|
13
16
|
isEnabled(): Promise<boolean>;
|
|
14
17
|
/**
|
|
15
18
|
* The `setManual()` method sets the proxy on the device.
|
|
16
19
|
*
|
|
17
20
|
* @since 5.4.0
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const enabled = await sos.management.proxy.setManual('178.62.193.192', 1080, 'username', 'password');
|
|
18
24
|
*/
|
|
19
25
|
setManual(uri: string, port: number, username?: string, password?: string): Promise<void>;
|
|
20
26
|
/**
|
|
21
27
|
* The `disable()` method disables the proxy on the device.
|
|
22
28
|
*
|
|
23
29
|
* @since 5.4.0
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* await sos.management.proxy.disable();
|
|
24
33
|
*/
|
|
25
34
|
disable(): Promise<void>;
|
|
26
35
|
/**
|
|
27
36
|
* The `getConnectedTo()` methods returns the current connected proxy server uri on the device.
|
|
28
37
|
*
|
|
29
38
|
* @since 5.4.0
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* const uri = await sos.management.proxy.getConnectedTo();
|
|
42
|
+
* console.log(uri); // 178.62.193.192
|
|
30
43
|
*/
|
|
31
44
|
getConnectedTo(): Promise<string>;
|
|
32
45
|
private getMessage;
|
|
@@ -12,6 +12,9 @@ class Proxy {
|
|
|
12
12
|
* The `isEnabled()` method returns whether the proxy is enabled on the device.
|
|
13
13
|
*
|
|
14
14
|
* @since 5.4.0
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const enabled = await sos.management.proxy.isEnabled();
|
|
15
18
|
*/
|
|
16
19
|
async isEnabled() {
|
|
17
20
|
const { isEnabled } = await this.postMessage({
|
|
@@ -23,6 +26,9 @@ class Proxy {
|
|
|
23
26
|
* The `setManual()` method sets the proxy on the device.
|
|
24
27
|
*
|
|
25
28
|
* @since 5.4.0
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const enabled = await sos.management.proxy.setManual('178.62.193.192', 1080, 'username', 'password');
|
|
26
32
|
*/
|
|
27
33
|
async setManual(uri, port, username, password) {
|
|
28
34
|
await this.postMessage({
|
|
@@ -37,6 +43,9 @@ class Proxy {
|
|
|
37
43
|
* The `disable()` method disables the proxy on the device.
|
|
38
44
|
*
|
|
39
45
|
* @since 5.4.0
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* await sos.management.proxy.disable();
|
|
40
49
|
*/
|
|
41
50
|
async disable() {
|
|
42
51
|
await this.postMessage({
|
|
@@ -47,6 +56,10 @@ class Proxy {
|
|
|
47
56
|
* The `getConnectedTo()` methods returns the current connected proxy server uri on the device.
|
|
48
57
|
*
|
|
49
58
|
* @since 5.4.0
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* const uri = await sos.management.proxy.getConnectedTo();
|
|
62
|
+
* console.log(uri); // 178.62.193.192
|
|
50
63
|
*/
|
|
51
64
|
async getConnectedTo() {
|
|
52
65
|
const { connectedTo } = await this.postMessage({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Proxy.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Proxy/Proxy.ts"],"names":[],"mappings":";;AAGA,MAAqB,KAAK;IAGhB;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ
|
|
1
|
+
{"version":3,"file":"Proxy.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Proxy/Proxy.ts"],"names":[],"mappings":";;AAGA,MAAqB,KAAK;IAGhB;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ;;;;;;;OAOG;IACI,KAAK,CAAC,SAAS;QACrB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAC5C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;SACzC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IAClB,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,SAAS,CAAC,GAAW,EAAE,IAAY,EAAE,QAAiB,EAAE,QAAiB;QACrF,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;YACzC,GAAG;YACH,IAAI;YACJ,QAAQ;YACR,QAAQ;SACR,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,OAAO;QACnB,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;SACtC,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,cAAc;QAC1B,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAC9C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC;SAC/C,CAAC,CAAC;QACH,OAAO,WAAW,CAAC;IACpB,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;CACD;AA1ED,wBA0EC"}
|
|
@@ -21,36 +21,54 @@ export default class RemoteControl implements IRemoteControl {
|
|
|
21
21
|
* :::
|
|
22
22
|
*
|
|
23
23
|
* @since 3.0.0
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* await sos.management.remoteControl.enable();
|
|
24
27
|
*/
|
|
25
28
|
enable(): Promise<void>;
|
|
26
29
|
/**
|
|
27
30
|
* The `disable()` method disables remote control.
|
|
28
31
|
*
|
|
29
32
|
* @since 3.0.0
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await sos.management.remoteControl.disable();
|
|
30
36
|
*/
|
|
31
37
|
disable(): Promise<void>;
|
|
32
38
|
/**
|
|
33
39
|
* The `isEnabled()` method returns whether the remote control is enabled.
|
|
34
40
|
*
|
|
35
41
|
* @since 4.0.0
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* const enabled = await sos.management.remoteControl.isEnabled();
|
|
36
45
|
*/
|
|
37
46
|
isEnabled(): Promise<boolean>;
|
|
38
47
|
/**
|
|
39
48
|
* The `lock()` method is an alias for the `disable()` method.
|
|
40
49
|
*
|
|
41
50
|
* @since 4.0.0
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* await sos.management.remoteControl.lock();
|
|
42
54
|
*/
|
|
43
55
|
lock(): Promise<void>;
|
|
44
56
|
/**
|
|
45
57
|
* The `unlock()` method is an alias for the `enable()` method.
|
|
46
58
|
*
|
|
47
59
|
* @since 4.0.0
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* await sos.management.remoteControl.unlock();
|
|
48
63
|
*/
|
|
49
64
|
unlock(): Promise<void>;
|
|
50
65
|
/**
|
|
51
66
|
* The `isLocked()` method returns whether the remote control is locked (disabled).
|
|
52
67
|
*
|
|
53
68
|
* @since 4.0.0
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* const locked = await sos.management.remoteControl.isLocked();
|
|
54
72
|
*/
|
|
55
73
|
isLocked(): Promise<boolean>;
|
|
56
74
|
private setEnabled;
|
|
@@ -24,6 +24,9 @@ class RemoteControl {
|
|
|
24
24
|
* :::
|
|
25
25
|
*
|
|
26
26
|
* @since 3.0.0
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await sos.management.remoteControl.enable();
|
|
27
30
|
*/
|
|
28
31
|
async enable() {
|
|
29
32
|
await this.setEnabled(true);
|
|
@@ -32,6 +35,9 @@ class RemoteControl {
|
|
|
32
35
|
* The `disable()` method disables remote control.
|
|
33
36
|
*
|
|
34
37
|
* @since 3.0.0
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* await sos.management.remoteControl.disable();
|
|
35
41
|
*/
|
|
36
42
|
async disable() {
|
|
37
43
|
await this.setEnabled(false);
|
|
@@ -40,6 +46,9 @@ class RemoteControl {
|
|
|
40
46
|
* The `isEnabled()` method returns whether the remote control is enabled.
|
|
41
47
|
*
|
|
42
48
|
* @since 4.0.0
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const enabled = await sos.management.remoteControl.isEnabled();
|
|
43
52
|
*/
|
|
44
53
|
async isEnabled() {
|
|
45
54
|
const { isRemoteControlEnabled } = await this.postMessage({
|
|
@@ -51,6 +60,9 @@ class RemoteControl {
|
|
|
51
60
|
* The `lock()` method is an alias for the `disable()` method.
|
|
52
61
|
*
|
|
53
62
|
* @since 4.0.0
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await sos.management.remoteControl.lock();
|
|
54
66
|
*/
|
|
55
67
|
async lock() {
|
|
56
68
|
await this.disable();
|
|
@@ -59,6 +71,9 @@ class RemoteControl {
|
|
|
59
71
|
* The `unlock()` method is an alias for the `enable()` method.
|
|
60
72
|
*
|
|
61
73
|
* @since 4.0.0
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* await sos.management.remoteControl.unlock();
|
|
62
77
|
*/
|
|
63
78
|
async unlock() {
|
|
64
79
|
await this.enable();
|
|
@@ -67,6 +82,9 @@ class RemoteControl {
|
|
|
67
82
|
* The `isLocked()` method returns whether the remote control is locked (disabled).
|
|
68
83
|
*
|
|
69
84
|
* @since 4.0.0
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* const locked = await sos.management.remoteControl.isLocked();
|
|
70
88
|
*/
|
|
71
89
|
async isLocked() {
|
|
72
90
|
return !(await this.isEnabled());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteControl.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/RemoteControl/RemoteControl.ts"],"names":[],"mappings":";;AAGA;;GAEG;AACH,MAAqB,aAAa;IAGxB;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ
|
|
1
|
+
{"version":3,"file":"RemoteControl.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/RemoteControl/RemoteControl.ts"],"names":[],"mappings":";;AAGA;;GAEG;AACH,MAAqB,aAAa;IAGxB;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ;;;;;;;;;;;;;;;;OAgBG;IACI,KAAK,CAAC,MAAM;QAClB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,OAAO;QACnB,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,SAAS;QACrB,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YACzD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC;SACtD,CAAC,CAAC;QAEH,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,IAAI;QAChB,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,MAAM;QAClB,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;IACrB,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,QAAQ;QACpB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAClC,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,OAAgB;QACxC,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAAC;YACnD,OAAO;SACP,CAAC,CAAC;IACJ,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;CACD;AAtGD,gCAsGC"}
|
|
@@ -5,7 +5,12 @@ export default interface IScreen {
|
|
|
5
5
|
getOrientation(): Promise<IOrientation>;
|
|
6
6
|
setBrightness(timeFrom1: string, brightness1: number, timeFrom2: string, brightness2: number): Promise<void>;
|
|
7
7
|
getBrightness(): Promise<IBrightness>;
|
|
8
|
+
/** @deprecated use takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<{ screenshotUrl: string; aHash?: string }> */
|
|
8
9
|
takeAndUploadScreenshot(uploadBaseUrl: string): Promise<string>;
|
|
10
|
+
takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<{
|
|
11
|
+
screenshotUrl: string;
|
|
12
|
+
aHash?: string;
|
|
13
|
+
}>;
|
|
9
14
|
powerOn(): Promise<void>;
|
|
10
15
|
powerOff(): Promise<void>;
|
|
11
16
|
isPoweredOn(): Promise<boolean>;
|
|
@@ -97,6 +97,10 @@ export default class Screen implements IScreen {
|
|
|
97
97
|
* @since 3.0.0
|
|
98
98
|
*/
|
|
99
99
|
getBrightness(): Promise<IBrightness>;
|
|
100
|
+
/**
|
|
101
|
+
* @deprecated Use `takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<{ screenshotUrl: string; aHash?: string }>` instead.
|
|
102
|
+
*/
|
|
103
|
+
takeAndUploadScreenshot(uploadBaseUrl: string): Promise<string>;
|
|
100
104
|
/**
|
|
101
105
|
* The `takeAndUploadScreenshot()` method takes a screenshot and uploads it to a specified url. This can be either a signageOS upload url
|
|
102
106
|
* (`https://upload.signageos.io`) or a dedicated server url for uploading screenshots. Format in which the screenshot is uploaded may be
|
|
@@ -110,9 +114,21 @@ export default class Screen implements IScreen {
|
|
|
110
114
|
* signageOS provides standalone server which is implements all of those methods. It is provided to all of our partners through the
|
|
111
115
|
* [support ticketing system](https://box.signageos.io/support/).
|
|
112
116
|
*
|
|
117
|
+
* @param uploadBaseUrl URL to which the screenshot will be uploaded. It can be either a signageOS upload url or a custom server url.
|
|
118
|
+
* @param computeHash Whether to compute a hash of the screenshot and return it in the response.
|
|
119
|
+
*
|
|
113
120
|
* @since 3.0.0
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* const { screenshotUrl, aHash } = await sos.management.screen.takeAndUploadScreenshot(
|
|
124
|
+
* 'https://your.upload.server/upload/file?prefix=screenshot/',
|
|
125
|
+
* true,
|
|
126
|
+
* );
|
|
114
127
|
*/
|
|
115
|
-
takeAndUploadScreenshot(uploadBaseUrl: string): Promise<
|
|
128
|
+
takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<{
|
|
129
|
+
screenshotUrl: string;
|
|
130
|
+
aHash?: string;
|
|
131
|
+
}>;
|
|
116
132
|
/**
|
|
117
133
|
* The `powerOn()` method turns the screen on.
|
|
118
134
|
*
|
|
@@ -121,7 +137,7 @@ export default class Screen implements IScreen {
|
|
|
121
137
|
*/
|
|
122
138
|
powerOn(): Promise<void>;
|
|
123
139
|
/**
|
|
124
|
-
* The `powerOff()` method turn the screen off.
|
|
140
|
+
* The `powerOff()` method turn the screen off. It will turn off the display backlight and the panel, and it will also disable applet.
|
|
125
141
|
*
|
|
126
142
|
* :::warning
|
|
127
143
|
*
|