@ledgerhq/device-management-kit 0.0.0-rn-ble-logs-20250416162013 → 0.0.0-rn-hid-sync-onboarding-behavior-20250516135345

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 (533) hide show
  1. package/README.md +3 -0
  2. package/lib/cjs/package.json +22 -23
  3. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  4. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +2 -2
  5. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
  6. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
  7. package/lib/cjs/src/api/DmkConfig.js +1 -1
  8. package/lib/cjs/src/api/DmkConfig.js.map +1 -1
  9. package/lib/cjs/src/api/command/di/commandModule.js +1 -1
  10. package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
  11. package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
  12. package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
  13. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  14. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  15. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  16. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  17. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  18. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  19. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  20. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  21. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
  22. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  23. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  24. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  25. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  26. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  27. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
  28. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  29. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  30. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  31. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  32. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  33. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  34. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  35. package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
  36. package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
  37. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
  38. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  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/index.js +1 -1
  103. package/lib/cjs/src/api/index.js.map +3 -3
  104. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  105. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  106. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  107. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  108. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
  109. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
  110. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  111. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  112. package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
  113. package/lib/cjs/src/api/types.js +1 -1
  114. package/lib/cjs/src/api/types.js.map +1 -1
  115. package/lib/cjs/src/di.js +1 -1
  116. package/lib/cjs/src/di.js.map +2 -2
  117. package/lib/cjs/src/internal/config/di/configModule.js +1 -1
  118. package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
  119. package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
  120. package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
  121. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
  122. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  123. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  124. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  125. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
  126. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  127. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
  128. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  129. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  130. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  131. package/lib/cjs/src/internal/device-session/model/DevicePinger.js +1 -1
  132. package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +3 -3
  133. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  134. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  135. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  136. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  137. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  138. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
  139. package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
  140. package/lib/cjs/src/internal/device-session/model/Frame.js.map +3 -3
  141. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  142. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  143. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  144. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  145. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  146. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  147. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  148. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  149. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  150. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  151. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
  152. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  153. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  154. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  155. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  156. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  157. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  158. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  159. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
  160. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  161. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  162. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  163. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  164. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  165. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  166. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  167. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  168. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  169. package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
  170. package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
  171. package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
  172. package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
  173. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  174. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  175. package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
  176. package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
  177. package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
  178. package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
  179. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  180. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  181. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  182. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  183. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
  184. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
  185. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +1 -1
  186. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +3 -3
  187. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +1 -1
  188. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +3 -3
  189. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  190. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  191. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  192. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  193. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  194. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  195. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  196. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  197. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +1 -1
  198. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +1 -1
  199. package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
  200. package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
  201. package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
  202. package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
  203. package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
  204. package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
  205. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  206. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  207. package/lib/esm/package.json +22 -23
  208. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  209. package/lib/esm/src/api/DeviceManagementKit.test.js.map +2 -2
  210. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  211. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  212. package/lib/esm/src/api/command/di/commandModule.js +1 -1
  213. package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
  214. package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
  215. package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
  216. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  217. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  218. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  219. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  220. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  221. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  222. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  223. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  224. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
  225. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  226. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  227. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  228. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  229. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  230. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
  231. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  232. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  233. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  234. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  235. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  236. package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
  237. package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
  238. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
  239. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  240. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  241. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  242. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  243. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  244. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  245. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  246. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  247. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  248. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  249. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  250. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  251. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  252. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  253. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  254. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  255. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  256. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  257. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  258. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  259. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  260. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  261. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  262. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  263. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  264. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  265. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  266. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  267. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  268. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  269. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  270. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  271. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  272. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  273. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  274. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  275. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  276. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  277. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  278. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  279. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  280. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  281. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  282. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  283. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  284. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  285. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  286. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  287. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  288. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  289. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  290. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  291. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  292. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  293. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  294. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  295. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  296. package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
  297. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  298. package/lib/esm/src/api/index.js +1 -1
  299. package/lib/esm/src/api/index.js.map +3 -3
  300. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  301. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  302. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  303. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  304. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
  305. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
  306. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  307. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  308. package/lib/esm/src/di.js +1 -1
  309. package/lib/esm/src/di.js.map +3 -3
  310. package/lib/esm/src/internal/config/di/configModule.js +1 -1
  311. package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
  312. package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
  313. package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
  314. package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
  315. package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  316. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  317. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  318. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
  319. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  320. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
  321. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  322. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  323. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  324. package/lib/esm/src/internal/device-session/model/DevicePinger.js +1 -1
  325. package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +3 -3
  326. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  327. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  328. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  329. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  330. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  331. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
  332. package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
  333. package/lib/esm/src/internal/device-session/model/Frame.js.map +3 -3
  334. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  335. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  336. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  337. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  338. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  339. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  340. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  341. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  342. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  343. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  344. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
  345. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  346. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  347. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  348. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  349. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  350. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  351. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  352. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  353. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  354. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  355. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  356. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  357. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  358. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  359. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  360. package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
  361. package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
  362. package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
  363. package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
  364. package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
  365. package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
  366. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  367. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  368. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  369. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  370. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +1 -1
  371. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +3 -3
  372. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +1 -1
  373. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +3 -3
  374. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  375. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  376. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  377. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  378. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  379. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  380. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  381. package/lib/esm/src/internal/send/di/sendModule.js +1 -1
  382. package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
  383. package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
  384. package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
  385. package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
  386. package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
  387. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  388. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  389. package/lib/types/src/api/DeviceManagementKit.d.ts +1 -1
  390. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  391. package/lib/types/src/api/DmkConfig.d.ts +1 -0
  392. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  393. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  394. package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
  395. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
  396. package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
  397. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
  398. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
  399. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
  400. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
  401. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +30 -2
  402. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  403. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
  404. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
  405. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
  406. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
  407. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  408. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
  409. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
  410. package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
  411. package/lib/types/src/api/device-action/DeviceAction.d.ts +3 -1
  412. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  413. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  414. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +5 -0
  415. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  416. package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
  417. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
  418. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +1 -0
  419. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  420. package/lib/types/src/api/device-action/os/Errors.d.ts +10 -0
  421. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  422. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts +58 -0
  423. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
  424. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
  425. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
  426. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +27 -0
  427. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
  428. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  429. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
  430. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  431. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
  432. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
  433. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
  434. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
  435. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +64 -0
  436. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
  437. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
  438. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
  439. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
  440. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
  441. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +25 -0
  442. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
  443. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  444. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -0
  445. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  446. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
  447. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
  448. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
  449. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
  450. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
  451. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
  452. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
  453. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
  454. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
  455. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
  456. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
  457. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
  458. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
  459. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
  460. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
  461. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
  462. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  463. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
  464. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  465. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  466. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +93 -0
  467. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  468. package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
  469. package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
  470. package/lib/types/src/api/index.d.ts +5 -1
  471. package/lib/types/src/api/index.d.ts.map +1 -1
  472. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -1
  473. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
  474. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -1
  475. package/lib/types/src/api/transport/model/Errors.d.ts +7 -3
  476. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  477. package/lib/types/src/api/transport/model/Transport.d.ts +1 -1
  478. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  479. package/lib/types/src/api/types.d.ts +4 -1
  480. package/lib/types/src/api/types.d.ts.map +1 -1
  481. package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
  482. package/lib/types/src/di.d.ts.map +1 -1
  483. package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
  484. package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
  485. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
  486. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
  487. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  488. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +1 -1
  489. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -1
  490. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +2 -1
  491. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  492. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  493. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -1
  494. package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
  495. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -1
  496. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  497. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +4 -2
  498. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
  499. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
  500. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +20 -4
  501. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  502. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +41 -6
  503. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  504. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +104 -18
  505. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
  506. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +5 -0
  507. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  508. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  509. package/lib/types/src/internal/manager-api/model/Application.d.ts +12 -12
  510. package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
  511. package/lib/types/src/internal/manager-api/model/Const.d.ts +1 -0
  512. package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
  513. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +17 -3
  514. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  515. package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
  516. package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
  517. package/lib/types/src/internal/manager-api/model/Params.d.ts +20 -0
  518. package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
  519. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +7 -1
  520. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  521. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +39 -1
  522. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  523. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +3 -1
  524. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -1
  525. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
  526. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +2 -2
  527. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -1
  528. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +3 -3
  529. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -1
  530. package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
  531. package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
  532. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  533. package/package.json +14 -15
@@ -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": "aAAA,IAAAA,EAA4B,qBAE5BC,EAAuC,+BACvCC,EAAqC,4CAErCC,EAAgD,6DAQhDC,EAAwC,qCAExC,SAAS,0BAA2B,IAAM,CACxC,MAAMC,KAAU,mCAAgC,EAC1CC,EAAa,CACjB,eAAgB,cAChB,qBAAsB,aACtB,UAAW,YACb,EAEMC,EAAoB,GAEpBC,EAAiB,CACrB,GAAI,CACN,EAEMC,EAAmB,CACvB,GAAI,IACJ,QAAS,QACT,MAAO,UACT,EAEMC,EAAc,CAClB,GAAI,IACJ,MAAO,UACT,EAEMC,EAAwB,CAC5B,GAAI,IACJ,QAAS,QACT,MAAO,WACP,YAAa,CAAC,CAAC,CACjB,EAEMC,EAAO,CACX,CACE,GAAI,EACJ,KAAM,eACR,EACA,CACE,GAAI,EACJ,KAAM,aACR,CACF,EAEMC,EAAe,CACnB,iBAAkB,GAAG,GAAG,EACxB,mBAAoB,GAAG,GAAG,EAC1B,yBAA0B,GAAG,GAAG,EAChC,uBAAwB,GAAG,GAAG,EAC9B,WAAY,GAAG,GAAG,CACpB,EAEA,WAAW,IAAM,CACf,GAAG,cAAc,EAEjBR,EAAQ,qBAAqB,gBAC3BQ,CACF,EACAA,EAAa,iBAAiB,mBAC5B,eAAY,SAAYL,CAAc,CACxC,EACAK,EAAa,mBAAmB,mBAC9B,eAAY,SAAYJ,CAAgB,CAC1C,EACAI,EAAa,yBAAyB,mBACpC,eAAY,SAAYH,CAAW,CACrC,EACAG,EAAa,uBAAuB,mBAClC,eAAY,SAAYF,CAAqB,CAC/C,EACAE,EAAa,WAAW,mBAAgB,eAAY,SAAYD,CAAI,CAAC,CACvE,CAAC,EAED,GAAG,4CAA6C,SAAY,CAE1DP,EAAQ,YACL,yBAAsB,wBAAqB,CAAE,KAAMC,CAAW,CAAC,CAAC,EAChE,yBAAsB,wBAAqB,CAAE,KAAMC,CAAkB,CAAC,CAAC,EAC1EM,EAAa,yBAAyB,uBACpC,eAAY,MAAO,CAAE,OAAAC,CAAO,IAAM,CAChCA,EAAO,IAAI,MAAM,OAAO,CAAC,CAC3B,CAAC,CACH,EAGA,MAAMC,EAAS,MAAM,IAAI,0BAAwBV,CAAO,EAAE,IAAI,EAG9D,OAAOU,CAAM,EAAE,iBACb,wBAAqB,CACnB,KAAM,CACJ,cAAeP,EACf,SAAUC,EACV,gBAAiB,CACf,IAAK,cACL,WAAY,aACZ,GAAI,aACJ,SAAUH,CACZ,EACA,sBAAuB,CACrB,gBAAiBG,EACjB,gBAAiB,MACnB,EACA,YAAa,CAAE,KAAMF,CAAkB,CACzC,CACF,CAAC,CACH,CACF,CAAC,EAED,GAAG,2CAA4C,SAAY,CAEzDF,EAAQ,YACL,yBAAsB,wBAAqB,CAAE,KAAMC,CAAW,CAAC,CAAC,EAChE,yBACC,wBAAqB,CAAE,MAAO,IAAI,yBAAuB,OAAO,CAAE,CAAC,CACrE,EAGF,MAAMS,EAAS,MAAM,IAAI,0BAAwBV,CAAO,EAAE,IAAI,EAG9D,OAAOU,CAAM,EAAE,iBACb,wBAAqB,CACnB,KAAM,CACJ,cAAeP,EACf,SAAUC,EACV,gBAAiB,CACf,IAAK,cACL,WAAY,aACZ,GAAI,aACJ,SAAUH,CACZ,EACA,sBAAuB,CACrB,gBAAiBG,EACjB,gBAAiB,CACf,YAAaC,EACb,cAAeC,EACf,kBAAmB,EACrB,CACF,EACA,YAAa,CAAC,CAChB,CACF,CAAC,CACH,EACA,OAAOE,EAAa,gBAAgB,EAAE,qBAAqBP,CAAU,EACrE,OAAOO,EAAa,kBAAkB,EAAE,qBACtCP,EACAE,CACF,EACA,OAAOK,EAAa,wBAAwB,EAAE,qBAC5CJ,EACAD,CACF,EACA,OAAOK,EAAa,sBAAsB,EAAE,qBAC1CH,CACF,CACF,CAAC,EAED,GAAG,0DAA2D,SAAY,CAExEL,EAAQ,YACL,yBAAsB,wBAAqB,CAAE,KAAMC,CAAW,CAAC,CAAC,EAChE,yBACC,wBAAqB,CAAE,MAAO,IAAI,yBAAuB,OAAO,CAAE,CAAC,CACrE,EACF,MAAMU,EAAe,CACnB,GAAGL,EACH,YAAa,CAAC,CAAC,CACjB,EACAE,EAAa,uBAAuB,mBAClC,eAAY,SAAYG,CAAY,CACtC,EAGA,MAAMD,EAAS,MAAM,IAAI,0BAAwBV,CAAO,EAAE,IAAI,EAG9D,OAAOU,CAAM,EAAE,iBACb,wBAAqB,CACnB,KAAM,CACJ,cAAeP,EACf,SAAUC,EACV,gBAAiB,CACf,IAAK,cACL,WAAY,aACZ,GAAI,aACJ,SAAUH,CACZ,EACA,sBAAuB,CACrB,gBAAiBG,EACjB,gBAAiB,CACf,YAAaC,EACb,cAAeM,EACf,kBAAmB,EACrB,CACF,EACA,YAAa,CAAC,CAChB,CACF,CAAC,CACH,CACF,CAAC,EAED,GAAG,kDAAmD,SAAY,CAEhEX,EAAQ,YAAY,yBAClB,wBAAqB,CAAE,MAAO,IAAI,yBAAuB,OAAO,CAAE,CAAC,CACrE,EAGA,MAAMU,EAAS,MAAM,IAAI,0BAAwBV,CAAO,EAAE,IAAI,EAG9D,OAAOU,CAAM,EAAE,iBACb,wBAAqB,CAAE,MAAO,IAAI,yBAAuB,OAAO,CAAE,CAAC,CACrE,CACF,CAAC,EAED,GAAG,kDAAmD,SAAY,CAEhEV,EAAQ,YAAY,yBAClB,wBAAqB,CAAE,KAAMC,CAAW,CAAC,CAC3C,EACAO,EAAa,iBAAiB,uBAC5B,eAAY,MAAO,CAAE,OAAAC,CAAO,IAAM,CAChCA,EAAO,IAAI,MAAM,OAAO,CAAC,CAC3B,CAAC,CACH,EAGA,MAAMC,EAAS,MAAM,IAAI,0BAAwBV,CAAO,EAAE,IAAI,EAG9D,OAAOU,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yBACT,wCACF,CACF,CAAC,CACH,CACF,CAAC,EAED,GAAG,oDAAqD,SAAY,CAElEV,EAAQ,YAAY,yBAClB,wBAAqB,CAAE,KAAMC,CAAW,CAAC,CAC3C,EACAO,EAAa,mBAAmB,uBAC9B,eAAY,MAAO,CAAE,OAAAC,CAAO,IAAM,CAChCA,EAAO,IAAI,MAAM,OAAO,CAAC,CAC3B,CAAC,CACH,EAGA,MAAMC,EAAS,MAAM,IAAI,0BAAwBV,CAAO,EAAE,IAAI,EAG9D,OAAOU,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yBACT,wCACF,CACF,CAAC,CACH,CACF,CAAC,CACH,CAAC",
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": "aAAA,IAAAA,EAA6B,oCAC7BC,EAAgD,6DAChDC,EAA+B,wCAG/BC,EAAuC,kDAIvCC,EAAuC,oCAEvC,SAAS,yBAA0B,IAAM,CACvC,MAAMC,KAAU,mCAAgC,EAEhD,WAAW,IAAM,CACf,GAAG,cAAc,EACjBA,EAAQ,eAAe,gBAAgB,CACrC,WAAY,QACZ,UAAW,EACb,CAAoC,CACtC,CAAC,EAED,GAAG,wBAAyB,IAAM,CAEhCA,EAAQ,sBAAsB,oBAAoB,CAChD,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,sBAAuB,CACrB,gBAAiB,CAAE,MAAO,MAAO,CACnC,EACA,YAAa,CAAE,KAAM,KAAM,EAC3B,cAAe,CACb,CAAE,MAAO,MAAO,EAChB,CAAE,MAAO,MAAO,EAChB,CAAE,MAAO,MAAO,CAClB,EACA,mBAAoB,CAAC,CAAE,GAAI,EAAG,KAAM,KAAM,CAAC,CAC7C,CAAkC,EAGlC,MAAMC,EAAS,IAAI,yBAAuBD,EAAS,CACjD,YAAa,CACX,CAAE,MAAO,IAAK,EACd,CAAE,MAAO,IAAK,CAChB,CACF,CAAC,EAAE,IAAI,EAGP,OAAOC,CAAM,EAAE,cAAc,CAC3B,YAAa,EACf,CAAC,CACH,CAAC,EAED,GAAG,4BAA6B,IAAM,CAEpCD,EAAQ,sBAAsB,oBAAoB,CAChD,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,sBAAuB,CACrB,gBAAiB,CAAE,MAAO,MAAO,CACnC,EACA,YAAa,CAAE,KAAM,KAAM,EAC3B,cAAe,CACb,CAAE,MAAO,MAAO,EAChB,CAAE,MAAO,MAAO,EAChB,CAAE,MAAO,MAAO,CAClB,EACA,mBAAoB,CAAC,CAAE,GAAI,EAAG,KAAM,KAAM,CAAC,CAC7C,CAAkC,EAGlC,MAAMC,EAAS,IAAI,yBAAuBD,EAAS,CACjD,YAAa,CACX,CAAE,MAAO,IAAK,EACd,CAAE,MAAO,IAAK,EACd,CAAE,MAAO,CAAE,CACb,CACF,CAAC,EAAE,IAAI,EAGP,OAAOC,CAAM,EAAE,cAAc,CAC3B,YAAa,EACf,CAAC,CACH,CAAC,EAED,GAAG,0BAA2B,IAAM,CAElCD,EAAQ,sBAAsB,oBAAoB,CAChD,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,sBAAuB,CACrB,gBAAiB,CAAE,MAAO,MAAO,CACnC,EACA,YAAa,CAAC,EACd,cAAe,CACb,CAAE,MAAO,MAAO,EAChB,CAAE,MAAO,IAAK,EACd,CAAE,MAAO,MAAO,CAClB,EACA,mBAAoB,CAAC,CACvB,CAAkC,EAGlC,MAAMC,EAAS,IAAI,yBAAuBD,EAAS,CACjD,YAAa,CACX,CAAE,MAAO,IAAK,EACd,CAAE,MAAO,IAAK,CAChB,CACF,CAAC,EAAE,IAAI,EAGP,OAAOC,CAAM,EAAE,cAAc,CAC3B,YAAa,EACf,CAAC,CACH,CAAC,EAED,GAAG,0CAA2C,IAAM,CAElDD,EAAQ,sBAAsB,oBAAoB,CAChD,iBAAkB,yBAAuB,UACzC,aAAc,eAAa,SAC7B,CAAuB,EAGvB,MAAMC,EAAS,IAAI,yBAAuBD,EAAS,CACjD,YAAa,CAAC,CAAE,MAAO,IAAK,CAAC,CAC/B,CAAC,EAAE,IAAI,EAGP,OAAOC,CAAM,EAAE,cAAc,CAC3B,MAAO,IAAI,iBAAe,sBAAsB,CAClD,CAAC,CACH,CAAC,EAED,GAAG,8CAA+C,IAAM,CAEtDD,EAAQ,sBAAsB,oBAAoB,CAChD,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,CAClB,CAAkC,EAGlC,MAAMC,EAAS,IAAI,yBAAuBD,EAAS,CACjD,YAAa,CAAC,CAAE,MAAO,IAAK,CAAC,CAC/B,CAAC,EAAE,IAAI,EAGP,OAAOC,CAAM,EAAE,cAAc,CAC3B,MAAO,IAAI,iBAAe,6BAA6B,CACzD,CAAC,CACH,CAAC,CACH,CAAC",
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=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var fe=Object.prototype.hasOwnProperty;var ce=(t,r)=>{for(var p in r)A(t,p,{get:r[p],enumerable:!0})},d=(t,r,p,D)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of se(r))!fe.call(t,a)&&a!==p&&A(t,a,{get:()=>r[a],enumerable:!(D=ae(r,a))||D.enumerable});return t},o=(t,r,p)=>(d(t,r,"default"),p&&d(p,r,"default"));var xe=t=>d(A({},"__esModule",{value:!0}),t);var e={};ce(e,{APDU_MAX_PAYLOAD:()=>s.APDU_MAX_PAYLOAD,Apdu:()=>u.Apdu,ApduBuilder:()=>s.ApduBuilder,ApduParser:()=>l.ApduParser,ApduResponse:()=>q.ApduResponse,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>K.BleDeviceInfos,ByteArrayBuilder:()=>v.ByteArrayBuilder,ByteArrayParser:()=>S.ByteArrayParser,CallTaskInAppDeviceAction:()=>h.CallTaskInAppDeviceAction,CloseAppCommand:()=>y.CloseAppCommand,CommandResultFactory:()=>i.CommandResultFactory,CommandResultStatus:()=>i.CommandResultStatus,CommandUtils:()=>M.CommandUtils,ConnectedDevice:()=>pe.ConnectedDevice,ConsoleLogger:()=>re.ConsoleLogger,DeviceActionStatus:()=>b.DeviceActionStatus,DeviceConnectionStateMachine:()=>ie.DeviceConnectionStateMachine,DeviceManagementKit:()=>$.DeviceManagementKit,DeviceManagementKitBuilder:()=>ee.DeviceManagementKitBuilder,DeviceModel:()=>m.DeviceModel,DeviceModelId:()=>m.DeviceModelId,DeviceSessionStateType:()=>w.DeviceSessionStateType,DeviceStatus:()=>I.DeviceStatus,FramerUtils:()=>Z.FramerUtils,GenuineCheckDeviceAction:()=>N.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>g.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceStatusDeviceAction:()=>U.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>L.GetOsVersionCommand,GlobalCommandError:()=>c.GlobalCommandError,GlobalCommandErrorHandler:()=>c.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>P.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>Y.InstallAppDeviceAction,InvalidStatusWordError:()=>C.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>m.LEDGER_VENDOR_ID,ListAppsCommand:()=>B.ListAppsCommand,ListAppsDeviceAction:()=>V.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>_.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>j.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>G.LoadCertificateCommand,LogLevel:()=>oe.LogLevel,OpenAppCommand:()=>R.OpenAppCommand,OpenAppDeviceAction:()=>k.OpenAppDeviceAction,SendCommandInAppDeviceAction:()=>H.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>F.StaticDeviceModelDataSource,TransportConnectedDevice:()=>me.TransportConnectedDevice,TransportDeviceModel:()=>X.TransportDeviceModel,UninstallAppDeviceAction:()=>z.UninstallAppDeviceAction,UnknownDAError:()=>O.UnknownDAError,UserInteractionRequired:()=>T.UserInteractionRequired,WebLogsExporterLogger:()=>te.WebLogsExporterLogger,XStateDeviceAction:()=>W.XStateDeviceAction,base64StringToBuffer:()=>x.base64StringToBuffer,bufferToHexaString:()=>n.bufferToHexaString,connectedDeviceStubBuilder:()=>ne.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>J.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>Q.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>n.hexaStringToBuffer,isBase64String:()=>x.isBase64String,isCommandErrorCode:()=>E.isCommandErrorCode,isHexaString:()=>n.isHexaString,isSuccessCommandResult:()=>i.isSuccessCommandResult});module.exports=xe(e);var u=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"),M=require("./command/utils/CommandUtils"),c=require("./command/utils/GlobalCommandError"),m=require("./device/DeviceModel"),I=require("./device/DeviceStatus"),b=require("./device-action/model/DeviceActionState"),T=require("./device-action/model/UserInteractionRequired"),h=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),O=require("./device-action/os/Errors"),U=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),P=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),V=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/InstallApp/InstallAppDeviceAction"),j=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),z=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),J=require("./device-session/service/DefaultApduReceiverService.stub"),Q=require("./device-session/service/DefaultApduSenderService.stub"),Z=require("./device-session/utils/FramerUtils"),$=require("./DeviceManagementKit"),ee=require("./DeviceManagementKitBuilder");o(e,require("./Error"),module.exports);var oe=require("./logger-subscriber/model/LogLevel"),re=require("./logger-subscriber/service/ConsoleLogger"),te=require("./logger-subscriber/service/WebLogsExporterLogger"),pe=require("./transport/model/ConnectedDevice"),ie=require("./transport/model/DeviceConnectionStateMachine");o(e,require("./transport/model/Errors"),module.exports);var me=require("./transport/model/TransportConnectedDevice"),ne=require("./transport/model/TransportConnectedDevice.stub");o(e,require("./types"),module.exports);var x=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,DeviceConnectionStateMachine,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,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 { 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\";\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,k5FAAAE,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,EAAuC,+EACvCC,EAA8C,6FAC9CC,EAAyC,mFAEzCC,EAAsD,uEACtDC,EAAoD,qEACpDC,EAA4B,iDAC5BC,EAAoC,oCACpCC,GAA2C,2CAC3CvC,EAAAN,EAAc,sBA7Fd,gBA8FA,IAAA8C,GAAyB,iDACzBC,GAA8B,wDAC9BC,GAAsC,gEACtCC,GAAgC,gDAChCC,GAGO,6DACP5C,EAAAN,EAAc,uCAtGd,gBAuGA,IAAAmD,GAAyC,yDACzCA,GAA2C,8DAC3C7C,EAAAN,EAAc,sBAzGd,gBA0GA,IAAAoD,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_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"]
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 m=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var M=(r,n)=>{for(var s in n)m(r,s,{get:n[s],enumerable:!0})},C=(r,n,s,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of T(n))!k.call(r,o)&&o!==s&&m(r,o,{get:()=>n[o],enumerable:!(p=O(n,o))||p.enumerable});return r};var N=r=>C(m({},"__esModule",{value:!0}),r);var R={};M(R,{InstallAppDeviceAction:()=>G});module.exports=N(R);var d=require("purify-ts"),a=require("xstate"),I=require("../../../command/model/CommandResult"),g=require("../../../command/os/GetOsVersionCommand"),h=require("../../../device-action/model/UserInteractionRequired"),D=require("../../../device-action/os/Const"),S=require("../../../device-action/os/Errors"),v=require("../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),f=require("../../../device-action/xstate-utils/XStateDeviceAction"),x=require("../../../device-session/DeviceSessionState"),y=require("../../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),V=require("../../../secure-channel/task/ConnectToSecureChannelTask"),E=require("../../../secure-channel/task/types");class G extends f.XStateDeviceAction{makeStateMachine(n){const{getOsVersion:s,getAppList:p,installApp:o,getDeviceSessionState:i,setDeviceSessionState:l}=this.extractDependencies(n),u=this.input.unlockTimeout??D.DEFAULT_UNLOCK_TIMEOUT_MS,A=new y.ListInstalledAppsDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n),L=new v.GoToDashboardDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n);return(0,a.setup)({types:{input:{},context:{},output:{}},actors:{listInstalledApps:A,goToDashboard:L,getOsVersion:(0,a.fromPromise)(s),getAppList:(0,a.fromPromise)(p),installApp:(0,a.fromObservable)(o)},guards:{hasError:t=>t.context._internalState.error!==null,appInstalled:t=>t.context._internalState.installedApps.some(e=>e.name===t.context.input.appName),appNotFound:t=>t.context._internalState.appList.findIndex(({versionName:e})=>e===t.context.input.appName)===-1,depAppNotInstalled:t=>{const e=t.context._internalState.appList.find(({versionName:c})=>c===t.context.input.appName);return e?.parentName?t.context._internalState.installedApps.findIndex(({name:c})=>c===e.parentName)===-1:!1}},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:t.event.error})}),assignAppNotFound:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new S.UnknownDAError("App to install not found in manager API")})}),assignDepAppNotInstalled:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new S.UnknownDAError("Dep app is not installed on the device")})})}}).createMachine({id:"InstallAppDeviceAction",initial:"DeviceReady",context:t=>({input:{unlockTimeout:t.input.unlockTimeout,appName:t.input.appName},intermediateValue:{requiredUserInteraction:h.UserInteractionRequired.None,progress:0},_internalState:{error:null,installedApps:[],getOsVersionResponse:null,appList:[]}}),states:{DeviceReady:{always:{target:"ListInstalledApps"}},ListInstalledApps:{value:"ListInstalledApps",invoke:{id:"listInstalledApps",src:"listInstalledApps",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"ListInstalledAppsCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:({installedApps:e})=>({...t.context._internalState,installedApps:e}),Left:e=>({...t.context._internalState,error:e})})})}}},ListInstalledAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success",guard:"appInstalled"},{target:"GoToDashboard"}]},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:()=>t.context._internalState,Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetOsVersion"}]},GetOsVersion:{invoke:{id:"getOsVersion",src:"getOsVersion",input:t=>{},onDone:{target:"GetOsVersionCheck",actions:(0,a.assign)({_internalState:t=>{if((0,I.isSuccessCommandResult)(t.event.output)){const e=i(),c=t.event.output.data.secureElementFlags.isSecureConnectionAllowed;return e.sessionStateType!==x.DeviceSessionStateType.Connected&&l({...e,isSecureConnectionAllowed:c}),{...t.context._internalState,getOsVersionResponse:t.event.output.data}}return{...t.context._internalState,error:t.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetAppList"}]},GetAppList:{invoke:{id:"getAppList",src:"getAppList",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse}),onDone:{target:"GetAppListCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:e=>({...t.context._internalState,appList:e}),Left:e=>({...t.context._internalState,error:e})})})}}},GetAppListCheck:{always:[{target:"Error",guard:"hasError"},{target:"Error",guard:"appNotFound",actions:"assignAppNotFound"},{target:"Error",guard:"depAppNotInstalled",actions:"assignDepAppNotInstalled"},{target:"InstallApp"}]},InstallApp:{invoke:{id:"installApp",src:"installApp",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse,app:t.context._internalState.appList.find(({versionName:e})=>e===t.context.input.appName)}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>t.event.snapshot.context?.type===E.SecureChannelEventType.Progress?{...t.context.intermediateValue,progress:t.event.snapshot.context.payload.progress}:{...t.context.intermediateValue}})},onDone:{target:"ListInstalledApps"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},Success:{type:"final",description:"App installed successfully"},Error:{type:"final"}},output:({context:t})=>t._internalState.error?(0,d.Left)(t._internalState.error):(0,d.Right)(void 0)})}extractDependencies(n){return{getOsVersion:()=>n.sendCommand(new g.GetOsVersionCommand),getAppList:({input:i})=>{const{deviceInfo:l}=i;return n.getManagerApiService().getAppList(l)},installApp:({input:i})=>{const{deviceInfo:l,app:u}=i,A=n.getSecureChannelService().installApp(l,u);return new V.ConnectToSecureChannelTask(n,{connection:A}).run()},getDeviceSessionState:()=>n.getDeviceSessionState(),setDeviceSessionState:i=>n.setDeviceSessionState(i)}}}0&&(module.exports={InstallAppDeviceAction});
1
+ "use strict";var S=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var M=(r,n)=>{for(var i in n)S(r,i,{get:n[i],enumerable:!0})},C=(r,n,i,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of O(n))!k.call(r,o)&&o!==i&&S(r,o,{get:()=>n[o],enumerable:!(l=L(n,o))||l.enumerable});return r};var N=r=>C(S({},"__esModule",{value:!0}),r);var R={};M(R,{InstallAppDeviceAction:()=>G});module.exports=N(R);var d=require("purify-ts"),a=require("xstate"),g=require("../../../command/model/CommandResult"),h=require("../../../command/os/GetOsVersionCommand"),D=require("../../../device-action/model/UserInteractionRequired"),v=require("../../../device-action/os/Const"),m=require("../../../device-action/os/Errors"),f=require("../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),x=require("../../../device-action/xstate-utils/XStateDeviceAction"),I=require("../../../device-session/DeviceSessionState"),y=require("../../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),V=require("../../../secure-channel/task/ConnectToSecureChannelTask"),E=require("../../../secure-channel/task/types");class G extends x.XStateDeviceAction{makeStateMachine(n){const{getOsVersion:i,getAppList:l,installApp:o,getDeviceSessionState:s,setDeviceSessionState:p}=this.extractDependencies(n),u=this.input.unlockTimeout??v.DEFAULT_UNLOCK_TIMEOUT_MS,A=new y.ListInstalledAppsDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n),T=new f.GoToDashboardDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n);return(0,a.setup)({types:{input:{},context:{},output:{}},actors:{listInstalledApps:A,goToDashboard:T,getOsVersion:(0,a.fromPromise)(i),getAppList:(0,a.fromPromise)(l),installApp:(0,a.fromObservable)(o)},guards:{hasError:t=>t.context._internalState.error!==null,appInstalled:t=>t.context._internalState.installedApps.some(e=>e.name===t.context.input.appName),appNotFound:t=>t.context._internalState.appList.findIndex(({versionName:e})=>e===t.context.input.appName)===-1,depAppNotInstalled:t=>{const e=t.context._internalState.appList.find(({versionName:c})=>c===t.context.input.appName);return e?.parentName?t.context._internalState.installedApps.findIndex(({name:c})=>c===e.parentName)===-1:!1}},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:t.event.error})}),assignAppNotFound:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new m.UnknownDAError("App to install not found in manager API")})}),assignDepAppNotInstalled:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new m.UnknownDAError("Dep app is not installed on the device")})}),cleanupDeviceState:()=>{const t=s();t.sessionStateType!==I.DeviceSessionStateType.Connected&&p({...t,installedApps:[],appsUpdates:void 0})}}}).createMachine({id:"InstallAppDeviceAction",initial:"DeviceReady",context:t=>({input:{unlockTimeout:t.input.unlockTimeout,appName:t.input.appName},intermediateValue:{requiredUserInteraction:D.UserInteractionRequired.None,progress:0},_internalState:{error:null,installedApps:[],getOsVersionResponse:null,appList:[]}}),states:{DeviceReady:{always:{target:"ListInstalledApps"}},ListInstalledApps:{value:"ListInstalledApps",invoke:{id:"listInstalledApps",src:"listInstalledApps",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"ListInstalledAppsCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:({installedApps:e})=>({...t.context._internalState,installedApps:e}),Left:e=>({...t.context._internalState,error:e})})})}}},ListInstalledAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success",guard:"appInstalled"},{target:"GoToDashboard"}]},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:()=>t.context._internalState,Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetOsVersion"}]},GetOsVersion:{invoke:{id:"getOsVersion",src:"getOsVersion",input:t=>{},onDone:{target:"GetOsVersionCheck",actions:(0,a.assign)({_internalState:t=>{if((0,g.isSuccessCommandResult)(t.event.output)){const e=s(),c=t.event.output.data.secureElementFlags.isSecureConnectionAllowed;return e.sessionStateType!==I.DeviceSessionStateType.Connected&&p({...e,isSecureConnectionAllowed:c}),{...t.context._internalState,getOsVersionResponse:t.event.output.data}}return{...t.context._internalState,error:t.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetAppList"}]},GetAppList:{invoke:{id:"getAppList",src:"getAppList",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse}),onDone:{target:"GetAppListCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:e=>({...t.context._internalState,appList:e}),Left:e=>({...t.context._internalState,error:e})})})}}},GetAppListCheck:{always:[{target:"Error",guard:"hasError"},{target:"Error",guard:"appNotFound",actions:"assignAppNotFound"},{target:"Error",guard:"depAppNotInstalled",actions:"assignDepAppNotInstalled"},{target:"InstallApp"}]},InstallApp:{invoke:{id:"installApp",src:"installApp",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse,app:t.context._internalState.appList.find(({versionName:e})=>e===t.context.input.appName)}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>t.event.snapshot.context?.type===E.SecureChannelEventType.Progress?{...t.context.intermediateValue,progress:t.event.snapshot.context.payload.progress}:{...t.context.intermediateValue}})},onDone:{target:"ListInstalledApps",actions:"cleanupDeviceState"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},Success:{type:"final",description:"App installed successfully"},Error:{type:"final"}},output:({context:t})=>t._internalState.error?(0,d.Left)(t._internalState.error):(0,d.Right)(void 0)})}extractDependencies(n){return{getOsVersion:()=>n.sendCommand(new h.GetOsVersionCommand),getAppList:({input:s})=>{const{deviceInfo:p}=s;return n.getManagerApiService().getAppList(p)},installApp:({input:s})=>{const{deviceInfo:p,app:u}=s,A=n.getSecureChannelService().installApp(p,u);return new V.ConnectToSecureChannelTask(n,{connection:A}).run()},getDeviceSessionState:()=>n.getDeviceSessionState(),setDeviceSessionState:s=>n.setDeviceSessionState(s)}}}0&&(module.exports={InstallAppDeviceAction});
2
2
  //# sourceMappingURL=InstallAppDeviceAction.js.map