@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.
- package/dist/bundle.js +5 -5
- package/dist/bundle.js.map +1 -1
- package/docs/fpath/index.md +316 -0
- package/docs/index.md +18 -85
- package/docs/sos/browser.md +210 -0
- package/docs/sos/command.md +68 -0
- package/docs/sos/debug.md +25 -0
- package/docs/sos/deviceInfo.md +49 -0
- package/docs/sos/display.md +21 -0
- package/docs/sos/fileSystem.md +594 -0
- package/docs/sos/hardware/barcodeScanner.md +40 -0
- package/docs/sos/hardware/index.md +64 -0
- package/docs/sos/hardware/led.md +14 -0
- package/docs/sos/index.md +82 -0
- package/docs/sos/input.md +73 -0
- package/docs/sos/monitors.md +21 -0
- package/docs/sos/native/index.md +5 -0
- package/docs/sos/native/mdc.md +240 -0
- package/docs/sos/offline/cache.md +183 -0
- package/docs/sos/offline/index.md +188 -0
- package/docs/sos/osd.md +13 -0
- package/docs/sos/proofOfPlay.md +37 -0
- package/docs/sos/stream.md +960 -0
- package/docs/sos/sync.md +298 -0
- package/docs/sos/video.md +285 -0
- package/docs/sos_management/app.md +102 -0
- package/docs/sos_management/audio.md +29 -0
- package/docs/sos_management/debug.md +33 -0
- package/docs/sos_management/firmware.md +86 -0
- package/docs/sos_management/index.md +212 -0
- package/docs/sos_management/network.md +197 -0
- package/docs/sos_management/os.md +54 -0
- package/docs/sos_management/package.md +33 -0
- package/docs/sos_management/power.md +136 -0
- package/docs/sos_management/proxy.md +41 -0
- package/docs/sos_management/remoteControl.md +72 -0
- package/docs/sos_management/screen.md +198 -0
- package/docs/sos_management/security.md +47 -0
- package/docs/sos_management/time.md +101 -0
- package/docs/sos_management/wifi.md +366 -0
- package/es6/FrontApplet/Browser/Browser.d.ts +61 -8
- package/es6/FrontApplet/Browser/Browser.js +92 -40
- package/es6/FrontApplet/Browser/Browser.js.map +1 -1
- package/es6/FrontApplet/Browser/IOpenLinkOptions.d.ts +2 -2
- package/es6/FrontApplet/Browser/events.d.ts +1 -1
- package/es6/FrontApplet/Browser/events.js +2 -2
- package/es6/FrontApplet/Browser/events.js.map +1 -1
- package/es6/FrontApplet/Browser/messages.d.ts +2 -2
- package/es6/FrontApplet/Command/Command.d.ts +37 -3
- package/es6/FrontApplet/Command/Command.js +52 -23
- package/es6/FrontApplet/Command/Command.js.map +1 -1
- package/es6/FrontApplet/Command/ICommandEvent.d.ts +6 -2
- package/es6/FrontApplet/Connect/Connect.d.ts +19 -0
- package/es6/FrontApplet/Connect/Connect.js +162 -0
- package/es6/FrontApplet/Connect/Connect.js.map +1 -0
- package/es6/FrontApplet/Connect/IConnectMessage.d.ts +4 -0
- package/es6/FrontApplet/{Stream/streamListeners.js → Connect/IConnectMessage.js} +1 -1
- package/es6/FrontApplet/Connect/IConnectMessage.js.map +1 -0
- package/es6/FrontApplet/Debug/Debug.d.ts +15 -1
- package/es6/FrontApplet/Debug/Debug.js +28 -18
- package/es6/FrontApplet/Debug/Debug.js.map +1 -1
- package/es6/FrontApplet/Debug/debugDecorator.d.ts +3 -3
- package/es6/FrontApplet/Debug/debugDecorator.js +15 -9
- package/es6/FrontApplet/Debug/debugDecorator.js.map +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +23 -0
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +36 -27
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
- package/es6/FrontApplet/Dimensions/coordinationsHelper.js +1 -2
- package/es6/FrontApplet/Dimensions/coordinationsHelper.js.map +1 -1
- package/es6/FrontApplet/Display/Display.d.ts +25 -3
- package/es6/FrontApplet/Display/Display.js +35 -19
- package/es6/FrontApplet/Display/Display.js.map +1 -1
- package/es6/FrontApplet/Display/IDisplay.d.ts +3 -1
- package/es6/FrontApplet/Error/AppletCommandError.js +12 -3
- package/es6/FrontApplet/Error/AppletCommandError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletError.js +10 -2
- package/es6/FrontApplet/Error/AppletError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletHardwareError.js +12 -3
- package/es6/FrontApplet/Error/AppletHardwareError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletOfflineCacheError.js +10 -2
- package/es6/FrontApplet/Error/AppletOfflineCacheError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletResourcesError.js +12 -3
- package/es6/FrontApplet/Error/AppletResourcesError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletSecurityError.js +12 -3
- package/es6/FrontApplet/Error/AppletSecurityError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletStreamError.js +10 -2
- package/es6/FrontApplet/Error/AppletStreamError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletVideoError.js +12 -3
- package/es6/FrontApplet/Error/AppletVideoError.js.map +1 -1
- package/es6/FrontApplet/Error/ErrorCodesMessages.js +4 -1
- package/es6/FrontApplet/Error/ErrorCodesMessages.js.map +1 -1
- package/es6/FrontApplet/Error/ErrorSuggestions.js +1 -0
- package/es6/FrontApplet/Error/ErrorSuggestions.js.map +1 -1
- package/es6/FrontApplet/Error/FileNotFoundError.js +10 -2
- package/es6/FrontApplet/Error/FileNotFoundError.js.map +1 -1
- package/es6/FrontApplet/Error/SosError.js +5 -1
- package/es6/FrontApplet/Error/SosError.js.map +1 -1
- package/es6/FrontApplet/Error/errorHelper.js +5 -6
- package/es6/FrontApplet/Error/errorHelper.js.map +1 -1
- package/es6/FrontApplet/Exchange/Exchange.js +7 -14
- package/es6/FrontApplet/Exchange/Exchange.js.map +1 -1
- package/es6/FrontApplet/FileSystem/FileSystem.d.ts +156 -1
- package/es6/FrontApplet/FileSystem/FileSystem.js +318 -195
- package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
- package/es6/FrontApplet/FileSystem/HashAlgorithm.d.ts +2 -0
- package/es6/FrontApplet/{Input/IKeyUpEventListener.js → FileSystem/HashAlgorithm.js} +1 -1
- package/es6/FrontApplet/FileSystem/HashAlgorithm.js.map +1 -0
- package/es6/FrontApplet/Font/fontFaceGenerator.js.map +1 -1
- package/es6/FrontApplet/FrontApplet.d.ts +57 -4
- package/es6/FrontApplet/FrontApplet.js +129 -49
- package/es6/FrontApplet/FrontApplet.js.map +1 -1
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.d.ts +2 -0
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js +35 -54
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js.map +1 -1
- package/es6/FrontApplet/Hardware/Hardware.d.ts +16 -2
- package/es6/FrontApplet/Hardware/Hardware.js +31 -19
- package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
- package/es6/FrontApplet/Hardware/IHardware.d.ts +2 -2
- package/es6/FrontApplet/Hardware/ISerialPort.d.ts +16 -0
- package/es6/FrontApplet/Hardware/ISerialPortOptions.js +1 -1
- package/es6/FrontApplet/Hardware/ISerialPortOptions.js.map +1 -1
- package/es6/FrontApplet/Hardware/Led/Led.d.ts +8 -0
- package/es6/FrontApplet/Hardware/Led/Led.js +22 -20
- package/es6/FrontApplet/Hardware/Led/Led.js.map +1 -1
- package/es6/FrontApplet/Hardware/SerialPort.d.ts +1 -1
- package/es6/FrontApplet/Hardware/SerialPort.js +15 -23
- package/es6/FrontApplet/Hardware/SerialPort.js.map +1 -1
- package/es6/FrontApplet/Hash/generator.js +2 -3
- package/es6/FrontApplet/Hash/generator.js.map +1 -1
- package/es6/FrontApplet/Iframe/Iframe.d.ts +9 -8
- package/es6/FrontApplet/Iframe/Iframe.js +10 -0
- package/es6/FrontApplet/Iframe/Iframe.js.map +1 -1
- package/es6/FrontApplet/Input/IInput.d.ts +1 -2
- package/es6/FrontApplet/Input/IKeyUpEvent.d.ts +32 -2
- package/es6/FrontApplet/Input/IKeyUpEvent.js +32 -0
- package/es6/FrontApplet/Input/IKeyUpEvent.js.map +1 -1
- package/es6/FrontApplet/Input/Input.d.ts +19 -3
- package/es6/FrontApplet/Input/Input.js +44 -23
- package/es6/FrontApplet/Input/Input.js.map +1 -1
- package/es6/FrontApplet/Management/App/App.d.ts +48 -10
- package/es6/FrontApplet/Management/App/App.js +45 -30
- package/es6/FrontApplet/Management/App/App.js.map +1 -1
- package/es6/FrontApplet/Management/App/IApp.d.ts +3 -1
- package/es6/FrontApplet/Management/Audio/Audio.d.ts +16 -0
- package/es6/FrontApplet/Management/Audio/Audio.js +30 -22
- package/es6/FrontApplet/Management/Audio/Audio.js.map +1 -1
- package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.d.ts +4 -0
- package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js +15 -22
- package/es6/FrontApplet/Management/AutoRecovery/AutoRecovery.js.map +1 -1
- package/es6/FrontApplet/Management/AutoRecovery/IAutoRecovery.d.ts +1 -1
- package/es6/FrontApplet/Management/AutoRecovery/IAutoRecovery.js +5 -2
- package/es6/FrontApplet/Management/AutoRecovery/IAutoRecovery.js.map +1 -1
- package/es6/FrontApplet/Management/Debug/Debug.d.ts +19 -0
- package/es6/FrontApplet/Management/Debug/Debug.js +37 -30
- package/es6/FrontApplet/Management/Debug/Debug.js.map +1 -1
- package/es6/FrontApplet/Management/Firmware/Firmware.d.ts +37 -10
- package/es6/FrontApplet/Management/Firmware/Firmware.js +34 -30
- package/es6/FrontApplet/Management/Firmware/Firmware.js.map +1 -1
- package/es6/FrontApplet/Management/Firmware/IFirmware.d.ts +1 -2
- package/es6/FrontApplet/Management/IManagement.d.ts +3 -1
- package/es6/FrontApplet/Management/Management.d.ts +106 -15
- package/es6/FrontApplet/Management/Management.js +191 -113
- package/es6/FrontApplet/Management/Management.js.map +1 -1
- package/es6/FrontApplet/Management/Network/INetworkInfo.d.ts +2 -2
- package/es6/FrontApplet/Management/Network/Network.d.ts +56 -8
- package/es6/FrontApplet/Management/Network/Network.js +86 -68
- package/es6/FrontApplet/Management/Network/Network.js.map +1 -1
- package/es6/FrontApplet/Management/OS/OS.d.ts +20 -0
- package/es6/FrontApplet/Management/OS/OS.js +34 -27
- package/es6/FrontApplet/Management/OS/OS.js.map +1 -1
- package/es6/FrontApplet/Management/Package/Package.d.ts +20 -0
- package/es6/FrontApplet/Management/Package/Package.js +37 -22
- package/es6/FrontApplet/Management/Package/Package.js.map +1 -1
- package/es6/FrontApplet/Management/PeerRecovery/IPeerRecovery.d.ts +1 -1
- package/es6/FrontApplet/Management/PeerRecovery/IPeerRecovery.js +5 -2
- package/es6/FrontApplet/Management/PeerRecovery/IPeerRecovery.js.map +1 -1
- package/es6/FrontApplet/Management/PeerRecovery/PeerRecovery.d.ts +4 -0
- package/es6/FrontApplet/Management/PeerRecovery/PeerRecovery.js +15 -22
- package/es6/FrontApplet/Management/PeerRecovery/PeerRecovery.js.map +1 -1
- package/es6/FrontApplet/Management/Power/Power.d.ts +64 -0
- package/es6/FrontApplet/Management/Power/Power.js +160 -115
- package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
- package/es6/FrontApplet/Management/Proxy/Proxy.d.ts +21 -0
- package/es6/FrontApplet/Management/Proxy/Proxy.js +41 -35
- package/es6/FrontApplet/Management/Proxy/Proxy.js.map +1 -1
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.d.ts +43 -0
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js +63 -39
- package/es6/FrontApplet/Management/RemoteControl/RemoteControl.js.map +1 -1
- package/es6/FrontApplet/Management/Screen/IOrientation.d.ts +1 -1
- package/es6/FrontApplet/Management/Screen/Screen.d.ts +127 -0
- package/es6/FrontApplet/Management/Screen/Screen.js +197 -89
- package/es6/FrontApplet/Management/Screen/Screen.js.map +1 -1
- package/es6/FrontApplet/Management/Security/Security.d.ts +20 -5
- package/es6/FrontApplet/Management/Security/Security.js +33 -31
- package/es6/FrontApplet/Management/Security/Security.js.map +1 -1
- package/es6/FrontApplet/Management/Time/Time.d.ts +31 -5
- package/es6/FrontApplet/Management/Time/Time.js +49 -40
- package/es6/FrontApplet/Management/Time/Time.js.map +1 -1
- package/es6/FrontApplet/Management/Wifi/IWifiEvent.d.ts +19 -1
- package/es6/FrontApplet/Management/Wifi/IWifiEvent.js +19 -1
- package/es6/FrontApplet/Management/Wifi/IWifiEvent.js.map +1 -1
- package/es6/FrontApplet/Management/Wifi/Wifi.d.ts +108 -7
- package/es6/FrontApplet/Management/Wifi/Wifi.js +162 -86
- package/es6/FrontApplet/Management/Wifi/Wifi.js.map +1 -1
- package/es6/FrontApplet/Management/helpers/DeviceHelper.js +2 -2
- package/es6/FrontApplet/Management/helpers/DeviceHelper.js.map +1 -1
- package/es6/FrontApplet/Management/helpers/ProprietaryTimerHelper.d.ts +1 -1
- package/es6/FrontApplet/Management/helpers/SecurityHelper.js +8 -6
- package/es6/FrontApplet/Management/helpers/SecurityHelper.js.map +1 -1
- package/es6/FrontApplet/Management/helpers/TimerHelper.js +2 -2
- package/es6/FrontApplet/Management/helpers/TimerHelper.js.map +1 -1
- package/es6/FrontApplet/Management/helpers/UpgradeHelper.js +35 -3
- package/es6/FrontApplet/Management/helpers/UpgradeHelper.js.map +1 -1
- package/es6/FrontApplet/Management/helpers/VideoHelper.js +1 -1
- package/es6/FrontApplet/Management/helpers/VideoHelper.js.map +1 -1
- package/es6/FrontApplet/Monitors/Monitors.d.ts +9 -0
- package/es6/FrontApplet/Monitors/Monitors.js +16 -16
- package/es6/FrontApplet/Monitors/Monitors.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/MDC/CodesMDC.js +1 -1
- package/es6/FrontApplet/NativeCommands/MDC/CodesMDC.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.d.ts +52 -3
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js +79 -38
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/NativeCommands.d.ts +4 -0
- package/es6/FrontApplet/NativeCommands/NativeCommands.js +12 -2
- package/es6/FrontApplet/NativeCommands/NativeCommands.js.map +1 -1
- package/es6/FrontApplet/OSD/OSD.d.ts +9 -0
- package/es6/FrontApplet/OSD/OSD.js +15 -15
- package/es6/FrontApplet/OSD/OSD.js.map +1 -1
- package/es6/FrontApplet/Offline/Cache/Cache.d.ts +91 -2
- package/es6/FrontApplet/Offline/Cache/Cache.js +193 -131
- package/es6/FrontApplet/Offline/Cache/Cache.js.map +1 -1
- package/es6/FrontApplet/Offline/Flags/AppendFlagController.d.ts +1 -1
- package/es6/FrontApplet/Offline/Flags/AppendFlagController.js +18 -26
- package/es6/FrontApplet/Offline/Flags/AppendFlagController.js.map +1 -1
- package/es6/FrontApplet/Offline/Flags/IFlags.d.ts +5 -5
- package/es6/FrontApplet/Offline/IAddFont.d.ts +3 -1
- package/es6/FrontApplet/Offline/IAddFont.js.map +1 -1
- package/es6/FrontApplet/Offline/IFileType.d.ts +1 -1
- package/es6/FrontApplet/Offline/ISaveFile.js +5 -2
- package/es6/FrontApplet/Offline/ISaveFile.js.map +1 -1
- package/es6/FrontApplet/Offline/LoadFile/CssLoadFileController.js +2 -1
- package/es6/FrontApplet/Offline/LoadFile/CssLoadFileController.js.map +1 -1
- package/es6/FrontApplet/Offline/LoadFile/JavascriptLoadFileController.js +2 -1
- package/es6/FrontApplet/Offline/LoadFile/JavascriptLoadFileController.js.map +1 -1
- package/es6/FrontApplet/Offline/Offline.d.ts +79 -8
- package/es6/FrontApplet/Offline/Offline.js +119 -59
- package/es6/FrontApplet/Offline/Offline.js.map +1 -1
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.d.ts +19 -1
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js +41 -29
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -1
- package/es6/FrontApplet/Sensors/Proximity.d.ts +4 -3
- package/es6/FrontApplet/Sensors/Proximity.js +13 -5
- package/es6/FrontApplet/Sensors/Proximity.js.map +1 -1
- package/es6/FrontApplet/Sensors/Sensors.d.ts +3 -1
- package/es6/FrontApplet/Sensors/Sensors.js +9 -2
- package/es6/FrontApplet/Sensors/Sensors.js.map +1 -1
- package/es6/FrontApplet/Stream/IStream.d.ts +10 -10
- package/es6/FrontApplet/Stream/IStreamMessage.d.ts +1 -1
- package/es6/FrontApplet/Stream/IStreamTrackInfo.d.ts +2 -2
- package/es6/FrontApplet/Stream/Stream.d.ts +130 -15
- package/es6/FrontApplet/Stream/Stream.js +262 -163
- package/es6/FrontApplet/Stream/Stream.js.map +1 -1
- package/es6/FrontApplet/Stream/StreamProtocol.js.map +1 -1
- package/es6/FrontApplet/Stream/streamEvents.d.ts +1 -1
- package/es6/FrontApplet/Sync/Sync.d.ts +152 -6
- package/es6/FrontApplet/Sync/Sync.js +199 -115
- package/es6/FrontApplet/Sync/Sync.js.map +1 -1
- package/es6/FrontApplet/Sync/syncEvents.d.ts +3 -1
- package/es6/FrontApplet/Sync/syncMessages.js +1 -1
- package/es6/FrontApplet/Sync/syncMessages.js.map +1 -1
- package/es6/FrontApplet/Timing/Timing.d.ts +1 -0
- package/es6/FrontApplet/Timing/Timing.js +9 -2
- package/es6/FrontApplet/Timing/Timing.js.map +1 -1
- package/es6/FrontApplet/Timing/Triggers/ITimingTriggersMessage.d.ts +1 -1
- package/es6/FrontApplet/Timing/Triggers/Triggers.d.ts +9 -0
- package/es6/FrontApplet/Timing/Triggers/Triggers.js +16 -18
- package/es6/FrontApplet/Timing/Triggers/Triggers.js.map +1 -1
- package/es6/FrontApplet/Touch/Touch.d.ts +3 -0
- package/es6/FrontApplet/Touch/Touch.js +13 -3
- package/es6/FrontApplet/Touch/Touch.js.map +1 -1
- package/es6/FrontApplet/Validate/Validate.d.ts +5 -5
- package/es6/FrontApplet/Validate/Validate.js +27 -24
- package/es6/FrontApplet/Validate/Validate.js.map +1 -1
- package/es6/FrontApplet/Validate/ValidateObjectInterface.js +7 -2
- package/es6/FrontApplet/Validate/ValidateObjectInterface.js.map +1 -1
- package/es6/FrontApplet/Video/IOptions.d.ts +8 -1
- package/es6/FrontApplet/Video/IVideo.d.ts +8 -8
- package/es6/FrontApplet/Video/IVideoEvent.d.ts +1 -1
- package/es6/FrontApplet/Video/IVideoEvent.js +3 -3
- package/es6/FrontApplet/Video/IVideoEvent.js.map +1 -1
- package/es6/FrontApplet/Video/IVideoMessage.d.ts +1 -1
- package/es6/FrontApplet/Video/Video.d.ts +84 -12
- package/es6/FrontApplet/Video/Video.js +196 -137
- package/es6/FrontApplet/Video/Video.js.map +1 -1
- package/es6/FrontApplet/createFrontApplet.js +5 -2
- package/es6/FrontApplet/createFrontApplet.js.map +1 -1
- package/es6/Monitoring/Console/consoleCommands.d.ts +1 -1
- package/es6/Monitoring/Display/displayCommands.d.ts +1 -1
- package/es6/Monitoring/Display/handleDisplayRequests.d.ts +2 -2
- package/es6/Monitoring/Display/handleDisplayRequests.js +5 -15
- package/es6/Monitoring/Display/handleDisplayRequests.js.map +1 -1
- package/es6/Monitoring/EmptyObject.d.ts +1 -1
- package/es6/Monitoring/FileSystem/fileSystemCommands.d.ts +10 -1
- package/es6/Monitoring/FileSystem/fileSystemCommands.js +3 -1
- package/es6/Monitoring/FileSystem/fileSystemCommands.js.map +1 -1
- package/es6/Monitoring/FileSystem/handleFileSystemRequests.d.ts +2 -2
- package/es6/Monitoring/FileSystem/handleFileSystemRequests.js +41 -45
- package/es6/Monitoring/FileSystem/handleFileSystemRequests.js.map +1 -1
- package/es6/Monitoring/Html/handleHtmlSnapshotTakingRequests.d.ts +2 -2
- package/es6/Monitoring/Html/handleHtmlSnapshotTakingRequests.js +4 -14
- package/es6/Monitoring/Html/handleHtmlSnapshotTakingRequests.js.map +1 -1
- package/es6/Monitoring/Management/App/applicationCommands.d.ts +1 -1
- package/es6/Monitoring/Management/App/handleApplicationRequests.d.ts +2 -2
- package/es6/Monitoring/Management/App/handleApplicationRequests.js +9 -19
- package/es6/Monitoring/Management/App/handleApplicationRequests.js.map +1 -1
- package/es6/Monitoring/Management/Audio/audioCommands.d.ts +1 -1
- package/es6/Monitoring/Management/Audio/handleAudioRequests.d.ts +2 -2
- package/es6/Monitoring/Management/Audio/handleAudioRequests.js +7 -17
- package/es6/Monitoring/Management/Audio/handleAudioRequests.js.map +1 -1
- package/es6/Monitoring/Management/AutoRecovery/autoRecoveryCommands.d.ts +1 -1
- package/es6/Monitoring/Management/AutoRecovery/handleAutoRecoveryRequests.d.ts +2 -2
- package/es6/Monitoring/Management/AutoRecovery/handleAutoRecoveryRequests.js +7 -17
- package/es6/Monitoring/Management/AutoRecovery/handleAutoRecoveryRequests.js.map +1 -1
- package/es6/Monitoring/Management/Debug/debugCommands.d.ts +1 -1
- package/es6/Monitoring/Management/Debug/handleDebugRequests.d.ts +2 -2
- package/es6/Monitoring/Management/Debug/handleDebugRequests.js +9 -19
- package/es6/Monitoring/Management/Debug/handleDebugRequests.js.map +1 -1
- package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.d.ts +2 -2
- package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.js +11 -21
- package/es6/Monitoring/Management/Network/handleManagementNetworkRequests.js.map +1 -1
- package/es6/Monitoring/Management/Network/managementNetworkCommands.d.ts +1 -1
- package/es6/Monitoring/Management/Os/managementOsRequests.d.ts +2 -2
- package/es6/Monitoring/Management/Os/managementOsRequests.js +9 -19
- package/es6/Monitoring/Management/Os/managementOsRequests.js.map +1 -1
- package/es6/Monitoring/Management/Os/osCommands.d.ts +1 -1
- package/es6/Monitoring/Management/PeerRecovery/handlePeerRecoveryRequests.d.ts +2 -2
- package/es6/Monitoring/Management/PeerRecovery/handlePeerRecoveryRequests.js +7 -17
- package/es6/Monitoring/Management/PeerRecovery/handlePeerRecoveryRequests.js.map +1 -1
- package/es6/Monitoring/Management/PeerRecovery/peerRecoveryCommands.d.ts +1 -1
- package/es6/Monitoring/Management/Power/handlePowerRequests.d.ts +2 -2
- package/es6/Monitoring/Management/Power/handlePowerRequests.js +19 -29
- package/es6/Monitoring/Management/Power/handlePowerRequests.js.map +1 -1
- package/es6/Monitoring/Management/Power/powerCommands.d.ts +1 -1
- package/es6/Monitoring/Management/RemoteControl/handleRemoteControlRequests.d.ts +2 -2
- package/es6/Monitoring/Management/RemoteControl/handleRemoteControlRequests.js +15 -25
- package/es6/Monitoring/Management/RemoteControl/handleRemoteControlRequests.js.map +1 -1
- package/es6/Monitoring/Management/RemoteControl/remoteControlCommands.d.ts +1 -1
- package/es6/Monitoring/Management/Screen/handleScreenRequests.d.ts +2 -2
- package/es6/Monitoring/Management/Screen/handleScreenRequests.js +19 -29
- package/es6/Monitoring/Management/Screen/handleScreenRequests.js.map +1 -1
- package/es6/Monitoring/Management/Screen/screenCommands.d.ts +1 -1
- package/es6/Monitoring/Management/Security/handleSecurityCommands.d.ts +2 -2
- package/es6/Monitoring/Management/Security/handleSecurityCommands.js +9 -19
- package/es6/Monitoring/Management/Security/handleSecurityCommands.js.map +1 -1
- package/es6/Monitoring/Management/Security/securityCommands.d.ts +1 -1
- package/es6/Monitoring/Management/Time/handleTimeCommands.d.ts +2 -2
- package/es6/Monitoring/Management/Time/handleTimeCommands.js +9 -19
- package/es6/Monitoring/Management/Time/handleTimeCommands.js.map +1 -1
- package/es6/Monitoring/Management/Time/timeCommands.d.ts +1 -1
- package/es6/Monitoring/Management/handleManagementRequests.d.ts +2 -2
- package/es6/Monitoring/Management/handleManagementRequests.js +23 -33
- package/es6/Monitoring/Management/handleManagementRequests.js.map +1 -1
- package/es6/Monitoring/Management/managementCommands.d.ts +1 -1
- package/es6/Monitoring/{Montoring.d.ts → Monitoring.d.ts} +1 -0
- package/es6/Monitoring/Monitoring.js +83 -0
- package/es6/Monitoring/Monitoring.js.map +1 -0
- package/es6/Monitoring/NativeCommands/handleNativeCommands.d.ts +2 -2
- package/es6/Monitoring/NativeCommands/handleNativeCommands.js +5 -15
- package/es6/Monitoring/NativeCommands/handleNativeCommands.js.map +1 -1
- package/es6/Monitoring/NativeCommands/nativeMdcCommands.d.ts +1 -1
- package/es6/Monitoring/OSD/handleOsdRequests.d.ts +2 -2
- package/es6/Monitoring/OSD/handleOsdRequests.js +5 -15
- package/es6/Monitoring/OSD/handleOsdRequests.js.map +1 -1
- package/es6/Monitoring/Offline/Cache/handleOfflineCacheRequests.d.ts +2 -2
- package/es6/Monitoring/Offline/Cache/handleOfflineCacheRequests.js +23 -33
- package/es6/Monitoring/Offline/Cache/handleOfflineCacheRequests.js.map +1 -1
- package/es6/Monitoring/Video/handleVideoRequests.d.ts +2 -2
- package/es6/Monitoring/Video/handleVideoRequests.js +36 -9
- package/es6/Monitoring/Video/handleVideoRequests.js.map +1 -1
- package/es6/Monitoring/handleMonitoringRequests.d.ts +2 -2
- package/es6/Monitoring/handleMonitoringRequests.js +6 -16
- package/es6/Monitoring/handleMonitoringRequests.js.map +1 -1
- package/es6/Monitoring/monitoringCommands.d.ts +1 -1
- package/es6/Sensors/IButton.js +1 -1
- package/es6/Sensors/IButton.js.map +1 -1
- package/es6/Sensors/IRfidAntenna.d.ts +1 -1
- package/es6/Sensors/IRfidAntenna.js +1 -1
- package/es6/Sensors/IRfidAntenna.js.map +1 -1
- package/es6/Util/Console/enhancer.d.ts +11 -0
- package/es6/Util/Console/enhancer.js +23 -0
- package/es6/Util/Console/enhancer.js.map +1 -0
- package/es6/bundle.d.ts +1 -1
- package/es6/bundle.js +12 -5
- package/es6/bundle.js.map +1 -1
- package/es6/fpath.d.ts +1 -1
- package/es6/fpath.js +34 -1
- package/es6/fpath.js.map +1 -1
- package/es6/utils/types.d.ts +1 -0
- package/es6/{FrontApplet/Video/IVideoEventListener.js → utils/types.js} +1 -1
- package/es6/utils/types.js.map +1 -0
- package/package.json +28 -26
- package/CHANGELOG.md +0 -480
- package/docs/applet-basics.md +0 -272
- package/docs/content/js-applet-resources.md +0 -154
- package/docs/content/js-browser.md +0 -163
- package/docs/content/js-command.md +0 -154
- package/docs/content/js-debug.md +0 -36
- package/docs/content/js-device-info.md +0 -56
- package/docs/content/js-display.md +0 -56
- package/docs/content/js-file-system.md +0 -670
- package/docs/content/js-fonts.md +0 -115
- package/docs/content/js-hardware.md +0 -55
- package/docs/content/js-iframes.md +0 -66
- package/docs/content/js-input.md +0 -71
- package/docs/content/js-offline-cache-media-files.md +0 -257
- package/docs/content/js-offline-cache-simple-data.md +0 -129
- package/docs/content/js-osd.md +0 -32
- package/docs/content/js-proof-of-play.md +0 -60
- package/docs/content/js-sensors.md +0 -70
- package/docs/content/js-serial.md +0 -165
- package/docs/content/js-sync-playback.md +0 -384
- package/docs/content/js-video-inputs-internal-ports.md +0 -131
- package/docs/content/js-video-stream.md +0 -618
- package/docs/content/js-video.md +0 -232
- package/docs/management/js-management-application.md +0 -107
- package/docs/management/js-management-audio.md +0 -44
- package/docs/management/js-management-debug.md +0 -40
- package/docs/management/js-management-firmware.md +0 -93
- package/docs/management/js-management-management.md +0 -178
- package/docs/management/js-management-monitoring-commands.md +0 -107
- package/docs/management/js-management-monitors.md +0 -55
- package/docs/management/js-management-native-commands-mdc.md +0 -90
- package/docs/management/js-management-network.md +0 -223
- package/docs/management/js-management-os.md +0 -62
- package/docs/management/js-management-package.md +0 -48
- package/docs/management/js-management-power.md +0 -175
- package/docs/management/js-management-proxy.md +0 -81
- package/docs/management/js-management-remote-control.md +0 -58
- package/docs/management/js-management-screen.md +0 -225
- package/docs/management/js-management-security.md +0 -71
- package/docs/management/js-management-time.md +0 -161
- package/docs/management/js-management-wifi.md +0 -341
- package/es6/FrontApplet/Command/ICommandEventListener.d.ts +0 -6
- package/es6/FrontApplet/Command/ICommandEventListener.js +0 -3
- package/es6/FrontApplet/Command/ICommandEventListener.js.map +0 -1
- package/es6/FrontApplet/Input/IKeyUpEventListener.d.ts +0 -5
- package/es6/FrontApplet/Input/IKeyUpEventListener.js.map +0 -1
- package/es6/FrontApplet/Management/Firmware/FirmwareType.d.ts +0 -4
- package/es6/FrontApplet/Management/Firmware/FirmwareType.js +0 -9
- package/es6/FrontApplet/Management/Firmware/FirmwareType.js.map +0 -1
- package/es6/FrontApplet/Stream/streamListeners.d.ts +0 -10
- package/es6/FrontApplet/Stream/streamListeners.js.map +0 -1
- package/es6/FrontApplet/Video/IVideoEventListener.d.ts +0 -5
- package/es6/FrontApplet/Video/IVideoEventListener.js.map +0 -1
- package/es6/Monitoring/Montoring.js +0 -131
- 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. |
|