@ledgerhq/device-management-kit 0.0.0-fix-rn-ble-20250502084951 → 0.0.0-hid-candidate-20250523130730

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 (482) hide show
  1. package/lib/cjs/package.json +22 -23
  2. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  3. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +2 -2
  4. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
  5. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
  6. package/lib/cjs/src/api/DmkConfig.js +1 -1
  7. package/lib/cjs/src/api/DmkConfig.js.map +1 -1
  8. package/lib/cjs/src/api/command/di/commandModule.js +1 -1
  9. package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
  10. package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
  11. package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
  12. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  13. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  14. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  15. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  16. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  17. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  18. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  19. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  20. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
  21. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  22. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  23. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  24. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  25. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  26. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  27. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  28. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  29. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  30. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  31. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  32. package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
  33. package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
  34. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
  35. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  36. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  37. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  38. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  39. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  40. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
  41. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  42. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  43. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  44. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  45. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  46. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  47. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +2 -0
  48. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  49. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
  50. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
  51. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  52. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  53. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  54. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  55. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
  56. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  57. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  58. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  59. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  60. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  61. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  62. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  63. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
  64. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  65. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  66. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  67. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  68. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  69. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  70. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  71. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  72. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  73. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  74. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  75. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  76. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  77. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  78. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  79. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  80. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  81. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  82. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  83. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  84. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  85. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  86. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  87. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  88. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  89. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
  90. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
  91. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  92. package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
  93. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
  94. package/lib/cjs/src/api/index.js +1 -1
  95. package/lib/cjs/src/api/index.js.map +3 -3
  96. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  97. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  98. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  99. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  100. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  101. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  102. package/lib/cjs/src/api/types.js +1 -1
  103. package/lib/cjs/src/api/types.js.map +1 -1
  104. package/lib/cjs/src/di.js +1 -1
  105. package/lib/cjs/src/di.js.map +2 -2
  106. package/lib/cjs/src/internal/config/di/configModule.js +1 -1
  107. package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
  108. package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
  109. package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
  110. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
  111. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  112. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  113. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  114. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
  115. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  116. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  117. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  118. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  119. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +2 -2
  120. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  121. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  122. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  123. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
  124. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  125. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  126. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  127. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  128. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  129. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  130. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  131. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  132. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
  133. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  134. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  135. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  136. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  137. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  138. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  139. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  140. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
  141. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  142. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  143. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  144. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  145. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  146. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  147. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  148. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  149. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  150. package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
  151. package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
  152. package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
  153. package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
  154. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  155. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  156. package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
  157. package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
  158. package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
  159. package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
  160. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  161. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  162. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  163. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  164. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
  165. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
  166. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +1 -1
  167. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +3 -3
  168. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +1 -1
  169. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +3 -3
  170. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  171. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  172. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  173. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  174. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  175. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  176. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  177. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  178. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +1 -1
  179. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +1 -1
  180. package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
  181. package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
  182. package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
  183. package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
  184. package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
  185. package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
  186. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  187. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  188. package/lib/esm/package.json +22 -23
  189. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  190. package/lib/esm/src/api/DeviceManagementKit.test.js.map +2 -2
  191. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  192. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  193. package/lib/esm/src/api/command/di/commandModule.js +1 -1
  194. package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
  195. package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
  196. package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
  197. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  198. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  199. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  200. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  201. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  202. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  203. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  204. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  205. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
  206. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  207. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  208. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  209. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  210. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  211. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  212. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  213. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  214. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  215. package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
  216. package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
  217. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
  218. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  219. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  220. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  221. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  222. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  223. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  224. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  225. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  226. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  227. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  228. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  229. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  230. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  231. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  232. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  233. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  234. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  235. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  236. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  237. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  238. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  239. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  240. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  241. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  242. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  243. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  244. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  245. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  246. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  247. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  248. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  249. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  250. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  251. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  252. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  253. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  254. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  255. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  256. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  257. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  258. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  259. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  260. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  261. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  262. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  263. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  264. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  265. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  266. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  267. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  268. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  269. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  270. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  271. package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
  272. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  273. package/lib/esm/src/api/index.js +1 -1
  274. package/lib/esm/src/api/index.js.map +3 -3
  275. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  276. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  277. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  278. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  279. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  280. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  281. package/lib/esm/src/di.js +1 -1
  282. package/lib/esm/src/di.js.map +3 -3
  283. package/lib/esm/src/internal/config/di/configModule.js +1 -1
  284. package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
  285. package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
  286. package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
  287. package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
  288. package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  289. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  290. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  291. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
  292. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  293. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  294. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  295. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  296. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +2 -2
  297. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  298. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  299. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  300. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
  301. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  302. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  303. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  304. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  305. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  306. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  307. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  308. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  309. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
  310. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  311. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  312. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  313. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  314. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  315. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  316. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  317. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  318. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  319. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  320. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  321. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  322. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  323. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  324. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  325. package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
  326. package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
  327. package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
  328. package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
  329. package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
  330. package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
  331. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  332. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  333. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  334. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  335. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +1 -1
  336. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +3 -3
  337. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +1 -1
  338. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +3 -3
  339. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  340. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  341. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  342. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  343. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  344. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  345. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  346. package/lib/esm/src/internal/send/di/sendModule.js +1 -1
  347. package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
  348. package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
  349. package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
  350. package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
  351. package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
  352. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  353. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  354. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  355. package/lib/types/src/api/DmkConfig.d.ts +1 -0
  356. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  357. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  358. package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
  359. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
  360. package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
  361. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
  362. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
  363. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
  364. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
  365. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +30 -2
  366. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  367. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
  368. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
  369. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
  370. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
  371. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  372. package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
  373. package/lib/types/src/api/device-action/DeviceAction.d.ts +2 -0
  374. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  375. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  376. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +5 -0
  377. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  378. package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
  379. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +1 -1
  380. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  381. package/lib/types/src/api/device-action/os/Errors.d.ts +10 -0
  382. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  383. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts +58 -0
  384. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
  385. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
  386. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
  387. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +27 -0
  388. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
  389. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
  390. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  391. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
  392. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
  393. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
  394. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
  395. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +64 -0
  396. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
  397. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
  398. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
  399. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
  400. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
  401. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +25 -0
  402. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
  403. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -1
  404. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  405. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
  406. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
  407. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
  408. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
  409. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
  410. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
  411. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
  412. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
  413. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
  414. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
  415. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
  416. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
  417. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
  418. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
  419. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
  420. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
  421. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  422. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
  423. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  424. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  425. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +93 -0
  426. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  427. package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
  428. package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
  429. package/lib/types/src/api/index.d.ts +5 -1
  430. package/lib/types/src/api/index.d.ts.map +1 -1
  431. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -1
  432. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
  433. package/lib/types/src/api/transport/model/Errors.d.ts +5 -0
  434. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  435. package/lib/types/src/api/types.d.ts +4 -1
  436. package/lib/types/src/api/types.d.ts.map +1 -1
  437. package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
  438. package/lib/types/src/di.d.ts.map +1 -1
  439. package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
  440. package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
  441. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  442. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +1 -0
  443. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  444. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  445. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -1
  446. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -1
  447. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  448. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
  449. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +20 -4
  450. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  451. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +41 -6
  452. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  453. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +104 -18
  454. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
  455. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +5 -0
  456. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  457. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  458. package/lib/types/src/internal/manager-api/model/Application.d.ts +12 -12
  459. package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
  460. package/lib/types/src/internal/manager-api/model/Const.d.ts +1 -0
  461. package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
  462. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +17 -3
  463. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  464. package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
  465. package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
  466. package/lib/types/src/internal/manager-api/model/Params.d.ts +20 -0
  467. package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
  468. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +7 -1
  469. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  470. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +39 -1
  471. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  472. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +3 -1
  473. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -1
  474. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
  475. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +2 -2
  476. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -1
  477. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +3 -3
  478. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -1
  479. package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
  480. package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
  481. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  482. package/package.json +14 -15
@@ -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,OAAS,gBAAAA,MAAoB,2BAC7B,OAAS,mCAAAC,MAAuC,oDAChD,OAAS,kBAAAC,MAAsB,+BAG/B,OAAS,0BAAAC,MAA8B,yCAIvC,OAAS,0BAAAC,MAA8B,2BAEvC,SAAS,yBAA0B,IAAM,CACvC,MAAMC,EAAUJ,EAAgC,EAEhD,WAAW,IAAM,CACf,GAAG,cAAc,EACjBI,EAAQ,eAAe,gBAAgB,CACrC,WAAY,QACZ,UAAW,EACb,CAAoC,CACtC,CAAC,EAED,GAAG,wBAAyB,IAAM,CAEhCA,EAAQ,sBAAsB,oBAAoB,CAChD,iBAAkBF,EAAuB,0BACzC,aAAcH,EAAa,UAC3B,sBAAuB,CACrB,gBAAiB,CAAE,MAAO,MAAO,CACnC,EACA,YAAa,CAAE,KAAM,KAAM,EAC3B,cAAe,CACb,CAAE,MAAO,MAAO,EAChB,C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,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,iBAAkBF,EAAuB,UACzC,aAAcH,EAAa,SAC7B,CAAuB,EAGvB,MAAMM,EAAS,IAAIF,EAAuBC,EAAS,CACjD,YAAa,CAAC,CAAE,MAAO,IAAK,CAAC,CAC/B,CAAC,EAAE,IAAI,EAGP,OAAOC,CAAM,EAAE,cAAc,CAC3B,MAAO,IAAIJ,EAAe,sBAAsB,CAClD,CAAC,CACH,CAAC,EAED,GAAG,8CAA+C,IAAM,CAEtDG,EAAQ,sBAAsB,oBAAoB,CAChD,iBAAkBF,EAAuB,0BACzC,aAAcH,EAAa,UAC3B,cAAe,CAAC,CAClB,CAAkC,EAGlC,MAAMM,EAAS,IAAIF,EAAuBC,EAAS,CACjD,YAAa,CAAC,CAAE,MAAO,IAAK,CAAC,CAC/B,CAAC,EAAE,IAAI,EAGP,OAAOC,CAAM,EAAE,cAAc,CAC3B,MAAO,IAAIJ,EAAe,6BAA6B,CACzD,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["DeviceStatus", "makeDeviceActionInternalApiMock", "UnknownDAError", "DeviceSessionStateType", "PredictOutOfMemoryTask", "apiMock", "result"]
7
+ }
@@ -1,2 +1,2 @@
1
- var n=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var f=(u,e,d)=>e in u?n(u,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):u[e]=d;var m=(u,e,d,s)=>{for(var r=s>1?void 0:s?b(e,d):e,t=u.length-1,l;t>=0;t--)(l=u[t])&&(r=(s?l(e,d,r):l(r))||r);return s&&r&&n(e,d,r),r};var v=(u,e,d)=>f(u,typeof e!="symbol"?e+"":e,d);import{injectable as p}from"inversify";import{DeviceModelId as o}from"../../device/DeviceModel";import{BleDeviceInfos as I}from"../../device-model/model/BleDeviceInfos";import{TransportDeviceModel as c}from"../../device-model/model/DeviceModel";let i=class{getAllDeviceModels(){return Object.values(i.deviceModelByIds)}getDeviceModel(e){return i.deviceModelByIds[e.id]}filterDeviceModels(e){return this.getAllDeviceModels().filter(d=>Object.entries(e).every(([s,r])=>d[s]===r))}getBluetoothServicesInfos(){return Object.values(i.deviceModelByIds).reduce((e,d)=>{const{bluetoothSpec:s}=d;return s?{...e,...s.reduce((r,t)=>({...r,[t.serviceUuid]:new I(d,t.serviceUuid,t.writeUuid,t.writeCmdUuid,t.notifyUuid)}),{})}:e},{})}getBluetoothServices(){return Object.values(i.deviceModelByIds).map(e=>(e.bluetoothSpec||[]).map(d=>d.serviceUuid)).flat().filter(e=>!!e)}};v(i,"deviceModelByIds",{[o.NANO_S]:new c({id:o.NANO_S,productName:"Ledger Nano S",usbProductId:16,bootloaderUsbProductId:1,usbOnly:!0,memorySize:320*1024,masks:[823132160]}),[o.NANO_SP]:new c({id:o.NANO_SP,productName:"Ledger Nano S Plus",usbProductId:80,bootloaderUsbProductId:5,usbOnly:!0,memorySize:1533*1024,masks:[856686592]}),[o.NANO_X]:new c({id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]}),[o.STAX]:new c({id:o.STAX,productName:"Ledger Stax",usbProductId:96,bootloaderUsbProductId:6,usbOnly:!1,memorySize:1533*1024,masks:[857735168],bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]}),[o.FLEX]:new c({id:o.FLEX,productName:"Ledger Flex",usbProductId:112,bootloaderUsbProductId:7,usbOnly:!1,memorySize:1533*1024,masks:[858783744],bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]})}),i=m([p()],i);export{i as StaticDeviceModelDataSource};
1
+ var n=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var f=(c,e,d)=>e in c?n(c,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):c[e]=d;var m=(c,e,d,s)=>{for(var r=s>1?void 0:s?v(e,d):e,t=c.length-1,l;t>=0;t--)(l=c[t])&&(r=(s?l(e,d,r):l(r))||r);return s&&r&&n(e,d,r),r};var b=(c,e,d)=>f(c,typeof e!="symbol"?e+"":e,d);import{injectable as p}from"inversify";import{DeviceModelId as o}from"../../device/DeviceModel";import{BleDeviceInfos as I}from"../../device-model/model/BleDeviceInfos";import{TransportDeviceModel as u}from"../../device-model/model/DeviceModel";let i=class{getAllDeviceModels(){return Object.values(i.deviceModelByIds)}getDeviceModel(e){return i.deviceModelByIds[e.id]}filterDeviceModels(e){return this.getAllDeviceModels().filter(d=>Object.entries(e).every(([s,r])=>d[s]===r))}getBluetoothServicesInfos(){return Object.values(i.deviceModelByIds).reduce((e,d)=>{const{bluetoothSpec:s}=d;return s?{...e,...s.reduce((r,t)=>({...r,[t.serviceUuid]:new I(d,t.serviceUuid,t.writeUuid,t.writeCmdUuid,t.notifyUuid)}),{})}:e},{})}getBluetoothServices(){return Object.values(i.deviceModelByIds).map(e=>(e.bluetoothSpec||[]).map(d=>d.serviceUuid)).flat().filter(e=>!!e)}};b(i,"deviceModelByIds",{[o.NANO_S]:new u({id:o.NANO_S,productName:"Ledger Nano S",usbProductId:16,bootloaderUsbProductId:1,usbOnly:!0,memorySize:320*1024,blockSize:4*1024,masks:[823132160]}),[o.NANO_SP]:new u({id:o.NANO_SP,productName:"Ledger Nano S Plus",usbProductId:80,bootloaderUsbProductId:5,usbOnly:!0,memorySize:1533*1024,blockSize:32,masks:[856686592]}),[o.NANO_X]:new u({id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,blockSize:4*1024,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]}),[o.STAX]:new u({id:o.STAX,productName:"Ledger Stax",usbProductId:96,bootloaderUsbProductId:6,usbOnly:!1,memorySize:1533*1024,blockSize:32,masks:[857735168],bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]}),[o.FLEX]:new u({id:o.FLEX,productName:"Ledger Flex",usbProductId:112,bootloaderUsbProductId:7,usbOnly:!1,memorySize:1533*1024,blockSize:32,masks:[858783744],bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]})}),i=m([p()],i);export{i as StaticDeviceModelDataSource};
2
2
  //# sourceMappingURL=StaticDeviceModelDataSource.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/data/StaticDeviceModelDataSource.ts"],
4
- "sourcesContent": ["import { injectable } from \"inversify\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nimport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\n/**\n * Static/in memory implementation of the device model data source\n */\n@injectable()\nexport class StaticDeviceModelDataSource implements DeviceModelDataSource {\n private static deviceModelByIds: {\n [_key in DeviceModelId]: TransportDeviceModel;\n } = {\n [DeviceModelId.NANO_S]: new TransportDeviceModel({\n id: DeviceModelId.NANO_S,\n productName: \"Ledger Nano S\",\n usbProductId: 0x10,\n bootloaderUsbProductId: 0x0001,\n usbOnly: true,\n memorySize: 320 * 1024,\n masks: [0x31100000],\n }),\n [DeviceModelId.NANO_SP]: new TransportDeviceModel({\n id: DeviceModelId.NANO_SP,\n productName: \"Ledger Nano S Plus\",\n usbProductId: 0x50,\n bootloaderUsbProductId: 0x0005,\n usbOnly: true,\n memorySize: 1533 * 1024,\n masks: [0x33100000],\n }),\n [DeviceModelId.NANO_X]: new TransportDeviceModel({\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.STAX]: new TransportDeviceModel({\n id: DeviceModelId.STAX,\n productName: \"Ledger Stax\",\n usbProductId: 0x60,\n bootloaderUsbProductId: 0x0006,\n usbOnly: false,\n memorySize: 1533 * 1024,\n masks: [0x33200000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-6004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-6004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-6004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-6004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.FLEX]: new TransportDeviceModel({\n id: DeviceModelId.FLEX,\n productName: \"Ledger Flex\",\n usbProductId: 0x70,\n bootloaderUsbProductId: 0x0007,\n usbOnly: false,\n memorySize: 1533 * 1024,\n masks: [0x33300000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-3004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-3004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-3004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-3004-0003-4c6564676572\",\n },\n ],\n }),\n };\n\n getAllDeviceModels(): TransportDeviceModel[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds);\n }\n\n getDeviceModel(params: { id: DeviceModelId }): TransportDeviceModel {\n return StaticDeviceModelDataSource.deviceModelByIds[params.id];\n }\n\n /**\n * Returns the list of device models that match all the given parameters\n */\n filterDeviceModels(\n params: Partial<TransportDeviceModel>,\n ): TransportDeviceModel[] {\n return this.getAllDeviceModels().filter((deviceModel) => {\n return Object.entries(params).every(([key, value]) => {\n return deviceModel[key as keyof TransportDeviceModel] === value;\n });\n });\n }\n\n getBluetoothServicesInfos(): Record<string, BleDeviceInfos> {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds).reduce<\n Record<string, BleDeviceInfos>\n >((acc, deviceModel) => {\n const { bluetoothSpec } = deviceModel;\n if (bluetoothSpec) {\n return {\n ...acc,\n ...bluetoothSpec.reduce<Record<string, BleDeviceInfos>>(\n (serviceToModel, bleSpec) => ({\n ...serviceToModel,\n [bleSpec.serviceUuid]: new BleDeviceInfos(\n deviceModel,\n bleSpec.serviceUuid,\n bleSpec.writeUuid,\n bleSpec.writeCmdUuid,\n bleSpec.notifyUuid,\n ),\n }),\n {},\n ),\n };\n }\n return acc;\n }, {});\n }\n\n getBluetoothServices(): string[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds)\n .map((deviceModel) =>\n (deviceModel.bluetoothSpec || []).map((spec) => spec.serviceUuid),\n )\n .flat()\n .filter((uuid) => !!uuid);\n }\n}\n"],
5
- "mappings": "gVAAA,OAAS,cAAAA,MAAkB,YAE3B,OAAS,iBAAAC,MAAqB,0BAE9B,OAAS,kBAAAC,MAAsB,yCAC/B,OAAS,wBAAAC,MAA4B,sCAM9B,IAAMC,EAAN,KAAmE,CA2ExE,oBAA6C,CAC3C,OAAO,OAAO,OAAOA,EAA4B,gBAAgB,CACnE,CAEA,eAAeC,EAAqD,CAClE,OAAOD,EAA4B,iBAAiBC,EAAO,EAAE,CAC/D,CAKA,mBACEA,EACwB,CACxB,OAAO,KAAK,mBAAmB,EAAE,OAAQC,GAChC,OAAO,QAAQD,CAAM,EAAE,MAAM,CAAC,CAACE,EAAKC,CAAK,IACvCF,EAAYC,CAAiC,IAAMC,CAC3D,CACF,CACH,CAEA,2BAA4D,CAC1D,OAAO,OAAO,OAAOJ,EAA4B,gBAAgB,EAAE,OAEjE,CAACK,EAAKH,IAAgB,CACtB,KAAM,CAAE,cAAAI,CAAc,EAAIJ,EAC1B,OAAII,EACK,CACL,GAAGD,EACH,GAAGC,EAAc,OACf,CAACC,EAAgBC,KAAa,CAC5B,GAAGD,EACH,CAACC,EAAQ,WAAW,EAAG,IAAIC,EACzBP,EACAM,EAAQ,YACRA,EAAQ,UACRA,EAAQ,aACRA,EAAQ,UACV,CACF,GACA,CAAC,CACH,CACF,EAEKH,CACT,EAAG,CAAC,CAAC,CACP,CAEA,sBAAiC,CAC/B,OAAO,OAAO,OAAOL,EAA4B,gBAAgB,EAC9D,IAAKE,IACHA,EAAY,eAAiB,CAAC,GAAG,IAAKQ,GAASA,EAAK,WAAW,CAClE,EACC,KAAK,EACL,OAAQC,GAAS,CAAC,CAACA,CAAI,CAC5B,CACF,EAlIEC,EADWZ,EACI,mBAEX,CACF,CAACa,EAAc,MAAM,EAAG,IAAIC,EAAqB,CAC/C,GAAID,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,IAAM,KAClB,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAACA,EAAc,OAAO,EAAG,IAAIC,EAAqB,CAChD,GAAID,EAAc,QAClB,YAAa,qBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAACA,EAAc,MAAM,EAAG,IAAIC,EAAqB,CAC/C,GAAID,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,IACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,CACH,GAzEWb,EAANe,EAAA,CADNC,EAAW,GACChB",
4
+ "sourcesContent": ["import { injectable } from \"inversify\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nimport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\n/**\n * Static/in memory implementation of the device model data source\n */\n@injectable()\nexport class StaticDeviceModelDataSource implements DeviceModelDataSource {\n private static deviceModelByIds: {\n [_key in DeviceModelId]: TransportDeviceModel;\n } = {\n [DeviceModelId.NANO_S]: new TransportDeviceModel({\n id: DeviceModelId.NANO_S,\n productName: \"Ledger Nano S\",\n usbProductId: 0x10,\n bootloaderUsbProductId: 0x0001,\n usbOnly: true,\n memorySize: 320 * 1024,\n blockSize: 4 * 1024,\n masks: [0x31100000],\n }),\n [DeviceModelId.NANO_SP]: new TransportDeviceModel({\n id: DeviceModelId.NANO_SP,\n productName: \"Ledger Nano S Plus\",\n usbProductId: 0x50,\n bootloaderUsbProductId: 0x0005,\n usbOnly: true,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33100000],\n }),\n [DeviceModelId.NANO_X]: new TransportDeviceModel({\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n blockSize: 4 * 1024,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.STAX]: new TransportDeviceModel({\n id: DeviceModelId.STAX,\n productName: \"Ledger Stax\",\n usbProductId: 0x60,\n bootloaderUsbProductId: 0x0006,\n usbOnly: false,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33200000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-6004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-6004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-6004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-6004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.FLEX]: new TransportDeviceModel({\n id: DeviceModelId.FLEX,\n productName: \"Ledger Flex\",\n usbProductId: 0x70,\n bootloaderUsbProductId: 0x0007,\n usbOnly: false,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33300000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-3004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-3004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-3004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-3004-0003-4c6564676572\",\n },\n ],\n }),\n };\n\n getAllDeviceModels(): TransportDeviceModel[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds);\n }\n\n getDeviceModel(params: { id: DeviceModelId }): TransportDeviceModel {\n return StaticDeviceModelDataSource.deviceModelByIds[params.id];\n }\n\n /**\n * Returns the list of device models that match all the given parameters\n */\n filterDeviceModels(\n params: Partial<TransportDeviceModel>,\n ): TransportDeviceModel[] {\n return this.getAllDeviceModels().filter((deviceModel) => {\n return Object.entries(params).every(([key, value]) => {\n return deviceModel[key as keyof TransportDeviceModel] === value;\n });\n });\n }\n\n getBluetoothServicesInfos(): Record<string, BleDeviceInfos> {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds).reduce<\n Record<string, BleDeviceInfos>\n >((acc, deviceModel) => {\n const { bluetoothSpec } = deviceModel;\n if (bluetoothSpec) {\n return {\n ...acc,\n ...bluetoothSpec.reduce<Record<string, BleDeviceInfos>>(\n (serviceToModel, bleSpec) => ({\n ...serviceToModel,\n [bleSpec.serviceUuid]: new BleDeviceInfos(\n deviceModel,\n bleSpec.serviceUuid,\n bleSpec.writeUuid,\n bleSpec.writeCmdUuid,\n bleSpec.notifyUuid,\n ),\n }),\n {},\n ),\n };\n }\n return acc;\n }, {});\n }\n\n getBluetoothServices(): string[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds)\n .map((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a,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,IAAM,KAClB,UAAW,EAAI,KACf,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAACA,EAAc,OAAO,EAAG,IAAIC,EAAqB,CAChD,GAAID,EAAc,QAClB,YAAa,qBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,UAAW,GACX,MAAO,CAAC,SAAU,CACpB,CAAC,EACD,CAACA,EAAc,MAAM,EAAG,IAAIC,EAAqB,CAC/C,GAAID,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,UAAW,EAAI,KACf,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,UAAW,GACX,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,IACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,UAAW,GACX,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,CACH,GA9EWb,EAANe,EAAA,CADNC,EAAW,GACChB",
6
6
  "names": ["injectable", "DeviceModelId", "BleDeviceInfos", "TransportDeviceModel", "StaticDeviceModelDataSource", "params", "deviceModel", "key", "value", "acc", "bluetoothSpec", "serviceToModel", "bleSpec", "BleDeviceInfos", "spec", "uuid", "__publicField", "DeviceModelId", "TransportDeviceModel", "__decorateClass", "injectable"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import r from"semver";import{DeviceModelId as t}from"../../device/DeviceModel";class s{id;productName;usbProductId;bootloaderUsbProductId;usbOnly;memorySize;masks;bluetoothSpec;constructor(e){this.id=e.id,this.productName=e.productName,this.usbProductId=e.usbProductId,this.bootloaderUsbProductId=e.bootloaderUsbProductId,this.usbOnly=e.usbOnly,this.memorySize=e.memorySize,this.masks=e.masks,this.bluetoothSpec=e.bluetoothSpec}getBlockSize(e){switch(this.id){case t.NANO_S:return r.lt(r.coerce(e)??"","2.0.0")?4*1024:2*1024;case t.NANO_X:return 4*1024;case t.NANO_SP:case t.STAX:case t.FLEX:return 32}}}export{s as TransportDeviceModel};
1
+ import i from"semver";import{DeviceModelId as t}from"../../device/DeviceModel";class d{id;productName;usbProductId;bootloaderUsbProductId;usbOnly;memorySize;blockSize;masks;bluetoothSpec;constructor(e){this.id=e.id,this.productName=e.productName,this.usbProductId=e.usbProductId,this.bootloaderUsbProductId=e.bootloaderUsbProductId,this.usbOnly=e.usbOnly,this.memorySize=e.memorySize,this.blockSize=e.blockSize,this.masks=e.masks,this.bluetoothSpec=e.bluetoothSpec}getBlockSize(e){switch(this.id){case t.NANO_S:return i.lt(i.coerce(e)??"","2.0.0")?4*1024:2*1024;case t.NANO_X:return 4*1024;case t.NANO_SP:case t.STAX:case t.FLEX:return 32}}}export{d as TransportDeviceModel};
2
2
  //# sourceMappingURL=DeviceModel.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/model/DeviceModel.ts"],
4
- "sourcesContent": ["import semver from \"semver\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\n/**\n * The info of a device model\n */\nexport class TransportDeviceModel {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n masks: number[];\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n\n constructor(props: {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n masks: number[];\n\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n }) {\n this.id = props.id;\n this.productName = props.productName;\n this.usbProductId = props.usbProductId;\n this.bootloaderUsbProductId = props.bootloaderUsbProductId;\n this.usbOnly = props.usbOnly;\n this.memorySize = props.memorySize;\n this.masks = props.masks;\n this.bluetoothSpec = props.bluetoothSpec;\n }\n\n getBlockSize(firmwareVersion: string): number {\n switch (this.id) {\n case DeviceModelId.NANO_S:\n return semver.lt(semver.coerce(firmwareVersion) ?? \"\", \"2.0.0\")\n ? 4 * 1024\n : 2 * 1024;\n case DeviceModelId.NANO_X:\n return 4 * 1024;\n case DeviceModelId.NANO_SP:\n case DeviceModelId.STAX:\n case DeviceModelId.FLEX:\n return 32;\n }\n }\n}\n"],
5
- "mappings": "AAAA,OAAOA,MAAY,SAEnB,OAAS,iBAAAC,MAAqB,0BAKvB,MAAMC,CAAqB,CAChC,GACA,YACA,aACA,uBACA,QACA,WACA,MACA,cAOA,YAAYC,EAeT,CACD,KAAK,GAAKA,EAAM,GAChB,KAAK,YAAcA,EAAM,YACzB,KAAK,aAAeA,EAAM,aAC1B,KAAK,uBAAyBA,EAAM,uBACpC,KAAK,QAAUA,EAAM,QACrB,KAAK,WAAaA,EAAM,WACxB,KAAK,MAAQA,EAAM,MACnB,KAAK,cAAgBA,EAAM,aAC7B,CAEA,aAAaC,EAAiC,CAC5C,OAAQ,KAAK,GAAI,CACf,KAAKH,EAAc,OACjB,OAAOD,EAAO,GAAGA,EAAO,OAAOI,CAAe,GAAK,GAAI,OAAO,EAC1D,EAAI,KACJ,EAAI,KACV,KAAKH,EAAc,OACjB,MAAO,GAAI,KACb,KAAKA,EAAc,QACnB,KAAKA,EAAc,KACnB,KAAKA,EAAc,KACjB,MAAO,GACX,CACF,CACF",
4
+ "sourcesContent": ["import semver from \"semver\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\n/**\n * The info of a device model\n */\nexport class TransportDeviceModel {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n\n constructor(props: {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n }) {\n this.id = props.id;\n this.productName = props.productName;\n this.usbProductId = props.usbProductId;\n this.bootloaderUsbProductId = props.bootloaderUsbProductId;\n this.usbOnly = props.usbOnly;\n this.memorySize = props.memorySize;\n this.blockSize = props.blockSize;\n this.masks = props.masks;\n this.bluetoothSpec = props.bluetoothSpec;\n }\n\n getBlockSize(firmwareVersion: string): number {\n switch (this.id) {\n case DeviceModelId.NANO_S:\n return semver.lt(semver.coerce(firmwareVersion) ?? \"\", \"2.0.0\")\n ? 4 * 1024\n : 2 * 1024;\n case DeviceModelId.NANO_X:\n return 4 * 1024;\n case DeviceModelId.NANO_SP:\n case DeviceModelId.STAX:\n case DeviceModelId.FLEX:\n return 32;\n }\n }\n}\n"],
5
+ "mappings": "AAAA,OAAOA,MAAY,SAEnB,OAAS,iBAAAC,MAAqB,0BAKvB,MAAMC,CAAqB,CAChC,GACA,YACA,aACA,uBACA,QACA,WACA,UACA,MACA,cAOA,YAAYC,EAgBT,CACD,KAAK,GAAKA,EAAM,GAChB,KAAK,YAAcA,EAAM,YACzB,KAAK,aAAeA,EAAM,aAC1B,KAAK,uBAAyBA,EAAM,uBACpC,KAAK,QAAUA,EAAM,QACrB,KAAK,WAAaA,EAAM,WACxB,KAAK,UAAYA,EAAM,UACvB,KAAK,MAAQA,EAAM,MACnB,KAAK,cAAgBA,EAAM,aAC7B,CAEA,aAAaC,EAAiC,CAC5C,OAAQ,KAAK,GAAI,CACf,KAAKH,EAAc,OACjB,OAAOD,EAAO,GAAGA,EAAO,OAAOI,CAAe,GAAK,GAAI,OAAO,EAC1D,EAAI,KACJ,EAAI,KACV,KAAKH,EAAc,OACjB,MAAO,GAAI,KACb,KAAKA,EAAc,QACnB,KAAKA,EAAc,KACnB,KAAKA,EAAc,KACjB,MAAO,GACX,CACF,CACF",
6
6
  "names": ["semver", "DeviceModelId", "TransportDeviceModel", "props", "firmwareVersion"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceModelId as o}from"../../device/DeviceModel";function r(e={}){return{id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}],getBlockSize:()=>4*1024,...e}}export{r as deviceModelStubBuilder};
1
+ import{DeviceModelId as o}from"../../device/DeviceModel";function r(e={}){return{id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,blockSize:32,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}],getBlockSize:()=>4*1024,...e}}export{r as deviceModelStubBuilder};
2
2
  //# sourceMappingURL=DeviceModel.stub.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/model/DeviceModel.stub.ts"],
4
- "sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\nexport function deviceModelStubBuilder(\n props: Partial<TransportDeviceModel> = {},\n): TransportDeviceModel {\n return {\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n getBlockSize: () => 4 * 1024,\n ...props,\n };\n}\n"],
5
- "mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAGvB,SAASC,EACdC,EAAuC,CAAC,EAClB,CACtB,MAAO,CACL,GAAIF,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,EACA,aAAc,IAAM,EAAI,KACxB,GAAGE,CACL,CACF",
4
+ "sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\nexport function deviceModelStubBuilder(\n props: Partial<TransportDeviceModel> = {},\n): TransportDeviceModel {\n return {\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n blockSize: 32,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n getBlockSize: () => 4 * 1024,\n ...props,\n };\n}\n"],
5
+ "mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAGvB,SAASC,EACdC,EAAuC,CAAC,EAClB,CACtB,MAAO,CACL,GAAIF,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,UAAW,GACX,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,EACA,aAAc,IAAM,EAAI,KACxB,GAAGE,CACL,CACF",
6
6
  "names": ["DeviceModelId", "deviceModelStubBuilder", "props"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var t=(e=>(e[e.Connected=0]="Connected",e[e.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",e[e.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",e))(t||{});export{t as DeviceSessionStateType};
1
+ var a=(e=>(e[e.Connected=0]="Connected",e[e.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",e[e.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",e))(a||{});export{a as DeviceSessionStateType};
2
2
  //# sourceMappingURL=DeviceSessionState.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/api/device-session/DeviceSessionState.ts"],
4
- "sourcesContent": ["import { type GetAppAndVersionResponse } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { type BatteryStatusFlags } from \"@api/command/os/GetBatteryStatusCommand\";\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\n\n/**\n * The battery status of a device.\n */\nexport type BatteryStatus = {\n readonly level: number;\n readonly voltage: number;\n readonly temperature: number;\n readonly current: number;\n readonly status: BatteryStatusFlags;\n};\n\n/**\n * The firmware version of a device.\n */\nexport type FirmwareVersion = {\n /**\n * Microcontroller Unit version\n */\n readonly mcu: string;\n\n /**\n * Bootloader version\n */\n readonly bootloader: string;\n\n /**\n * Operating System version\n */\n readonly os: string;\n};\n\n/**\n * The current application running on a device. Alias of GetAppAndVersionResponse.\n */\nexport type RunningApp = GetAppAndVersionResponse;\n\n/**\n * The state types of a device session.\n */\nexport enum DeviceSessionStateType {\n Connected,\n ReadyWithoutSecureChannel,\n ReadyWithSecureChannel,\n}\n\ntype DeviceSessionBaseState = {\n readonly sessionStateType: DeviceSessionStateType;\n\n /**\n * The status of the device.\n */\n readonly deviceStatus: DeviceStatus;\n\n /**\n * The model of the device.\n */\n readonly deviceModelId: DeviceModelId;\n\n /**\n * The name of the device.\n */\n readonly deviceName?: string;\n};\n\ntype DeviceSessionReadyState = {\n /**\n * The battery status of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly batteryStatus?: BatteryStatus;\n\n /**\n * The firmware version of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly firmwareVersion?: FirmwareVersion;\n\n /**\n * The current application running on the device.\n */\n readonly currentApp: RunningApp;\n\n /**\n * The current applications installed on the device.\n */\n readonly installedApps: Application[];\n\n /**\n * The device is allowed to establish a secure connection.\n */\n readonly isSecureConnectionAllowed: boolean;\n};\n\n/**\n * The state of a connected device session.\n */\nexport type ConnectedState = DeviceSessionBaseState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.Connected;\n};\n\n/**\n * The state of a device session when it is ready without a secure channel.\n */\nexport type ReadyWithoutSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel;\n };\n\n/**\n * The state of a device session when it is ready with a secure channel.\n */\nexport type ReadyWithSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithSecureChannel;\n };\n\n/**\n * The state of a device session.\n */\nexport type DeviceSessionState =\n | ConnectedState\n | ReadyWithoutSecureChannelState\n | ReadyWithSecureChannelState;\n"],
5
- "mappings": "AA6CO,IAAKA,OACVA,IAAA,yBACAA,IAAA,yDACAA,IAAA,mDAHUA,OAAA",
4
+ "sourcesContent": ["import { type GetAppAndVersionResponse } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { type BatteryStatusFlags } from \"@api/command/os/GetBatteryStatusCommand\";\nimport { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\nimport {\n type FinalFirmware,\n type OsuFirmware,\n} from \"@internal/manager-api/model/Firmware\";\nimport { type LanguagePackage } from \"@internal/manager-api/model/Language\";\n\n/**\n * The battery status of a device.\n */\nexport type BatteryStatus = {\n readonly level: number;\n readonly voltage: number;\n readonly temperature: number;\n readonly current: number;\n readonly status: BatteryStatusFlags;\n};\n\n/**\n * The firmware version of a device.\n */\nexport type FirmwareVersion = {\n /**\n * Microcontroller Unit version\n */\n readonly mcu: string;\n\n /**\n * Bootloader version\n */\n readonly bootloader: string;\n\n /**\n * Operating System version\n */\n readonly os: string;\n\n /**\n * Metadata for advanced users, to get detailed informations on\n * the firmware running on the device.\n */\n readonly metadata?: GetOsVersionResponse;\n};\n\n/**\n * Context for firmware updates\n */\nexport type FirmwareUpdateContext = {\n /**\n * Current installed firmware\n */\n readonly currentFirmware: FinalFirmware;\n\n /**\n * Available firmware update\n */\n readonly availableUpdate?: FirmwareUpdate;\n};\n\n/**\n * Available firmware update\n */\nexport type FirmwareUpdate = {\n /**\n * Version of the OS updater firmware\n */\n readonly osuFirmware: OsuFirmware;\n\n /**\n * Version of the final firmware\n */\n readonly finalFirmware: FinalFirmware;\n\n /**\n * Indicates if the MCU needs to be updated\n */\n readonly mcuUpdateRequired: boolean;\n};\n\n/**\n * The app store catalog for that device.\n */\nexport type Catalog = {\n /**\n * Available applications for the device\n */\n readonly applications: Application[];\n\n /**\n * Available languages packages for the device\n */\n readonly languagePackages: LanguagePackage[];\n};\n\n/**\n * Language package installed on the device\n */\nexport type InstalledLanguagePackage = {\n /**\n * The identifier of the language package\n */\n readonly id: number;\n\n /**\n * The size of the language package\n */\n readonly size: number;\n};\n\n/**\n * Custom image metadata, if one was loaded on the device\n */\nexport type CustomImage = {\n /**\n * The size of loaded custom image, if one was loaded\n */\n readonly size?: number;\n};\n\n/**\n * The current application running on a device. Alias of GetAppAndVersionResponse.\n */\nexport type RunningApp = GetAppAndVersionResponse;\n\n/**\n * The state types of a device session.\n */\nexport enum DeviceSessionStateType {\n Connected,\n ReadyWithoutSecureChannel,\n ReadyWithSecureChannel,\n}\n\ntype DeviceSessionBaseState = {\n readonly sessionStateType: DeviceSessionStateType;\n\n /**\n * The status of the device.\n */\n readonly deviceStatus: DeviceStatus;\n\n /**\n * The model of the device.\n */\n readonly deviceModelId: DeviceModelId;\n\n /**\n * The name of the device.\n */\n readonly deviceName?: string;\n};\n\ntype DeviceSessionReadyState = {\n /**\n * The battery status of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly batteryStatus?: BatteryStatus;\n\n /**\n * The firmware version of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly firmwareVersion?: FirmwareVersion;\n\n /**\n * Context of available firmware update\n */\n readonly firmwareUpdateContext?: FirmwareUpdateContext;\n\n /**\n * The current application running on the device.\n */\n readonly currentApp: RunningApp;\n\n /**\n * The current applications installed on the device.\n */\n readonly installedApps: Application[];\n\n /**\n * Available updates from the app store for installed applications.\n */\n readonly appsUpdates?: Application[];\n\n /**\n * The current language packages installed on the device.\n */\n readonly installedLanguages?: InstalledLanguagePackage[];\n\n /**\n * Catalog of available applications and languages for the device.\n */\n readonly catalog?: Catalog;\n\n /**\n * Custom image metadata.\n */\n readonly customImage?: CustomImage;\n\n /**\n * The device is allowed to establish a secure connection.\n */\n readonly isSecureConnectionAllowed: boolean;\n};\n\n/**\n * The state of a connected device session.\n */\nexport type ConnectedState = DeviceSessionBaseState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.Connected;\n};\n\n/**\n * The state of a device session when it is ready without a secure channel.\n */\nexport type ReadyWithoutSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel;\n };\n\n/**\n * The state of a device session when it is ready with a secure channel.\n */\nexport type ReadyWithSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithSecureChannel;\n };\n\n/**\n * The state of a device session.\n */\nexport type DeviceSessionState =\n | ConnectedState\n | ReadyWithoutSecureChannelState\n | ReadyWithSecureChannelState;\n"],
5
+ "mappings": "AAoIO,IAAKA,OACVA,IAAA,yBACAA,IAAA,yDACAA,IAAA,mDAHUA,OAAA",
6
6
  "names": ["DeviceSessionStateType"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Apdu as r}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as i}from"./apdu/utils/ApduBuilder";import{ApduParser as n}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as f}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as x}from"./apdu/utils/ByteArrayParser";import{InvalidStatusWordError as A}from"./command/Errors";import{CommandResultFactory as u,CommandResultStatus as l,isSuccessCommandResult as v}from"./command/model/CommandResult";import{CloseAppCommand as C}from"./command/os/CloseAppCommand";import{GetAppAndVersionCommand as g}from"./command/os/GetAppAndVersionCommand";import{BatteryStatusType as B,GetBatteryStatusCommand as G}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as E}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as I}from"./command/os/ListAppsCommand";import{LoadCertificateCommand as T}from"./command/os/LoadCertificateCommand";import{OpenAppCommand as O}from"./command/os/OpenAppCommand";import{isCommandErrorCode as P}from"./command/utils/CommandErrors";import{CommandUtils as _}from"./command/utils/CommandUtils";import{GlobalCommandError as H,GlobalCommandErrorHandler as W}from"./command/utils/GlobalCommandError";import{DeviceModel as K,DeviceModelId as X,LEDGER_VENDOR_ID as q}from"./device/DeviceModel";import{DeviceStatus as N}from"./device/DeviceStatus";import{DeviceActionStatus as j}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as J}from"./device-action/model/UserInteractionRequired";import{CallTaskInAppDeviceAction as Z}from"./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction";import{UnknownDAError as ee}from"./device-action/os/Errors";import{GetDeviceStatusDeviceAction as re}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as pe}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{ListAppsDeviceAction as me}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as ae}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as fe}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{SendCommandInAppDeviceAction as xe}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as Ae}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as ue}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as ve}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as Ce}from"./device-model/model/DeviceModel";import{ApduResponse as ge}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as Ge}from"./device-session/DeviceSessionState";import{GenuineCheckDeviceAction as Ee}from"./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction";import{InstallAppDeviceAction as Ie}from"./secure-channel/device-action/InstallApp/InstallAppDeviceAction";import{ListInstalledAppsDeviceAction as Te}from"./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{UninstallAppDeviceAction as Oe}from"./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction";import{defaultApduReceiverServiceStubBuilder as Pe}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as _e}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as He}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as Fe}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as Xe}from"./DeviceManagementKitBuilder";export*from"./Error";import{LogLevel as Ne}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as je}from"./logger-subscriber/service/ConsoleLogger";import{WebLogsExporterLogger as Je}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as Ze}from"./transport/model/ConnectedDevice";import{DeviceConnectionStateMachine as eo}from"./transport/model/DeviceConnectionStateMachine";export*from"./transport/model/Errors";import{TransportConnectedDevice as to}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as io}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{base64StringToBuffer as ao,isBase64String as so}from"./utils/Base64String";import{bufferToHexaString as co,hexaStringToBuffer as xo,isHexaString as Ao}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,r as Apdu,i as ApduBuilder,n as ApduParser,ge as ApduResponse,B as BatteryStatusType,ve as BleDeviceInfos,f as ByteArrayBuilder,x as ByteArrayParser,Z as CallTaskInAppDeviceAction,C as CloseAppCommand,u as CommandResultFactory,l as CommandResultStatus,_ as CommandUtils,Ze as ConnectedDevice,je as ConsoleLogger,j as DeviceActionStatus,eo as DeviceConnectionStateMachine,Fe as DeviceManagementKit,Xe as DeviceManagementKitBuilder,K as DeviceModel,X as DeviceModelId,Ge as DeviceSessionStateType,N as DeviceStatus,He as FramerUtils,Ee as GenuineCheckDeviceAction,g as GetAppAndVersionCommand,G as GetBatteryStatusCommand,re as GetDeviceStatusDeviceAction,E as GetOsVersionCommand,H as GlobalCommandError,W as GlobalCommandErrorHandler,pe as GoToDashboardDeviceAction,Ie as InstallAppDeviceAction,A as InvalidStatusWordError,q as LEDGER_VENDOR_ID,I as ListAppsCommand,me as ListAppsDeviceAction,ae as ListAppsWithMetadataDeviceAction,Te as ListInstalledAppsDeviceAction,T as LoadCertificateCommand,Ne as LogLevel,O as OpenAppCommand,fe as OpenAppDeviceAction,xe as SendCommandInAppDeviceAction,ue as StaticDeviceModelDataSource,to as TransportConnectedDevice,Ce as TransportDeviceModel,Oe as UninstallAppDeviceAction,ee as UnknownDAError,J as UserInteractionRequired,Je as WebLogsExporterLogger,Ae as XStateDeviceAction,ao as base64StringToBuffer,co as bufferToHexaString,io as connectedDeviceStubBuilder,Pe as defaultApduReceiverServiceStubBuilder,_e as defaultApduSenderServiceStubBuilder,xo as hexaStringToBuffer,so as isBase64String,P as isCommandErrorCode,Ao as isHexaString,v as isSuccessCommandResult};
1
+ import{Apdu as o}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as i}from"./apdu/utils/ApduBuilder";import{ApduParser as m}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as c}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as x}from"./apdu/utils/ByteArrayParser";import{InvalidStatusWordError as A}from"./command/Errors";import{CommandResultFactory as v,CommandResultStatus as u,isSuccessCommandResult as l}from"./command/model/CommandResult";import{CloseAppCommand as C}from"./command/os/CloseAppCommand";import{GetAppAndVersionCommand as L}from"./command/os/GetAppAndVersionCommand";import{BatteryStatusType as B,GetBatteryStatusCommand as E}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as M}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as I}from"./command/os/ListAppsCommand";import{LoadCertificateCommand as b}from"./command/os/LoadCertificateCommand";import{OpenAppCommand as T}from"./command/os/OpenAppCommand";import{isCommandErrorCode as P}from"./command/utils/CommandErrors";import{CommandUtils as k}from"./command/utils/CommandUtils";import{GlobalCommandError as _,GlobalCommandErrorHandler as F}from"./command/utils/GlobalCommandError";import{DeviceModel as w,DeviceModelId as K,LEDGER_VENDOR_ID as X}from"./device/DeviceModel";import{DeviceStatus as N}from"./device/DeviceStatus";import{DeviceActionStatus as j}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as J}from"./device-action/model/UserInteractionRequired";import{CallTaskInAppDeviceAction as Z}from"./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction";import{DeviceLockedError as ee,OutOfMemoryDAError as re,UnknownDAError as oe,UnsupportedFirmwareDAError as te}from"./device-action/os/Errors";import{GetDeviceMetadataDeviceAction as ie}from"./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction";import{GetDeviceStatusDeviceAction as me}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as se}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{InstallOrUpdateAppsDeviceAction as fe}from"./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction";import{ListAppsDeviceAction as de}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as De}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as ue}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{OpenAppWithDependenciesDeviceAction as Se}from"./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction";import{SendCommandInAppDeviceAction as ye}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as ge}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as Ee}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as Me}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as Ie}from"./device-model/model/DeviceModel";import{ApduResponse as be}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as Ue}from"./device-session/DeviceSessionState";import{GenuineCheckDeviceAction as Ve}from"./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction";import{InstallAppDeviceAction as We}from"./secure-channel/device-action/InstallApp/InstallAppDeviceAction";import{ListInstalledAppsDeviceAction as Fe}from"./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{UninstallAppDeviceAction as we}from"./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction";import{SecureChannelError as Xe}from"../internal/secure-channel/model/Errors";import{defaultApduReceiverServiceStubBuilder as Ne}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as je}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as Je}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as Ze}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as er}from"./DeviceManagementKitBuilder";export*from"./Error";import{LogLevel as tr}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as ir}from"./logger-subscriber/service/ConsoleLogger";import{WebLogsExporterLogger as mr}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as sr}from"./transport/model/ConnectedDevice";import{DeviceConnectionStateMachine as fr}from"./transport/model/DeviceConnectionStateMachine";export*from"./transport/model/Errors";import{TransportConnectedDevice as Ar}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as vr}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{base64StringToBuffer as Sr,isBase64String as Cr}from"./utils/Base64String";import{bufferToHexaString as Lr,hexaStringToBuffer as gr,isHexaString as Br}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,o as Apdu,i as ApduBuilder,m as ApduParser,be as ApduResponse,B as BatteryStatusType,Me as BleDeviceInfos,c as ByteArrayBuilder,x as ByteArrayParser,Z as CallTaskInAppDeviceAction,C as CloseAppCommand,v as CommandResultFactory,u as CommandResultStatus,k as CommandUtils,sr as ConnectedDevice,ir as ConsoleLogger,j as DeviceActionStatus,fr as DeviceConnectionStateMachine,ee as DeviceLockedError,Ze as DeviceManagementKit,er as DeviceManagementKitBuilder,w as DeviceModel,K as DeviceModelId,Ue as DeviceSessionStateType,N as DeviceStatus,Je as FramerUtils,Ve as GenuineCheckDeviceAction,L as GetAppAndVersionCommand,E as GetBatteryStatusCommand,ie as GetDeviceMetadataDeviceAction,me as GetDeviceStatusDeviceAction,M as GetOsVersionCommand,_ as GlobalCommandError,F as GlobalCommandErrorHandler,se as GoToDashboardDeviceAction,We as InstallAppDeviceAction,fe as InstallOrUpdateAppsDeviceAction,A as InvalidStatusWordError,X as LEDGER_VENDOR_ID,I as ListAppsCommand,de as ListAppsDeviceAction,De as ListAppsWithMetadataDeviceAction,Fe as ListInstalledAppsDeviceAction,b as LoadCertificateCommand,tr as LogLevel,T as OpenAppCommand,ue as OpenAppDeviceAction,Se as OpenAppWithDependenciesDeviceAction,re as OutOfMemoryDAError,Xe as SecureChannelError,ye as SendCommandInAppDeviceAction,Ee as StaticDeviceModelDataSource,Ar as TransportConnectedDevice,Ie as TransportDeviceModel,we as UninstallAppDeviceAction,oe as UnknownDAError,te as UnsupportedFirmwareDAError,J as UserInteractionRequired,mr as WebLogsExporterLogger,ge as XStateDeviceAction,Sr as base64StringToBuffer,Lr as bufferToHexaString,vr as connectedDeviceStubBuilder,Ne as defaultApduReceiverServiceStubBuilder,je as defaultApduSenderServiceStubBuilder,gr as hexaStringToBuffer,Cr as isBase64String,P as isCommandErrorCode,Br as isHexaString,l as isSuccessCommandResult};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/index.ts"],
4
- "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { UnknownDAError } from \"@api/device-action/os/Errors\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { 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": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAChC,OAAS,0BAAAC,MAA8B,sBACvC,OACE,wBAAAC,EACA,uBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,mBAAAC,MAAuB,kCAChC,OACE,2BAAAC,MAEK,0CACP,OAC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AAgC,gDACzC,OAAS,8BAAAC,OAAkC,qDAC3C,WAAc,aACd,OAAS,wBAAAC,GAAsB,kBAAAC,OAAsB,0BACrD,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
6
- "names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "UnknownDAError", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "GenuineCheckDeviceAction", "InstallAppDeviceAction", "ListInstalledAppsDeviceAction", "UninstallAppDeviceAction", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "LogLevel", "ConsoleLogger", "WebLogsExporterLogger", "ConnectedDevice", "DeviceConnectionStateMachine", "TransportConnectedDevice", "connectedDeviceStubBuilder", "base64StringToBuffer", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
4
+ "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport {\n DeviceLockedError,\n OutOfMemoryDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
+ "mappings": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAChC,OAAS,0BAAAC,MAA8B,sBACvC,OACE,wBAAAC,EACA,uBAAAC,EAC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AAC,OAA2B,2BACpC,OAAS,8BAAAC,OAAkC,kCAC3C,WAAc,aACd,OAAS,YAAAC,OAAgB,wCACzB,OAAS,iBAAAC,OAAqB,+CAC9B,OAAS,yBAAAC,OAA6B,uDACtC,OAAS,mBAAAC,OAAuB,uCAChC,OACE,gCAAAC,OAEK,oDACP,WAAc,8BACd,OAAS,4BAAAC,OAAgC,gDACzC,OAAS,8BAAAC,OAAkC,qDAC3C,WAAc,aACd,OAAS,wBAAAC,GAAsB,kBAAAC,OAAsB,0BACrD,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
6
+ "names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "DeviceLockedError", "OutOfMemoryDAError", "UnknownDAError", "UnsupportedFirmwareDAError", "GetDeviceMetadataDeviceAction", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "InstallOrUpdateAppsDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "OpenAppWithDependenciesDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "GenuineCheckDeviceAction", "InstallAppDeviceAction", "ListInstalledAppsDeviceAction", "UninstallAppDeviceAction", "SecureChannelError", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "LogLevel", "ConsoleLogger", "WebLogsExporterLogger", "ConnectedDevice", "DeviceConnectionStateMachine", "TransportConnectedDevice", "connectedDeviceStubBuilder", "base64StringToBuffer", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Left as S,Right as I}from"purify-ts";import{assign as a,fromObservable as g,fromPromise as d,setup as h}from"xstate";import{isSuccessCommandResult as D}from"../../../command/model/CommandResult";import{GetOsVersionCommand as v}from"../../../command/os/GetOsVersionCommand";import{UserInteractionRequired as f}from"../../../device-action/model/UserInteractionRequired";import{DEFAULT_UNLOCK_TIMEOUT_MS as x}from"../../../device-action/os/Const";import{UnknownDAError as A}from"../../../device-action/os/Errors";import{GoToDashboardDeviceAction as y}from"../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{XStateDeviceAction as V}from"../../../device-action/xstate-utils/XStateDeviceAction";import{DeviceSessionStateType as E}from"../../../device-session/DeviceSessionState";import{ListInstalledAppsDeviceAction as L}from"../../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{ConnectToSecureChannelTask as O}from"../../../secure-channel/task/ConnectToSecureChannelTask";import{SecureChannelEventType as T}from"../../../secure-channel/task/types";class X extends V{makeStateMachine(n){const{getOsVersion:l,getAppList:c,installApp:u,getDeviceSessionState:r,setDeviceSessionState:o}=this.extractDependencies(n),i=this.input.unlockTimeout??x,p=new L({input:{unlockTimeout:i}}).makeStateMachine(n),m=new y({input:{unlockTimeout:i}}).makeStateMachine(n);return h({types:{input:{},context:{},output:{}},actors:{listInstalledApps:p,goToDashboard:m,getOsVersion:d(l),getAppList:d(c),installApp:g(u)},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:s})=>s===t.context.input.appName);return e?.parentName?t.context._internalState.installedApps.findIndex(({name:s})=>s===e.parentName)===-1:!1}},actions:{assignErrorFromEvent:a({_internalState:t=>({...t.context._internalState,error:t.event.error})}),assignAppNotFound:a({_internalState:t=>({...t.context._internalState,error:new A("App to install not found in manager API")})}),assignDepAppNotInstalled:a({_internalState:t=>({...t.context._internalState,error:new A("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:f.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:a({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"ListInstalledAppsCheck",actions:a({_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:a({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:a({_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:a({_internalState:t=>{if(D(t.event.output)){const e=r(),s=t.event.output.data.secureElementFlags.isSecureConnectionAllowed;return e.sessionStateType!==E.Connected&&o({...e,isSecureConnectionAllowed:s}),{...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:a({_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:a({intermediateValue:t=>t.event.snapshot.context?.type===T.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?S(t._internalState.error):I(void 0)})}extractDependencies(n){return{getOsVersion:()=>n.sendCommand(new v),getAppList:({input:r})=>{const{deviceInfo:o}=r;return n.getManagerApiService().getAppList(o)},installApp:({input:r})=>{const{deviceInfo:o,app:i}=r,p=n.getSecureChannelService().installApp(o,i);return new O(n,{connection:p}).run()},getDeviceSessionState:()=>n.getDeviceSessionState(),setDeviceSessionState:r=>n.setDeviceSessionState(r)}}}export{X as InstallAppDeviceAction};
1
+ import{Left as I,Right as g}from"purify-ts";import{assign as a,fromObservable as h,fromPromise as d,setup as D}from"xstate";import{isSuccessCommandResult as v}from"../../../command/model/CommandResult";import{GetOsVersionCommand as f}from"../../../command/os/GetOsVersionCommand";import{UserInteractionRequired as x}from"../../../device-action/model/UserInteractionRequired";import{DEFAULT_UNLOCK_TIMEOUT_MS as y}from"../../../device-action/os/Const";import{UnknownDAError as A}from"../../../device-action/os/Errors";import{GoToDashboardDeviceAction as V}from"../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{XStateDeviceAction as E}from"../../../device-action/xstate-utils/XStateDeviceAction";import{DeviceSessionStateType as S}from"../../../device-session/DeviceSessionState";import{ListInstalledAppsDeviceAction as T}from"../../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{ConnectToSecureChannelTask as L}from"../../../secure-channel/task/ConnectToSecureChannelTask";import{SecureChannelEventType as O}from"../../../secure-channel/task/types";class X extends E{makeStateMachine(n){const{getOsVersion:l,getAppList:c,installApp:u,getDeviceSessionState:r,setDeviceSessionState:o}=this.extractDependencies(n),i=this.input.unlockTimeout??y,p=new T({input:{unlockTimeout:i}}).makeStateMachine(n),m=new V({input:{unlockTimeout:i}}).makeStateMachine(n);return D({types:{input:{},context:{},output:{}},actors:{listInstalledApps:p,goToDashboard:m,getOsVersion:d(l),getAppList:d(c),installApp:h(u)},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:s})=>s===t.context.input.appName);return e?.parentName?t.context._internalState.installedApps.findIndex(({name:s})=>s===e.parentName)===-1:!1}},actions:{assignErrorFromEvent:a({_internalState:t=>({...t.context._internalState,error:t.event.error})}),assignAppNotFound:a({_internalState:t=>({...t.context._internalState,error:new A("App to install not found in manager API")})}),assignDepAppNotInstalled:a({_internalState:t=>({...t.context._internalState,error:new A("Dep app is not installed on the device")})}),cleanupDeviceState:()=>{const t=r();t.sessionStateType!==S.Connected&&o({...t,installedApps:[],appsUpdates:void 0})}}}).createMachine({id:"InstallAppDeviceAction",initial:"DeviceReady",context:t=>({input:{unlockTimeout:t.input.unlockTimeout,appName:t.input.appName},intermediateValue:{requiredUserInteraction:x.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:a({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"ListInstalledAppsCheck",actions:a({_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:a({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:a({_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:a({_internalState:t=>{if(v(t.event.output)){const e=r(),s=t.event.output.data.secureElementFlags.isSecureConnectionAllowed;return e.sessionStateType!==S.Connected&&o({...e,isSecureConnectionAllowed:s}),{...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:a({_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:a({intermediateValue:t=>t.event.snapshot.context?.type===O.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?I(t._internalState.error):g(void 0)})}extractDependencies(n){return{getOsVersion:()=>n.sendCommand(new f),getAppList:({input:r})=>{const{deviceInfo:o}=r;return n.getManagerApiService().getAppList(o)},installApp:({input:r})=>{const{deviceInfo:o,app:i}=r,p=n.getSecureChannelService().installApp(o,i);return new L(n,{connection:p}).run()},getDeviceSessionState:()=>n.getDeviceSessionState(),setDeviceSessionState:r=>n.setDeviceSessionState(r)}}}export{X as InstallAppDeviceAction};
2
2
  //# sourceMappingURL=InstallAppDeviceAction.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.ts"],
4
- "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nimport { ConnectToSecureChannelTask } from \"@api/secure-channel/task/ConnectToSecureChannelTask\";\nimport { SecureChannelEventType } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\n\nimport {\n type InstallAppDAError,\n type InstallAppDAInput,\n type InstallAppDAIntermediateValue,\n type InstallAppDAOutput,\n type InstallAppStateMachineInternalState,\n type MachineDependencies,\n} from \"./types\";\n\nexport class InstallAppDeviceAction extends XStateDeviceAction<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n> {\n override makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n > {\n type types = StateMachineTypes<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n >;\n\n const {\n getOsVersion,\n getAppList,\n installApp,\n getDeviceSessionState,\n setDeviceSessionState,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const listInstalledAppsMachine = new ListInstalledAppsDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalApi);\n\n const goToDashboardMachine = new GoToDashboardDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalApi);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n listInstalledApps: listInstalledAppsMachine,\n goToDashboard: goToDashboardMachine,\n getOsVersion: fromPromise(getOsVersion),\n getAppList: fromPromise(getAppList),\n installApp: fromObservable(installApp),\n },\n guards: {\n hasError: (_) => _.context._internalState.error !== null,\n appInstalled: (_) =>\n _.context._internalState.installedApps.some(\n (app) => app.name === _.context.input.appName,\n ),\n appNotFound: (_) =>\n _.context._internalState.appList.findIndex(\n ({ versionName }) => versionName === _.context.input.appName,\n ) === -1,\n depAppNotInstalled: (_) => {\n const appToInstall = _.context._internalState.appList.find(\n ({ versionName }) => versionName === _.context.input.appName,\n );\n if (appToInstall?.parentName) {\n return (\n _.context._internalState.installedApps.findIndex(\n ({ name }) => name === appToInstall.parentName,\n ) === -1\n );\n }\n return false;\n },\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"],\n }),\n }),\n assignAppNotFound: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\n \"App to install not found in manager API\",\n ),\n }),\n }),\n assignDepAppNotInstalled: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\"Dep app is not installed on the device\"),\n }),\n }),\n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FIREQELiqXhrAEWYxFQrYOhkdshmVRFJZ0bVtSxdKw7XpJCBjFoTkBTYjKmENc6qjCrDEY+Gj6E+-lPqF80PYtrC0ctq33BKwhSnBm2jplaiDLYWhmHojIaAMKmqgYmj5cYFgWKY6rERo+l3RV+xUSZyPPW1r3owStjveJiVfXjBNE8RpPk0mbLUhsG4M8sOjwwa7NVeiQGEA1Ho8Y192EB1H0SZSQSsP8gKTFDO3Mn+Oq5qzCOq49Aoa4INZ1g2TYtu2TpdqUesG0L8opgTKqTGmr4-iykK22VeaoEwEBwEoGtFtR2MjklAC0OWqpn0LLgsAwrIYaZ2Mru4c8cRY8Hwkw2RnX1rEmbiDMyaYAnt7jXeXC3UYKdQFji8DxTjSWiEmFipd4Ufahys32yrqec3VWJD2e6efb04+qu+re-qy-52-metL6a4F9ieG9G64Srg6YGaWHYN2iDd87qpHsbLKs6wDD3iN94eCC-ZTx8yvsLXoN0XB33fHYf4hMOQnR2jdf4egQQvnTMsP+jskYowEhZCShtwHqDcPhIKlgdD9BGJ5KwqkXA7WLt4FYbgrCLDKgvCuasDxRXwagdeI8G63kZNSdBgUUzTChObL4j8nILm-oTK6SwsGnyeqjWoYDurph2mMQqj4hruGOjhNwYI4ELHVAuYiSi9ycxRi9TAfD66b1cJNbQpivCeXjERSRCBUGzGUjCTKj8oSKUsZXdWFFiDqNHNvMOiltDTxtnPEJnC2AAGUACu1BaCwGHg46+30zDaGsF-EElhSkjCTCCME6wobOSMLdY+bNlECgAKK1nrJEpKmVfpFJWCUspDgcLBBpnTDCZhliLn0uEIAA */\n id: \"InstallAppDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => ({\n input: {\n unlockTimeout: _.input.unlockTimeout,\n appName: _.input.appName,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n progress: 0,\n },\n _internalState: {\n error: null,\n installedApps: [],\n getOsVersionResponse: null,\n appList: [],\n },\n }),\n states: {\n DeviceReady: {\n always: {\n target: \"ListInstalledApps\",\n },\n },\n ListInstalledApps: {\n value: \"ListInstalledApps\",\n invoke: {\n id: \"listInstalledApps\",\n src: \"listInstalledApps\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"ListInstalledAppsCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: ({ installedApps }) => ({\n ..._.context._internalState,\n installedApps,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n },\n },\n ListInstalledAppsCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n guard: \"appInstalled\",\n },\n {\n target: \"GoToDashboard\",\n },\n ],\n },\n GoToDashboard: {\n invoke: {\n id: \"goToDashboard\",\n src: \"goToDashboard\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"GoToDashboardCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GoToDashboardCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetOsVersion\",\n },\n ],\n },\n GetOsVersion: {\n invoke: {\n id: \"getOsVersion\",\n src: \"getOsVersion\",\n input: (_) => undefined,\n onDone: {\n target: \"GetOsVersionCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const currentState: DeviceSessionState =\n getDeviceSessionState();\n const isSecureConnectionAllowed =\n _.event.output.data.secureElementFlags\n .isSecureConnectionAllowed;\n if (\n currentState.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...currentState,\n isSecureConnectionAllowed,\n });\n }\n return {\n ..._.context._internalState,\n getOsVersionResponse: _.event.output.data,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n },\n },\n GetOsVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetAppList\",\n },\n ],\n },\n GetAppList: {\n invoke: {\n id: \"getAppList\",\n src: \"getAppList\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n }),\n onDone: {\n target: \"GetAppListCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: (appList) => ({\n ..._.context._internalState,\n appList,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n },\n },\n GetAppListCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Error\",\n guard: \"appNotFound\",\n actions: \"assignAppNotFound\",\n },\n {\n target: \"Error\",\n guard: \"depAppNotInstalled\",\n actions: \"assignDepAppNotInstalled\",\n },\n {\n target: \"InstallApp\",\n },\n ],\n },\n InstallApp: {\n invoke: {\n id: \"installApp\",\n src: \"installApp\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n app: _.context._internalState.appList.find(\n ({ versionName }) => versionName === _.context.input.appName,\n )!,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => {\n if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Progress\n ) {\n return {\n ..._.context.intermediateValue,\n progress: _.event.snapshot.context.payload.progress,\n };\n }\n return { ..._.context.intermediateValue };\n },\n }),\n },\n onDone: {\n target: \"ListInstalledApps\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n Success: {\n type: \"final\",\n description: \"App installed successfully\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.error\n ? Left(context._internalState.error)\n : Right(void 0),\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getOsVersion = () =>\n internalApi.sendCommand(new GetOsVersionCommand());\n\n const getAppList = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n }>) => {\n const { deviceInfo } = input;\n return internalApi.getManagerApiService().getAppList(deviceInfo);\n };\n\n const installApp = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n app: Application;\n }>) => {\n const { deviceInfo, app } = input;\n const eitherConnection = internalApi\n .getSecureChannelService()\n .installApp(deviceInfo, app);\n return new ConnectToSecureChannelTask(internalApi, {\n connection: eitherConnection,\n }).run();\n };\n\n return {\n getOsVersion,\n getAppList,\n installApp,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
5
- "mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAC5B,OAAS,UAAAC,EAAQ,kBAAAC,EAAgB,eAAAC,EAAa,SAAAC,MAAa,SAE3D,OAAS,0BAAAC,MAA8B,mCACvC,OACE,uBAAAC,MAEK,sCAEP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,6BAAAC,MAAiC,8BAC1C,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,6BAAAC,MAAiC,gEAE1C,OAEE,sBAAAC,MACK,qDACP,OAEE,0BAAAC,MACK,yCACP,OAAS,iCAAAC,MAAqC,oFAC9C,OAAS,8BAAAC,MAAkC,sDAC3C,OAAS,0BAAAC,MAA8B,iCAahC,MAAMC,UAA+BL,CAM1C,CACS,iBACPM,EAOA,CASA,KAAM,CACJ,aAAAC,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AAY,YAAY,IAAIX,CAAqB,EA4BjD,WA1BiB,CAAC,CAClB,MAAA+B,CACF,IAEO,CACL,KAAM,CAAE,WAAAC,CAAW,EAAID,EACvB,OAAOpB,EAAY,qBAAqB,EAAE,WAAWqB,CAAU,CACjE,EAoBE,WAlBiB,CAAC,CAClB,MAAAD,CACF,IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,IAAAX,CAAI,EAAIU,EACtBE,EAAmBtB,EACtB,wBAAwB,EACxB,WAAWqB,EAAYX,CAAG,EAC7B,OAAO,IAAIb,EAA2BG,EAAa,CACjD,WAAYsB,CACd,CAAC,EAAE,IAAI,CACT,EAME,sBAAuB,IAAMtB,EAAY,sBAAsB,EAC/D,sBAAwBuB,GACtBvB,EAAY,sBAAsBuB,CAAK,CAC3C,CACF,CACF",
6
- "names": ["Left", "Right", "assign", "fromObservable", "fromPromise", "setup", "isSuccessCommandResult", "GetOsVersionCommand", "UserInteractionRequired", "DEFAULT_UNLOCK_TIMEOUT_MS", "UnknownDAError", "GoToDashboardDeviceAction", "XStateDeviceAction", "DeviceSessionStateType", "ListInstalledAppsDeviceAction", "ConnectToSecureChannelTask", "SecureChannelEventType", "InstallAppDeviceAction", "internalApi", "getOsVersion", "getAppList", "installApp", "getDeviceSessionState", "setDeviceSessionState", "unlockTimeout", "listInstalledAppsMachine", "goToDashboardMachine", "_", "app", "versionName", "appToInstall", "name", "installedApps", "error", "currentState", "isSecureConnectionAllowed", "appList", "context", "input", "deviceInfo", "eitherConnection", "state"]
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nimport { ConnectToSecureChannelTask } from \"@api/secure-channel/task/ConnectToSecureChannelTask\";\nimport { SecureChannelEventType } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\n\nimport {\n type InstallAppDAError,\n type InstallAppDAInput,\n type InstallAppDAIntermediateValue,\n type InstallAppDAOutput,\n type InstallAppStateMachineInternalState,\n type MachineDependencies,\n} from \"./types\";\n\nexport class InstallAppDeviceAction extends XStateDeviceAction<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n> {\n override makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n > {\n type types = StateMachineTypes<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n >;\n\n const {\n getOsVersion,\n getAppList,\n installApp,\n getDeviceSessionState,\n setDeviceSessionState,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const listInstalledAppsMachine = new ListInstalledAppsDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalApi);\n\n const goToDashboardMachine = new GoToDashboardDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalApi);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n listInstalledApps: listInstalledAppsMachine,\n goToDashboard: goToDashboardMachine,\n getOsVersion: fromPromise(getOsVersion),\n getAppList: fromPromise(getAppList),\n installApp: fromObservable(installApp),\n },\n guards: {\n hasError: (_) => _.context._internalState.error !== null,\n appInstalled: (_) =>\n _.context._internalState.installedApps.some(\n (app) => app.name === _.context.input.appName,\n ),\n appNotFound: (_) =>\n _.context._internalState.appList.findIndex(\n ({ versionName }) => versionName === _.context.input.appName,\n ) === -1,\n depAppNotInstalled: (_) => {\n const appToInstall = _.context._internalState.appList.find(\n ({ versionName }) => versionName === _.context.input.appName,\n );\n if (appToInstall?.parentName) {\n return (\n _.context._internalState.installedApps.findIndex(\n ({ name }) => name === appToInstall.parentName,\n ) === -1\n );\n }\n return false;\n },\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"],\n }),\n }),\n assignAppNotFound: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\n \"App to install not found in manager API\",\n ),\n }),\n }),\n assignDepAppNotInstalled: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\"Dep app is not installed on the device\"),\n }),\n }),\n cleanupDeviceState: () => {\n // After app successful installation, cleanup the device session state\n // to force fetching the new device state when required\n const state = getDeviceSessionState();\n if (state.sessionStateType !== DeviceSessionStateType.Connected) {\n setDeviceSessionState({\n ...state,\n installedApps: [],\n appsUpdates: undefined,\n });\n }\n },\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QEkB2sAuBDANjgggA6EAiYAbgJYDGY+1GlA9qgHRlW0BKYWEAngGIA2gAYAuol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SnBm2jplaiDLYWhmHojIaAMKmqgYmj5cYFgWKY6rERo+l3RV+xUSZyPPW1r3owStjveJiVfXjBNE8RpPk0mbLUhsG4M8sOjwwa7NVeiQGEA1Ho8Y192EB1H0SZSQSsP8gKTFDO3Mn+Oq5qzCOq49Aoa4INZ1g2TYtu2TpdqUesG0L8opgTKqTGmr4-iykK22VeaoEwEBwEoGtFtR2MjklAC0OWqpn0LLgsAwrIYaZ2Mru4c8cRY8Hwkw2RnX1rEmbiDMyaYAnt7jXeXC3UYKdQFji8DxTjSWiEmFipd4Ufahys32yrqec3VWJD2e6efb04+qu+re-qy-52-metL6a4F9ieG9G64Srg6YGaWHYN2iDd87qpHsbLKs6wDD3iN94eCC-ZTx8yvsLXoN0XB33fHYf4hMOQnR2jdf4egQQvnTMsP+jskYowEhZCShtwHqDcPhIKlgdD9BGJ5KwqkXA7WLt4FYbgrCLDKgvCuasDxRXwagdeI8G63kZNSdBgUUzTChObL4j8nILm-oTK6SwsGnyeqjWoYDurph2mMQqj4hruGOjhNwYI4ELHVAuYiSi9ycxRi9TAfD66b1cJNbQpivCeXjERSRCBUGzGUjCTKj8oSKUsZXdWFFiDqNHNvMOiltDTxtnPEJnC2AAGUACu1BaCwGHg46+30zDaGsF-EElhSkjCTCCME6wobOSMLdY+bNlECgAKK1nrJEpKmVfpFJWCUspDgcLBBpnTDCZhliLn0uEIAA */\n id: \"InstallAppDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => ({\n input: {\n unlockTimeout: _.input.unlockTimeout,\n appName: _.input.appName,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n progress: 0,\n },\n _internalState: {\n error: null,\n installedApps: [],\n getOsVersionResponse: null,\n appList: [],\n },\n }),\n states: {\n DeviceReady: {\n always: {\n target: \"ListInstalledApps\",\n },\n },\n ListInstalledApps: {\n value: \"ListInstalledApps\",\n invoke: {\n id: \"listInstalledApps\",\n src: \"listInstalledApps\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"ListInstalledAppsCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: ({ installedApps }) => ({\n ..._.context._internalState,\n installedApps,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n },\n },\n ListInstalledAppsCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n guard: \"appInstalled\",\n },\n {\n target: \"GoToDashboard\",\n },\n ],\n },\n GoToDashboard: {\n invoke: {\n id: \"goToDashboard\",\n src: \"goToDashboard\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"GoToDashboardCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GoToDashboardCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetOsVersion\",\n },\n ],\n },\n GetOsVersion: {\n invoke: {\n id: \"getOsVersion\",\n src: \"getOsVersion\",\n input: (_) => undefined,\n onDone: {\n target: \"GetOsVersionCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const currentState: DeviceSessionState =\n getDeviceSessionState();\n const isSecureConnectionAllowed =\n _.event.output.data.secureElementFlags\n .isSecureConnectionAllowed;\n if (\n currentState.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...currentState,\n isSecureConnectionAllowed,\n });\n }\n return {\n ..._.context._internalState,\n getOsVersionResponse: _.event.output.data,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n },\n },\n GetOsVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetAppList\",\n },\n ],\n },\n GetAppList: {\n invoke: {\n id: \"getAppList\",\n src: \"getAppList\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n }),\n onDone: {\n target: \"GetAppListCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: (appList) => ({\n ..._.context._internalState,\n appList,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n },\n },\n GetAppListCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Error\",\n guard: \"appNotFound\",\n actions: \"assignAppNotFound\",\n },\n {\n target: \"Error\",\n guard: \"depAppNotInstalled\",\n actions: \"assignDepAppNotInstalled\",\n },\n {\n target: \"InstallApp\",\n },\n ],\n },\n InstallApp: {\n invoke: {\n id: \"installApp\",\n src: \"installApp\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n app: _.context._internalState.appList.find(\n ({ versionName }) => versionName === _.context.input.appName,\n )!,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => {\n if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Progress\n ) {\n return {\n ..._.context.intermediateValue,\n progress: _.event.snapshot.context.payload.progress,\n };\n }\n return { ..._.context.intermediateValue };\n },\n }),\n },\n onDone: {\n target: \"ListInstalledApps\",\n actions: \"cleanupDeviceState\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n Success: {\n type: \"final\",\n description: \"App installed successfully\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.error\n ? Left(context._internalState.error)\n : Right(undefined),\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getOsVersion = () =>\n internalApi.sendCommand(new GetOsVersionCommand());\n\n const getAppList = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n }>) => {\n const { deviceInfo } = input;\n return internalApi.getManagerApiService().getAppList(deviceInfo);\n };\n\n const installApp = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n app: Application;\n }>) => {\n const { deviceInfo, app } = input;\n const eitherConnection = internalApi\n .getSecureChannelService()\n .installApp(deviceInfo, app);\n return new ConnectToSecureChannelTask(internalApi, {\n connection: eitherConnection,\n }).run();\n };\n\n return {\n getOsVersion,\n getAppList,\n installApp,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
5
+ "mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAC5B,OAAS,UAAAC,EAAQ,kBAAAC,EAAgB,eAAAC,EAAa,SAAAC,MAAa,SAE3D,OAAS,0BAAAC,MAA8B,mCACvC,OACE,uBAAAC,MAEK,sCAEP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,6BAAAC,MAAiC,8BAC1C,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,6BAAAC,MAAiC,gEAE1C,OAEE,sBAAAC,MACK,qDACP,OAEE,0BAAAC,MACK,yCACP,OAAS,iCAAAC,MAAqC,oFAC9C,OAAS,8BAAAC,MAAkC,sDAC3C,OAAS,0BAAAC,MAA8B,iCAahC,MAAMC,UAA+BL,CAM1C,CACS,iBACPM,EAOA,CASA,KAAM,CACJ,aAAAC,EACA,WAAAC,EACA,WAAAC,EACA,sBAAAC,EACA,sBAAAC,CACF,EAAI,KAAK,oBAAoBL,CAAW,EAElCM,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ACvB,CAAC,CACH,CAEA,oBAAoBiB,EAA+C,CA4BjE,MAAO,CACL,aA5BmB,IACnBA,EAAY,YAAY,IAAIX,CAAqB,EA4BjD,WA1BiB,CAAC,CAClB,MAAAgC,CACF,IAEO,CACL,KAAM,CAAE,WAAAC,CAAW,EAAID,EACvB,OAAOrB,EAAY,qBAAqB,EAAE,WAAWsB,CAAU,CACjE,EAoBE,WAlBiB,CAAC,CAClB,MAAAD,CACF,IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,IAAAZ,CAAI,EAAIW,EACtBE,EAAmBvB,EACtB,wBAAwB,EACxB,WAAWsB,EAAYZ,CAAG,EAC7B,OAAO,IAAIb,EAA2BG,EAAa,CACjD,WAAYuB,CACd,CAAC,EAAE,IAAI,CACT,EAME,sBAAuB,IAAMvB,EAAY,sBAAsB,EAC/D,sBAAwBc,GACtBd,EAAY,sBAAsBc,CAAK,CAC3C,CACF,CACF",
6
+ "names": ["Left", "Right", "assign", "fromObservable", "fromPromise", "setup", "isSuccessCommandResult", "GetOsVersionCommand", "UserInteractionRequired", "DEFAULT_UNLOCK_TIMEOUT_MS", "UnknownDAError", "GoToDashboardDeviceAction", "XStateDeviceAction", "DeviceSessionStateType", "ListInstalledAppsDeviceAction", "ConnectToSecureChannelTask", "SecureChannelEventType", "InstallAppDeviceAction", "internalApi", "getOsVersion", "getAppList", "installApp", "getDeviceSessionState", "setDeviceSessionState", "unlockTimeout", "listInstalledAppsMachine", "goToDashboardMachine", "_", "app", "versionName", "appToInstall", "name", "state", "installedApps", "error", "currentState", "isSecureConnectionAllowed", "appList", "context", "input", "deviceInfo", "eitherConnection"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Left as g,Right as D}from"purify-ts";import{assign as a,fromObservable as I,fromPromise as d,setup as v}from"xstate";import{isSuccessCommandResult as y}from"../../../command/model/CommandResult";import{GetOsVersionCommand as f}from"../../../command/os/GetOsVersionCommand";import{UserInteractionRequired as p}from"../../../device-action/model/UserInteractionRequired";import{DEFAULT_UNLOCK_TIMEOUT_MS as E}from"../../../device-action/os/Const";import{UnknownDAError as A}from"../../../device-action/os/Errors";import{GoToDashboardDeviceAction as U}from"../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{XStateDeviceAction as x}from"../../../device-action/xstate-utils/XStateDeviceAction";import{DeviceSessionStateType as O}from"../../../device-session/DeviceSessionState";import{ListInstalledAppsDeviceAction as V}from"../../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{ConnectToSecureChannelTask as k}from"../../../secure-channel/task/ConnectToSecureChannelTask";import{SecureChannelEventType as m}from"../../../secure-channel/task/types";class P extends x{makeStateMachine(n){const{getOsVersion:l,getAppsByHash:c,uninstallApp:u,getDeviceSessionState:r,setDeviceSessionState:o}=this.extractDependencies(n),s=this.input.unlockTimeout??E,i=new U({input:{unlockTimeout:s}}).makeStateMachine(n),S=new V({input:{unlockTimeout:s}}).makeStateMachine(n);return v({types:{input:{},context:{},output:{}},actors:{listInstalledApps:S,goToDashboard:i,getOsVersion:d(l),getAppsByHash:d(c),uninstallApp:I(u)},guards:{hasError:t=>t.context._internalState.error!==null,appNotInstalled:t=>!t.context._internalState.installedApps.some(e=>e.name===t.context.input.appName),appNotFound:t=>t.context._internalState.appList.findIndex(e=>e?.versionName===t.context.input.appName)===-1,isDepAppOfOther:t=>t.context._internalState.appList.some(e=>e?.parentName===t.context.input.appName)},actions:{assignErrorFromEvent:a({_internalState:t=>({...t.context._internalState,error:t.event.error})}),assignAppNotFound:a({_internalState:t=>({...t.context._internalState,error:new A("App to uninstall not found in manager API")})}),assignIsDepAppOfOther:a({_internalState:t=>({...t.context._internalState,error:new A("App to uninstall is a dependency of another installed app")})})}}).createMachine({id:"UninstallAppDeviceAction",initial:"DeviceReady",context:t=>({input:{unlockTimeout:t.input.unlockTimeout,appName:t.input.appName},intermediateValue:{requiredUserInteraction:p.None},_internalState:{error:null,installedApps:[],appList:[],getOsVersionResponse:null}}),states:{DeviceReady:{always:{target:"ListInstalledApps"}},ListInstalledApps:{invoke:{id:"listInstalledApps",src:"listInstalledApps",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:a({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"ListInstalledAppsCheck",actions:a({_internalState:t=>t.event.output.caseOf({Right:({installedApps:e})=>({...t.context._internalState,installedApps:e,hasCheckedInstalledApps:!0}),Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},ListInstalledAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success",guard:"appNotInstalled"},{target:"GetAppsByHash"}]},GetAppsByHash:{invoke:{id:"getAppsByHash",src:"getAppsByHash",input:t=>t.context._internalState.installedApps,onDone:{target:"GetAppsByHashCheck",actions:a({_internalState:t=>t.event.output.caseOf({Right:e=>({...t.context._internalState,appList:e}),Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetAppsByHashCheck:{always:[{target:"Error",guard:"hasError"},{target:"Error",guard:"appNotFound",actions:"assignAppNotFound"},{target:"Error",guard:"isDepAppOfOther",actions:"assignIsDepAppOfOther"},{target:"GoToDashboard"}]},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:a({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:a({_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:a({_internalState:t=>{if(y(t.event.output)){const e=r(),h=t.event.output.data.secureElementFlags.isSecureConnectionAllowed;return e.sessionStateType!==O.Connected&&o({...e,isSecureConnectionAllowed:h}),{...t.context._internalState,getOsVersionResponse:t.event.output.data}}return{...t.context._internalState,error:t.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"UninstallApp"}]},UninstallApp:{invoke:{id:"uninstallApp",src:"uninstallApp",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse,app:t.context._internalState.appList.find(e=>e?.versionName===t.context.input.appName)}),onSnapshot:{actions:a({intermediateValue:t=>{switch(t.event.snapshot.context?.type){case m.PermissionRequested:return{requiredUserInteraction:p.AllowSecureConnection};case m.PermissionGranted:return{requiredUserInteraction:p.None};default:return{...t.context.intermediateValue}}}})},onDone:{target:"ListInstalledApps"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},Success:{type:"final",description:"App uninstalled successfully"},Error:{type:"final"}},output:({context:t})=>t._internalState.error?g(t._internalState.error):D(void 0)})}extractDependencies(n){return{getOsVersion:()=>n.sendCommand(new f),getAppsByHash:({input:r})=>{const o=r.map(s=>s.hash);return n.getManagerApiService().getAppsByHash(o)},uninstallApp:({input:r})=>{const{deviceInfo:o,app:s}=r,i=n.getSecureChannelService().uninstallApp(o,s);return new k(n,{connection:i}).run()},getDeviceSessionState:()=>n.getDeviceSessionState(),setDeviceSessionState:r=>n.setDeviceSessionState(r)}}}export{P as UninstallAppDeviceAction};
1
+ import{Left as D,Right as v}from"purify-ts";import{assign as a,fromObservable as I,fromPromise as d,setup as f}from"xstate";import{isSuccessCommandResult as y}from"../../../command/model/CommandResult";import{GetOsVersionCommand as E}from"../../../command/os/GetOsVersionCommand";import{UserInteractionRequired as p}from"../../../device-action/model/UserInteractionRequired";import{DEFAULT_UNLOCK_TIMEOUT_MS as U}from"../../../device-action/os/Const";import{UnknownDAError as A}from"../../../device-action/os/Errors";import{GoToDashboardDeviceAction as x}from"../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{XStateDeviceAction as O}from"../../../device-action/xstate-utils/XStateDeviceAction";import{DeviceSessionStateType as m}from"../../../device-session/DeviceSessionState";import{ListInstalledAppsDeviceAction as V}from"../../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{ConnectToSecureChannelTask as T}from"../../../secure-channel/task/ConnectToSecureChannelTask";import{SecureChannelEventType as S}from"../../../secure-channel/task/types";class P extends O{makeStateMachine(n){const{getOsVersion:l,getAppsByHash:c,uninstallApp:u,getDeviceSessionState:r,setDeviceSessionState:s}=this.extractDependencies(n),o=this.input.unlockTimeout??U,i=new x({input:{unlockTimeout:o}}).makeStateMachine(n),h=new V({input:{unlockTimeout:o}}).makeStateMachine(n);return f({types:{input:{},context:{},output:{}},actors:{listInstalledApps:h,goToDashboard:i,getOsVersion:d(l),getAppsByHash:d(c),uninstallApp:I(u)},guards:{hasError:t=>t.context._internalState.error!==null,appNotInstalled:t=>!t.context._internalState.installedApps.some(e=>e.name===t.context.input.appName),appNotFound:t=>t.context._internalState.appList.findIndex(e=>e?.versionName===t.context.input.appName)===-1,isDepAppOfOther:t=>t.context._internalState.appList.some(e=>e?.parentName===t.context.input.appName)},actions:{assignErrorFromEvent:a({_internalState:t=>({...t.context._internalState,error:t.event.error})}),assignAppNotFound:a({_internalState:t=>({...t.context._internalState,error:new A("App to uninstall not found in manager API")})}),assignIsDepAppOfOther:a({_internalState:t=>({...t.context._internalState,error:new A("App to uninstall is a dependency of another installed app")})}),cleanupDeviceState:()=>{const t=r();t.sessionStateType!==m.Connected&&s({...t,installedApps:[],appsUpdates:void 0})}}}).createMachine({id:"UninstallAppDeviceAction",initial:"DeviceReady",context:t=>({input:{unlockTimeout:t.input.unlockTimeout,appName:t.input.appName},intermediateValue:{requiredUserInteraction:p.None},_internalState:{error:null,installedApps:[],appList:[],getOsVersionResponse:null}}),states:{DeviceReady:{always:{target:"ListInstalledApps"}},ListInstalledApps:{invoke:{id:"listInstalledApps",src:"listInstalledApps",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:a({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"ListInstalledAppsCheck",actions:a({_internalState:t=>t.event.output.caseOf({Right:({installedApps:e})=>({...t.context._internalState,installedApps:e,hasCheckedInstalledApps:!0}),Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},ListInstalledAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success",guard:"appNotInstalled"},{target:"GetAppsByHash"}]},GetAppsByHash:{invoke:{id:"getAppsByHash",src:"getAppsByHash",input:t=>t.context._internalState.installedApps,onDone:{target:"GetAppsByHashCheck",actions:a({_internalState:t=>t.event.output.caseOf({Right:e=>({...t.context._internalState,appList:e}),Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetAppsByHashCheck:{always:[{target:"Error",guard:"hasError"},{target:"Error",guard:"appNotFound",actions:"assignAppNotFound"},{target:"Error",guard:"isDepAppOfOther",actions:"assignIsDepAppOfOther"},{target:"GoToDashboard"}]},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:a({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:a({_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:a({_internalState:t=>{if(y(t.event.output)){const e=r(),g=t.event.output.data.secureElementFlags.isSecureConnectionAllowed;return e.sessionStateType!==m.Connected&&s({...e,isSecureConnectionAllowed:g}),{...t.context._internalState,getOsVersionResponse:t.event.output.data}}return{...t.context._internalState,error:t.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"UninstallApp"}]},UninstallApp:{invoke:{id:"uninstallApp",src:"uninstallApp",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse,app:t.context._internalState.appList.find(e=>e?.versionName===t.context.input.appName)}),onSnapshot:{actions:a({intermediateValue:t=>{switch(t.event.snapshot.context?.type){case S.PermissionRequested:return{requiredUserInteraction:p.AllowSecureConnection};case S.PermissionGranted:return{requiredUserInteraction:p.None};default:return{...t.context.intermediateValue}}}})},onDone:{target:"ListInstalledApps",actions:"cleanupDeviceState"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},Success:{type:"final",description:"App uninstalled successfully"},Error:{type:"final"}},output:({context:t})=>t._internalState.error?D(t._internalState.error):v(void 0)})}extractDependencies(n){return{getOsVersion:()=>n.sendCommand(new E),getAppsByHash:({input:r})=>{const s=r.map(o=>o.hash);return n.getManagerApiService().getAppsByHash(s)},uninstallApp:({input:r})=>{const{deviceInfo:s,app:o}=r,i=n.getSecureChannelService().uninstallApp(s,o);return new T(n,{connection:i}).run()},getDeviceSessionState:()=>n.getDeviceSessionState(),setDeviceSessionState:r=>n.setDeviceSessionState(r)}}}export{P as UninstallAppDeviceAction};
2
2
  //# sourceMappingURL=UninstallAppDeviceAction.js.map