@signageos/front-applet 8.1.2 → 8.1.3
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 +1 -1
- package/dist/bundle.js.map +1 -1
- package/docs/sos/browser.md +66 -14
- package/docs/sos/command.md +52 -6
- package/docs/sos/debug.md +17 -2
- package/docs/sos/deviceInfo.md +27 -0
- package/docs/sos/display.md +34 -3
- package/docs/sos/fileSystem.md +1135 -59
- package/docs/sos/input.md +42 -1
- package/docs/sos/native/mdc.md +65 -19
- package/docs/sos/offline/cache.md +8 -2
- package/es6/FrontApplet/Browser/Browser.d.ts +25 -9
- package/es6/FrontApplet/Browser/Browser.js +25 -9
- package/es6/FrontApplet/Browser/Browser.js.map +1 -1
- package/es6/FrontApplet/Browser/IOpenLinkOptions.d.ts +7 -0
- package/es6/FrontApplet/Browser/IOpenLinkOptions.js.map +1 -1
- package/es6/FrontApplet/Browser/events.d.ts +6 -0
- package/es6/FrontApplet/Browser/events.js.map +1 -1
- package/es6/FrontApplet/Command/Command.d.ts +15 -6
- package/es6/FrontApplet/Command/Command.js +15 -6
- package/es6/FrontApplet/Command/Command.js.map +1 -1
- package/es6/FrontApplet/Command/ICommand.d.ts +7 -0
- package/es6/FrontApplet/Command/ICommandEvent.d.ts +6 -0
- package/es6/FrontApplet/Debug/Debug.d.ts +11 -3
- package/es6/FrontApplet/Debug/Debug.js +11 -3
- package/es6/FrontApplet/Debug/Debug.js.map +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +15 -0
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +16 -2
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
- package/es6/FrontApplet/Display/Display.d.ts +22 -14
- package/es6/FrontApplet/Display/Display.js +22 -14
- package/es6/FrontApplet/Display/Display.js.map +1 -1
- package/es6/FrontApplet/Display/IDisplay.d.ts +4 -0
- package/es6/FrontApplet/FileSystem/FileSystem.d.ts +429 -41
- package/es6/FrontApplet/FileSystem/FileSystem.js +427 -39
- package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
- package/es6/FrontApplet/FileSystem/HashAlgorithm.d.ts +4 -1
- package/es6/FrontApplet/FileSystem/types.d.ts +46 -0
- package/es6/FrontApplet/FileSystem/types.js.map +1 -1
- package/es6/FrontApplet/Input/IKeyUpEvent.d.ts +9 -0
- package/es6/FrontApplet/Input/IKeyUpEvent.js +6 -0
- package/es6/FrontApplet/Input/IKeyUpEvent.js.map +1 -1
- package/es6/FrontApplet/Input/Input.d.ts +17 -1
- package/es6/FrontApplet/Input/Input.js +17 -1
- package/es6/FrontApplet/Input/Input.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.d.ts +32 -11
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js +14 -11
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js.map +1 -1
- package/package.json +1 -1
package/docs/sos/input.md
CHANGED
|
@@ -4,25 +4,39 @@ sidebar_position: 0
|
|
|
4
4
|
|
|
5
5
|
# input
|
|
6
6
|
|
|
7
|
+
The `sos.input` API groups together all input-related functionality, such as remote control key events. With this API, you can
|
|
8
|
+
listen to key events from the remote control and handle them in your application.
|
|
9
|
+
|
|
7
10
|
## Methods
|
|
8
11
|
|
|
9
12
|
### onKeyUp()
|
|
10
13
|
|
|
11
|
-
The `onKeyUp` method sets up a listeners, which is called on every
|
|
14
|
+
The `onKeyUp` method sets up a listeners, which is called on every keystroke of the remote controller. For the specific logic of an
|
|
12
15
|
application (games for example), binding the remote control inputs can be helpful. Only a subset of all remote control keys is
|
|
13
16
|
supported on the specific device. Only numerical digits are guaranteed to be supported.
|
|
14
17
|
|
|
18
|
+
:::note
|
|
15
19
|
This feature must be tested by users on real devices.
|
|
20
|
+
:::
|
|
16
21
|
|
|
17
22
|
```ts expandable
|
|
18
23
|
onKeyUp(listener: (event: IKeyUpEvent) => void): void;
|
|
19
24
|
// show-more
|
|
25
|
+
/**
|
|
26
|
+
* KeyUp event interface for handling key release events.
|
|
27
|
+
*/
|
|
20
28
|
interface IKeyUpEvent {
|
|
21
29
|
type: 'keyup';
|
|
22
30
|
keyCode: KeyUpEventMap;
|
|
23
31
|
keyName: keyof typeof KeyUpEventMap;
|
|
24
32
|
}
|
|
25
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Enum of supported key codes for KeyUp events.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* If a key is not listed here, it will show warning in the console.
|
|
39
|
+
*/
|
|
26
40
|
enum KeyUpEventMap {
|
|
27
41
|
UNKNOWN = 0,
|
|
28
42
|
NUM_0 = 1,
|
|
@@ -56,6 +70,22 @@ enum KeyUpEventMap {
|
|
|
56
70
|
|
|
57
71
|
```
|
|
58
72
|
|
|
73
|
+
#### Params
|
|
74
|
+
|
|
75
|
+
| Name | Type | Description |
|
|
76
|
+
|------------|--------------------------------|------------------------------------------------------------------|
|
|
77
|
+
| `listener` | `(event: IKeyUpEvent) => void` | The listener function that will be called on every key up event. |
|
|
78
|
+
|
|
79
|
+
#### Return value
|
|
80
|
+
|
|
81
|
+
Resolves when the listener is successfully set up.
|
|
82
|
+
|
|
83
|
+
#### Possible errors
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
- If listener is not valid function.
|
|
87
|
+
- If listener is unregistered.
|
|
88
|
+
|
|
59
89
|
<Separator />
|
|
60
90
|
|
|
61
91
|
### removeEventListener()
|
|
@@ -66,6 +96,17 @@ The `removeEventListener()` method removes all event listeners for a specific ev
|
|
|
66
96
|
removeEventListener(event: 'keyup', listener: (...args: any[]) => void): void;
|
|
67
97
|
```
|
|
68
98
|
|
|
99
|
+
#### Params
|
|
100
|
+
|
|
101
|
+
| Name | Type | Description |
|
|
102
|
+
|------------|----------------------------|-----------------------------------------------------------------------------------------|
|
|
103
|
+
| `event` | `"keyup"` | The name of the event to remove the listener for. Currently, only `keyup` is supported. |
|
|
104
|
+
| `listener` | `(...args: any[]) => void` | The listener function to remove. |
|
|
105
|
+
|
|
106
|
+
#### Return value
|
|
107
|
+
|
|
108
|
+
Resolves when the listener is successfully removed.
|
|
109
|
+
|
|
69
110
|
<Separator />
|
|
70
111
|
|
|
71
112
|
### removeEventListeners()
|
package/docs/sos/native/mdc.md
CHANGED
|
@@ -7,15 +7,11 @@ sidebar_position: 0
|
|
|
7
7
|
The `sos.native.mdc` API groups together methods for controlling Tizen devices using MDC commands.
|
|
8
8
|
|
|
9
9
|
:::warning
|
|
10
|
-
|
|
11
10
|
This API is currently available on Tizen devices only.
|
|
12
|
-
|
|
13
11
|
:::
|
|
14
12
|
|
|
15
13
|
:::info
|
|
16
|
-
|
|
17
14
|
You can ensure that the device supports MDC commands via `sos.management.supports("NATIVE_COMMANDS_MDC")`.
|
|
18
|
-
|
|
19
15
|
:::
|
|
20
16
|
|
|
21
17
|
## Methods
|
|
@@ -27,6 +23,26 @@ The `sendOne()` method sends an MDC command to another Tizen device on the same
|
|
|
27
23
|
```ts expandable
|
|
28
24
|
sendOne(ipAddress: IpAddressType, command: CodesMDC, data?: number[]): Promise<IMDCResponse>;
|
|
29
25
|
// show-more
|
|
26
|
+
/**
|
|
27
|
+
* Response object returned by Tizen Core App.
|
|
28
|
+
*/
|
|
29
|
+
interface IMDCResponse {
|
|
30
|
+
/**
|
|
31
|
+
* The type of the response, either 'ACK' for acknowledgment or 'NACK' for negative acknowledgment.
|
|
32
|
+
*/
|
|
33
|
+
type: 'ACK' | 'NACK';
|
|
34
|
+
/**
|
|
35
|
+
* The command type that was executed, represented as a number.
|
|
36
|
+
* Should match the command number in {@link CodesMDC}.
|
|
37
|
+
*/
|
|
38
|
+
commandType: number;
|
|
39
|
+
/**
|
|
40
|
+
* The result of the command execution, represented as a number.
|
|
41
|
+
* This value can vary depending on the command executed.
|
|
42
|
+
*/
|
|
43
|
+
result: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
30
46
|
/**
|
|
31
47
|
* This enum contains valid command codes for Tizen MDC communication.
|
|
32
48
|
*/
|
|
@@ -177,12 +193,6 @@ enum CodesMDC {
|
|
|
177
193
|
REPLY = 255
|
|
178
194
|
}
|
|
179
195
|
|
|
180
|
-
interface IMDCResponse {
|
|
181
|
-
type: 'ACK' | 'NACK';
|
|
182
|
-
commandType: number;
|
|
183
|
-
result: number;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
196
|
```
|
|
187
197
|
|
|
188
198
|
#### Params
|
|
@@ -190,18 +200,29 @@ interface IMDCResponse {
|
|
|
190
200
|
| Name | Type | Description |
|
|
191
201
|
|---------------------|------------|------------------------------------------------------|
|
|
192
202
|
| `ipAddress` | `string` | The IP address of the device to send the command to. |
|
|
193
|
-
| `command` | `CodesMDC` | The MDC command to send
|
|
203
|
+
| `command` | `CodesMDC` | The MDC command to send |
|
|
194
204
|
| `data` *(optional)* | `number[]` | The optional data to send with the command. |
|
|
195
205
|
|
|
206
|
+
#### Return value
|
|
207
|
+
|
|
208
|
+
MDC response object containing the result of the command execution.
|
|
209
|
+
|
|
210
|
+
#### Possible errors
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
- If the `ipAddress` is not a valid string or if the `command` is not a valid number.
|
|
214
|
+
- If the `data` is not an array of numbers.
|
|
215
|
+
- If any error occurs during the command execution.
|
|
216
|
+
|
|
196
217
|
#### Example
|
|
197
218
|
|
|
198
219
|
```ts
|
|
199
|
-
await sos.native.mdc.sendOne('localhost', CodesMDC.BRIGHTNESS_CONTROL);
|
|
200
|
-
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.VOLUME_CONTROL, [50]);
|
|
201
|
-
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.PICTURE_CONTROL, [0x54, 0x03]);
|
|
220
|
+
await sos.native.mdc.sendOne('localhost', CodesMDC.BRIGHTNESS_CONTROL);
|
|
221
|
+
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.VOLUME_CONTROL, [50]);
|
|
222
|
+
await sos.native.mdc.sendOne('192.168.0.10', CodesMDC.PICTURE_CONTROL, [0x54, 0x03]);
|
|
202
223
|
|
|
203
224
|
// You can also send custom number if we don't have predefined command in our enum
|
|
204
|
-
await sos.native.mdc.sendOne('192.168.0.10', 0x01, []);
|
|
225
|
+
await sos.native.mdc.sendOne('192.168.0.10', 0x01, []);
|
|
205
226
|
```
|
|
206
227
|
|
|
207
228
|
<Separator />
|
|
@@ -215,9 +236,23 @@ but without explicitly specifying the command.
|
|
|
215
236
|
sendOneRaw(ipAddress: IpAddressType, data: number[] | [
|
|
216
237
|
]): Promise<IMDCResponse>;
|
|
217
238
|
// show-more
|
|
239
|
+
/**
|
|
240
|
+
* Response object returned by Tizen Core App.
|
|
241
|
+
*/
|
|
218
242
|
interface IMDCResponse {
|
|
243
|
+
/**
|
|
244
|
+
* The type of the response, either 'ACK' for acknowledgment or 'NACK' for negative acknowledgment.
|
|
245
|
+
*/
|
|
219
246
|
type: 'ACK' | 'NACK';
|
|
247
|
+
/**
|
|
248
|
+
* The command type that was executed, represented as a number.
|
|
249
|
+
* Should match the command number in {@link CodesMDC}.
|
|
250
|
+
*/
|
|
220
251
|
commandType: number;
|
|
252
|
+
/**
|
|
253
|
+
* The result of the command execution, represented as a number.
|
|
254
|
+
* This value can vary depending on the command executed.
|
|
255
|
+
*/
|
|
221
256
|
result: number;
|
|
222
257
|
}
|
|
223
258
|
|
|
@@ -225,10 +260,21 @@ interface IMDCResponse {
|
|
|
225
260
|
|
|
226
261
|
#### Params
|
|
227
262
|
|
|
228
|
-
| Name | Type | Description
|
|
229
|
-
|
|
230
|
-
| `ipAddress` | `string` | The IP address of the device to send the command to.
|
|
231
|
-
| `data` | `number[] \| []` | The data to send with the command.
|
|
263
|
+
| Name | Type | Description |
|
|
264
|
+
|-------------|------------------|------------------------------------------------------------------------------------|
|
|
265
|
+
| `ipAddress` | `string` | The IP address of the device to send the command to. |
|
|
266
|
+
| `data` | `number[] \| []` | The data as array of numbers to send with the command. It can be also empty array. |
|
|
267
|
+
|
|
268
|
+
#### Return value
|
|
269
|
+
|
|
270
|
+
MDC response object containing the result of the command execution.
|
|
271
|
+
|
|
272
|
+
#### Possible errors
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
- If the `ipAddress` is not a valid string or if the `command` is not a valid number.
|
|
276
|
+
- If the `data` is not an array of numbers.
|
|
277
|
+
- If any error occurs during the command execution.
|
|
232
278
|
|
|
233
279
|
#### Example
|
|
234
280
|
|
|
@@ -67,7 +67,10 @@ The `getChecksumFile()` computes a checksum of the file specified by `uid`.
|
|
|
67
67
|
```ts expandable
|
|
68
68
|
getChecksumFile(uid: string, hashType: HashAlgorithm): Promise<string>;
|
|
69
69
|
// show-more
|
|
70
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Represents the supported hash algorithms by Core Apps.
|
|
72
|
+
*/
|
|
73
|
+
type HashAlgorithm = 'md5' | 'crc32' | AnyString;
|
|
71
74
|
|
|
72
75
|
type AnyString = string & {};
|
|
73
76
|
|
|
@@ -196,7 +199,10 @@ The `validateChecksumFile()` method validates whether the file, specified by `ui
|
|
|
196
199
|
```ts expandable
|
|
197
200
|
validateChecksumFile(uid: string, hash: string, hashType: HashAlgorithm): Promise<boolean>;
|
|
198
201
|
// show-more
|
|
199
|
-
|
|
202
|
+
/**
|
|
203
|
+
* Represents the supported hash algorithms by Core Apps.
|
|
204
|
+
*/
|
|
205
|
+
type HashAlgorithm = 'md5' | 'crc32' | AnyString;
|
|
200
206
|
|
|
201
207
|
type AnyString = string & {};
|
|
202
208
|
|
|
@@ -4,7 +4,7 @@ import IOpenLinkOptions, { IDeprecatedOpenLinkOptions } from './IOpenLinkOptions
|
|
|
4
4
|
import { IBrowserMessage } from './messages';
|
|
5
5
|
import IBrowser from './IBrowser';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* There are several use-cases when you need to open a web browser on a touch-enabled device (also known as a tablet). For these cases, you can use a custom web browser we built. Default URL can be opened and even the whitelisting/blacklisting of certain domains is supported.
|
|
8
8
|
*
|
|
9
9
|
* :::info
|
|
10
10
|
*
|
|
@@ -27,21 +27,28 @@ export default class Browser implements IBrowser {
|
|
|
27
27
|
/**
|
|
28
28
|
* The `open()` method opens the specified url in a browser window.
|
|
29
29
|
*
|
|
30
|
-
* @param
|
|
31
|
-
* @param options
|
|
32
|
-
* @param options.
|
|
33
|
-
* @param options.
|
|
30
|
+
* @param uri The URL to open in the browser.
|
|
31
|
+
* @param options Optional parameters to configure the browser window.
|
|
32
|
+
* @param options.aclDomains List of domains to be interpreted according to `aclMode`. Example: `signageos.io`, `www.example.com`
|
|
33
|
+
* @param options.aclMode `blacklist` – Allow access to all domains except those in aclDomains and their subdomains, `whitelist` – Allow access only to domains in aclDomains and their subdomains.
|
|
34
|
+
* @param options.readOnlyAddressBar If `true`, the address bar is read-only, if `false` the user can navigate away by entering a URL in the address bar.
|
|
35
|
+
* @param options.idleTimeout The browser will automatically close after a specified period of inactivity (in milliseconds).
|
|
34
36
|
* @param options.coordinates Size and position of the browser window. Defaults to fullscreen.
|
|
35
37
|
* @param options.theme Specify custom UI theme. (Android only)
|
|
36
38
|
* @param options.headlessMode Headless mode hides the entire address bar. (Android only)
|
|
37
39
|
* @param options.canUserClose Whether the user can manually close the browser. (default if headless false, else true)
|
|
38
40
|
* @param options.clearData Clear cache after the browser closes. (default if headless false, else true)
|
|
39
|
-
* @param options.method
|
|
40
|
-
*
|
|
41
|
+
* @param options.method Can only be native (which opens a new, fully sandboxed fullscreen window) or iframe (which opens a configurable-sized window). (only Linux)
|
|
42
|
+
* @returns {Promise<void>} A promise that resolves when the browser is opened.
|
|
43
|
+
* @throws {Error} If the `uri` is not a valid URL or string.
|
|
44
|
+
* @throws {Error} If the `options` are not valid.
|
|
45
|
+
* @throws {Error} If unexpected error occurred when opening link.
|
|
41
46
|
* @since 4.0.0
|
|
42
47
|
*
|
|
48
|
+
* @example // {@link https://github.com/signageos/applet-examples/tree/master/examples/content-js-api/browser | Example of Applet for using browser on Android }
|
|
49
|
+
*
|
|
43
50
|
* @example
|
|
44
|
-
* sos.browser.open('https://www.signageos.io', {
|
|
51
|
+
* await sos.browser.open('https://www.signageos.io', {
|
|
45
52
|
* aclDomains: ['google.com', 'yahoo.com'],
|
|
46
53
|
* aclMode: 'blacklist', // or 'whitelist'
|
|
47
54
|
* readOnlyAddressBar: true,
|
|
@@ -59,14 +66,23 @@ export default class Browser implements IBrowser {
|
|
|
59
66
|
/**
|
|
60
67
|
* The `close()` method closes the browser window opened by the `open()` method.
|
|
61
68
|
*
|
|
69
|
+
* @returns {Promise<void>} A promise that resolves when the browser is closed.
|
|
62
70
|
* @since 4.0.0
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* await sos.browser.open('https://www.signageos.io', {
|
|
74
|
+
* readOnlyAddressBar: true,
|
|
75
|
+
* });
|
|
76
|
+
* // some time later
|
|
77
|
+
* await sos.browser.close();
|
|
63
78
|
*/
|
|
64
79
|
close(): Promise<void>;
|
|
65
80
|
/**
|
|
66
81
|
* The `onClose()` method sets up a listener, which is called whenever a browser window is closed. This can happen by an API call, by a
|
|
67
82
|
* user request or after a timeout. This doesn't fire between `open` calls or on subsequent `close` calls.
|
|
68
83
|
*
|
|
69
|
-
* @
|
|
84
|
+
* @param listener The listener to be called when the browser is closed.
|
|
85
|
+
* @returns {void} A callback which removes the listener.
|
|
70
86
|
*/
|
|
71
87
|
onClose(listener: (event: CloseEvent) => void): () => void;
|
|
72
88
|
/** @internal */
|
|
@@ -8,7 +8,7 @@ const Validate_1 = __importDefault(require("../Validate/Validate"));
|
|
|
8
8
|
const events_2 = require("./events");
|
|
9
9
|
const IOpenLinkOptions_1 = require("./IOpenLinkOptions");
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* There are several use-cases when you need to open a web browser on a touch-enabled device (also known as a tablet). For these cases, you can use a custom web browser we built. Default URL can be opened and even the whitelisting/blacklisting of certain domains is supported.
|
|
12
12
|
*
|
|
13
13
|
* :::info
|
|
14
14
|
*
|
|
@@ -33,21 +33,28 @@ class Browser {
|
|
|
33
33
|
/**
|
|
34
34
|
* The `open()` method opens the specified url in a browser window.
|
|
35
35
|
*
|
|
36
|
-
* @param
|
|
37
|
-
* @param options
|
|
38
|
-
* @param options.
|
|
39
|
-
* @param options.
|
|
36
|
+
* @param uri The URL to open in the browser.
|
|
37
|
+
* @param options Optional parameters to configure the browser window.
|
|
38
|
+
* @param options.aclDomains List of domains to be interpreted according to `aclMode`. Example: `signageos.io`, `www.example.com`
|
|
39
|
+
* @param options.aclMode `blacklist` – Allow access to all domains except those in aclDomains and their subdomains, `whitelist` – Allow access only to domains in aclDomains and their subdomains.
|
|
40
|
+
* @param options.readOnlyAddressBar If `true`, the address bar is read-only, if `false` the user can navigate away by entering a URL in the address bar.
|
|
41
|
+
* @param options.idleTimeout The browser will automatically close after a specified period of inactivity (in milliseconds).
|
|
40
42
|
* @param options.coordinates Size and position of the browser window. Defaults to fullscreen.
|
|
41
43
|
* @param options.theme Specify custom UI theme. (Android only)
|
|
42
44
|
* @param options.headlessMode Headless mode hides the entire address bar. (Android only)
|
|
43
45
|
* @param options.canUserClose Whether the user can manually close the browser. (default if headless false, else true)
|
|
44
46
|
* @param options.clearData Clear cache after the browser closes. (default if headless false, else true)
|
|
45
|
-
* @param options.method
|
|
46
|
-
*
|
|
47
|
+
* @param options.method Can only be native (which opens a new, fully sandboxed fullscreen window) or iframe (which opens a configurable-sized window). (only Linux)
|
|
48
|
+
* @returns {Promise<void>} A promise that resolves when the browser is opened.
|
|
49
|
+
* @throws {Error} If the `uri` is not a valid URL or string.
|
|
50
|
+
* @throws {Error} If the `options` are not valid.
|
|
51
|
+
* @throws {Error} If unexpected error occurred when opening link.
|
|
47
52
|
* @since 4.0.0
|
|
48
53
|
*
|
|
54
|
+
* @example // {@link https://github.com/signageos/applet-examples/tree/master/examples/content-js-api/browser | Example of Applet for using browser on Android }
|
|
55
|
+
*
|
|
49
56
|
* @example
|
|
50
|
-
* sos.browser.open('https://www.signageos.io', {
|
|
57
|
+
* await sos.browser.open('https://www.signageos.io', {
|
|
51
58
|
* aclDomains: ['google.com', 'yahoo.com'],
|
|
52
59
|
* aclMode: 'blacklist', // or 'whitelist'
|
|
53
60
|
* readOnlyAddressBar: true,
|
|
@@ -75,7 +82,15 @@ class Browser {
|
|
|
75
82
|
/**
|
|
76
83
|
* The `close()` method closes the browser window opened by the `open()` method.
|
|
77
84
|
*
|
|
85
|
+
* @returns {Promise<void>} A promise that resolves when the browser is closed.
|
|
78
86
|
* @since 4.0.0
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* await sos.browser.open('https://www.signageos.io', {
|
|
90
|
+
* readOnlyAddressBar: true,
|
|
91
|
+
* });
|
|
92
|
+
* // some time later
|
|
93
|
+
* await sos.browser.close();
|
|
79
94
|
*/
|
|
80
95
|
async close() {
|
|
81
96
|
await this.exchange.postMessage({
|
|
@@ -86,7 +101,8 @@ class Browser {
|
|
|
86
101
|
* The `onClose()` method sets up a listener, which is called whenever a browser window is closed. This can happen by an API call, by a
|
|
87
102
|
* user request or after a timeout. This doesn't fire between `open` calls or on subsequent `close` calls.
|
|
88
103
|
*
|
|
89
|
-
* @
|
|
104
|
+
* @param listener The listener to be called when the browser is closed.
|
|
105
|
+
* @returns {void} A callback which removes the listener.
|
|
90
106
|
*/
|
|
91
107
|
onClose(listener) {
|
|
92
108
|
(0, Validate_1.default)({ listener }).required().function();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Browser.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/Browser.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,oEAA4C;AAC5C,qCAA8D;AAC9D,yDAAqG;AAIrG;;;;;;;;;;;;;;;GAeG;AACH,MAAqB,OAAO;IAIE;IAHZ,MAAM,GAAiB,IAAI,qBAAY,EAAE,CAAC;IAE3D,gBAAgB;IAChB,YAA6B,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;IAAG,CAAC;IAEzD
|
|
1
|
+
{"version":3,"file":"Browser.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/Browser.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,oEAA4C;AAC5C,qCAA8D;AAC9D,yDAAqG;AAIrG;;;;;;;;;;;;;;;GAeG;AACH,MAAqB,OAAO;IAIE;IAHZ,MAAM,GAAiB,IAAI,qBAAY,EAAE,CAAC;IAE3D,gBAAgB;IAChB,YAA6B,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;IAAG,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACI,KAAK,CAAC,IAAI,CAAC,GAAW,EAAE,UAA4B,EAAE;QAC5D,IAAA,kBAAQ,EAAC,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC;QACnC,IAAA,kBAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,oCAAiB,CAAC,CAAC;QAE3D,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC;QAClD,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC/B,GAAG;YACH,GAAG,OAAO;YACV,YAAY;YACZ,IAAI,EAAE,MAAM;SACZ,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,KAAK,CAAC,KAAK;QACjB,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC/B,IAAI,EAAE,OAAO;SACb,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACI,OAAO,CAAC,QAAqC;QACnD,IAAA,kBAAQ,EAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;QAE7C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE;YACX,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,kBAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC,CAAC;IACH,CAAC;IAED,gBAAgB;IACT,iBAAiB,CAAC,IAAqB;QAC7C,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC;gBAC7C,MAAM,KAAK,GAAe;oBACzB,IAAI,EAAE,kBAAS,CAAC,KAAK;oBACrB,MAAM,EAAE,IAAI,CAAC,MAAqB;iBAClC,CAAC;gBACF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBACzC,MAAM;YACP,QAAQ;QACT,CAAC;IACF,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,QAAQ,CAAC,GAAW,EAAE,UAAsC,EAAE;QAC1E,OAAO,CAAC,IAAI,CAAC,kHAAkH,CAAC,CAAC;QAEjI,IAAA,kBAAQ,EAAC,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC;QACnC,IAAA,kBAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC;QAE1C,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC/B,GAAG;YACH,GAAG,OAAO;YACV,YAAY,EAAE,KAAK;YACnB,IAAI,EAAE,WAAW;SACjB,CAAC,CAAC;IACJ,CAAC;CACD;AA1HD,0BA0HC"}
|
|
@@ -89,6 +89,9 @@ export interface IDeprecatedOpenLinkOptions {
|
|
|
89
89
|
idleTimeout?: number;
|
|
90
90
|
theme?: ITheme;
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Interface defines the options for opening a link in the browser.
|
|
94
|
+
*/
|
|
92
95
|
interface IOpenLinkOptions {
|
|
93
96
|
aclDomains?: string[];
|
|
94
97
|
aclMode?: 'blacklist' | 'whitelist';
|
|
@@ -104,6 +107,10 @@ interface IOpenLinkOptions {
|
|
|
104
107
|
headlessMode?: boolean;
|
|
105
108
|
clearData?: boolean;
|
|
106
109
|
canUserClose?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Method of opening the link.
|
|
112
|
+
* @default 'native'
|
|
113
|
+
*/
|
|
107
114
|
method?: 'native' | 'iframe';
|
|
108
115
|
}
|
|
109
116
|
export default IOpenLinkOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IOpenLinkOptions.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/IOpenLinkOptions.ts"],"names":[],"mappings":";;;AAkCa,QAAA,OAAO,GAAG;IACtB,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;IACtC,KAAK,EAAE;QACN,SAAS,EAAE;YACV,UAAU,EAAE,SAAS;SACrB;KACD;IACD,MAAM,EAAE;QACP,SAAS,EAAE;YACV,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE,SAAS;SAClB;KACD;IACD,OAAO,EAAE;QACR,SAAS,EAAE;YACV,WAAW,EAAE;gBACZ,SAAS,EAAE;oBACV,MAAM,EAAE;wBACP,SAAS,EAAE;4BACV,UAAU,EAAE,SAAS;4BACrB,IAAI,EAAE,SAAS;yBACf;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ,SAAS,EAAE;oBACV,MAAM,EAAE;wBACP,SAAS,EAAE;4BACV,UAAU,EAAE,SAAS;4BACrB,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,SAAS;yBACf;qBACD;oBACD,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE;oBAC/D,IAAI,EAAE,SAAS;iBACf;aACD;YACD,QAAQ,EAAE;gBACT,SAAS,EAAE;oBACV,KAAK,EAAE,SAAS;iBAChB;aACD;SACD;KACD;CACD,CAAC;
|
|
1
|
+
{"version":3,"file":"IOpenLinkOptions.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/IOpenLinkOptions.ts"],"names":[],"mappings":";;;AAkCa,QAAA,OAAO,GAAG;IACtB,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;IACtC,KAAK,EAAE;QACN,SAAS,EAAE;YACV,UAAU,EAAE,SAAS;SACrB;KACD;IACD,MAAM,EAAE;QACP,SAAS,EAAE;YACV,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE,SAAS;SAClB;KACD;IACD,OAAO,EAAE;QACR,SAAS,EAAE;YACV,WAAW,EAAE;gBACZ,SAAS,EAAE;oBACV,MAAM,EAAE;wBACP,SAAS,EAAE;4BACV,UAAU,EAAE,SAAS;4BACrB,IAAI,EAAE,SAAS;yBACf;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ,SAAS,EAAE;oBACV,MAAM,EAAE;wBACP,SAAS,EAAE;4BACV,UAAU,EAAE,SAAS;4BACrB,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,SAAS;yBACf;qBACD;oBACD,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE;oBAC/D,IAAI,EAAE,SAAS;iBACf;aACD;YACD,QAAQ,EAAE;gBACT,SAAS,EAAE;oBACV,KAAK,EAAE,SAAS;iBAChB;aACD;SACD;KACD;CACD,CAAC;AAwEW,QAAA,iBAAiB,GAAG;IAChC,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;IAClC,OAAO,EAAE,EAAE,SAAS,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE;IAClD,kBAAkB,EAAE,UAAU;IAC9B,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;QACZ,SAAS,EAAE;YACV,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;SAChB;KACD;IACD,KAAK,EAAE,EAAE,SAAS,EAAE,eAAO,EAAE;IAC7B,YAAY,EAAE,UAAU;IACxB,SAAS,EAAE,UAAU;IACrB,YAAY,EAAE,UAAU;IACxB,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;CAC3C,CAAC"}
|
|
@@ -5,7 +5,13 @@ export declare const VIEventType: string[];
|
|
|
5
5
|
export type Event<TType extends EventType = EventType> = {
|
|
6
6
|
type: TType;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Interface representing a close event in the browser.
|
|
10
|
+
*/
|
|
8
11
|
export interface CloseEvent extends Event<EventType.CLOSE> {
|
|
12
|
+
/**
|
|
13
|
+
* The reason for the browser being closed.
|
|
14
|
+
*/
|
|
9
15
|
reason: CloseReason;
|
|
10
16
|
}
|
|
11
17
|
export declare enum CloseReason {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/events.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAEX;AAFD,WAAY,SAAS;IACpB,4BAAe,CAAA;AAChB,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB;AAEY,QAAA,WAAW,GAAG,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/events.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAEX;AAFD,WAAY,SAAS;IACpB,4BAAe,CAAA;AAChB,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB;AAEY,QAAA,WAAW,GAAG,CAAC,OAAO,CAAC,CAAC;AAgBrC,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,0BAAW,CAAA;IACX,4BAAa,CAAA;IACb,kCAAmB,CAAA;AACpB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB"}
|
|
@@ -3,7 +3,9 @@ import IPostMessage from '../IPostMessage';
|
|
|
3
3
|
import ICommandDispatchToAppletMessage from './ICommandDispatchToAppletMessage';
|
|
4
4
|
import ICommandEvent from './ICommandEvent';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* In some cases, you might be interested in a complete log of what the device was doing during its operation. All of your business or technical logs can be stored in our storage for later usage. You can identify which events happened or even trigger self-repairing logic.
|
|
7
|
+
*
|
|
8
|
+
* All commands will be available in [Applet Command REST API](https://developers.signageos.io/api/#tag/DeviceApplet-Command) and can be downloaded historically as [CSV export](https://developers.signageos.io/api/#tag/DeviceMonitoring/paths/~1v1~1device~1%7BdeviceUid%7D~1report/get).
|
|
7
9
|
*/
|
|
8
10
|
export default class Command {
|
|
9
11
|
private messagePrefix;
|
|
@@ -16,16 +18,21 @@ export default class Command {
|
|
|
16
18
|
* The `dispatch()` method dispatches a new log record to the signageOS.
|
|
17
19
|
*
|
|
18
20
|
* :::warning[Dispatch throttling]
|
|
19
|
-
*
|
|
20
21
|
* Sending commands from an applet is throttled, this means that after if the dispatch frequency is too high, some commands may be
|
|
21
|
-
* discarded. Currently the limit is 30 commands per 30 seconds, although this may not be fully accurate and it's not possible to know the
|
|
22
|
+
* discarded. Currently, the limit is 30 commands per 30 seconds, although this may not be fully accurate, and it's not possible to know the
|
|
22
23
|
* exact limit.
|
|
23
|
-
*
|
|
24
24
|
* :::
|
|
25
25
|
*
|
|
26
|
+
* @param command The command to be dispatched.
|
|
27
|
+
* @throws {AppletCommandError} If type contains invalid characters, allowed to are `/^[a-zA-Z0-9\.\-_]+$/g`
|
|
28
|
+
* @throws {AppletCommandError} If the command type is longer then 100 characters limit.
|
|
29
|
+
* @throws {AppletCommandError} If the command is not an object or is missing required properties.
|
|
26
30
|
* @since 1.0.3
|
|
27
31
|
*
|
|
28
|
-
* @example // {@link https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/sending/ |Sending commands}
|
|
32
|
+
* @example // {@link https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/sending/ | Sending commands in Applet}
|
|
33
|
+
* @example // {@link https://developers.signageos.io/api/#tag/DeviceApplet-Command/paths/~1v1~1device~1%7BdeviceUid%7D~1applet~1%7BappletUid%7D~1command/post | Rest API - Dispatching commands}
|
|
34
|
+
* @example // {@link https://developers.signageos.io/api/#tag/DeviceApplet-Command/paths/~1v1~1device~1%7BdeviceUid%7D~1applet~1command/get | Rest API - Get commands}
|
|
35
|
+
* @example // {@link https://developers.signageos.io/api/#tag/DeviceMonitoring/paths/~1v1~1device~1%7BdeviceUid%7D~1report/get | Rest API - Receiving historical data}
|
|
29
36
|
*
|
|
30
37
|
* @example
|
|
31
38
|
* await sos.command.dispatch({
|
|
@@ -38,9 +45,11 @@ export default class Command {
|
|
|
38
45
|
/**
|
|
39
46
|
* The `onCommand()` method sets up a listener, which is called whenever a new command from signageOS is received.
|
|
40
47
|
*
|
|
48
|
+
* @param listener The listener to be called when a new command is received.
|
|
49
|
+
* @returns {void} Resolves when the listener is successfully set up.
|
|
41
50
|
* @since 1.0.3
|
|
42
51
|
*
|
|
43
|
-
* @example // {@link https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/receiving |Receiving commands}
|
|
52
|
+
* @example // {@link https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/receiving | Receiving commands in Applet}
|
|
44
53
|
*/
|
|
45
54
|
onCommand(listener: (command: ICommandEvent) => void): void;
|
|
46
55
|
/** @internal */
|
|
@@ -9,7 +9,9 @@ const ErrorCodes_1 = __importDefault(require("../Error/ErrorCodes"));
|
|
|
9
9
|
const ErrorSuggestions_1 = __importDefault(require("../Error/ErrorSuggestions"));
|
|
10
10
|
const Validate_1 = __importDefault(require("../Validate/Validate"));
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* In some cases, you might be interested in a complete log of what the device was doing during its operation. All of your business or technical logs can be stored in our storage for later usage. You can identify which events happened or even trigger self-repairing logic.
|
|
13
|
+
*
|
|
14
|
+
* All commands will be available in [Applet Command REST API](https://developers.signageos.io/api/#tag/DeviceApplet-Command) and can be downloaded historically as [CSV export](https://developers.signageos.io/api/#tag/DeviceMonitoring/paths/~1v1~1device~1%7BdeviceUid%7D~1report/get).
|
|
13
15
|
*/
|
|
14
16
|
class Command {
|
|
15
17
|
messagePrefix;
|
|
@@ -26,16 +28,21 @@ class Command {
|
|
|
26
28
|
* The `dispatch()` method dispatches a new log record to the signageOS.
|
|
27
29
|
*
|
|
28
30
|
* :::warning[Dispatch throttling]
|
|
29
|
-
*
|
|
30
31
|
* Sending commands from an applet is throttled, this means that after if the dispatch frequency is too high, some commands may be
|
|
31
|
-
* discarded. Currently the limit is 30 commands per 30 seconds, although this may not be fully accurate and it's not possible to know the
|
|
32
|
+
* discarded. Currently, the limit is 30 commands per 30 seconds, although this may not be fully accurate, and it's not possible to know the
|
|
32
33
|
* exact limit.
|
|
33
|
-
*
|
|
34
34
|
* :::
|
|
35
35
|
*
|
|
36
|
+
* @param command The command to be dispatched.
|
|
37
|
+
* @throws {AppletCommandError} If type contains invalid characters, allowed to are `/^[a-zA-Z0-9\.\-_]+$/g`
|
|
38
|
+
* @throws {AppletCommandError} If the command type is longer then 100 characters limit.
|
|
39
|
+
* @throws {AppletCommandError} If the command is not an object or is missing required properties.
|
|
36
40
|
* @since 1.0.3
|
|
37
41
|
*
|
|
38
|
-
* @example // {@link https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/sending/ |Sending commands}
|
|
42
|
+
* @example // {@link https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/sending/ | Sending commands in Applet}
|
|
43
|
+
* @example // {@link https://developers.signageos.io/api/#tag/DeviceApplet-Command/paths/~1v1~1device~1%7BdeviceUid%7D~1applet~1%7BappletUid%7D~1command/post | Rest API - Dispatching commands}
|
|
44
|
+
* @example // {@link https://developers.signageos.io/api/#tag/DeviceApplet-Command/paths/~1v1~1device~1%7BdeviceUid%7D~1applet~1command/get | Rest API - Get commands}
|
|
45
|
+
* @example // {@link https://developers.signageos.io/api/#tag/DeviceMonitoring/paths/~1v1~1device~1%7BdeviceUid%7D~1report/get | Rest API - Receiving historical data}
|
|
39
46
|
*
|
|
40
47
|
* @example
|
|
41
48
|
* await sos.command.dispatch({
|
|
@@ -54,9 +61,11 @@ class Command {
|
|
|
54
61
|
/**
|
|
55
62
|
* The `onCommand()` method sets up a listener, which is called whenever a new command from signageOS is received.
|
|
56
63
|
*
|
|
64
|
+
* @param listener The listener to be called when a new command is received.
|
|
65
|
+
* @returns {void} Resolves when the listener is successfully set up.
|
|
57
66
|
* @since 1.0.3
|
|
58
67
|
*
|
|
59
|
-
* @example // {@link https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/receiving |Receiving commands}
|
|
68
|
+
* @example // {@link https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/command/receiving | Receiving commands in Applet}
|
|
60
69
|
*/
|
|
61
70
|
onCommand(listener) {
|
|
62
71
|
(0, Validate_1.default)({ listener }).required().function();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.js","sourceRoot":"","sources":["../../../src/FrontApplet/Command/Command.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAItC,qFAA6D;AAC7D,qEAA6C;AAC7C,iFAAyD;AACzD,oEAA4C;AAG5C
|
|
1
|
+
{"version":3,"file":"Command.js","sourceRoot":"","sources":["../../../src/FrontApplet/Command/Command.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAItC,qFAA6D;AAC7D,qEAA6C;AAC7C,iFAAyD;AACzD,oEAA4C;AAG5C;;;;GAIG;AACH,MAAqB,OAAO;IAOlB;IACA;IAPF,MAAM,CAAC,cAAc,GAAW,SAAS,CAAC;IAEzC,YAAY,CAAe;IAEnC,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA+B;QAD/B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAoB;QAEvC,IAAI,CAAC,YAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;IACxC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACI,KAAK,CAAC,QAAQ,CAA4B,OAAiB;QACjE,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;YACjC,OAAO;SACP,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACI,SAAS,CAAC,QAA0C;QAC1D,IAAA,kBAAQ,EAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC7C,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACpD,CAAC;IAED,gBAAgB;IACT,iBAAiB,CAAC,IAAqC;QAC7D,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;gBACzC,MAAM,YAAY,GAAG;oBACpB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,IAAI,CAAC,OAAO;iBACrB,CAAC;gBACF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;gBAChD,MAAM;YACP,QAAQ;QACT,CAAC;IACF,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,OAAO,CAAC,cAAc,GAAG,GAAG,GAAG,IAAI,CAAC;IACvE,CAAC;IAEO,iBAAiB,CAAC,IAAY;QACrC,MAAM,KAAK,GAAG,sBAAsB,CAAC;QAErC,IAAA,kBAAQ,EAAC,EAAE,IAAI,EAAE,CAAC;aAChB,QAAQ,CACR,IAAI,4BAAkB,CAAC;YACtB,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,mCAAmC;YAC5C,IAAI,EAAE,oBAAU,CAAC,sBAAsB;YACvC,UAAU,EAAE,0BAAgB,CAAC,sBAAsB;SACnD,CAAC,CACF;aACA,QAAQ,EAAE;aACV,MAAM,EAAE;aACR,WAAW,CAAC,KAAK,CAAC,CAAC;QAErB,IAAA,kBAAQ,EAAC,EAAE,IAAI,EAAE,CAAC;aAChB,QAAQ,CACR,IAAI,4BAAkB,CAAC;YACtB,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,qCAAqC;YAC9C,IAAI,EAAE,oBAAU,CAAC,wBAAwB;SACzC,CAAC,CACF;aACA,SAAS,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC;;AAzGF,0BA0GC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface represents a command structure with a type and additional data.
|
|
3
|
+
*/
|
|
1
4
|
interface ICommand {
|
|
2
5
|
type: string;
|
|
6
|
+
/**
|
|
7
|
+
* The `data` property is an object that contains additional data related to the command.
|
|
8
|
+
*/
|
|
9
|
+
[key: string]: any;
|
|
3
10
|
}
|
|
4
11
|
export default ICommand;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import ICommand from './ICommand';
|
|
2
|
+
/**
|
|
3
|
+
* Received command event interface from signageOS.
|
|
4
|
+
*/
|
|
2
5
|
interface ICommandEvent {
|
|
3
6
|
type: 'command';
|
|
7
|
+
/**
|
|
8
|
+
* Command data received from occurred event.
|
|
9
|
+
*/
|
|
4
10
|
command: ICommand;
|
|
5
11
|
}
|
|
6
12
|
export default ICommandEvent;
|
|
@@ -3,6 +3,11 @@ import IPostMessage from '../IPostMessage';
|
|
|
3
3
|
import IDebug, { IDebugSetWeinreMessage, WeinreData } from './IDebug';
|
|
4
4
|
/**
|
|
5
5
|
* The `sos.debug` API groups together methods for checking the state of remote debug mode.
|
|
6
|
+
*
|
|
7
|
+
* :::note
|
|
8
|
+
* - This debug is not the "native debug" of the device, but rather a remote debug mode that allows you to connect to the device using Weinre.
|
|
9
|
+
* - State of the remote debug mode or native debug mode can be changed via Cloud Control or [Rest API](https://developers-staging.signageos.io/api/#tag/DeviceDebug/paths/~1v1~1device~1%7BdeviceUid%7D~1debug/put).
|
|
10
|
+
* :::
|
|
6
11
|
*/
|
|
7
12
|
export default class Debug extends EventEmitter implements IDebug {
|
|
8
13
|
readonly window: Window & WeinreData;
|
|
@@ -13,15 +18,18 @@ export default class Debug extends EventEmitter implements IDebug {
|
|
|
13
18
|
/** @internal */
|
|
14
19
|
constructor(window: Window & WeinreData, messagePrefix: string, postMessage: IPostMessage<any>);
|
|
15
20
|
/**
|
|
16
|
-
* The `isRemoteDebugEnabled()` method returns the state of the
|
|
21
|
+
* The `isRemoteDebugEnabled()` method returns the state of the Device debug mode.
|
|
17
22
|
*
|
|
23
|
+
* @returens {Promise<boolean>} Resolves to `true` if the remote debug mode is enabled, otherwise `false`.
|
|
18
24
|
* @since 5.8.0
|
|
19
25
|
*/
|
|
20
26
|
isRemoteDebugEnabled(): Promise<boolean>;
|
|
21
27
|
/**
|
|
22
|
-
* The `onRemoteDebugChanged()` method sets up a listener, which is called whenever the state of the
|
|
28
|
+
* The `onRemoteDebugChanged()` method sets up a listener, which is called whenever the state of the Device debug mode is changed.
|
|
23
29
|
*
|
|
24
|
-
* @
|
|
30
|
+
* @param listener The listener to be called when the state of the remote debug mode is changed.
|
|
31
|
+
* @returns {void} Resolves when the listener is successfully set up.
|
|
32
|
+
* @since 5.8.0
|
|
25
33
|
*/
|
|
26
34
|
onRemoteDebugChanged(listener: (data: {
|
|
27
35
|
enabled: boolean;
|