@signageos/front-applet 8.2.1 → 8.2.4
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 +20 -6
- package/dist/bundle.js.map +1 -1
- package/docs/index.md +9 -9
- package/docs/sos/browser.md +11 -3
- package/docs/sos/display.md +13 -20
- package/docs/sos/fileSystem.md +31 -6
- package/docs/sos/hardware/barcodeScanner.md +9 -0
- package/docs/sos/hardware/index.md +9 -0
- package/docs/sos/native/mdc.md +8 -3
- package/docs/sos/osd.md +9 -0
- package/docs/sos/video.md +9 -0
- package/docs/sos_management/app.md +97 -18
- package/docs/sos_management/audio.md +43 -2
- package/docs/sos_management/autoRecovery.md +101 -0
- package/docs/sos_management/debug.md +84 -1
- package/docs/sos_management/firmware.md +64 -1
- package/docs/sos_management/index.md +217 -19
- package/docs/sos_management/network.md +84 -29
- package/docs/sos_management/os.md +59 -4
- package/docs/sos_management/package.md +25 -3
- package/docs/sos_management/power.md +142 -18
- package/docs/sos_management/proxy.md +54 -3
- package/docs/sos_management/remoteControl.md +55 -4
- package/docs/sos_management/screen.md +140 -29
- package/docs/sos_management/security.md +48 -5
- package/docs/sos_management/time.md +76 -9
- package/docs/sos_management/wifi.md +207 -45
- package/es6/FrontApplet/Browser/Browser.d.ts +11 -3
- package/es6/FrontApplet/Browser/Browser.js +13 -4
- package/es6/FrontApplet/Browser/Browser.js.map +1 -1
- package/es6/FrontApplet/Command/Command.js +8 -10
- package/es6/FrontApplet/Command/Command.js.map +1 -1
- package/es6/FrontApplet/Connect/Connect.js +2 -2
- package/es6/FrontApplet/Connect/Connect.js.map +1 -1
- package/es6/FrontApplet/Debug/debugDecorator.d.ts +1 -1
- package/es6/FrontApplet/Debug/debugDecorator.js.map +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
- package/es6/FrontApplet/Display/Display.d.ts +14 -19
- package/es6/FrontApplet/Display/Display.js +14 -19
- package/es6/FrontApplet/Display/Display.js.map +1 -1
- package/es6/FrontApplet/FileSystem/FileSystem.d.ts +27 -5
- package/es6/FrontApplet/FileSystem/FileSystem.js +27 -5
- package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
- package/es6/FrontApplet/FileSystem/StorageUnitsChangedMessage.d.ts +1 -2
- package/es6/FrontApplet/Font/fontFaceGenerator.js +1 -1
- package/es6/FrontApplet/Font/fontFaceGenerator.js.map +1 -1
- package/es6/FrontApplet/FrontApplet.js +3 -3
- package/es6/FrontApplet/FrontApplet.js.map +1 -1
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.d.ts +10 -1
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js +9 -0
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js.map +1 -1
- package/es6/FrontApplet/Hardware/Hardware.d.ts +9 -0
- package/es6/FrontApplet/Hardware/Hardware.js +9 -0
- package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
- package/es6/FrontApplet/Iframe/Iframe.js +1 -1
- package/es6/FrontApplet/Iframe/Iframe.js.map +1 -1
- package/es6/FrontApplet/Input/Input.js +2 -1
- package/es6/FrontApplet/Input/Input.js.map +1 -1
- package/es6/FrontApplet/Management/App/App.d.ts +53 -17
- package/es6/FrontApplet/Management/App/App.js +23 -12
- package/es6/FrontApplet/Management/App/App.js.map +1 -1
- package/es6/FrontApplet/Management/App/IApp.d.ts +3 -0
- package/es6/FrontApplet/Management/Audio/Audio.d.ts +24 -3
- package/es6/FrontApplet/Management/Audio/Audio.js +24 -3
- package/es6/FrontApplet/Management/Audio/Audio.js.map +1 -1
- package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.d.ts +49 -3
- package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js +49 -3
- package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js.map +1 -1
- package/es6/FrontApplet/Management/Debug/Debug.d.ts +44 -2
- package/es6/FrontApplet/Management/Debug/Debug.js +43 -1
- package/es6/FrontApplet/Management/Debug/Debug.js.map +1 -1
- package/es6/FrontApplet/Management/Firmware/Firmware.d.ts +41 -4
- package/es6/FrontApplet/Management/Firmware/Firmware.js +33 -0
- package/es6/FrontApplet/Management/Firmware/Firmware.js.map +1 -1
- package/es6/FrontApplet/Management/Management.d.ts +119 -21
- package/es6/FrontApplet/Management/Management.js +119 -22
- package/es6/FrontApplet/Management/Management.js.map +1 -1
- package/es6/FrontApplet/Management/Network/Network.d.ts +44 -25
- package/es6/FrontApplet/Management/Network/Network.js +28 -14
- package/es6/FrontApplet/Management/Network/Network.js.map +1 -1
- package/es6/FrontApplet/Management/OS/IOS.d.ts +3 -0
- package/es6/FrontApplet/Management/OS/OS.d.ts +32 -4
- package/es6/FrontApplet/Management/OS/OS.js +32 -4
- package/es6/FrontApplet/Management/OS/OS.js.map +1 -1
- package/es6/FrontApplet/Management/Package/Package.d.ts +18 -3
- package/es6/FrontApplet/Management/Package/Package.js +18 -4
- package/es6/FrontApplet/Management/Package/Package.js.map +1 -1
- package/es6/FrontApplet/Management/Power/IPower.d.ts +3 -0
- package/es6/FrontApplet/Management/Power/IPower.js.map +1 -1
- package/es6/FrontApplet/Management/Power/Power.d.ts +67 -20
- package/es6/FrontApplet/Management/Power/Power.js +71 -25
- package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
- package/es6/FrontApplet/Management/Proxy/Proxy.d.ts +28 -3
- package/es6/FrontApplet/Management/Proxy/Proxy.js +28 -3
- package/es6/FrontApplet/Management/Proxy/Proxy.js.map +1 -1
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.d.ts +23 -5
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js +23 -5
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js.map +1 -1
- package/es6/FrontApplet/Management/Screen/Screen.d.ts +77 -32
- package/es6/FrontApplet/Management/Screen/Screen.js +65 -26
- package/es6/FrontApplet/Management/Screen/Screen.js.map +1 -1
- package/es6/FrontApplet/Management/Security/Security.d.ts +25 -7
- package/es6/FrontApplet/Management/Security/Security.js +25 -7
- package/es6/FrontApplet/Management/Security/Security.js.map +1 -1
- package/es6/FrontApplet/Management/Time/Time.d.ts +47 -11
- package/es6/FrontApplet/Management/Time/Time.js +29 -7
- 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.map +1 -1
- package/es6/FrontApplet/Management/Wifi/Wifi.d.ts +137 -42
- package/es6/FrontApplet/Management/Wifi/Wifi.js +139 -43
- package/es6/FrontApplet/Management/Wifi/Wifi.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.d.ts +8 -3
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js +8 -3
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js.map +1 -1
- package/es6/FrontApplet/OSD/OSD.d.ts +9 -0
- package/es6/FrontApplet/OSD/OSD.js +9 -0
- package/es6/FrontApplet/OSD/OSD.js.map +1 -1
- package/es6/FrontApplet/Offline/Cache/Cache.js +2 -2
- package/es6/FrontApplet/Offline/Cache/Cache.js.map +1 -1
- package/es6/FrontApplet/Offline/Flags/AppendFlagController.d.ts +1 -1
- package/es6/FrontApplet/Offline/Flags/AppendFlagController.js.map +1 -1
- package/es6/FrontApplet/Offline/Offline.js +2 -2
- package/es6/FrontApplet/Offline/Offline.js.map +1 -1
- package/es6/FrontApplet/Sync/Sync.js +6 -3
- package/es6/FrontApplet/Sync/Sync.js.map +1 -1
- package/es6/FrontApplet/Touch/Touch.js +2 -1
- package/es6/FrontApplet/Touch/Touch.js.map +1 -1
- package/es6/FrontApplet/Validate/Validate.d.ts +1 -1
- package/es6/FrontApplet/Validate/Validate.js +9 -9
- package/es6/FrontApplet/Validate/Validate.js.map +1 -1
- package/es6/FrontApplet/Validate/ValidateObjectInterface.js +10 -10
- package/es6/FrontApplet/Validate/ValidateObjectInterface.js.map +1 -1
- package/es6/FrontApplet/Video/Video.d.ts +9 -0
- package/es6/FrontApplet/Video/Video.js +11 -1
- package/es6/FrontApplet/Video/Video.js.map +1 -1
- package/es6/Monitoring/FileSystem/fileSystemCommands.d.ts +2 -2
- package/es6/Monitoring/Management/Screen/handleScreenRequests.js +2 -1
- package/es6/Monitoring/Management/Screen/handleScreenRequests.js.map +1 -1
- package/es6/bundle.js +5 -5
- package/es6/bundle.js.map +1 -1
- package/package.json +16 -21
|
@@ -2,6 +2,25 @@ import IPostMessage from '../../IPostMessage';
|
|
|
2
2
|
import IFirmware from './IFirmware';
|
|
3
3
|
/**
|
|
4
4
|
* The `sos.management.firmware` API groups together methods for working with the firmware of the device.
|
|
5
|
+
*
|
|
6
|
+
* :::warning
|
|
7
|
+
* Always check if your absolute firmware URL ends with a firmware file. Example: `https://cnd.your-cms.com/brightsign/fw/brightsign-update.bsfw`
|
|
8
|
+
* :::
|
|
9
|
+
*
|
|
10
|
+
* :::info
|
|
11
|
+
* For BrightSign firmware upgrade, please ensure that you have a text file with the SHA1 hash of that firmware file.
|
|
12
|
+
* - Firmware file path: `https://cnd.your-cms.com/brightsign/fw/brightsign-update.bsfw`
|
|
13
|
+
* - SHA1 txt file: `https://cnd.your-cms.com/brightsign/fw/brightsign-update.bsfw.sha1.txt`
|
|
14
|
+
* :::
|
|
15
|
+
*
|
|
16
|
+
* <details>
|
|
17
|
+
* <summary>Firmware Management Capabilities</summary>
|
|
18
|
+
* | Capability | Description |
|
|
19
|
+
* |:------------|:-------------|
|
|
20
|
+
* | `FIRMWARE_UPGRADE` | If device can upgrade firmware version |
|
|
21
|
+
*
|
|
22
|
+
* If you want to check if the device supports this capability, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
23
|
+
* </details>
|
|
5
24
|
*/
|
|
6
25
|
export default class Firmware implements IFirmware {
|
|
7
26
|
private messagePrefix;
|
|
@@ -15,18 +34,20 @@ export default class Firmware implements IFirmware {
|
|
|
15
34
|
*
|
|
16
35
|
* @param version The version of the firmware being installed.
|
|
17
36
|
* @param [baseUrl='https://2.signageos.io'] Optional server URL where firmware files are located.
|
|
18
|
-
*
|
|
37
|
+
* @returns {Promise<void>} A promise that resolves when the firmware upgrade is initiated.
|
|
19
38
|
* @since 4.0.0
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await sos.management.firmware.upgrade('T-HKMLAKUC-2080.4');
|
|
20
42
|
*/
|
|
21
43
|
upgrade(version: string, baseUrl?: string): Promise<void>;
|
|
22
44
|
/**
|
|
23
45
|
* The `upgrade(baseUrl, version)` does the same as `upgrade(version, baseUrl)`.
|
|
24
46
|
*
|
|
25
47
|
* @alias upgrade(version: string, baseUrl?: string)
|
|
26
|
-
*
|
|
27
48
|
* @param baseUrl The server URL where firmware files are located.
|
|
28
49
|
* @param version The version of the firmware being installed.
|
|
29
|
-
*
|
|
50
|
+
* @returns {Promise<void>} A promise that resolves when the firmware upgrade is initiated.
|
|
30
51
|
* @since 4.0.0
|
|
31
52
|
*
|
|
32
53
|
* @example
|
|
@@ -46,9 +67,11 @@ export default class Firmware implements IFirmware {
|
|
|
46
67
|
* - Android: http://example.com/fw/FB-00.0.0.zip
|
|
47
68
|
*
|
|
48
69
|
* @param fwUri FQN uri where the firmware main file is located.
|
|
49
|
-
*
|
|
70
|
+
* @returns {Promise<void>} A promise that resolves when the firmware upgrade is initiated.
|
|
50
71
|
* @since 4.0.0
|
|
51
72
|
*
|
|
73
|
+
* @example // {@link https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/firmware | Example applet with firmware upgrade}
|
|
74
|
+
*
|
|
52
75
|
* @example
|
|
53
76
|
* await sos.management.firmware.upgrade('https://cdn.your-cms.com/tizen/pmf/fw/2080_4.bem');
|
|
54
77
|
*/
|
|
@@ -56,6 +79,7 @@ export default class Firmware implements IFirmware {
|
|
|
56
79
|
/**
|
|
57
80
|
* The `getVersion()` method returns the version of the firmware currently installed on the device.
|
|
58
81
|
*
|
|
82
|
+
* @returns {Promise<string>} A promise that resolves to the current firmware version.
|
|
59
83
|
* @since 4.0.0
|
|
60
84
|
*
|
|
61
85
|
* @example
|
|
@@ -68,6 +92,19 @@ export default class Firmware implements IFirmware {
|
|
|
68
92
|
*
|
|
69
93
|
* This information, when combined with firmware version, can be used to identify a correct firmware image to install on the current device.
|
|
70
94
|
*
|
|
95
|
+
* <details>
|
|
96
|
+
* <summary>Linux and Android prefixes</summary>
|
|
97
|
+
* | Type | Description |
|
|
98
|
+
* |:------------|:-------------|
|
|
99
|
+
* | `rpi` | Any Raspberry Pi 3 or Compute Module 3 |
|
|
100
|
+
* | `rpi4` | Any Raspberry Pi 4 or Compute Module 4 |
|
|
101
|
+
* | `benq-` | Any Benq display |
|
|
102
|
+
* | `philips-` | Any Philips display |
|
|
103
|
+
* | `sharp-` | Any Sharp display |
|
|
104
|
+
* | `elo-` | Any Elo display |
|
|
105
|
+
* </details>
|
|
106
|
+
*
|
|
107
|
+
* @returns {Promise<string>} A promise that resolves to the current firmware type.
|
|
71
108
|
* @since 4.8.0
|
|
72
109
|
*
|
|
73
110
|
* @example
|
|
@@ -3,6 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const UpgradeHelper_1 = require("../helpers/UpgradeHelper");
|
|
4
4
|
/**
|
|
5
5
|
* The `sos.management.firmware` API groups together methods for working with the firmware of the device.
|
|
6
|
+
*
|
|
7
|
+
* :::warning
|
|
8
|
+
* Always check if your absolute firmware URL ends with a firmware file. Example: `https://cnd.your-cms.com/brightsign/fw/brightsign-update.bsfw`
|
|
9
|
+
* :::
|
|
10
|
+
*
|
|
11
|
+
* :::info
|
|
12
|
+
* For BrightSign firmware upgrade, please ensure that you have a text file with the SHA1 hash of that firmware file.
|
|
13
|
+
* - Firmware file path: `https://cnd.your-cms.com/brightsign/fw/brightsign-update.bsfw`
|
|
14
|
+
* - SHA1 txt file: `https://cnd.your-cms.com/brightsign/fw/brightsign-update.bsfw.sha1.txt`
|
|
15
|
+
* :::
|
|
16
|
+
*
|
|
17
|
+
* <details>
|
|
18
|
+
* <summary>Firmware Management Capabilities</summary>
|
|
19
|
+
* | Capability | Description |
|
|
20
|
+
* |:------------|:-------------|
|
|
21
|
+
* | `FIRMWARE_UPGRADE` | If device can upgrade firmware version |
|
|
22
|
+
*
|
|
23
|
+
* If you want to check if the device supports this capability, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
24
|
+
* </details>
|
|
6
25
|
*/
|
|
7
26
|
class Firmware {
|
|
8
27
|
messagePrefix;
|
|
@@ -25,6 +44,7 @@ class Firmware {
|
|
|
25
44
|
/**
|
|
26
45
|
* The `getVersion()` method returns the version of the firmware currently installed on the device.
|
|
27
46
|
*
|
|
47
|
+
* @returns {Promise<string>} A promise that resolves to the current firmware version.
|
|
28
48
|
* @since 4.0.0
|
|
29
49
|
*
|
|
30
50
|
* @example
|
|
@@ -42,6 +62,19 @@ class Firmware {
|
|
|
42
62
|
*
|
|
43
63
|
* This information, when combined with firmware version, can be used to identify a correct firmware image to install on the current device.
|
|
44
64
|
*
|
|
65
|
+
* <details>
|
|
66
|
+
* <summary>Linux and Android prefixes</summary>
|
|
67
|
+
* | Type | Description |
|
|
68
|
+
* |:------------|:-------------|
|
|
69
|
+
* | `rpi` | Any Raspberry Pi 3 or Compute Module 3 |
|
|
70
|
+
* | `rpi4` | Any Raspberry Pi 4 or Compute Module 4 |
|
|
71
|
+
* | `benq-` | Any Benq display |
|
|
72
|
+
* | `philips-` | Any Philips display |
|
|
73
|
+
* | `sharp-` | Any Sharp display |
|
|
74
|
+
* | `elo-` | Any Elo display |
|
|
75
|
+
* </details>
|
|
76
|
+
*
|
|
77
|
+
* @returns {Promise<string>} A promise that resolves to the current firmware type.
|
|
45
78
|
* @since 4.8.0
|
|
46
79
|
*
|
|
47
80
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Firmware.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Firmware/Firmware.ts"],"names":[],"mappings":";;AACA,4DAAiE;AAGjE
|
|
1
|
+
{"version":3,"file":"Firmware.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Firmware/Firmware.ts"],"names":[],"mappings":";;AACA,4DAAiE;AAGjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAqB,QAAQ;IAGnB;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAsDJ,gBAAgB;IACT,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,IAAa;QAC/C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAA,qCAAqB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1E,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;YACzC,OAAO;YACP,OAAO;YACP,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,UAAU;QACtB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAClD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;SAC7C,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACxB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACI,KAAK,CAAC,OAAO;QACnB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAC/C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;SAC1C,CAAC,CAAC;QACH,OAAO,YAAY,CAAC;IACrB,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;CACD;AA1HD,2BA0HC"}
|
|
@@ -19,10 +19,30 @@ import Security from './Security/Security';
|
|
|
19
19
|
import Time from './Time/Time';
|
|
20
20
|
import Wifi from './Wifi/Wifi';
|
|
21
21
|
/**
|
|
22
|
-
* The `sos.management` API group provides methods for managing the device. Through this API things like device firmware,
|
|
23
|
-
* battery status, brightness, network information, remote control, power, time or volume can be monitored.
|
|
22
|
+
* The `sos.management` API group provides methods for managing the device. Through this API, things like device firmware,
|
|
23
|
+
* battery status, brightness, network information, remote control, power, time, or volume can be monitored.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
25
|
+
* :::note GitHub Example
|
|
26
|
+
* - [Basic usage of the Management API](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/basics)
|
|
27
|
+
* - [Getting basic management data](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/js-management-getters)
|
|
28
|
+
* - [Setting management data](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/js-management-setters)
|
|
29
|
+
* :::
|
|
30
|
+
*
|
|
31
|
+
* <details>
|
|
32
|
+
* <summary>Management Capabilities</summary>
|
|
33
|
+
* | Capability | Description |
|
|
34
|
+
* |:------------|:-------------|
|
|
35
|
+
* | `MODEL` | If device can return proper model name |
|
|
36
|
+
* | `SERIAL_NUMBER` | If device can return serial number |
|
|
37
|
+
* | `BATTERY_STATUS` | If device can return battery status |
|
|
38
|
+
* | `TEMPERATURE` | If device can return current temperature |
|
|
39
|
+
* | `BRAND` | If device can return manufacturer brand |
|
|
40
|
+
* | `FACTORY_RESET` | If device can perform factory reset |
|
|
41
|
+
* | `EXTENDED_MANAGEMENT` | If device can return or set extended management URL |
|
|
42
|
+
* | `HARDWARE_ACCELERATION` | If device can turn hardware acceleration on or off |
|
|
43
|
+
*
|
|
44
|
+
* If you want to check if the device supports those capabilities, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
45
|
+
* </details>
|
|
26
46
|
*/
|
|
27
47
|
export default class Management implements IManagement {
|
|
28
48
|
private messagePrefix;
|
|
@@ -49,21 +69,48 @@ export default class Management implements IManagement {
|
|
|
49
69
|
/**
|
|
50
70
|
* The `supports()` method determines whether a queried capability is supported.
|
|
51
71
|
*
|
|
52
|
-
*
|
|
72
|
+
* #### What are capabilities?
|
|
73
|
+
* Capabilities are features or functionalities that a device can support. We divided those capabilities into `front` and `management` capabilities.
|
|
74
|
+
* This section is about management capabilities, which include features to manage the device, receive information about the device, or change its settings.
|
|
75
|
+
*
|
|
76
|
+
* On the other hand, the `front` capabilities are features that are related to the application running on the device, such as displaying content, handling user input, etc.
|
|
77
|
+
* To check `front` capabilities, refer to the `sos.display.supports()` method or [this section](https://developers.signageos.io/sdk/sos/display#supports).
|
|
53
78
|
*
|
|
79
|
+
* :::tip
|
|
80
|
+
* If you want to check specific capabilities, refer to the sidebar for the selected management section. Every section has its capabilities written in the description,
|
|
81
|
+
* or check the **ManagementCapability** type in `supports()` method. It has a list of all available capabilities for all platforms.
|
|
82
|
+
* :::
|
|
83
|
+
*
|
|
84
|
+
* @param capability The capability to check for support.
|
|
85
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the capability is supported, otherwise `false`.
|
|
86
|
+
* @throws {Error} If the capability is not a valid string.
|
|
54
87
|
* @since 2.0.0
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* const isSupported = await sos.management.supports('OS_VERSION');
|
|
91
|
+
* console.log(`Is OS_VERSION supported? ${isSupported}`);
|
|
55
92
|
*/
|
|
56
93
|
supports(capability: ManagementCapability): Promise<boolean>;
|
|
57
94
|
/**
|
|
58
95
|
* The `getModel()` method returns the model of the device.
|
|
59
96
|
*
|
|
97
|
+
* @returns {Promise<string>} A promise that resolves to the model name of the device.
|
|
60
98
|
* @since 2.0.0
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const model = await sos.management.getModel();
|
|
102
|
+
* console.log(`Device model is: ${model}`); // e.g. 'XC4055' (BrightSign)
|
|
61
103
|
*/
|
|
62
104
|
getModel(): Promise<string>;
|
|
63
105
|
/**
|
|
64
106
|
* The `getSerialNumber()` method returns the serial number of the device.
|
|
65
107
|
*
|
|
108
|
+
* @returns {Promise<string>} A promise that resolves to the serial number of the device.
|
|
66
109
|
* @since 2.1.0
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* const serialNumber = await sos.management.getSerialNumber();
|
|
113
|
+
* console.log(`Device serial number is: ${serialNumber}`); // e.g. '1234567890'
|
|
67
114
|
*/
|
|
68
115
|
getSerialNumber(): Promise<string>;
|
|
69
116
|
/** @deprecated Use `sos.management.network.listInterfaces()` instead. */
|
|
@@ -71,77 +118,128 @@ export default class Management implements IManagement {
|
|
|
71
118
|
/**
|
|
72
119
|
* The `getBatteryStatus()` method returns information about the battery of the device.
|
|
73
120
|
*
|
|
121
|
+
* :::note
|
|
122
|
+
* - Emulator has mocked this method and will always return a battery status with 100% charge.
|
|
123
|
+
* :::
|
|
124
|
+
*
|
|
125
|
+
* @returns {Promise<IBatteryStatus>} A promise that resolves to an object containing the battery status.
|
|
126
|
+
* @throws {Error} If the device does not support battery status monitoring.
|
|
74
127
|
* @since 2.1.0
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* const batteryStatus = await sos.management.getBatteryStatus();
|
|
131
|
+
* console.log(`Battery status: ${batteryStatus.percentage}% charged`);
|
|
75
132
|
*/
|
|
76
133
|
getBatteryStatus(): Promise<IBatteryStatus>;
|
|
77
134
|
/**
|
|
78
|
-
* The `getTemperature()` method returns the temperature of the device (in 0-100 range of degrees Celsius).
|
|
135
|
+
* The `getTemperature()` method returns the temperature of the device (in the 0-100 range of degrees Celsius).
|
|
79
136
|
*
|
|
137
|
+
* @returns {Promise<number>} A promise that resolves to the current temperature of the device.
|
|
138
|
+
* @throws {Error} If the device does not support temperature monitoring.
|
|
80
139
|
* @since 3.0.0
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* const temperature = await sos.management.getTemperature();
|
|
143
|
+
* console.log(`Current device temperature is: ${temperature}°C`); // e.g. 25°C
|
|
81
144
|
*/
|
|
82
145
|
getTemperature(): Promise<number>;
|
|
83
146
|
/**
|
|
84
147
|
* The `getBrand()` method returns the manufacturer brand of the device.
|
|
85
148
|
*
|
|
149
|
+
* @returns {Promise<string>} A promise that resolves to the brand name of the device.
|
|
150
|
+
* @throws {Error} If the device does not support brand information.
|
|
86
151
|
* @since 5.7.0
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* const brand = await sos.management.getBrand();
|
|
155
|
+
* console.log(`Device brand is: ${brand}`); // e.g., 'Samsung', 'LG', BrightSign, etc.
|
|
87
156
|
*/
|
|
88
157
|
getBrand(): Promise<string>;
|
|
89
158
|
/**
|
|
90
159
|
* The `resetSettings()` method initializes the reset of the specific device settings.
|
|
91
160
|
*
|
|
92
|
-
* :::
|
|
93
|
-
*
|
|
94
|
-
* This is currently only implemented on Linux platform.
|
|
95
|
-
*
|
|
161
|
+
* :::warning
|
|
162
|
+
* This is currently only implemented on the Linux platform.
|
|
96
163
|
* :::
|
|
97
164
|
*
|
|
165
|
+
* @returns {Promise<void>} A promise that resolves when the settings are reset.
|
|
166
|
+
* @throws {Error} If the device does not support settings reset.
|
|
98
167
|
* @since 4.0.0
|
|
99
168
|
*/
|
|
100
169
|
resetSettings(): Promise<void>;
|
|
101
170
|
/**
|
|
102
171
|
* The `factoryReset()` method initializes the factory reset of the device.
|
|
103
172
|
*
|
|
173
|
+
* @returns {Promise<void>} A promise that resolves when the factory reset is initiated.
|
|
174
|
+
* @throws {Error} If the device does not support factory reset.
|
|
104
175
|
* @since 4.0.0
|
|
105
176
|
*/
|
|
106
177
|
factoryReset(): Promise<void>;
|
|
107
178
|
/**
|
|
108
|
-
* The `getExtendedManagementUrl()` method returns the management
|
|
179
|
+
* The `getExtendedManagementUrl()` method returns the management URL of the device.
|
|
109
180
|
*
|
|
110
181
|
* :::info
|
|
111
|
-
*
|
|
112
|
-
* This is currently only implemented for the MagicInfo on Tizen platform.
|
|
113
|
-
*
|
|
182
|
+
* This is currently only implemented for the MagicInfo on the Tizen platform.
|
|
114
183
|
* :::
|
|
115
184
|
*
|
|
185
|
+
* @returns {Promise<string | null>} A promise that resolves to the management URL of the device, or `null` if not set.
|
|
186
|
+
* @throws {Error} If the device does not support the extended management URL.
|
|
116
187
|
* @since 6.2.0
|
|
117
188
|
*/
|
|
118
189
|
getExtendedManagementUrl(): Promise<string | null>;
|
|
119
190
|
/**
|
|
120
|
-
* The `getExtendedManagementUrl()`
|
|
191
|
+
* The `getExtendedManagementUrl()` sets the management URL of the device.
|
|
121
192
|
*
|
|
122
193
|
* :::info
|
|
123
|
-
*
|
|
124
|
-
* This is currently only implemented for the MagicInfo on Tizen platform.
|
|
125
|
-
*
|
|
194
|
+
* This is currently only implemented for the MagicInfo on the Tizen platform.
|
|
126
195
|
* :::
|
|
127
196
|
*
|
|
128
|
-
* @param url The management URL to set.
|
|
129
|
-
*
|
|
197
|
+
* @param url The management URL to set. If `null`, it will remove the current URL.
|
|
198
|
+
* @returns {Promise<void>} A promise that resolves when the URL is set.
|
|
199
|
+
* @throws {Error} If the URL is not a valid string or if the device
|
|
200
|
+
* @throws {Error} If the device does not support the extended management URL.
|
|
130
201
|
* @since 6.2.0
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* await sos.management.setExtendedManagementUrl('https://example.com/management');
|
|
205
|
+
* // later
|
|
206
|
+
* const url = await sos.management.getExtendedManagementUrl();
|
|
207
|
+
* console.log(`Extended management URL is: ${url}`); // e.g. 'https://example.com/management'
|
|
131
208
|
*/
|
|
132
209
|
setExtendedManagementUrl(url: string | null): Promise<void>;
|
|
133
210
|
/**
|
|
134
|
-
* The `setHardwareAcceleration()` method
|
|
211
|
+
* The `setHardwareAcceleration()` method turns hardware acceleration on or off.
|
|
135
212
|
*
|
|
136
|
-
*
|
|
213
|
+
* :::note
|
|
214
|
+
* - This is currently only implemented for the BrightSign platform.
|
|
215
|
+
* - Device must always be rebooted for the changes to take effect.
|
|
216
|
+
* :::
|
|
137
217
|
*
|
|
218
|
+
* @param enabled Whether hardware acceleration should be enabled.
|
|
219
|
+
* @returns {Promise<void>} A promise that resolves when the hardware acceleration setting is applied.
|
|
220
|
+
* @throws {Error} If the `enabled` parameter is not a boolean.
|
|
221
|
+
* @throws {Error} If the device does not support hardware acceleration management.
|
|
138
222
|
* @since 7.1.0
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* await sos.management.setHardwareAcceleration(true).then(async () => {
|
|
226
|
+
* console.log('Hardware acceleration enabled.');
|
|
227
|
+
* await sos.management.reboot();
|
|
228
|
+
* }).catch((error) => {
|
|
229
|
+
* console.error('Failed to set hardware acceleration:', error);
|
|
230
|
+
* });
|
|
139
231
|
*/
|
|
140
232
|
setHardwareAcceleration(enabled: boolean): Promise<void>;
|
|
141
233
|
/**
|
|
142
234
|
* The `isHardwareAccelerationEnabled()` method returns whether hardware acceleration is enabled.
|
|
143
235
|
*
|
|
236
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if hardware acceleration is enabled, otherwise `false`.
|
|
237
|
+
* @throws {Error} If the device does not support hardware acceleration management.
|
|
144
238
|
* @since 7.1.0
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* const isEnabled = await sos.management.isHardwareAccelerationEnabled();
|
|
242
|
+
* console.log(`Hardware acceleration is ${isEnabled ? 'enabled' : 'disabled'}.`);
|
|
145
243
|
*/
|
|
146
244
|
isHardwareAccelerationEnabled(): Promise<boolean>;
|
|
147
245
|
private getMessage;
|
|
@@ -21,10 +21,30 @@ const Security_1 = __importDefault(require("./Security/Security"));
|
|
|
21
21
|
const Time_1 = __importDefault(require("./Time/Time"));
|
|
22
22
|
const Wifi_1 = __importDefault(require("./Wifi/Wifi"));
|
|
23
23
|
/**
|
|
24
|
-
* The `sos.management` API group provides methods for managing the device. Through this API things like device firmware,
|
|
25
|
-
* battery status, brightness, network information, remote control, power, time or volume can be monitored.
|
|
24
|
+
* The `sos.management` API group provides methods for managing the device. Through this API, things like device firmware,
|
|
25
|
+
* battery status, brightness, network information, remote control, power, time, or volume can be monitored.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* :::note GitHub Example
|
|
28
|
+
* - [Basic usage of the Management API](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/basics)
|
|
29
|
+
* - [Getting basic management data](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/js-management-getters)
|
|
30
|
+
* - [Setting management data](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/js-management-setters)
|
|
31
|
+
* :::
|
|
32
|
+
*
|
|
33
|
+
* <details>
|
|
34
|
+
* <summary>Management Capabilities</summary>
|
|
35
|
+
* | Capability | Description |
|
|
36
|
+
* |:------------|:-------------|
|
|
37
|
+
* | `MODEL` | If device can return proper model name |
|
|
38
|
+
* | `SERIAL_NUMBER` | If device can return serial number |
|
|
39
|
+
* | `BATTERY_STATUS` | If device can return battery status |
|
|
40
|
+
* | `TEMPERATURE` | If device can return current temperature |
|
|
41
|
+
* | `BRAND` | If device can return manufacturer brand |
|
|
42
|
+
* | `FACTORY_RESET` | If device can perform factory reset |
|
|
43
|
+
* | `EXTENDED_MANAGEMENT` | If device can return or set extended management URL |
|
|
44
|
+
* | `HARDWARE_ACCELERATION` | If device can turn hardware acceleration on or off |
|
|
45
|
+
*
|
|
46
|
+
* If you want to check if the device supports those capabilities, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
47
|
+
* </details>
|
|
28
48
|
*/
|
|
29
49
|
class Management {
|
|
30
50
|
messagePrefix;
|
|
@@ -70,9 +90,26 @@ class Management {
|
|
|
70
90
|
/**
|
|
71
91
|
* The `supports()` method determines whether a queried capability is supported.
|
|
72
92
|
*
|
|
73
|
-
*
|
|
93
|
+
* #### What are capabilities?
|
|
94
|
+
* Capabilities are features or functionalities that a device can support. We divided those capabilities into `front` and `management` capabilities.
|
|
95
|
+
* This section is about management capabilities, which include features to manage the device, receive information about the device, or change its settings.
|
|
96
|
+
*
|
|
97
|
+
* On the other hand, the `front` capabilities are features that are related to the application running on the device, such as displaying content, handling user input, etc.
|
|
98
|
+
* To check `front` capabilities, refer to the `sos.display.supports()` method or [this section](https://developers.signageos.io/sdk/sos/display#supports).
|
|
74
99
|
*
|
|
100
|
+
* :::tip
|
|
101
|
+
* If you want to check specific capabilities, refer to the sidebar for the selected management section. Every section has its capabilities written in the description,
|
|
102
|
+
* or check the **ManagementCapability** type in `supports()` method. It has a list of all available capabilities for all platforms.
|
|
103
|
+
* :::
|
|
104
|
+
*
|
|
105
|
+
* @param capability The capability to check for support.
|
|
106
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the capability is supported, otherwise `false`.
|
|
107
|
+
* @throws {Error} If the capability is not a valid string.
|
|
75
108
|
* @since 2.0.0
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* const isSupported = await sos.management.supports('OS_VERSION');
|
|
112
|
+
* console.log(`Is OS_VERSION supported? ${isSupported}`);
|
|
76
113
|
*/
|
|
77
114
|
async supports(capability) {
|
|
78
115
|
(0, Validate_1.default)({ capability }).required().string();
|
|
@@ -85,7 +122,12 @@ class Management {
|
|
|
85
122
|
/**
|
|
86
123
|
* The `getModel()` method returns the model of the device.
|
|
87
124
|
*
|
|
125
|
+
* @returns {Promise<string>} A promise that resolves to the model name of the device.
|
|
88
126
|
* @since 2.0.0
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* const model = await sos.management.getModel();
|
|
130
|
+
* console.log(`Device model is: ${model}`); // e.g. 'XC4055' (BrightSign)
|
|
89
131
|
*/
|
|
90
132
|
async getModel() {
|
|
91
133
|
const { model } = await this.postMessage({
|
|
@@ -96,7 +138,12 @@ class Management {
|
|
|
96
138
|
/**
|
|
97
139
|
* The `getSerialNumber()` method returns the serial number of the device.
|
|
98
140
|
*
|
|
141
|
+
* @returns {Promise<string>} A promise that resolves to the serial number of the device.
|
|
99
142
|
* @since 2.1.0
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* const serialNumber = await sos.management.getSerialNumber();
|
|
146
|
+
* console.log(`Device serial number is: ${serialNumber}`); // e.g. '1234567890'
|
|
100
147
|
*/
|
|
101
148
|
async getSerialNumber() {
|
|
102
149
|
const { serialNumber } = await this.postMessage({
|
|
@@ -111,7 +158,17 @@ class Management {
|
|
|
111
158
|
/**
|
|
112
159
|
* The `getBatteryStatus()` method returns information about the battery of the device.
|
|
113
160
|
*
|
|
161
|
+
* :::note
|
|
162
|
+
* - Emulator has mocked this method and will always return a battery status with 100% charge.
|
|
163
|
+
* :::
|
|
164
|
+
*
|
|
165
|
+
* @returns {Promise<IBatteryStatus>} A promise that resolves to an object containing the battery status.
|
|
166
|
+
* @throws {Error} If the device does not support battery status monitoring.
|
|
114
167
|
* @since 2.1.0
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* const batteryStatus = await sos.management.getBatteryStatus();
|
|
171
|
+
* console.log(`Battery status: ${batteryStatus.percentage}% charged`);
|
|
115
172
|
*/
|
|
116
173
|
async getBatteryStatus() {
|
|
117
174
|
const { batteryStatus } = await this.postMessage({
|
|
@@ -120,9 +177,15 @@ class Management {
|
|
|
120
177
|
return batteryStatus;
|
|
121
178
|
}
|
|
122
179
|
/**
|
|
123
|
-
* The `getTemperature()` method returns the temperature of the device (in 0-100 range of degrees Celsius).
|
|
180
|
+
* The `getTemperature()` method returns the temperature of the device (in the 0-100 range of degrees Celsius).
|
|
124
181
|
*
|
|
182
|
+
* @returns {Promise<number>} A promise that resolves to the current temperature of the device.
|
|
183
|
+
* @throws {Error} If the device does not support temperature monitoring.
|
|
125
184
|
* @since 3.0.0
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* const temperature = await sos.management.getTemperature();
|
|
188
|
+
* console.log(`Current device temperature is: ${temperature}°C`); // e.g. 25°C
|
|
126
189
|
*/
|
|
127
190
|
async getTemperature() {
|
|
128
191
|
const { currentTemperature } = await this.postMessage({
|
|
@@ -133,7 +196,13 @@ class Management {
|
|
|
133
196
|
/**
|
|
134
197
|
* The `getBrand()` method returns the manufacturer brand of the device.
|
|
135
198
|
*
|
|
199
|
+
* @returns {Promise<string>} A promise that resolves to the brand name of the device.
|
|
200
|
+
* @throws {Error} If the device does not support brand information.
|
|
136
201
|
* @since 5.7.0
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* const brand = await sos.management.getBrand();
|
|
205
|
+
* console.log(`Device brand is: ${brand}`); // e.g., 'Samsung', 'LG', BrightSign, etc.
|
|
137
206
|
*/
|
|
138
207
|
async getBrand() {
|
|
139
208
|
const { brand } = await this.postMessage({
|
|
@@ -141,16 +210,15 @@ class Management {
|
|
|
141
210
|
});
|
|
142
211
|
return brand;
|
|
143
212
|
}
|
|
144
|
-
// TODO: Used only by NEC, can be eventually removed?
|
|
145
213
|
/**
|
|
146
214
|
* The `resetSettings()` method initializes the reset of the specific device settings.
|
|
147
215
|
*
|
|
148
|
-
* :::
|
|
149
|
-
*
|
|
150
|
-
* This is currently only implemented on Linux platform.
|
|
151
|
-
*
|
|
216
|
+
* :::warning
|
|
217
|
+
* This is currently only implemented on the Linux platform.
|
|
152
218
|
* :::
|
|
153
219
|
*
|
|
220
|
+
* @returns {Promise<void>} A promise that resolves when the settings are reset.
|
|
221
|
+
* @throws {Error} If the device does not support settings reset.
|
|
154
222
|
* @since 4.0.0
|
|
155
223
|
*/
|
|
156
224
|
async resetSettings() {
|
|
@@ -161,6 +229,8 @@ class Management {
|
|
|
161
229
|
/**
|
|
162
230
|
* The `factoryReset()` method initializes the factory reset of the device.
|
|
163
231
|
*
|
|
232
|
+
* @returns {Promise<void>} A promise that resolves when the factory reset is initiated.
|
|
233
|
+
* @throws {Error} If the device does not support factory reset.
|
|
164
234
|
* @since 4.0.0
|
|
165
235
|
*/
|
|
166
236
|
async factoryReset() {
|
|
@@ -169,14 +239,14 @@ class Management {
|
|
|
169
239
|
});
|
|
170
240
|
}
|
|
171
241
|
/**
|
|
172
|
-
* The `getExtendedManagementUrl()` method returns the management
|
|
242
|
+
* The `getExtendedManagementUrl()` method returns the management URL of the device.
|
|
173
243
|
*
|
|
174
244
|
* :::info
|
|
175
|
-
*
|
|
176
|
-
* This is currently only implemented for the MagicInfo on Tizen platform.
|
|
177
|
-
*
|
|
245
|
+
* This is currently only implemented for the MagicInfo on the Tizen platform.
|
|
178
246
|
* :::
|
|
179
247
|
*
|
|
248
|
+
* @returns {Promise<string | null>} A promise that resolves to the management URL of the device, or `null` if not set.
|
|
249
|
+
* @throws {Error} If the device does not support the extended management URL.
|
|
180
250
|
* @since 6.2.0
|
|
181
251
|
*/
|
|
182
252
|
async getExtendedManagementUrl() {
|
|
@@ -186,17 +256,23 @@ class Management {
|
|
|
186
256
|
return url;
|
|
187
257
|
}
|
|
188
258
|
/**
|
|
189
|
-
* The `getExtendedManagementUrl()`
|
|
259
|
+
* The `getExtendedManagementUrl()` sets the management URL of the device.
|
|
190
260
|
*
|
|
191
261
|
* :::info
|
|
192
|
-
*
|
|
193
|
-
* This is currently only implemented for the MagicInfo on Tizen platform.
|
|
194
|
-
*
|
|
262
|
+
* This is currently only implemented for the MagicInfo on the Tizen platform.
|
|
195
263
|
* :::
|
|
196
264
|
*
|
|
197
|
-
* @param url The management URL to set.
|
|
198
|
-
*
|
|
265
|
+
* @param url The management URL to set. If `null`, it will remove the current URL.
|
|
266
|
+
* @returns {Promise<void>} A promise that resolves when the URL is set.
|
|
267
|
+
* @throws {Error} If the URL is not a valid string or if the device
|
|
268
|
+
* @throws {Error} If the device does not support the extended management URL.
|
|
199
269
|
* @since 6.2.0
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* await sos.management.setExtendedManagementUrl('https://example.com/management');
|
|
273
|
+
* // later
|
|
274
|
+
* const url = await sos.management.getExtendedManagementUrl();
|
|
275
|
+
* console.log(`Extended management URL is: ${url}`); // e.g. 'https://example.com/management'
|
|
200
276
|
*/
|
|
201
277
|
async setExtendedManagementUrl(url) {
|
|
202
278
|
(0, Validate_1.default)({ url }).string().canBeNull();
|
|
@@ -206,11 +282,26 @@ class Management {
|
|
|
206
282
|
});
|
|
207
283
|
}
|
|
208
284
|
/**
|
|
209
|
-
* The `setHardwareAcceleration()` method
|
|
285
|
+
* The `setHardwareAcceleration()` method turns hardware acceleration on or off.
|
|
210
286
|
*
|
|
211
|
-
*
|
|
287
|
+
* :::note
|
|
288
|
+
* - This is currently only implemented for the BrightSign platform.
|
|
289
|
+
* - Device must always be rebooted for the changes to take effect.
|
|
290
|
+
* :::
|
|
212
291
|
*
|
|
292
|
+
* @param enabled Whether hardware acceleration should be enabled.
|
|
293
|
+
* @returns {Promise<void>} A promise that resolves when the hardware acceleration setting is applied.
|
|
294
|
+
* @throws {Error} If the `enabled` parameter is not a boolean.
|
|
295
|
+
* @throws {Error} If the device does not support hardware acceleration management.
|
|
213
296
|
* @since 7.1.0
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* await sos.management.setHardwareAcceleration(true).then(async () => {
|
|
300
|
+
* console.log('Hardware acceleration enabled.');
|
|
301
|
+
* await sos.management.reboot();
|
|
302
|
+
* }).catch((error) => {
|
|
303
|
+
* console.error('Failed to set hardware acceleration:', error);
|
|
304
|
+
* });
|
|
214
305
|
*/
|
|
215
306
|
async setHardwareAcceleration(enabled) {
|
|
216
307
|
(0, Validate_1.default)({ enabled }).required().boolean();
|
|
@@ -222,7 +313,13 @@ class Management {
|
|
|
222
313
|
/**
|
|
223
314
|
* The `isHardwareAccelerationEnabled()` method returns whether hardware acceleration is enabled.
|
|
224
315
|
*
|
|
316
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if hardware acceleration is enabled, otherwise `false`.
|
|
317
|
+
* @throws {Error} If the device does not support hardware acceleration management.
|
|
225
318
|
* @since 7.1.0
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* const isEnabled = await sos.management.isHardwareAccelerationEnabled();
|
|
322
|
+
* console.log(`Hardware acceleration is ${isEnabled ? 'enabled' : 'disabled'}.`);
|
|
226
323
|
*/
|
|
227
324
|
async isHardwareAccelerationEnabled() {
|
|
228
325
|
const { enabled } = await this.postMessage({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Management.js","sourceRoot":"","sources":["../../../src/FrontApplet/Management/Management.ts"],"names":[],"mappings":";;;;;AACA,oEAA4C;AAC5C,oDAA4B;AAC5B,0DAAkC;AAClC,+EAAuD;AACvD,0DAAkC;AAClC,mEAA2C;AAI3C,gEAAwC;AACxC,iDAAyB;AACzB,gEAAwC;AACxC,+EAAuD;AACvD,0DAAkC;AAClC,0DAAkC;AAClC,kFAA0D;AAC1D,6DAAqC;AACrC,mEAA2C;AAC3C,uDAA+B;AAC/B,uDAA+B;AAE/B
|
|
1
|
+
{"version":3,"file":"Management.js","sourceRoot":"","sources":["../../../src/FrontApplet/Management/Management.ts"],"names":[],"mappings":";;;;;AACA,oEAA4C;AAC5C,oDAA4B;AAC5B,0DAAkC;AAClC,+EAAuD;AACvD,0DAAkC;AAClC,mEAA2C;AAI3C,gEAAwC;AACxC,iDAAyB;AACzB,gEAAwC;AACxC,+EAAuD;AACvD,0DAAkC;AAClC,0DAAkC;AAClC,kFAA0D;AAC1D,6DAAqC;AACrC,mEAA2C;AAC3C,uDAA+B;AAC/B,uDAA+B;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAqB,UAAU;IAsBrB;IACA;IAtBF,MAAM,CAAC,cAAc,GAAW,YAAY,CAAC;IAEpC,GAAG,CAAM;IACT,EAAE,CAAK;IACP,KAAK,CAAQ;IACb,KAAK,CAAQ;IACb,QAAQ,CAAW;IACnB,OAAO,CAAU;IACjB,KAAK,CAAQ;IACb,aAAa,CAAgB;IAC7B,MAAM,CAAS;IACf,IAAI,CAAO;IACX,OAAO,CAAU;IACjB,IAAI,CAAO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