@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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmB,kBAEnBC,EAAuC,+BACvCC,EAIO,4CACPC,EAAwC,mDA+BxC,MAAMC,EACJ,mEAEK,MAAMN,CAA4B,CACvC,YACmBO,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,SAAO,wBAAqB,CAC1B,MAAO,IAAI,yBAAuB,oCAAoC,CACxE,CAAC,EAEH,KAAM,CAAE,aAAAC,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,MAAc,MAAGA,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,IAAI,0BAAwB,CAAE,WAAYD,IAAM,CAAE,CAAC,CACrD,EACA,GAAI,IAAC,0BAAuBC,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,KAEb,wBAAqB,CAC1B,KAAM,CACJ,aAAcV,EACd,oBAAqBM,EACrB,mBAAAC,EACA,QAAS,CACP,aAAcR,EACd,iBAAkBW,EAAU,QAAQ,CACtC,CACF,CACF,CAAC,KAEM,wBAAqB,CAC1B,MAAO,IAAI,yBAAuB,kCAAkC,CACtE,CAAC,CAEL,CAEQ,cAAchB,EAA4B,CAGhD,OAAOA,EAAI,WAAaJ,CAC1B,CACF",
6
+ "names": ["GetApplicationsMetadataTask_exports", "__export", "GetApplicationsMetadataTask", "__toCommonJS", "import_semver", "import_Errors", "import_CommandResult", "import_ListLanguagePackCommand", "ZERO_HASH", "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
+ "use strict";var s=require("purify-ts"),g=require("../../command/Errors"),e=require("../../command/model/CommandResult"),c=require("../../device-action/__test-utils__/data"),d=require("../../device-action/__test-utils__/makeInternalApi"),o=require("./GetApplicationsMetadataTask");describe("GetApplicationsMetadataTask",()=>{const t=(0,d.makeDeviceActionInternalApiMock)(),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"}],u=[c.ETH_APP_METADATA],p=[c.BTC_APP_METADATA,c.ETH_APP_METADATA],l=["fr","eng","it"],i={deviceVersion:m,firmware:h,firmwareVersion:A,installedApps:w},n={getAppsByHash:vi.fn(),getAppList:vi.fn(),getLanguagePackages:vi.fn()};beforeEach(()=>{vi.clearAllMocks(),t.sendCommand.mockResolvedValue((0,e.CommandResultFactory)({data:void 0})),t.getManagerApiService.mockReturnValue(n),n.getAppsByHash.mockReturnValue((0,s.EitherAsync)(async()=>u)),n.getAppList.mockReturnValue((0,s.EitherAsync)(async()=>p)),n.getLanguagePackages.mockReturnValue((0,s.EitherAsync)(async()=>l))}),it("Success without updates",async()=>{const a=await new o.GetApplicationsMetadataTask(t,i).run();expect(a).toStrictEqual((0,e.CommandResultFactory)({data:{applications:u,applicationsUpdates:[],installedLanguages:[],catalog:{applications:p,languagePackages:l}}}))}),it("Success without languages",async()=>{t.sendCommand.mockResolvedValueOnce((0,e.CommandResultFactory)({data:{id:1,size:15}})).mockResolvedValueOnce((0,e.CommandResultFactory)({data:{id:2,size:17}}));const a=await new o.GetApplicationsMetadataTask(t,i).run();expect(a).toStrictEqual((0,e.CommandResultFactory)({data:{applications:u,applicationsUpdates:[],installedLanguages:[{id:1,size:15},{id:2,size:17}],catalog:{applications:p,languagePackages:l}}}))}),it("Success with an available update",async()=>{const a={...c.BTC_APP_METADATA,version:"1.0.0"};n.getAppsByHash.mockReturnValue((0,s.EitherAsync)(async()=>[a]));const r=await new o.GetApplicationsMetadataTask(t,i).run();expect(r).toStrictEqual((0,e.CommandResultFactory)({data:{applications:[a],applicationsUpdates:[c.BTC_APP_METADATA],installedLanguages:[],catalog:{applications:p,languagePackages:l}}})),expect(n.getAppsByHash).toHaveBeenCalledWith(["hash2"])}),it("Success with app hash not found",async()=>{n.getAppsByHash.mockReturnValue((0,s.EitherAsync)(async()=>[null]));const a=await new o.GetApplicationsMetadataTask(t,i).run();expect(a).toStrictEqual((0,e.CommandResultFactory)({data:{applications:u,applicationsUpdates:[],installedLanguages:[],catalog:{applications:p,languagePackages:l}}}))}),it("should fail when apps hash cannot by retrieved",async()=>{n.getAppsByHash.mockReturnValueOnce((0,s.EitherAsync)(async({throwE:r})=>{r(new Error("error"))}));const a=await new o.GetApplicationsMetadataTask(t,i).run();expect(a).toStrictEqual((0,e.CommandResultFactory)({error:new g.InvalidStatusWordError("Cannot get the application catalog")}))}),it("should fail when apps list cannot by retrieved",async()=>{n.getAppList.mockReturnValueOnce((0,s.EitherAsync)(async({throwE:r})=>{r(new Error("error"))}));const a=await new o.GetApplicationsMetadataTask(t,i).run();expect(a).toStrictEqual((0,e.CommandResultFactory)({error:new g.InvalidStatusWordError("Cannot get the application catalog")}))}),it("should fail when languages cannot by retrieved",async()=>{n.getLanguagePackages.mockReturnValueOnce((0,s.EitherAsync)(async({throwE:r})=>{r(new Error("error"))}));const a=await new o.GetApplicationsMetadataTask(t,i).run();expect(a).toStrictEqual((0,e.CommandResultFactory)({error:new g.InvalidStatusWordError("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": ["import_purify_ts", "import_Errors", "import_CommandResult", "import_data", "import_makeInternalApi", "import_GetApplicationsMetadataTask", "apiMock", "DEVICE_VERSION", "FIRMWARE", "FIRMWARE_VERSION", "INSTALLED_APPS", "APPS", "CATALOG", "LANGUAGES", "ARGS", "MANAGER_MOCK", "result", "app", "throwE"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var I=(a,e)=>{for(var o in e)p(a,o,{get:e[o],enumerable:!0})},U=(a,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of v(e))!h.call(a,r)&&r!==o&&p(a,r,{get:()=>e[r],enumerable:!(t=y(e,r))||t.enumerable});return a};var x=a=>U(p({},"__esModule",{value:!0}),a);var S={};I(S,{GetFirmwareMetadataTask:()=>R});module.exports=x(S);var f=require("../../command/Errors"),n=require("../../command/model/CommandResult"),l=require("../../command/os/GetCustomImageSizeCommand"),C=require("../../command/os/GetOsVersionCommand");class R{constructor(e){this.api=e}async run(){const e=await this.api.sendCommand(new C.GetOsVersionCommand);if(!(0,n.isSuccessCommandResult)(e))return e;const o={mcu:e.data.mcuSephVersion,bootloader:e.data.mcuBootloaderVersion,os:e.data.seVersion,metadata:e.data},t=this.api.getManagerApiService(),r=await t.getDeviceVersion(e.data).chain(i=>t.getFirmwareVersion(e.data,i).map(s=>({deviceVersion:i,currentFirmware:s})));if(r.isLeft())return(0,n.CommandResultFactory)({error:new f.InvalidStatusWordError("Cannot fetch current firmware metadata")});const{deviceVersion:c,currentFirmware:d}=r.unsafeCoerce(),V=(await t.getLatestFirmwareVersion(d,c).chain(i=>t.getNextFirmwareVersion(i).chain(s=>t.getMcuList().map(m=>m.find(g=>g.name===o.mcu)).map(m=>m===void 0||!s.mcuVersions.includes(m.id)).map(m=>({osuFirmware:i,finalFirmware:s,mcuUpdateRequired:m}))))).caseOf({Right:i=>i,Left:i=>{}}),F={currentFirmware:d,availableUpdate:V};let u={};const w=await this.api.sendCommand(new l.GetCustomImageSizeCommand);return(0,n.isSuccessCommandResult)(w)&&(u={size:w.data}),(0,n.CommandResultFactory)({data:{deviceVersion:c,firmware:d,firmwareVersion:o,firmwareUpdateContext:F,customImage:u}})}}0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuC,+BACvCC,EAIO,4CACPC,EAA0C,qDAC1CC,EAAoC,+CAmB7B,MAAML,CAAwB,CACnC,YAA6BM,EAAkB,CAAlB,SAAAA,CAAmB,CAEhD,MAAM,KAA8C,CAElD,MAAMC,EAAY,MAAM,KAAK,IAAI,YAAY,IAAI,qBAAqB,EACtE,GAAI,IAAC,0BAAuBA,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,SAAO,wBAAqB,CAC1B,MAAO,IAAI,yBACT,wCACF,CACF,CAAC,EAEH,KAAM,CAAE,cAAAC,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,IAAI,2BACN,EACA,SAAI,0BAAuBA,CAAS,IAClCD,EAAc,CAAE,KAAMC,EAAU,IAAK,MAIhC,wBAAqB,CAC1B,KAAM,CACJ,cAAAZ,EACA,SAAUC,EACV,gBAAAJ,EACA,sBAAAa,EACA,YAAAC,CACF,CACF,CAAC,CACH,CACF",
6
+ "names": ["GetFirmwareMetadataTask_exports", "__export", "GetFirmwareMetadataTask", "__toCommonJS", "import_Errors", "import_CommandResult", "import_GetCustomImageSizeCommand", "import_GetOsVersionCommand", "api", "osVersion", "firmwareVersion", "manager", "result", "deviceVersion", "currentFirmware", "availableUpdate", "osuFirmware", "finalFirmware", "mcus", "mcu", "mcuUpdateRequired", "data", "_error", "firmwareUpdateContext", "customImage", "imageSize"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=require("purify-ts"),c=require("../../command/Errors"),e=require("../../command/model/CommandResult"),v=require("../../device-action/__test-utils__/makeInternalApi"),m=require("./GetFirmwareMetadataTask");describe("GetFirmwareMetadataTask",()=>{const a=(0,v.makeDeviceActionInternalApiMock)(),o={mcuSephVersion:"mcu_version",mcuBootloaderVersion:"bl_version",seVersion:"se_version"},w=97,u={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((0,n.EitherAsync)(async()=>u)),r.getFirmwareVersion.mockReturnValue((0,n.EitherAsync)(async()=>i)),r.getLatestFirmwareVersion.mockReturnValue((0,n.EitherAsync)(async()=>l)),r.getNextFirmwareVersion.mockReturnValue((0,n.EitherAsync)(async()=>d)),r.getMcuList.mockReturnValue((0,n.EitherAsync)(async()=>V))}),it("success with no firmware update available",async()=>{a.sendCommand.mockResolvedValueOnce((0,e.CommandResultFactory)({data:o})).mockResolvedValueOnce((0,e.CommandResultFactory)({data:w})),r.getLatestFirmwareVersion.mockReturnValueOnce((0,n.EitherAsync)(async({throwE:s})=>{s(new Error("error"))}));const t=await new m.GetFirmwareMetadataTask(a).run();expect(t).toStrictEqual((0,e.CommandResultFactory)({data:{deviceVersion:u,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((0,e.CommandResultFactory)({data:o})).mockResolvedValueOnce((0,e.CommandResultFactory)({error:new c.InvalidStatusWordError("error")}));const t=await new m.GetFirmwareMetadataTask(a).run();expect(t).toStrictEqual((0,e.CommandResultFactory)({data:{deviceVersion:u,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,u),expect(r.getLatestFirmwareVersion).toHaveBeenCalledWith(i,u),expect(r.getNextFirmwareVersion).toHaveBeenCalledWith(l)}),it("success with a firmware update available and MCU update",async()=>{a.sendCommand.mockResolvedValueOnce((0,e.CommandResultFactory)({data:o})).mockResolvedValueOnce((0,e.CommandResultFactory)({error:new c.InvalidStatusWordError("error")}));const t={...d,mcuVersions:[3]};r.getNextFirmwareVersion.mockReturnValue((0,n.EitherAsync)(async()=>t));const s=await new m.GetFirmwareMetadataTask(a).run();expect(s).toStrictEqual((0,e.CommandResultFactory)({data:{deviceVersion:u,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((0,e.CommandResultFactory)({error:new c.InvalidStatusWordError("error")}));const t=await new m.GetFirmwareMetadataTask(a).run();expect(t).toStrictEqual((0,e.CommandResultFactory)({error:new c.InvalidStatusWordError("error")}))}),it("should fail if device version cannot be fetched",async()=>{a.sendCommand.mockResolvedValueOnce((0,e.CommandResultFactory)({data:o})),r.getDeviceVersion.mockReturnValueOnce((0,n.EitherAsync)(async({throwE:s})=>{s(new Error("error"))}));const t=await new m.GetFirmwareMetadataTask(a).run();expect(t).toStrictEqual((0,e.CommandResultFactory)({error:new c.InvalidStatusWordError("Cannot fetch current firmware metadata")}))}),it("should fail if firmware version cannot be fetched",async()=>{a.sendCommand.mockResolvedValueOnce((0,e.CommandResultFactory)({data:o})),r.getFirmwareVersion.mockReturnValueOnce((0,n.EitherAsync)(async({throwE:s})=>{s(new Error("error"))}));const t=await new m.GetFirmwareMetadataTask(a).run();expect(t).toStrictEqual((0,e.CommandResultFactory)({error:new c.InvalidStatusWordError("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": ["import_purify_ts", "import_Errors", "import_CommandResult", "import_makeInternalApi", "import_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
+ "use strict";var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var o in e)a(t,o,{get:e[o],enumerable:!0})},b=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of y(e))!k.call(t,s)&&s!==o&&a(t,s,{get:()=>e[s],enumerable:!(r=u(e,s))||r.enumerable});return t};var B=t=>b(a({},"__esModule",{value:!0}),t);var v={};f(v,{PredictOutOfMemoryTask:()=>g});module.exports=B(v);var c=require("../../device-action/os/Errors"),l=require("../../device-session/DeviceSessionState");class g{constructor(e,o){this.api=e;this.args=o;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===l.DeviceSessionStateType.Connected)return{error:new c.UnknownDAError("Invalid device state")};if(e.firmwareUpdateContext===void 0||e.customImage===void 0||e.installedLanguages===void 0)return{error:new c.UnknownDAError("Device metadata not fetched")};const o=this.bytesToBlocks(e.firmwareUpdateContext.currentFirmware.bytes||0),r=this.bytesToBlocks(e.customImage.size||0),s=e.installedApps.reduce((i,n)=>i+this.bytesToBlocks(n.bytes||0),0),m=e.installedLanguages.reduce((i,n)=>i+this.bytesToBlocks(n.size),0),d=o+r+s+m,p=this.memoryBlocks-d;return{outOfMemory:this.args.installPlan.reduce((i,n)=>i+this.bytesToBlocks(n.bytes||0),0)>p}}bytesToBlocks(e){return Math.ceil(e/this.blockSize)}}0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA+B,wCAC/BC,EAAuC,kDAehC,MAAMH,CAAuB,CAIlC,YACmBI,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,mBAAqB,yBAAuB,UAC1D,MAAO,CAAE,MAAO,IAAI,iBAAe,sBAAsB,CAAE,EAI7D,GACEA,EAAY,wBAA0B,QACtCA,EAAY,cAAgB,QAC5BA,EAAY,qBAAuB,OAEnC,MAAO,CAAE,MAAO,IAAI,iBAAe,6BAA6B,CAAE,EAIpE,MAAMC,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": ["PredictOutOfMemoryTask_exports", "__export", "PredictOutOfMemoryTask", "__toCommonJS", "import_Errors", "import_DeviceSessionState", "api", "args", "deviceModel", "deviceState", "firmwareBlocks", "customImageBlocks", "applicationsBlocks", "size", "app", "languagesBlocks", "lang", "usedBlocks", "availableBlocks"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=require("../../device/DeviceStatus"),o=require("../../device-action/__test-utils__/makeInternalApi"),i=require("../../device-action/os/Errors"),s=require("../../device-session/DeviceSessionState"),a=require("./PredictOutOfMemoryTask");describe("PredictOutOfMemoryTask",()=>{const e=(0,o.makeDeviceActionInternalApiMock)();beforeEach(()=>{vi.clearAllMocks(),e.getDeviceModel.mockReturnValue({memorySize:1569792,blockSize:32})}),it("Success enough memory",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:n.DeviceStatus.CONNECTED,firmwareUpdateContext:{currentFirmware:{bytes:397824}},customImage:{size:51893},installedApps:[{bytes:305442},{bytes:514598},{bytes:271583}],installedLanguages:[{id:1,size:20480}]});const t=new a.PredictOutOfMemoryTask(e,{installPlan:[{bytes:1324},{bytes:6559}]}).run();expect(t).toStrictEqual({outOfMemory:!1})}),it("Success not enough memory",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:n.DeviceStatus.CONNECTED,firmwareUpdateContext:{currentFirmware:{bytes:397824}},customImage:{size:51893},installedApps:[{bytes:305442},{bytes:514598},{bytes:271583}],installedLanguages:[{id:1,size:20480}]});const t=new a.PredictOutOfMemoryTask(e,{installPlan:[{bytes:1324},{bytes:6559},{bytes:1}]}).run();expect(t).toStrictEqual({outOfMemory:!0})}),it("Success undefined sizes",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:n.DeviceStatus.CONNECTED,firmwareUpdateContext:{currentFirmware:{bytes:397824}},customImage:{},installedApps:[{bytes:305442},{bytes:null},{bytes:271583}],installedLanguages:[]});const t=new a.PredictOutOfMemoryTask(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.DeviceSessionStateType.Connected,deviceStatus:n.DeviceStatus.CONNECTED});const t=new a.PredictOutOfMemoryTask(e,{installPlan:[{bytes:1324}]}).run();expect(t).toStrictEqual({error:new i.UnknownDAError("Invalid device state")})}),it("Error when device session was not populated",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:n.DeviceStatus.CONNECTED,installedApps:[]});const t=new a.PredictOutOfMemoryTask(e,{installPlan:[{bytes:1324}]}).run();expect(t).toStrictEqual({error:new i.UnknownDAError("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": ["import_DeviceStatus", "import_makeInternalApi", "import_Errors", "import_DeviceSessionState", "import_PredictOutOfMemoryTask", "apiMock", "result"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var y=(o,e,d)=>e in o?l(o,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):o[e]=d;var N=(o,e)=>{for(var d in e)l(o,d,{get:e[d],enumerable:!0})},a=(o,e,d,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of I(e))!U.call(o,r)&&r!==d&&l(o,r,{get:()=>e[r],enumerable:!(i=m(e,r))||i.enumerable});return o};var x=o=>a(l({},"__esModule",{value:!0}),o),v=(o,e,d,i)=>{for(var r=i>1?void 0:i?m(e,d):e,u=o.length-1,n;u>=0;u--)(n=o[u])&&(r=(i?n(e,d,r):n(r))||r);return i&&r&&l(e,d,r),r};var b=(o,e,d)=>y(o,typeof e!="symbol"?e+"":e,d);var O={};N(O,{StaticDeviceModelDataSource:()=>t});module.exports=x(O);var f=require("inversify"),s=require("../../device/DeviceModel"),p=require("../../device-model/model/BleDeviceInfos"),c=require("../../device-model/model/DeviceModel");let t=class{getAllDeviceModels(){return Object.values(t.deviceModelByIds)}getDeviceModel(e){return t.deviceModelByIds[e.id]}filterDeviceModels(e){return this.getAllDeviceModels().filter(d=>Object.entries(e).every(([i,r])=>d[i]===r))}getBluetoothServicesInfos(){return Object.values(t.deviceModelByIds).reduce((e,d)=>{const{bluetoothSpec:i}=d;return i?{...e,...i.reduce((r,u)=>({...r,[u.serviceUuid]:new p.BleDeviceInfos(d,u.serviceUuid,u.writeUuid,u.writeCmdUuid,u.notifyUuid)}),{})}:e},{})}getBluetoothServices(){return Object.values(t.deviceModelByIds).map(e=>(e.bluetoothSpec||[]).map(d=>d.serviceUuid)).flat().filter(e=>!!e)}};b(t,"deviceModelByIds",{[s.DeviceModelId.NANO_S]:new c.TransportDeviceModel({id:s.DeviceModelId.NANO_S,productName:"Ledger Nano S",usbProductId:16,bootloaderUsbProductId:1,usbOnly:!0,memorySize:320*1024,masks:[823132160]}),[s.DeviceModelId.NANO_SP]:new c.TransportDeviceModel({id:s.DeviceModelId.NANO_SP,productName:"Ledger Nano S Plus",usbProductId:80,bootloaderUsbProductId:5,usbOnly:!0,memorySize:1533*1024,masks:[856686592]}),[s.DeviceModelId.NANO_X]:new c.TransportDeviceModel({id:s.DeviceModelId.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"}]}),[s.DeviceModelId.STAX]:new c.TransportDeviceModel({id:s.DeviceModelId.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"}]}),[s.DeviceModelId.FLEX]:new c.TransportDeviceModel({id:s.DeviceModelId.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"}]})}),t=v([(0,f.injectable)()],t);0&&(module.exports={StaticDeviceModelDataSource});
1
+ "use strict";var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var y=(o,e,d)=>e in o?l(o,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):o[e]=d;var N=(o,e)=>{for(var d in e)l(o,d,{get:e[d],enumerable:!0})},a=(o,e,d,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of I(e))!U.call(o,r)&&r!==d&&l(o,r,{get:()=>e[r],enumerable:!(i=m(e,r))||i.enumerable});return o};var x=o=>a(l({},"__esModule",{value:!0}),o),b=(o,e,d,i)=>{for(var r=i>1?void 0:i?m(e,d):e,c=o.length-1,n;c>=0;c--)(n=o[c])&&(r=(i?n(e,d,r):n(r))||r);return i&&r&&l(e,d,r),r};var v=(o,e,d)=>y(o,typeof e!="symbol"?e+"":e,d);var O={};N(O,{StaticDeviceModelDataSource:()=>t});module.exports=x(O);var f=require("inversify"),s=require("../../device/DeviceModel"),p=require("../../device-model/model/BleDeviceInfos"),u=require("../../device-model/model/DeviceModel");let t=class{getAllDeviceModels(){return Object.values(t.deviceModelByIds)}getDeviceModel(e){return t.deviceModelByIds[e.id]}filterDeviceModels(e){return this.getAllDeviceModels().filter(d=>Object.entries(e).every(([i,r])=>d[i]===r))}getBluetoothServicesInfos(){return Object.values(t.deviceModelByIds).reduce((e,d)=>{const{bluetoothSpec:i}=d;return i?{...e,...i.reduce((r,c)=>({...r,[c.serviceUuid]:new p.BleDeviceInfos(d,c.serviceUuid,c.writeUuid,c.writeCmdUuid,c.notifyUuid)}),{})}:e},{})}getBluetoothServices(){return Object.values(t.deviceModelByIds).map(e=>(e.bluetoothSpec||[]).map(d=>d.serviceUuid)).flat().filter(e=>!!e)}};v(t,"deviceModelByIds",{[s.DeviceModelId.NANO_S]:new u.TransportDeviceModel({id:s.DeviceModelId.NANO_S,productName:"Ledger Nano S",usbProductId:16,bootloaderUsbProductId:1,usbOnly:!0,memorySize:320*1024,blockSize:4*1024,masks:[823132160]}),[s.DeviceModelId.NANO_SP]:new u.TransportDeviceModel({id:s.DeviceModelId.NANO_SP,productName:"Ledger Nano S Plus",usbProductId:80,bootloaderUsbProductId:5,usbOnly:!0,memorySize:1533*1024,blockSize:32,masks:[856686592]}),[s.DeviceModelId.NANO_X]:new u.TransportDeviceModel({id:s.DeviceModelId.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"}]}),[s.DeviceModelId.STAX]:new u.TransportDeviceModel({id:s.DeviceModelId.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"}]}),[s.DeviceModelId.FLEX]:new u.TransportDeviceModel({id:s.DeviceModelId.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"}]})}),t=b([(0,f.injectable)()],t);0&&(module.exports={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": "mrBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA2B,qBAE3BC,EAA8B,mCAE9BC,EAA+B,kDAC/BD,EAAqC,+CAM9B,IAAME,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,IAAI,iBACzBN,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,IAAKO,GAASA,EAAK,WAAW,CAClE,EACC,KAAK,EACL,OAAQC,GAAS,CAAC,CAACA,CAAI,CAC5B,CACF,EAlIEC,EADWX,EACI,mBAEX,CACF,CAAC,gBAAc,MAAM,EAAG,IAAI,uBAAqB,CAC/C,GAAI,gBAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,IAAM,KAClB,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAAC,gBAAc,OAAO,EAAG,IAAI,uBAAqB,CAChD,GAAI,gBAAc,QAClB,YAAa,qBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAAC,gBAAc,MAAM,EAAG,IAAI,uBAAqB,CAC/C,GAAI,gBAAc,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,CAAC,gBAAc,IAAI,EAAG,IAAI,uBAAqB,CAC7C,GAAI,gBAAc,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,CAAC,gBAAc,IAAI,EAAG,IAAI,uBAAqB,CAC7C,GAAI,gBAAc,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,GAzEWA,EAANY,EAAA,IADN,cAAW,GACCZ",
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": "mrBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA2B,qBAE3BC,EAA8B,mCAE9BC,EAA+B,kDAC/BD,EAAqC,+CAM9B,IAAME,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,IAAI,iBACzBN,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,IAAKO,GAASA,EAAK,WAAW,CAClE,EACC,KAAK,EACL,OAAQC,GAAS,CAAC,CAACA,CAAI,CAC5B,CACF,EAvIEC,EADWX,EACI,mBAEX,CACF,CAAC,gBAAc,MAAM,EAAG,IAAI,uBAAqB,CAC/C,GAAI,gBAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,IAAM,KAClB,UAAW,EAAI,KACf,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAAC,gBAAc,OAAO,EAAG,IAAI,uBAAqB,CAChD,GAAI,gBAAc,QAClB,YAAa,qBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,UAAW,GACX,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAAC,gBAAc,MAAM,EAAG,IAAI,uBAAqB,CAC/C,GAAI,gBAAc,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,CAAC,gBAAc,IAAI,EAAG,IAAI,uBAAqB,CAC7C,GAAI,gBAAc,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,CAAC,gBAAc,IAAI,EAAG,IAAI,uBAAqB,CAC7C,GAAI,gBAAc,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,GA9EWA,EAANY,EAAA,IADN,cAAW,GACCZ",
6
6
  "names": ["StaticDeviceModelDataSource_exports", "__export", "StaticDeviceModelDataSource", "__toCommonJS", "import_inversify", "import_DeviceModel", "import_BleDeviceInfos", "StaticDeviceModelDataSource", "params", "deviceModel", "key", "value", "acc", "bluetoothSpec", "serviceToModel", "bleSpec", "spec", "uuid", "__publicField", "__decorateClass"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.create;var d=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var r in e)d(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!l.call(t,o)&&o!==r&&d(t,o,{get:()=>e[o],enumerable:!(u=m(e,o))||u.enumerable});return t};var g=(t,e,r)=>(r=t!=null?n(a(t)):{},c(e||!t||!t.__esModule?d(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(d({},"__esModule",{value:!0}),t);var I={};h(I,{TransportDeviceModel:()=>U});module.exports=S(I);var s=g(require("semver")),i=require("../../device/DeviceModel");class U{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 i.DeviceModelId.NANO_S:return s.default.lt(s.default.coerce(e)??"","2.0.0")?4*1024:2*1024;case i.DeviceModelId.NANO_X:return 4*1024;case i.DeviceModelId.NANO_SP:case i.DeviceModelId.STAX:case i.DeviceModelId.FLEX:return 32}}}0&&(module.exports={TransportDeviceModel});
1
+ "use strict";var b=Object.create;var u=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty;var S=(t,e)=>{for(var i in e)u(t,i,{get:e[i],enumerable:!0})},c=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of m(e))!a.call(t,o)&&o!==i&&u(t,o,{get:()=>e[o],enumerable:!(s=n(e,o))||s.enumerable});return t};var h=(t,e,i)=>(i=t!=null?b(l(t)):{},c(e||!t||!t.__esModule?u(i,"default",{value:t,enumerable:!0}):i,t)),g=t=>c(u({},"__esModule",{value:!0}),t);var I={};S(I,{TransportDeviceModel:()=>U});module.exports=g(I);var d=h(require("semver")),r=require("../../device/DeviceModel");class U{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 r.DeviceModelId.NANO_S:return d.default.lt(d.default.coerce(e)??"","2.0.0")?4*1024:2*1024;case r.DeviceModelId.NANO_X:return 4*1024;case r.DeviceModelId.NANO_SP:case r.DeviceModelId.STAX:case r.DeviceModelId.FLEX:return 32}}}0&&(module.exports={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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmB,qBAEnBC,EAA8B,mCAKvB,MAAMH,CAAqB,CAChC,GACA,YACA,aACA,uBACA,QACA,WACA,MACA,cAOA,YAAYI,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,KAAK,gBAAc,OACjB,OAAO,EAAAC,QAAO,GAAG,EAAAA,QAAO,OAAOD,CAAe,GAAK,GAAI,OAAO,EAC1D,EAAI,KACJ,EAAI,KACV,KAAK,gBAAc,OACjB,MAAO,GAAI,KACb,KAAK,gBAAc,QACnB,KAAK,gBAAc,KACnB,KAAK,gBAAc,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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmB,qBAEnBC,EAA8B,mCAKvB,MAAMH,CAAqB,CAChC,GACA,YACA,aACA,uBACA,QACA,WACA,UACA,MACA,cAOA,YAAYI,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,KAAK,gBAAc,OACjB,OAAO,EAAAC,QAAO,GAAG,EAAAA,QAAO,OAAOD,CAAe,GAAK,GAAI,OAAO,EAC1D,EAAI,KACJ,EAAI,KACV,KAAK,gBAAc,OACjB,MAAO,GAAI,KACb,KAAK,gBAAc,QACnB,KAAK,gBAAc,KACnB,KAAK,gBAAc,KACjB,MAAO,GACX,CACF,CACF",
6
6
  "names": ["DeviceModel_exports", "__export", "TransportDeviceModel", "__toCommonJS", "import_semver", "import_DeviceModel", "props", "firmwareVersion", "semver"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var s=(e,o)=>{for(var r in o)i(e,r,{get:o[r],enumerable:!0})},m=(e,o,r,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of l(o))!a.call(e,d)&&d!==r&&i(e,d,{get:()=>o[d],enumerable:!(t=u(o,d))||t.enumerable});return e};var n=e=>m(i({},"__esModule",{value:!0}),e);var b={};s(b,{deviceModelStubBuilder:()=>p});module.exports=n(b);var c=require("../../device/DeviceModel");function p(e={}){return{id:c.DeviceModelId.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}}0&&(module.exports={deviceModelStubBuilder});
1
+ "use strict";var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var s=(e,o)=>{for(var r in o)i(e,r,{get:o[r],enumerable:!0})},m=(e,o,r,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of l(o))!a.call(e,d)&&d!==r&&i(e,d,{get:()=>o[d],enumerable:!(c=u(o,d))||c.enumerable});return e};var n=e=>m(i({},"__esModule",{value:!0}),e);var b={};s(b,{deviceModelStubBuilder:()=>p});module.exports=n(b);var t=require("../../device/DeviceModel");function p(e={}){return{id:t.DeviceModelId.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}}0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8B,mCAGvB,SAASF,EACdG,EAAuC,CAAC,EAClB,CACtB,MAAO,CACL,GAAI,gBAAc,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,GAAGA,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8B,mCAGvB,SAASF,EACdG,EAAuC,CAAC,EAClB,CACtB,MAAO,CACL,GAAI,gBAAc,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,GAAGA,CACL,CACF",
6
6
  "names": ["DeviceModel_stub_exports", "__export", "deviceModelStubBuilder", "__toCommonJS", "import_DeviceModel", "props"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(n,e)=>{for(var o in e)r(n,o,{get:e[o],enumerable:!0})},l=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of y(e))!d.call(n,a)&&a!==o&&r(n,a,{get:()=>e[a],enumerable:!(t=s(e,a))||t.enumerable});return n};var S=n=>l(r({},"__esModule",{value:!0}),n);var u={};p(u,{DeviceSessionStateType:()=>i});module.exports=S(u);var i=(t=>(t[t.Connected=0]="Connected",t[t.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",t[t.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",t))(i||{});0&&(module.exports={DeviceSessionStateType});
1
+ "use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},y=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of s(e))!l.call(t,r)&&r!==n&&o(t,r,{get:()=>e[r],enumerable:!(a=p(e,r))||a.enumerable});return t};var m=t=>y(o({},"__esModule",{value:!0}),t);var u={};d(u,{DeviceSessionStateType:()=>i});module.exports=m(u);var i=(a=>(a[a.Connected=0]="Connected",a[a.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",a[a.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",a))(i||{});0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GA6CO,IAAKE,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAoIO,IAAKE,OACVA,IAAA,yBACAA,IAAA,yDACAA,IAAA,mDAHUA,OAAA",
6
6
  "names": ["DeviceSessionState_exports", "__export", "DeviceSessionStateType", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=require("../../../internal/device-session/model/DeviceSession.stub"),f=require("../../../internal/device-session/model/Errors"),l=require("../../../internal/device-session/service/DefaultDeviceSessionService"),S=require("../../../internal/logger-publisher/service/DefaultLoggerPublisherService"),m=require("../../../internal/manager-api/data/AxiosManagerApiDataSource"),v=require("../../../internal/manager-api/service/DefaultManagerApiService"),d=require("../../../internal/secure-channel/data/DefaultSecureChannelDataSource"),u=require("../../../internal/secure-channel/service/DefaultSecureChannelService"),n=require("./DisableDeviceSessionRefresher");vi.mock("uuid",()=>({v4:()=>"fakeUuid"}));let e,r,i,o,t,c;describe("DisableDeviceSessionRefresherUseCase",()=>{beforeEach(()=>{e=new S.DefaultLoggerPublisherService([],"get-connected-device-use-case-test"),r=new l.DefaultDeviceSessionService(()=>e),t=new v.DefaultManagerApiService(new m.AxiosManagerApiDataSource({})),c=new u.DefaultSecureChannelService(new d.DefaultSecureChannelDataSource({}))}),afterEach(()=>{vi.clearAllMocks()}),describe("execute",()=>{it("should disable the device session refresher and return a function to reenable it",()=>{o=(0,a.deviceSessionStubBuilder)({id:"fakeSessionId"},()=>e,t,c),r.addDeviceSession(o),i=new n.DisableDeviceSessionRefresherUseCase(r,()=>e);const s=vi.spyOn(o,"disableRefresher"),p=i.execute({sessionId:"fakeSessionId",blockerId:"fakeBlockerId"});expect(s).toHaveBeenCalledWith("fakeBlockerId"),p(),o.close()}),it("should throw error when deviceSession is not found",()=>{i=new n.DisableDeviceSessionRefresherUseCase(r,()=>e);try{i.execute({sessionId:"fakeSessionId",blockerId:"fakeBlockerId"})}catch(s){expect(s).toBeInstanceOf(f.DeviceSessionNotFound)}})})});
1
+ "use strict";var a=require("../../../internal/device-session/data/DeviceSessionRefresherConst"),f=require("../../../internal/device-session/model/DeviceSession.stub"),l=require("../../../internal/device-session/model/Errors"),S=require("../../../internal/device-session/service/DefaultDeviceSessionService"),m=require("../../../internal/logger-publisher/service/DefaultLoggerPublisherService"),v=require("../../../internal/manager-api/data/AxiosManagerApiDataSource"),d=require("../../../internal/manager-api/service/DefaultManagerApiService"),p=require("../../../internal/secure-channel/data/DefaultSecureChannelDataSource"),u=require("../../../internal/secure-channel/service/DefaultSecureChannelService"),n=require("./DisableDeviceSessionRefresher");vi.mock("uuid",()=>({v4:()=>"fakeUuid"}));let e,r,i,o,t,c;describe("DisableDeviceSessionRefresherUseCase",()=>{beforeEach(()=>{e=new m.DefaultLoggerPublisherService([],"get-connected-device-use-case-test"),r=new S.DefaultDeviceSessionService(()=>e),t=new d.DefaultManagerApiService(new v.AxiosManagerApiDataSource({})),c=new u.DefaultSecureChannelService(new p.DefaultSecureChannelDataSource({}))}),afterEach(()=>{vi.clearAllMocks()}),describe("execute",()=>{it("should disable the device session refresher and return a function to reenable it",()=>{o=(0,f.deviceSessionStubBuilder)({id:"fakeSessionId"},()=>e,t,c,a.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS),r.addDeviceSession(o),i=new n.DisableDeviceSessionRefresherUseCase(r,()=>e);const s=vi.spyOn(o,"disableRefresher"),D=i.execute({sessionId:"fakeSessionId",blockerId:"fakeBlockerId"});expect(s).toHaveBeenCalledWith("fakeBlockerId"),D(),o.close()}),it("should throw error when deviceSession is not found",()=>{i=new n.DisableDeviceSessionRefresherUseCase(r,()=>e);try{i.execute({sessionId:"fakeSessionId",blockerId:"fakeBlockerId"})}catch(s){expect(s).toBeInstanceOf(l.DeviceSessionNotFound)}})})});
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,IAAAA,EAAyC,6DACzCC,EAAsC,iDACtCC,EAA4C,wEAE5CC,EAA8C,4EAC9CC,EAA0C,gEAC1CC,EAAyC,kEAEzCC,EAA+C,wEAC/CC,EAA4C,wEAG5CC,EAAqD,2CAErD,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,IAAI,gCACX,CAAC,EACD,oCACF,EACAC,EAAiB,IAAI,8BAA4B,IAAMD,CAAM,EAC7DI,EAAa,IAAI,2BACf,IAAI,4BAA0B,CAAC,CAAc,CAC/C,EACAC,EAAgB,IAAI,8BAClB,IAAI,iCAA+B,CAAC,CAAc,CACpD,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,GAAG,mFAAoF,IAAM,CAE3FF,KAAgB,4BACd,CAAE,GAAI,eAAgB,EACtB,IAAMH,EACNI,EACAC,CACF,EACAJ,EAAe,iBAAiBE,CAAa,EAC7CD,EAAU,IAAI,uCACZD,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,IAAI,uCACZD,EACA,IAAMD,CACR,EAGA,GAAI,CACFE,EAAQ,QAAQ,CACd,UAAW,gBACX,UAAW,eACb,CAAC,CACH,OAASM,EAAO,CAEd,OAAOA,CAAK,EAAE,eAAe,uBAAqB,CACpD,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["import_DeviceSession", "import_Errors", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_DisableDeviceSessionRefresher", "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,IAAAA,EAAyD,qEAEzDC,EAAyC,6DACzCC,EAAsC,iDACtCC,EAA4C,wEAE5CC,EAA8C,4EAC9CC,EAA0C,gEAC1CC,EAAyC,kEAEzCC,EAA+C,wEAC/CC,EAA4C,wEAG5CC,EAAqD,2CAErD,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,IAAI,gCACX,CAAC,EACD,oCACF,EACAC,EAAiB,IAAI,8BAA4B,IAAMD,CAAM,EAC7DI,EAAa,IAAI,2BACf,IAAI,4BAA0B,CAAC,CAAc,CAC/C,EACAC,EAAgB,IAAI,8BAClB,IAAI,iCAA+B,CAAC,CAAc,CACpD,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,GAAG,mFAAoF,IAAM,CAE3FF,KAAgB,4BACd,CAAE,GAAI,eAAgB,EACtB,IAAMH,EACNI,EACAC,EACA,0CACF,EACAJ,EAAe,iBAAiBE,CAAa,EAC7CD,EAAU,IAAI,uCACZD,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,IAAI,uCACZD,EACA,IAAMD,CACR,EAGA,GAAI,CACFE,EAAQ,QAAQ,CACd,UAAW,gBACX,UAAW,eACb,CAAC,CACH,OAASM,EAAO,CAEd,OAAOA,CAAK,EAAE,eAAe,uBAAqB,CACpD,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_DeviceSessionRefresherConst", "import_DeviceSession", "import_Errors", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_DisableDeviceSessionRefresher", "logger", "sessionService", "useCase", "deviceSession", "managerApi", "secureChannel", "spy", "reenableRefresher", "error"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var A=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var ne=Object.prototype.hasOwnProperty;var ae=(t,r)=>{for(var p in r)A(t,p,{get:r[p],enumerable:!0})},d=(t,r,p,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of me(r))!ne.call(t,a)&&a!==p&&A(t,a,{get:()=>r[a],enumerable:!(u=ie(r,a))||u.enumerable});return t},o=(t,r,p)=>(d(t,r,"default"),p&&d(p,r,"default"));var se=t=>d(A({},"__esModule",{value:!0}),t);var e={};ae(e,{APDU_MAX_PAYLOAD:()=>s.APDU_MAX_PAYLOAD,Apdu:()=>D.Apdu,ApduBuilder:()=>s.ApduBuilder,ApduParser:()=>l.ApduParser,ApduResponse:()=>q.ApduResponse,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>K.BleDeviceInfos,ByteArrayBuilder:()=>v.ByteArrayBuilder,ByteArrayParser:()=>S.ByteArrayParser,CallTaskInAppDeviceAction:()=>O.CallTaskInAppDeviceAction,CloseAppCommand:()=>y.CloseAppCommand,CommandResultFactory:()=>i.CommandResultFactory,CommandResultStatus:()=>i.CommandResultStatus,CommandUtils:()=>b.CommandUtils,ConnectedDevice:()=>re.ConnectedDevice,ConsoleLogger:()=>ee.ConsoleLogger,DeviceActionStatus:()=>M.DeviceActionStatus,DeviceManagementKit:()=>Q.DeviceManagementKit,DeviceManagementKitBuilder:()=>Z.DeviceManagementKitBuilder,DeviceModel:()=>m.DeviceModel,DeviceModelId:()=>m.DeviceModelId,DeviceSessionStateType:()=>w.DeviceSessionStateType,DeviceStatus:()=>I.DeviceStatus,FramerUtils:()=>J.FramerUtils,GenuineCheckDeviceAction:()=>N.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>g.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceStatusDeviceAction:()=>U.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>L.GetOsVersionCommand,GlobalCommandError:()=>x.GlobalCommandError,GlobalCommandErrorHandler:()=>x.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>V.GoToDashboardDeviceAction,InvalidStatusWordError:()=>C.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>m.LEDGER_VENDOR_ID,ListAppsCommand:()=>B.ListAppsCommand,ListAppsDeviceAction:()=>P.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>_.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>Y.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>G.LoadCertificateCommand,LogLevel:()=>$.LogLevel,OpenAppCommand:()=>R.OpenAppCommand,OpenAppDeviceAction:()=>k.OpenAppDeviceAction,SendCommandInAppDeviceAction:()=>H.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>F.StaticDeviceModelDataSource,TransportConnectedDevice:()=>te.TransportConnectedDevice,TransportDeviceModel:()=>X.TransportDeviceModel,UnknownDAError:()=>h.UnknownDAError,UserInteractionRequired:()=>T.UserInteractionRequired,WebLogsExporterLogger:()=>oe.WebLogsExporterLogger,XStateDeviceAction:()=>W.XStateDeviceAction,base64StringToBuffer:()=>c.base64StringToBuffer,bufferToHexaString:()=>n.bufferToHexaString,connectedDeviceStubBuilder:()=>pe.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>j.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>z.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>n.hexaStringToBuffer,isBase64String:()=>c.isBase64String,isCommandErrorCode:()=>E.isCommandErrorCode,isHexaString:()=>n.isHexaString,isSuccessCommandResult:()=>i.isSuccessCommandResult});module.exports=se(e);var D=require("./apdu/model/Apdu"),s=require("./apdu/utils/ApduBuilder"),l=require("./apdu/utils/ApduParser");o(e,require("./apdu/utils/AppBuilderError"),module.exports);var v=require("./apdu/utils/ByteArrayBuilder"),S=require("./apdu/utils/ByteArrayParser"),C=require("./command/Errors"),i=require("./command/model/CommandResult"),y=require("./command/os/CloseAppCommand"),g=require("./command/os/GetAppAndVersionCommand"),f=require("./command/os/GetBatteryStatusCommand"),L=require("./command/os/GetOsVersionCommand"),B=require("./command/os/ListAppsCommand"),G=require("./command/os/LoadCertificateCommand"),R=require("./command/os/OpenAppCommand"),E=require("./command/utils/CommandErrors"),b=require("./command/utils/CommandUtils"),x=require("./command/utils/GlobalCommandError"),m=require("./device/DeviceModel"),I=require("./device/DeviceStatus"),M=require("./device-action/model/DeviceActionState"),T=require("./device-action/model/UserInteractionRequired"),O=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),h=require("./device-action/os/Errors"),U=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),V=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),P=require("./device-action/os/ListApps/ListAppsDeviceAction"),_=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),k=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),H=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),W=require("./device-action/xstate-utils/XStateDeviceAction"),F=require("./device-model/data/StaticDeviceModelDataSource"),K=require("./device-model/model/BleDeviceInfos"),X=require("./device-model/model/DeviceModel"),q=require("./device-session/ApduResponse");o(e,require("./device-session/data/FramerConst"),module.exports);var w=require("./device-session/DeviceSessionState"),N=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),Y=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),j=require("./device-session/service/DefaultApduReceiverService.stub"),z=require("./device-session/service/DefaultApduSenderService.stub"),J=require("./device-session/utils/FramerUtils"),Q=require("./DeviceManagementKit"),Z=require("./DeviceManagementKitBuilder");o(e,require("./Error"),module.exports);var $=require("./logger-subscriber/model/LogLevel"),ee=require("./logger-subscriber/service/ConsoleLogger"),oe=require("./logger-subscriber/service/WebLogsExporterLogger"),re=require("./transport/model/ConnectedDevice");o(e,require("./transport/model/Errors"),module.exports);var te=require("./transport/model/TransportConnectedDevice"),pe=require("./transport/model/TransportConnectedDevice.stub");o(e,require("./types"),module.exports);var c=require("./utils/Base64String"),n=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UnknownDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
1
+ "use strict";var D=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var Ae=Object.prototype.hasOwnProperty;var De=(t,o)=>{for(var i in o)D(t,i,{get:o[i],enumerable:!0})},A=(t,o,i,v)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of de(o))!Ae.call(t,s)&&s!==i&&D(t,s,{get:()=>o[s],enumerable:!(v=xe(o,s))||v.enumerable});return t},r=(t,o,i)=>(A(t,o,"default"),i&&A(i,o,"default"));var ve=t=>A(D({},"__esModule",{value:!0}),t);var e={};De(e,{APDU_MAX_PAYLOAD:()=>c.APDU_MAX_PAYLOAD,Apdu:()=>u.Apdu,ApduBuilder:()=>c.ApduBuilder,ApduParser:()=>l.ApduParser,ApduResponse:()=>Y.ApduResponse,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>q.BleDeviceInfos,ByteArrayBuilder:()=>S.ByteArrayBuilder,ByteArrayParser:()=>C.ByteArrayParser,CallTaskInAppDeviceAction:()=>T.CallTaskInAppDeviceAction,CloseAppCommand:()=>L.CloseAppCommand,CommandResultFactory:()=>n.CommandResultFactory,CommandResultStatus:()=>n.CommandResultStatus,CommandUtils:()=>I.CommandUtils,ConnectedDevice:()=>ae.ConnectedDevice,ConsoleLogger:()=>ne.ConsoleLogger,DeviceActionStatus:()=>b.DeviceActionStatus,DeviceConnectionStateMachine:()=>se.DeviceConnectionStateMachine,DeviceLockedError:()=>p.DeviceLockedError,DeviceManagementKit:()=>te.DeviceManagementKit,DeviceManagementKitBuilder:()=>pe.DeviceManagementKitBuilder,DeviceModel:()=>m.DeviceModel,DeviceModelId:()=>m.DeviceModelId,DeviceSessionStateType:()=>j.DeviceSessionStateType,DeviceStatus:()=>O.DeviceStatus,FramerUtils:()=>oe.FramerUtils,GenuineCheckDeviceAction:()=>z.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>g.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>U.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>P.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>B.GetOsVersionCommand,GlobalCommandError:()=>x.GlobalCommandError,GlobalCommandErrorHandler:()=>x.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>V.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>J.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>k.InstallOrUpdateAppsDeviceAction,InvalidStatusWordError:()=>y.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>m.LEDGER_VENDOR_ID,ListAppsCommand:()=>E.ListAppsCommand,ListAppsDeviceAction:()=>W.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>_.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>Q.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>G.LoadCertificateCommand,LogLevel:()=>ie.LogLevel,OpenAppCommand:()=>M.OpenAppCommand,OpenAppDeviceAction:()=>F.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>H.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>p.OutOfMemoryDAError,SecureChannelError:()=>$.SecureChannelError,SendCommandInAppDeviceAction:()=>w.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>X.StaticDeviceModelDataSource,TransportConnectedDevice:()=>ce.TransportConnectedDevice,TransportDeviceModel:()=>N.TransportDeviceModel,UninstallAppDeviceAction:()=>Z.UninstallAppDeviceAction,UnknownDAError:()=>p.UnknownDAError,UnsupportedFirmwareDAError:()=>p.UnsupportedFirmwareDAError,UserInteractionRequired:()=>h.UserInteractionRequired,WebLogsExporterLogger:()=>me.WebLogsExporterLogger,XStateDeviceAction:()=>K.XStateDeviceAction,base64StringToBuffer:()=>d.base64StringToBuffer,bufferToHexaString:()=>a.bufferToHexaString,connectedDeviceStubBuilder:()=>fe.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>ee.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>re.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>a.hexaStringToBuffer,isBase64String:()=>d.isBase64String,isCommandErrorCode:()=>R.isCommandErrorCode,isHexaString:()=>a.isHexaString,isSuccessCommandResult:()=>n.isSuccessCommandResult});module.exports=ve(e);var u=require("./apdu/model/Apdu"),c=require("./apdu/utils/ApduBuilder"),l=require("./apdu/utils/ApduParser");r(e,require("./apdu/utils/AppBuilderError"),module.exports);var S=require("./apdu/utils/ByteArrayBuilder"),C=require("./apdu/utils/ByteArrayParser"),y=require("./command/Errors"),n=require("./command/model/CommandResult"),L=require("./command/os/CloseAppCommand"),g=require("./command/os/GetAppAndVersionCommand"),f=require("./command/os/GetBatteryStatusCommand"),B=require("./command/os/GetOsVersionCommand"),E=require("./command/os/ListAppsCommand"),G=require("./command/os/LoadCertificateCommand"),M=require("./command/os/OpenAppCommand"),R=require("./command/utils/CommandErrors"),I=require("./command/utils/CommandUtils"),x=require("./command/utils/GlobalCommandError"),m=require("./device/DeviceModel"),O=require("./device/DeviceStatus"),b=require("./device-action/model/DeviceActionState"),h=require("./device-action/model/UserInteractionRequired"),T=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),p=require("./device-action/os/Errors"),U=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),P=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),V=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),k=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),W=require("./device-action/os/ListApps/ListAppsDeviceAction"),_=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),F=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),H=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),w=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),K=require("./device-action/xstate-utils/XStateDeviceAction"),X=require("./device-model/data/StaticDeviceModelDataSource"),q=require("./device-model/model/BleDeviceInfos"),N=require("./device-model/model/DeviceModel"),Y=require("./device-session/ApduResponse");r(e,require("./device-session/data/FramerConst"),module.exports);var j=require("./device-session/DeviceSessionState"),z=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),J=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),Q=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),Z=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),$=require("../internal/secure-channel/model/Errors"),ee=require("./device-session/service/DefaultApduReceiverService.stub"),re=require("./device-session/service/DefaultApduSenderService.stub"),oe=require("./device-session/utils/FramerUtils"),te=require("./DeviceManagementKit"),pe=require("./DeviceManagementKitBuilder");r(e,require("./Error"),module.exports);var ie=require("./logger-subscriber/model/LogLevel"),ne=require("./logger-subscriber/service/ConsoleLogger"),me=require("./logger-subscriber/service/WebLogsExporterLogger"),ae=require("./transport/model/ConnectedDevice"),se=require("./transport/model/DeviceConnectionStateMachine");r(e,require("./transport/model/Errors"),module.exports);var ce=require("./transport/model/TransportConnectedDevice"),fe=require("./transport/model/TransportConnectedDevice.stub");r(e,require("./types"),module.exports);var d=require("./utils/Base64String"),a=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
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": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,muFAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAAuC,+BACvCC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1ChB,EAA+B,wCAC/BiB,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/Bb,EAAqC,+CACrCc,EAA6B,4CAC7B7B,EAAAN,EAAc,gDA9Ed,gBA+EA,IAAAoC,EAGO,kDACPC,EAAyC,mFACzCC,EAA8C,6FAE9CC,EAAsD,uEACtDC,EAAoD,qEACpDC,EAA4B,iDAC5BC,EAAoC,oCACpCC,EAA2C,2CAC3CrC,EAAAN,EAAc,sBA3Fd,gBA4FA,IAAA4C,EAAyB,iDACzBC,GAA8B,wDAC9BC,GAAsC,gEACtCC,GAAgC,gDAChCzC,EAAAN,EAAc,uCAhGd,gBAiGA,IAAAgD,GAAyC,yDACzCA,GAA2C,8DAC3C1C,EAAAN,EAAc,sBAnGd,gBAoGA,IAAAiD,EAAqD,mCACrDC,EAIO",
6
- "names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_ListInstalledAppsDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_TransportConnectedDevice", "import_Base64String", "import_HexaString"]
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": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,0yGAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAAuC,+BACvCC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1ChB,EAKO,wCACPiB,EAA8C,iFAC9CC,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAgD,qFAChDC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAAoD,6FACpDC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BhB,EAAqC,+CACrCiB,EAA6B,4CAC7BhC,EAAAN,EAAc,gDAtFd,gBAuFA,IAAAuC,EAGO,kDACPC,EAAyC,mFACzCC,EAAuC,+EACvCC,EAA8C,6FAC9CC,EAAyC,mFACzClC,EAAmC,iDAEnCmC,GAAsD,uEACtDC,GAAoD,qEACpDC,GAA4B,iDAC5BC,GAAoC,oCACpCC,GAA2C,2CAC3C1C,EAAAN,EAAc,sBAtGd,gBAuGA,IAAAiD,GAAyB,iDACzBC,GAA8B,wDAC9BC,GAAsC,gEACtCC,GAAgC,gDAChCC,GAGO,6DACP/C,EAAAN,EAAc,uCA/Gd,gBAgHA,IAAAsD,GAAyC,yDACzCA,GAA2C,8DAC3ChD,EAAAN,EAAc,sBAlHd,gBAmHA,IAAAuD,EAAqD,mCACrDC,EAIO",
6
+ "names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_Base64String", "import_HexaString"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=require("../../device-model/model/DeviceModel.stub"),o=require("../../../internal/device-session/model/DeviceSession"),r=require("./WebLogsExporterLogger");describe("getJSONStringifyReplacer",()=>{it("should return a function that replaces Uint8Array correctly",()=>{const e=(0,r.getJSONStringifyReplacer)(),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=(0,i.deviceModelStubBuilder)(),t=(0,r.getJSONStringifyReplacer)(),c={deviceModel:(0,i.deviceModelStubBuilder)(),type:"USB",id:"mockedDeviceId",sendApdu:vi.fn(),transport:"USB"},n=new o.DeviceSession({connectedDevice:c,id:"mockedSessionId"},vi.fn(),{},{}),s=JSON.stringify(n,t),a=`{"id":"mockedSessionId","connectedDevice":{"deviceModel":${JSON.stringify(e)},"type":"USB","id":"mockedDeviceId"}}`;n.close(),expect(s).toEqual(a)}),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,(0,r.getJSONStringifyReplacer)());expect(c).toEqual(t)})});
1
+ "use strict";var i=require("../../device-model/model/DeviceModel.stub"),o=require("../../../internal/device-session/data/DeviceSessionRefresherConst"),s=require("../../../internal/device-session/model/DeviceSession"),c=require("./WebLogsExporterLogger");describe("getJSONStringifyReplacer",()=>{it("should return a function that replaces Uint8Array correctly",()=>{const e=(0,c.getJSONStringifyReplacer)(),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=(0,i.deviceModelStubBuilder)(),t=(0,c.getJSONStringifyReplacer)(),r={deviceModel:(0,i.deviceModelStubBuilder)(),type:"USB",id:"mockedDeviceId",sendApdu:vi.fn(),transport:"USB"},n=new s.DeviceSession({connectedDevice:r,id:"mockedSessionId"},vi.fn(),{},{},o.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS),a=JSON.stringify(n,t),l=`{"id":"mockedSessionId","connectedDevice":{"deviceModel":${JSON.stringify(e)},"type":"USB","id":"mockedDeviceId"}}`;n.close(),expect(a).toEqual(l)}),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,(0,c.getJSONStringifyReplacer)());expect(r).toEqual(t)})});
2
2
  //# sourceMappingURL=WebLogsExporterLogger.test.js.map