@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.
- package/dist/bundle.js +5 -5
- package/dist/bundle.js.map +1 -1
- package/docs/index.md +9 -9
- package/docs/sos/browser.md +11 -3
- package/docs/sos/deviceInfo.md +1 -1
- 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 +11 -3
- package/es6/FrontApplet/Browser/Browser.js.map +1 -1
- package/es6/FrontApplet/Command/Command.js +1 -0
- package/es6/FrontApplet/Command/Command.js.map +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +15 -5
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
- package/es6/FrontApplet/DeviceInfo/IDeviceInfo.d.ts +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/Hardware/BarcodeScanner/BarcodeScanner.d.ts +9 -0
- 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/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 +70 -24
- 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 +137 -42
- 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/Video/Video.d.ts +9 -0
- package/es6/FrontApplet/Video/Video.js +9 -0
- package/es6/FrontApplet/Video/Video.js.map +1 -1
- package/es6/Monitoring/DeviceInfo/deviceInfoCommands.d.ts +1 -1
- package/package.json +1 -1
|
@@ -49,7 +49,7 @@ export default class DeviceInfo implements IDeviceInfo {
|
|
|
49
49
|
* const deviceName = await sos.deviceInfo.getDeviceName();
|
|
50
50
|
* console.log(`Device name is: ${deviceName}`);
|
|
51
51
|
*/
|
|
52
|
-
getDeviceName(): Promise<string>;
|
|
52
|
+
getDeviceName(): Promise<string | null>;
|
|
53
53
|
private getMessage;
|
|
54
54
|
private geDeviceNameFromTittle;
|
|
55
55
|
}
|
|
@@ -59,16 +59,26 @@ class DeviceInfo {
|
|
|
59
59
|
* console.log(`Device name is: ${deviceName}`);
|
|
60
60
|
*/
|
|
61
61
|
async getDeviceName() {
|
|
62
|
-
|
|
62
|
+
const deviceNameFromTittle = this.geDeviceNameFromTittle();
|
|
63
|
+
if (typeof deviceNameFromTittle === 'string') {
|
|
64
|
+
return deviceNameFromTittle;
|
|
65
|
+
}
|
|
66
|
+
const { name } = await this.postMessage({ type: this.getMessage('get_device_name') });
|
|
67
|
+
return name;
|
|
63
68
|
}
|
|
64
69
|
getMessage(name) {
|
|
65
70
|
return [this.messagePrefix, DeviceInfo.MESSAGE_PREFIX, name].join('.');
|
|
66
71
|
}
|
|
67
72
|
geDeviceNameFromTittle() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
try {
|
|
74
|
+
const rootDocument = window.parent.document;
|
|
75
|
+
const titleElement = rootDocument.head.getElementsByTagName('title')[0];
|
|
76
|
+
const parentElement = titleElement.parentElement;
|
|
77
|
+
return parentElement.getElementsByTagName('title')[0].innerHTML || null;
|
|
78
|
+
}
|
|
79
|
+
catch (_) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
72
82
|
}
|
|
73
83
|
}
|
|
74
84
|
exports.default = DeviceInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceInfo.js","sourceRoot":"","sources":["../../../src/FrontApplet/DeviceInfo/DeviceInfo.ts"],"names":[],"mappings":";;AAGA;;;GAGG;AACH,MAAqB,UAAU;IAKrB;IACA;IALF,MAAM,CAAC,cAAc,GAAW,aAAa,CAAC;IAErD,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ;;;;;;;;;;OAUG;IACI,KAAK,CAAC,WAAW;QACvB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACvF,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED;;;;;;;;;;OAUG;IACI,KAAK,CAAC,mBAAmB;QAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;QAC5F,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACI,KAAK,CAAC,aAAa;QACzB,
|
|
1
|
+
{"version":3,"file":"DeviceInfo.js","sourceRoot":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AAC;IACxE,CAAC;IAEO,sBAAsB;QAC7B,IAAI,CAAC;YACJ,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC5C,MAAM,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YACxE,MAAM,aAAa,GAAG,YAAY,CAAC,aAAc,CAAC;YAClD,OAAO,aAAa,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC;QACzE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;;AA9EF,6BA+EC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface IDeviceInfo {
|
|
2
2
|
getLocation(): Promise<IDeviceLocation | null>;
|
|
3
3
|
getOrganizationTags(): Promise<IOrganizationTag[]>;
|
|
4
|
-
getDeviceName(): Promise<string>;
|
|
4
|
+
getDeviceName(): Promise<string | null>;
|
|
5
5
|
}
|
|
6
6
|
export interface IDeviceLocation {
|
|
7
7
|
name: string;
|
|
@@ -4,24 +4,6 @@ import IDisplay, { DisplayCapability } from './IDisplay';
|
|
|
4
4
|
* The `sos.display` API groups together methods for getting information about the device. Primarily to find out which
|
|
5
5
|
* features it supports.
|
|
6
6
|
*
|
|
7
|
-
* <details>
|
|
8
|
-
* <summary>List of all display capabilities</summary>
|
|
9
|
-
* | Capability | Description |
|
|
10
|
-
* |:------------|:-------------|
|
|
11
|
-
* | `FILE_SYSTEM_INTERNAL_STORAGE` | If device supports internal storage |
|
|
12
|
-
* | `FILE_SYSTEM_EXTERNAL_STORAGE` | If device supports external storage |
|
|
13
|
-
* | `FILE_SYSTEM_FILE_CHECKSUM` | If device supports file checksum calculation |
|
|
14
|
-
* | `FILE_SYSTEM_LINK` | If device supports file system `link()` |
|
|
15
|
-
* | `FILE_SYSTEM_CREATE_ARCHIVE` | If device supports creating archives in the file system |
|
|
16
|
-
* | `FILE_SYSTEM_ARCHIVE_EXTRACT_INFO` | If device can determine a total size of a potentially extracted archive |
|
|
17
|
-
* | `TIMERS_PROPRIETARY` | If device supports proprietary timers |
|
|
18
|
-
* | `VIDEO_4K` | If device supports 4K video playback |
|
|
19
|
-
* | `BROWSER` | If device supports opening browser |
|
|
20
|
-
* | `SERIAL` | If device supports serial port communication |
|
|
21
|
-
* | `BARCODE_SCANNER` | If device supports barcode scanner setup |
|
|
22
|
-
* | `FRONT_OSD` | If device supports Front OSD (our on-screen display) |
|
|
23
|
-
* | `PROXIMITY_SENSOR` | If device supports proximity sensor |
|
|
24
|
-
* </details>
|
|
25
7
|
*/
|
|
26
8
|
declare class Display implements IDisplay {
|
|
27
9
|
private messagePrefix;
|
|
@@ -31,7 +13,20 @@ declare class Display implements IDisplay {
|
|
|
31
13
|
/** @internal */
|
|
32
14
|
constructor(messagePrefix: string, postMessage: IPostMessage<any>);
|
|
33
15
|
/**
|
|
34
|
-
* The `supports()` method determines whether a queried capability
|
|
16
|
+
* The `supports()` method determines whether the device supports a queried capability.
|
|
17
|
+
*
|
|
18
|
+
* #### What are capabilities?
|
|
19
|
+
* Capabilities are features or functionalities that a device can support. We divided those capabilities into `front` and `management` capabilities.
|
|
20
|
+
* This section is about front capabilities, which include features like handling serial ports, video and stream playback, and more.
|
|
21
|
+
*
|
|
22
|
+
* On the other hand, the `management` capabilities are features that are related to the application management, such as app upgrade, app version, and more.
|
|
23
|
+
* To check `management` capabilities, refer to the `sos.management.supports()` method or [this section](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
24
|
+
*
|
|
25
|
+
* :::tip
|
|
26
|
+
* 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,
|
|
27
|
+
* or check the **DisplayCapability** type in `supports()` methods. It has a list of all available capabilities for all platforms.
|
|
28
|
+
* :::
|
|
29
|
+
*
|
|
35
30
|
* @param capability The capability to check for support.
|
|
36
31
|
* @returns {Promise<boolean>} Resolves to `true` if the capability is supported, otherwise `false`.
|
|
37
32
|
* @since 3.1.0
|
|
@@ -8,24 +8,6 @@ const Validate_1 = __importDefault(require("../Validate/Validate"));
|
|
|
8
8
|
* The `sos.display` API groups together methods for getting information about the device. Primarily to find out which
|
|
9
9
|
* features it supports.
|
|
10
10
|
*
|
|
11
|
-
* <details>
|
|
12
|
-
* <summary>List of all display capabilities</summary>
|
|
13
|
-
* | Capability | Description |
|
|
14
|
-
* |:------------|:-------------|
|
|
15
|
-
* | `FILE_SYSTEM_INTERNAL_STORAGE` | If device supports internal storage |
|
|
16
|
-
* | `FILE_SYSTEM_EXTERNAL_STORAGE` | If device supports external storage |
|
|
17
|
-
* | `FILE_SYSTEM_FILE_CHECKSUM` | If device supports file checksum calculation |
|
|
18
|
-
* | `FILE_SYSTEM_LINK` | If device supports file system `link()` |
|
|
19
|
-
* | `FILE_SYSTEM_CREATE_ARCHIVE` | If device supports creating archives in the file system |
|
|
20
|
-
* | `FILE_SYSTEM_ARCHIVE_EXTRACT_INFO` | If device can determine a total size of a potentially extracted archive |
|
|
21
|
-
* | `TIMERS_PROPRIETARY` | If device supports proprietary timers |
|
|
22
|
-
* | `VIDEO_4K` | If device supports 4K video playback |
|
|
23
|
-
* | `BROWSER` | If device supports opening browser |
|
|
24
|
-
* | `SERIAL` | If device supports serial port communication |
|
|
25
|
-
* | `BARCODE_SCANNER` | If device supports barcode scanner setup |
|
|
26
|
-
* | `FRONT_OSD` | If device supports Front OSD (our on-screen display) |
|
|
27
|
-
* | `PROXIMITY_SENSOR` | If device supports proximity sensor |
|
|
28
|
-
* </details>
|
|
29
11
|
*/
|
|
30
12
|
class Display {
|
|
31
13
|
messagePrefix;
|
|
@@ -38,7 +20,20 @@ class Display {
|
|
|
38
20
|
this.postMessage = postMessage;
|
|
39
21
|
}
|
|
40
22
|
/**
|
|
41
|
-
* The `supports()` method determines whether a queried capability
|
|
23
|
+
* The `supports()` method determines whether the device supports a queried capability.
|
|
24
|
+
*
|
|
25
|
+
* #### What are capabilities?
|
|
26
|
+
* Capabilities are features or functionalities that a device can support. We divided those capabilities into `front` and `management` capabilities.
|
|
27
|
+
* This section is about front capabilities, which include features like handling serial ports, video and stream playback, and more.
|
|
28
|
+
*
|
|
29
|
+
* On the other hand, the `management` capabilities are features that are related to the application management, such as app upgrade, app version, and more.
|
|
30
|
+
* To check `management` capabilities, refer to the `sos.management.supports()` method or [this section](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
31
|
+
*
|
|
32
|
+
* :::tip
|
|
33
|
+
* 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,
|
|
34
|
+
* or check the **DisplayCapability** type in `supports()` methods. It has a list of all available capabilities for all platforms.
|
|
35
|
+
* :::
|
|
36
|
+
*
|
|
42
37
|
* @param capability The capability to check for support.
|
|
43
38
|
* @returns {Promise<boolean>} Resolves to `true` if the capability is supported, otherwise `false`.
|
|
44
39
|
* @since 3.1.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Display.js","sourceRoot":"","sources":["../../../src/FrontApplet/Display/Display.ts"],"names":[],"mappings":";;;;;AACA,oEAA4C;AAG5C
|
|
1
|
+
{"version":3,"file":"Display.js","sourceRoot":"","sources":["../../../src/FrontApplet/Display/Display.ts"],"names":[],"mappings":";;;;;AACA,oEAA4C;AAG5C;;;;GAIG;AACH,MAAM,OAAO;IAOH;IACA;IAPF,MAAM,CAAC,cAAc,GAAW,SAAS,CAAC;IAE1C,OAAO,GAAW,SAAU,CAAC;IAEpC,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ;;;;;;;;;;;;;;;;;;OAkBG;IACI,KAAK,CAAC,QAAQ,CAAC,UAA6B;QAClD,IAAA,kBAAQ,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QAClC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAC3C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;YACjC,UAAU;SACV,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,OAAO,CAAC,cAAc,GAAG,GAAG,GAAG,IAAI,CAAC;IACvE,CAAC;;AAGF,kBAAe,OAAO,CAAC"}
|
|
@@ -17,6 +17,20 @@ import { HashAlgorithm } from './HashAlgorithm';
|
|
|
17
17
|
* - [Example usage of File System API in Applet](https://github.com/signageos/applet-examples/tree/master/examples/content-js-api/file-system)
|
|
18
18
|
* :::
|
|
19
19
|
*
|
|
20
|
+
* <details>
|
|
21
|
+
* <summary>Device File System Capabilities</summary>
|
|
22
|
+
* | Capability | Description |
|
|
23
|
+
* |:------------|:-------------|
|
|
24
|
+
* | `FILE_SYSTEM_INTERNAL_STORAGE` | If device supports internal storage units |
|
|
25
|
+
* | `FILE_SYSTEM_EXTERNAL_STORAGE` | If device supports connecting external storage units |
|
|
26
|
+
* | `FILE_SYSTEM_FILE_CHECKSUM` | If device supports checksum for MD5 or CRC32 hash algorithms |
|
|
27
|
+
* | `FILE_SYSTEM_LINK` | If device supports creating hard links to files |
|
|
28
|
+
* | `FILE_SYSTEM_CREATE_ARCHIVE` | If device supports creating archives - zip |
|
|
29
|
+
* | `FILE_SYSTEM_ARCHIVE_EXTRACT_INFO` | If device supports extracting information about archive files |
|
|
30
|
+
*
|
|
31
|
+
* If you want to check if the device supports this capability, use [`sos.display.supports()`](https://developers.signageos.io/sdk/sos/display#supports).
|
|
32
|
+
* </details>
|
|
33
|
+
*
|
|
20
34
|
*
|
|
21
35
|
* ## Storing files permanently
|
|
22
36
|
* To allow more low-level file operations, the applet SDK exposes the File System API. Files created using this API are permanent and are only removed on a factory reset or file system wipeout.
|
|
@@ -71,7 +85,7 @@ export default class FileSystem implements IFileSystem {
|
|
|
71
85
|
*/
|
|
72
86
|
listStorageUnits(): Promise<IStorageUnit[]>;
|
|
73
87
|
/**
|
|
74
|
-
* A shorthand method for listing only the internal storage units (i.e
|
|
88
|
+
* A shorthand method for listing only the internal storage units (i.e., those with the `removable: false`). The capacity values are in bytes.
|
|
75
89
|
*
|
|
76
90
|
* @returns {Promise<IStorageUnit[]>} An array of internal storage units available on the device.
|
|
77
91
|
* @since 7.0.0
|
|
@@ -571,14 +585,22 @@ export default class FileSystem implements IFileSystem {
|
|
|
571
585
|
*/
|
|
572
586
|
link(sourceFilePath: IFilePath, destinationFilePath: IFilePath): Promise<void>;
|
|
573
587
|
/**
|
|
574
|
-
* The `wipeout()` method is used to wipe out all data from the file system
|
|
575
|
-
*
|
|
576
|
-
* @returns {Promise<void>} A promise that resolves when the wipeout is complete.
|
|
588
|
+
* The `wipeout()` method is used to wipe out all data from the file system.
|
|
577
589
|
*
|
|
578
590
|
* :::danger
|
|
579
|
-
* - Ensure that function is called only once, otherwise it will wipe out the file system again on applet start!
|
|
591
|
+
* - Ensure that function is called only once, otherwise it will wipe out the file system again on applet or device start!
|
|
580
592
|
* - This function is clearing internal file system storage, cache storage and cookies. Local storage will not be cleared.
|
|
581
593
|
* :::
|
|
594
|
+
*
|
|
595
|
+
* @returns {Promise<void>} A promise that resolves when the wipeout is complete.
|
|
596
|
+
*
|
|
597
|
+
* @example
|
|
598
|
+
* await sos.fileSystem.wipeout().then(() => {
|
|
599
|
+
* console.log('File system wiped out successfully.');
|
|
600
|
+
* await sos.management.power.systemReboot(); // Reboot the device after wipeout
|
|
601
|
+
* }).catch((error) => {
|
|
602
|
+
* console.error('Error wiping out file system:', error);
|
|
603
|
+
* });
|
|
582
604
|
*/
|
|
583
605
|
wipeout(): Promise<void>;
|
|
584
606
|
/** @internal */
|
|
@@ -21,6 +21,20 @@ const EVENT_STORAGE_UNITS_CHANGED = 'storage_units_changed';
|
|
|
21
21
|
* - [Example usage of File System API in Applet](https://github.com/signageos/applet-examples/tree/master/examples/content-js-api/file-system)
|
|
22
22
|
* :::
|
|
23
23
|
*
|
|
24
|
+
* <details>
|
|
25
|
+
* <summary>Device File System Capabilities</summary>
|
|
26
|
+
* | Capability | Description |
|
|
27
|
+
* |:------------|:-------------|
|
|
28
|
+
* | `FILE_SYSTEM_INTERNAL_STORAGE` | If device supports internal storage units |
|
|
29
|
+
* | `FILE_SYSTEM_EXTERNAL_STORAGE` | If device supports connecting external storage units |
|
|
30
|
+
* | `FILE_SYSTEM_FILE_CHECKSUM` | If device supports checksum for MD5 or CRC32 hash algorithms |
|
|
31
|
+
* | `FILE_SYSTEM_LINK` | If device supports creating hard links to files |
|
|
32
|
+
* | `FILE_SYSTEM_CREATE_ARCHIVE` | If device supports creating archives - zip |
|
|
33
|
+
* | `FILE_SYSTEM_ARCHIVE_EXTRACT_INFO` | If device supports extracting information about archive files |
|
|
34
|
+
*
|
|
35
|
+
* If you want to check if the device supports this capability, use [`sos.display.supports()`](https://developers.signageos.io/sdk/sos/display#supports).
|
|
36
|
+
* </details>
|
|
37
|
+
*
|
|
24
38
|
*
|
|
25
39
|
* ## Storing files permanently
|
|
26
40
|
* To allow more low-level file operations, the applet SDK exposes the File System API. Files created using this API are permanent and are only removed on a factory reset or file system wipeout.
|
|
@@ -84,7 +98,7 @@ class FileSystem {
|
|
|
84
98
|
return storageUnits;
|
|
85
99
|
}
|
|
86
100
|
/**
|
|
87
|
-
* A shorthand method for listing only the internal storage units (i.e
|
|
101
|
+
* A shorthand method for listing only the internal storage units (i.e., those with the `removable: false`). The capacity values are in bytes.
|
|
88
102
|
*
|
|
89
103
|
* @returns {Promise<IStorageUnit[]>} An array of internal storage units available on the device.
|
|
90
104
|
* @since 7.0.0
|
|
@@ -729,14 +743,22 @@ class FileSystem {
|
|
|
729
743
|
});
|
|
730
744
|
}
|
|
731
745
|
/**
|
|
732
|
-
* The `wipeout()` method is used to wipe out all data from the file system
|
|
733
|
-
*
|
|
734
|
-
* @returns {Promise<void>} A promise that resolves when the wipeout is complete.
|
|
746
|
+
* The `wipeout()` method is used to wipe out all data from the file system.
|
|
735
747
|
*
|
|
736
748
|
* :::danger
|
|
737
|
-
* - Ensure that function is called only once, otherwise it will wipe out the file system again on applet start!
|
|
749
|
+
* - Ensure that function is called only once, otherwise it will wipe out the file system again on applet or device start!
|
|
738
750
|
* - This function is clearing internal file system storage, cache storage and cookies. Local storage will not be cleared.
|
|
739
751
|
* :::
|
|
752
|
+
*
|
|
753
|
+
* @returns {Promise<void>} A promise that resolves when the wipeout is complete.
|
|
754
|
+
*
|
|
755
|
+
* @example
|
|
756
|
+
* await sos.fileSystem.wipeout().then(() => {
|
|
757
|
+
* console.log('File system wiped out successfully.');
|
|
758
|
+
* await sos.management.power.systemReboot(); // Reboot the device after wipeout
|
|
759
|
+
* }).catch((error) => {
|
|
760
|
+
* console.error('Error wiping out file system:', error);
|
|
761
|
+
* });
|
|
740
762
|
*/
|
|
741
763
|
async wipeout() {
|
|
742
764
|
await this.postMessage({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../../../src/FrontApplet/FileSystem/FileSystem.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,mCAWiB;AAEjB,oEAA4C;AAI5C,MAAM,2BAA2B,GAAG,uBAAuB,CAAC;AAE5D
|
|
1
|
+
{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../../../src/FrontApplet/FileSystem/FileSystem.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,mCAWiB;AAEjB,oEAA4C;AAI5C,MAAM,2BAA2B,GAAG,uBAAuB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAqB,UAAU;IAOrB;IACA;IAPF,MAAM,CAAC,cAAc,GAAW,aAAa,CAAC;IAE7C,YAAY,CA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IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC;gBAC5C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;gBACpD,MAAM;YACP,QAAQ;QACT,CAAC;IACF,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,UAAU,CAAC,cAAc,GAAG,GAAG,GAAG,IAAI,CAAC;IAC1E,CAAC;;AA1uBF,6BA2uBC"}
|
|
@@ -9,6 +9,15 @@ export declare const DEFAULT_SCANNER_ID = 0;
|
|
|
9
9
|
* :::note
|
|
10
10
|
* This API is experimental and may change in the future.
|
|
11
11
|
* :::
|
|
12
|
+
*
|
|
13
|
+
* <details>
|
|
14
|
+
* <summary>Device Barcode Scanner Capabilities</summary>
|
|
15
|
+
* | Capability | Description |
|
|
16
|
+
* |:------------|:-------------|
|
|
17
|
+
* | `BARCODE_SCANNER` | If device supports serial communication for Barcode Scanners |
|
|
18
|
+
*
|
|
19
|
+
* If you want to check if the device supports this capability, use [`sos.display.supports()`](https://developers.signageos.io/sdk/sos/display#supports).
|
|
20
|
+
* </details>
|
|
12
21
|
*/
|
|
13
22
|
export default class BarcodeScanner implements IBarcodeScanner {
|
|
14
23
|
private messagePrefix;
|
|
@@ -10,6 +10,15 @@ exports.DEFAULT_SCANNER_ID = 0;
|
|
|
10
10
|
* :::note
|
|
11
11
|
* This API is experimental and may change in the future.
|
|
12
12
|
* :::
|
|
13
|
+
*
|
|
14
|
+
* <details>
|
|
15
|
+
* <summary>Device Barcode Scanner Capabilities</summary>
|
|
16
|
+
* | Capability | Description |
|
|
17
|
+
* |:------------|:-------------|
|
|
18
|
+
* | `BARCODE_SCANNER` | If device supports serial communication for Barcode Scanners |
|
|
19
|
+
*
|
|
20
|
+
* If you want to check if the device supports this capability, use [`sos.display.supports()`](https://developers.signageos.io/sdk/sos/display#supports).
|
|
21
|
+
* </details>
|
|
13
22
|
*/
|
|
14
23
|
class BarcodeScanner {
|
|
15
24
|
messagePrefix;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarcodeScanner.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAKzB,QAAA,kBAAkB,GAAG,CAAC,CAAC;AAEpC
|
|
1
|
+
{"version":3,"file":"BarcodeScanner.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAKzB,QAAA,kBAAkB,GAAG,CAAC,CAAC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAqB,cAAc;IAOzB;IACA;IAPF,MAAM,CAAC,cAAc,GAAsB,iBAAiB,CAAC;IAE5D,YAAY,CAAe;IAEnC,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;QAEtC,IAAI,CAAC,YAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,UAAU;QACtB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAC1C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;SACpC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,KAAK,CAAC,KAAK,CAAC,WAAuD;QACzE,MAAM,cAAc,GAAG,EAAE,SAAS,EAAE,0BAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;QAChG,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,WAAW,EAAE,CAAC;QACxE,IAAI,OAAO,CAAC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,GAAG,CAAC,IAAI,CAAC,CAAC;gBACrE,MAAM;YACP,KAAK,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBAC5B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,GAAG,CAAC,SAAS,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;gBACtE,MAAM;YACP,QAAQ;QACT,CAAC;IACF,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5E,CAAC;;AA/FF,iCAgGC"}
|
|
@@ -14,6 +14,15 @@ import ISerialPort from './ISerialPort';
|
|
|
14
14
|
* - Samsung Kiosk serial connection only works over serial ports, not over USB ports.
|
|
15
15
|
* :::
|
|
16
16
|
*
|
|
17
|
+
* <details>
|
|
18
|
+
* <summary>Device Hardware Capabilities</summary>
|
|
19
|
+
* | Capability | Description |
|
|
20
|
+
* |:------------|:-------------|
|
|
21
|
+
* | `SERIAL` | If the device supports sending and receiving data via serial ports |
|
|
22
|
+
*
|
|
23
|
+
* If you want to check if the device supports this capability, use [`sos.display.supports()`](https://developers.signageos.io/sdk/sos/display#supports).
|
|
24
|
+
* </details>
|
|
25
|
+
*
|
|
17
26
|
* ### List of supported serial ports
|
|
18
27
|
* Bellow is example list of serial ports that can be used with `sos.hardware.openSerialPort()` method.
|
|
19
28
|
*
|
|
@@ -15,6 +15,15 @@ const BarcodeScanner_1 = __importDefault(require("./BarcodeScanner/BarcodeScanne
|
|
|
15
15
|
* - Samsung Kiosk serial connection only works over serial ports, not over USB ports.
|
|
16
16
|
* :::
|
|
17
17
|
*
|
|
18
|
+
* <details>
|
|
19
|
+
* <summary>Device Hardware Capabilities</summary>
|
|
20
|
+
* | Capability | Description |
|
|
21
|
+
* |:------------|:-------------|
|
|
22
|
+
* | `SERIAL` | If the device supports sending and receiving data via serial ports |
|
|
23
|
+
*
|
|
24
|
+
* If you want to check if the device supports this capability, use [`sos.display.supports()`](https://developers.signageos.io/sdk/sos/display#supports).
|
|
25
|
+
* </details>
|
|
26
|
+
*
|
|
18
27
|
* ### List of supported serial ports
|
|
19
28
|
* Bellow is example list of serial ports that can be used with `sos.hardware.openSerialPort()` method.
|
|
20
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hardware.js","sourceRoot":"","sources":["../../../src/FrontApplet/Hardware/Hardware.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,oDAA4B;AAC5B,8DAAsC;AAGtC,qFAA6D;AAK7D
|
|
1
|
+
{"version":3,"file":"Hardware.js","sourceRoot":"","sources":["../../../src/FrontApplet/Hardware/Hardware.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,oDAA4B;AAC5B,8DAAsC;AAGtC,qFAA6D;AAK7D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAqB,QAAQ;IAUnB;IACA;IAVF,MAAM,CAAC,cAAc,GAAW,UAAU,CAAC;IAElC,GAAG,CAAM;IAClB,cAAc,CAAiB;IAErB,YAAY,CAAe;IAE5C,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;QAEtC,IAAI,CAAC,YAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;QACvC,IAAI,CAAC,GAAG,GAAG,IAAI,aAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9D,IAAI,CAAC,cAAc,GAAG,IAAI,wBAAc,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACI,KAAK,CAAC,cAAc,CAAC,OAA2B;QACtD,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YACxC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;YACzC,OAAO;SACP,CAAC,CAAC;QACH,OAAO,IAAI,oBAAU,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5F,CAAC;IAED,gBAAgB;IACT,iBAAiB,CAAC,IAAyD;QACjF,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;gBACvC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;gBACpE,MAAM;YACP;gBACC,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAkC,CAAC,CAAC;QAC5E,CAAC;IACF,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,QAAQ,CAAC,cAAc,CAAC;IAC3D,CAAC;;AAnEF,2BAoEC"}
|
|
@@ -2,6 +2,15 @@ import IPostMessage from '../../IPostMessage';
|
|
|
2
2
|
import IApp, { AppType } from './IApp';
|
|
3
3
|
/**
|
|
4
4
|
* The `sos.management.app` API groups together methods for managing the signageOS application installed on the system.
|
|
5
|
+
*
|
|
6
|
+
* <details>
|
|
7
|
+
* <summary>App Management Capabilities</summary>
|
|
8
|
+
* | Capability | Description |
|
|
9
|
+
* |:------------|:-------------|
|
|
10
|
+
* | `APP_UPGRADE` | If the signageOS application can upgrade itself to a specific version |
|
|
11
|
+
*
|
|
12
|
+
* If you want to check if the device supports this capability, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).
|
|
13
|
+
* </details>
|
|
5
14
|
*/
|
|
6
15
|
export default class App implements IApp {
|
|
7
16
|
private messagePrefix;
|
|
@@ -9,38 +18,47 @@ export default class App implements IApp {
|
|
|
9
18
|
/** @internal */
|
|
10
19
|
constructor(messagePrefix: string, postMessage: IPostMessage<any>);
|
|
11
20
|
/**
|
|
12
|
-
* The `getType()` method returns type of the platform the application is running on.
|
|
21
|
+
* The `getType()` method returns the type of the platform the application is running on.
|
|
13
22
|
*
|
|
14
23
|
* :::info
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
24
|
+
* - If you need to get a specific Android brand or Raspberry Pi model, use the `sos.management.firmware.getType()`.
|
|
25
|
+
* - `default` type is always Emulator.
|
|
18
26
|
* :::
|
|
19
27
|
*
|
|
28
|
+
* @returns {Promise<AppType>} Resolves to the type of the application platform.
|
|
20
29
|
* @since 4.0.0
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const appType = await sos.management.app.getType();
|
|
33
|
+
* console.log(appType); // tizen, linux, webos, etc.
|
|
21
34
|
*/
|
|
22
35
|
getType(): Promise<AppType>;
|
|
23
36
|
/**
|
|
24
|
-
* The `getVersion()` method returns version of the
|
|
25
|
-
*
|
|
26
|
-
* :::info
|
|
27
|
-
*
|
|
28
|
-
* This API is only available for Applets deployed via Timing from Box or REST API.
|
|
29
|
-
*
|
|
30
|
-
* :::
|
|
37
|
+
* The `getVersion()` method returns the version of the Core App that is currently running on the device.
|
|
31
38
|
*
|
|
39
|
+
* @returns {Promise<string>} Resolves to the version of the Core application.
|
|
32
40
|
* @since 4.0.0
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const version = await sos.management.app.getVersion();
|
|
44
|
+
* console.log(`Current application version is: ${version}`); // e.g. '4.0.0', '5.2.1', etc.
|
|
33
45
|
*/
|
|
34
46
|
getVersion(): Promise<string>;
|
|
35
47
|
/**
|
|
36
|
-
* The `upgrade(version, baseUrl?)` method upgrades the signageOS application using version and baseUrl. Platform users can install general
|
|
37
|
-
* application version directly with passing just version number. Optionally, the baseUrl can be passed as argument to specify server
|
|
48
|
+
* The `upgrade(version, baseUrl?)` method upgrades the signageOS application using version and baseUrl. Platform users can install the general
|
|
49
|
+
* application version directly with passing just the version number. Optionally, the baseUrl can be passed as an argument to specify the server
|
|
38
50
|
* where the application files are accessible.
|
|
39
51
|
*
|
|
40
52
|
* @param version The version of the application being installed.
|
|
41
53
|
* @param [baseUrl='https://2.signageos.io'] Optional server URL where application files are located.
|
|
42
|
-
*
|
|
54
|
+
* @returns {Promise<void>} A promise that resolves when the upgrade starts.
|
|
55
|
+
* @throws {Error} If the upgrade fails.
|
|
43
56
|
* @since 4.0.0
|
|
57
|
+
*
|
|
58
|
+
* @example // {@link https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/app-upgrade | How to upgrade application via applets}
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* await sos.management.app.upgrade('4.0.0', 'https://2.signageos.io')
|
|
44
62
|
*/
|
|
45
63
|
upgrade(version: string, baseUrl?: string): Promise<void>;
|
|
46
64
|
/**
|
|
@@ -55,8 +73,8 @@ export default class App implements IApp {
|
|
|
55
73
|
*/
|
|
56
74
|
upgrade(baseUrl: string, version: string): Promise<void>;
|
|
57
75
|
/**
|
|
58
|
-
* The `upgrade(appUri)` method upgrades the signageOS application with provided appUri
|
|
59
|
-
*
|
|
76
|
+
* The `upgrade(appUri)` method upgrades the signageOS application with the provided `appUri`. Open users can upgrade the app passing FQN
|
|
77
|
+
* URI where the application's main file is located.
|
|
60
78
|
*
|
|
61
79
|
* This file type/extension differs for every platform. E.g.:
|
|
62
80
|
* - SSSP: http://example.com/apps/sssp_config.xml or http://example.com/apps/ApplicationName.zip
|
|
@@ -66,10 +84,28 @@ export default class App implements IApp {
|
|
|
66
84
|
* - Brightsign: http://example.com/apps/ApplicationName.zip
|
|
67
85
|
* - Linux: http://example.com/apps/ApplicationName.apk
|
|
68
86
|
* - Android: http://example.com/apps/ApplicationName.apk
|
|
87
|
+
* - ChromeOS: Not supported
|
|
69
88
|
*
|
|
70
|
-
*
|
|
89
|
+
* :::tip
|
|
90
|
+
* Check our latest versions in our [changelogs](https://docs.signageos.io/hc/en-us/sections/4409161443730-Core-Apps).
|
|
91
|
+
* :::
|
|
71
92
|
*
|
|
93
|
+
* @param appUri FQN uri where the application's main file is located.
|
|
94
|
+
* @returns {Promise<void>} A promise that resolves when the upgrade starts.
|
|
95
|
+
* @throws {Error} If the upgrade fails.
|
|
72
96
|
* @since 4.0.0
|
|
97
|
+
*
|
|
98
|
+
* @example // {@link https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/app-upgrade | How to upgrade application via applets}
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* // Upgrade the application to a specific version
|
|
102
|
+
* await sos.management.app.upgrade('http://example.com/apps/ApplicationName.zip')
|
|
103
|
+
* .then(() => {
|
|
104
|
+
* console.log('Application upgrade started successfully.');
|
|
105
|
+
* })
|
|
106
|
+
* .catch((error) => {
|
|
107
|
+
* console.error('Failed to start application upgrade:', error);
|
|
108
|
+
* });
|
|
73
109
|
*/
|
|
74
110
|
upgrade(appUri: string): Promise<void>;
|
|
75
111
|
private getMessage;
|
|
@@ -3,6 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const UpgradeHelper_1 = require("../helpers/UpgradeHelper");
|
|
4
4
|
/**
|
|
5
5
|
* The `sos.management.app` API groups together methods for managing the signageOS application installed on the system.
|
|
6
|
+
*
|
|
7
|
+
* <details>
|
|
8
|
+
* <summary>App Management Capabilities</summary>
|
|
9
|
+
* | Capability | Description |
|
|
10
|
+
* |:------------|:-------------|
|
|
11
|
+
* | `APP_UPGRADE` | If the signageOS application can upgrade itself to a specific version |
|
|
12
|
+
*
|
|
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>
|
|
6
15
|
*/
|
|
7
16
|
class App {
|
|
8
17
|
messagePrefix;
|
|
@@ -13,15 +22,19 @@ class App {
|
|
|
13
22
|
this.postMessage = postMessage;
|
|
14
23
|
}
|
|
15
24
|
/**
|
|
16
|
-
* The `getType()` method returns type of the platform the application is running on.
|
|
25
|
+
* The `getType()` method returns the type of the platform the application is running on.
|
|
17
26
|
*
|
|
18
27
|
* :::info
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
28
|
+
* - If you need to get a specific Android brand or Raspberry Pi model, use the `sos.management.firmware.getType()`.
|
|
29
|
+
* - `default` type is always Emulator.
|
|
22
30
|
* :::
|
|
23
31
|
*
|
|
32
|
+
* @returns {Promise<AppType>} Resolves to the type of the application platform.
|
|
24
33
|
* @since 4.0.0
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const appType = await sos.management.app.getType();
|
|
37
|
+
* console.log(appType); // tizen, linux, webos, etc.
|
|
25
38
|
*/
|
|
26
39
|
async getType() {
|
|
27
40
|
const { applicationType } = await this.postMessage({
|
|
@@ -29,17 +42,15 @@ class App {
|
|
|
29
42
|
});
|
|
30
43
|
return applicationType;
|
|
31
44
|
}
|
|
32
|
-
// TODO: unify box/cloud control
|
|
33
45
|
/**
|
|
34
|
-
* The `getVersion()` method returns version of the
|
|
35
|
-
*
|
|
36
|
-
* :::info
|
|
37
|
-
*
|
|
38
|
-
* This API is only available for Applets deployed via Timing from Box or REST API.
|
|
39
|
-
*
|
|
40
|
-
* :::
|
|
46
|
+
* The `getVersion()` method returns the version of the Core App that is currently running on the device.
|
|
41
47
|
*
|
|
48
|
+
* @returns {Promise<string>} Resolves to the version of the Core application.
|
|
42
49
|
* @since 4.0.0
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* const version = await sos.management.app.getVersion();
|
|
53
|
+
* console.log(`Current application version is: ${version}`); // e.g. '4.0.0', '5.2.1', etc.
|
|
43
54
|
*/
|
|
44
55
|
async getVersion() {
|
|
45
56
|
const { applicationVersion } = await this.postMessage({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/App/App.ts"],"names":[],"mappings":";;AACA,4DAAiE;AAGjE
|
|
1
|
+
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/App/App.ts"],"names":[],"mappings":";;AACA,4DAAiE;AAGjE;;;;;;;;;;;GAWG;AACH,MAAqB,GAAG;IAGd;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ;;;;;;;;;;;;;;OAcG;IACI,KAAK,CAAC,OAAO;QACnB,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;;;;;;;;;OASG;IACI,KAAK,CAAC,UAAU;QACtB,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YACrD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC;SAChD,CAAC,CAAC;QAEH,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAqED,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,aAAa,CAAC;YACpC,OAAO;YACP,OAAO;YACP,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;CACD;AAjID,sBAiIC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { AnyString } from '../../../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* All available app types
|
|
4
|
+
*/
|
|
2
5
|
export type AppType = 'android' | 'brightsign' | 'default' | 'linux' | 'sssp' | 'tizen' | 'webos' | 'windows' | 'chromeos' | AnyString;
|
|
3
6
|
export default interface IApp {
|
|
4
7
|
getType(): Promise<AppType>;
|