@signageos/front-applet 8.3.0 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +6 -6
- package/dist/bundle.js.map +1 -1
- package/docs/index.md +1 -1
- package/docs/sos/command.md +1 -1
- package/docs/sos/deviceInfo.md +60 -14
- package/docs/sos/display.md +32 -0
- package/docs/sos/hardware/index.md +9 -0
- package/docs/sos/input.md +3 -0
- package/docs/sos/offline/index.md +18 -0
- package/docs/sos/proofOfPlay.md +7 -0
- package/docs/sos/sync.md +2 -0
- package/docs/sos_management/index.md +28 -0
- package/docs/sos_management/network.md +7 -0
- package/docs/sos_management/power.md +5 -0
- package/docs/sos_management/screen.md +59 -8
- package/docs/sos_management/wifi.md +18 -13
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +15 -11
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +17 -10
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
- package/es6/FrontApplet/DeviceInfo/IDeviceInfo.d.ts +24 -0
- package/es6/FrontApplet/Display/Display.d.ts +13 -0
- package/es6/FrontApplet/Display/Display.js +18 -0
- package/es6/FrontApplet/Display/Display.js.map +1 -1
- package/es6/FrontApplet/Display/IDisplay.d.ts +1 -0
- package/es6/FrontApplet/Hardware/ISerialPortDataMessage.d.ts +2 -0
- package/es6/FrontApplet/Hardware/ISerialPortOptions.d.ts +9 -0
- package/es6/FrontApplet/Hardware/ISerialPortOptions.js +1 -1
- package/es6/FrontApplet/Input/IKeyUpEvent.d.ts +3 -0
- package/es6/FrontApplet/Management/IManagement.d.ts +1 -0
- package/es6/FrontApplet/Management/Management.d.ts +13 -0
- package/es6/FrontApplet/Management/Management.js +18 -0
- package/es6/FrontApplet/Management/Management.js.map +1 -1
- package/es6/FrontApplet/Management/Network/INetwork.d.ts +7 -0
- package/es6/FrontApplet/Management/Power/IPower.d.ts +5 -0
- package/es6/FrontApplet/Management/Screen/IScreen.d.ts +21 -5
- package/es6/FrontApplet/Management/Screen/IScreen.js +5 -0
- package/es6/FrontApplet/Management/Screen/IScreen.js.map +1 -1
- package/es6/FrontApplet/Management/Screen/Screen.d.ts +25 -8
- package/es6/FrontApplet/Management/Screen/Screen.js +22 -1
- package/es6/FrontApplet/Management/Screen/Screen.js.map +1 -1
- package/es6/FrontApplet/Management/Wifi/IWifi.d.ts +14 -0
- package/es6/FrontApplet/Management/Wifi/IWifi.js.map +1 -1
- package/es6/FrontApplet/Management/Wifi/Wifi.d.ts +4 -13
- package/es6/FrontApplet/Management/Wifi/Wifi.js +4 -13
- package/es6/FrontApplet/Management/Wifi/Wifi.js.map +1 -1
- package/es6/FrontApplet/Offline/IAddFont.d.ts +3 -0
- package/es6/FrontApplet/Offline/ISaveFile.d.ts +5 -0
- package/es6/FrontApplet/ProofOfPlay/IRecordItemOptions.d.ts +7 -0
- package/es6/FrontApplet/Sync/Sync.d.ts +2 -0
- package/es6/Monitoring/Display/displayCommands.d.ts +11 -1
- package/es6/Monitoring/Display/displayCommands.js +3 -1
- package/es6/Monitoring/Display/displayCommands.js.map +1 -1
- package/es6/Monitoring/Display/handleDisplayRequests.js +6 -0
- package/es6/Monitoring/Display/handleDisplayRequests.js.map +1 -1
- package/es6/Monitoring/FileSystem/handleFileSystemRequests.js +2 -1
- package/es6/Monitoring/FileSystem/handleFileSystemRequests.js.map +1 -1
- package/es6/Monitoring/Management/handleManagementRequests.js +6 -0
- package/es6/Monitoring/Management/handleManagementRequests.js.map +1 -1
- package/es6/Monitoring/Management/managementCommands.d.ts +11 -1
- package/es6/Monitoring/Management/managementCommands.js +3 -1
- package/es6/Monitoring/Management/managementCommands.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ class DeviceInfo {
|
|
|
14
14
|
this.postMessage = postMessage;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* The `getLocation()` method returns location of the device. Location is requested from server on application start, automatically
|
|
17
|
+
* The `getLocation()` method returns location of the device with child tags if available. Location is requested from server on application start, automatically
|
|
18
18
|
* updated when changed and persisted in local storage.
|
|
19
19
|
*
|
|
20
20
|
* :::note
|
|
@@ -29,15 +29,7 @@ class DeviceInfo {
|
|
|
29
29
|
return location;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* updated when changed and persisted in local storage.
|
|
34
|
-
*
|
|
35
|
-
* :::note
|
|
36
|
-
* Tags can be set only in CloudControl on Device Info page, or via [Rest API](https://developers.signageos.io/api/#tag/DeviceTag-(Device-Tags)).
|
|
37
|
-
* :::
|
|
38
|
-
*
|
|
39
|
-
* @returns {Promise<IOrganizationTag[]>} A promise that resolves to an array of organization tags.
|
|
40
|
-
* @since 5.2.0
|
|
32
|
+
* @deprecated Please use `getDeviceTags()` method instead.
|
|
41
33
|
*/
|
|
42
34
|
async getOrganizationTags() {
|
|
43
35
|
const { tags } = await this.postMessage({ type: this.getMessage('get_organization_tags') });
|
|
@@ -66,6 +58,21 @@ class DeviceInfo {
|
|
|
66
58
|
const { name } = await this.postMessage({ type: this.getMessage('get_device_name') });
|
|
67
59
|
return name;
|
|
68
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* The `getDeviceTags()` method returns all organization tags assigned to the device including parent tags, if available.
|
|
63
|
+
* Tags are requested from server on application start, automatically updated when changed and persisted in local storage.
|
|
64
|
+
*
|
|
65
|
+
* :::note
|
|
66
|
+
* Tags can be set only in CloudControl on Device Info page, or via [Rest API](https://developers.signageos.io/api/#tag/DeviceTag-(Device-Tags)).
|
|
67
|
+
* :::
|
|
68
|
+
*
|
|
69
|
+
* @returns {Promise<IDeviceTag[]>} A promise that returns the device tags.
|
|
70
|
+
* @since 8.5.0
|
|
71
|
+
*/
|
|
72
|
+
async getDeviceTags() {
|
|
73
|
+
const { tags } = await this.postMessage({ type: this.getMessage('get_device_tags') });
|
|
74
|
+
return tags;
|
|
75
|
+
}
|
|
69
76
|
getMessage(name) {
|
|
70
77
|
return [this.messagePrefix, DeviceInfo.MESSAGE_PREFIX, name].join('.');
|
|
71
78
|
}
|
|
@@ -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
|
|
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;;OAEG;IACI,KAAK,CAAC,mBAAmB;QAC/B,MAAM,EAAE,IAAI,EAAE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I,CAAC;QACzE,CAAC;QAAC,MAAM,CAAC;YACR,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;;AAtFF,6BAuFC"}
|
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
export interface IDeviceInfo {
|
|
2
2
|
getLocation(): Promise<IDeviceLocation | null>;
|
|
3
|
+
/** @deprecated Use getDeviceTags() function */
|
|
3
4
|
getOrganizationTags(): Promise<IOrganizationTag[]>;
|
|
4
5
|
getDeviceName(): Promise<string | null>;
|
|
6
|
+
getDeviceTags(): Promise<IDeviceTag[]>;
|
|
5
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Represents device location information set via Rest API.
|
|
10
|
+
*/
|
|
6
11
|
export interface IDeviceLocation {
|
|
12
|
+
/** Name of the location. */
|
|
7
13
|
name: string;
|
|
14
|
+
/** Optional custom identifier for the location. */
|
|
8
15
|
customId?: string;
|
|
16
|
+
/** Optional description of the location. */
|
|
9
17
|
description?: string;
|
|
18
|
+
/** Optional child array of tags associated with the location. */
|
|
19
|
+
tags?: ITag[];
|
|
10
20
|
}
|
|
21
|
+
/** @deprecated */
|
|
11
22
|
export interface IOrganizationTag {
|
|
12
23
|
name: string;
|
|
13
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Represents organization tags assigned to a device.
|
|
27
|
+
*/
|
|
28
|
+
interface ITag {
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Represents a device tag which may have a parent (organization) tag.
|
|
33
|
+
*/
|
|
34
|
+
export interface IDeviceTag extends ITag {
|
|
35
|
+
parentTag?: ITag;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -32,6 +32,19 @@ declare class Display implements IDisplay {
|
|
|
32
32
|
* @since 3.1.0
|
|
33
33
|
*/
|
|
34
34
|
supports(capability: DisplayCapability): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* The `getCapabilities()` method returns a list of all supported front capabilities of the device.
|
|
37
|
+
*
|
|
38
|
+
* For more information what are capabilities, see the description of the `supports()` method.
|
|
39
|
+
*
|
|
40
|
+
* @returns {Promise<DisplayCapability[]>} Resolves to an array of supported capabilities.
|
|
41
|
+
* @since 8.5.0
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* const capabilities = await sos.display.getCapabilities();
|
|
45
|
+
* console.log('Supported display capabilities:', capabilities.join(', '));
|
|
46
|
+
*/
|
|
47
|
+
getCapabilities(): Promise<DisplayCapability[]>;
|
|
35
48
|
private getMessage;
|
|
36
49
|
}
|
|
37
50
|
export default Display;
|
|
@@ -46,6 +46,24 @@ class Display {
|
|
|
46
46
|
});
|
|
47
47
|
return supports;
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* The `getCapabilities()` method returns a list of all supported front capabilities of the device.
|
|
51
|
+
*
|
|
52
|
+
* For more information what are capabilities, see the description of the `supports()` method.
|
|
53
|
+
*
|
|
54
|
+
* @returns {Promise<DisplayCapability[]>} Resolves to an array of supported capabilities.
|
|
55
|
+
* @since 8.5.0
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* const capabilities = await sos.display.getCapabilities();
|
|
59
|
+
* console.log('Supported display capabilities:', capabilities.join(', '));
|
|
60
|
+
*/
|
|
61
|
+
async getCapabilities() {
|
|
62
|
+
const { capabilities } = await this.postMessage({
|
|
63
|
+
type: this.getMessage('get_capabilities'),
|
|
64
|
+
});
|
|
65
|
+
return capabilities;
|
|
66
|
+
}
|
|
49
67
|
getMessage(name) {
|
|
50
68
|
return this.messagePrefix + '.' + Display.MESSAGE_PREFIX + '.' + name;
|
|
51
69
|
}
|
|
@@ -1 +1 @@
|
|
|
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,G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AAU,CAAC,UAAU,CAAC;YACjC,UAAU;SACV,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,eAAe;QAC3B,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAC/C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;SACzC,CAAC,CAAC;QACH,OAAO,YAAY,CAAC;IACrB,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"}
|
|
@@ -6,4 +6,5 @@ import { AnyString } from '../../utils/types';
|
|
|
6
6
|
export type DisplayCapability = 'FILE_SYSTEM_INTERNAL_STORAGE' | 'FILE_SYSTEM_EXTERNAL_STORAGE' | 'FILE_SYSTEM_FILE_CHECKSUM' | 'FILE_SYSTEM_LINK' | 'TIMERS_PROPRIETARY' | 'VIDEO_4K' | 'SERIAL' | 'BARCODE_SCANNER' | 'FRONT_OSD' | 'FILE_SYSTEM_CREATE_ARCHIVE' | 'FILE_SYSTEM_ARCHIVE_EXTRACT_INFO' | 'BROWSER' | 'PROXIMITY_SENSOR' | AnyString;
|
|
7
7
|
export default interface IDisplay {
|
|
8
8
|
supports(capability: DisplayCapability): Promise<boolean>;
|
|
9
|
+
getCapabilities(): Promise<DisplayCapability[]>;
|
|
9
10
|
}
|
|
@@ -3,7 +3,9 @@ import IMessage from '../IMessage';
|
|
|
3
3
|
* Received message from the serial port with data.
|
|
4
4
|
*/
|
|
5
5
|
interface ISerialPortDataMessage extends IMessage {
|
|
6
|
+
/** Unique reference ID of the serial port. */
|
|
6
7
|
refid: string;
|
|
8
|
+
/** Data received from the serial port. */
|
|
7
9
|
data: any;
|
|
8
10
|
}
|
|
9
11
|
export default ISerialPortDataMessage;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available parity options for the serial port.
|
|
3
|
+
*/
|
|
1
4
|
export declare enum Parity {
|
|
2
5
|
NONE = "none",
|
|
3
6
|
EVEN = "even",
|
|
@@ -12,11 +15,17 @@ export declare enum Parity {
|
|
|
12
15
|
* All properties are optional except `baudRate`.
|
|
13
16
|
*/
|
|
14
17
|
interface ISerialPortOptions {
|
|
18
|
+
/** Unique address of the external device. */
|
|
15
19
|
device?: string;
|
|
20
|
+
/** Data transmission speed in bits per second. */
|
|
16
21
|
baudRate: number;
|
|
22
|
+
/** Form of error checking, whether (or what) extra bits are added to a byte. */
|
|
17
23
|
parity?: Parity;
|
|
24
|
+
/** Number of bits in a byte. */
|
|
18
25
|
databits?: number;
|
|
26
|
+
/** Number of bits used to signal the end of a communication packet. */
|
|
19
27
|
stopbits?: number;
|
|
28
|
+
/** Enables or disables RTS/CTS handshaking over the serial port. Currently supported by selected models of BrightSign. */
|
|
20
29
|
rtscts?: boolean;
|
|
21
30
|
}
|
|
22
31
|
export default ISerialPortOptions;
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
* KeyUp event interface for handling key release events.
|
|
3
3
|
*/
|
|
4
4
|
interface IKeyUpEvent {
|
|
5
|
+
/** KeyUp event type */
|
|
5
6
|
type: 'keyup';
|
|
7
|
+
/** Key code representing the key that was released */
|
|
6
8
|
keyCode: KeyUpEventMap;
|
|
9
|
+
/** Key name representing the key that was released */
|
|
7
10
|
keyName: keyof typeof KeyUpEventMap;
|
|
8
11
|
}
|
|
9
12
|
export default IKeyUpEvent;
|
|
@@ -91,6 +91,19 @@ export default class Management implements IManagement {
|
|
|
91
91
|
* console.log(`Is OS_VERSION supported? ${isSupported}`);
|
|
92
92
|
*/
|
|
93
93
|
supports(capability: ManagementCapability): Promise<boolean>;
|
|
94
|
+
/**
|
|
95
|
+
* The `getCapabilities()` method returns a list of all supported management capabilities of the device.
|
|
96
|
+
*
|
|
97
|
+
* For more information what are capabilities, see the description of the `supports()` method.
|
|
98
|
+
*
|
|
99
|
+
* @returns {Promise<ManagementCapability[]>} A promise that resolves to an array of supported management capabilities.
|
|
100
|
+
* @since 8.5.0
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* const capabilities = await sos.management.getCapabilities();
|
|
104
|
+
* console.log('Supported management capabilities:', capabilities.join(', '));
|
|
105
|
+
*/
|
|
106
|
+
getCapabilities(): Promise<ManagementCapability[]>;
|
|
94
107
|
/**
|
|
95
108
|
* The `getModel()` method returns the model of the device.
|
|
96
109
|
*
|
|
@@ -119,6 +119,24 @@ class Management {
|
|
|
119
119
|
});
|
|
120
120
|
return supports;
|
|
121
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* The `getCapabilities()` method returns a list of all supported management capabilities of the device.
|
|
124
|
+
*
|
|
125
|
+
* For more information what are capabilities, see the description of the `supports()` method.
|
|
126
|
+
*
|
|
127
|
+
* @returns {Promise<ManagementCapability[]>} A promise that resolves to an array of supported management capabilities.
|
|
128
|
+
* @since 8.5.0
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* const capabilities = await sos.management.getCapabilities();
|
|
132
|
+
* console.log('Supported management capabilities:', capabilities.join(', '));
|
|
133
|
+
*/
|
|
134
|
+
async getCapabilities() {
|
|
135
|
+
const { capabilities } = await this.postMessage({
|
|
136
|
+
type: this.getMessage('get_capabilities'),
|
|
137
|
+
});
|
|
138
|
+
return capabilities;
|
|
139
|
+
}
|
|
122
140
|
/**
|
|
123
141
|
* The `getModel()` method returns the model of the device.
|
|
124
142
|
*
|
|
@@ -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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AAK,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;;
|
|
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,Q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E,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;;AAxUF,6BAyUC"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import INetworkInfo, { INetworkInterface, INetworkOptions, INetworkOptionsLegacy, NetworkInterface } from './INetworkInfo';
|
|
2
|
+
/** Allowed types of EAP authentication */
|
|
2
3
|
export type EAPType = 'EAP-TLS' | 'PEAP' | 'EAP-TTLS';
|
|
4
|
+
/** Details for importing a certificate for EAP authentication. */
|
|
3
5
|
export interface CertificateEapDetails {
|
|
6
|
+
/** Type of EAP authentication */
|
|
4
7
|
type: EAPType;
|
|
8
|
+
/** CA certificate */
|
|
5
9
|
caCertificate?: string;
|
|
10
|
+
/** Client certificate for EAP-TLS */
|
|
6
11
|
clientCertificate?: string;
|
|
12
|
+
/** Private key for client certificate for EAP-TLS */
|
|
7
13
|
clientKey?: string;
|
|
14
|
+
/** Password for the private key, if it's encrypted */
|
|
8
15
|
clientCertificatePassword?: string;
|
|
9
16
|
}
|
|
10
17
|
export default interface INetwork {
|
|
@@ -4,13 +4,18 @@ import { IProprietaryTimer, ProprietaryTimerType } from '../helpers/ProprietaryT
|
|
|
4
4
|
* Interface representing the scheduled reboot action.
|
|
5
5
|
*/
|
|
6
6
|
export interface IScheduledRebootActions {
|
|
7
|
+
/** Random generated ID for the scheduled reboot action */
|
|
7
8
|
id: string;
|
|
9
|
+
/** The rule of the scheduled reboot */
|
|
8
10
|
rule: IScheduledRebootRule;
|
|
9
11
|
}
|
|
10
12
|
export interface IScheduledRebootRule {
|
|
13
|
+
/** Weekdays as numbers or strings. Number types are received from server. */
|
|
11
14
|
weekdays: number[] | string[];
|
|
15
|
+
/** Time in HH:mm:ss format */
|
|
12
16
|
time: string;
|
|
13
17
|
}
|
|
18
|
+
/** Allowed scheduled action weekday types */
|
|
14
19
|
export type WeekdayType = 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY';
|
|
15
20
|
/**
|
|
16
21
|
* This enum is necessary to convert between the number representation of the weekday and the string representation.
|
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
import IOrientation from './IOrientation';
|
|
2
2
|
import IBrightness from './IBrightness';
|
|
3
|
+
export interface TakeAndUploadScreenshotResult {
|
|
4
|
+
/** URL of the uploaded screenshot. */
|
|
5
|
+
screenshotUrl: string;
|
|
6
|
+
/** aHash of the screenshot, if computed. */
|
|
7
|
+
aHash?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Options for taking and uploading a screenshot. */
|
|
10
|
+
export interface TakeAndUploadScreenshotOptions {
|
|
11
|
+
/** Whether to compute the hash of the screenshot. Default is false. */
|
|
12
|
+
computeHash?: boolean;
|
|
13
|
+
/** Additional headers to include in the upload request. */
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
export declare const VTakeAndUploadScreenshotOptions: {
|
|
17
|
+
computeHash: string;
|
|
18
|
+
headers: string;
|
|
19
|
+
};
|
|
3
20
|
export default interface IScreen {
|
|
4
21
|
resize(baseUrl: string, orientation: string, resolution: string, currentVersion: string, videoOrientation?: string): Promise<void>;
|
|
5
22
|
getOrientation(): Promise<IOrientation>;
|
|
6
23
|
setBrightness(timeFrom1: string, brightness1: number, timeFrom2: string, brightness2: number): Promise<void>;
|
|
7
24
|
getBrightness(): Promise<IBrightness>;
|
|
8
|
-
/** @deprecated use takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<
|
|
25
|
+
/** @deprecated use takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<TakeAndUploadScreenshotResult> */
|
|
9
26
|
takeAndUploadScreenshot(uploadBaseUrl: string): Promise<string>;
|
|
10
|
-
takeAndUploadScreenshot(uploadBaseUrl: string,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}>;
|
|
27
|
+
/** @deprecated use takeAndUploadScreenshot(uploadBaseUrl: string, options: TakeAndUploadScreenshotOptions): Promise<TakeAndUploadScreenshotResult> */
|
|
28
|
+
takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<TakeAndUploadScreenshotResult>;
|
|
29
|
+
takeAndUploadScreenshot(uploadBaseUrl: string, options: TakeAndUploadScreenshotOptions): Promise<TakeAndUploadScreenshotResult>;
|
|
14
30
|
powerOn(): Promise<void>;
|
|
15
31
|
powerOff(): Promise<void>;
|
|
16
32
|
isPoweredOn(): Promise<boolean>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VTakeAndUploadScreenshotOptions = void 0;
|
|
4
|
+
exports.VTakeAndUploadScreenshotOptions = {
|
|
5
|
+
computeHash: '?boolean',
|
|
6
|
+
headers: '?object',
|
|
7
|
+
};
|
|
3
8
|
//# sourceMappingURL=IScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IScreen.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Screen/IScreen.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"IScreen.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Screen/IScreen.ts"],"names":[],"mappings":";;;AAkBa,QAAA,+BAA+B,GAAG;IAC9C,WAAW,EAAE,UAAU;IACvB,OAAO,EAAE,SAAS;CAClB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import IPostMessage from '../../IPostMessage';
|
|
2
2
|
import IBrightness from './IBrightness';
|
|
3
3
|
import IOrientation from './IOrientation';
|
|
4
|
-
import IScreen from './IScreen';
|
|
4
|
+
import IScreen, { TakeAndUploadScreenshotOptions, TakeAndUploadScreenshotResult } from './IScreen';
|
|
5
5
|
/**
|
|
6
6
|
* The `sos.management.screen` API groups together methods for controlling the screen of the device. It allows for manipulating the screen
|
|
7
7
|
* resolution or orientation, set brightness, retrieve the current brightness of the display, and manipulate the power mode.
|
|
@@ -138,6 +138,10 @@ export default class Screen implements IScreen {
|
|
|
138
138
|
* @deprecated Use `takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<{ screenshotUrl: string; aHash?: string }>` instead.
|
|
139
139
|
*/
|
|
140
140
|
takeAndUploadScreenshot(uploadBaseUrl: string): Promise<string>;
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated Use `takeAndUploadScreenshot(uploadBaseUrl: string, options: TakeAndUploadScreenshotOptions): Promise<TakeAndUploadScreenshotResult>` instead.
|
|
143
|
+
*/
|
|
144
|
+
takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<TakeAndUploadScreenshotResult>;
|
|
141
145
|
/**
|
|
142
146
|
* The `takeAndUploadScreenshot()` method takes a screenshot and uploads it to a specified URL. This can be either a signageOS upload URL
|
|
143
147
|
* (`https://upload.signageos.io`) or a dedicated server URL for uploading screenshots. The format in which the screenshot is uploaded may be
|
|
@@ -152,10 +156,13 @@ export default class Screen implements IScreen {
|
|
|
152
156
|
* [support ticketing system](https://box.signageos.io/support/).
|
|
153
157
|
*
|
|
154
158
|
* @param uploadBaseUrl URL to which the screenshot will be uploaded. It can be either a signageOS upload URL or a custom server URL.
|
|
155
|
-
* @param
|
|
156
|
-
* @
|
|
159
|
+
* @param options Optional parameters for taking and uploading the screenshot.
|
|
160
|
+
* @param options.computeHash Whether to compute a hash of the screenshot and return it in the response.
|
|
161
|
+
* @param options.headers Additional headers to include in the upload request for POST requests.
|
|
162
|
+
* @return {Promise<TakeAndUploadScreenshotResult>} A promise that resolves to an object containing the screenshot URL and optionally a hash of the screenshot.
|
|
157
163
|
* @throws {Error} If `uploadBaseUrl` is not a valid URL
|
|
158
164
|
* @throws {Error} If `computeHash` is not a boolean
|
|
165
|
+
* @throws {Error} If `headers` is not a valid object
|
|
159
166
|
* @throws {Error} If the screenshot cannot be taken or uploaded.
|
|
160
167
|
* @since 3.0.0
|
|
161
168
|
*
|
|
@@ -163,14 +170,24 @@ export default class Screen implements IScreen {
|
|
|
163
170
|
*
|
|
164
171
|
* @example
|
|
165
172
|
* const { screenshotUrl, aHash } = await sos.management.screen.takeAndUploadScreenshot(
|
|
173
|
+
* 'https://your.upload.server/upload/file?prefix=screenshot/',
|
|
174
|
+
* { computeHash: true },
|
|
175
|
+
* );
|
|
176
|
+
* console.log(`Screenshot uploaded to: ${screenshotUrl} with aHash: ${aHash}`);
|
|
177
|
+
*
|
|
178
|
+
* // Upload screenshot with custom headers
|
|
179
|
+
* const { screenshotUrl } = await sos.management.screen.takeAndUploadScreenshot(
|
|
166
180
|
* 'https://your.upload.server/upload/file?prefix=screenshot/',
|
|
167
|
-
*
|
|
181
|
+
* {
|
|
182
|
+
* computeHash: false,
|
|
183
|
+
* headers: {
|
|
184
|
+
* 'Authorization': 'Bearer yourTokenHere',
|
|
185
|
+
* 'Custom-Header': 'CustomValue'
|
|
186
|
+
* }
|
|
187
|
+
* },
|
|
168
188
|
* );
|
|
169
189
|
*/
|
|
170
|
-
takeAndUploadScreenshot(uploadBaseUrl: string,
|
|
171
|
-
screenshotUrl: string;
|
|
172
|
-
aHash?: string;
|
|
173
|
-
}>;
|
|
190
|
+
takeAndUploadScreenshot(uploadBaseUrl: string, options?: TakeAndUploadScreenshotOptions): Promise<TakeAndUploadScreenshotResult>;
|
|
174
191
|
/**
|
|
175
192
|
* The `powerOn()` method turns the screen on.
|
|
176
193
|
*
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const DeviceHelper_1 = require("../helpers/DeviceHelper");
|
|
7
7
|
const VideoHelper_1 = require("../helpers/VideoHelper");
|
|
8
8
|
const Validate_1 = __importDefault(require("../../Validate/Validate"));
|
|
9
|
+
const IScreen_1 = require("./IScreen");
|
|
9
10
|
/**
|
|
10
11
|
* The `sos.management.screen` API groups together methods for controlling the screen of the device. It allows for manipulating the screen
|
|
11
12
|
* resolution or orientation, set brightness, retrieve the current brightness of the display, and manipulate the power mode.
|
|
@@ -196,6 +197,7 @@ class Screen {
|
|
|
196
197
|
/** @internal */
|
|
197
198
|
async takeAndUploadScreenshot(...args) {
|
|
198
199
|
if (typeof args[0] === 'string' && typeof args[1] === 'undefined') {
|
|
200
|
+
// 1st implementation (deprecated) - takeAndUploadScreenshot(uploadBaseUrl: string): Promise<string>
|
|
199
201
|
const [uploadBaseUrl] = args;
|
|
200
202
|
(0, Validate_1.default)({ uploadBaseUrl }).required().uri();
|
|
201
203
|
const response = await this.postMessage({
|
|
@@ -210,7 +212,8 @@ class Screen {
|
|
|
210
212
|
return screenshotUrl;
|
|
211
213
|
}
|
|
212
214
|
}
|
|
213
|
-
else {
|
|
215
|
+
else if (typeof args[0] === 'string' && typeof args[1] === 'boolean') {
|
|
216
|
+
// 2nd implementation (deprecated) - takeAndUploadScreenshot(uploadBaseUrl: string, computeHash?: boolean): Promise<TakeAndUploadScreenshotResult>
|
|
214
217
|
const [uploadBaseUrl, computeHash] = args;
|
|
215
218
|
(0, Validate_1.default)({ uploadBaseUrl }).required().uri();
|
|
216
219
|
(0, Validate_1.default)({ computeHash }).boolean();
|
|
@@ -224,6 +227,24 @@ class Screen {
|
|
|
224
227
|
aHash,
|
|
225
228
|
};
|
|
226
229
|
}
|
|
230
|
+
else if (typeof args[0] === 'string' && typeof args[1] === 'object') {
|
|
231
|
+
// 3rd implementation - takeAndUploadScreenshot(uploadBaseUrl: string, options: TakeAndUploadScreenshotOptions): Promise<TakeAndUploadScreenshotResult>
|
|
232
|
+
const [uploadBaseUrl, options] = args;
|
|
233
|
+
(0, Validate_1.default)({ uploadBaseUrl }).required().uri();
|
|
234
|
+
if (options !== undefined) {
|
|
235
|
+
(0, Validate_1.default)({ options }).object(IScreen_1.VTakeAndUploadScreenshotOptions);
|
|
236
|
+
}
|
|
237
|
+
const { screenshotUrl, aHash } = await this.postMessage({
|
|
238
|
+
type: this.getMessage('upload_screenshot'),
|
|
239
|
+
uploadBaseUrl,
|
|
240
|
+
computeHash: options.computeHash,
|
|
241
|
+
headers: options.headers,
|
|
242
|
+
});
|
|
243
|
+
return {
|
|
244
|
+
screenshotUrl,
|
|
245
|
+
aHash,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
227
248
|
}
|
|
228
249
|
/**
|
|
229
250
|
* The `powerOn()` method turns the screen on.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Screen/Screen.ts"],"names":[],"mappings":";;;;;AAGA,0DAAkE;AAClE,wDAAyE;AACzE,uEAA+C;
|
|
1
|
+
{"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Screen/Screen.ts"],"names":[],"mappings":";;;;;AAGA,0DAAkE;AAClE,wDAAyE;AACzE,uEAA+C;AAC/C,uCAAoI;AAEpI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAqB,MAAM;IAGjB;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;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EH,OAAO,gBAAgB,CAAC;IACzB,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,CAAC;IAC3B,CAAC;CACD;AA9UD,yBA8UC"}
|
|
@@ -21,21 +21,35 @@ export default interface IWifi {
|
|
|
21
21
|
* Interface representing a scanned Wi-Fi device.
|
|
22
22
|
*/
|
|
23
23
|
export interface IScannedDevice {
|
|
24
|
+
/** SSID of the Wi-Fi network */
|
|
24
25
|
ssid: string;
|
|
26
|
+
/** If Wi-Fi SSID is encrypted */
|
|
25
27
|
encrypted: boolean;
|
|
26
28
|
}
|
|
27
29
|
export type WifiEncryptionType = 'OPEN' | 'WEP' | 'WPA2' | 'WPA2_WPA_MIXED' | 'WPA3' | '802.1X_EAP';
|
|
28
30
|
export type EAPMethod = 'PEAP' | 'TLS' | 'TTLS';
|
|
29
31
|
export type EAPPhase2Auth = 'PAP' | 'MSCHAP' | 'MSCHAPV2' | 'GTC';
|
|
32
|
+
/**
|
|
33
|
+
* Options for connecting to a Wi-Fi network.
|
|
34
|
+
*/
|
|
30
35
|
export interface IWifiConnectOptions {
|
|
36
|
+
/** Whether the network is hidden. */
|
|
31
37
|
hidden?: boolean;
|
|
38
|
+
/** The type of security/encryption used by the network. */
|
|
32
39
|
securityType?: WifiEncryptionType;
|
|
40
|
+
/** Authentication details for networks that require EAP. */
|
|
33
41
|
eap?: {
|
|
42
|
+
/** The type of EAP authentication to use. */
|
|
34
43
|
method: EAPMethod;
|
|
44
|
+
/** Username or identity for authentication. */
|
|
35
45
|
identity: string;
|
|
46
|
+
/** Anonymous identity for authentication. */
|
|
36
47
|
anonymousIdentity?: string;
|
|
48
|
+
/** Password or passphrase for authentication. */
|
|
37
49
|
passphrase: string;
|
|
50
|
+
/** Secondary authentication method. Not needed for TLS. */
|
|
38
51
|
phase2Auth?: EAPPhase2Auth;
|
|
52
|
+
/** Whether to use a CA certificate for authentication. Not needed for TLS. */
|
|
39
53
|
useCACert?: boolean;
|
|
40
54
|
};
|
|
41
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IWifi.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Wifi/IWifi.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IWifi.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Wifi/IWifi.ts"],"names":[],"mappings":";;;AA4Da,QAAA,oBAAoB,GAAG;IACnC,MAAM,EAAE,UAAU;IAClB,YAAY,EAAE,SAAS;IACvB,GAAG,EAAE;QACJ,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,QAAQ;QAClB,iBAAiB,EAAE,SAAS;QAC5B,UAAU,EAAE,QAAQ;QACpB,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,UAAU;KACrB;CACD,CAAC"}
|
|
@@ -119,12 +119,6 @@ export default class Wifi implements IWifi {
|
|
|
119
119
|
* Make sure that you have a backup script or a checking mechanism in place, which will allow you to recover from the situation if the connection fails.
|
|
120
120
|
* :::
|
|
121
121
|
*
|
|
122
|
-
* :::warning
|
|
123
|
-
* Connecting to an OPEN Wi-Fi network for Tizen and WebOS is different.
|
|
124
|
-
* - For Tizen, make sure that the `password` is an empty string (`''`) and in the options you have selected `OPEN` as encryption type.
|
|
125
|
-
* - For WebOS, you can pass `undefined` as the `password` parameter.
|
|
126
|
-
* :::
|
|
127
|
-
*
|
|
128
122
|
* :::info
|
|
129
123
|
* The security type of Wi-Fi is mandatory for Tizen.
|
|
130
124
|
* :::
|
|
@@ -143,21 +137,18 @@ export default class Wifi implements IWifi {
|
|
|
143
137
|
*
|
|
144
138
|
* @throws Error If the Wi-Fi state is not in the `client` state.
|
|
145
139
|
* @throws Error If the `ssid` is not a string or is empty.
|
|
146
|
-
* @throws Error If the `password` is not a string
|
|
140
|
+
* @throws Error If the `password` is not a string
|
|
147
141
|
* @throws Error If the `options` is not an object or does not match the expected schema.
|
|
148
142
|
* @throws Error If the `securityType` is not one of the allowed values.
|
|
149
143
|
* @returns {Promise<void>} A promise that resolves when the connection is established or if the connection fails.
|
|
150
144
|
* @since 4.3.0
|
|
151
145
|
*
|
|
152
146
|
* @example
|
|
153
|
-
* // To connect
|
|
154
|
-
* await sos.management.wifi.connect('MyOpenNetwork');
|
|
155
|
-
*
|
|
156
|
-
* // To connect an open Wi-Fi network with an empty password (Tizen)
|
|
157
|
-
* await sos.management.wifi.connect('MyOpenNetwork', '', { securityType: 'OPEN' });
|
|
147
|
+
* // To connect an open Wi-Fi network with an empty password
|
|
148
|
+
* await sos.management.wifi.connect('MyOpenNetwork', undefined, { securityType: 'OPEN' });
|
|
158
149
|
*
|
|
159
150
|
* // If the network is hidden
|
|
160
|
-
* await sos.management.wifi.connect('MyOpenNetwork', undefined, { hidden: true });
|
|
151
|
+
* await sos.management.wifi.connect('MyOpenNetwork', undefined, { hidden: true, securityType: 'WPA2' });
|
|
161
152
|
*
|
|
162
153
|
* // To connect to an encrypted Wi-Fi network with WPA2 security
|
|
163
154
|
* await sos.management.wifi.connect('MyEncryptedNetwork', 'my-password', { securityType: 'WPA2' });
|