@signageos/front-applet 7.1.1 → 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 (457) hide show
  1. package/dist/bundle.js +5 -5
  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 +92 -40
  43. package/es6/FrontApplet/Browser/Browser.js.map +1 -1
  44. package/es6/FrontApplet/Browser/IOpenLinkOptions.d.ts +2 -2
  45. package/es6/FrontApplet/Browser/events.d.ts +1 -1
  46. package/es6/FrontApplet/Browser/events.js +2 -2
  47. package/es6/FrontApplet/Browser/events.js.map +1 -1
  48. package/es6/FrontApplet/Browser/messages.d.ts +2 -2
  49. package/es6/FrontApplet/Command/Command.d.ts +37 -3
  50. package/es6/FrontApplet/Command/Command.js +52 -23
  51. package/es6/FrontApplet/Command/Command.js.map +1 -1
  52. package/es6/FrontApplet/Command/ICommandEvent.d.ts +6 -2
  53. package/es6/FrontApplet/Connect/Connect.d.ts +19 -0
  54. package/es6/FrontApplet/Connect/Connect.js +162 -0
  55. package/es6/FrontApplet/Connect/Connect.js.map +1 -0
  56. package/es6/FrontApplet/Connect/IConnectMessage.d.ts +4 -0
  57. package/es6/FrontApplet/{Stream/streamListeners.js → Connect/IConnectMessage.js} +1 -1
  58. package/es6/FrontApplet/Connect/IConnectMessage.js.map +1 -0
  59. package/es6/FrontApplet/Debug/Debug.d.ts +15 -1
  60. package/es6/FrontApplet/Debug/Debug.js +28 -18
  61. package/es6/FrontApplet/Debug/Debug.js.map +1 -1
  62. package/es6/FrontApplet/Debug/debugDecorator.d.ts +3 -3
  63. package/es6/FrontApplet/Debug/debugDecorator.js +15 -9
  64. package/es6/FrontApplet/Debug/debugDecorator.js.map +1 -1
  65. package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +23 -0
  66. package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +36 -27
  67. package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
  68. package/es6/FrontApplet/Dimensions/coordinationsHelper.js +1 -2
  69. package/es6/FrontApplet/Dimensions/coordinationsHelper.js.map +1 -1
  70. package/es6/FrontApplet/Display/Display.d.ts +25 -3
  71. package/es6/FrontApplet/Display/Display.js +35 -19
  72. package/es6/FrontApplet/Display/Display.js.map +1 -1
  73. package/es6/FrontApplet/Display/IDisplay.d.ts +3 -1
  74. package/es6/FrontApplet/Error/AppletCommandError.js +12 -3
  75. package/es6/FrontApplet/Error/AppletCommandError.js.map +1 -1
  76. package/es6/FrontApplet/Error/AppletError.js +10 -2
  77. package/es6/FrontApplet/Error/AppletError.js.map +1 -1
  78. package/es6/FrontApplet/Error/AppletHardwareError.js +12 -3
  79. package/es6/FrontApplet/Error/AppletHardwareError.js.map +1 -1
  80. package/es6/FrontApplet/Error/AppletOfflineCacheError.js +10 -2
  81. package/es6/FrontApplet/Error/AppletOfflineCacheError.js.map +1 -1
  82. package/es6/FrontApplet/Error/AppletResourcesError.js +12 -3
  83. package/es6/FrontApplet/Error/AppletResourcesError.js.map +1 -1
  84. package/es6/FrontApplet/Error/AppletSecurityError.js +12 -3
  85. package/es6/FrontApplet/Error/AppletSecurityError.js.map +1 -1
  86. package/es6/FrontApplet/Error/AppletStreamError.js +10 -2
  87. package/es6/FrontApplet/Error/AppletStreamError.js.map +1 -1
  88. package/es6/FrontApplet/Error/AppletVideoError.js +12 -3
  89. package/es6/FrontApplet/Error/AppletVideoError.js.map +1 -1
  90. package/es6/FrontApplet/Error/ErrorCodesMessages.js +4 -1
  91. package/es6/FrontApplet/Error/ErrorCodesMessages.js.map +1 -1
  92. package/es6/FrontApplet/Error/ErrorSuggestions.js +1 -0
  93. package/es6/FrontApplet/Error/ErrorSuggestions.js.map +1 -1
  94. package/es6/FrontApplet/Error/FileNotFoundError.js +10 -2
  95. package/es6/FrontApplet/Error/FileNotFoundError.js.map +1 -1
  96. package/es6/FrontApplet/Error/SosError.js +5 -1
  97. package/es6/FrontApplet/Error/SosError.js.map +1 -1
  98. package/es6/FrontApplet/Error/errorHelper.js +5 -6
  99. package/es6/FrontApplet/Error/errorHelper.js.map +1 -1
  100. package/es6/FrontApplet/Exchange/Exchange.js +7 -14
  101. package/es6/FrontApplet/Exchange/Exchange.js.map +1 -1
  102. package/es6/FrontApplet/FileSystem/FileSystem.d.ts +156 -1
  103. package/es6/FrontApplet/FileSystem/FileSystem.js +318 -195
  104. package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
  105. package/es6/FrontApplet/FileSystem/HashAlgorithm.d.ts +2 -0
  106. package/es6/FrontApplet/{Input/IKeyUpEventListener.js → FileSystem/HashAlgorithm.js} +1 -1
  107. package/es6/FrontApplet/FileSystem/HashAlgorithm.js.map +1 -0
  108. package/es6/FrontApplet/Font/fontFaceGenerator.js.map +1 -1
  109. package/es6/FrontApplet/FrontApplet.d.ts +57 -4
  110. package/es6/FrontApplet/FrontApplet.js +129 -49
  111. package/es6/FrontApplet/FrontApplet.js.map +1 -1
  112. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.d.ts +2 -0
  113. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js +35 -54
  114. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js.map +1 -1
  115. package/es6/FrontApplet/Hardware/Hardware.d.ts +16 -2
  116. package/es6/FrontApplet/Hardware/Hardware.js +31 -19
  117. package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
  118. package/es6/FrontApplet/Hardware/IHardware.d.ts +2 -2
  119. package/es6/FrontApplet/Hardware/ISerialPort.d.ts +16 -0
  120. package/es6/FrontApplet/Hardware/ISerialPortOptions.js +1 -1
  121. package/es6/FrontApplet/Hardware/ISerialPortOptions.js.map +1 -1
  122. package/es6/FrontApplet/Hardware/Led/Led.d.ts +8 -0
  123. package/es6/FrontApplet/Hardware/Led/Led.js +22 -20
  124. package/es6/FrontApplet/Hardware/Led/Led.js.map +1 -1
  125. package/es6/FrontApplet/Hardware/SerialPort.d.ts +1 -1
  126. package/es6/FrontApplet/Hardware/SerialPort.js +15 -23
  127. package/es6/FrontApplet/Hardware/SerialPort.js.map +1 -1
  128. package/es6/FrontApplet/Hash/generator.js +2 -3
  129. package/es6/FrontApplet/Hash/generator.js.map +1 -1
  130. package/es6/FrontApplet/Iframe/Iframe.d.ts +9 -8
  131. package/es6/FrontApplet/Iframe/Iframe.js +10 -0
  132. package/es6/FrontApplet/Iframe/Iframe.js.map +1 -1
  133. package/es6/FrontApplet/Input/IInput.d.ts +1 -2
  134. package/es6/FrontApplet/Input/IKeyUpEvent.d.ts +32 -2
  135. package/es6/FrontApplet/Input/IKeyUpEvent.js +32 -0
  136. package/es6/FrontApplet/Input/IKeyUpEvent.js.map +1 -1
  137. package/es6/FrontApplet/Input/Input.d.ts +19 -3
  138. package/es6/FrontApplet/Input/Input.js +44 -23
  139. package/es6/FrontApplet/Input/Input.js.map +1 -1
  140. package/es6/FrontApplet/Management/App/App.d.ts +48 -10
  141. package/es6/FrontApplet/Management/App/App.js +45 -30
  142. package/es6/FrontApplet/Management/App/App.js.map +1 -1
  143. package/es6/FrontApplet/Management/App/IApp.d.ts +3 -1
  144. package/es6/FrontApplet/Management/Audio/Audio.d.ts +16 -0
  145. package/es6/FrontApplet/Management/Audio/Audio.js +30 -22
  146. package/es6/FrontApplet/Management/Audio/Audio.js.map +1 -1
  147. package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.d.ts +4 -0
  148. package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js +15 -22
  149. package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js.map +1 -1
  150. package/es6/FrontApplet/Management/AutoRecovery/IAutoRecovery.d.ts +1 -1
  151. package/es6/FrontApplet/Management/AutoRecovery/IAutoRecovery.js +5 -2
  152. package/es6/FrontApplet/Management/AutoRecovery/IAutoRecovery.js.map +1 -1
  153. package/es6/FrontApplet/Management/Debug/Debug.d.ts +19 -0
  154. package/es6/FrontApplet/Management/Debug/Debug.js +37 -30
  155. package/es6/FrontApplet/Management/Debug/Debug.js.map +1 -1
  156. package/es6/FrontApplet/Management/Firmware/Firmware.d.ts +37 -10
  157. package/es6/FrontApplet/Management/Firmware/Firmware.js +34 -30
  158. package/es6/FrontApplet/Management/Firmware/Firmware.js.map +1 -1
  159. package/es6/FrontApplet/Management/Firmware/IFirmware.d.ts +1 -2
  160. package/es6/FrontApplet/Management/IManagement.d.ts +3 -1
  161. package/es6/FrontApplet/Management/Management.d.ts +106 -15
  162. package/es6/FrontApplet/Management/Management.js +191 -113
  163. package/es6/FrontApplet/Management/Management.js.map +1 -1
  164. package/es6/FrontApplet/Management/Network/INetworkInfo.d.ts +2 -2
  165. package/es6/FrontApplet/Management/Network/Network.d.ts +56 -8
  166. package/es6/FrontApplet/Management/Network/Network.js +86 -68
  167. package/es6/FrontApplet/Management/Network/Network.js.map +1 -1
  168. package/es6/FrontApplet/Management/OS/OS.d.ts +20 -0
  169. package/es6/FrontApplet/Management/OS/OS.js +34 -27
  170. package/es6/FrontApplet/Management/OS/OS.js.map +1 -1
  171. package/es6/FrontApplet/Management/Package/Package.d.ts +20 -0
  172. package/es6/FrontApplet/Management/Package/Package.js +37 -22
  173. package/es6/FrontApplet/Management/Package/Package.js.map +1 -1
  174. package/es6/FrontApplet/Management/PeerRecovery/IPeerRecovery.d.ts +1 -1
  175. package/es6/FrontApplet/Management/PeerRecovery/IPeerRecovery.js +5 -2
  176. package/es6/FrontApplet/Management/PeerRecovery/IPeerRecovery.js.map +1 -1
  177. package/es6/FrontApplet/Management/PeerRecovery/PeerRecovery.d.ts +4 -0
  178. package/es6/FrontApplet/Management/PeerRecovery/PeerRecovery.js +15 -22
  179. package/es6/FrontApplet/Management/PeerRecovery/PeerRecovery.js.map +1 -1
  180. package/es6/FrontApplet/Management/Power/Power.d.ts +64 -0
  181. package/es6/FrontApplet/Management/Power/Power.js +160 -115
  182. package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
  183. package/es6/FrontApplet/Management/Proxy/Proxy.d.ts +21 -0
  184. package/es6/FrontApplet/Management/Proxy/Proxy.js +41 -35
  185. package/es6/FrontApplet/Management/Proxy/Proxy.js.map +1 -1
  186. package/es6/FrontApplet/Management/RemoteControl/RemoteControl.d.ts +43 -0
  187. package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js +63 -39
  188. package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js.map +1 -1
  189. package/es6/FrontApplet/Management/Screen/IOrientation.d.ts +1 -1
  190. package/es6/FrontApplet/Management/Screen/Screen.d.ts +127 -0
  191. package/es6/FrontApplet/Management/Screen/Screen.js +197 -89
  192. package/es6/FrontApplet/Management/Screen/Screen.js.map +1 -1
  193. package/es6/FrontApplet/Management/Security/Security.d.ts +20 -5
  194. package/es6/FrontApplet/Management/Security/Security.js +33 -31
  195. package/es6/FrontApplet/Management/Security/Security.js.map +1 -1
  196. package/es6/FrontApplet/Management/Time/Time.d.ts +31 -5
  197. package/es6/FrontApplet/Management/Time/Time.js +49 -40
  198. package/es6/FrontApplet/Management/Time/Time.js.map +1 -1
  199. package/es6/FrontApplet/Management/Wifi/IWifiEvent.d.ts +19 -1
  200. package/es6/FrontApplet/Management/Wifi/IWifiEvent.js +19 -1
  201. package/es6/FrontApplet/Management/Wifi/IWifiEvent.js.map +1 -1
  202. package/es6/FrontApplet/Management/Wifi/Wifi.d.ts +108 -7
  203. package/es6/FrontApplet/Management/Wifi/Wifi.js +162 -86
  204. package/es6/FrontApplet/Management/Wifi/Wifi.js.map +1 -1
  205. package/es6/FrontApplet/Management/helpers/DeviceHelper.js +2 -2
  206. package/es6/FrontApplet/Management/helpers/DeviceHelper.js.map +1 -1
  207. package/es6/FrontApplet/Management/helpers/ProprietaryTimerHelper.d.ts +1 -1
  208. package/es6/FrontApplet/Management/helpers/SecurityHelper.js +8 -6
  209. package/es6/FrontApplet/Management/helpers/SecurityHelper.js.map +1 -1
  210. package/es6/FrontApplet/Management/helpers/TimerHelper.js +2 -2
  211. package/es6/FrontApplet/Management/helpers/TimerHelper.js.map +1 -1
  212. package/es6/FrontApplet/Management/helpers/UpgradeHelper.js +35 -3
  213. package/es6/FrontApplet/Management/helpers/UpgradeHelper.js.map +1 -1
  214. package/es6/FrontApplet/Management/helpers/VideoHelper.js +1 -1
  215. package/es6/FrontApplet/Management/helpers/VideoHelper.js.map +1 -1
  216. package/es6/FrontApplet/Monitors/Monitors.d.ts +9 -0
  217. package/es6/FrontApplet/Monitors/Monitors.js +16 -16
  218. package/es6/FrontApplet/Monitors/Monitors.js.map +1 -1
  219. package/es6/FrontApplet/NativeCommands/MDC/CodesMDC.js +1 -1
  220. package/es6/FrontApplet/NativeCommands/MDC/CodesMDC.js.map +1 -1
  221. package/es6/FrontApplet/NativeCommands/MDC/Mdc.d.ts +52 -3
  222. package/es6/FrontApplet/NativeCommands/MDC/Mdc.js +79 -38
  223. package/es6/FrontApplet/NativeCommands/MDC/Mdc.js.map +1 -1
  224. package/es6/FrontApplet/NativeCommands/NativeCommands.d.ts +4 -0
  225. package/es6/FrontApplet/NativeCommands/NativeCommands.js +12 -2
  226. package/es6/FrontApplet/NativeCommands/NativeCommands.js.map +1 -1
  227. package/es6/FrontApplet/OSD/OSD.d.ts +9 -0
  228. package/es6/FrontApplet/OSD/OSD.js +15 -15
  229. package/es6/FrontApplet/OSD/OSD.js.map +1 -1
  230. package/es6/FrontApplet/Offline/Cache/Cache.d.ts +91 -2
  231. package/es6/FrontApplet/Offline/Cache/Cache.js +193 -131
  232. package/es6/FrontApplet/Offline/Cache/Cache.js.map +1 -1
  233. package/es6/FrontApplet/Offline/Flags/AppendFlagController.d.ts +1 -1
  234. package/es6/FrontApplet/Offline/Flags/AppendFlagController.js +18 -26
  235. package/es6/FrontApplet/Offline/Flags/AppendFlagController.js.map +1 -1
  236. package/es6/FrontApplet/Offline/Flags/IFlags.d.ts +5 -5
  237. package/es6/FrontApplet/Offline/IAddFont.d.ts +3 -1
  238. package/es6/FrontApplet/Offline/IAddFont.js.map +1 -1
  239. package/es6/FrontApplet/Offline/IFileType.d.ts +1 -1
  240. package/es6/FrontApplet/Offline/ISaveFile.js +5 -2
  241. package/es6/FrontApplet/Offline/ISaveFile.js.map +1 -1
  242. package/es6/FrontApplet/Offline/LoadFile/CssLoadFileController.js +2 -1
  243. package/es6/FrontApplet/Offline/LoadFile/CssLoadFileController.js.map +1 -1
  244. package/es6/FrontApplet/Offline/LoadFile/JavascriptLoadFileController.js +2 -1
  245. package/es6/FrontApplet/Offline/LoadFile/JavascriptLoadFileController.js.map +1 -1
  246. package/es6/FrontApplet/Offline/Offline.d.ts +79 -8
  247. package/es6/FrontApplet/Offline/Offline.js +119 -59
  248. package/es6/FrontApplet/Offline/Offline.js.map +1 -1
  249. package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.d.ts +19 -1
  250. package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js +41 -29
  251. package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -1
  252. package/es6/FrontApplet/Sensors/Proximity.d.ts +4 -3
  253. package/es6/FrontApplet/Sensors/Proximity.js +13 -5
  254. package/es6/FrontApplet/Sensors/Proximity.js.map +1 -1
  255. package/es6/FrontApplet/Sensors/Sensors.d.ts +3 -1
  256. package/es6/FrontApplet/Sensors/Sensors.js +9 -2
  257. package/es6/FrontApplet/Sensors/Sensors.js.map +1 -1
  258. package/es6/FrontApplet/Stream/IStream.d.ts +10 -10
  259. package/es6/FrontApplet/Stream/IStreamMessage.d.ts +1 -1
  260. package/es6/FrontApplet/Stream/IStreamTrackInfo.d.ts +2 -2
  261. package/es6/FrontApplet/Stream/Stream.d.ts +130 -15
  262. package/es6/FrontApplet/Stream/Stream.js +262 -163
  263. package/es6/FrontApplet/Stream/Stream.js.map +1 -1
  264. package/es6/FrontApplet/Stream/StreamProtocol.js.map +1 -1
  265. package/es6/FrontApplet/Stream/streamEvents.d.ts +1 -1
  266. package/es6/FrontApplet/Sync/Sync.d.ts +152 -6
  267. package/es6/FrontApplet/Sync/Sync.js +199 -115
  268. package/es6/FrontApplet/Sync/Sync.js.map +1 -1
  269. package/es6/FrontApplet/Sync/syncEvents.d.ts +3 -1
  270. package/es6/FrontApplet/Sync/syncMessages.js +1 -1
  271. package/es6/FrontApplet/Sync/syncMessages.js.map +1 -1
  272. package/es6/FrontApplet/Timing/Timing.d.ts +1 -0
  273. package/es6/FrontApplet/Timing/Timing.js +9 -2
  274. package/es6/FrontApplet/Timing/Timing.js.map +1 -1
  275. package/es6/FrontApplet/Timing/Triggers/ITimingTriggersMessage.d.ts +1 -1
  276. package/es6/FrontApplet/Timing/Triggers/Triggers.d.ts +9 -0
  277. package/es6/FrontApplet/Timing/Triggers/Triggers.js +16 -18
  278. package/es6/FrontApplet/Timing/Triggers/Triggers.js.map +1 -1
  279. package/es6/FrontApplet/Touch/Touch.d.ts +3 -0
  280. package/es6/FrontApplet/Touch/Touch.js +13 -3
  281. package/es6/FrontApplet/Touch/Touch.js.map +1 -1
  282. package/es6/FrontApplet/Validate/Validate.d.ts +5 -5
  283. package/es6/FrontApplet/Validate/Validate.js +27 -24
  284. package/es6/FrontApplet/Validate/Validate.js.map +1 -1
  285. package/es6/FrontApplet/Validate/ValidateObjectInterface.js +7 -2
  286. package/es6/FrontApplet/Validate/ValidateObjectInterface.js.map +1 -1
  287. package/es6/FrontApplet/Video/IOptions.d.ts +8 -1
  288. package/es6/FrontApplet/Video/IVideo.d.ts +8 -8
  289. package/es6/FrontApplet/Video/IVideoEvent.d.ts +1 -1
  290. package/es6/FrontApplet/Video/IVideoEvent.js +3 -3
  291. package/es6/FrontApplet/Video/IVideoEvent.js.map +1 -1
  292. package/es6/FrontApplet/Video/IVideoMessage.d.ts +1 -1
  293. package/es6/FrontApplet/Video/Video.d.ts +84 -12
  294. package/es6/FrontApplet/Video/Video.js +196 -137
  295. package/es6/FrontApplet/Video/Video.js.map +1 -1
  296. package/es6/FrontApplet/createFrontApplet.js +5 -2
  297. package/es6/FrontApplet/createFrontApplet.js.map +1 -1
  298. package/es6/Monitoring/Console/consoleCommands.d.ts +1 -1
  299. package/es6/Monitoring/Display/displayCommands.d.ts +1 -1
  300. package/es6/Monitoring/Display/handleDisplayRequests.d.ts +2 -2
  301. package/es6/Monitoring/Display/handleDisplayRequests.js +5 -15
  302. package/es6/Monitoring/Display/handleDisplayRequests.js.map +1 -1
  303. package/es6/Monitoring/EmptyObject.d.ts +1 -1
  304. package/es6/Monitoring/FileSystem/fileSystemCommands.d.ts +10 -1
  305. package/es6/Monitoring/FileSystem/fileSystemCommands.js +3 -1
  306. package/es6/Monitoring/FileSystem/fileSystemCommands.js.map +1 -1
  307. package/es6/Monitoring/FileSystem/handleFileSystemRequests.d.ts +2 -2
  308. package/es6/Monitoring/FileSystem/handleFileSystemRequests.js +41 -45
  309. package/es6/Monitoring/FileSystem/handleFileSystemRequests.js.map +1 -1
  310. package/es6/Monitoring/Html/handleHtmlSnapshotTakingRequests.d.ts +2 -2
  311. package/es6/Monitoring/Html/handleHtmlSnapshotTakingRequests.js +4 -14
  312. package/es6/Monitoring/Html/handleHtmlSnapshotTakingRequests.js.map +1 -1
  313. package/es6/Monitoring/Management/App/applicationCommands.d.ts +1 -1
  314. package/es6/Monitoring/Management/App/handleApplicationRequests.d.ts +2 -2
  315. package/es6/Monitoring/Management/App/handleApplicationRequests.js +9 -19
  316. package/es6/Monitoring/Management/App/handleApplicationRequests.js.map +1 -1
  317. package/es6/Monitoring/Management/Audio/audioCommands.d.ts +1 -1
  318. package/es6/Monitoring/Management/Audio/handleAudioRequests.d.ts +2 -2
  319. package/es6/Monitoring/Management/Audio/handleAudioRequests.js +7 -17
  320. package/es6/Monitoring/Management/Audio/handleAudioRequests.js.map +1 -1
  321. package/es6/Monitoring/Management/AutoRecovery/autoRecoveryCommands.d.ts +1 -1
  322. package/es6/Monitoring/Management/AutoRecovery/handleAutoRecoveryRequests.d.ts +2 -2
  323. package/es6/Monitoring/Management/AutoRecovery/handleAutoRecoveryRequests.js +7 -17
  324. package/es6/Monitoring/Management/AutoRecovery/handleAutoRecoveryRequests.js.map +1 -1
  325. package/es6/Monitoring/Management/Debug/debugCommands.d.ts +1 -1
  326. package/es6/Monitoring/Management/Debug/handleDebugRequests.d.ts +2 -2
  327. package/es6/Monitoring/Management/Debug/handleDebugRequests.js +9 -19
  328. package/es6/Monitoring/Management/Debug/handleDebugRequests.js.map +1 -1
  329. package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.d.ts +2 -2
  330. package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.js +11 -21
  331. package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.js.map +1 -1
  332. package/es6/Monitoring/Management/Network/managementNetworkCommands.d.ts +1 -1
  333. package/es6/Monitoring/Management/Os/managementOsRequests.d.ts +2 -2
  334. package/es6/Monitoring/Management/Os/managementOsRequests.js +9 -19
  335. package/es6/Monitoring/Management/Os/managementOsRequests.js.map +1 -1
  336. package/es6/Monitoring/Management/Os/osCommands.d.ts +1 -1
  337. package/es6/Monitoring/Management/PeerRecovery/handlePeerRecoveryRequests.d.ts +2 -2
  338. package/es6/Monitoring/Management/PeerRecovery/handlePeerRecoveryRequests.js +7 -17
  339. package/es6/Monitoring/Management/PeerRecovery/handlePeerRecoveryRequests.js.map +1 -1
  340. package/es6/Monitoring/Management/PeerRecovery/peerRecoveryCommands.d.ts +1 -1
  341. package/es6/Monitoring/Management/Power/handlePowerRequests.d.ts +2 -2
  342. package/es6/Monitoring/Management/Power/handlePowerRequests.js +19 -29
  343. package/es6/Monitoring/Management/Power/handlePowerRequests.js.map +1 -1
  344. package/es6/Monitoring/Management/Power/powerCommands.d.ts +1 -1
  345. package/es6/Monitoring/Management/RemoteControl/handleRemoteControlRequests.d.ts +2 -2
  346. package/es6/Monitoring/Management/RemoteControl/handleRemoteControlRequests.js +15 -25
  347. package/es6/Monitoring/Management/RemoteControl/handleRemoteControlRequests.js.map +1 -1
  348. package/es6/Monitoring/Management/RemoteControl/remoteControlCommands.d.ts +1 -1
  349. package/es6/Monitoring/Management/Screen/handleScreenRequests.d.ts +2 -2
  350. package/es6/Monitoring/Management/Screen/handleScreenRequests.js +19 -29
  351. package/es6/Monitoring/Management/Screen/handleScreenRequests.js.map +1 -1
  352. package/es6/Monitoring/Management/Screen/screenCommands.d.ts +1 -1
  353. package/es6/Monitoring/Management/Security/handleSecurityCommands.d.ts +2 -2
  354. package/es6/Monitoring/Management/Security/handleSecurityCommands.js +9 -19
  355. package/es6/Monitoring/Management/Security/handleSecurityCommands.js.map +1 -1
  356. package/es6/Monitoring/Management/Security/securityCommands.d.ts +1 -1
  357. package/es6/Monitoring/Management/Time/handleTimeCommands.d.ts +2 -2
  358. package/es6/Monitoring/Management/Time/handleTimeCommands.js +9 -19
  359. package/es6/Monitoring/Management/Time/handleTimeCommands.js.map +1 -1
  360. package/es6/Monitoring/Management/Time/timeCommands.d.ts +1 -1
  361. package/es6/Monitoring/Management/handleManagementRequests.d.ts +2 -2
  362. package/es6/Monitoring/Management/handleManagementRequests.js +23 -33
  363. package/es6/Monitoring/Management/handleManagementRequests.js.map +1 -1
  364. package/es6/Monitoring/Management/managementCommands.d.ts +1 -1
  365. package/es6/Monitoring/{Montoring.d.ts → Monitoring.d.ts} +1 -0
  366. package/es6/Monitoring/Monitoring.js +83 -0
  367. package/es6/Monitoring/Monitoring.js.map +1 -0
  368. package/es6/Monitoring/NativeCommands/handleNativeCommands.d.ts +2 -2
  369. package/es6/Monitoring/NativeCommands/handleNativeCommands.js +5 -15
  370. package/es6/Monitoring/NativeCommands/handleNativeCommands.js.map +1 -1
  371. package/es6/Monitoring/NativeCommands/nativeMdcCommands.d.ts +1 -1
  372. package/es6/Monitoring/OSD/handleOsdRequests.d.ts +2 -2
  373. package/es6/Monitoring/OSD/handleOsdRequests.js +5 -15
  374. package/es6/Monitoring/OSD/handleOsdRequests.js.map +1 -1
  375. package/es6/Monitoring/Offline/Cache/handleOfflineCacheRequests.d.ts +2 -2
  376. package/es6/Monitoring/Offline/Cache/handleOfflineCacheRequests.js +23 -33
  377. package/es6/Monitoring/Offline/Cache/handleOfflineCacheRequests.js.map +1 -1
  378. package/es6/Monitoring/Video/handleVideoRequests.d.ts +2 -2
  379. package/es6/Monitoring/Video/handleVideoRequests.js +36 -9
  380. package/es6/Monitoring/Video/handleVideoRequests.js.map +1 -1
  381. package/es6/Monitoring/handleMonitoringRequests.d.ts +2 -2
  382. package/es6/Monitoring/handleMonitoringRequests.js +6 -16
  383. package/es6/Monitoring/handleMonitoringRequests.js.map +1 -1
  384. package/es6/Monitoring/monitoringCommands.d.ts +1 -1
  385. package/es6/Sensors/IButton.js +1 -1
  386. package/es6/Sensors/IButton.js.map +1 -1
  387. package/es6/Sensors/IRfidAntenna.d.ts +1 -1
  388. package/es6/Sensors/IRfidAntenna.js +1 -1
  389. package/es6/Sensors/IRfidAntenna.js.map +1 -1
  390. package/es6/Util/Console/enhancer.d.ts +11 -0
  391. package/es6/Util/Console/enhancer.js +23 -0
  392. package/es6/Util/Console/enhancer.js.map +1 -0
  393. package/es6/bundle.d.ts +1 -1
  394. package/es6/bundle.js +12 -5
  395. package/es6/bundle.js.map +1 -1
  396. package/es6/fpath.d.ts +1 -1
  397. package/es6/fpath.js +34 -1
  398. package/es6/fpath.js.map +1 -1
  399. package/es6/utils/types.d.ts +1 -0
  400. package/es6/{FrontApplet/Video/IVideoEventListener.js → utils/types.js} +1 -1
  401. package/es6/utils/types.js.map +1 -0
  402. package/package.json +28 -26
  403. package/CHANGELOG.md +0 -480
  404. package/docs/applet-basics.md +0 -272
  405. package/docs/content/js-applet-resources.md +0 -154
  406. package/docs/content/js-browser.md +0 -163
  407. package/docs/content/js-command.md +0 -154
  408. package/docs/content/js-debug.md +0 -36
  409. package/docs/content/js-device-info.md +0 -56
  410. package/docs/content/js-display.md +0 -56
  411. package/docs/content/js-file-system.md +0 -670
  412. package/docs/content/js-fonts.md +0 -115
  413. package/docs/content/js-hardware.md +0 -55
  414. package/docs/content/js-iframes.md +0 -66
  415. package/docs/content/js-input.md +0 -71
  416. package/docs/content/js-offline-cache-media-files.md +0 -257
  417. package/docs/content/js-offline-cache-simple-data.md +0 -129
  418. package/docs/content/js-osd.md +0 -32
  419. package/docs/content/js-proof-of-play.md +0 -60
  420. package/docs/content/js-sensors.md +0 -70
  421. package/docs/content/js-serial.md +0 -165
  422. package/docs/content/js-sync-playback.md +0 -384
  423. package/docs/content/js-video-inputs-internal-ports.md +0 -131
  424. package/docs/content/js-video-stream.md +0 -618
  425. package/docs/content/js-video.md +0 -232
  426. package/docs/management/js-management-application.md +0 -107
  427. package/docs/management/js-management-audio.md +0 -44
  428. package/docs/management/js-management-debug.md +0 -40
  429. package/docs/management/js-management-firmware.md +0 -93
  430. package/docs/management/js-management-management.md +0 -178
  431. package/docs/management/js-management-monitoring-commands.md +0 -107
  432. package/docs/management/js-management-monitors.md +0 -55
  433. package/docs/management/js-management-native-commands-mdc.md +0 -90
  434. package/docs/management/js-management-network.md +0 -223
  435. package/docs/management/js-management-os.md +0 -62
  436. package/docs/management/js-management-package.md +0 -48
  437. package/docs/management/js-management-power.md +0 -175
  438. package/docs/management/js-management-proxy.md +0 -81
  439. package/docs/management/js-management-remote-control.md +0 -58
  440. package/docs/management/js-management-screen.md +0 -225
  441. package/docs/management/js-management-security.md +0 -71
  442. package/docs/management/js-management-time.md +0 -161
  443. package/docs/management/js-management-wifi.md +0 -341
  444. package/es6/FrontApplet/Command/ICommandEventListener.d.ts +0 -6
  445. package/es6/FrontApplet/Command/ICommandEventListener.js +0 -3
  446. package/es6/FrontApplet/Command/ICommandEventListener.js.map +0 -1
  447. package/es6/FrontApplet/Input/IKeyUpEventListener.d.ts +0 -5
  448. package/es6/FrontApplet/Input/IKeyUpEventListener.js.map +0 -1
  449. package/es6/FrontApplet/Management/Firmware/FirmwareType.d.ts +0 -4
  450. package/es6/FrontApplet/Management/Firmware/FirmwareType.js +0 -9
  451. package/es6/FrontApplet/Management/Firmware/FirmwareType.js.map +0 -1
  452. package/es6/FrontApplet/Stream/streamListeners.d.ts +0 -10
  453. package/es6/FrontApplet/Stream/streamListeners.js.map +0 -1
  454. package/es6/FrontApplet/Video/IVideoEventListener.d.ts +0 -5
  455. package/es6/FrontApplet/Video/IVideoEventListener.js.map +0 -1
  456. package/es6/Monitoring/Montoring.js +0 -131
  457. package/es6/Monitoring/Montoring.js.map +0 -1
@@ -1,670 +0,0 @@
1
- ---
2
- title: File System
3
- author: Michael Zabka
4
- date: 26.11.2018
5
- type: js-api
6
- tags:
7
- - applet
8
- - applet_api
9
- - api
10
- - js_api
11
- description: "[Content JS API] File System API allows **low level manipulation with files and directories** in the device internal storage. File System API works with both in **internal and external storages** (USB flash drives, etc.)."
12
- ---
13
-
14
- # File System
15
- File System API allows **low level manipulation with files and directories** in the device internal storage.
16
- File System API works with both in **internal and external storages** (USB flash drives, etc.).
17
-
18
- :::warning
19
- File System directory structure is **PERSISTENT** and is **NOT** automatically deleted through `Applet Reload` power action! Applet Reload only deletes `/data` directory which is reserved for simplified [Offline Cache API](js-offline-cache-media-files). Use `deleteFile()` to clear the device storage file system.
20
- :::
21
-
22
- :::note[GitHub Examples]
23
- [Complete example of the File System API on our Github](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/file-system)
24
- :::
25
-
26
- :::note[Alternative file caching]
27
- [Offline Cache for media files](js-offline-cache-media-files)
28
- :::
29
-
30
- ## All methods
31
-
32
-
33
- | Methods | Description | Supported since |
34
- | -------- | ----------- | :---------------: |
35
- | `listStorageUnits()` | Return list of storage units /internal, external/ from the device | 2.1.0 |
36
- | `listFiles()` | Return list of files of existing directory | 2.1.0 |
37
- | `getFile()` | Returns local uri of existing file | 2.1.0 |
38
- | `exists()` | Returns true of existing directory or file | 2.1.0 |
39
- | `downloadFile()` | Download file to path within existing directory or Overrides existing file in path when successfully downloaded | 2.1.0 |
40
- | `deleteFile()` | Delete file from path within existing directory | 2.1.0 |
41
- | `moveFile()` | Move file to destination path or Move directory to destination path | 2.1.0 |
42
- | `getFileChecksum()` | Returns checksum of existing file in path | 2.1.0 |
43
- | `extractFile()` | Extract ZIPed all files (recursively) to destination path and override existing files or merge existing directories | 2.1.0 |
44
- | `createArchive()` | Creates archive in selected path | 5.12.0 |
45
- | `createDirectory()` | Creates directory in path | 2.1.0 |
46
- | `isDirectory()` | Returns true if existing path is directory | 2.1.0 |
47
- | `copyFile()` | Copy file or directory to a new location | 3.3.0 |
48
- | `writeFile()` | Write string to a file | 3.2.0 |
49
- | `appendFile()` | Write string to a file | 4.13.0 |
50
- | `readFile()` | Read a text file | 3.3.0
51
-
52
- ## listStorageUnits()
53
-
54
- Return list of storage units /internal, external/ from the device. Capacity values are in bytes.
55
-
56
- :::info
57
- This is a mandatory method that is required for all the other File System APIs. The other APIs require a `storageUnit` object that is retrieved from this method to manipulate with files on a correct storage location (internal/external).
58
- :::
59
-
60
- :::warning
61
- `storageUnit` is a dynamic object! It has to be always generated and retrieved by this JS API, as the values in `type` differ platform by platform. **Never** generate the object manually. `{"type":"internal"}` is for demonstration only.
62
- :::
63
-
64
-
65
- ### Javascript Example
66
-
67
- ```javascript
68
- // Storage units are equivalent to disk volumes (C:, D: etc on Windows; /mnt/disc1, /mnt/disc2 on Unix)
69
- const storageUnits = await sos.fileSystem.listStorageUnits();
70
-
71
- // Every platform has at least one not removable storage unit (internal storage unit)
72
- const internalStorageUnit = storageUnits.find((storageUnit) => !storageUnit.removable);
73
-
74
- console.log(storageUnits);
75
- ```
76
-
77
- ### Returns
78
-
79
- ```json
80
- [
81
- {
82
- "type":"internal",
83
- "capacity":4124856000, // in bytes
84
- "freeSpace":3764700000, // in bytes
85
- "usableSpace":3764700000, // in bytes
86
- "removable":false
87
- },
88
- {
89
- "type":"external",
90
- "capacity":2224856000, // in bytes
91
- "freeSpace":764700000, // in bytes
92
- "usableSpace":764700000, // in bytes
93
- "removable":true
94
- }
95
- ]
96
- ```
97
-
98
- ## listFiles()
99
-
100
- List files and folders located in the internal/external storage.
101
- * SUCCESS: Return list of files of existing directory
102
- * FAIL: When listing not existing directory
103
- * FAIL: When listing existing file (not a directory)
104
-
105
- ### Javascript Example
106
-
107
- ```javascript
108
- // Storage units are equivalent to disk volumes (C:, D: etc on Windows; /mnt/disc1, /mnt/disc2 on Unix)
109
- const storageUnits = await sos.fileSystem.listStorageUnits();
110
-
111
- // Every platform has at least one not removable storage unit (internal storage unit)
112
- const internalStorageUnit = storageUnits.find((storageUnit) => !storageUnit.removable);
113
-
114
- // Empty string '' refers to root directory. Here is root directory of internal storage
115
- const rootDirectoryFilePaths = await sos.fileSystem.listFiles({ filePath: '', storageUnit: internalStorageUnit });
116
-
117
- console.log(rootDirectoryFilePaths);
118
-
119
- // get files from directory 'test-dir'
120
- const testDirDirectoryFilePaths = await sos.fileSystem.listFiles({ filePath: 'test-dir', storageUnit: internalStorageUnit });
121
- console.log(testDirDirectoryFilePaths);
122
- ```
123
-
124
- ### Returns
125
-
126
- ```json
127
- // there are 2 directories in the internal storage
128
- [
129
- {
130
- "storageUnit":{
131
- "type":"internal",
132
- "capacity":4124856000,
133
- "freeSpace":3336336000,
134
- "usableSpace":3336336000,
135
- "removable":false
136
- },
137
- "filePath":"data"
138
- },
139
- {
140
- "storageUnit":{
141
- "type":"internal",
142
- "capacity":4124856000,
143
- "freeSpace":3336336000,
144
- "usableSpace":3336336000,
145
- "removable":false
146
- },
147
- "filePath":"test-dir"
148
- }
149
- ]
150
-
151
- // there are 3 files in the 'test-dir' directory
152
- [
153
- {
154
- "storageUnit":{
155
- "type":"internal",
156
- "capacity":4124856000,
157
- "freeSpace":3764696000,
158
- "usableSpace":3764696000,
159
- "removable":false
160
- },
161
- "filePath":"test-dir/downloaded-file.png"
162
- },
163
- {
164
- "storageUnit":{
165
- "type":"internal",
166
- "capacity":4124856000,
167
- "freeSpace":3764696000,
168
- "usableSpace":3764696000,
169
- "removable":false
170
- },
171
- "filePath":"test-dir/log.1.txt"
172
- },
173
- {
174
- "storageUnit":{
175
- "type":"internal",
176
- "capacity":4124856000,
177
- "freeSpace":3764696000,
178
- "usableSpace":3764696000,
179
- "removable":false
180
- },
181
- "filePath":"test-dir/log.1.txt.backup"
182
- }
183
- ]
184
- ```
185
-
186
- ## getFile()
187
-
188
- Return a file from an internal storage
189
- * OK: Returns local uri of existing file
190
- * OK: Returns NULL of not existing file
191
-
192
- ### Parameters
193
-
194
- | Param | Type | Required | Description |
195
- | -------------- | ------ | :-------: | ----- |
196
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
197
-
198
- ### Javascript Example
199
-
200
- ```javascript
201
- // always pass storageUnit to tell the JS API where to look
202
- // get properties of file (at least localUri) or null when not exist
203
- const fileProperties = await sos.fileSystem.getFile({ storageUnit: internalStorageUnit, filePath: 'test-dir/downloaded-file.png' });
204
-
205
- // Complete file details
206
- console.log(fileProperties);
207
-
208
- // To access file from HTML applet, use localUri
209
- console.log(fileProperties.localUri);
210
- ```
211
-
212
- ### Returns
213
-
214
- :::warning
215
- Return statement is a dynamic object! It has to be always generated and retrieved by this JS API, as the values in `localUri` differ platform by platform. **Never** generate the object manually. `{"localUri":"file://internal/test-dir/downloaded-file.png"}` is for demonstration only.
216
- :::
217
-
218
- ```json
219
- {
220
- "localUri": "file://internal/test-dir/downloaded-file.png",
221
- // Other optional properties when supported
222
- "createdAt": "2019-05-03T12:00:00.000Z",
223
- "lastModifiedAt": "2019-05-03T12:00:00.000Z",
224
- "sizeBytes": 2048,
225
- "mimeType": "image/png"
226
- }
227
- ```
228
-
229
- ## exists()
230
-
231
- * OK: Returns true of existing directory or file
232
- * OK: Returns false of not existing directory nor file
233
-
234
- ### Parameters
235
-
236
- | Param | Type | Required | Description |
237
- | -------------- | ----- | :------: | ------ |
238
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
239
-
240
- ### Javascript Example
241
-
242
- ```javascript
243
- // always pass storageUnit to tell the JS API where to look
244
- // check if there is such a file
245
- const fileExists = await sos.fileSystem.exists({ storageUnit: internalStorageUnit, filePath: 'test-dir/downloaded-file.png' });
246
-
247
- console.log(fileExists);
248
- ```
249
-
250
- ### Returns
251
-
252
- Boolean value
253
-
254
- ## downloadFile()
255
-
256
- Download file to path within existing directory or **overrides existing file** in a path when successfully downloaded
257
-
258
- * OK: Download file to path within existing directory
259
- * OK: Overrides existing file in path when sucessfully downloaded
260
- * FAIL: When containing (parent) directory of destination path doesn't exist
261
- * FAIL: When destination path is directory
262
-
263
- ### Parameters
264
-
265
- | Param | Type | Required | Description |
266
- | -------------- | ----- | :----: | ---- |
267
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
268
- | `uri` | String | <div class="red">Yes</div> | Url address to retrieve the file from network |
269
- | `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
270
-
271
- :::danger
272
- For every download request, our app makes HEAD request for `content-length` header on that downloaded file.
273
- :::
274
-
275
- :::warning
276
- - `headers` has to be a JSON object. If you are passing the value, make sure you use `JSON.parse()`.
277
- - Windows platform can download only files smaller then 4GB.
278
- :::
279
-
280
- ### Javascript Example
281
-
282
- ```javascript
283
- // You can download file to specific existing directory
284
- await sos.fileSystem.downloadFile(
285
- { storageUnit: internalStorageUnit, filePath: 'test-dir/downloaded-file.png' },
286
- 'https://2.signageos.io/assets/android-benq-amy_bbd9afbc0655ceb6da790a80fbd90290.png',
287
- { 'Authentication-Token': 'MySecretToken' }, // Optionally, you can use headers for download file
288
- );
289
- ```
290
-
291
- #### Encoding
292
-
293
- All downloads respect a standard of `Encoding` with optional compression of files. See [Mozilla standard Accept Encoding](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding) and [Content Encoding](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding).
294
-
295
- Download file method is always sending optional following headers:
296
- ```
297
- Accept-Encoding: gzip
298
- Accept-Encoding: compress
299
- Accept-Encoding: deflate
300
- Accept-Encoding: br
301
- Accept-Encoding: identity
302
- Accept-Encoding: *
303
- ```
304
-
305
- If the server understands the `Encoding` standard, it compresses files using `gzip` algorithm before the files are sent to the client. If so, the response will contain the following headers:
306
- ```
307
- Content-Encoding: gzip
308
- Content-Encoding: compress
309
- Content-Encoding: deflate
310
- Content-Encoding: br
311
- ```
312
- So the data communication is compressed under the hood. The client will automatically decompress data before it's saved to a specified location path. So from JS API point of view, there is no requirement to decompress data by itself.
313
-
314
- The standard is supported on all following platforms:
315
-
316
- - WebOS 3+
317
- - Tizen 2.4+
318
- - Brightsign
319
- - Raspberry Pi
320
- - Windows
321
-
322
- ## deleteFile()
323
-
324
- Delete a file or directory from the path.
325
-
326
- * OK: (not recursive) Deletes an existing file or existing empty directory
327
- * OK: (recursive) Deletes an existing file or existing (non-empty) directory recursively
328
- * FAIL: (not recursive) When is deleting directory and is not empty
329
- * FAIL: (both) When deleting path doesn't exist
330
-
331
- ### Parameters
332
-
333
- | Param | Type | Required | Description |
334
- | ---- | ----- | :------: | ----- |
335
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
336
- | `recursive`| boolean | <div class="yellow">No</div> | `TRUE` for recursive delete of all content from a directory |
337
-
338
- ### Javascript Example
339
-
340
- ```javascript
341
- // Delete directory and all files inside
342
- //// First check, if there is such a directory
343
- if (await sos.fileSystem.exists({ storageUnit: internalStorageUnit, filePath: 'test-dir' })) {
344
- // Delete the directory and all it's content recursively
345
- await sos.fileSystem.deleteFile({ storageUnit: internalStorageUnit, filePath: 'test-dir' }, true);
346
- }
347
-
348
- // Delete file
349
- //// First check, if there is such a file
350
- if (await sos.fileSystem.exists({ storageUnit: internalStorageUnit, filePath: 'test-dir/downloaded-file.png' })) {
351
- // Delete the file
352
- await sos.fileSystem.deleteFile({ storageUnit: internalStorageUnit, filePath: 'test-dir/downloaded-file.png' }, false);
353
- }
354
- ```
355
-
356
- ## moveFile()
357
-
358
- Move file OR directory to destination path or Move directory to destination path.
359
-
360
- * OK: Move file to destination path
361
- * OK: Move directory to destination path
362
- * FAIL: When destination path exists (is file or directory)
363
- * FAIL: When containing (parent) directory of destination path doesn't exist
364
- * FAIL: When source file (or directory) doesn't exist
365
-
366
- ### Parameters
367
-
368
- | Param| Type | Required | Description |
369
- | ------ | ------ | :-------: | ----- |
370
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
371
-
372
- ### Javascript Example
373
-
374
- ```javascript
375
- // Move file to a different directory
376
- //// First check, if there is such a file and directory
377
- if (await sos.fileSystem.exists({ storageUnit: internalStorageUnit, filePath: 'test-dir/log.txt' })
378
- && await sos.fileSystem.exists({ storageUnit: internalStorageUnit, filePath: 'new-dir' }) ) {
379
-
380
- await sos.fileSystem.moveFile(
381
- { storageUnit: internalStorageUnit, filePath: 'test-dir/log.txt' },
382
- { storageUnit: internalStorageUnit, filePath: 'new-dir/log.txt' },
383
- );
384
- }
385
-
386
- ```
387
-
388
- ## getFileChecksum()
389
-
390
- Returns checksum of existing file in a path.
391
- * OK: Returns checksum of existing file in path
392
- * FAIL: When file path doesn't exist
393
- * FAIL: When file path is directory
394
-
395
- :::info
396
- Does not work on Samsung Tizen display - [read more here](https://docs.signageos.io/hc/en-us/articles/4416327809810)
397
- :::
398
-
399
- ### Parameters
400
-
401
- | Param | Type | Required | Description |
402
- | ---- | ----- | :---------: | ------ |
403
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
404
- | `hashFunction` | string | <div class="red">Yes</div> | Available function is `md5` |
405
-
406
- ### Javascript Example
407
-
408
- ```javascript
409
- const md5Checksum = await sos.fileSystem.getFileChecksum({ storageUnit: internalStorageUnit, filePath: 'test-dir/log.1.txt.backup' }, 'md5');
410
- console.log(md5Checksum);
411
- ```
412
-
413
- ### Returns
414
-
415
- ```json
416
- "b3c6930b9306b8e35a978d342cf5a01e" // string
417
- ```
418
-
419
- ## extractFile()
420
-
421
- Extract ZIPed all files (recursively) to destination path and override existing files or merge existing directories.
422
-
423
- * OK: Extract ZIPed all files (recursively) to destination path
424
- * OK: Extract ZIPed all files (recursively) to destination path and override existing files or merge existing directories
425
- * OK: Auto create destination directory path if doesn't exist
426
- * FAIL: When extracting not existing ZIP archive file
427
- * FAIL: When extracting try override existing directory with file or existing file with directory
428
-
429
- :::info
430
- The directory/folder you are extracting your ZIP file into has to be created BEFORE you start extracting the ZIP.
431
- :::
432
-
433
- ### Parameters
434
-
435
- | Param | Type | Required | Description |
436
- | ------ | ----- | -------- | ----- |
437
- | `archiveFilePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
438
- | `destinationFilePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
439
- | `archiveMethod` | string | <div class="red">Yes</div> | Available method is `zip` |
440
-
441
- ### Javascript Example
442
-
443
- ```javascript
444
- // Create directory 'test-dir' in a root directory
445
- await sos.fileSystem.createDirectory({ storageUnit: internalStorageUnit, filePath: 'test-dir' });
446
-
447
- // Extract ZIP file into the test-extracted directory
448
- await sos.fileSystem.extractFile(
449
- { storageUnit: internalStorageUnit, filePath: 'test-dir/test.zip' },
450
- { storageUnit: internalStorageUnit, filePath: 'test-dir/test-extracted' },
451
- 'zip',
452
- );
453
- ```
454
-
455
- ## createArchive()
456
-
457
- Creates a archive in a path with all files from `archiveEntries` array.
458
-
459
- * OK: Creates directory in path
460
- * FAIL: When creating directory over existing file or directory
461
- * FAIL: When creating directory in not existing containing (parent) directory
462
-
463
- :::warning
464
- - Never start OR end the `filePath` with a slash - `/`. It will cause error *50517*
465
- - It is a good practice to check if file exists - `exists()` prior creating it
466
- :::
467
-
468
- :::info
469
- - This function is available only on Tizen devices.
470
- - All files are added to the archive based on absolute path from root directory.
471
- :::
472
-
473
- ### Parameters
474
-
475
- | Param | Type | Required | Description |
476
- | ------ | ----- | -------- | ----- |
477
- | `archiveFilePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
478
- | `archiveEntries` | FilePath Array | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and array of all files which will be archived into newly created archive |
479
-
480
- ```javascript
481
- // Create archive 'test.zip' in a root directory with selected files
482
- await sos.fileSystem.createArchive(
483
- { storageUnit: internalStorageUnit, filePath: 'test.zip' },
484
- [
485
- { storageUnit: internalStorageUnit, filePath: 'test-dir/log.txt' },
486
- { storageUnit: internalStorageUnit, filePath: 'test-dir/log.1.txt' },
487
- ],
488
- );
489
-
490
- // Example with listFiles() function if you want to archive all files from directory
491
- const filesToArchive = await sos.fileSystem.listFiles({ storageUnit: internalStorageUnit, filePath: 'test-dir' });
492
- await sos.fileSystem.createArchive(
493
- { storageUnit: internalStorageUnit, filePath: 'test.zip' },
494
- filesToArchive,
495
- );
496
- ```
497
-
498
- ## createDirectory()
499
-
500
- Creates a directory in a path.
501
-
502
- * OK: Creates directory in path
503
- * FAIL: When creating directory over existing file or directory
504
- * FAIL: When creating directory in not existing containing (parent) directory
505
-
506
- :::warning
507
- - Never start OR end the `filePath` with a slash - `/`. It will cause error *50512*
508
- - It is a good practice to check if directory exists - `isDirectory()` prior creating it
509
- :::
510
-
511
- ### Parameters
512
-
513
- | Param | Type | Required | Description |
514
- | ----- | --------- | :-----: | --------- |
515
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
516
-
517
- ### Javascript Example
518
-
519
- ```javascript
520
- // Create directory 'test-dir' in a root directory
521
- await sos.fileSystem.createDirectory({ storageUnit: internalStorageUnit, filePath: 'test-dir' });
522
- ```
523
-
524
- ```javascript
525
- // Create multiple directories
526
- const myDirs = [
527
- 'dir1',
528
- 'dir2',
529
- 'dir1/dir3',
530
- ];
531
- await Promise.all(myDirs.map(async (dirname) => {
532
- const fp = { storageUnit: internalStorageUnit, filePath: `uploads/${dirname}` };
533
- if (!await sos.fileSystem.exists(fp)) {
534
- await sos.fileSystem.createDirectory(fp);
535
- }
536
- });
537
- // All dirs created
538
- ```
539
-
540
- ## isDirectory()
541
-
542
- Returns true if existing path is directory.
543
-
544
- * OK: Returns true if existing path is directory
545
- * OK: Returns false if existing path is file
546
- * FAIL: When path doesn't exist
547
-
548
- ### Parameters
549
-
550
- | Param | Type | Required | Description |
551
- | ------ | --------------- | :-----------: | ------ |
552
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
553
-
554
- ### Javascript Example
555
-
556
- ```javascript
557
- await sos.fileSystem.isDirectory({ storageUnit: internalStorageUnit, filePath: 'test-dir' });
558
- ```
559
-
560
- ## copyFile()
561
-
562
- Copy file OR directory to a new location.
563
-
564
- ### Parameters
565
-
566
- | Param | Type | Required | Description |
567
- | ------ | -------- | :----------: | ------ |
568
- | `sourceFilePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
569
- | `destinationFilePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
570
-
571
- ### Javascript Example
572
-
573
- ```javascript
574
- await sos.fileSystem.copyFile(
575
- { storageUnit: internalStorageUnit, filePath: 'test-dir/log.1.txt' },
576
- { storageUnit: internalStorageUnit, filePath: 'destination-dir/log.1.txt.backup' },
577
- );
578
- ```
579
-
580
- ## writeFile()
581
-
582
- Write into file directly:
583
-
584
- - string support only
585
- - override only
586
- - no append
587
-
588
- ### Parameters
589
-
590
- | Param | Type | Required | Description |
591
- | ------ | -------- | :------: | ---- |
592
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
593
- | `content` | String | <div class="red">Yes</div> | Parsed content as string |
594
-
595
-
596
- ### Javascript Example
597
-
598
- ```javascript
599
- await sos.fileSystem.writeFile(
600
- { storageUnit: internalStorageUnit, filePath: 'test-dir/log.txt' },
601
- 'My awesome log line\n',
602
- );
603
- ```
604
-
605
- ## appendFile()
606
-
607
- Append content into file directly:
608
-
609
- - string support only
610
- - append only
611
-
612
- ### Parameters
613
-
614
- | Param | Type | Required | Description |
615
- | ------ | -------- | :------: | ---- |
616
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
617
- | `content` | String | <div class="red">Yes</div> | Parsed content as string |
618
-
619
-
620
- ### Javascript Example
621
-
622
- ```javascript
623
- await sos.fileSystem.appendFile(
624
- { storageUnit: internalStorageUnit, filePath: 'test-dir/log.txt' },
625
- 'My awesome log line\n',
626
- );
627
- ```
628
-
629
- ## readFile()
630
- Read a text file.
631
-
632
- ### Parameters
633
-
634
- | Param | Type | Required | Description |
635
- | ----- | ---- | :-----: | ----- |
636
- | `filePath` | FilePath | <div class="red">Yes</div> | Object contains storageUnit object returned by `listStorageUnits()` and `filePath` if the file or directory |
637
-
638
- ### Javascript Example
639
- ```javascript
640
- // Written file can be read (coming soon)
641
- const logFileContent = await sos.fileSystem.readFile({ storageUnit: internalStorageUnit, filePath: 'test-dir/log.txt' });
642
- ```
643
-
644
- ### Returns
645
- ```json
646
- "content of your text file" // string
647
- ```
648
-
649
- ## Errors
650
- Although we are doing our best, following errors may occur when working with the file system.
651
-
652
- | Code | Type | Message |
653
- | ---- | ---- | ------- |
654
- | 50501 | InternalFileSystemError | Unexpected error occurred when listing storage units. |
655
- | 50502 | InternalFileSystemError | Unexpected error occurred when listing files. |
656
- | 50503 | InternalFileSystemError | Unexpected error occurred when checking for file existence. |
657
- | 50504 | InternalFileSystemError | Unexpected error occurred when getting a file. |
658
- | 50505 | InternalFileSystemError | Unexpected error occurred when writing a file. |
659
- | 50506 | InternalFileSystemError | Unexpected error occurred when copying a file. |
660
- | 50507 | InternalFileSystemError | Unexpected error occurred when moving a file. |
661
- | 50508 | InternalFileSystemError | Unexpected error occurred when deleting a file. |
662
- | 50509 | InternalFileSystemError | Unexpected error occurred when downloading a file. |
663
- | 50510 | InternalFileSystemError | Unexpected error occurred when extracting a file. |
664
- | 50511 | InternalFileSystemError | Unexpected error occurred when getting file checksum. |
665
- | 50512 | InternalFileSystemError | Unexpected error occurred when creating directory. |
666
- | 50513 | InternalFileSystemError | Unexpected error occurred when checking if a path is directory. |
667
- | 50514 | InternalFileSystemError | Unexpected error occurred when reading a file. |
668
- | 50515 | InternalFileSystemError | Unexpected error occurred when creating a link. |
669
- | 50516 | InternalFileSystemError | Link is not supported on this platform. |
670
- | 50518 | InternalFileSystemError | Unexpected error occurred when creating a archive file. |