@signageos/front-applet 8.2.0 → 8.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/bundle.js +5 -5
  2. package/dist/bundle.js.map +1 -1
  3. package/docs/index.md +9 -9
  4. package/docs/sos/browser.md +11 -3
  5. package/docs/sos/deviceInfo.md +1 -1
  6. package/docs/sos/display.md +13 -20
  7. package/docs/sos/fileSystem.md +31 -6
  8. package/docs/sos/hardware/barcodeScanner.md +9 -0
  9. package/docs/sos/hardware/index.md +9 -0
  10. package/docs/sos/native/mdc.md +8 -3
  11. package/docs/sos/osd.md +9 -0
  12. package/docs/sos/video.md +9 -0
  13. package/docs/sos_management/app.md +97 -18
  14. package/docs/sos_management/audio.md +43 -2
  15. package/docs/sos_management/autoRecovery.md +101 -0
  16. package/docs/sos_management/debug.md +84 -1
  17. package/docs/sos_management/firmware.md +64 -1
  18. package/docs/sos_management/index.md +217 -19
  19. package/docs/sos_management/network.md +84 -29
  20. package/docs/sos_management/os.md +59 -4
  21. package/docs/sos_management/package.md +25 -3
  22. package/docs/sos_management/power.md +142 -18
  23. package/docs/sos_management/proxy.md +54 -3
  24. package/docs/sos_management/remoteControl.md +55 -4
  25. package/docs/sos_management/screen.md +140 -29
  26. package/docs/sos_management/security.md +48 -5
  27. package/docs/sos_management/time.md +76 -9
  28. package/docs/sos_management/wifi.md +207 -45
  29. package/es6/FrontApplet/Browser/Browser.d.ts +11 -3
  30. package/es6/FrontApplet/Browser/Browser.js +11 -3
  31. package/es6/FrontApplet/Browser/Browser.js.map +1 -1
  32. package/es6/FrontApplet/Command/Command.js +1 -0
  33. package/es6/FrontApplet/Command/Command.js.map +1 -1
  34. package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +1 -1
  35. package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +15 -5
  36. package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
  37. package/es6/FrontApplet/DeviceInfo/IDeviceInfo.d.ts +1 -1
  38. package/es6/FrontApplet/Display/Display.d.ts +14 -19
  39. package/es6/FrontApplet/Display/Display.js +14 -19
  40. package/es6/FrontApplet/Display/Display.js.map +1 -1
  41. package/es6/FrontApplet/FileSystem/FileSystem.d.ts +27 -5
  42. package/es6/FrontApplet/FileSystem/FileSystem.js +27 -5
  43. package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
  44. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.d.ts +9 -0
  45. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js +9 -0
  46. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js.map +1 -1
  47. package/es6/FrontApplet/Hardware/Hardware.d.ts +9 -0
  48. package/es6/FrontApplet/Hardware/Hardware.js +9 -0
  49. package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
  50. package/es6/FrontApplet/Management/App/App.d.ts +53 -17
  51. package/es6/FrontApplet/Management/App/App.js +23 -12
  52. package/es6/FrontApplet/Management/App/App.js.map +1 -1
  53. package/es6/FrontApplet/Management/App/IApp.d.ts +3 -0
  54. package/es6/FrontApplet/Management/Audio/Audio.d.ts +24 -3
  55. package/es6/FrontApplet/Management/Audio/Audio.js +24 -3
  56. package/es6/FrontApplet/Management/Audio/Audio.js.map +1 -1
  57. package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.d.ts +49 -3
  58. package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js +49 -3
  59. package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js.map +1 -1
  60. package/es6/FrontApplet/Management/Debug/Debug.d.ts +44 -2
  61. package/es6/FrontApplet/Management/Debug/Debug.js +43 -1
  62. package/es6/FrontApplet/Management/Debug/Debug.js.map +1 -1
  63. package/es6/FrontApplet/Management/Firmware/Firmware.d.ts +41 -4
  64. package/es6/FrontApplet/Management/Firmware/Firmware.js +33 -0
  65. package/es6/FrontApplet/Management/Firmware/Firmware.js.map +1 -1
  66. package/es6/FrontApplet/Management/Management.d.ts +119 -21
  67. package/es6/FrontApplet/Management/Management.js +119 -22
  68. package/es6/FrontApplet/Management/Management.js.map +1 -1
  69. package/es6/FrontApplet/Management/Network/Network.d.ts +44 -25
  70. package/es6/FrontApplet/Management/Network/Network.js +28 -14
  71. package/es6/FrontApplet/Management/Network/Network.js.map +1 -1
  72. package/es6/FrontApplet/Management/OS/IOS.d.ts +3 -0
  73. package/es6/FrontApplet/Management/OS/OS.d.ts +32 -4
  74. package/es6/FrontApplet/Management/OS/OS.js +32 -4
  75. package/es6/FrontApplet/Management/OS/OS.js.map +1 -1
  76. package/es6/FrontApplet/Management/Package/Package.d.ts +18 -3
  77. package/es6/FrontApplet/Management/Package/Package.js +18 -4
  78. package/es6/FrontApplet/Management/Package/Package.js.map +1 -1
  79. package/es6/FrontApplet/Management/Power/IPower.d.ts +3 -0
  80. package/es6/FrontApplet/Management/Power/IPower.js.map +1 -1
  81. package/es6/FrontApplet/Management/Power/Power.d.ts +67 -20
  82. package/es6/FrontApplet/Management/Power/Power.js +70 -24
  83. package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
  84. package/es6/FrontApplet/Management/Proxy/Proxy.d.ts +28 -3
  85. package/es6/FrontApplet/Management/Proxy/Proxy.js +28 -3
  86. package/es6/FrontApplet/Management/Proxy/Proxy.js.map +1 -1
  87. package/es6/FrontApplet/Management/RemoteControl/RemoteControl.d.ts +23 -5
  88. package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js +23 -5
  89. package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js.map +1 -1
  90. package/es6/FrontApplet/Management/Screen/Screen.d.ts +77 -32
  91. package/es6/FrontApplet/Management/Screen/Screen.js +65 -26
  92. package/es6/FrontApplet/Management/Screen/Screen.js.map +1 -1
  93. package/es6/FrontApplet/Management/Security/Security.d.ts +25 -7
  94. package/es6/FrontApplet/Management/Security/Security.js +25 -7
  95. package/es6/FrontApplet/Management/Security/Security.js.map +1 -1
  96. package/es6/FrontApplet/Management/Time/Time.d.ts +47 -11
  97. package/es6/FrontApplet/Management/Time/Time.js +29 -7
  98. package/es6/FrontApplet/Management/Time/Time.js.map +1 -1
  99. package/es6/FrontApplet/Management/Wifi/IWifi.d.ts +3 -0
  100. package/es6/FrontApplet/Management/Wifi/IWifi.js.map +1 -1
  101. package/es6/FrontApplet/Management/Wifi/Wifi.d.ts +137 -42
  102. package/es6/FrontApplet/Management/Wifi/Wifi.js +137 -42
  103. package/es6/FrontApplet/Management/Wifi/Wifi.js.map +1 -1
  104. package/es6/FrontApplet/NativeCommands/MDC/Mdc.d.ts +8 -3
  105. package/es6/FrontApplet/NativeCommands/MDC/Mdc.js +8 -3
  106. package/es6/FrontApplet/NativeCommands/MDC/Mdc.js.map +1 -1
  107. package/es6/FrontApplet/OSD/OSD.d.ts +9 -0
  108. package/es6/FrontApplet/OSD/OSD.js +9 -0
  109. package/es6/FrontApplet/OSD/OSD.js.map +1 -1
  110. package/es6/FrontApplet/Video/Video.d.ts +9 -0
  111. package/es6/FrontApplet/Video/Video.js +9 -0
  112. package/es6/FrontApplet/Video/Video.js.map +1 -1
  113. package/es6/Monitoring/DeviceInfo/deviceInfoCommands.d.ts +1 -1
  114. package/package.json +1 -1
@@ -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
- * @example // {@link https://developers.signageos.io/sdk/management/js-management-management Example of the App API}
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
- * @param capability The capability to check for support.
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
- * :::info
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 url of the device.
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()` set the management url of the device.
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 enables or disables hardware acceleration.
211
+ * The `setHardwareAcceleration()` method turns hardware acceleration on or off.
135
212
  *
136
- * @param enabled Whether hardware acceleration should be enabled.
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
- * @example // {@link https://developers.signageos.io/sdk/management/js-management-management Example of the App API}
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
- * @param capability The capability to check for support.
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
- * :::info
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 url of the device.
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()` set the management url of the device.
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 enables or disables hardware acceleration.
285
+ * The `setHardwareAcceleration()` method turns hardware acceleration on or off.
210
286
  *
211
- * @param enabled Whether hardware acceleration should be enabled.
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;;;;;GAKG;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;IACX,QAAQ,CAAW;IACnB,KAAK,CAAQ;IACb,YAAY,CAAe;IAC3B,YAAY,CAAe;IAE3C,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;QAEtC,IAAI,CAAC,GAAG,GAAG,IAAI,aAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9D,IAAI,CAAC,EAAE,GAAG,IAAI,YAAE,CAAC,IAAI,CAAC,gBAAgB,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ACI,KAAK,CAAC,uBAAuB,CAAC,OAAgB;QACpD,IAAA,kBAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC;QAC3C,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;YAClD,OAAO;SACP,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACI,KAAK,CAAC,6BAA6B;QACzC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAC1C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,kCAAkC,CAAC;SACzD,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IAChB,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,gBAAgB,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC;IAC7C,CAAC;IAEO,gBAAgB;QACvB,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,UAAU,CAAC,cAAc,CAAC;IAC7D,CAAC;;AApTF,6BAqTC"}
@@ -2,13 +2,16 @@ import IPostMessage from '../../IPostMessage';
2
2
  import INetworkInfo, { INetworkInterface, INetworkOptions, INetworkOptionsLegacy, NetworkInterface } from './INetworkInfo';
3
3
  import INetwork from './INetwork';
4
4
  /**
5
- * The `sos.management.network` API groups together methods for networking.
5
+ * The `sos.management.network` API groups together networking methods. For Wi-Fi setup, use the [Wi-Fi API](https://developers.signageos.io/sdk/sos_management/wifi).
6
6
  *
7
- * :::info
7
+ * <details>
8
+ * <summary>Network Management Capabilities</summary>
9
+ * | Capability | Description |
10
+ * |:------------|:-------------|
11
+ * | `NETWORK_INFO` | If device supports returning network information |
8
12
  *
9
- * Use `sos.management.supports('NETWORK_INFO')` to check if the device supports managing the network setup.
10
- *
11
- * :::
13
+ * If you want to check if the device supports this capability, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
14
+ * </details>
12
15
  */
13
16
  export default class Network implements INetwork {
14
17
  private messagePrefix;
@@ -18,11 +21,19 @@ export default class Network implements INetwork {
18
21
  /** @deprecated Use `sos.management.network.listInterfaces()` instead. */
19
22
  getActiveInfo(): Promise<INetworkInfo>;
20
23
  /**
21
- * The `listInterface()` method returns list of all network interfaces, and their information like MAC address, IP address, etc. Wifi
22
- * connection strength is described as percentage in range from 0 to 100, linearly converted from dBm -90 to -30 respectively based on
23
- * platform.
24
+ * The `listInterface()` method returns a list of all network interfaces, and their information like MAC address, IP address, etc.
25
+ * Wi-Fi connection strength is described as a percentage in the range from 0 to 100, linearly converted from dBm -90 to -30, respectively, based on the platform.
24
26
  *
27
+ * @returns {Promise<INetworkInterface[]>} Resolves to an array of network interfaces with their information.
25
28
  * @since 4.9.0
29
+ *
30
+ * @example // {@link https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/network | Applet Example with Network Interfaces}
31
+ *
32
+ * @example
33
+ * const interfaces = await sos.management.network.listInterfaces();
34
+ * interfaces.forEach((iface) => {
35
+ * console.log(`Interface: ${iface.name}, IP: ${iface.ipAddress}, MAC: ${iface.macAddress}`);
36
+ * });
26
37
  */
27
38
  listInterfaces(): Promise<INetworkInterface[]>;
28
39
  /** @deprecated Use `sos.management.network.setManual(interfaceName, options)` instead. */
@@ -31,45 +42,53 @@ export default class Network implements INetwork {
31
42
  * The `setManual()` method manually configures a network interface.
32
43
  *
33
44
  * :::warning
34
- *
35
- * Wi-Fi interface can be configured with this method but it has to be first enabled via the [Wi-Fi API](./wifi#enableClient).
36
- *
45
+ * Wi-Fi interface can be configured with this method, but it has to be first enabled via the [Wi-Fi API](https://developers.signageos.io/sdk/sos_management/wifi#enableclient).
37
46
  * :::
38
47
  *
39
- * @param interfaceName The interface name which can be retrieved from the list of interfaces returned by listInterfaces()
48
+ * @param interfaceName The interface name which can be retrieved from the list of interfaces returned by `listInterfaces()`
40
49
  * @param options The network configuration options.
41
- *
50
+ * @param options.localAddress The local IP address to be set.
51
+ * @param options.gateway The gateway IP address to be set.
52
+ * @param options.netmask The netmask to be set.
53
+ * @param options.dns The DNS server array of IP addresses to be set.
54
+ * @returns {Promise<void>} A promise that resolves when the network is set.
55
+ * @throws {Error} If the network options are invalid.
56
+ * @throws {Error} If the device does not support network management.
42
57
  * @since 4.0.0
43
58
  */
44
59
  setManual(interfaceName: string, options: INetworkOptions): Promise<void>;
45
60
  /** @deprecated Use `sos.management.network.setDHCP(interfaceName)` instead. */
46
61
  setDHCP(networkInterface: NetworkInterface): Promise<void>;
47
62
  /**
48
- * The `setDHCP()` method configures a network interface to use DHCP.
63
+ * The `setDHCP()` method configures a selected network interface to use DHCP.
49
64
  *
50
65
  * :::warning
51
- *
52
- * Wi-Fi interface can be configured with this method but it has to be first enabled via the [Wi-Fi API](./wifi#enableClient).
53
- *
66
+ * Wi-Fi interface can be configured with this method, but it has to be first enabled via the [Wi-Fi API](https://developers.signageos.io/sdk/sos_management/wifi#enableclient).
54
67
  * :::
55
68
  *
56
- * @param interfaceName The interface name which can be retrieved from the list of interfaces returned by listInterfaces()
57
- *
69
+ * @param interfaceName The interface name which can be retrieved from the list of interfaces returned by `listInterfaces()`
70
+ * @returns {Promise<void>} A promise that resolves when the network interface is set to use DHCP.
58
71
  * @since 4.0.0
72
+ *
73
+ * @example
74
+ * await sos.management.network.setDHCP('eth0');
59
75
  */
60
76
  setDHCP(interfaceName: string): Promise<void>;
61
77
  /**
62
- * The `disableInterface()` disables a network interface.
78
+ * The `disableInterface()` turns off a selected network interface.
63
79
  *
64
80
  * :::warning
65
- *
66
- * Don't use this method to disable Wi-Fi. Use [Wi-Fi API](./wifi) to enable/disable Wi-Fi.
67
- *
81
+ * Don't use this method to disable Wi-Fi. Use [Wi-Fi API](https://developers.signageos.io/sdk/sos_management/wifi) to turn Wi-Fi on/off.
68
82
  * :::
69
83
  *
70
- * @param interfaceName The interface name which can be retrieved from the list of interfaces returned by listInterfaces()
71
- *
84
+ * @param interfaceName The interface name which can be retrieved from the list of interfaces returned by `listInterfaces()`
85
+ * @return {Promise<void>} A promise that resolves when the network interface is disabled.
86
+ * @throws {Error} If the interface name is invalid.
87
+ * @throws {Error} If the device does not support network management.
72
88
  * @since 4.13.0
89
+ *
90
+ * @example
91
+ * await sos.management.network.disableInterface('eth0');
73
92
  */
74
93
  disableInterface(interfaceName: string): Promise<void>;
75
94
  private getMessage;