@ledgerhq/device-management-kit 0.6.4 → 0.7.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 (716) hide show
  1. package/README.md +61 -8
  2. package/lib/cjs/package.json +23 -23
  3. package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
  4. package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
  5. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  6. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +3 -3
  7. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
  8. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
  9. package/lib/cjs/src/api/DmkConfig.js +1 -1
  10. package/lib/cjs/src/api/DmkConfig.js.map +1 -1
  11. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  12. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  13. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  14. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  15. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  16. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  17. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  18. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  19. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
  20. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  21. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  22. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  23. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  24. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  25. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
  26. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  27. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  28. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  29. package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
  30. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +3 -3
  31. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
  32. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +3 -3
  33. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  34. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  35. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  36. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  37. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  38. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  39. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  40. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  41. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  42. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  43. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -1
  44. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
  45. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  46. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  47. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  48. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  49. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  50. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  51. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +2 -0
  52. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  53. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  54. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  55. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  56. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  57. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
  58. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
  59. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  60. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  61. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  62. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  63. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
  64. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  65. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  66. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  67. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  68. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  69. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  70. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  71. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
  72. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  73. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  74. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  75. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  76. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  77. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  78. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  79. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  80. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  81. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  82. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  83. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  84. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  85. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  86. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  87. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  88. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  89. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  90. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  91. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  92. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  93. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  94. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  95. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  96. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  97. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
  98. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
  99. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  100. package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
  101. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
  102. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +1 -1
  103. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +3 -3
  104. package/lib/cjs/src/api/index.js +1 -1
  105. package/lib/cjs/src/api/index.js.map +3 -3
  106. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  107. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
  108. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  109. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  110. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +1 -1
  111. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +3 -3
  112. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
  113. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
  114. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
  115. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
  116. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +2 -0
  117. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
  118. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  119. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  120. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +1 -1
  121. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +3 -3
  122. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  123. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  124. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
  125. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
  126. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
  127. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
  128. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +2 -0
  129. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
  130. package/lib/cjs/src/api/secure-channel/utils.test.js +1 -1
  131. package/lib/cjs/src/api/secure-channel/utils.test.js.map +2 -2
  132. package/lib/cjs/src/api/transport/model/DeviceApduSender.js +2 -0
  133. package/lib/cjs/src/api/transport/model/DeviceApduSender.js.map +7 -0
  134. package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
  135. package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
  136. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  137. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  138. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
  139. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  140. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  141. package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
  142. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
  143. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
  144. package/lib/cjs/src/api/types.js +1 -1
  145. package/lib/cjs/src/api/types.js.map +1 -1
  146. package/lib/cjs/src/di.js +1 -1
  147. package/lib/cjs/src/di.js.map +2 -2
  148. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
  149. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  150. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
  151. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
  152. package/lib/cjs/src/internal/device-session/model/DevicePinger.js +2 -0
  153. package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +7 -0
  154. package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js +2 -0
  155. package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
  156. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  157. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  158. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  159. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  160. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js +2 -0
  161. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
  162. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
  163. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
  164. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  165. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  166. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  167. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
  168. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
  169. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
  170. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
  171. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
  172. package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
  173. package/lib/cjs/src/internal/device-session/model/Frame.js.map +3 -3
  174. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  175. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  176. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  177. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  178. package/lib/cjs/src/internal/device-session/service/MutexService.js +2 -0
  179. package/lib/cjs/src/internal/device-session/service/MutexService.js.map +7 -0
  180. package/lib/cjs/src/internal/device-session/service/MutexService.test.js +2 -0
  181. package/lib/cjs/src/internal/device-session/service/MutexService.test.js.map +7 -0
  182. package/lib/cjs/src/internal/device-session/service/RefresherService.js +1 -1
  183. package/lib/cjs/src/internal/device-session/service/RefresherService.js.map +3 -3
  184. package/lib/cjs/src/internal/device-session/service/RefresherService.test.js +1 -1
  185. package/lib/cjs/src/internal/device-session/service/RefresherService.test.js.map +3 -3
  186. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  187. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  188. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  189. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  190. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  191. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  192. package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
  193. package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
  194. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  195. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  196. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  197. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  198. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  199. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  200. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  201. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  202. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  203. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  204. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
  205. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
  206. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  207. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  208. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  209. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  210. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  211. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  212. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  213. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  214. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  215. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  216. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  217. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  218. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  219. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  220. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
  221. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  222. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  223. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  224. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  225. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  226. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  227. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  228. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  229. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  230. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js +1 -1
  231. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  232. package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
  233. package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
  234. package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
  235. package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
  236. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  237. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  238. package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
  239. package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
  240. package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
  241. package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
  242. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  243. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  244. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  245. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  246. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
  247. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
  248. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  249. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  250. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  251. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  252. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +1 -1
  253. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +2 -2
  254. package/lib/cjs/src/internal/secure-channel/model/Params.js +1 -1
  255. package/lib/cjs/src/internal/secure-channel/model/Params.js.map +1 -1
  256. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  257. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  258. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  259. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  260. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +1 -1
  261. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +1 -1
  262. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
  263. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  264. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  265. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  266. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  267. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  268. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
  269. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  270. package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
  271. package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
  272. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  273. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  274. package/lib/esm/package.json +23 -23
  275. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  276. package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
  277. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  278. package/lib/esm/src/api/DeviceManagementKit.test.js.map +3 -3
  279. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  280. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  281. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  282. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  283. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  284. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  285. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  286. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  287. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  288. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  289. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
  290. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  291. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  292. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  293. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  294. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  295. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
  296. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  297. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  298. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  299. package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
  300. package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
  301. package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
  302. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +3 -3
  303. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  304. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  305. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  306. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  307. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  308. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  309. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  310. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  311. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  312. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  313. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  314. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  315. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  316. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  317. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  318. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  319. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  320. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  321. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  322. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  323. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  324. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  325. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  326. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  327. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  328. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  329. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  330. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  331. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  332. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  333. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  334. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  335. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  336. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  337. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  338. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  339. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  340. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  341. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  342. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  343. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  344. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  345. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  346. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  347. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  348. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  349. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  350. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  351. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  352. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  353. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  354. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  355. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  356. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  357. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  358. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  359. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  360. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  361. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  362. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  363. package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
  364. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  365. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +1 -1
  366. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +3 -3
  367. package/lib/esm/src/api/index.js +1 -1
  368. package/lib/esm/src/api/index.js.map +3 -3
  369. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  370. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
  371. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  372. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  373. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +1 -1
  374. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +3 -3
  375. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
  376. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
  377. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
  378. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
  379. package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js +1 -0
  380. package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
  381. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  382. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  383. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +1 -1
  384. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +3 -3
  385. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  386. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
  387. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
  388. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
  389. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
  390. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js +1 -0
  391. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
  392. package/lib/esm/src/api/secure-channel/utils.test.js +1 -1
  393. package/lib/esm/src/api/secure-channel/utils.test.js.map +2 -2
  394. package/lib/esm/src/api/transport/model/DeviceApduSender.js +1 -0
  395. package/lib/esm/src/api/transport/model/DeviceApduSender.js.map +7 -0
  396. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  397. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  398. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  399. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  400. package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
  401. package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
  402. package/lib/esm/src/di.js +1 -1
  403. package/lib/esm/src/di.js.map +3 -3
  404. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
  405. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  406. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
  407. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
  408. package/lib/esm/src/internal/device-session/model/DevicePinger.js +2 -0
  409. package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +7 -0
  410. package/lib/esm/src/internal/device-session/model/DevicePinger.test.js +2 -0
  411. package/lib/esm/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
  412. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  413. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  414. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  415. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  416. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js +2 -0
  417. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
  418. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
  419. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
  420. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  421. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  422. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  423. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
  424. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
  425. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
  426. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
  427. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
  428. package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
  429. package/lib/esm/src/internal/device-session/model/Frame.js.map +3 -3
  430. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  431. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  432. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  433. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  434. package/lib/esm/src/internal/device-session/service/MutexService.js +2 -0
  435. package/lib/esm/src/internal/device-session/service/MutexService.js.map +7 -0
  436. package/lib/esm/src/internal/device-session/service/MutexService.test.js +2 -0
  437. package/lib/esm/src/internal/device-session/service/MutexService.test.js.map +7 -0
  438. package/lib/esm/src/internal/device-session/service/RefresherService.js +1 -1
  439. package/lib/esm/src/internal/device-session/service/RefresherService.js.map +3 -3
  440. package/lib/esm/src/internal/device-session/service/RefresherService.test.js +1 -1
  441. package/lib/esm/src/internal/device-session/service/RefresherService.test.js.map +3 -3
  442. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  443. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  444. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  445. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  446. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  447. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  448. package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
  449. package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
  450. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  451. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  452. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  453. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  454. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  455. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  456. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  457. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  458. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  459. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  460. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
  461. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
  462. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  463. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  464. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  465. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  466. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  467. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  468. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  469. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  470. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  471. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  472. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  473. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  474. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  475. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  476. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  477. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  478. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  479. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  480. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  481. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  482. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  483. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  484. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js +1 -1
  485. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  486. package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
  487. package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
  488. package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
  489. package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
  490. package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
  491. package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
  492. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  493. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  494. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  495. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  496. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  497. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  498. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  499. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  500. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +1 -1
  501. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +2 -2
  502. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  503. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  504. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  505. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  506. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
  507. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  508. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  509. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  510. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  511. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  512. package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
  513. package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  514. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  515. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  516. package/lib/types/src/api/DeviceManagementKit.d.ts +16 -2
  517. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  518. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  519. package/lib/types/src/api/DmkConfig.d.ts +2 -0
  520. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  521. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
  522. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
  523. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
  524. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
  525. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +30 -2
  526. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  527. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
  528. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
  529. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
  530. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
  531. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  532. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
  533. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
  534. package/lib/types/src/api/command/utils/CommandUtils.d.ts +1 -0
  535. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  536. package/lib/types/src/api/device-action/DeviceAction.d.ts +3 -1
  537. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  538. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  539. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +9 -0
  540. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  541. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
  542. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +1 -0
  543. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  544. package/lib/types/src/api/device-action/os/Errors.d.ts +10 -0
  545. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  546. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts +58 -0
  547. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
  548. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
  549. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
  550. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +27 -0
  551. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
  552. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  553. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
  554. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  555. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
  556. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
  557. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
  558. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
  559. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +64 -0
  560. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
  561. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
  562. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
  563. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
  564. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
  565. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +25 -0
  566. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
  567. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  568. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -0
  569. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  570. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
  571. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
  572. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
  573. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
  574. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
  575. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
  576. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
  577. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
  578. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
  579. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
  580. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
  581. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
  582. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
  583. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
  584. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
  585. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
  586. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  587. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
  588. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  589. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  590. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +93 -0
  591. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  592. package/lib/types/src/api/index.d.ts +8 -1
  593. package/lib/types/src/api/index.d.ts.map +1 -1
  594. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts +3 -3
  595. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -1
  596. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.d.ts +1 -0
  597. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts +8 -0
  598. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -0
  599. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts +2 -0
  600. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts.map +1 -0
  601. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +44 -0
  602. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -0
  603. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts +3 -3
  604. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -1
  605. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.d.ts +1 -0
  606. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +1 -3
  607. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -1
  608. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts +8 -0
  609. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -0
  610. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts +2 -0
  611. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts.map +1 -0
  612. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +41 -0
  613. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -0
  614. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts +17 -0
  615. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts.map +1 -0
  616. package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
  617. package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
  618. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +62 -0
  619. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -0
  620. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +1 -1
  621. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
  622. package/lib/types/src/api/transport/model/Errors.d.ts +22 -3
  623. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  624. package/lib/types/src/api/transport/model/Transport.d.ts +1 -1
  625. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  626. package/lib/types/src/api/types.d.ts +8 -2
  627. package/lib/types/src/api/types.d.ts.map +1 -1
  628. package/lib/types/src/di.d.ts.map +1 -1
  629. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
  630. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
  631. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts +6 -1
  632. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts.map +1 -1
  633. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +18 -0
  634. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -0
  635. package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts +2 -0
  636. package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts.map +1 -0
  637. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +21 -12
  638. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  639. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts +2 -2
  640. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  641. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts +35 -0
  642. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts.map +1 -0
  643. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts +2 -0
  644. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts.map +1 -0
  645. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts +17 -79
  646. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts.map +1 -1
  647. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts +20 -0
  648. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -0
  649. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts +2 -0
  650. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts.map +1 -0
  651. package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
  652. package/lib/types/src/internal/device-session/service/MutexService.d.ts +6 -0
  653. package/lib/types/src/internal/device-session/service/MutexService.d.ts.map +1 -0
  654. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts +2 -0
  655. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts.map +1 -0
  656. package/lib/types/src/internal/device-session/service/RefresherService.d.ts +7 -2
  657. package/lib/types/src/internal/device-session/service/RefresherService.d.ts.map +1 -1
  658. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +3 -1
  659. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
  660. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts +3 -0
  661. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -0
  662. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts +8 -1
  663. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts.map +1 -1
  664. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts +1 -1
  665. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -1
  666. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts +1 -1
  667. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts.map +1 -1
  668. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts +1 -1
  669. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
  670. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +4 -2
  671. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
  672. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +24 -5
  673. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  674. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +51 -6
  675. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  676. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +104 -18
  677. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
  678. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +7 -0
  679. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  680. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  681. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts +1 -0
  682. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts.map +1 -1
  683. package/lib/types/src/internal/manager-api/model/Application.d.ts +12 -12
  684. package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
  685. package/lib/types/src/internal/manager-api/model/Const.d.ts +2 -0
  686. package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
  687. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +17 -3
  688. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  689. package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
  690. package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
  691. package/lib/types/src/internal/manager-api/model/Params.d.ts +20 -6
  692. package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
  693. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +9 -3
  694. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  695. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +42 -7
  696. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  697. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +13 -0
  698. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -0
  699. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts +2 -0
  700. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts.map +1 -0
  701. package/lib/types/src/internal/secure-channel/model/Params.d.ts +3 -5
  702. package/lib/types/src/internal/secure-channel/model/Params.d.ts.map +1 -1
  703. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +7 -7
  704. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -1
  705. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +41 -7
  706. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -1
  707. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +5 -1
  708. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
  709. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +2 -0
  710. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
  711. package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -1
  712. package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
  713. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +1 -0
  714. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
  715. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  716. package/package.json +15 -15
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/device-action/task/GetApplicationsMetadataTask.ts"],
4
+ "sourcesContent": ["import { gt } from \"semver\";\n\nimport { InvalidStatusWordError } from \"@api/command/Errors\";\nimport {\n type CommandResult,\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { ListLanguagePackCommand } from \"@api/command/os/ListLanguagePackCommand\";\nimport type { InternalApi } from \"@api/device-action/DeviceAction\";\nimport {\n type Catalog,\n type FirmwareVersion,\n type InstalledLanguagePackage,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\n\nexport type InstalledApp = {\n hash: string;\n hashCode: string;\n name: string;\n};\n\nexport type GetApplicationsMetadataTaskArgs = {\n deviceVersion: DeviceVersion;\n firmware: FinalFirmware;\n firmwareVersion: FirmwareVersion;\n installedApps: InstalledApp[];\n};\n\nexport type GetApplicationsMetadataTaskResult = CommandResult<{\n applications: Application[];\n applicationsUpdates: Application[];\n installedLanguages: InstalledLanguagePackage[];\n catalog: Catalog;\n}>;\n\nconst ZERO_HASH =\n \"0000000000000000000000000000000000000000000000000000000000000000\";\n\nexport class GetApplicationsMetadataTask {\n constructor(\n private readonly api: InternalApi,\n private readonly args: GetApplicationsMetadataTaskArgs,\n ) {}\n\n async run(): Promise<GetApplicationsMetadataTaskResult> {\n // Get applications metadata\n const installedApps = this.args.installedApps.filter((app) =>\n this.isApplication(app),\n );\n const manager = this.api.getManagerApiService();\n const appHashes = installedApps.map((app) => app.hash);\n const result = await manager\n .getAppsByHash(appHashes)\n .chain((applications) =>\n manager\n .getAppList(this.args.firmwareVersion.metadata!)\n .map((catalog) => ({ applications, catalog })),\n );\n if (result.isLeft()) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Cannot get the application catalog\"),\n });\n }\n const { applications, catalog } = result.unsafeCoerce();\n\n // Complete applications metadata using the catalog if needed\n const appsWithMetadata = applications.reduce((apps, app, index) => {\n if (app !== null) {\n // Is the app hash was found in app store, append its metadata\n return [...apps, app];\n }\n // For apps with non-deterministic hash (ie. Security Key, sideloaded app, ...),\n // use metadata of latest version from the catalog\n const installedApp = installedApps[index]!;\n const catalogApp = catalog.find(\n (c) => c.versionName === installedApp.name,\n );\n return catalogApp ? [...apps, catalogApp] : apps;\n }, [] as Application[]);\n\n // Filter apps metadata and catalog\n const filteredApps = applications.filter((app) => app !== null);\n const filteredCatalog = filteredApps.reduce((apps, app) => {\n const catalogApp = catalog.find((c) => c.versionName === app.versionName);\n if (catalogApp && gt(catalogApp.version, app.version)) {\n return [...apps, catalogApp];\n }\n return apps;\n }, [] as Application[]);\n\n // Get install language packages\n let installedLanguages: InstalledLanguagePackage[] = [];\n for (let i = 0; ; i++) {\n const language = await this.api.sendCommand(\n new ListLanguagePackCommand({ firstChunk: i === 0 }),\n );\n if (!isSuccessCommandResult(language) || language.data === undefined) {\n break;\n }\n installedLanguages = [...installedLanguages, language.data];\n }\n\n // Get all the available language packs for the device\n const languages = await manager.getLanguagePackages(\n this.args.deviceVersion,\n this.args.firmware,\n );\n if (languages.isRight()) {\n // Return the application metadata\n return CommandResultFactory({\n data: {\n applications: appsWithMetadata,\n applicationsUpdates: filteredCatalog,\n installedLanguages,\n catalog: {\n applications: catalog,\n languagePackages: languages.extract(),\n },\n },\n });\n } else {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Cannot get the languages catalog\"),\n });\n }\n }\n\n private isApplication(app: InstalledApp): boolean {\n // Applications with no \"code\" hash are not real applications\n // (typically a language package).\n return app.hashCode !== ZERO_HASH;\n }\n}\n"],
5
+ "mappings": "AAAA,OAAS,MAAAA,MAAU,SAEnB,OAAS,0BAAAC,MAA8B,sBACvC,OAEE,wBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,2BAAAC,MAA+B,0CA+BxC,MAAMC,EACJ,mEAEK,MAAMC,CAA4B,CACvC,YACmBC,EACAC,EACjB,CAFiB,SAAAD,EACA,UAAAC,CAChB,CAEH,MAAM,KAAkD,CAEtD,MAAMC,EAAgB,KAAK,KAAK,cAAc,OAAQC,GACpD,KAAK,cAAcA,CAAG,CACxB,EACMC,EAAU,KAAK,IAAI,qBAAqB,EACxCC,EAAYH,EAAc,IAAKC,GAAQA,EAAI,IAAI,EAC/CG,EAAS,MAAMF,EAClB,cAAcC,CAAS,EACvB,MAAOE,GACNH,EACG,WAAW,KAAK,KAAK,gBAAgB,QAAS,EAC9C,IAAKI,IAAa,CAAE,aAAAD,EAAc,QAAAC,CAAQ,EAAE,CACjD,EACF,GAAIF,EAAO,OAAO,EAChB,OAAOX,EAAqB,CAC1B,MAAO,IAAID,EAAuB,oCAAoC,CACxE,CAAC,EAEH,KAAM,CAAE,aAAAa,EAAc,QAAAC,CAAQ,EAAIF,EAAO,aAAa,EAGhDG,EAAmBF,EAAa,OAAO,CAACG,EAAMP,EAAKQ,IAAU,CACjE,GAAIR,IAAQ,KAEV,MAAO,CAAC,GAAGO,EAAMP,CAAG,EAItB,MAAMS,EAAeV,EAAcS,CAAK,EAClCE,EAAaL,EAAQ,KACxBM,GAAMA,EAAE,cAAgBF,EAAa,IACxC,EACA,OAAOC,EAAa,CAAC,GAAGH,EAAMG,CAAU,EAAIH,CAC9C,EAAG,CAAC,CAAkB,EAIhBK,EADeR,EAAa,OAAQJ,GAAQA,IAAQ,IAAI,EACzB,OAAO,CAACO,EAAMP,IAAQ,CACzD,MAAMU,EAAaL,EAAQ,KAAMM,GAAMA,EAAE,cAAgBX,EAAI,WAAW,EACxE,OAAIU,GAAcpB,EAAGoB,EAAW,QAASV,EAAI,OAAO,EAC3C,CAAC,GAAGO,EAAMG,CAAU,EAEtBH,CACT,EAAG,CAAC,CAAkB,EAGtB,IAAIM,EAAiD,CAAC,EACtD,QAASC,EAAI,GAAKA,IAAK,CACrB,MAAMC,EAAW,MAAM,KAAK,IAAI,YAC9B,IAAIrB,EAAwB,CAAE,WAAYoB,IAAM,CAAE,CAAC,CACrD,EACA,GAAI,CAACrB,EAAuBsB,CAAQ,GAAKA,EAAS,OAAS,OACzD,MAEFF,EAAqB,CAAC,GAAGA,EAAoBE,EAAS,IAAI,CAC5D,CAGA,MAAMC,EAAY,MAAMf,EAAQ,oBAC9B,KAAK,KAAK,cACV,KAAK,KAAK,QACZ,EACA,OAAIe,EAAU,QAAQ,EAEbxB,EAAqB,CAC1B,KAAM,CACJ,aAAcc,EACd,oBAAqBM,EACrB,mBAAAC,EACA,QAAS,CACP,aAAcR,EACd,iBAAkBW,EAAU,QAAQ,CACtC,CACF,CACF,CAAC,EAEMxB,EAAqB,CAC1B,MAAO,IAAID,EAAuB,kCAAkC,CACtE,CAAC,CAEL,CAEQ,cAAcS,EAA4B,CAGhD,OAAOA,EAAI,WAAaL,CAC1B,CACF",
6
+ "names": ["gt", "InvalidStatusWordError", "CommandResultFactory", "isSuccessCommandResult", "ListLanguagePackCommand", "ZERO_HASH", "GetApplicationsMetadataTask", "api", "args", "installedApps", "app", "manager", "appHashes", "result", "applications", "catalog", "appsWithMetadata", "apps", "index", "installedApp", "catalogApp", "c", "filteredCatalog", "installedLanguages", "i", "language", "languages"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{EitherAsync as s}from"purify-ts";import{InvalidStatusWordError as u}from"../../command/Errors";import{CommandResultFactory as n}from"../../command/model/CommandResult";import{BTC_APP_METADATA as g,ETH_APP_METADATA as d}from"../../device-action/__test-utils__/data";import{makeDeviceActionInternalApiMock as y}from"../../device-action/__test-utils__/makeInternalApi";import{GetApplicationsMetadataTask as r}from"./GetApplicationsMetadataTask";describe("GetApplicationsMetadataTask",()=>{const e=y(),m={id:7},h={id:361,version:"1.6.0",perso:"perso_11"},A={mcu:"mcu_version",bootloader:"bl_version",os:"se_version",metadata:"metadata"},w=[{name:"Ethereum",hash:"hash2",hashCode:"hashCode"},{name:"Language",hash:"hash3",hashCode:"0000000000000000000000000000000000000000000000000000000000000000"}],l=[d],c=[g,d],p=["fr","eng","it"],o={deviceVersion:m,firmware:h,firmwareVersion:A,installedApps:w},t={getAppsByHash:vi.fn(),getAppList:vi.fn(),getLanguagePackages:vi.fn()};beforeEach(()=>{vi.clearAllMocks(),e.sendCommand.mockResolvedValue(n({data:void 0})),e.getManagerApiService.mockReturnValue(t),t.getAppsByHash.mockReturnValue(s(async()=>l)),t.getAppList.mockReturnValue(s(async()=>c)),t.getLanguagePackages.mockReturnValue(s(async()=>p))}),it("Success without updates",async()=>{const a=await new r(e,o).run();expect(a).toStrictEqual(n({data:{applications:l,applicationsUpdates:[],installedLanguages:[],catalog:{applications:c,languagePackages:p}}}))}),it("Success without languages",async()=>{e.sendCommand.mockResolvedValueOnce(n({data:{id:1,size:15}})).mockResolvedValueOnce(n({data:{id:2,size:17}}));const a=await new r(e,o).run();expect(a).toStrictEqual(n({data:{applications:l,applicationsUpdates:[],installedLanguages:[{id:1,size:15},{id:2,size:17}],catalog:{applications:c,languagePackages:p}}}))}),it("Success with an available update",async()=>{const a={...g,version:"1.0.0"};t.getAppsByHash.mockReturnValue(s(async()=>[a]));const i=await new r(e,o).run();expect(i).toStrictEqual(n({data:{applications:[a],applicationsUpdates:[g],installedLanguages:[],catalog:{applications:c,languagePackages:p}}})),expect(t.getAppsByHash).toHaveBeenCalledWith(["hash2"])}),it("Success with app hash not found",async()=>{t.getAppsByHash.mockReturnValue(s(async()=>[null]));const a=await new r(e,o).run();expect(a).toStrictEqual(n({data:{applications:l,applicationsUpdates:[],installedLanguages:[],catalog:{applications:c,languagePackages:p}}}))}),it("should fail when apps hash cannot by retrieved",async()=>{t.getAppsByHash.mockReturnValueOnce(s(async({throwE:i})=>{i(new Error("error"))}));const a=await new r(e,o).run();expect(a).toStrictEqual(n({error:new u("Cannot get the application catalog")}))}),it("should fail when apps list cannot by retrieved",async()=>{t.getAppList.mockReturnValueOnce(s(async({throwE:i})=>{i(new Error("error"))}));const a=await new r(e,o).run();expect(a).toStrictEqual(n({error:new u("Cannot get the application catalog")}))}),it("should fail when languages cannot by retrieved",async()=>{t.getLanguagePackages.mockReturnValueOnce(s(async({throwE:i})=>{i(new Error("error"))}));const a=await new r(e,o).run();expect(a).toStrictEqual(n({error:new u("Cannot get the languages catalog")}))})});
2
+ //# sourceMappingURL=GetApplicationsMetadataTask.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/device-action/task/GetApplicationsMetadataTask.test.ts"],
4
+ "sourcesContent": ["import { EitherAsync } from \"purify-ts\";\n\nimport { InvalidStatusWordError } from \"@api/command/Errors\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport {\n BTC_APP_METADATA,\n ETH_APP_METADATA,\n} from \"@api/device-action/__test-utils__/data\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { type FirmwareVersion } from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\nimport { type LanguagePackage } from \"@internal/manager-api/model/Language\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { GetApplicationsMetadataTask } from \"./GetApplicationsMetadataTask\";\n\ndescribe(\"GetApplicationsMetadataTask\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n\n const DEVICE_VERSION = {\n id: 7,\n } as DeviceVersion;\n\n const FIRMWARE = {\n id: 361,\n version: \"1.6.0\",\n perso: \"perso_11\",\n } as FinalFirmware;\n\n const FIRMWARE_VERSION = {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: \"metadata\",\n } as unknown as FirmwareVersion;\n\n const INSTALLED_APPS = [\n { name: \"Ethereum\", hash: \"hash2\", hashCode: \"hashCode\" },\n {\n name: \"Language\",\n hash: \"hash3\",\n hashCode:\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n },\n ];\n\n const APPS = [ETH_APP_METADATA];\n\n const CATALOG = [BTC_APP_METADATA, ETH_APP_METADATA];\n\n const LANGUAGES = [\"fr\", \"eng\", \"it\"] as unknown as LanguagePackage[];\n\n const ARGS = {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE,\n firmwareVersion: FIRMWARE_VERSION,\n installedApps: INSTALLED_APPS,\n };\n\n const MANAGER_MOCK = {\n getAppsByHash: vi.fn(),\n getAppList: vi.fn(),\n getLanguagePackages: vi.fn(),\n };\n\n beforeEach(() => {\n vi.clearAllMocks();\n\n apiMock.sendCommand.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n apiMock.getManagerApiService.mockReturnValue(\n MANAGER_MOCK as unknown as ManagerApiService,\n );\n MANAGER_MOCK.getAppsByHash.mockReturnValue(EitherAsync(async () => APPS));\n MANAGER_MOCK.getAppList.mockReturnValue(EitherAsync(async () => CATALOG));\n MANAGER_MOCK.getLanguagePackages.mockReturnValue(\n EitherAsync(async () => LANGUAGES),\n );\n });\n\n it(\"Success without updates\", async () => {\n // WHEN\n const result = await new GetApplicationsMetadataTask(apiMock, ARGS).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n applications: APPS,\n applicationsUpdates: [],\n installedLanguages: [],\n catalog: {\n applications: CATALOG,\n languagePackages: LANGUAGES,\n },\n },\n }),\n );\n });\n\n it(\"Success without languages\", async () => {\n // WHEN\n apiMock.sendCommand\n .mockResolvedValueOnce(\n CommandResultFactory({ data: { id: 1, size: 15 } }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory({ data: { id: 2, size: 17 } }),\n );\n const result = await new GetApplicationsMetadataTask(apiMock, ARGS).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n applications: APPS,\n applicationsUpdates: [],\n installedLanguages: [\n { id: 1, size: 15 },\n { id: 2, size: 17 },\n ],\n catalog: {\n applications: CATALOG,\n languagePackages: LANGUAGES,\n },\n },\n }),\n );\n });\n\n it(\"Success with an available update\", async () => {\n // GIVEN\n const app = {\n ...BTC_APP_METADATA,\n version: \"1.0.0\",\n };\n MANAGER_MOCK.getAppsByHash.mockReturnValue(EitherAsync(async () => [app]));\n\n // WHEN\n const result = await new GetApplicationsMetadataTask(apiMock, ARGS).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n applications: [app],\n applicationsUpdates: [BTC_APP_METADATA],\n installedLanguages: [],\n catalog: {\n applications: CATALOG,\n languagePackages: LANGUAGES,\n },\n },\n }),\n );\n expect(MANAGER_MOCK.getAppsByHash).toHaveBeenCalledWith([\"hash2\"]);\n });\n\n it(\"Success with app hash not found\", async () => {\n // GIVEN\n MANAGER_MOCK.getAppsByHash.mockReturnValue(EitherAsync(async () => [null]));\n\n // WHEN\n const result = await new GetApplicationsMetadataTask(apiMock, ARGS).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n applications: APPS,\n applicationsUpdates: [],\n installedLanguages: [],\n catalog: {\n applications: CATALOG,\n languagePackages: LANGUAGES,\n },\n },\n }),\n );\n });\n\n it(\"should fail when apps hash cannot by retrieved\", async () => {\n // GIVEN\n MANAGER_MOCK.getAppsByHash.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetApplicationsMetadataTask(apiMock, ARGS).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Cannot get the application catalog\"),\n }),\n );\n });\n\n it(\"should fail when apps list cannot by retrieved\", async () => {\n // GIVEN\n MANAGER_MOCK.getAppList.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetApplicationsMetadataTask(apiMock, ARGS).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Cannot get the application catalog\"),\n }),\n );\n });\n\n it(\"should fail when languages cannot by retrieved\", async () => {\n // GIVEN\n MANAGER_MOCK.getLanguagePackages.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetApplicationsMetadataTask(apiMock, ARGS).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Cannot get the languages catalog\"),\n }),\n );\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["EitherAsync", "InvalidStatusWordError", "CommandResultFactory", "BTC_APP_METADATA", "ETH_APP_METADATA", "makeDeviceActionInternalApiMock", "GetApplicationsMetadataTask", "apiMock", "DEVICE_VERSION", "FIRMWARE", "FIRMWARE_VERSION", "INSTALLED_APPS", "APPS", "CATALOG", "LANGUAGES", "ARGS", "MANAGER_MOCK", "result", "app", "throwE"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{InvalidStatusWordError as C}from"../../command/Errors";import{CommandResultFactory as c,isSuccessCommandResult as u}from"../../command/model/CommandResult";import{GetCustomImageSizeCommand as V}from"../../command/os/GetCustomImageSizeCommand";import{GetOsVersionCommand as F}from"../../command/os/GetOsVersionCommand";class x{constructor(e){this.api=e}async run(){const e=await this.api.sendCommand(new F);if(!u(e))return e;const m={mcu:e.data.mcuSephVersion,bootloader:e.data.mcuBootloaderVersion,os:e.data.seVersion,metadata:e.data},r=this.api.getManagerApiService(),n=await r.getDeviceVersion(e.data).chain(a=>r.getFirmwareVersion(e.data,a).map(i=>({deviceVersion:a,currentFirmware:i})));if(n.isLeft())return c({error:new C("Cannot fetch current firmware metadata")});const{deviceVersion:s,currentFirmware:o}=n.unsafeCoerce(),w=(await r.getLatestFirmwareVersion(o,s).chain(a=>r.getNextFirmwareVersion(a).chain(i=>r.getMcuList().map(t=>t.find(l=>l.name===m.mcu)).map(t=>t===void 0||!i.mcuVersions.includes(t.id)).map(t=>({osuFirmware:a,finalFirmware:i,mcuUpdateRequired:t}))))).caseOf({Right:a=>a,Left:a=>{}}),f={currentFirmware:o,availableUpdate:w};let d={};const p=await this.api.sendCommand(new V);return u(p)&&(d={size:p.data}),c({data:{deviceVersion:s,firmware:o,firmwareVersion:m,firmwareUpdateContext:f,customImage:d}})}}export{x as GetFirmwareMetadataTask};
2
+ //# sourceMappingURL=GetFirmwareMetadataTask.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/device-action/task/GetFirmwareMetadataTask.ts"],
4
+ "sourcesContent": ["import { InvalidStatusWordError } from \"@api/command/Errors\";\nimport {\n type CommandResult,\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { GetCustomImageSizeCommand } from \"@api/command/os/GetCustomImageSizeCommand\";\nimport { GetOsVersionCommand } from \"@api/command/os/GetOsVersionCommand\";\nimport type { InternalApi } from \"@api/device-action/DeviceAction\";\nimport {\n type CustomImage,\n type FirmwareUpdate,\n type FirmwareUpdateContext,\n type FirmwareVersion,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\n\nexport type GetFirmwareMetadataTaskResult = CommandResult<{\n deviceVersion: DeviceVersion;\n firmware: FinalFirmware;\n firmwareVersion: FirmwareVersion;\n firmwareUpdateContext: FirmwareUpdateContext;\n customImage: CustomImage;\n}>;\n\nexport class GetFirmwareMetadataTask {\n constructor(private readonly api: InternalApi) {}\n\n async run(): Promise<GetFirmwareMetadataTaskResult> {\n // Get installed firmware metadata\n const osVersion = await this.api.sendCommand(new GetOsVersionCommand());\n if (!isSuccessCommandResult(osVersion)) {\n return osVersion;\n }\n const firmwareVersion: FirmwareVersion = {\n mcu: osVersion.data.mcuSephVersion,\n bootloader: osVersion.data.mcuBootloaderVersion,\n os: osVersion.data.seVersion,\n metadata: osVersion.data,\n };\n\n // Fetch current firmware metadata from app store\n const manager = this.api.getManagerApiService();\n const result = await manager\n .getDeviceVersion(osVersion.data)\n .chain((deviceVersion) =>\n manager\n .getFirmwareVersion(osVersion.data, deviceVersion)\n .map((currentFirmware) => ({ deviceVersion, currentFirmware })),\n );\n if (result.isLeft()) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\n \"Cannot fetch current firmware metadata\",\n ),\n });\n }\n const { deviceVersion, currentFirmware } = result.unsafeCoerce();\n\n // Fetch latest firmware available, if any\n const maybeUpdate = await manager\n .getLatestFirmwareVersion(currentFirmware, deviceVersion)\n .chain((osuFirmware) =>\n manager.getNextFirmwareVersion(osuFirmware).chain((finalFirmware) =>\n manager\n .getMcuList()\n .map((mcus) => mcus.find((mcu) => mcu.name === firmwareVersion.mcu))\n .map(\n (mcu) =>\n mcu === undefined ||\n !finalFirmware.mcuVersions.includes(mcu.id),\n )\n .map((mcuUpdateRequired) => ({\n osuFirmware,\n finalFirmware,\n mcuUpdateRequired,\n })),\n ),\n );\n const availableUpdate: FirmwareUpdate | undefined = maybeUpdate.caseOf({\n Right: (data) => data,\n Left: (_error) => undefined,\n });\n const firmwareUpdateContext = {\n currentFirmware,\n availableUpdate,\n };\n\n // Get custom image metadata\n let customImage: CustomImage = {};\n const imageSize = await this.api.sendCommand(\n new GetCustomImageSizeCommand(),\n );\n if (isSuccessCommandResult(imageSize)) {\n customImage = { size: imageSize.data };\n }\n\n // Return firmware metadata\n return CommandResultFactory({\n data: {\n deviceVersion,\n firmware: currentFirmware,\n firmwareVersion,\n firmwareUpdateContext,\n customImage,\n },\n });\n }\n}\n"],
5
+ "mappings": "AAAA,OAAS,0BAAAA,MAA8B,sBACvC,OAEE,wBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,6BAAAC,MAAiC,4CAC1C,OAAS,uBAAAC,MAA2B,sCAmB7B,MAAMC,CAAwB,CACnC,YAA6BC,EAAkB,CAAlB,SAAAA,CAAmB,CAEhD,MAAM,KAA8C,CAElD,MAAMC,EAAY,MAAM,KAAK,IAAI,YAAY,IAAIH,CAAqB,EACtE,GAAI,CAACF,EAAuBK,CAAS,EACnC,OAAOA,EAET,MAAMC,EAAmC,CACvC,IAAKD,EAAU,KAAK,eACpB,WAAYA,EAAU,KAAK,qBAC3B,GAAIA,EAAU,KAAK,UACnB,SAAUA,EAAU,IACtB,EAGME,EAAU,KAAK,IAAI,qBAAqB,EACxCC,EAAS,MAAMD,EAClB,iBAAiBF,EAAU,IAAI,EAC/B,MAAOI,GACNF,EACG,mBAAmBF,EAAU,KAAMI,CAAa,EAChD,IAAKC,IAAqB,CAAE,cAAAD,EAAe,gBAAAC,CAAgB,EAAE,CAClE,EACF,GAAIF,EAAO,OAAO,EAChB,OAAOT,EAAqB,CAC1B,MAAO,IAAID,EACT,wCACF,CACF,CAAC,EAEH,KAAM,CAAE,cAAAW,EAAe,gBAAAC,CAAgB,EAAIF,EAAO,aAAa,EAsBzDG,GAnBc,MAAMJ,EACvB,yBAAyBG,EAAiBD,CAAa,EACvD,MAAOG,GACNL,EAAQ,uBAAuBK,CAAW,EAAE,MAAOC,GACjDN,EACG,WAAW,EACX,IAAKO,GAASA,EAAK,KAAMC,GAAQA,EAAI,OAAST,EAAgB,GAAG,CAAC,EAClE,IACES,GACCA,IAAQ,QACR,CAACF,EAAc,YAAY,SAASE,EAAI,EAAE,CAC9C,EACC,IAAKC,IAAuB,CAC3B,YAAAJ,EACA,cAAAC,EACA,kBAAAG,CACF,EAAE,CACN,CACF,GAC8D,OAAO,CACrE,MAAQC,GAASA,EACjB,KAAOC,GAAQ,EACjB,CAAC,EACKC,EAAwB,CAC5B,gBAAAT,EACA,gBAAAC,CACF,EAGA,IAAIS,EAA2B,CAAC,EAChC,MAAMC,EAAY,MAAM,KAAK,IAAI,YAC/B,IAAIpB,CACN,EACA,OAAID,EAAuBqB,CAAS,IAClCD,EAAc,CAAE,KAAMC,EAAU,IAAK,GAIhCtB,EAAqB,CAC1B,KAAM,CACJ,cAAAU,EACA,SAAUC,EACV,gBAAAJ,EACA,sBAAAa,EACA,YAAAC,CACF,CACF,CAAC,CACH,CACF",
6
+ "names": ["InvalidStatusWordError", "CommandResultFactory", "isSuccessCommandResult", "GetCustomImageSizeCommand", "GetOsVersionCommand", "GetFirmwareMetadataTask", "api", "osVersion", "firmwareVersion", "manager", "result", "deviceVersion", "currentFirmware", "availableUpdate", "osuFirmware", "finalFirmware", "mcus", "mcu", "mcuUpdateRequired", "data", "_error", "firmwareUpdateContext", "customImage", "imageSize"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{EitherAsync as n}from"purify-ts";import{InvalidStatusWordError as m}from"../../command/Errors";import{CommandResultFactory as e}from"../../command/model/CommandResult";import{makeDeviceActionInternalApiMock as V}from"../../device-action/__test-utils__/makeInternalApi";import{GetFirmwareMetadataTask as u}from"./GetFirmwareMetadataTask";describe("GetFirmwareMetadataTask",()=>{const a=V(),o={mcuSephVersion:"mcu_version",mcuBootloaderVersion:"bl_version",seVersion:"se_version"},w=97,c={id:7},i={id:361,version:"1.6.0",perso:"perso_11"},l={id:362,perso:"perso_11"},d={id:363,version:"1.7.0",perso:"perso_11",mcuVersions:[1]},v=[{id:3,name:"other_version"},{id:1,name:"mcu_version"}],r={getDeviceVersion:vi.fn(),getFirmwareVersion:vi.fn(),getLatestFirmwareVersion:vi.fn(),getNextFirmwareVersion:vi.fn(),getMcuList:vi.fn()};beforeEach(()=>{vi.clearAllMocks(),a.getManagerApiService.mockReturnValue(r),r.getDeviceVersion.mockReturnValue(n(async()=>c)),r.getFirmwareVersion.mockReturnValue(n(async()=>i)),r.getLatestFirmwareVersion.mockReturnValue(n(async()=>l)),r.getNextFirmwareVersion.mockReturnValue(n(async()=>d)),r.getMcuList.mockReturnValue(n(async()=>v))}),it("success with no firmware update available",async()=>{a.sendCommand.mockResolvedValueOnce(e({data:o})).mockResolvedValueOnce(e({data:w})),r.getLatestFirmwareVersion.mockReturnValueOnce(n(async({throwE:s})=>{s(new Error("error"))}));const t=await new u(a).run();expect(t).toStrictEqual(e({data:{deviceVersion:c,firmware:i,firmwareVersion:{mcu:"mcu_version",bootloader:"bl_version",os:"se_version",metadata:o},firmwareUpdateContext:{currentFirmware:i,availableUpdate:void 0},customImage:{size:w}}}))}),it("success with a firmware update available",async()=>{a.sendCommand.mockResolvedValueOnce(e({data:o})).mockResolvedValueOnce(e({error:new m("error")}));const t=await new u(a).run();expect(t).toStrictEqual(e({data:{deviceVersion:c,firmware:i,firmwareVersion:{mcu:"mcu_version",bootloader:"bl_version",os:"se_version",metadata:o},firmwareUpdateContext:{currentFirmware:i,availableUpdate:{osuFirmware:l,finalFirmware:d,mcuUpdateRequired:!1}},customImage:{}}})),expect(r.getDeviceVersion).toHaveBeenCalledWith(o),expect(r.getFirmwareVersion).toHaveBeenCalledWith(o,c),expect(r.getLatestFirmwareVersion).toHaveBeenCalledWith(i,c),expect(r.getNextFirmwareVersion).toHaveBeenCalledWith(l)}),it("success with a firmware update available and MCU update",async()=>{a.sendCommand.mockResolvedValueOnce(e({data:o})).mockResolvedValueOnce(e({error:new m("error")}));const t={...d,mcuVersions:[3]};r.getNextFirmwareVersion.mockReturnValue(n(async()=>t));const s=await new u(a).run();expect(s).toStrictEqual(e({data:{deviceVersion:c,firmware:i,firmwareVersion:{mcu:"mcu_version",bootloader:"bl_version",os:"se_version",metadata:o},firmwareUpdateContext:{currentFirmware:i,availableUpdate:{osuFirmware:l,finalFirmware:t,mcuUpdateRequired:!0}},customImage:{}}}))}),it("should fail when OS version cannot be retrieved",async()=>{a.sendCommand.mockResolvedValueOnce(e({error:new m("error")}));const t=await new u(a).run();expect(t).toStrictEqual(e({error:new m("error")}))}),it("should fail if device version cannot be fetched",async()=>{a.sendCommand.mockResolvedValueOnce(e({data:o})),r.getDeviceVersion.mockReturnValueOnce(n(async({throwE:s})=>{s(new Error("error"))}));const t=await new u(a).run();expect(t).toStrictEqual(e({error:new m("Cannot fetch current firmware metadata")}))}),it("should fail if firmware version cannot be fetched",async()=>{a.sendCommand.mockResolvedValueOnce(e({data:o})),r.getFirmwareVersion.mockReturnValueOnce(n(async({throwE:s})=>{s(new Error("error"))}));const t=await new u(a).run();expect(t).toStrictEqual(e({error:new m("Cannot fetch current firmware metadata")}))})});
2
+ //# sourceMappingURL=GetFirmwareMetadataTask.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/device-action/task/GetFirmwareMetadataTask.test.ts"],
4
+ "sourcesContent": ["import { EitherAsync } from \"purify-ts\";\n\nimport { InvalidStatusWordError } from \"@api/command/Errors\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport {\n type FinalFirmware,\n type McuFirmware,\n type OsuFirmware,\n} from \"@internal/manager-api/model/Firmware\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { GetFirmwareMetadataTask } from \"./GetFirmwareMetadataTask\";\n\ndescribe(\"GetFirmwareMetadataTask\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n const OS_VERSION = {\n mcuSephVersion: \"mcu_version\",\n mcuBootloaderVersion: \"bl_version\",\n seVersion: \"se_version\",\n } as GetOsVersionResponse;\n\n const CUSTOM_IMAGE_SIZE = 97;\n\n const DEVICE_VERSION = {\n id: 7,\n };\n\n const FIRMWARE_VERSION = {\n id: 361,\n version: \"1.6.0\",\n perso: \"perso_11\",\n } as FinalFirmware;\n\n const OSU_VERSION = {\n id: 362,\n perso: \"perso_11\",\n } as OsuFirmware;\n\n const NEXT_FIRMWARE_VERSION = {\n id: 363,\n version: \"1.7.0\",\n perso: \"perso_11\",\n mcuVersions: [1],\n } as FinalFirmware;\n\n const MCUS = [\n {\n id: 3,\n name: \"other_version\",\n },\n {\n id: 1,\n name: \"mcu_version\",\n },\n ] as McuFirmware[];\n\n const MANAGER_MOCK = {\n getDeviceVersion: vi.fn(),\n getFirmwareVersion: vi.fn(),\n getLatestFirmwareVersion: vi.fn(),\n getNextFirmwareVersion: vi.fn(),\n getMcuList: vi.fn(),\n };\n\n beforeEach(() => {\n vi.clearAllMocks();\n\n apiMock.getManagerApiService.mockReturnValue(\n MANAGER_MOCK as unknown as ManagerApiService,\n );\n MANAGER_MOCK.getDeviceVersion.mockReturnValue(\n EitherAsync(async () => DEVICE_VERSION),\n );\n MANAGER_MOCK.getFirmwareVersion.mockReturnValue(\n EitherAsync(async () => FIRMWARE_VERSION),\n );\n MANAGER_MOCK.getLatestFirmwareVersion.mockReturnValue(\n EitherAsync(async () => OSU_VERSION),\n );\n MANAGER_MOCK.getNextFirmwareVersion.mockReturnValue(\n EitherAsync(async () => NEXT_FIRMWARE_VERSION),\n );\n MANAGER_MOCK.getMcuList.mockReturnValue(EitherAsync(async () => MCUS));\n });\n\n it(\"success with no firmware update available\", async () => {\n // GIVEN\n apiMock.sendCommand\n .mockResolvedValueOnce(CommandResultFactory({ data: OS_VERSION }))\n .mockResolvedValueOnce(CommandResultFactory({ data: CUSTOM_IMAGE_SIZE }));\n MANAGER_MOCK.getLatestFirmwareVersion.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE_VERSION,\n firmwareVersion: {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: OS_VERSION,\n },\n firmwareUpdateContext: {\n currentFirmware: FIRMWARE_VERSION,\n availableUpdate: undefined,\n },\n customImage: { size: CUSTOM_IMAGE_SIZE },\n },\n }),\n );\n });\n\n it(\"success with a firmware update available\", async () => {\n // GIVEN\n apiMock.sendCommand\n .mockResolvedValueOnce(CommandResultFactory({ data: OS_VERSION }))\n .mockResolvedValueOnce(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE_VERSION,\n firmwareVersion: {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: OS_VERSION,\n },\n firmwareUpdateContext: {\n currentFirmware: FIRMWARE_VERSION,\n availableUpdate: {\n osuFirmware: OSU_VERSION,\n finalFirmware: NEXT_FIRMWARE_VERSION,\n mcuUpdateRequired: false,\n },\n },\n customImage: {},\n },\n }),\n );\n expect(MANAGER_MOCK.getDeviceVersion).toHaveBeenCalledWith(OS_VERSION);\n expect(MANAGER_MOCK.getFirmwareVersion).toHaveBeenCalledWith(\n OS_VERSION,\n DEVICE_VERSION,\n );\n expect(MANAGER_MOCK.getLatestFirmwareVersion).toHaveBeenCalledWith(\n FIRMWARE_VERSION,\n DEVICE_VERSION,\n );\n expect(MANAGER_MOCK.getNextFirmwareVersion).toHaveBeenCalledWith(\n OSU_VERSION,\n );\n });\n\n it(\"success with a firmware update available and MCU update\", async () => {\n // GIVEN\n apiMock.sendCommand\n .mockResolvedValueOnce(CommandResultFactory({ data: OS_VERSION }))\n .mockResolvedValueOnce(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n const nextFirmware = {\n ...NEXT_FIRMWARE_VERSION,\n mcuVersions: [3],\n };\n MANAGER_MOCK.getNextFirmwareVersion.mockReturnValue(\n EitherAsync(async () => nextFirmware),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE_VERSION,\n firmwareVersion: {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: OS_VERSION,\n },\n firmwareUpdateContext: {\n currentFirmware: FIRMWARE_VERSION,\n availableUpdate: {\n osuFirmware: OSU_VERSION,\n finalFirmware: nextFirmware,\n mcuUpdateRequired: true,\n },\n },\n customImage: {},\n },\n }),\n );\n });\n\n it(\"should fail when OS version cannot be retrieved\", async () => {\n // GIVEN\n apiMock.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n });\n\n it(\"should fail if device version cannot be fetched\", async () => {\n // GIVEN\n apiMock.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ data: OS_VERSION }),\n );\n MANAGER_MOCK.getDeviceVersion.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\n \"Cannot fetch current firmware metadata\",\n ),\n }),\n );\n });\n\n it(\"should fail if firmware version cannot be fetched\", async () => {\n // GIVEN\n apiMock.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ data: OS_VERSION }),\n );\n MANAGER_MOCK.getFirmwareVersion.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\n \"Cannot fetch current firmware metadata\",\n ),\n }),\n );\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["EitherAsync", "InvalidStatusWordError", "CommandResultFactory", "makeDeviceActionInternalApiMock", "GetFirmwareMetadataTask", "apiMock", "OS_VERSION", "CUSTOM_IMAGE_SIZE", "DEVICE_VERSION", "FIRMWARE_VERSION", "OSU_VERSION", "NEXT_FIRMWARE_VERSION", "MCUS", "MANAGER_MOCK", "throwE", "result", "nextFirmware"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{UnknownDAError as i}from"../../device-action/os/Errors";import{DeviceSessionStateType as m}from"../../device-session/DeviceSessionState";class k{constructor(e,s){this.api=e;this.args=s;const r=e.getDeviceModel();this.blockSize=r.blockSize,this.memoryBlocks=Math.floor(r.memorySize/this.blockSize)}blockSize;memoryBlocks;run(){const e=this.api.getDeviceSessionState();if(e.sessionStateType===m.Connected)return{error:new i("Invalid device state")};if(e.firmwareUpdateContext===void 0||e.customImage===void 0||e.installedLanguages===void 0)return{error:new i("Device metadata not fetched")};const s=this.bytesToBlocks(e.firmwareUpdateContext.currentFirmware.bytes||0),r=this.bytesToBlocks(e.customImage.size||0),n=e.installedApps.reduce((t,o)=>t+this.bytesToBlocks(o.bytes||0),0),a=e.installedLanguages.reduce((t,o)=>t+this.bytesToBlocks(o.size),0),c=s+r+n+a,l=this.memoryBlocks-c;return{outOfMemory:this.args.installPlan.reduce((t,o)=>t+this.bytesToBlocks(o.bytes||0),0)>l}}bytesToBlocks(e){return Math.ceil(e/this.blockSize)}}export{k as PredictOutOfMemoryTask};
2
+ //# sourceMappingURL=PredictOutOfMemoryTask.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/device-action/task/PredictOutOfMemoryTask.ts"],
4
+ "sourcesContent": ["import type { InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport type { Application } from \"@internal/manager-api/model/Application\";\n\nexport type PredictOutOfMemoryTaskArgs = {\n installPlan: Application[];\n};\n\nexport type PredictOutOfMemoryTaskResult =\n | {\n outOfMemory: boolean;\n }\n | {\n error: UnknownDAError;\n };\n\nexport class PredictOutOfMemoryTask {\n private readonly blockSize: number;\n private readonly memoryBlocks: number;\n\n constructor(\n private readonly api: InternalApi,\n private readonly args: PredictOutOfMemoryTaskArgs,\n ) {\n const deviceModel = api.getDeviceModel();\n this.blockSize = deviceModel.blockSize;\n this.memoryBlocks = Math.floor(deviceModel.memorySize / this.blockSize);\n }\n\n run(): PredictOutOfMemoryTaskResult {\n // Get device session state.\n const deviceState = this.api.getDeviceSessionState();\n if (deviceState.sessionStateType === DeviceSessionStateType.Connected) {\n return { error: new UnknownDAError(\"Invalid device state\") };\n }\n\n // Ensure the device metadata were correctly fetched.\n if (\n deviceState.firmwareUpdateContext === undefined ||\n deviceState.customImage === undefined ||\n deviceState.installedLanguages === undefined\n ) {\n return { error: new UnknownDAError(\"Device metadata not fetched\") };\n }\n\n // Compute device memory layout\n const firmwareBlocks = this.bytesToBlocks(\n deviceState.firmwareUpdateContext.currentFirmware.bytes || 0,\n );\n const customImageBlocks = this.bytesToBlocks(\n deviceState.customImage.size || 0,\n );\n const applicationsBlocks = deviceState.installedApps.reduce(\n (size, app) => size + this.bytesToBlocks(app.bytes || 0),\n 0,\n );\n const languagesBlocks = deviceState.installedLanguages.reduce(\n (size, lang) => size + this.bytesToBlocks(lang.size),\n 0,\n );\n const usedBlocks =\n firmwareBlocks + customImageBlocks + applicationsBlocks + languagesBlocks;\n const availableBlocks = this.memoryBlocks - usedBlocks;\n\n // Compute install plan memory consumption\n const installPlanBlocks = this.args.installPlan.reduce(\n (size, app) => size + this.bytesToBlocks(app.bytes || 0),\n 0,\n );\n return { outOfMemory: installPlanBlocks > availableBlocks };\n }\n\n private bytesToBlocks(size: number) {\n return Math.ceil(size / this.blockSize);\n }\n}\n"],
5
+ "mappings": "AACA,OAAS,kBAAAA,MAAsB,+BAC/B,OAAS,0BAAAC,MAA8B,yCAehC,MAAMC,CAAuB,CAIlC,YACmBC,EACAC,EACjB,CAFiB,SAAAD,EACA,UAAAC,EAEjB,MAAMC,EAAcF,EAAI,eAAe,EACvC,KAAK,UAAYE,EAAY,UAC7B,KAAK,aAAe,KAAK,MAAMA,EAAY,WAAa,KAAK,SAAS,CACxE,CAViB,UACA,aAWjB,KAAoC,CAElC,MAAMC,EAAc,KAAK,IAAI,sBAAsB,EACnD,GAAIA,EAAY,mBAAqBL,EAAuB,UAC1D,MAAO,CAAE,MAAO,IAAID,EAAe,sBAAsB,CAAE,EAI7D,GACEM,EAAY,wBAA0B,QACtCA,EAAY,cAAgB,QAC5BA,EAAY,qBAAuB,OAEnC,MAAO,CAAE,MAAO,IAAIN,EAAe,6BAA6B,CAAE,EAIpE,MAAMO,EAAiB,KAAK,cAC1BD,EAAY,sBAAsB,gBAAgB,OAAS,CAC7D,EACME,EAAoB,KAAK,cAC7BF,EAAY,YAAY,MAAQ,CAClC,EACMG,EAAqBH,EAAY,cAAc,OACnD,CAACI,EAAMC,IAAQD,EAAO,KAAK,cAAcC,EAAI,OAAS,CAAC,EACvD,CACF,EACMC,EAAkBN,EAAY,mBAAmB,OACrD,CAACI,EAAMG,IAASH,EAAO,KAAK,cAAcG,EAAK,IAAI,EACnD,CACF,EACMC,EACJP,EAAiBC,EAAoBC,EAAqBG,EACtDG,EAAkB,KAAK,aAAeD,EAO5C,MAAO,CAAE,YAJiB,KAAK,KAAK,YAAY,OAC9C,CAACJ,EAAMC,IAAQD,EAAO,KAAK,cAAcC,EAAI,OAAS,CAAC,EACvD,CACF,EAC0CI,CAAgB,CAC5D,CAEQ,cAAcL,EAAc,CAClC,OAAO,KAAK,KAAKA,EAAO,KAAK,SAAS,CACxC,CACF",
6
+ "names": ["UnknownDAError", "DeviceSessionStateType", "PredictOutOfMemoryTask", "api", "args", "deviceModel", "deviceState", "firmwareBlocks", "customImageBlocks", "applicationsBlocks", "size", "app", "languagesBlocks", "lang", "usedBlocks", "availableBlocks"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{DeviceStatus as n}from"../../device/DeviceStatus";import{makeDeviceActionInternalApiMock as o}from"../../device-action/__test-utils__/makeInternalApi";import{UnknownDAError as i}from"../../device-action/os/Errors";import{DeviceSessionStateType as s}from"../../device-session/DeviceSessionState";import{PredictOutOfMemoryTask as a}from"./PredictOutOfMemoryTask";describe("PredictOutOfMemoryTask",()=>{const e=o();beforeEach(()=>{vi.clearAllMocks(),e.getDeviceModel.mockReturnValue({memorySize:1569792,blockSize:32})}),it("Success enough memory",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:n.CONNECTED,firmwareUpdateContext:{currentFirmware:{bytes:397824}},customImage:{size:51893},installedApps:[{bytes:305442},{bytes:514598},{bytes:271583}],installedLanguages:[{id:1,size:20480}]});const t=new a(e,{installPlan:[{bytes:1324},{bytes:6559}]}).run();expect(t).toStrictEqual({outOfMemory:!1})}),it("Success not enough memory",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:n.CONNECTED,firmwareUpdateContext:{currentFirmware:{bytes:397824}},customImage:{size:51893},installedApps:[{bytes:305442},{bytes:514598},{bytes:271583}],installedLanguages:[{id:1,size:20480}]});const t=new a(e,{installPlan:[{bytes:1324},{bytes:6559},{bytes:1}]}).run();expect(t).toStrictEqual({outOfMemory:!0})}),it("Success undefined sizes",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:n.CONNECTED,firmwareUpdateContext:{currentFirmware:{bytes:397824}},customImage:{},installedApps:[{bytes:305442},{bytes:null},{bytes:271583}],installedLanguages:[]});const t=new a(e,{installPlan:[{bytes:1324},{bytes:6559}]}).run();expect(t).toStrictEqual({outOfMemory:!1})}),it("Error when device is in incorrect state",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:s.Connected,deviceStatus:n.CONNECTED});const t=new a(e,{installPlan:[{bytes:1324}]}).run();expect(t).toStrictEqual({error:new i("Invalid device state")})}),it("Error when device session was not populated",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:n.CONNECTED,installedApps:[]});const t=new a(e,{installPlan:[{bytes:1324}]}).run();expect(t).toStrictEqual({error:new i("Device metadata not fetched")})})});
2
+ //# sourceMappingURL=PredictOutOfMemoryTask.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/device-action/task/PredictOutOfMemoryTask.test.ts"],
4
+ "sourcesContent": ["import { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport type { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nimport type { DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport type { Application } from \"@internal/manager-api/model/Application\";\nimport type { FinalFirmware } from \"@internal/manager-api/model/Firmware\";\n\nimport { PredictOutOfMemoryTask } from \"./PredictOutOfMemoryTask\";\n\ndescribe(\"PredictOutOfMemoryTask\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n\n beforeEach(() => {\n vi.clearAllMocks();\n apiMock.getDeviceModel.mockReturnValue({\n memorySize: 1569792,\n blockSize: 32,\n } as unknown as TransportDeviceModel);\n });\n\n it(\"Success enough memory\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n firmwareUpdateContext: {\n currentFirmware: { bytes: 397824 } as FinalFirmware,\n },\n customImage: { size: 51893 },\n installedApps: [\n { bytes: 305442 },\n { bytes: 514598 },\n { bytes: 271583 },\n ] as unknown as Application[],\n installedLanguages: [{ id: 1, size: 20480 }],\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new PredictOutOfMemoryTask(apiMock, {\n installPlan: [\n { bytes: 1324 },\n { bytes: 6559 },\n ] as unknown as Application[],\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n outOfMemory: false,\n });\n });\n\n it(\"Success not enough memory\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n firmwareUpdateContext: {\n currentFirmware: { bytes: 397824 } as FinalFirmware,\n },\n customImage: { size: 51893 },\n installedApps: [\n { bytes: 305442 },\n { bytes: 514598 },\n { bytes: 271583 },\n ] as unknown as Application[],\n installedLanguages: [{ id: 1, size: 20480 }],\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new PredictOutOfMemoryTask(apiMock, {\n installPlan: [\n { bytes: 1324 },\n { bytes: 6559 },\n { bytes: 1 },\n ] as unknown as Application[],\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n outOfMemory: true,\n });\n });\n\n it(\"Success undefined sizes\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n firmwareUpdateContext: {\n currentFirmware: { bytes: 397824 } as FinalFirmware,\n },\n customImage: {},\n installedApps: [\n { bytes: 305442 },\n { bytes: null },\n { bytes: 271583 },\n ] as unknown as Application[],\n installedLanguages: [],\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new PredictOutOfMemoryTask(apiMock, {\n installPlan: [\n { bytes: 1324 },\n { bytes: 6559 },\n ] as unknown as Application[],\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n outOfMemory: false,\n });\n });\n\n it(\"Error when device is in incorrect state\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n } as DeviceSessionState);\n\n // WHEN\n const result = new PredictOutOfMemoryTask(apiMock, {\n installPlan: [{ bytes: 1324 }] as unknown as Application[],\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n error: new UnknownDAError(\"Invalid device state\"),\n });\n });\n\n it(\"Error when device session was not populated\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new PredictOutOfMemoryTask(apiMock, {\n installPlan: [{ bytes: 1324 }] as unknown as Application[],\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n error: new UnknownDAError(\"Device metadata not fetched\"),\n });\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["DeviceStatus", "makeDeviceActionInternalApiMock", "UnknownDAError", "DeviceSessionStateType", "PredictOutOfMemoryTask", "apiMock", "result"]
7
+ }
@@ -1,2 +1,2 @@
1
- var n=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var f=(u,e,d)=>e in u?n(u,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):u[e]=d;var m=(u,e,d,s)=>{for(var r=s>1?void 0:s?b(e,d):e,t=u.length-1,l;t>=0;t--)(l=u[t])&&(r=(s?l(e,d,r):l(r))||r);return s&&r&&n(e,d,r),r};var v=(u,e,d)=>f(u,typeof e!="symbol"?e+"":e,d);import{injectable as p}from"inversify";import{DeviceModelId as o}from"../../device/DeviceModel";import{BleDeviceInfos as I}from"../../device-model/model/BleDeviceInfos";import{TransportDeviceModel as c}from"../../device-model/model/DeviceModel";let i=class{getAllDeviceModels(){return Object.values(i.deviceModelByIds)}getDeviceModel(e){return i.deviceModelByIds[e.id]}filterDeviceModels(e){return this.getAllDeviceModels().filter(d=>Object.entries(e).every(([s,r])=>d[s]===r))}getBluetoothServicesInfos(){return Object.values(i.deviceModelByIds).reduce((e,d)=>{const{bluetoothSpec:s}=d;return s?{...e,...s.reduce((r,t)=>({...r,[t.serviceUuid]:new I(d,t.serviceUuid,t.writeUuid,t.writeCmdUuid,t.notifyUuid)}),{})}:e},{})}getBluetoothServices(){return Object.values(i.deviceModelByIds).map(e=>(e.bluetoothSpec||[]).map(d=>d.serviceUuid)).flat().filter(e=>!!e)}};v(i,"deviceModelByIds",{[o.NANO_S]:new c({id:o.NANO_S,productName:"Ledger Nano S",usbProductId:16,bootloaderUsbProductId:1,usbOnly:!0,memorySize:320*1024,masks:[823132160]}),[o.NANO_SP]:new c({id:o.NANO_SP,productName:"Ledger Nano S Plus",usbProductId:80,bootloaderUsbProductId:5,usbOnly:!0,memorySize:1533*1024,masks:[856686592]}),[o.NANO_X]:new c({id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]}),[o.STAX]:new c({id:o.STAX,productName:"Ledger Stax",usbProductId:96,bootloaderUsbProductId:6,usbOnly:!1,memorySize:1533*1024,masks:[857735168],bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]}),[o.FLEX]:new c({id:o.FLEX,productName:"Ledger Flex",usbProductId:112,bootloaderUsbProductId:7,usbOnly:!1,memorySize:1533*1024,masks:[858783744],bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]})}),i=m([p()],i);export{i as StaticDeviceModelDataSource};
1
+ var n=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var f=(c,e,d)=>e in c?n(c,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):c[e]=d;var m=(c,e,d,s)=>{for(var r=s>1?void 0:s?v(e,d):e,t=c.length-1,l;t>=0;t--)(l=c[t])&&(r=(s?l(e,d,r):l(r))||r);return s&&r&&n(e,d,r),r};var b=(c,e,d)=>f(c,typeof e!="symbol"?e+"":e,d);import{injectable as p}from"inversify";import{DeviceModelId as o}from"../../device/DeviceModel";import{BleDeviceInfos as I}from"../../device-model/model/BleDeviceInfos";import{TransportDeviceModel as u}from"../../device-model/model/DeviceModel";let i=class{getAllDeviceModels(){return Object.values(i.deviceModelByIds)}getDeviceModel(e){return i.deviceModelByIds[e.id]}filterDeviceModels(e){return this.getAllDeviceModels().filter(d=>Object.entries(e).every(([s,r])=>d[s]===r))}getBluetoothServicesInfos(){return Object.values(i.deviceModelByIds).reduce((e,d)=>{const{bluetoothSpec:s}=d;return s?{...e,...s.reduce((r,t)=>({...r,[t.serviceUuid]:new I(d,t.serviceUuid,t.writeUuid,t.writeCmdUuid,t.notifyUuid)}),{})}:e},{})}getBluetoothServices(){return Object.values(i.deviceModelByIds).map(e=>(e.bluetoothSpec||[]).map(d=>d.serviceUuid)).flat().filter(e=>!!e)}};b(i,"deviceModelByIds",{[o.NANO_S]:new u({id:o.NANO_S,productName:"Ledger Nano S",usbProductId:16,bootloaderUsbProductId:1,usbOnly:!0,memorySize:320*1024,blockSize:4*1024,masks:[823132160]}),[o.NANO_SP]:new u({id:o.NANO_SP,productName:"Ledger Nano S Plus",usbProductId:80,bootloaderUsbProductId:5,usbOnly:!0,memorySize:1533*1024,blockSize:32,masks:[856686592]}),[o.NANO_X]:new u({id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,blockSize:4*1024,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]}),[o.STAX]:new u({id:o.STAX,productName:"Ledger Stax",usbProductId:96,bootloaderUsbProductId:6,usbOnly:!1,memorySize:1533*1024,blockSize:32,masks:[857735168],bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]}),[o.FLEX]:new u({id:o.FLEX,productName:"Ledger Flex",usbProductId:112,bootloaderUsbProductId:7,usbOnly:!1,memorySize:1533*1024,blockSize:32,masks:[858783744],bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]})}),i=m([p()],i);export{i as StaticDeviceModelDataSource};
2
2
  //# sourceMappingURL=StaticDeviceModelDataSource.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/data/StaticDeviceModelDataSource.ts"],
4
- "sourcesContent": ["import { injectable } from \"inversify\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nimport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\n/**\n * Static/in memory implementation of the device model data source\n */\n@injectable()\nexport class StaticDeviceModelDataSource implements DeviceModelDataSource {\n private static deviceModelByIds: {\n [key in DeviceModelId]: TransportDeviceModel;\n } = {\n [DeviceModelId.NANO_S]: new TransportDeviceModel({\n id: DeviceModelId.NANO_S,\n productName: \"Ledger Nano S\",\n usbProductId: 0x10,\n bootloaderUsbProductId: 0x0001,\n usbOnly: true,\n memorySize: 320 * 1024,\n masks: [0x31100000],\n }),\n [DeviceModelId.NANO_SP]: new TransportDeviceModel({\n id: DeviceModelId.NANO_SP,\n productName: \"Ledger Nano S Plus\",\n usbProductId: 0x50,\n bootloaderUsbProductId: 0x0005,\n usbOnly: true,\n memorySize: 1533 * 1024,\n masks: [0x33100000],\n }),\n [DeviceModelId.NANO_X]: new TransportDeviceModel({\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.STAX]: new TransportDeviceModel({\n id: DeviceModelId.STAX,\n productName: \"Ledger Stax\",\n usbProductId: 0x60,\n bootloaderUsbProductId: 0x0006,\n usbOnly: false,\n memorySize: 1533 * 1024,\n masks: [0x33200000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-6004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-6004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-6004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-6004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.FLEX]: new TransportDeviceModel({\n id: DeviceModelId.FLEX,\n productName: \"Ledger Flex\",\n usbProductId: 0x70,\n bootloaderUsbProductId: 0x0007,\n usbOnly: false,\n memorySize: 1533 * 1024,\n masks: [0x33300000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-3004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-3004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-3004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-3004-0003-4c6564676572\",\n },\n ],\n }),\n };\n\n getAllDeviceModels(): TransportDeviceModel[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds);\n }\n\n getDeviceModel(params: { id: DeviceModelId }): TransportDeviceModel {\n return StaticDeviceModelDataSource.deviceModelByIds[params.id];\n }\n\n /**\n * Returns the list of device models that match all the given parameters\n */\n filterDeviceModels(\n params: Partial<TransportDeviceModel>,\n ): TransportDeviceModel[] {\n return this.getAllDeviceModels().filter((deviceModel) => {\n return Object.entries(params).every(([key, value]) => {\n return deviceModel[key as keyof TransportDeviceModel] === value;\n });\n });\n }\n\n getBluetoothServicesInfos(): Record<string, BleDeviceInfos> {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds).reduce<\n Record<string, BleDeviceInfos>\n >((acc, deviceModel) => {\n const { bluetoothSpec } = deviceModel;\n if (bluetoothSpec) {\n return {\n ...acc,\n ...bluetoothSpec.reduce<Record<string, BleDeviceInfos>>(\n (serviceToModel, bleSpec) => ({\n ...serviceToModel,\n [bleSpec.serviceUuid]: new BleDeviceInfos(\n deviceModel,\n bleSpec.serviceUuid,\n bleSpec.writeUuid,\n bleSpec.writeCmdUuid,\n bleSpec.notifyUuid,\n ),\n }),\n {},\n ),\n };\n }\n return acc;\n }, {});\n }\n\n getBluetoothServices(): string[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds)\n .map((deviceModel) =>\n (deviceModel.bluetoothSpec || []).map((spec) => spec.serviceUuid),\n )\n .flat()\n .filter((uuid) => !!uuid);\n }\n}\n"],
5
- "mappings": "gVAAA,OAAS,cAAAA,MAAkB,YAE3B,OAAS,iBAAAC,MAAqB,0BAE9B,OAAS,kBAAAC,MAAsB,yCAC/B,OAAS,wBAAAC,MAA4B,sCAM9B,IAAMC,EAAN,KAAmE,CA2ExE,oBAA6C,CAC3C,OAAO,OAAO,OAAOA,EAA4B,gBAAgB,CACnE,CAEA,eAAeC,EAAqD,CAClE,OAAOD,EAA4B,iBAAiBC,EAAO,EAAE,CAC/D,CAKA,mBACEA,EACwB,CACxB,OAAO,KAAK,mBAAmB,EAAE,OAAQC,GAChC,OAAO,QAAQD,CAAM,EAAE,MAAM,CAAC,CAACE,EAAKC,CAAK,IACvCF,EAAYC,CAAiC,IAAMC,CAC3D,CACF,CACH,CAEA,2BAA4D,CAC1D,OAAO,OAAO,OAAOJ,EAA4B,gBAAgB,EAAE,OAEjE,CAACK,EAAKH,IAAgB,CACtB,KAAM,CAAE,cAAAI,CAAc,EAAIJ,EAC1B,OAAII,EACK,CACL,GAAGD,EACH,GAAGC,EAAc,OACf,CAACC,EAAgBC,KAAa,CAC5B,GAAGD,EACH,CAACC,EAAQ,WAAW,EAAG,IAAIC,EACzBP,EACAM,EAAQ,YACRA,EAAQ,UACRA,EAAQ,aACRA,EAAQ,UACV,CACF,GACA,CAAC,CACH,CACF,EAEKH,CACT,EAAG,CAAC,CAAC,CACP,CAEA,sBAAiC,CAC/B,OAAO,OAAO,OAAOL,EAA4B,gBAAgB,EAC9D,IAAKE,IACHA,EAAY,eAAiB,CAAC,GAAG,IAAKQ,GAASA,EAAK,WAAW,CAClE,EACC,KAAK,EACL,OAAQC,GAAS,CAAC,CAACA,CAAI,CAC5B,CACF,EAlIEC,EADWZ,EACI,mBAEX,CACF,CAACa,EAAc,MAAM,EAAG,IAAIC,EAAqB,CAC/C,GAAID,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,IAAM,KAClB,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAACA,EAAc,OAAO,EAAG,IAAIC,EAAqB,CAChD,GAAID,EAAc,QAClB,YAAa,qBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAACA,EAAc,MAAM,EAAG,IAAIC,EAAqB,CAC/C,GAAID,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,IACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,CACH,GAzEWb,EAANe,EAAA,CADNC,EAAW,GACChB",
4
+ "sourcesContent": ["import { injectable } from \"inversify\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nimport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\n/**\n * Static/in memory implementation of the device model data source\n */\n@injectable()\nexport class StaticDeviceModelDataSource implements DeviceModelDataSource {\n private static deviceModelByIds: {\n [_key in DeviceModelId]: TransportDeviceModel;\n } = {\n [DeviceModelId.NANO_S]: new TransportDeviceModel({\n id: DeviceModelId.NANO_S,\n productName: \"Ledger Nano S\",\n usbProductId: 0x10,\n bootloaderUsbProductId: 0x0001,\n usbOnly: true,\n memorySize: 320 * 1024,\n blockSize: 4 * 1024,\n masks: [0x31100000],\n }),\n [DeviceModelId.NANO_SP]: new TransportDeviceModel({\n id: DeviceModelId.NANO_SP,\n productName: \"Ledger Nano S Plus\",\n usbProductId: 0x50,\n bootloaderUsbProductId: 0x0005,\n usbOnly: true,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33100000],\n }),\n [DeviceModelId.NANO_X]: new TransportDeviceModel({\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n blockSize: 4 * 1024,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.STAX]: new TransportDeviceModel({\n id: DeviceModelId.STAX,\n productName: \"Ledger Stax\",\n usbProductId: 0x60,\n bootloaderUsbProductId: 0x0006,\n usbOnly: false,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33200000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-6004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-6004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-6004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-6004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.FLEX]: new TransportDeviceModel({\n id: DeviceModelId.FLEX,\n productName: \"Ledger Flex\",\n usbProductId: 0x70,\n bootloaderUsbProductId: 0x0007,\n usbOnly: false,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33300000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-3004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-3004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-3004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-3004-0003-4c6564676572\",\n },\n ],\n }),\n };\n\n getAllDeviceModels(): TransportDeviceModel[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds);\n }\n\n getDeviceModel(params: { id: DeviceModelId }): TransportDeviceModel {\n return StaticDeviceModelDataSource.deviceModelByIds[params.id];\n }\n\n /**\n * Returns the list of device models that match all the given parameters\n */\n filterDeviceModels(\n params: Partial<TransportDeviceModel>,\n ): TransportDeviceModel[] {\n return this.getAllDeviceModels().filter((deviceModel) => {\n return Object.entries(params).every(([key, value]) => {\n return deviceModel[key as keyof TransportDeviceModel] === value;\n });\n });\n }\n\n getBluetoothServicesInfos(): Record<string, BleDeviceInfos> {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds).reduce<\n Record<string, BleDeviceInfos>\n >((acc, deviceModel) => {\n const { bluetoothSpec } = deviceModel;\n if (bluetoothSpec) {\n return {\n ...acc,\n ...bluetoothSpec.reduce<Record<string, BleDeviceInfos>>(\n (serviceToModel, bleSpec) => ({\n ...serviceToModel,\n [bleSpec.serviceUuid]: new BleDeviceInfos(\n deviceModel,\n bleSpec.serviceUuid,\n bleSpec.writeUuid,\n bleSpec.writeCmdUuid,\n bleSpec.notifyUuid,\n ),\n }),\n {},\n ),\n };\n }\n return acc;\n }, {});\n }\n\n getBluetoothServices(): string[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds)\n .map((deviceModel) =>\n (deviceModel.bluetoothSpec || []).map((spec) => spec.serviceUuid),\n )\n .flat()\n .filter((uuid) => !!uuid);\n }\n}\n"],
5
+ "mappings": "gVAAA,OAAS,cAAAA,MAAkB,YAE3B,OAAS,iBAAAC,MAAqB,0BAE9B,OAAS,kBAAAC,MAAsB,yCAC/B,OAAS,wBAAAC,MAA4B,sCAM9B,IAAMC,EAAN,KAAmE,CAgFxE,oBAA6C,CAC3C,OAAO,OAAO,OAAOA,EAA4B,gBAAgB,CACnE,CAEA,eAAeC,EAAqD,CAClE,OAAOD,EAA4B,iBAAiBC,EAAO,EAAE,CAC/D,CAKA,mBACEA,EACwB,CACxB,OAAO,KAAK,mBAAmB,EAAE,OAAQC,GAChC,OAAO,QAAQD,CAAM,EAAE,MAAM,CAAC,CAACE,EAAKC,CAAK,IACvCF,EAAYC,CAAiC,IAAMC,CAC3D,CACF,CACH,CAEA,2BAA4D,CAC1D,OAAO,OAAO,OAAOJ,EAA4B,gBAAgB,EAAE,OAEjE,CAACK,EAAKH,IAAgB,CACtB,KAAM,CAAE,cAAAI,CAAc,EAAIJ,EAC1B,OAAII,EACK,CACL,GAAGD,EACH,GAAGC,EAAc,OACf,CAACC,EAAgBC,KAAa,CAC5B,GAAGD,EACH,CAACC,EAAQ,WAAW,EAAG,IAAIC,EACzBP,EACAM,EAAQ,YACRA,EAAQ,UACRA,EAAQ,aACRA,EAAQ,UACV,CACF,GACA,CAAC,CACH,CACF,EAEKH,CACT,EAAG,CAAC,CAAC,CACP,CAEA,sBAAiC,CAC/B,OAAO,OAAO,OAAOL,EAA4B,gBAAgB,EAC9D,IAAKE,IACHA,EAAY,eAAiB,CAAC,GAAG,IAAKQ,GAASA,EAAK,WAAW,CAClE,EACC,KAAK,EACL,OAAQC,GAAS,CAAC,CAACA,CAAI,CAC5B,CACF,EAvIEC,EADWZ,EACI,mBAEX,CACF,CAACa,EAAc,MAAM,EAAG,IAAIC,EAAqB,CAC/C,GAAID,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,IAAM,KAClB,UAAW,EAAI,KACf,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAACA,EAAc,OAAO,EAAG,IAAIC,EAAqB,CAChD,GAAID,EAAc,QAClB,YAAa,qBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,UAAW,GACX,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAACA,EAAc,MAAM,EAAG,IAAIC,EAAqB,CAC/C,GAAID,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,UAAW,EAAI,KACf,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,UAAW,GACX,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,IACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,UAAW,GACX,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,CACH,GA9EWb,EAANe,EAAA,CADNC,EAAW,GACChB",
6
6
  "names": ["injectable", "DeviceModelId", "BleDeviceInfos", "TransportDeviceModel", "StaticDeviceModelDataSource", "params", "deviceModel", "key", "value", "acc", "bluetoothSpec", "serviceToModel", "bleSpec", "BleDeviceInfos", "spec", "uuid", "__publicField", "DeviceModelId", "TransportDeviceModel", "__decorateClass", "injectable"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import r from"semver";import{DeviceModelId as t}from"../../device/DeviceModel";class s{id;productName;usbProductId;bootloaderUsbProductId;usbOnly;memorySize;masks;bluetoothSpec;constructor(e){this.id=e.id,this.productName=e.productName,this.usbProductId=e.usbProductId,this.bootloaderUsbProductId=e.bootloaderUsbProductId,this.usbOnly=e.usbOnly,this.memorySize=e.memorySize,this.masks=e.masks,this.bluetoothSpec=e.bluetoothSpec}getBlockSize(e){switch(this.id){case t.NANO_S:return r.lt(r.coerce(e)??"","2.0.0")?4*1024:2*1024;case t.NANO_X:return 4*1024;case t.NANO_SP:case t.STAX:case t.FLEX:return 32}}}export{s as TransportDeviceModel};
1
+ import i from"semver";import{DeviceModelId as t}from"../../device/DeviceModel";class d{id;productName;usbProductId;bootloaderUsbProductId;usbOnly;memorySize;blockSize;masks;bluetoothSpec;constructor(e){this.id=e.id,this.productName=e.productName,this.usbProductId=e.usbProductId,this.bootloaderUsbProductId=e.bootloaderUsbProductId,this.usbOnly=e.usbOnly,this.memorySize=e.memorySize,this.blockSize=e.blockSize,this.masks=e.masks,this.bluetoothSpec=e.bluetoothSpec}getBlockSize(e){switch(this.id){case t.NANO_S:return i.lt(i.coerce(e)??"","2.0.0")?4*1024:2*1024;case t.NANO_X:return 4*1024;case t.NANO_SP:case t.STAX:case t.FLEX:return 32}}}export{d as TransportDeviceModel};
2
2
  //# sourceMappingURL=DeviceModel.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/model/DeviceModel.ts"],
4
- "sourcesContent": ["import semver from \"semver\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\n/**\n * The info of a device model\n */\nexport class TransportDeviceModel {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n masks: number[];\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n\n constructor(props: {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n masks: number[];\n\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n }) {\n this.id = props.id;\n this.productName = props.productName;\n this.usbProductId = props.usbProductId;\n this.bootloaderUsbProductId = props.bootloaderUsbProductId;\n this.usbOnly = props.usbOnly;\n this.memorySize = props.memorySize;\n this.masks = props.masks;\n this.bluetoothSpec = props.bluetoothSpec;\n }\n\n getBlockSize(firmwareVersion: string): number {\n switch (this.id) {\n case DeviceModelId.NANO_S:\n return semver.lt(semver.coerce(firmwareVersion) ?? \"\", \"2.0.0\")\n ? 4 * 1024\n : 2 * 1024;\n case DeviceModelId.NANO_X:\n return 4 * 1024;\n case DeviceModelId.NANO_SP:\n case DeviceModelId.STAX:\n case DeviceModelId.FLEX:\n return 32;\n }\n }\n}\n"],
5
- "mappings": "AAAA,OAAOA,MAAY,SAEnB,OAAS,iBAAAC,MAAqB,0BAKvB,MAAMC,CAAqB,CAChC,GACA,YACA,aACA,uBACA,QACA,WACA,MACA,cAOA,YAAYC,EAeT,CACD,KAAK,GAAKA,EAAM,GAChB,KAAK,YAAcA,EAAM,YACzB,KAAK,aAAeA,EAAM,aAC1B,KAAK,uBAAyBA,EAAM,uBACpC,KAAK,QAAUA,EAAM,QACrB,KAAK,WAAaA,EAAM,WACxB,KAAK,MAAQA,EAAM,MACnB,KAAK,cAAgBA,EAAM,aAC7B,CAEA,aAAaC,EAAiC,CAC5C,OAAQ,KAAK,GAAI,CACf,KAAKH,EAAc,OACjB,OAAOD,EAAO,GAAGA,EAAO,OAAOI,CAAe,GAAK,GAAI,OAAO,EAC1D,EAAI,KACJ,EAAI,KACV,KAAKH,EAAc,OACjB,MAAO,GAAI,KACb,KAAKA,EAAc,QACnB,KAAKA,EAAc,KACnB,KAAKA,EAAc,KACjB,MAAO,GACX,CACF,CACF",
4
+ "sourcesContent": ["import semver from \"semver\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\n/**\n * The info of a device model\n */\nexport class TransportDeviceModel {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n\n constructor(props: {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n }) {\n this.id = props.id;\n this.productName = props.productName;\n this.usbProductId = props.usbProductId;\n this.bootloaderUsbProductId = props.bootloaderUsbProductId;\n this.usbOnly = props.usbOnly;\n this.memorySize = props.memorySize;\n this.blockSize = props.blockSize;\n this.masks = props.masks;\n this.bluetoothSpec = props.bluetoothSpec;\n }\n\n getBlockSize(firmwareVersion: string): number {\n switch (this.id) {\n case DeviceModelId.NANO_S:\n return semver.lt(semver.coerce(firmwareVersion) ?? \"\", \"2.0.0\")\n ? 4 * 1024\n : 2 * 1024;\n case DeviceModelId.NANO_X:\n return 4 * 1024;\n case DeviceModelId.NANO_SP:\n case DeviceModelId.STAX:\n case DeviceModelId.FLEX:\n return 32;\n }\n }\n}\n"],
5
+ "mappings": "AAAA,OAAOA,MAAY,SAEnB,OAAS,iBAAAC,MAAqB,0BAKvB,MAAMC,CAAqB,CAChC,GACA,YACA,aACA,uBACA,QACA,WACA,UACA,MACA,cAOA,YAAYC,EAgBT,CACD,KAAK,GAAKA,EAAM,GAChB,KAAK,YAAcA,EAAM,YACzB,KAAK,aAAeA,EAAM,aAC1B,KAAK,uBAAyBA,EAAM,uBACpC,KAAK,QAAUA,EAAM,QACrB,KAAK,WAAaA,EAAM,WACxB,KAAK,UAAYA,EAAM,UACvB,KAAK,MAAQA,EAAM,MACnB,KAAK,cAAgBA,EAAM,aAC7B,CAEA,aAAaC,EAAiC,CAC5C,OAAQ,KAAK,GAAI,CACf,KAAKH,EAAc,OACjB,OAAOD,EAAO,GAAGA,EAAO,OAAOI,CAAe,GAAK,GAAI,OAAO,EAC1D,EAAI,KACJ,EAAI,KACV,KAAKH,EAAc,OACjB,MAAO,GAAI,KACb,KAAKA,EAAc,QACnB,KAAKA,EAAc,KACnB,KAAKA,EAAc,KACjB,MAAO,GACX,CACF,CACF",
6
6
  "names": ["semver", "DeviceModelId", "TransportDeviceModel", "props", "firmwareVersion"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceModelId as o}from"../../device/DeviceModel";function r(e={}){return{id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}],getBlockSize:()=>4*1024,...e}}export{r as deviceModelStubBuilder};
1
+ import{DeviceModelId as o}from"../../device/DeviceModel";function r(e={}){return{id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,blockSize:32,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}],getBlockSize:()=>4*1024,...e}}export{r as deviceModelStubBuilder};
2
2
  //# sourceMappingURL=DeviceModel.stub.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/model/DeviceModel.stub.ts"],
4
- "sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\nexport function deviceModelStubBuilder(\n props: Partial<TransportDeviceModel> = {},\n): TransportDeviceModel {\n return {\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n getBlockSize: () => 4 * 1024,\n ...props,\n };\n}\n"],
5
- "mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAGvB,SAASC,EACdC,EAAuC,CAAC,EAClB,CACtB,MAAO,CACL,GAAIF,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,EACA,aAAc,IAAM,EAAI,KACxB,GAAGE,CACL,CACF",
4
+ "sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\nexport function deviceModelStubBuilder(\n props: Partial<TransportDeviceModel> = {},\n): TransportDeviceModel {\n return {\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n blockSize: 32,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n getBlockSize: () => 4 * 1024,\n ...props,\n };\n}\n"],
5
+ "mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAGvB,SAASC,EACdC,EAAuC,CAAC,EAClB,CACtB,MAAO,CACL,GAAIF,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,UAAW,GACX,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,EACA,aAAc,IAAM,EAAI,KACxB,GAAGE,CACL,CACF",
6
6
  "names": ["DeviceModelId", "deviceModelStubBuilder", "props"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var t=(e=>(e[e.Connected=0]="Connected",e[e.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",e[e.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",e))(t||{});export{t as DeviceSessionStateType};
1
+ var a=(e=>(e[e.Connected=0]="Connected",e[e.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",e[e.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",e))(a||{});export{a as DeviceSessionStateType};
2
2
  //# sourceMappingURL=DeviceSessionState.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/api/device-session/DeviceSessionState.ts"],
4
- "sourcesContent": ["import { type GetAppAndVersionResponse } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { type BatteryStatusFlags } from \"@api/command/os/GetBatteryStatusCommand\";\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\n\n/**\n * The battery status of a device.\n */\nexport type BatteryStatus = {\n readonly level: number;\n readonly voltage: number;\n readonly temperature: number;\n readonly current: number;\n readonly status: BatteryStatusFlags;\n};\n\n/**\n * The firmware version of a device.\n */\nexport type FirmwareVersion = {\n /**\n * Microcontroller Unit version\n */\n readonly mcu: string;\n\n /**\n * Bootloader version\n */\n readonly bootloader: string;\n\n /**\n * Operating System version\n */\n readonly os: string;\n};\n\n/**\n * The current application running on a device. Alias of GetAppAndVersionResponse.\n */\nexport type RunningApp = GetAppAndVersionResponse;\n\n/**\n * The state types of a device session.\n */\nexport enum DeviceSessionStateType {\n Connected,\n ReadyWithoutSecureChannel,\n ReadyWithSecureChannel,\n}\n\ntype DeviceSessionBaseState = {\n readonly sessionStateType: DeviceSessionStateType;\n\n /**\n * The status of the device.\n */\n readonly deviceStatus: DeviceStatus;\n\n /**\n * The model of the device.\n */\n readonly deviceModelId: DeviceModelId;\n\n /**\n * The name of the device.\n */\n readonly deviceName?: string;\n};\n\ntype DeviceSessionReadyState = {\n /**\n * The battery status of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly batteryStatus?: BatteryStatus;\n\n /**\n * The firmware version of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly firmwareVersion?: FirmwareVersion;\n\n /**\n * The current application running on the device.\n */\n readonly currentApp: RunningApp;\n\n /**\n * The current applications installed on the device.\n */\n readonly installedApps: Application[];\n\n /**\n * The device is allowed to establish a secure connection.\n */\n readonly isSecureConnectionAllowed: boolean;\n};\n\n/**\n * The state of a connected device session.\n */\nexport type ConnectedState = DeviceSessionBaseState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.Connected;\n};\n\n/**\n * The state of a device session when it is ready without a secure channel.\n */\nexport type ReadyWithoutSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel;\n };\n\n/**\n * The state of a device session when it is ready with a secure channel.\n */\nexport type ReadyWithSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithSecureChannel;\n };\n\n/**\n * The state of a device session.\n */\nexport type DeviceSessionState =\n | ConnectedState\n | ReadyWithoutSecureChannelState\n | ReadyWithSecureChannelState;\n"],
5
- "mappings": "AA6CO,IAAKA,OACVA,IAAA,yBACAA,IAAA,yDACAA,IAAA,mDAHUA,OAAA",
4
+ "sourcesContent": ["import { type GetAppAndVersionResponse } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { type BatteryStatusFlags } from \"@api/command/os/GetBatteryStatusCommand\";\nimport { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\nimport {\n type FinalFirmware,\n type OsuFirmware,\n} from \"@internal/manager-api/model/Firmware\";\nimport { type LanguagePackage } from \"@internal/manager-api/model/Language\";\n\n/**\n * The battery status of a device.\n */\nexport type BatteryStatus = {\n readonly level: number;\n readonly voltage: number;\n readonly temperature: number;\n readonly current: number;\n readonly status: BatteryStatusFlags;\n};\n\n/**\n * The firmware version of a device.\n */\nexport type FirmwareVersion = {\n /**\n * Microcontroller Unit version\n */\n readonly mcu: string;\n\n /**\n * Bootloader version\n */\n readonly bootloader: string;\n\n /**\n * Operating System version\n */\n readonly os: string;\n\n /**\n * Metadata for advanced users, to get detailed informations on\n * the firmware running on the device.\n */\n readonly metadata?: GetOsVersionResponse;\n};\n\n/**\n * Context for firmware updates\n */\nexport type FirmwareUpdateContext = {\n /**\n * Current installed firmware\n */\n readonly currentFirmware: FinalFirmware;\n\n /**\n * Available firmware update\n */\n readonly availableUpdate?: FirmwareUpdate;\n};\n\n/**\n * Available firmware update\n */\nexport type FirmwareUpdate = {\n /**\n * Version of the OS updater firmware\n */\n readonly osuFirmware: OsuFirmware;\n\n /**\n * Version of the final firmware\n */\n readonly finalFirmware: FinalFirmware;\n\n /**\n * Indicates if the MCU needs to be updated\n */\n readonly mcuUpdateRequired: boolean;\n};\n\n/**\n * The app store catalog for that device.\n */\nexport type Catalog = {\n /**\n * Available applications for the device\n */\n readonly applications: Application[];\n\n /**\n * Available languages packages for the device\n */\n readonly languagePackages: LanguagePackage[];\n};\n\n/**\n * Language package installed on the device\n */\nexport type InstalledLanguagePackage = {\n /**\n * The identifier of the language package\n */\n readonly id: number;\n\n /**\n * The size of the language package\n */\n readonly size: number;\n};\n\n/**\n * Custom image metadata, if one was loaded on the device\n */\nexport type CustomImage = {\n /**\n * The size of loaded custom image, if one was loaded\n */\n readonly size?: number;\n};\n\n/**\n * The current application running on a device. Alias of GetAppAndVersionResponse.\n */\nexport type RunningApp = GetAppAndVersionResponse;\n\n/**\n * The state types of a device session.\n */\nexport enum DeviceSessionStateType {\n Connected,\n ReadyWithoutSecureChannel,\n ReadyWithSecureChannel,\n}\n\ntype DeviceSessionBaseState = {\n readonly sessionStateType: DeviceSessionStateType;\n\n /**\n * The status of the device.\n */\n readonly deviceStatus: DeviceStatus;\n\n /**\n * The model of the device.\n */\n readonly deviceModelId: DeviceModelId;\n\n /**\n * The name of the device.\n */\n readonly deviceName?: string;\n};\n\ntype DeviceSessionReadyState = {\n /**\n * The battery status of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly batteryStatus?: BatteryStatus;\n\n /**\n * The firmware version of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly firmwareVersion?: FirmwareVersion;\n\n /**\n * Context of available firmware update\n */\n readonly firmwareUpdateContext?: FirmwareUpdateContext;\n\n /**\n * The current application running on the device.\n */\n readonly currentApp: RunningApp;\n\n /**\n * The current applications installed on the device.\n */\n readonly installedApps: Application[];\n\n /**\n * Available updates from the app store for installed applications.\n */\n readonly appsUpdates?: Application[];\n\n /**\n * The current language packages installed on the device.\n */\n readonly installedLanguages?: InstalledLanguagePackage[];\n\n /**\n * Catalog of available applications and languages for the device.\n */\n readonly catalog?: Catalog;\n\n /**\n * Custom image metadata.\n */\n readonly customImage?: CustomImage;\n\n /**\n * The device is allowed to establish a secure connection.\n */\n readonly isSecureConnectionAllowed: boolean;\n};\n\n/**\n * The state of a connected device session.\n */\nexport type ConnectedState = DeviceSessionBaseState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.Connected;\n};\n\n/**\n * The state of a device session when it is ready without a secure channel.\n */\nexport type ReadyWithoutSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel;\n };\n\n/**\n * The state of a device session when it is ready with a secure channel.\n */\nexport type ReadyWithSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithSecureChannel;\n };\n\n/**\n * The state of a device session.\n */\nexport type DeviceSessionState =\n | ConnectedState\n | ReadyWithoutSecureChannelState\n | ReadyWithSecureChannelState;\n"],
5
+ "mappings": "AAoIO,IAAKA,OACVA,IAAA,yBACAA,IAAA,yDACAA,IAAA,mDAHUA,OAAA",
6
6
  "names": ["DeviceSessionStateType"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{deviceSessionStubBuilder as f}from"../../../internal/device-session/model/DeviceSession.stub";import{DeviceSessionNotFound as l}from"../../../internal/device-session/model/Errors";import{DefaultDeviceSessionService as S}from"../../../internal/device-session/service/DefaultDeviceSessionService";import{DefaultLoggerPublisherService as m}from"../../../internal/logger-publisher/service/DefaultLoggerPublisherService";import{AxiosManagerApiDataSource as v}from"../../../internal/manager-api/data/AxiosManagerApiDataSource";import{DefaultManagerApiService as d}from"../../../internal/manager-api/service/DefaultManagerApiService";import{DefaultSecureChannelDataSource as u}from"../../../internal/secure-channel/data/DefaultSecureChannelDataSource";import{DefaultSecureChannelService as p}from"../../../internal/secure-channel/service/DefaultSecureChannelService";import{DisableDeviceSessionRefresherUseCase as n}from"./DisableDeviceSessionRefresher";vi.mock("uuid",()=>({v4:()=>"fakeUuid"}));let e,r,i,o,t,c;describe("DisableDeviceSessionRefresherUseCase",()=>{beforeEach(()=>{e=new m([],"get-connected-device-use-case-test"),r=new S(()=>e),t=new d(new v({})),c=new p(new u({}))}),afterEach(()=>{vi.clearAllMocks()}),describe("execute",()=>{it("should disable the device session refresher and return a function to reenable it",()=>{o=f({id:"fakeSessionId"},()=>e,t,c),r.addDeviceSession(o),i=new n(r,()=>e);const s=vi.spyOn(o,"disableRefresher"),a=i.execute({sessionId:"fakeSessionId",blockerId:"fakeBlockerId"});expect(s).toHaveBeenCalledWith("fakeBlockerId"),a(),o.close()}),it("should throw error when deviceSession is not found",()=>{i=new n(r,()=>e);try{i.execute({sessionId:"fakeSessionId",blockerId:"fakeBlockerId"})}catch(s){expect(s).toBeInstanceOf(l)}})})});
1
+ import{DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS as f}from"../../../internal/device-session/data/DeviceSessionRefresherConst";import{deviceSessionStubBuilder as l}from"../../../internal/device-session/model/DeviceSession.stub";import{DeviceSessionNotFound as S}from"../../../internal/device-session/model/Errors";import{DefaultDeviceSessionService as m}from"../../../internal/device-session/service/DefaultDeviceSessionService";import{DefaultLoggerPublisherService as v}from"../../../internal/logger-publisher/service/DefaultLoggerPublisherService";import{AxiosManagerApiDataSource as d}from"../../../internal/manager-api/data/AxiosManagerApiDataSource";import{DefaultManagerApiService as p}from"../../../internal/manager-api/service/DefaultManagerApiService";import{DefaultSecureChannelDataSource as u}from"../../../internal/secure-channel/data/DefaultSecureChannelDataSource";import{DefaultSecureChannelService as D}from"../../../internal/secure-channel/service/DefaultSecureChannelService";import{DisableDeviceSessionRefresherUseCase as n}from"./DisableDeviceSessionRefresher";vi.mock("uuid",()=>({v4:()=>"fakeUuid"}));let e,r,i,o,t,c;describe("DisableDeviceSessionRefresherUseCase",()=>{beforeEach(()=>{e=new v([],"get-connected-device-use-case-test"),r=new m(()=>e),t=new p(new d({})),c=new D(new u({}))}),afterEach(()=>{vi.clearAllMocks()}),describe("execute",()=>{it("should disable the device session refresher and return a function to reenable it",()=>{o=l({id:"fakeSessionId"},()=>e,t,c,f),r.addDeviceSession(o),i=new n(r,()=>e);const s=vi.spyOn(o,"disableRefresher"),a=i.execute({sessionId:"fakeSessionId",blockerId:"fakeBlockerId"});expect(s).toHaveBeenCalledWith("fakeBlockerId"),a(),o.close()}),it("should throw error when deviceSession is not found",()=>{i=new n(r,()=>e);try{i.execute({sessionId:"fakeSessionId",blockerId:"fakeBlockerId"})}catch(s){expect(s).toBeInstanceOf(S)}})})});
2
2
  //# sourceMappingURL=DisableDeviceSessionRefresher.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-session/use-case/DisableDeviceSessionRefresher.test.ts"],
4
- "sourcesContent": ["import { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DisableDeviceSessionRefresherUseCase } from \"./DisableDeviceSessionRefresher\";\n\nvi.mock(\"uuid\", () => ({\n v4: () => \"fakeUuid\",\n}));\n\nlet logger: LoggerPublisherService;\nlet sessionService: DeviceSessionService;\nlet useCase: DisableDeviceSessionRefresherUseCase;\nlet deviceSession: DeviceSession;\nlet managerApi: ManagerApiService;\nlet secureChannel: SecureChannelService;\ndescribe(\"DisableDeviceSessionRefresherUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService(\n [],\n \"get-connected-device-use-case-test\",\n );\n sessionService = new DefaultDeviceSessionService(() => logger);\n managerApi = new DefaultManagerApiService(\n new AxiosManagerApiDataSource({} as DmkConfig),\n );\n secureChannel = new DefaultSecureChannelService(\n new DefaultSecureChannelDataSource({} as DmkConfig),\n );\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n });\n\n describe(\"execute\", () => {\n it(\"should disable the device session refresher and return a function to reenable it\", () => {\n // given\n deviceSession = deviceSessionStubBuilder(\n { id: \"fakeSessionId\" },\n () => logger,\n managerApi,\n secureChannel,\n );\n sessionService.addDeviceSession(deviceSession);\n useCase = new DisableDeviceSessionRefresherUseCase(\n sessionService,\n () => logger,\n );\n\n const spy = vi.spyOn(deviceSession, \"disableRefresher\");\n\n // when\n const reenableRefresher = useCase.execute({\n sessionId: \"fakeSessionId\",\n blockerId: \"fakeBlockerId\",\n });\n\n // then\n expect(spy).toHaveBeenCalledWith(\"fakeBlockerId\");\n reenableRefresher();\n deviceSession.close();\n });\n\n it(\"should throw error when deviceSession is not found\", () => {\n // given\n useCase = new DisableDeviceSessionRefresherUseCase(\n sessionService,\n () => logger,\n );\n\n // when\n try {\n useCase.execute({\n sessionId: \"fakeSessionId\",\n blockerId: \"fakeBlockerId\",\n });\n } catch (error) {\n // then\n expect(error).toBeInstanceOf(DeviceSessionNotFound);\n }\n });\n });\n});\n"],
5
- "mappings": "AAGA,OAAS,4BAAAA,MAAgC,oDACzC,OAAS,yBAAAC,MAA6B,wCACtC,OAAS,+BAAAC,MAAmC,+DAE5C,OAAS,iCAAAC,MAAqC,mEAC9C,OAAS,6BAAAC,MAAiC,uDAC1C,OAAS,4BAAAC,MAAgC,yDAEzC,OAAS,kCAAAC,MAAsC,+DAC/C,OAAS,+BAAAC,MAAmC,+DAG5C,OAAS,wCAAAC,MAA4C,kCAErD,GAAG,KAAK,OAAQ,KAAO,CACrB,GAAI,IAAM,UACZ,EAAE,EAEF,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,SAAS,uCAAwC,IAAM,CACrD,WAAW,IAAM,CACfL,EAAS,IAAIN,EACX,CAAC,EACD,oCACF,EACAO,EAAiB,IAAIR,EAA4B,IAAMO,CAAM,EAC7DI,EAAa,IAAIR,EACf,IAAID,EAA0B,CAAC,CAAc,CAC/C,EACAU,EAAgB,IAAIP,EAClB,IAAID,EAA+B,CAAC,CAAc,CACpD,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,GAAG,mFAAoF,IAAM,CAE3FM,EAAgBZ,EACd,CAAE,GAAI,eAAgB,EACtB,IAAMS,EACNI,EACAC,CACF,EACAJ,EAAe,iBAAiBE,CAAa,EAC7CD,EAAU,IAAIH,EACZE,EACA,IAAMD,CACR,EAEA,MAAMM,EAAM,GAAG,MAAMH,EAAe,kBAAkB,EAGhDI,EAAoBL,EAAQ,QAAQ,CACxC,UAAW,gBACX,UAAW,eACb,CAAC,EAGD,OAAOI,CAAG,EAAE,qBAAqB,eAAe,EAChDC,EAAkB,EAClBJ,EAAc,MAAM,CACtB,CAAC,EAED,GAAG,qDAAsD,IAAM,CAE7DD,EAAU,IAAIH,EACZE,EACA,IAAMD,CACR,EAGA,GAAI,CACFE,EAAQ,QAAQ,CACd,UAAW,gBACX,UAAW,eACb,CAAC,CACH,OAASM,EAAO,CAEd,OAAOA,CAAK,EAAE,eAAehB,CAAqB,CACpD,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["deviceSessionStubBuilder", "DeviceSessionNotFound", "DefaultDeviceSessionService", "DefaultLoggerPublisherService", "AxiosManagerApiDataSource", "DefaultManagerApiService", "DefaultSecureChannelDataSource", "DefaultSecureChannelService", "DisableDeviceSessionRefresherUseCase", "logger", "sessionService", "useCase", "deviceSession", "managerApi", "secureChannel", "spy", "reenableRefresher", "error"]
4
+ "sourcesContent": ["import { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { type DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DisableDeviceSessionRefresherUseCase } from \"./DisableDeviceSessionRefresher\";\n\nvi.mock(\"uuid\", () => ({\n v4: () => \"fakeUuid\",\n}));\n\nlet logger: LoggerPublisherService;\nlet sessionService: DeviceSessionService;\nlet useCase: DisableDeviceSessionRefresherUseCase;\nlet deviceSession: DeviceSession;\nlet managerApi: ManagerApiService;\nlet secureChannel: SecureChannelService;\ndescribe(\"DisableDeviceSessionRefresherUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService(\n [],\n \"get-connected-device-use-case-test\",\n );\n sessionService = new DefaultDeviceSessionService(() => logger);\n managerApi = new DefaultManagerApiService(\n new AxiosManagerApiDataSource({} as DmkConfig),\n );\n secureChannel = new DefaultSecureChannelService(\n new DefaultSecureChannelDataSource({} as DmkConfig),\n );\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n });\n\n describe(\"execute\", () => {\n it(\"should disable the device session refresher and return a function to reenable it\", () => {\n // given\n deviceSession = deviceSessionStubBuilder(\n { id: \"fakeSessionId\" },\n () => logger,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n sessionService.addDeviceSession(deviceSession);\n useCase = new DisableDeviceSessionRefresherUseCase(\n sessionService,\n () => logger,\n );\n\n const spy = vi.spyOn(deviceSession, \"disableRefresher\");\n\n // when\n const reenableRefresher = useCase.execute({\n sessionId: \"fakeSessionId\",\n blockerId: \"fakeBlockerId\",\n });\n\n // then\n expect(spy).toHaveBeenCalledWith(\"fakeBlockerId\");\n reenableRefresher();\n deviceSession.close();\n });\n\n it(\"should throw error when deviceSession is not found\", () => {\n // given\n useCase = new DisableDeviceSessionRefresherUseCase(\n sessionService,\n () => logger,\n );\n\n // when\n try {\n useCase.execute({\n sessionId: \"fakeSessionId\",\n blockerId: \"fakeBlockerId\",\n });\n } catch (error) {\n // then\n expect(error).toBeInstanceOf(DeviceSessionNotFound);\n }\n });\n });\n});\n"],
5
+ "mappings": "AAEA,OAAS,4CAAAA,MAAgD,4DAEzD,OAAS,4BAAAC,MAAgC,oDACzC,OAAS,yBAAAC,MAA6B,wCACtC,OAAS,+BAAAC,MAAmC,+DAE5C,OAAS,iCAAAC,MAAqC,mEAC9C,OAAS,6BAAAC,MAAiC,uDAC1C,OAAS,4BAAAC,MAAgC,yDAEzC,OAAS,kCAAAC,MAAsC,+DAC/C,OAAS,+BAAAC,MAAmC,+DAG5C,OAAS,wCAAAC,MAA4C,kCAErD,GAAG,KAAK,OAAQ,KAAO,CACrB,GAAI,IAAM,UACZ,EAAE,EAEF,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,SAAS,uCAAwC,IAAM,CACrD,WAAW,IAAM,CACfL,EAAS,IAAIN,EACX,CAAC,EACD,oCACF,EACAO,EAAiB,IAAIR,EAA4B,IAAMO,CAAM,EAC7DI,EAAa,IAAIR,EACf,IAAID,EAA0B,CAAC,CAAc,CAC/C,EACAU,EAAgB,IAAIP,EAClB,IAAID,EAA+B,CAAC,CAAc,CACpD,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,GAAG,mFAAoF,IAAM,CAE3FM,EAAgBZ,EACd,CAAE,GAAI,eAAgB,EACtB,IAAMS,EACNI,EACAC,EACAf,CACF,EACAW,EAAe,iBAAiBE,CAAa,EAC7CD,EAAU,IAAIH,EACZE,EACA,IAAMD,CACR,EAEA,MAAMM,EAAM,GAAG,MAAMH,EAAe,kBAAkB,EAGhDI,EAAoBL,EAAQ,QAAQ,CACxC,UAAW,gBACX,UAAW,eACb,CAAC,EAGD,OAAOI,CAAG,EAAE,qBAAqB,eAAe,EAChDC,EAAkB,EAClBJ,EAAc,MAAM,CACtB,CAAC,EAED,GAAG,qDAAsD,IAAM,CAE7DD,EAAU,IAAIH,EACZE,EACA,IAAMD,CACR,EAGA,GAAI,CACFE,EAAQ,QAAQ,CACd,UAAW,gBACX,UAAW,eACb,CAAC,CACH,OAASM,EAAO,CAEd,OAAOA,CAAK,EAAE,eAAehB,CAAqB,CACpD,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS", "deviceSessionStubBuilder", "DeviceSessionNotFound", "DefaultDeviceSessionService", "DefaultLoggerPublisherService", "AxiosManagerApiDataSource", "DefaultManagerApiService", "DefaultSecureChannelDataSource", "DefaultSecureChannelService", "DisableDeviceSessionRefresherUseCase", "logger", "sessionService", "useCase", "deviceSession", "managerApi", "secureChannel", "spy", "reenableRefresher", "error"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Apdu as r}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as i}from"./apdu/utils/ApduBuilder";import{ApduParser as n}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as f}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as c}from"./apdu/utils/ByteArrayParser";import{InvalidStatusWordError as A}from"./command/Errors";import{CommandResultFactory as D,CommandResultStatus as l,isSuccessCommandResult as v}from"./command/model/CommandResult";import{CloseAppCommand as C}from"./command/os/CloseAppCommand";import{GetAppAndVersionCommand as g}from"./command/os/GetAppAndVersionCommand";import{BatteryStatusType as B,GetBatteryStatusCommand as G}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as E}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as I}from"./command/os/ListAppsCommand";import{LoadCertificateCommand as T}from"./command/os/LoadCertificateCommand";import{OpenAppCommand as h}from"./command/os/OpenAppCommand";import{isCommandErrorCode as V}from"./command/utils/CommandErrors";import{CommandUtils as _}from"./command/utils/CommandUtils";import{GlobalCommandError as H,GlobalCommandErrorHandler as W}from"./command/utils/GlobalCommandError";import{DeviceModel as K,DeviceModelId as X,LEDGER_VENDOR_ID as q}from"./device/DeviceModel";import{DeviceStatus as N}from"./device/DeviceStatus";import{DeviceActionStatus as j}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as J}from"./device-action/model/UserInteractionRequired";import{CallTaskInAppDeviceAction as Z}from"./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction";import{UnknownDAError as ee}from"./device-action/os/Errors";import{GetDeviceStatusDeviceAction as re}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as pe}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{ListAppsDeviceAction as me}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as ae}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as fe}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{SendCommandInAppDeviceAction as ce}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as Ae}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as De}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as ve}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as Ce}from"./device-model/model/DeviceModel";import{ApduResponse as ge}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as Ge}from"./device-session/DeviceSessionState";import{GenuineCheckDeviceAction as Ee}from"./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction";import{ListInstalledAppsDeviceAction as Ie}from"./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{defaultApduReceiverServiceStubBuilder as Te}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as he}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as Ve}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as _e}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as He}from"./DeviceManagementKitBuilder";export*from"./Error";import{LogLevel as Ke}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as qe}from"./logger-subscriber/service/ConsoleLogger";import{WebLogsExporterLogger as Ne}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as je}from"./transport/model/ConnectedDevice";export*from"./transport/model/Errors";import{TransportConnectedDevice as Qe}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as $e}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{base64StringToBuffer as ro,isBase64String as to}from"./utils/Base64String";import{bufferToHexaString as io,hexaStringToBuffer as mo,isHexaString as no}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,r as Apdu,i as ApduBuilder,n as ApduParser,ge as ApduResponse,B as BatteryStatusType,ve as BleDeviceInfos,f as ByteArrayBuilder,c as ByteArrayParser,Z as CallTaskInAppDeviceAction,C as CloseAppCommand,D as CommandResultFactory,l as CommandResultStatus,_ as CommandUtils,je as ConnectedDevice,qe as ConsoleLogger,j as DeviceActionStatus,_e as DeviceManagementKit,He as DeviceManagementKitBuilder,K as DeviceModel,X as DeviceModelId,Ge as DeviceSessionStateType,N as DeviceStatus,Ve as FramerUtils,Ee as GenuineCheckDeviceAction,g as GetAppAndVersionCommand,G as GetBatteryStatusCommand,re as GetDeviceStatusDeviceAction,E as GetOsVersionCommand,H as GlobalCommandError,W as GlobalCommandErrorHandler,pe as GoToDashboardDeviceAction,A as InvalidStatusWordError,q as LEDGER_VENDOR_ID,I as ListAppsCommand,me as ListAppsDeviceAction,ae as ListAppsWithMetadataDeviceAction,Ie as ListInstalledAppsDeviceAction,T as LoadCertificateCommand,Ke as LogLevel,h as OpenAppCommand,fe as OpenAppDeviceAction,ce as SendCommandInAppDeviceAction,De as StaticDeviceModelDataSource,Qe as TransportConnectedDevice,Ce as TransportDeviceModel,ee as UnknownDAError,J as UserInteractionRequired,Ne as WebLogsExporterLogger,Ae as XStateDeviceAction,ro as base64StringToBuffer,io as bufferToHexaString,$e as connectedDeviceStubBuilder,Te as defaultApduReceiverServiceStubBuilder,he as defaultApduSenderServiceStubBuilder,mo as hexaStringToBuffer,to as isBase64String,V as isCommandErrorCode,no as isHexaString,v as isSuccessCommandResult};
1
+ import{Apdu as o}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as i}from"./apdu/utils/ApduBuilder";import{ApduParser as m}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as c}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as x}from"./apdu/utils/ByteArrayParser";import{InvalidStatusWordError as A}from"./command/Errors";import{CommandResultFactory as v,CommandResultStatus as u,isSuccessCommandResult as l}from"./command/model/CommandResult";import{CloseAppCommand as C}from"./command/os/CloseAppCommand";import{GetAppAndVersionCommand as L}from"./command/os/GetAppAndVersionCommand";import{BatteryStatusType as B,GetBatteryStatusCommand as E}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as M}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as I}from"./command/os/ListAppsCommand";import{LoadCertificateCommand as b}from"./command/os/LoadCertificateCommand";import{OpenAppCommand as T}from"./command/os/OpenAppCommand";import{isCommandErrorCode as P}from"./command/utils/CommandErrors";import{CommandUtils as k}from"./command/utils/CommandUtils";import{GlobalCommandError as _,GlobalCommandErrorHandler as F}from"./command/utils/GlobalCommandError";import{DeviceModel as w,DeviceModelId as K,LEDGER_VENDOR_ID as X}from"./device/DeviceModel";import{DeviceStatus as N}from"./device/DeviceStatus";import{DeviceActionStatus as j}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as J}from"./device-action/model/UserInteractionRequired";import{CallTaskInAppDeviceAction as Z}from"./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction";import{DeviceLockedError as ee,OutOfMemoryDAError as re,UnknownDAError as oe,UnsupportedFirmwareDAError as te}from"./device-action/os/Errors";import{GetDeviceMetadataDeviceAction as ie}from"./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction";import{GetDeviceStatusDeviceAction as me}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as se}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{InstallOrUpdateAppsDeviceAction as fe}from"./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction";import{ListAppsDeviceAction as de}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as De}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as ue}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{OpenAppWithDependenciesDeviceAction as Se}from"./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction";import{SendCommandInAppDeviceAction as ye}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as ge}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as Ee}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as Me}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as Ie}from"./device-model/model/DeviceModel";import{ApduResponse as be}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as Ue}from"./device-session/DeviceSessionState";import{GenuineCheckDeviceAction as Ve}from"./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction";import{InstallAppDeviceAction as We}from"./secure-channel/device-action/InstallApp/InstallAppDeviceAction";import{ListInstalledAppsDeviceAction as Fe}from"./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{UninstallAppDeviceAction as we}from"./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction";import{SecureChannelError as Xe}from"../internal/secure-channel/model/Errors";import{defaultApduReceiverServiceStubBuilder as Ne}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as je}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as Je}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as Ze}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as er}from"./DeviceManagementKitBuilder";export*from"./Error";import{LogLevel as tr}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as ir}from"./logger-subscriber/service/ConsoleLogger";import{WebLogsExporterLogger as mr}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as sr}from"./transport/model/ConnectedDevice";import{DeviceConnectionStateMachine as fr}from"./transport/model/DeviceConnectionStateMachine";export*from"./transport/model/Errors";import{TransportConnectedDevice as Ar}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as vr}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{base64StringToBuffer as Sr,isBase64String as Cr}from"./utils/Base64String";import{bufferToHexaString as Lr,hexaStringToBuffer as gr,isHexaString as Br}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,o as Apdu,i as ApduBuilder,m as ApduParser,be as ApduResponse,B as BatteryStatusType,Me as BleDeviceInfos,c as ByteArrayBuilder,x as ByteArrayParser,Z as CallTaskInAppDeviceAction,C as CloseAppCommand,v as CommandResultFactory,u as CommandResultStatus,k as CommandUtils,sr as ConnectedDevice,ir as ConsoleLogger,j as DeviceActionStatus,fr as DeviceConnectionStateMachine,ee as DeviceLockedError,Ze as DeviceManagementKit,er as DeviceManagementKitBuilder,w as DeviceModel,K as DeviceModelId,Ue as DeviceSessionStateType,N as DeviceStatus,Je as FramerUtils,Ve as GenuineCheckDeviceAction,L as GetAppAndVersionCommand,E as GetBatteryStatusCommand,ie as GetDeviceMetadataDeviceAction,me as GetDeviceStatusDeviceAction,M as GetOsVersionCommand,_ as GlobalCommandError,F as GlobalCommandErrorHandler,se as GoToDashboardDeviceAction,We as InstallAppDeviceAction,fe as InstallOrUpdateAppsDeviceAction,A as InvalidStatusWordError,X as LEDGER_VENDOR_ID,I as ListAppsCommand,de as ListAppsDeviceAction,De as ListAppsWithMetadataDeviceAction,Fe as ListInstalledAppsDeviceAction,b as LoadCertificateCommand,tr as LogLevel,T as OpenAppCommand,ue as OpenAppDeviceAction,Se as OpenAppWithDependenciesDeviceAction,re as OutOfMemoryDAError,Xe as SecureChannelError,ye as SendCommandInAppDeviceAction,Ee as StaticDeviceModelDataSource,Ar as TransportConnectedDevice,Ie as TransportDeviceModel,we as UninstallAppDeviceAction,oe as UnknownDAError,te as UnsupportedFirmwareDAError,J as UserInteractionRequired,mr as WebLogsExporterLogger,ge as XStateDeviceAction,Sr as base64StringToBuffer,Lr as bufferToHexaString,vr as connectedDeviceStubBuilder,Ne as defaultApduReceiverServiceStubBuilder,je as defaultApduSenderServiceStubBuilder,gr as hexaStringToBuffer,Cr as isBase64String,P as isCommandErrorCode,Br as isHexaString,l as isSuccessCommandResult};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/index.ts"],
4
- "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { UnknownDAError } from \"@api/device-action/os/Errors\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
- "mappings": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAChC,OAAS,0BAAAC,MAA8B,sBACvC,OACE,wBAAAC,EACA,uBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,mBAAAC,MAAuB,kCAChC,OACE,2BAAAC,MAEK,0CACP,OACE,qBAAAC,EAEA,2BAAAC,MAEK,0CACP,OACE,uBAAAC,MAEK,sCACP,OAEE,mBAAAC,MAGK,kCACP,OAEE,0BAAAC,MAEK,yCACP,OAEE,kBAAAC,MACK,iCACP,OAAS,sBAAAC,MAA0B,mCACnC,OAAS,gBAAAC,MAAoB,kCAC7B,OACE,sBAAAC,EACA,6BAAAC,MACK,wCACP,OACE,eAAAC,EACA,iBAAAC,EACA,oBAAAC,MACK,0BACP,OAAS,gBAAAC,MAAoB,2BAE7B,OAEE,sBAAAC,MACK,6CACP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,6BAAAC,MAAiC,4EAC1C,OAAS,kBAAAC,OAAsB,+BAC/B,OAAS,+BAAAC,OAAmC,oEAC5C,OAAS,6BAAAC,OAAiC,gEAC1C,OAAS,wBAAAC,OAA4B,sDACrC,OAAS,oCAAAC,OAAwC,8EACjD,OAAS,uBAAAC,OAA2B,gEACpC,OAAS,gCAAAC,OAAoC,kFAC7C,OAEE,sBAAAC,OACK,qDACP,OAAS,+BAAAC,OAAmC,qDAC5C,OAAS,kBAAAC,OAAsB,yCAC/B,OAAS,wBAAAC,OAA4B,sCACrC,OAAS,gBAAAC,OAAoB,mCAC7B,WAAc,uCACd,OAEE,0BAAAC,OACK,yCACP,OAAS,4BAAAC,OAAgC,0EACzC,OAAS,iCAAAC,OAAqC,oFAE9C,OAAS,yCAAAC,OAA6C,8DACtD,OAAS,uCAAAC,OAA2C,4DACpD,OAAS,eAAAC,OAAmB,wCAC5B,OAAS,uBAAAC,OAA2B,2BACpC,OAAS,8BAAAC,OAAkC,kCAC3C,WAAc,aACd,OAAS,YAAAC,OAAgB,wCACzB,OAAS,iBAAAC,OAAqB,+CAC9B,OAAS,yBAAAC,OAA6B,uDACtC,OAAS,mBAAAC,OAAuB,uCAChC,WAAc,8BACd,OAAS,4BAAAC,OAAgC,gDACzC,OAAS,8BAAAC,OAAkC,qDAC3C,WAAc,aACd,OAAS,wBAAAC,GAAsB,kBAAAC,OAAsB,0BACrD,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
6
- "names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "UnknownDAError", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "GenuineCheckDeviceAction", "ListInstalledAppsDeviceAction", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "LogLevel", "ConsoleLogger", "WebLogsExporterLogger", "ConnectedDevice", "TransportConnectedDevice", "connectedDeviceStubBuilder", "base64StringToBuffer", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
4
+ "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport {\n DeviceLockedError,\n OutOfMemoryDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
+ "mappings": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAChC,OAAS,0BAAAC,MAA8B,sBACvC,OACE,wBAAAC,EACA,uBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,mBAAAC,MAAuB,kCAChC,OACE,2BAAAC,MAEK,0CACP,OACE,qBAAAC,EAEA,2BAAAC,MAEK,0CACP,OACE,uBAAAC,MAEK,sCACP,OAEE,mBAAAC,MAGK,kCACP,OAEE,0BAAAC,MAEK,yCACP,OAEE,kBAAAC,MACK,iCACP,OAAS,sBAAAC,MAA0B,mCACnC,OAAS,gBAAAC,MAAoB,kCAC7B,OACE,sBAAAC,EACA,6BAAAC,MACK,wCACP,OACE,eAAAC,EACA,iBAAAC,EACA,oBAAAC,MACK,0BACP,OAAS,gBAAAC,MAAoB,2BAE7B,OAEE,sBAAAC,MACK,6CACP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,6BAAAC,MAAiC,4EAC1C,OACE,qBAAAC,GACA,sBAAAC,GACA,kBAAAC,GACA,8BAAAC,OACK,+BACP,OAAS,iCAAAC,OAAqC,wEAC9C,OAAS,+BAAAC,OAAmC,oEAC5C,OAAS,6BAAAC,OAAiC,gEAC1C,OAAS,mCAAAC,OAAuC,4EAChD,OAAS,wBAAAC,OAA4B,sDACrC,OAAS,oCAAAC,OAAwC,8EACjD,OAAS,uBAAAC,OAA2B,gEACpC,OAAS,uCAAAC,OAA2C,oFACpD,OAAS,gCAAAC,OAAoC,kFAC7C,OAEE,sBAAAC,OACK,qDACP,OAAS,+BAAAC,OAAmC,qDAC5C,OAAS,kBAAAC,OAAsB,yCAC/B,OAAS,wBAAAC,OAA4B,sCACrC,OAAS,gBAAAC,OAAoB,mCAC7B,WAAc,uCACd,OAEE,0BAAAC,OACK,yCACP,OAAS,4BAAAC,OAAgC,0EACzC,OAAS,0BAAAC,OAA8B,sEACvC,OAAS,iCAAAC,OAAqC,oFAC9C,OAAS,4BAAAC,OAAgC,0EACzC,OAAS,sBAAAC,OAA0B,wCAEnC,OAAS,yCAAAC,OAA6C,8DACtD,OAAS,uCAAAC,OAA2C,4DACpD,OAAS,eAAAC,OAAmB,wCAC5B,OAAS,uBAAAC,OAA2B,2BACpC,OAAS,8BAAAC,OAAkC,kCAC3C,WAAc,aACd,OAAS,YAAAC,OAAgB,wCACzB,OAAS,iBAAAC,OAAqB,+CAC9B,OAAS,yBAAAC,OAA6B,uDACtC,OAAS,mBAAAC,OAAuB,uCAChC,OACE,gCAAAC,OAEK,oDACP,WAAc,8BACd,OAAS,4BAAAC,OAAgC,gDACzC,OAAS,8BAAAC,OAAkC,qDAC3C,WAAc,aACd,OAAS,wBAAAC,GAAsB,kBAAAC,OAAsB,0BACrD,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
6
+ "names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "DeviceLockedError", "OutOfMemoryDAError", "UnknownDAError", "UnsupportedFirmwareDAError", "GetDeviceMetadataDeviceAction", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "InstallOrUpdateAppsDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "OpenAppWithDependenciesDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "GenuineCheckDeviceAction", "InstallAppDeviceAction", "ListInstalledAppsDeviceAction", "UninstallAppDeviceAction", "SecureChannelError", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "LogLevel", "ConsoleLogger", "WebLogsExporterLogger", "ConnectedDevice", "DeviceConnectionStateMachine", "TransportConnectedDevice", "connectedDeviceStubBuilder", "base64StringToBuffer", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{deviceModelStubBuilder as n}from"../../device-model/model/DeviceModel.stub";import{DeviceSession as a}from"../../../internal/device-session/model/DeviceSession";import{getJSONStringifyReplacer as r}from"./WebLogsExporterLogger";describe("getJSONStringifyReplacer",()=>{it("should return a function that replaces Uint8Array correctly",()=>{const e=r(),t=new Uint8Array([1,2,3]),c=e("key",t);expect(c).toEqual({hex:"0x010203",readableHex:"01 02 03",value:"1,2,3"})}),it("should return a function that replaces DeviceSession",()=>{const e=n(),t=r(),c={deviceModel:n(),type:"USB",id:"mockedDeviceId",sendApdu:vi.fn(),transport:"USB"},i=new a({connectedDevice:c,id:"mockedSessionId"},vi.fn(),{},{}),o=JSON.stringify(i,t),s=`{"id":"mockedSessionId","connectedDevice":{"deviceModel":${JSON.stringify(e)},"type":"USB","id":"mockedDeviceId"}}`;i.close(),expect(o).toEqual(s)}),it("should return a function that replaces circular references",()=>{const e={name:"Alice"};e.self=e;const t='{"name":"Alice","self":"[Circular]"}',c=JSON.stringify(e,r());expect(c).toEqual(t)})});
1
+ import{deviceModelStubBuilder as n}from"../../device-model/model/DeviceModel.stub";import{DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS as a}from"../../../internal/device-session/data/DeviceSessionRefresherConst";import{DeviceSession as l}from"../../../internal/device-session/model/DeviceSession";import{getJSONStringifyReplacer as c}from"./WebLogsExporterLogger";describe("getJSONStringifyReplacer",()=>{it("should return a function that replaces Uint8Array correctly",()=>{const e=c(),t=new Uint8Array([1,2,3]),r=e("key",t);expect(r).toEqual({hex:"0x010203",readableHex:"01 02 03",value:"1,2,3"})}),it("should return a function that replaces DeviceSession",()=>{const e=n(),t=c(),r={deviceModel:n(),type:"USB",id:"mockedDeviceId",sendApdu:vi.fn(),transport:"USB"},i=new l({connectedDevice:r,id:"mockedSessionId"},vi.fn(),{},{},a),o=JSON.stringify(i,t),s=`{"id":"mockedSessionId","connectedDevice":{"deviceModel":${JSON.stringify(e)},"type":"USB","id":"mockedDeviceId"}}`;i.close(),expect(o).toEqual(s)}),it("should return a function that replaces circular references",()=>{const e={name:"Alice"};e.self=e;const t='{"name":"Alice","self":"[Circular]"}',r=JSON.stringify(e,c());expect(r).toEqual(t)})});
2
2
  //# sourceMappingURL=WebLogsExporterLogger.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/logger-subscriber/service/WebLogsExporterLogger.test.ts"],
4
- "sourcesContent": ["import { deviceModelStubBuilder } from \"@api/device-model/model/DeviceModel.stub\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { getJSONStringifyReplacer } from \"./WebLogsExporterLogger\";\n\ndescribe(\"getJSONStringifyReplacer\", () => {\n it(\"should return a function that replaces Uint8Array correctly\", () => {\n const replacer = getJSONStringifyReplacer();\n const value = new Uint8Array([1, 2, 3]);\n const result = replacer(\"key\", value);\n expect(result).toEqual({\n hex: \"0x010203\",\n readableHex: \"01 02 03\",\n value: \"1,2,3\",\n });\n });\n\n it(\"should return a function that replaces DeviceSession\", () => {\n const stubDeviceModel = deviceModelStubBuilder();\n const replacer = getJSONStringifyReplacer();\n\n const connectedDevice: TransportConnectedDevice = {\n deviceModel: deviceModelStubBuilder(),\n type: \"USB\",\n id: \"mockedDeviceId\",\n sendApdu: vi.fn(),\n transport: \"USB\",\n };\n\n const value = new DeviceSession(\n {\n connectedDevice,\n id: \"mockedSessionId\",\n },\n vi.fn(),\n {} as ManagerApiService,\n {} as SecureChannelService,\n );\n const result = JSON.stringify(value, replacer);\n const expected = `{\"id\":\"mockedSessionId\",\"connectedDevice\":{\"deviceModel\":${JSON.stringify(\n stubDeviceModel,\n )},\"type\":\"USB\",\"id\":\"mockedDeviceId\"}}`;\n value.close();\n expect(result).toEqual(expected);\n });\n\n it(\"should return a function that replaces circular references\", () => {\n interface CircularObject {\n name: string;\n self?: CircularObject;\n }\n\n const obj: CircularObject = { name: \"Alice\" };\n obj.self = obj;\n\n const expected = '{\"name\":\"Alice\",\"self\":\"[Circular]\"}';\n const result = JSON.stringify(obj, getJSONStringifyReplacer());\n expect(result).toEqual(expected);\n });\n});\n"],
5
- "mappings": "AAAA,OAAS,0BAAAA,MAA8B,2CAEvC,OAAS,iBAAAC,MAAqB,+CAI9B,OAAS,4BAAAC,MAAgC,0BAEzC,SAAS,2BAA4B,IAAM,CACzC,GAAG,8DAA+D,IAAM,CACtE,MAAMC,EAAWD,EAAyB,EACpCE,EAAQ,IAAI,WAAW,CAAC,EAAG,EAAG,CAAC,CAAC,EAChCC,EAASF,EAAS,MAAOC,CAAK,EACpC,OAAOC,CAAM,EAAE,QAAQ,CACrB,IAAK,WACL,YAAa,WACb,MAAO,OACT,CAAC,CACH,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMC,EAAkBN,EAAuB,EACzCG,EAAWD,EAAyB,EAEpCK,EAA4C,CAChD,YAAaP,EAAuB,EACpC,KAAM,MACN,GAAI,iBACJ,SAAU,GAAG,GAAG,EAChB,UAAW,KACb,EAEMI,EAAQ,IAAIH,EAChB,CACE,gBAAAM,EACA,GAAI,iBACN,EACA,GAAG,GAAG,EACN,CAAC,EACD,CAAC,CACH,EACMF,EAAS,KAAK,UAAUD,EAAOD,CAAQ,EACvCK,EAAW,4DAA4D,KAAK,UAChFF,CACF,CAAC,wCACDF,EAAM,MAAM,EACZ,OAAOC,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,EAED,GAAG,6DAA8D,IAAM,CAMrE,MAAMC,EAAsB,CAAE,KAAM,OAAQ,EAC5CA,EAAI,KAAOA,EAEX,MAAMD,EAAW,uCACXH,EAAS,KAAK,UAAUI,EAAKP,EAAyB,CAAC,EAC7D,OAAOG,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,CACH,CAAC",
6
- "names": ["deviceModelStubBuilder", "DeviceSession", "getJSONStringifyReplacer", "replacer", "value", "result", "stubDeviceModel", "connectedDevice", "expected", "obj"]
4
+ "sourcesContent": ["import { deviceModelStubBuilder } from \"@api/device-model/model/DeviceModel.stub\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { getJSONStringifyReplacer } from \"./WebLogsExporterLogger\";\n\ndescribe(\"getJSONStringifyReplacer\", () => {\n it(\"should return a function that replaces Uint8Array correctly\", () => {\n const replacer = getJSONStringifyReplacer();\n const value = new Uint8Array([1, 2, 3]);\n const result = replacer(\"key\", value);\n expect(result).toEqual({\n hex: \"0x010203\",\n readableHex: \"01 02 03\",\n value: \"1,2,3\",\n });\n });\n\n it(\"should return a function that replaces DeviceSession\", () => {\n const stubDeviceModel = deviceModelStubBuilder();\n const replacer = getJSONStringifyReplacer();\n\n const connectedDevice: TransportConnectedDevice = {\n deviceModel: deviceModelStubBuilder(),\n type: \"USB\",\n id: \"mockedDeviceId\",\n sendApdu: vi.fn(),\n transport: \"USB\",\n };\n\n const value = new DeviceSession(\n {\n connectedDevice,\n id: \"mockedSessionId\",\n },\n vi.fn(),\n {} as ManagerApiService,\n {} as SecureChannelService,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n const result = JSON.stringify(value, replacer);\n const expected = `{\"id\":\"mockedSessionId\",\"connectedDevice\":{\"deviceModel\":${JSON.stringify(\n stubDeviceModel,\n )},\"type\":\"USB\",\"id\":\"mockedDeviceId\"}}`;\n value.close();\n expect(result).toEqual(expected);\n });\n\n it(\"should return a function that replaces circular references\", () => {\n interface CircularObject {\n name: string;\n self?: CircularObject;\n }\n\n const obj: CircularObject = { name: \"Alice\" };\n obj.self = obj;\n\n const expected = '{\"name\":\"Alice\",\"self\":\"[Circular]\"}';\n const result = JSON.stringify(obj, getJSONStringifyReplacer());\n expect(result).toEqual(expected);\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,0BAAAA,MAA8B,2CAEvC,OAAS,4CAAAC,MAAgD,4DACzD,OAAS,iBAAAC,MAAqB,+CAI9B,OAAS,4BAAAC,MAAgC,0BAEzC,SAAS,2BAA4B,IAAM,CACzC,GAAG,8DAA+D,IAAM,CACtE,MAAMC,EAAWD,EAAyB,EACpCE,EAAQ,IAAI,WAAW,CAAC,EAAG,EAAG,CAAC,CAAC,EAChCC,EAASF,EAAS,MAAOC,CAAK,EACpC,OAAOC,CAAM,EAAE,QAAQ,CACrB,IAAK,WACL,YAAa,WACb,MAAO,OACT,CAAC,CACH,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMC,EAAkBP,EAAuB,EACzCI,EAAWD,EAAyB,EAEpCK,EAA4C,CAChD,YAAaR,EAAuB,EACpC,KAAM,MACN,GAAI,iBACJ,SAAU,GAAG,GAAG,EAChB,UAAW,KACb,EAEMK,EAAQ,IAAIH,EAChB,CACE,gBAAAM,EACA,GAAI,iBACN,EACA,GAAG,GAAG,EACN,CAAC,EACD,CAAC,EACDP,CACF,EACMK,EAAS,KAAK,UAAUD,EAAOD,CAAQ,EACvCK,EAAW,4DAA4D,KAAK,UAChFF,CACF,CAAC,wCACDF,EAAM,MAAM,EACZ,OAAOC,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,EAED,GAAG,6DAA8D,IAAM,CAMrE,MAAMC,EAAsB,CAAE,KAAM,OAAQ,EAC5CA,EAAI,KAAOA,EAEX,MAAMD,EAAW,uCACXH,EAAS,KAAK,UAAUI,EAAKP,EAAyB,CAAC,EAC7D,OAAOG,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,CACH,CAAC",
6
+ "names": ["deviceModelStubBuilder", "DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS", "DeviceSession", "getJSONStringifyReplacer", "replacer", "value", "result", "stubDeviceModel", "connectedDevice", "expected", "obj"]
7
7
  }