@signageos/front-applet 5.4.2 → 5.6.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/bundle.js +1 -1
  3. package/dist/bundle.js.map +1 -1
  4. package/docs/js-api/js-api-introduction.md +6 -0
  5. package/docs/js-api/js-display.md +1 -1
  6. package/docs/js-api/js-hardware-serial.md +9 -6
  7. package/docs/js-api/js-osd.md +34 -0
  8. package/docs/management-api/2-js-management-os.md +8 -0
  9. package/docs/management-api/5-js-management-screen.md +16 -0
  10. package/es6/FrontApplet/Browser/IOpenLinkOptions.js +9 -9
  11. package/es6/FrontApplet/Dimensions/coordinationsHelper.js +2 -1
  12. package/es6/FrontApplet/Dimensions/coordinationsHelper.js.map +1 -1
  13. package/es6/FrontApplet/Error/SosError.js +1 -1
  14. package/es6/FrontApplet/Exchange/Exchange.js +1 -1
  15. package/es6/FrontApplet/Font/fontFaceGenerator.js +1 -1
  16. package/es6/FrontApplet/FrontApplet.d.ts +2 -0
  17. package/es6/FrontApplet/FrontApplet.js +3 -1
  18. package/es6/FrontApplet/FrontApplet.js.map +1 -1
  19. package/es6/FrontApplet/Input/Input.d.ts +1 -1
  20. package/es6/FrontApplet/Management/App.js +2 -2
  21. package/es6/FrontApplet/Management/Audio.js +2 -2
  22. package/es6/FrontApplet/Management/Debug.js +2 -2
  23. package/es6/FrontApplet/Management/Firmware.js +1 -1
  24. package/es6/FrontApplet/Management/Management.d.ts +2 -0
  25. package/es6/FrontApplet/Management/Management.js +4 -4
  26. package/es6/FrontApplet/Management/Management.js.map +1 -1
  27. package/es6/FrontApplet/Management/Network.js +1 -1
  28. package/es6/FrontApplet/Management/OS.js +3 -3
  29. package/es6/FrontApplet/Management/Package.js +1 -1
  30. package/es6/FrontApplet/Management/PeerRecovery.d.ts +1 -1
  31. package/es6/FrontApplet/Management/PeerRecovery.js +2 -2
  32. package/es6/FrontApplet/Management/Power.js +3 -3
  33. package/es6/FrontApplet/Management/Proxy.js +3 -3
  34. package/es6/FrontApplet/Management/RemoteControl.js +2 -2
  35. package/es6/FrontApplet/Management/Screen.js +7 -7
  36. package/es6/FrontApplet/Management/Time.js +1 -1
  37. package/es6/FrontApplet/OSD/OSD.d.ts +9 -0
  38. package/es6/FrontApplet/OSD/OSD.js +30 -0
  39. package/es6/FrontApplet/OSD/OSD.js.map +1 -0
  40. package/es6/FrontApplet/Offline/Cache/Cache.js +2 -2
  41. package/es6/FrontApplet/Offline/Flags/AppendFlagController.js +1 -1
  42. package/es6/FrontApplet/Offline/IElement.js +1 -1
  43. package/es6/FrontApplet/Offline/ISaveFile.js +4 -4
  44. package/es6/FrontApplet/Offline/Types.js +1 -1
  45. package/es6/FrontApplet/Stream/Stream.js +1 -1
  46. package/es6/FrontApplet/Video/Video.js +5 -5
  47. package/es6/Monitoring/Montoring.js +5 -5
  48. package/package.json +4 -4
@@ -43,7 +43,7 @@ class Screen {
43
43
  getOrientation() {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
45
  const { screenOrientation } = yield this.postMessage({
46
- type: this.getMessage('get_screen_orientation')
46
+ type: this.getMessage('get_screen_orientation'),
47
47
  });
48
48
  return screenOrientation;
49
49
  });
@@ -59,14 +59,14 @@ class Screen {
59
59
  timeFrom1,
60
60
  brightness1,
61
61
  timeFrom2,
62
- brightness2
62
+ brightness2,
63
63
  });
64
64
  });
65
65
  }
66
66
  getBrightness() {
67
67
  return __awaiter(this, void 0, void 0, function* () {
68
68
  const { screenBrightness } = yield this.postMessage({
69
- type: this.getMessage('get_screen_brightness')
69
+ type: this.getMessage('get_screen_brightness'),
70
70
  });
71
71
  return screenBrightness;
72
72
  });
@@ -76,7 +76,7 @@ class Screen {
76
76
  Validate_1.default({ uploadBaseUrl }).required().uri();
77
77
  const { screenshotUrl } = yield this.postMessage({
78
78
  type: this.getMessage('upload_screenshot'),
79
- uploadBaseUrl
79
+ uploadBaseUrl,
80
80
  });
81
81
  return screenshotUrl;
82
82
  });
@@ -84,21 +84,21 @@ class Screen {
84
84
  powerOn() {
85
85
  return __awaiter(this, void 0, void 0, function* () {
86
86
  yield this.postMessage({
87
- type: this.getMessage('power_on_display')
87
+ type: this.getMessage('power_on_display'),
88
88
  });
89
89
  });
90
90
  }
91
91
  powerOff() {
92
92
  return __awaiter(this, void 0, void 0, function* () {
93
93
  yield this.postMessage({
94
- type: this.getMessage('power_off_display')
94
+ type: this.getMessage('power_off_display'),
95
95
  });
96
96
  });
97
97
  }
98
98
  isPoweredOn() {
99
99
  return __awaiter(this, void 0, void 0, function* () {
100
100
  const { isDisplayPowerOn } = yield this.postMessage({
101
- type: this.getMessage('get_is_display_power_on')
101
+ type: this.getMessage('get_is_display_power_on'),
102
102
  });
103
103
  return isDisplayPowerOn;
104
104
  });
@@ -26,7 +26,7 @@ class Time {
26
26
  get() {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
28
  const { currentTimeWithTimezone } = yield this.postMessage({
29
- type: this.getMessage('get_current_time_with_timezone')
29
+ type: this.getMessage('get_current_time_with_timezone'),
30
30
  });
31
31
  return currentTimeWithTimezone;
32
32
  });
@@ -0,0 +1,9 @@
1
+ import IPostMessage from '../IPostMessage';
2
+ export default class OSD {
3
+ private messagePrefix;
4
+ private postMessage;
5
+ static MESSAGE_PREFIX: string;
6
+ constructor(messagePrefix: string, postMessage: IPostMessage<any>);
7
+ showOSD(): Promise<void>;
8
+ private getMessage;
9
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ class OSD {
13
+ constructor(messagePrefix, postMessage) {
14
+ this.messagePrefix = messagePrefix;
15
+ this.postMessage = postMessage;
16
+ }
17
+ showOSD() {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield this.postMessage({
20
+ type: this.getMessage('show_osd'),
21
+ });
22
+ });
23
+ }
24
+ getMessage(name) {
25
+ return this.messagePrefix + "." + OSD.MESSAGE_PREFIX + "." + name;
26
+ }
27
+ }
28
+ exports.default = OSD;
29
+ OSD.MESSAGE_PREFIX = "osd";
30
+ //# sourceMappingURL=OSD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OSD.js","sourceRoot":"","sources":["../../../src/FrontApplet/OSD/OSD.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,MAAqB,GAAG;IAGvB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACvC,CAAC;IAEY,OAAO;;YACnB,MAAM,IAAI,CAAC,WAAW,CAAC;gBACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;aACjC,CAAC,CAAC;QACJ,CAAC;KAAA;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,GAAG,CAAC,cAAc,GAAG,GAAG,GAAG,IAAI,CAAC;IACnE,CAAC;;AAhBF,sBAiBC;AAhBc,kBAAc,GAAW,KAAK,CAAC"}
@@ -46,7 +46,7 @@ class Cache {
46
46
  throw new AppletOfflineCacheError_1.default({
47
47
  kind: 'appletOfflineCacheError',
48
48
  message: `Invalid headers ${headers}`,
49
- code: ErrorCodes_1.default.OFFLINE_CACHE_HEADERS_NOT_VALID
49
+ code: ErrorCodes_1.default.OFFLINE_CACHE_HEADERS_NOT_VALID,
50
50
  });
51
51
  }
52
52
  const response = yield this.postMessage({
@@ -169,7 +169,7 @@ class Cache {
169
169
  throw new FileNotFoundError_1.default({
170
170
  kind: 'fileNotFoundError',
171
171
  message: 'File was not found ' + uid,
172
- code: ErrorCodes_1.default.FILE_NOT_FOUND_IN_CACHE
172
+ code: ErrorCodes_1.default.FILE_NOT_FOUND_IN_CACHE,
173
173
  });
174
174
  }
175
175
  return this.savedFiles[uid];
@@ -23,7 +23,7 @@ class AppendFlagController {
23
23
  type: "append",
24
24
  element: {
25
25
  uid,
26
- }
26
+ },
27
27
  };
28
28
  }
29
29
  applyFlag(flag, fileType, filePath) {
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VIElement = void 0;
4
4
  exports.VIElement = {
5
- uid: 'string'
5
+ uid: 'string',
6
6
  };
7
7
  //# sourceMappingURL=IElement.js.map
@@ -9,19 +9,19 @@ exports.VISaveFile = {
9
9
  uid: { 'string': null, 'error': {
10
10
  code: ErrorCodes_1.default.FILE_DOES_NOT_HAVE_UID,
11
11
  message: ErrorCodesMessages_1.default[ErrorCodes_1.default.FILE_DOES_NOT_HAVE_UID],
12
- }
12
+ },
13
13
  },
14
14
  uri: 'string',
15
15
  type: { 'string': IFileType_1.VIFileType, 'error': {
16
16
  code: ErrorCodes_1.default.FILE_FLAGS_ARE_NOT_IN_ARRAY,
17
17
  message: ErrorCodesMessages_1.default[ErrorCodes_1.default.FILE_FLAGS_ARE_NOT_IN_ARRAY],
18
- }
18
+ },
19
19
  },
20
20
  headers: '?object',
21
21
  flags: { '?array': {
22
22
  'object': IFlag_1.VIFlag,
23
- 'error': { code: ErrorCodes_1.default.FILE_FLAG_IS_NOT_OBJECT, message: ErrorCodesMessages_1.default[ErrorCodes_1.default.FILE_FLAG_IS_NOT_OBJECT] }
24
- }
23
+ 'error': { code: ErrorCodes_1.default.FILE_FLAG_IS_NOT_OBJECT, message: ErrorCodesMessages_1.default[ErrorCodes_1.default.FILE_FLAG_IS_NOT_OBJECT] },
24
+ },
25
25
  },
26
26
  };
27
27
  //# sourceMappingURL=ISaveFile.js.map
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const Types = {
4
4
  javascript: "javascript",
5
5
  css: "css",
6
- video: "video"
6
+ video: "video",
7
7
  };
8
8
  exports.default = Types;
9
9
  //# sourceMappingURL=Types.js.map
@@ -29,7 +29,7 @@ class Stream {
29
29
  throw new AppletStreamError_1.default({
30
30
  kind: 'appletStreamError',
31
31
  message: 'Invalid stream protocol type: ' + protocol,
32
- code: ErrorCodes_1.default.STREAM_INVALID_PROTOCOL_TYPE
32
+ code: ErrorCodes_1.default.STREAM_INVALID_PROTOCOL_TYPE,
33
33
  });
34
34
  }
35
35
  }
@@ -82,7 +82,7 @@ class Video {
82
82
  kind: 'appletVideoError',
83
83
  message: `This video was stopped already. The arguments: ${srcArgumentsString}`,
84
84
  code: ErrorCodes_1.default.VIDEO_WAS_STOPPED_ALREADY,
85
- suggestion: ErrorSuggestions_1.default.VIDEO_WAS_STOPPED_ALREADY
85
+ suggestion: ErrorSuggestions_1.default.VIDEO_WAS_STOPPED_ALREADY,
86
86
  }));
87
87
  delete this.onceDeferredIndex[srcArgumentsString];
88
88
  });
@@ -131,7 +131,7 @@ class Video {
131
131
  kind: 'appletVideoError',
132
132
  message: `This video was not played yet. The arguments: ${srcArgumentsString}`,
133
133
  code: ErrorCodes_1.default.VIDEO_WAS_NOT_PLAYED_YET,
134
- suggestion: ErrorSuggestions_1.default.VIDEO_WAS_NOT_PLAYED
134
+ suggestion: ErrorSuggestions_1.default.VIDEO_WAS_NOT_PLAYED,
135
135
  });
136
136
  }
137
137
  return onceDeferreds.ended.oncePromise;
@@ -146,7 +146,7 @@ class Video {
146
146
  kind: 'appletVideoError',
147
147
  message: `This video was not played yet. The arguments: ${srcArgumentsString}`,
148
148
  code: ErrorCodes_1.default.VIDEO_WAS_NOT_PLAYED_YET,
149
- suggestion: ErrorSuggestions_1.default.VIDEO_WAS_NOT_PLAYED
149
+ suggestion: ErrorSuggestions_1.default.VIDEO_WAS_NOT_PLAYED,
150
150
  });
151
151
  }
152
152
  return onceDeferreds.stop.oncePromise;
@@ -210,7 +210,7 @@ class Video {
210
210
  reject(new SosError_1.default({
211
211
  kind: 'sosError',
212
212
  message: JSON.stringify(event.srcArguments),
213
- code: ErrorCodes_1.default.UNEXPECTED_EXCEPTION
213
+ code: ErrorCodes_1.default.UNEXPECTED_EXCEPTION,
214
214
  }));
215
215
  }
216
216
  }
@@ -238,7 +238,7 @@ class Video {
238
238
  y,
239
239
  width,
240
240
  height,
241
- }
241
+ },
242
242
  };
243
243
  const eventName = this.getEventName(videoEvent);
244
244
  this.eventEmitter.emit(eventName, videoEvent);
@@ -132,13 +132,13 @@ class Monitoring {
132
132
  case fileSystemCommands_1.FileSystemGetFileRequest:
133
133
  this.dispatch({
134
134
  type: fileSystemCommands_1.FileSystemGetFileResult,
135
- file: yield this.frontApplet.fileSystem.getFile(commandEvent.command.filePath)
135
+ file: yield this.frontApplet.fileSystem.getFile(commandEvent.command.filePath),
136
136
  });
137
137
  break;
138
138
  case fileSystemCommands_1.FileSystemExistsRequest:
139
139
  this.dispatch({
140
140
  type: fileSystemCommands_1.FileSystemExistsResult,
141
- result: yield this.frontApplet.fileSystem.exists(commandEvent.command.filePath)
141
+ result: yield this.frontApplet.fileSystem.exists(commandEvent.command.filePath),
142
142
  });
143
143
  break;
144
144
  case fileSystemCommands_1.FileSystemDownloadFileRequest:
@@ -174,13 +174,13 @@ class Monitoring {
174
174
  case fileSystemCommands_1.FileSystemCreateDirectoryRequest:
175
175
  this.dispatch({
176
176
  type: fileSystemCommands_1.FileSystemCreateDirectoryResult,
177
- result: yield this.frontApplet.fileSystem.createDirectory(commandEvent.command.directoryPath)
177
+ result: yield this.frontApplet.fileSystem.createDirectory(commandEvent.command.directoryPath),
178
178
  });
179
179
  break;
180
180
  case fileSystemCommands_1.FileSystemIsDirectoryRequest:
181
181
  this.dispatch({
182
182
  type: fileSystemCommands_1.FileSystemIsDirectoryResult,
183
- result: yield this.frontApplet.fileSystem.isDirectory(commandEvent.command.filePath)
183
+ result: yield this.frontApplet.fileSystem.isDirectory(commandEvent.command.filePath),
184
184
  });
185
185
  break;
186
186
  case fileSystemCommands_1.FileSystemCopyFileRequest:
@@ -204,7 +204,7 @@ class Monitoring {
204
204
  case fileSystemCommands_1.FileSystemReadFileRequest:
205
205
  this.dispatch({
206
206
  type: fileSystemCommands_1.FileSystemReadFileResult,
207
- data: yield this.frontApplet.fileSystem.readFile(commandEvent.command.filePath)
207
+ data: yield this.frontApplet.fileSystem.readFile(commandEvent.command.filePath),
208
208
  });
209
209
  break;
210
210
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signageos/front-applet",
3
- "version": "5.4.2",
3
+ "version": "5.6.0",
4
4
  "main": "dist/bundle.js",
5
5
  "types": "es6/bundle.d.ts",
6
6
  "files": [
@@ -14,13 +14,13 @@
14
14
  "build": "webpack --config=webpack.config.js",
15
15
  "develop": "webpack --watch --config=webpack.config.js",
16
16
  "generate-declarations": "tsc -p tsconfig.declarations.json",
17
- "lint": "tslint --config node_modules/hugport-codestyle/tslint.json {src,tests}/**/*.{ts,tsx}",
17
+ "lint": "tslint --config node_modules/@signageos/codestyle/tslint.json {src,tests}/**/*.{ts,tsx}",
18
18
  "prebuild": "rm -rf dist/*",
19
19
  "prepare": "npm run prebuild && npm run build && npm run generate-declarations",
20
20
  "test": "env NODE_ENV=test ./node_modules/mocha/bin/mocha --opts mocha.opts",
21
21
  "escheck": "es-check --module es5 dist/*.js",
22
22
  "check": "npm run depcheck && npx --userconfig ./.npmrc @signageos/lib check-deps '.+' 'weinre'",
23
- "depcheck": "depcheck --specials=tslint,webpack,mocha --parsers='*.ts:typescript,*.js:es6' --detectors='requireCallExpression,importDeclaration' --ignore-dirs='dist,packages' --ignores='@types/*,hugport-codestyle,ts-node,source-map-support,mocha,depcheck,webpack-cli,@babel/polyfill,@babel/preset-env,es-check'"
23
+ "depcheck": "depcheck --specials=tslint,webpack,mocha --parsers='*.ts:typescript,*.js:es6' --detectors='requireCallExpression,importDeclaration' --ignore-dirs='dist,packages' --ignores='@types/*,@signageos/codestyle,ts-node,source-map-support,mocha,depcheck,webpack-cli,@babel/polyfill,@babel/preset-env,es-check'"
24
24
  },
25
25
  "repository": {
26
26
  "url": "git@gitlab.com:signageos/front-applet",
@@ -30,6 +30,7 @@
30
30
  "@babel/core": "7.6.0",
31
31
  "@babel/polyfill": "7.6.0",
32
32
  "@babel/preset-env": "7.6.0",
33
+ "@signageos/codestyle": "0.0.23",
33
34
  "@signageos/lib": "10.0.0",
34
35
  "@types/faker": "4.1.5",
35
36
  "@types/lodash": "4.14.137",
@@ -41,7 +42,6 @@
41
42
  "depcheck": "0.8.3",
42
43
  "es-check": "5.1.0",
43
44
  "faker": "4.1.0",
44
- "hugport-codestyle": "0.0.10",
45
45
  "lodash": "4.17.21",
46
46
  "mocha": "6.2.0",
47
47
  "should": "13.2.3",