@signageos/front-applet 7.2.0 → 8.0.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 (420) hide show
  1. package/dist/bundle.js +8 -4
  2. package/dist/bundle.js.map +1 -1
  3. package/docs/fpath/index.md +316 -0
  4. package/docs/index.md +18 -85
  5. package/docs/sos/browser.md +210 -0
  6. package/docs/sos/command.md +68 -0
  7. package/docs/sos/debug.md +25 -0
  8. package/docs/sos/deviceInfo.md +49 -0
  9. package/docs/sos/display.md +21 -0
  10. package/docs/sos/fileSystem.md +594 -0
  11. package/docs/sos/hardware/barcodeScanner.md +40 -0
  12. package/docs/sos/hardware/index.md +64 -0
  13. package/docs/sos/hardware/led.md +14 -0
  14. package/docs/sos/index.md +82 -0
  15. package/docs/sos/input.md +73 -0
  16. package/docs/sos/monitors.md +21 -0
  17. package/docs/sos/native/index.md +5 -0
  18. package/docs/sos/native/mdc.md +240 -0
  19. package/docs/sos/offline/cache.md +183 -0
  20. package/docs/sos/offline/index.md +188 -0
  21. package/docs/sos/osd.md +13 -0
  22. package/docs/sos/proofOfPlay.md +37 -0
  23. package/docs/sos/stream.md +960 -0
  24. package/docs/sos/sync.md +298 -0
  25. package/docs/sos/video.md +285 -0
  26. package/docs/sos_management/app.md +102 -0
  27. package/docs/sos_management/audio.md +29 -0
  28. package/docs/sos_management/debug.md +33 -0
  29. package/docs/sos_management/firmware.md +86 -0
  30. package/docs/sos_management/index.md +212 -0
  31. package/docs/sos_management/network.md +197 -0
  32. package/docs/sos_management/os.md +54 -0
  33. package/docs/sos_management/package.md +33 -0
  34. package/docs/sos_management/power.md +136 -0
  35. package/docs/sos_management/proxy.md +41 -0
  36. package/docs/sos_management/remoteControl.md +72 -0
  37. package/docs/sos_management/screen.md +198 -0
  38. package/docs/sos_management/security.md +47 -0
  39. package/docs/sos_management/time.md +101 -0
  40. package/docs/sos_management/wifi.md +366 -0
  41. package/es6/FrontApplet/Browser/Browser.d.ts +61 -8
  42. package/es6/FrontApplet/Browser/Browser.js +91 -39
  43. package/es6/FrontApplet/Browser/Browser.js.map +1 -1
  44. package/es6/FrontApplet/Browser/events.js +2 -2
  45. package/es6/FrontApplet/Browser/events.js.map +1 -1
  46. package/es6/FrontApplet/Command/Command.d.ts +37 -3
  47. package/es6/FrontApplet/Command/Command.js +49 -20
  48. package/es6/FrontApplet/Command/Command.js.map +1 -1
  49. package/es6/FrontApplet/Command/ICommandEvent.d.ts +6 -2
  50. package/es6/FrontApplet/Connect/Connect.d.ts +3 -0
  51. package/es6/FrontApplet/Connect/Connect.js +55 -7
  52. package/es6/FrontApplet/Connect/Connect.js.map +1 -1
  53. package/es6/FrontApplet/Connect/IConnectMessage.d.ts +1 -1
  54. package/es6/FrontApplet/Debug/Debug.d.ts +15 -1
  55. package/es6/FrontApplet/Debug/Debug.js +27 -17
  56. package/es6/FrontApplet/Debug/Debug.js.map +1 -1
  57. package/es6/FrontApplet/Debug/debugDecorator.d.ts +3 -3
  58. package/es6/FrontApplet/Debug/debugDecorator.js +13 -7
  59. package/es6/FrontApplet/Debug/debugDecorator.js.map +1 -1
  60. package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +23 -0
  61. package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +36 -27
  62. package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
  63. package/es6/FrontApplet/Dimensions/coordinationsHelper.js +1 -2
  64. package/es6/FrontApplet/Dimensions/coordinationsHelper.js.map +1 -1
  65. package/es6/FrontApplet/Display/Display.d.ts +25 -3
  66. package/es6/FrontApplet/Display/Display.js +35 -19
  67. package/es6/FrontApplet/Display/Display.js.map +1 -1
  68. package/es6/FrontApplet/Display/IDisplay.d.ts +3 -1
  69. package/es6/FrontApplet/Error/AppletCommandError.js +12 -3
  70. package/es6/FrontApplet/Error/AppletCommandError.js.map +1 -1
  71. package/es6/FrontApplet/Error/AppletError.js +10 -2
  72. package/es6/FrontApplet/Error/AppletError.js.map +1 -1
  73. package/es6/FrontApplet/Error/AppletHardwareError.js +12 -3
  74. package/es6/FrontApplet/Error/AppletHardwareError.js.map +1 -1
  75. package/es6/FrontApplet/Error/AppletOfflineCacheError.js +10 -2
  76. package/es6/FrontApplet/Error/AppletOfflineCacheError.js.map +1 -1
  77. package/es6/FrontApplet/Error/AppletResourcesError.js +12 -3
  78. package/es6/FrontApplet/Error/AppletResourcesError.js.map +1 -1
  79. package/es6/FrontApplet/Error/AppletSecurityError.js +12 -3
  80. package/es6/FrontApplet/Error/AppletSecurityError.js.map +1 -1
  81. package/es6/FrontApplet/Error/AppletStreamError.js +10 -2
  82. package/es6/FrontApplet/Error/AppletStreamError.js.map +1 -1
  83. package/es6/FrontApplet/Error/AppletVideoError.js +12 -3
  84. package/es6/FrontApplet/Error/AppletVideoError.js.map +1 -1
  85. package/es6/FrontApplet/Error/ErrorCodesMessages.js +4 -1
  86. package/es6/FrontApplet/Error/ErrorCodesMessages.js.map +1 -1
  87. package/es6/FrontApplet/Error/ErrorSuggestions.js +1 -0
  88. package/es6/FrontApplet/Error/ErrorSuggestions.js.map +1 -1
  89. package/es6/FrontApplet/Error/FileNotFoundError.js +10 -2
  90. package/es6/FrontApplet/Error/FileNotFoundError.js.map +1 -1
  91. package/es6/FrontApplet/Error/SosError.js +4 -0
  92. package/es6/FrontApplet/Error/SosError.js.map +1 -1
  93. package/es6/FrontApplet/Error/errorHelper.js +5 -6
  94. package/es6/FrontApplet/Error/errorHelper.js.map +1 -1
  95. package/es6/FrontApplet/Exchange/Exchange.js +7 -14
  96. package/es6/FrontApplet/Exchange/Exchange.js.map +1 -1
  97. package/es6/FrontApplet/FileSystem/FileSystem.d.ts +156 -1
  98. package/es6/FrontApplet/FileSystem/FileSystem.js +316 -193
  99. package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
  100. package/es6/FrontApplet/FileSystem/HashAlgorithm.d.ts +2 -0
  101. package/es6/FrontApplet/{Stream/streamListeners.js → FileSystem/HashAlgorithm.js} +1 -1
  102. package/es6/FrontApplet/FileSystem/HashAlgorithm.js.map +1 -0
  103. package/es6/FrontApplet/Font/fontFaceGenerator.js.map +1 -1
  104. package/es6/FrontApplet/FrontApplet.d.ts +55 -4
  105. package/es6/FrontApplet/FrontApplet.js +124 -47
  106. package/es6/FrontApplet/FrontApplet.js.map +1 -1
  107. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.d.ts +2 -0
  108. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js +35 -54
  109. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js.map +1 -1
  110. package/es6/FrontApplet/Hardware/Hardware.d.ts +16 -2
  111. package/es6/FrontApplet/Hardware/Hardware.js +31 -19
  112. package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
  113. package/es6/FrontApplet/Hardware/IHardware.d.ts +2 -2
  114. package/es6/FrontApplet/Hardware/ISerialPort.d.ts +16 -0
  115. package/es6/FrontApplet/Hardware/ISerialPortOptions.js +1 -1
  116. package/es6/FrontApplet/Hardware/ISerialPortOptions.js.map +1 -1
  117. package/es6/FrontApplet/Hardware/Led/Led.d.ts +8 -0
  118. package/es6/FrontApplet/Hardware/Led/Led.js +20 -18
  119. package/es6/FrontApplet/Hardware/Led/Led.js.map +1 -1
  120. package/es6/FrontApplet/Hardware/SerialPort.d.ts +1 -1
  121. package/es6/FrontApplet/Hardware/SerialPort.js +15 -23
  122. package/es6/FrontApplet/Hardware/SerialPort.js.map +1 -1
  123. package/es6/FrontApplet/Hash/generator.js +1 -2
  124. package/es6/FrontApplet/Hash/generator.js.map +1 -1
  125. package/es6/FrontApplet/Iframe/Iframe.d.ts +9 -8
  126. package/es6/FrontApplet/Iframe/Iframe.js +10 -0
  127. package/es6/FrontApplet/Iframe/Iframe.js.map +1 -1
  128. package/es6/FrontApplet/Input/IInput.d.ts +1 -2
  129. package/es6/FrontApplet/Input/IKeyUpEvent.d.ts +32 -2
  130. package/es6/FrontApplet/Input/IKeyUpEvent.js +32 -0
  131. package/es6/FrontApplet/Input/IKeyUpEvent.js.map +1 -1
  132. package/es6/FrontApplet/Input/Input.d.ts +19 -3
  133. package/es6/FrontApplet/Input/Input.js +43 -22
  134. package/es6/FrontApplet/Input/Input.js.map +1 -1
  135. package/es6/FrontApplet/Management/App/App.d.ts +48 -10
  136. package/es6/FrontApplet/Management/App/App.js +45 -30
  137. package/es6/FrontApplet/Management/App/App.js.map +1 -1
  138. package/es6/FrontApplet/Management/App/IApp.d.ts +3 -1
  139. package/es6/FrontApplet/Management/Audio/Audio.d.ts +16 -0
  140. package/es6/FrontApplet/Management/Audio/Audio.js +30 -22
  141. package/es6/FrontApplet/Management/Audio/Audio.js.map +1 -1
  142. package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.d.ts +4 -0
  143. package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js +15 -22
  144. package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js.map +1 -1
  145. package/es6/FrontApplet/Management/AutoRecovery/IAutoRecovery.js +4 -1
  146. package/es6/FrontApplet/Management/AutoRecovery/IAutoRecovery.js.map +1 -1
  147. package/es6/FrontApplet/Management/Debug/Debug.d.ts +19 -0
  148. package/es6/FrontApplet/Management/Debug/Debug.js +37 -30
  149. package/es6/FrontApplet/Management/Debug/Debug.js.map +1 -1
  150. package/es6/FrontApplet/Management/Firmware/Firmware.d.ts +37 -10
  151. package/es6/FrontApplet/Management/Firmware/Firmware.js +34 -30
  152. package/es6/FrontApplet/Management/Firmware/Firmware.js.map +1 -1
  153. package/es6/FrontApplet/Management/Firmware/IFirmware.d.ts +1 -2
  154. package/es6/FrontApplet/Management/IManagement.d.ts +3 -1
  155. package/es6/FrontApplet/Management/Management.d.ts +106 -15
  156. package/es6/FrontApplet/Management/Management.js +191 -113
  157. package/es6/FrontApplet/Management/Management.js.map +1 -1
  158. package/es6/FrontApplet/Management/Network/INetworkInfo.d.ts +1 -1
  159. package/es6/FrontApplet/Management/Network/Network.d.ts +56 -8
  160. package/es6/FrontApplet/Management/Network/Network.js +85 -67
  161. package/es6/FrontApplet/Management/Network/Network.js.map +1 -1
  162. package/es6/FrontApplet/Management/OS/OS.d.ts +20 -0
  163. package/es6/FrontApplet/Management/OS/OS.js +34 -27
  164. package/es6/FrontApplet/Management/OS/OS.js.map +1 -1
  165. package/es6/FrontApplet/Management/Package/Package.d.ts +20 -0
  166. package/es6/FrontApplet/Management/Package/Package.js +37 -22
  167. package/es6/FrontApplet/Management/Package/Package.js.map +1 -1
  168. package/es6/FrontApplet/Management/PeerRecovery/IPeerRecovery.js +4 -1
  169. package/es6/FrontApplet/Management/PeerRecovery/IPeerRecovery.js.map +1 -1
  170. package/es6/FrontApplet/Management/PeerRecovery/PeerRecovery.d.ts +4 -0
  171. package/es6/FrontApplet/Management/PeerRecovery/PeerRecovery.js +15 -22
  172. package/es6/FrontApplet/Management/PeerRecovery/PeerRecovery.js.map +1 -1
  173. package/es6/FrontApplet/Management/Power/Power.d.ts +64 -0
  174. package/es6/FrontApplet/Management/Power/Power.js +160 -115
  175. package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
  176. package/es6/FrontApplet/Management/Proxy/Proxy.d.ts +21 -0
  177. package/es6/FrontApplet/Management/Proxy/Proxy.js +41 -35
  178. package/es6/FrontApplet/Management/Proxy/Proxy.js.map +1 -1
  179. package/es6/FrontApplet/Management/RemoteControl/RemoteControl.d.ts +43 -0
  180. package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js +63 -39
  181. package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js.map +1 -1
  182. package/es6/FrontApplet/Management/Screen/Screen.d.ts +127 -0
  183. package/es6/FrontApplet/Management/Screen/Screen.js +197 -89
  184. package/es6/FrontApplet/Management/Screen/Screen.js.map +1 -1
  185. package/es6/FrontApplet/Management/Security/Security.d.ts +20 -5
  186. package/es6/FrontApplet/Management/Security/Security.js +33 -31
  187. package/es6/FrontApplet/Management/Security/Security.js.map +1 -1
  188. package/es6/FrontApplet/Management/Time/Time.d.ts +31 -5
  189. package/es6/FrontApplet/Management/Time/Time.js +49 -40
  190. package/es6/FrontApplet/Management/Time/Time.js.map +1 -1
  191. package/es6/FrontApplet/Management/Wifi/IWifiEvent.d.ts +18 -0
  192. package/es6/FrontApplet/Management/Wifi/IWifiEvent.js +19 -1
  193. package/es6/FrontApplet/Management/Wifi/IWifiEvent.js.map +1 -1
  194. package/es6/FrontApplet/Management/Wifi/Wifi.d.ts +108 -7
  195. package/es6/FrontApplet/Management/Wifi/Wifi.js +162 -86
  196. package/es6/FrontApplet/Management/Wifi/Wifi.js.map +1 -1
  197. package/es6/FrontApplet/Management/helpers/DeviceHelper.js +2 -2
  198. package/es6/FrontApplet/Management/helpers/DeviceHelper.js.map +1 -1
  199. package/es6/FrontApplet/Management/helpers/SecurityHelper.js +8 -6
  200. package/es6/FrontApplet/Management/helpers/SecurityHelper.js.map +1 -1
  201. package/es6/FrontApplet/Management/helpers/TimerHelper.js +2 -2
  202. package/es6/FrontApplet/Management/helpers/TimerHelper.js.map +1 -1
  203. package/es6/FrontApplet/Management/helpers/UpgradeHelper.js +35 -3
  204. package/es6/FrontApplet/Management/helpers/UpgradeHelper.js.map +1 -1
  205. package/es6/FrontApplet/Management/helpers/VideoHelper.js +1 -1
  206. package/es6/FrontApplet/Management/helpers/VideoHelper.js.map +1 -1
  207. package/es6/FrontApplet/Monitors/Monitors.d.ts +9 -0
  208. package/es6/FrontApplet/Monitors/Monitors.js +16 -16
  209. package/es6/FrontApplet/Monitors/Monitors.js.map +1 -1
  210. package/es6/FrontApplet/NativeCommands/MDC/CodesMDC.js +1 -1
  211. package/es6/FrontApplet/NativeCommands/MDC/CodesMDC.js.map +1 -1
  212. package/es6/FrontApplet/NativeCommands/MDC/Mdc.d.ts +51 -2
  213. package/es6/FrontApplet/NativeCommands/MDC/Mdc.js +79 -38
  214. package/es6/FrontApplet/NativeCommands/MDC/Mdc.js.map +1 -1
  215. package/es6/FrontApplet/NativeCommands/NativeCommands.d.ts +4 -0
  216. package/es6/FrontApplet/NativeCommands/NativeCommands.js +12 -2
  217. package/es6/FrontApplet/NativeCommands/NativeCommands.js.map +1 -1
  218. package/es6/FrontApplet/OSD/OSD.d.ts +9 -0
  219. package/es6/FrontApplet/OSD/OSD.js +15 -15
  220. package/es6/FrontApplet/OSD/OSD.js.map +1 -1
  221. package/es6/FrontApplet/Offline/Cache/Cache.d.ts +91 -2
  222. package/es6/FrontApplet/Offline/Cache/Cache.js +192 -130
  223. package/es6/FrontApplet/Offline/Cache/Cache.js.map +1 -1
  224. package/es6/FrontApplet/Offline/Flags/AppendFlagController.d.ts +1 -1
  225. package/es6/FrontApplet/Offline/Flags/AppendFlagController.js +17 -25
  226. package/es6/FrontApplet/Offline/Flags/AppendFlagController.js.map +1 -1
  227. package/es6/FrontApplet/Offline/Flags/IFlags.d.ts +4 -4
  228. package/es6/FrontApplet/Offline/IAddFont.d.ts +3 -1
  229. package/es6/FrontApplet/Offline/IAddFont.js.map +1 -1
  230. package/es6/FrontApplet/Offline/ISaveFile.js +5 -2
  231. package/es6/FrontApplet/Offline/ISaveFile.js.map +1 -1
  232. package/es6/FrontApplet/Offline/LoadFile/CssLoadFileController.js +2 -1
  233. package/es6/FrontApplet/Offline/LoadFile/CssLoadFileController.js.map +1 -1
  234. package/es6/FrontApplet/Offline/LoadFile/JavascriptLoadFileController.js +2 -1
  235. package/es6/FrontApplet/Offline/LoadFile/JavascriptLoadFileController.js.map +1 -1
  236. package/es6/FrontApplet/Offline/Offline.d.ts +75 -4
  237. package/es6/FrontApplet/Offline/Offline.js +116 -56
  238. package/es6/FrontApplet/Offline/Offline.js.map +1 -1
  239. package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.d.ts +19 -1
  240. package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js +41 -29
  241. package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -1
  242. package/es6/FrontApplet/Sensors/Proximity.d.ts +4 -3
  243. package/es6/FrontApplet/Sensors/Proximity.js +12 -4
  244. package/es6/FrontApplet/Sensors/Proximity.js.map +1 -1
  245. package/es6/FrontApplet/Sensors/Sensors.d.ts +2 -0
  246. package/es6/FrontApplet/Sensors/Sensors.js +9 -2
  247. package/es6/FrontApplet/Sensors/Sensors.js.map +1 -1
  248. package/es6/FrontApplet/Stream/IStream.d.ts +10 -10
  249. package/es6/FrontApplet/Stream/Stream.d.ts +130 -15
  250. package/es6/FrontApplet/Stream/Stream.js +229 -130
  251. package/es6/FrontApplet/Stream/Stream.js.map +1 -1
  252. package/es6/FrontApplet/Stream/StreamProtocol.js.map +1 -1
  253. package/es6/FrontApplet/Sync/Sync.d.ts +152 -6
  254. package/es6/FrontApplet/Sync/Sync.js +196 -112
  255. package/es6/FrontApplet/Sync/Sync.js.map +1 -1
  256. package/es6/FrontApplet/Sync/syncEvents.d.ts +3 -1
  257. package/es6/FrontApplet/Sync/syncMessages.js +1 -1
  258. package/es6/FrontApplet/Sync/syncMessages.js.map +1 -1
  259. package/es6/FrontApplet/Timing/Timing.d.ts +1 -0
  260. package/es6/FrontApplet/Timing/Timing.js +9 -2
  261. package/es6/FrontApplet/Timing/Timing.js.map +1 -1
  262. package/es6/FrontApplet/Timing/Triggers/ITimingTriggersMessage.d.ts +1 -1
  263. package/es6/FrontApplet/Timing/Triggers/Triggers.d.ts +9 -0
  264. package/es6/FrontApplet/Timing/Triggers/Triggers.js +16 -18
  265. package/es6/FrontApplet/Timing/Triggers/Triggers.js.map +1 -1
  266. package/es6/FrontApplet/Touch/Touch.d.ts +3 -0
  267. package/es6/FrontApplet/Touch/Touch.js +13 -3
  268. package/es6/FrontApplet/Touch/Touch.js.map +1 -1
  269. package/es6/FrontApplet/Validate/Validate.js +14 -11
  270. package/es6/FrontApplet/Validate/Validate.js.map +1 -1
  271. package/es6/FrontApplet/Validate/ValidateObjectInterface.js +7 -2
  272. package/es6/FrontApplet/Validate/ValidateObjectInterface.js.map +1 -1
  273. package/es6/FrontApplet/Video/IOptions.d.ts +8 -1
  274. package/es6/FrontApplet/Video/IVideo.d.ts +8 -8
  275. package/es6/FrontApplet/Video/IVideoEvent.js +3 -3
  276. package/es6/FrontApplet/Video/IVideoEvent.js.map +1 -1
  277. package/es6/FrontApplet/Video/Video.d.ts +84 -12
  278. package/es6/FrontApplet/Video/Video.js +161 -102
  279. package/es6/FrontApplet/Video/Video.js.map +1 -1
  280. package/es6/FrontApplet/createFrontApplet.js +5 -2
  281. package/es6/FrontApplet/createFrontApplet.js.map +1 -1
  282. package/es6/Monitoring/Display/handleDisplayRequests.d.ts +2 -2
  283. package/es6/Monitoring/Display/handleDisplayRequests.js +5 -15
  284. package/es6/Monitoring/Display/handleDisplayRequests.js.map +1 -1
  285. package/es6/Monitoring/FileSystem/fileSystemCommands.d.ts +10 -1
  286. package/es6/Monitoring/FileSystem/fileSystemCommands.js +3 -1
  287. package/es6/Monitoring/FileSystem/fileSystemCommands.js.map +1 -1
  288. package/es6/Monitoring/FileSystem/handleFileSystemRequests.d.ts +2 -2
  289. package/es6/Monitoring/FileSystem/handleFileSystemRequests.js +41 -45
  290. package/es6/Monitoring/FileSystem/handleFileSystemRequests.js.map +1 -1
  291. package/es6/Monitoring/Html/handleHtmlSnapshotTakingRequests.d.ts +2 -2
  292. package/es6/Monitoring/Html/handleHtmlSnapshotTakingRequests.js +4 -14
  293. package/es6/Monitoring/Html/handleHtmlSnapshotTakingRequests.js.map +1 -1
  294. package/es6/Monitoring/Management/App/handleApplicationRequests.d.ts +2 -2
  295. package/es6/Monitoring/Management/App/handleApplicationRequests.js +9 -19
  296. package/es6/Monitoring/Management/App/handleApplicationRequests.js.map +1 -1
  297. package/es6/Monitoring/Management/Audio/handleAudioRequests.d.ts +2 -2
  298. package/es6/Monitoring/Management/Audio/handleAudioRequests.js +7 -17
  299. package/es6/Monitoring/Management/Audio/handleAudioRequests.js.map +1 -1
  300. package/es6/Monitoring/Management/AutoRecovery/handleAutoRecoveryRequests.d.ts +2 -2
  301. package/es6/Monitoring/Management/AutoRecovery/handleAutoRecoveryRequests.js +7 -17
  302. package/es6/Monitoring/Management/AutoRecovery/handleAutoRecoveryRequests.js.map +1 -1
  303. package/es6/Monitoring/Management/Debug/handleDebugRequests.d.ts +2 -2
  304. package/es6/Monitoring/Management/Debug/handleDebugRequests.js +9 -19
  305. package/es6/Monitoring/Management/Debug/handleDebugRequests.js.map +1 -1
  306. package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.d.ts +2 -2
  307. package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.js +11 -21
  308. package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.js.map +1 -1
  309. package/es6/Monitoring/Management/Os/managementOsRequests.d.ts +2 -2
  310. package/es6/Monitoring/Management/Os/managementOsRequests.js +9 -19
  311. package/es6/Monitoring/Management/Os/managementOsRequests.js.map +1 -1
  312. package/es6/Monitoring/Management/PeerRecovery/handlePeerRecoveryRequests.d.ts +2 -2
  313. package/es6/Monitoring/Management/PeerRecovery/handlePeerRecoveryRequests.js +7 -17
  314. package/es6/Monitoring/Management/PeerRecovery/handlePeerRecoveryRequests.js.map +1 -1
  315. package/es6/Monitoring/Management/Power/handlePowerRequests.d.ts +2 -2
  316. package/es6/Monitoring/Management/Power/handlePowerRequests.js +19 -29
  317. package/es6/Monitoring/Management/Power/handlePowerRequests.js.map +1 -1
  318. package/es6/Monitoring/Management/RemoteControl/handleRemoteControlRequests.d.ts +2 -2
  319. package/es6/Monitoring/Management/RemoteControl/handleRemoteControlRequests.js +15 -25
  320. package/es6/Monitoring/Management/RemoteControl/handleRemoteControlRequests.js.map +1 -1
  321. package/es6/Monitoring/Management/Screen/handleScreenRequests.d.ts +2 -2
  322. package/es6/Monitoring/Management/Screen/handleScreenRequests.js +19 -29
  323. package/es6/Monitoring/Management/Screen/handleScreenRequests.js.map +1 -1
  324. package/es6/Monitoring/Management/Security/handleSecurityCommands.d.ts +2 -2
  325. package/es6/Monitoring/Management/Security/handleSecurityCommands.js +9 -19
  326. package/es6/Monitoring/Management/Security/handleSecurityCommands.js.map +1 -1
  327. package/es6/Monitoring/Management/Time/handleTimeCommands.d.ts +2 -2
  328. package/es6/Monitoring/Management/Time/handleTimeCommands.js +9 -19
  329. package/es6/Monitoring/Management/Time/handleTimeCommands.js.map +1 -1
  330. package/es6/Monitoring/Management/handleManagementRequests.d.ts +2 -2
  331. package/es6/Monitoring/Management/handleManagementRequests.js +23 -33
  332. package/es6/Monitoring/Management/handleManagementRequests.js.map +1 -1
  333. package/es6/Monitoring/{Montoring.d.ts → Monitoring.d.ts} +1 -0
  334. package/es6/Monitoring/{Montoring.js → Monitoring.js} +12 -23
  335. package/es6/Monitoring/Monitoring.js.map +1 -0
  336. package/es6/Monitoring/NativeCommands/handleNativeCommands.d.ts +2 -2
  337. package/es6/Monitoring/NativeCommands/handleNativeCommands.js +5 -15
  338. package/es6/Monitoring/NativeCommands/handleNativeCommands.js.map +1 -1
  339. package/es6/Monitoring/OSD/handleOsdRequests.d.ts +2 -2
  340. package/es6/Monitoring/OSD/handleOsdRequests.js +5 -15
  341. package/es6/Monitoring/OSD/handleOsdRequests.js.map +1 -1
  342. package/es6/Monitoring/Offline/Cache/handleOfflineCacheRequests.d.ts +2 -2
  343. package/es6/Monitoring/Offline/Cache/handleOfflineCacheRequests.js +23 -33
  344. package/es6/Monitoring/Offline/Cache/handleOfflineCacheRequests.js.map +1 -1
  345. package/es6/Monitoring/Video/handleVideoRequests.d.ts +2 -2
  346. package/es6/Monitoring/Video/handleVideoRequests.js +36 -9
  347. package/es6/Monitoring/Video/handleVideoRequests.js.map +1 -1
  348. package/es6/Monitoring/handleMonitoringRequests.d.ts +2 -2
  349. package/es6/Monitoring/handleMonitoringRequests.js +6 -16
  350. package/es6/Monitoring/handleMonitoringRequests.js.map +1 -1
  351. package/es6/Sensors/IButton.js +1 -1
  352. package/es6/Sensors/IButton.js.map +1 -1
  353. package/es6/Sensors/IRfidAntenna.js +1 -1
  354. package/es6/Sensors/IRfidAntenna.js.map +1 -1
  355. package/es6/Util/Console/enhancer.js +1 -2
  356. package/es6/Util/Console/enhancer.js.map +1 -1
  357. package/es6/bundle.d.ts +1 -1
  358. package/es6/bundle.js +6 -3
  359. package/es6/bundle.js.map +1 -1
  360. package/es6/fpath.js +34 -1
  361. package/es6/fpath.js.map +1 -1
  362. package/es6/utils/types.d.ts +1 -0
  363. package/es6/{FrontApplet/Input/IKeyUpEventListener.js → utils/types.js} +1 -1
  364. package/es6/utils/types.js.map +1 -0
  365. package/package.json +27 -25
  366. package/CHANGELOG.md +0 -484
  367. package/docs/applet-basics.md +0 -272
  368. package/docs/content/js-applet-resources.md +0 -154
  369. package/docs/content/js-browser.md +0 -163
  370. package/docs/content/js-command.md +0 -154
  371. package/docs/content/js-debug.md +0 -36
  372. package/docs/content/js-device-info.md +0 -56
  373. package/docs/content/js-display.md +0 -56
  374. package/docs/content/js-file-system.md +0 -670
  375. package/docs/content/js-fonts.md +0 -115
  376. package/docs/content/js-hardware.md +0 -55
  377. package/docs/content/js-iframes.md +0 -66
  378. package/docs/content/js-input.md +0 -71
  379. package/docs/content/js-offline-cache-media-files.md +0 -257
  380. package/docs/content/js-offline-cache-simple-data.md +0 -129
  381. package/docs/content/js-osd.md +0 -32
  382. package/docs/content/js-proof-of-play.md +0 -60
  383. package/docs/content/js-sensors.md +0 -70
  384. package/docs/content/js-serial.md +0 -165
  385. package/docs/content/js-sync-playback.md +0 -384
  386. package/docs/content/js-video-inputs-internal-ports.md +0 -131
  387. package/docs/content/js-video-stream.md +0 -618
  388. package/docs/content/js-video.md +0 -232
  389. package/docs/management/js-management-application.md +0 -107
  390. package/docs/management/js-management-audio.md +0 -44
  391. package/docs/management/js-management-debug.md +0 -40
  392. package/docs/management/js-management-firmware.md +0 -93
  393. package/docs/management/js-management-management.md +0 -178
  394. package/docs/management/js-management-monitoring-commands.md +0 -107
  395. package/docs/management/js-management-monitors.md +0 -55
  396. package/docs/management/js-management-native-commands-mdc.md +0 -90
  397. package/docs/management/js-management-network.md +0 -223
  398. package/docs/management/js-management-os.md +0 -62
  399. package/docs/management/js-management-package.md +0 -48
  400. package/docs/management/js-management-power.md +0 -175
  401. package/docs/management/js-management-proxy.md +0 -81
  402. package/docs/management/js-management-remote-control.md +0 -58
  403. package/docs/management/js-management-screen.md +0 -225
  404. package/docs/management/js-management-security.md +0 -71
  405. package/docs/management/js-management-time.md +0 -161
  406. package/docs/management/js-management-wifi.md +0 -341
  407. package/es6/FrontApplet/Command/ICommandEventListener.d.ts +0 -6
  408. package/es6/FrontApplet/Command/ICommandEventListener.js +0 -3
  409. package/es6/FrontApplet/Command/ICommandEventListener.js.map +0 -1
  410. package/es6/FrontApplet/Input/IKeyUpEventListener.d.ts +0 -5
  411. package/es6/FrontApplet/Input/IKeyUpEventListener.js.map +0 -1
  412. package/es6/FrontApplet/Management/Firmware/FirmwareType.d.ts +0 -4
  413. package/es6/FrontApplet/Management/Firmware/FirmwareType.js +0 -9
  414. package/es6/FrontApplet/Management/Firmware/FirmwareType.js.map +0 -1
  415. package/es6/FrontApplet/Stream/streamListeners.d.ts +0 -10
  416. package/es6/FrontApplet/Stream/streamListeners.js.map +0 -1
  417. package/es6/FrontApplet/Video/IVideoEventListener.d.ts +0 -5
  418. package/es6/FrontApplet/Video/IVideoEventListener.js +0 -3
  419. package/es6/FrontApplet/Video/IVideoEventListener.js.map +0 -1
  420. package/es6/Monitoring/Montoring.js.map +0 -1
@@ -1,115 +0,0 @@
1
- ---
2
- title: Fonts
3
- author: Miroslav Behina
4
- date: 22.11.2018
5
- type: js-api
6
- tags:
7
- - applet
8
- - applet_api
9
- - api
10
- - js_api
11
- description: "[Content JS API] When working with custom font families, you should use this method that downloads fonts into offline storage and generates the appropriate font-face definition."
12
- ---
13
-
14
- # Loading fonts
15
- When working with custom font families, you should use this method that downloads fonts into offline storage and generates the appropriate font-face definition.
16
-
17
- ## All methods
18
-
19
- | Method | Description | Supported since |
20
- | ------ | -------- | :----------: |
21
- | `addFont()` | Load additionally font into applet cache | 2.0.0 |
22
-
23
-
24
- ## addFont()
25
-
26
- Load your custom fonts into the Applet.
27
-
28
- ### Parameters
29
- | Param | Type | Required | Description |
30
- | ------- | --------- | :----------: | ------ |
31
- | `uid` | string | <div class="red">Yes</div> | Unique file identifier is used for later file retrieval, must contain a-z,A-Z,0-9 and . characters |
32
- | `append` | HTMLElement | <div class="red">Yes</div> |Reference to HTMLElement where the generated font-face will resist |
33
- | `fontFamily` | string | <div class="yellow">No</div> | Font family that can be referenced from your CSS |
34
- | `formats` | object | <div class="yellow">No</div> | URI where these formats will be downloaded from |
35
- | `fontStretch` | string | <div class="yellow">No</div> | Allows you to make text wider or narrower |
36
- | `fontStyle` | string | <div class="yellow">No</div> | Apecifies the font stlye for a text |
37
- |^^|^^|^^| Types: `normal`, `italic`, `oblique`, `initial`, `inherit` |
38
- | `fontWeight` | string | <div class="yellow">No</div> | Sets how thick or thin characters in text should be displayed |
39
- | `unicodeRage` | string | <div class="yellow">No</div> | Defines the range of unicode characters the font supports, default value is "U+0-10FFFF"
40
-
41
- ### Formats parameters
42
- | Param | Type | Required | Description |
43
- | ------- | --------- | :----------: | ------ |
44
- | `woff2` | String | <div class="yellow">No</div> | URI points to woff2 file |
45
- | `woff` | String | <div class="yellow">No</div> | URI points to woff file |
46
- | `svg` | String | <div class="yellow">No</div> | URI points to svg file |
47
- | `ttf` | String | <div class="yellow">No</div> | URI points to ttf file |
48
- | `eot` | String | <div class="yellow">No</div> | URI points to eot file |
49
-
50
- ### Javascript Example
51
- ```javascript
52
- await sos.offline.addFont({
53
- uid: 'my-tondo-font',
54
- fontFamily: 'tondo',
55
- fontStretch: 'normal',
56
- fontStyle: 'normal',
57
- fontWeight: 'bold',
58
- unicodeRange: 'U+0-10FFFF',
59
- formats: {
60
- woff2: 'https://mycms.signageos.io/fonts/tondo-woff2',
61
- eot: 'https://mycms.signageos.io/fonts/tondo-eot',
62
- ttf: 'https://mycms.signageos.io/fonts/tondo-ttf',
63
- svg: 'https://mycms.signageos.io/fonts/tondo-svg',
64
- woff: 'https://mycms.signageos.io/fonts/tondo-woff',
65
- },
66
- append: document.body,
67
- })
68
- .then(() => {
69
- console.log('Generated');
70
- });
71
- ```
72
-
73
- :::info
74
- Most properties follow the official CSS properties found on [Mozilla Developer Page](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face)
75
- :::
76
-
77
-
78
- :::note[GitHub Example]
79
- [Example of Applet that load custom fonts](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/fonts)
80
- :::
81
-
82
- ## Usage with Typescript
83
- You can also use all these methods with [signageOS TypeScript](https://docs.signageos.io/hc/en-us/articles/4405069154962#signageos-typescript).
84
-
85
- ```typescript
86
- addFont(
87
- uid: string;
88
- append: HTMLElement;
89
- fontFamily: string;
90
- formats: {
91
- woff2: string;
92
- woff?: string;
93
- svg?: string;
94
- ttf?: string;
95
- svg?: string;
96
- },
97
- fontStretch?: string;
98
- fontStyle?: 'normal' | 'italic' | 'oblique' | 'initial' | 'inherit';
99
- fontWeight?: string;
100
- unicodeRange?: string;
101
- );
102
- ```
103
-
104
- ## Errors
105
- Although we are doing our best, following errors may occur when working with the Applet Resources.
106
-
107
-
108
- | Code | Type | Message |
109
- | ---- | ---- | ------- |
110
- | 40105 | AppletResourcesError | Already loading file: `$$FILE_NAME$$` |
111
- |^^|^^| Please, check your code for multiple occurrences of addFile/s methods. |
112
- | 40106 | AppletResourcesError | Already existing file: `$$FILE_NAME$$` |
113
- |^^|^^| Please, check your code for occurrences of addFile/s methods on lines before this error. |
114
- | 49901 | AppletResourceError | Please, check if the used URL is correct. |
115
- | 49902 | FileNotFoundError | File was not found `$$FILE_ID$$`
@@ -1,55 +0,0 @@
1
- ---
2
- title: Hardware
3
- author: Miroslav Behina
4
- date: 22.11.2018
5
- type: js-api
6
- tags:
7
- - applet
8
- - applet_api
9
- - api
10
- - philips
11
- - led
12
- - js_api
13
- description: "[Content JS API] Some platforms support special hardware, that can be easily managed by JS using sOS hardware API."
14
- ---
15
-
16
- # Hardware
17
- Some platforms support special hardware, that can be easily managed by JS using sOS hardware API.
18
-
19
-
20
- ## LED
21
-
22
- Some Philips brand devices have LED lights built into them. The color of lights can be changed or disabled:
23
-
24
- ### All methods
25
-
26
-
27
- | Method | Description | Supported since |
28
- | ------ | -------- | :---------: |
29
- | `setColor()` | Method supports a string in hexa format to display color of LED light or null value to not be disabled | 1.0.1
30
-
31
- ### setColor()
32
-
33
-
34
- | Param | Type | Required | Description |
35
- | ------ | ------ | :--------: | -------- |
36
- | `color` | string | <div class="red">Yes</div> | Color of LED to be set in CSS hexa format `#000000`. To disable LED pass null value instead.
37
-
38
- #### Javascript example
39
- ```javascript
40
- sos.hardware.led.setColor("#00FF00"); // For GREEN light
41
- ```
42
-
43
- :::note[GitHub Example]
44
- [Example of Applet with LED usage](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/hardware-led)
45
- :::
46
-
47
- ## Errors
48
- Although we are doing our best, following errors may occur when working with the hardware.
49
-
50
-
51
- | Code | Type | Message |
52
- | ---- | ---- | ------- |
53
- | 50601 | InternalHardwareError | Unexpected error occurred when working with hardware. |
54
- | 40601 | AppletHardwareError | Color must be string |
55
- | 40602 | AppletHardwareError | Color must be in format #000000 or null, allowed are `/^[a-zA-Z0-9\.\-_]+$/g`
@@ -1,66 +0,0 @@
1
- ---
2
- title: Iframes
3
- author: Josef Král
4
- date: 7.9.2020
5
- type: js-api
6
- tags:
7
- - applet
8
- - applet_api
9
- - api
10
- - js_api
11
- - iframe
12
- description: "[Content JS API] We **do not recommend** to use iframes inside your Applet. However, if you have to use it, you can add full support of the sOS JS API to every one of your iframe. Just add the JS snippet script below to every page load in iframe before ending &lt;/body>. Everything will be prepared, and you can call the very same methods as described for Applet."
13
- ---
14
-
15
- # Iframes
16
- We **recommend limiting the use of iframes** inside your Applet to avoid performance hiccups. However, if you you are leveraging iframes, you can also add full support of the sOS JS API within the iframe context. Add the JS snippet script below to every page load in iframe before ending &lt;/body>. Everything will be prepared, and you can call the very same methods as described for Applet.
17
-
18
- :::warning
19
- The signageOS Snippet and API works **ONLY** if the iframe is served from the display's internal storage - `<iframe src="file://...`. If your iframe is served from a live URL - `<iframe src="https://your-iframe-url"...` the snippet and signageOS API will **NOT** work. This is a security limitation to prevent random site took advantage of the API and alter the display behavior. There is a simple way to [save and load your iframe from the internal storage](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/iframes). Just make sure you are using full paths in your iframe for linking javascripts and css instead of the relative ones.
20
-
21
- If your device can not load a file stored in local storage, such as an html, you can try to use an alternative instead of python to zip the file when you are preparing the applet.
22
- :::
23
-
24
- ## Create applet
25
- First applet, what will be as iframe in main applet. There is also **required event listener** to work iframes in an applet. Insert this snippet on bottom of iframe applet code.
26
- ```javascript
27
- <script type="text/javascript">
28
- // sOS JS API loader
29
- !function(){window.addEventListener("message",function(t){
30
- if(t.source===window.parent&&"hug.api_js_uri"===t.data.type) {
31
- var e=t.data.uri;
32
- if(!e)throw new Error("Front applet JS is not set.");
33
- var a=document.createElement("script");
34
- a.setAttribute("type","text/javascript"),a.setAttribute("src",e),a.onload=a.onreadystatechange=function(){
35
- this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(window.sos.apiJsUri=t.data.uri,window.dispatchEvent(new Event("hug.loaded")),window.dispatchEvent(new Event("sos.loaded")))},document.head.appendChild(a)}}),window.parent.postMessage({type:"hug_loader.ready"},"*")}();
36
- </script>
37
- ```
38
-
39
- :::note[GitHub Example]
40
- [Applet that will be in Iframe](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/iframes)
41
- :::
42
-
43
- ## Finally, use created applet in another applet as iframe.
44
-
45
- ```javascript
46
- window.addEventListener('sos.loaded', () => {
47
- sos.onReady().then(() => {
48
- const contentElement = document.getElementById('index');
49
- const iframeElement = document.getElementById('iframe');
50
- sos.onReady();
51
-
52
- // Download created iframe into main applet
53
- const iframeUri = sos.config.iframeUri || 'https://raw.githubusercontent.com/signageos/applet-examples/master/examples/iframes/iframe.html';
54
- const { filePath } = sos.offline.cache.loadOrSaveFile('iframe.html', iframeUri);
55
-
56
- // Setup iframe
57
- contentElement.innerHTML = '';
58
- iframeElement.src = filePath;
59
- iframeElement.style.display = 'block';
60
- });
61
- });
62
- ```
63
-
64
- :::note[GitHub Example]
65
- [How to use Iframes in Applet](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/iframes)
66
- :::
@@ -1,71 +0,0 @@
1
- ---
2
- title: IR Remote Control Input
3
- author: Miroslav Behina
4
- date: 22.11.2018
5
- type: js-api
6
- tags:
7
- - applet
8
- - applet_api
9
- - api
10
- - js_api
11
- description: "[Content JS API] For the specific logic of an application (games for example), binding the remote control inputs can be helpful."
12
- ---
13
-
14
- # IR Remote Control Input
15
- For the specific logic of an application (games for example), binding the remote control inputs can be helpful.
16
- Only a subset of all remote control keys is supported on the specific device. Only numerical digits are guaranteed to be supported.
17
- This feature must be tested by users on real devices.
18
-
19
- ## Event onKeyUp()
20
-
21
- ### Parameters
22
-
23
-
24
- | Parameters | Type | Required | Description | Supported Since |
25
- | ------ | ------ | :--------: | -------- | :-----: |
26
- | event (in listener) | Object | <div class="red">Yes</div> | Plain JS object containing keyCode as number and keyName as string and type of event (always keyup string) | 1.3.0
27
-
28
- ### Javascript syntax
29
- ```javascript
30
- await sos.input.onKeyUp((keyUpEvent) => {
31
- console.log(`Pressed: ${keyUpEvent.keyCode} (${keyUpEvent.keyName})`);
32
- });
33
- ```
34
-
35
- ## Map of keyCodes:
36
- | Name | Key code | Name | Key Code |
37
- | ---- | :----: | ----- | :----: |
38
- | UNKNOWN | 0 | OK | 15 |
39
- | NUM_0 | 1 | YELLOW | 16 |
40
- | NUM_1 | 2 | BLUE | 17 |
41
- | NUM_2 | 3 | RED | 18 |
42
- | NUM_3 | 4 | GREEN | 19 |
43
- | NUM_4 | 5 | VOLUME_DOWN | 20 |
44
- | NUM_5 | 6 | VOLUME_UP | 30 |
45
- | NUM_6 | 7 | POWER | 31 |
46
- | NUM_7 | 8 | POWER_OFF | 32 |
47
- | NUM_8 | 9 | HOME | 33 |
48
- | NUM_9 | 10 | EXIT | 34 |
49
- | ARROW_LEFT | 11 | RETURN | 35 |
50
- | ARROW_UP | 12 | BACKSPACE | 36 |
51
- | ARROW_RIGHT | 13 | LOCK | 37 |
52
- | ARROW_DOWN | 14 | | |
53
-
54
- ## Usage with Typescript
55
- You can also use all these methods with [signageOS TypeScript](https://docs.signageos.io/hc/en-us/articles/4405069154962#signageos-typescript).
56
-
57
- ```typescript
58
- interface IKeyUpEvent {
59
- type: 'keyup';
60
- keyCode: number;
61
- keyName: string;
62
- }
63
- interface IKeyUpEventListener {
64
- (event: IKeyUpEvent): void;
65
- }
66
- onKeyUp(listener: IKeyUpEventListener): void;
67
- ```
68
-
69
- :::note[GitHub Example]
70
- [IR Input handling](https://github.com/signageos/applet-examples/tree/master/examples/content-js-api/remote-control)
71
- :::
@@ -1,257 +0,0 @@
1
- ---
2
- title: Offline Cache for media files
3
- author: Miroslav Behina
4
- date: 22.11.2018
5
- type: js-api
6
- tags:
7
- - applet
8
- - applet_api
9
- - api
10
- - js_api
11
- description: "[Content JS API] File API allows files (video files, media files etc.) to be stored for offline usage."
12
- ---
13
-
14
- # Offline Cache for media files (File API)
15
- File API allows files (video files, media files etc.) to be stored for offline usage.
16
-
17
- ## All methods
18
-
19
- | Methods | Description | Supported since |
20
- | ------ | -------- | :-------------: |
21
- | `listFiles()` | Return list of files of existing directory | 2.0.0 |
22
- | `saveFile()` | Download file to selected directory | 1.0.3 |
23
- | `loadFile()` | Load file from cache | 1.0.3 |
24
- | `loadOrSaveFile()` | Download and load file from directory | 1.0.9 |
25
- | `deleteFile()` | Delete file from directory | 2.0.0 |
26
- | `getChecksumFile()` | Get checksum of a file | 2.0.0 |
27
- | `validateChecksumFile()` | Validate that file's checksum matches expected value | 2.0.0 |
28
- | `decompressFile()` | Decompress a compressed file or archive | 2.1.0 |
29
-
30
- :::warning
31
- Emulator has certain limitations while handling offline files. [Read more here](https://docs.signageos.io/hc/en-us/articles/4405238997138)
32
- :::
33
-
34
- ## listFiles()
35
- This method is used to get a list of uids of all files, saved by the current applet.
36
-
37
- ### Javascript example
38
- ```javascript
39
- // List uids of all files
40
- await sos.offline.cache.listFiles().then((fileUids) => {
41
- console.log("Loaded", fileUids);
42
- }).catch((error) => { console.error(error); });
43
- ```
44
- ### Returns
45
- ```javascript
46
- ["video-3", "video-2", "video-1", "image-9", "image-8", "image-7", "image-6", "image-5", "image-4", "image-3", "image-2", "image-13", "image-12", "image-11", "image-10", "image-1"]
47
- ```
48
-
49
-
50
- ## saveFile()
51
- Method `saveFile()` is used to save files from remote a destination into the device internal memory.
52
-
53
- ### Parameters
54
-
55
-
56
- | Param | Type | Required | Description |
57
- | ---------------- | --------------------- | :------: |---------------------------------------------- |
58
- | `uid` | string | <div class="red">Yes</div> | Unique file identifier is used for later file retrieval, must contain a-z,A-Z,0-9 and . characters, slash / is supported since Front-display version 6.0.0 |
59
- | `uri` | string | <div class="red">Yes</div> | URL address to retrieve the file |
60
- | `headers` | object | <div class="yellow">No</div> | Key, value pairs of HTTP headers to send along with the request. Used when the target file is protected by a password or if any other specific headers are needed to access it.
61
-
62
- :::warning
63
- `headers` has to be a JSON object. If you are passing the value, make sure you use `JSON.parse()`.
64
- :::
65
-
66
- :::warning
67
- `uid` should have the same file extension (e.g.: mp4, svg, jpg) as the original file.
68
- :::
69
-
70
- ### Javascript example
71
- ```javascript
72
- // Example saving files into internal memory, unique id could be salted md5 hash, uri directs to our CDN
73
- await sos.offline.cache.saveFile('9d66725ba2105f1833731ade5b7f334e.mp4', 'https://cdn.my-cms.com/files/video.mp4', { "Authorization": "Basic Zm9vOmJhcg==" })
74
- .then(() => { console.log('Saved'); })
75
- .catch((error) => { console.error(error); });
76
- ```
77
-
78
- :::info
79
- Local device file path differs from device to device. It can point to file:// or http://localhost etc.
80
- :::
81
-
82
- ## loadFile()
83
- Method `loadFile()` is used for individual file retrieval from internal memory.
84
-
85
- ### Parameters
86
-
87
- | Param | Type | Required | Description |
88
- | --------- | ------------ | :---------: | --------------- |
89
- | `uid` | string | <div class="red">Yes</div> | Unique file identifier is used for later file retrieval, must contain a-z,A-Z,0-9 and . characters |
90
-
91
- :::warning
92
- `uid` should have the same file extension (e.g.: mp4, svg, jpg) as the original file.
93
- :::
94
-
95
- ### Javascript Example
96
- ```javascript
97
- await sos.offline.cache.loadFile('9d66725ba2105f1833731ade5b7f334e.mp4')
98
- .then((file) => { console.log('Loaded', file); })
99
- .catch((error) => { console.error(error); });
100
-
101
- // Logs into console
102
- {
103
- filePath: '/real/device/path/to/file/9d66725ba2105f1833731ade5b7f334e.mp4',
104
- }
105
- ```
106
-
107
- :::info
108
- Local device file path differs from device to device. It can point to file:// or http://localhost etc.
109
- :::
110
-
111
- ### Returns
112
- * SUCCESS: File object
113
- * FAIL: No file of such uid is available, it throws error into promise
114
-
115
- ## loadOrSaveFile()
116
- Method `loadOrSaveFile()` is used for individual file retrieval & save in case when file is not saved in local storage yet.
117
- To get file from internal memory & save it when not yet exists we prepared `loadOrSaveFile()` method:
118
-
119
- :::info
120
- * The file URI has to return the file. If your URI leads to a 303 redirect (e.g. from http to http**s**), the API will not work.
121
- * Emulator has certain limitations while handling offline files. [Read more here](https://docs.signageos.io/hc/en-us/articles/4405238997138)
122
- :::
123
-
124
- ### Parameters
125
-
126
- | Param | Type | Required | Description |
127
- | --------------- | -------------- | :-------: |---------------------------------------------- |
128
- | `uid` | string | <div class="red">Yes</div> | Unique file identifier is used for later file retrieval, must contain a-z,A-Z,0-9 and . characters |
129
- | `uri` | string | <div class="red">Yes</div> | URL address where to get the file |
130
- | `headers` | object | <div class="yellow">No</div> | Key, value pairs of HTTP headers to send along with the request. Used when the target file is protected by a password or if any other specific headers are needed to access it. |
131
-
132
- :::warning
133
- `uid` should have the same file extension (e.g.: mp4, svg, jpg) as the original file.
134
- :::
135
-
136
- ### Javascript Example
137
- ```javascript
138
- await sos.offline.cache.loadOrSaveFile('9d66725ba2105f1833731ade5b7f334e.mp4', 'https://cdn.my-cms.com/files/video.mp4', { "Authorization": "Basic Zm9vOmJhcg==" })
139
- .then((file) => { console.log('Loaded or Saved', file); })
140
- .catch((error) => { console.error(error); });
141
-
142
- // Logs into console
143
- {
144
- filePath: '/real/device/path/to/file/9d66725ba2105f1833731ade5b7f334e.mp4',
145
- }
146
- ```
147
-
148
- :::info
149
- Local device file path differs from device to device. It can point to file:// or http://localhost etc.
150
- :::
151
-
152
- ### Returns
153
- * SUCCESS: File object
154
- * FAIL: No file of such uid is available, it will download it to local storage & then return saved file.
155
-
156
- :::note[GitHub Example]
157
- - [Example of managing offline files](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/offline-files)
158
- - [Example of playing video in loop](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/video-loop-offline)
159
- :::
160
-
161
- ## deleteFile()
162
- Method `deleteFile()` is used for deleting previously saved file from internal memory.
163
-
164
- ### Parameters
165
-
166
- | Param | Type | Required | Description |
167
- | -------------- | -------------| :-------: |-------------------------------------------- |
168
- | `uid` | string | <div class="red">Yes</div> | Unique file identifier is used for later file retrieval, must contain a-z,A-Z,0-9 and . characters |
169
-
170
- ### Javascript example
171
- ```javascript
172
- await sos.offline.cache.deleteFile('9d66725ba2105f1833731ade5b7f334e.mp4')
173
- .then(() => { console.log('Deleted'); })
174
- .catch((error) => { console.error(error); });
175
- ```
176
-
177
- ## getChecksumFile()
178
- Method `getChecksumFile()` is used for getting the checksum of file from internal memory.
179
-
180
- ### Parameters:
181
- | Param | Type | Required | Description |
182
- | -------------- | ----------------| :-------: |-------------------------------------------- |
183
- | `uid` | string | <div class="red">Yes</div> |Unique file identifier is used for later file retrieval, must contain a-z,A-Z,0-9 and . characters |
184
- | `hashType` | string | <div class="red">Yes</div> |Type of checksum has. Currently supported hashType is just md5 |
185
-
186
- ### Javascript example
187
- ```javascript
188
- await sos.offline.cache.getChecksumFile('9d66725ba2105f1833731ade5b7f334e.mp4', 'md5')
189
- .then((checksum) => { console.log('MD5 checksum is ' + checksum); })
190
- .catch((error) => { console.error(error); });
191
- ```
192
-
193
- :::note[GitHub Example]
194
- [Example of checking checksum of file](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/md5-checksum)
195
- :::
196
-
197
- ## validateChecksumFile()
198
- Method `validateChecksumFile()` is used for validating the checksum of the previously saved file in from internal memory.
199
-
200
- ### Parameters:
201
-
202
- | Param | Type | Required | Description |
203
- | -------------- | -----------------| :-------: |-------------------------------------------- |
204
- | `uid` | string | <div class="red">Yes</div> |Unique file identifier is used for later file retrieval, must contain a-z,A-Z,0-9 and . characters |
205
- | `hash` | string | <div class="red">Yes</div> |Hexa decimal representation of file checksum to be validated against |
206
- | `hashType` | string | <div class="red">Yes</div> |Type of checksum hash. Currently supported hashType is just md5 |
207
-
208
- ### Javascript example
209
- ```javascript
210
- // validate file checksum against internal memory
211
- await sos.offline.cache.validateChecksumFile(uid, '23dc936691f46d2bbef631f18a02f94f', 'md5')
212
- .then((valid) => { console.log('MD5 checksum is ' + (valid ? 'valid' : 'not valid')); })
213
- .catch((error) => { console.error(error); });
214
- ```
215
-
216
- ## decompressFile() (ZIP)
217
- Method `decompressFile()` is used to decompress (extract ZIP) file previously saved to internal memory.
218
-
219
- ### Parameters
220
-
221
- | Param | Type | Required | Description |
222
- | --------------- | ------------ | :-------: |----------------------------------------------------------------- |
223
- | `zipUid` | string | <div class="red">Yes</div> | Unique file identifier of a previously downloaded ZIP file |
224
- | `destinationUid` | string | <div class="red">Yes</div> | Unique directory identifier (prefix of file) to extract ZIP file to |
225
- | `method` | string | <div class="red">Yes</div> | Method of compression algorithm, currently only zip is supported |
226
-
227
- ### Javascript example
228
- ```javascript
229
- // validate file checksum against internal memory
230
- await sos.offline.cache.decompressFile(zipUid, destinationDirectoryUid, 'zip')
231
- .then(() => { console.log('ZIP file extracted'); })
232
- .catch((error) => { console.error(error); });
233
- ```
234
-
235
- :::note[GitHub Example]
236
- - [Example of decompressing ZIP files](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/offline-zip-decompress
237
- - [Managing files](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/file-system)
238
- - [Sample applet from Box](https://github.com/signageos/applet-examples/blob/master/index.html)
239
- - All other examples are available in Knowledge Base under [Applet Examples](https://github.com/signageos/applet-examples/)
240
- :::
241
-
242
- ## Errors
243
- Although we are doing our best, following errors may occur when working with the offline cache.
244
-
245
- | Code | Type | Message |
246
- | ---- | ---- | ------- |
247
- | 40105 | AppletResourceError | Already loading file: `$$FILE_NAME$$` |
248
- |^^|^^| Please, check your code for multiple occurrences of addFile/s methods. |
249
- | 40106 | AppletResourceError | Already existing file: `$$FILE_NAME$$` |
250
- |^^|^^| Please, check your code for occurrences of addFile/s methods on lines before this error. |
251
- | 49902 | FileNotFoundError | File was not found `$$FILE_ID$$` |
252
- | 40901 | AppletOfflineCacheError | Uid contains invalid characters, allowed: `$$ALLOWED_CHARS$$`, got `$$ACTUAL_UID$$` |
253
- |^^|^^| Please, check if the used URL is correct. |
254
- | 40902 | AppletOfflineCacheError | Invalid headers `$$HEADERS$$` |
255
- | 50901 | InternalOfflineCacheError | Couldn't not read the files from the offline cache. |
256
- | 50902 | InternalOfflineCacheError | File wasn't saved correctly. |
257
- | 50903 | InternalOfflineCacheError | Reading the file from the offline cache failed. |