@ledgerhq/device-management-kit 0.0.0-wrong-error-when-in-experimental-provider-20251021161219 → 0.0.0-z-intent-queue-7-20251204111630

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 (445) hide show
  1. package/lib/cjs/package.json +45 -40
  2. package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
  3. package/lib/cjs/src/api/DeviceManagementKit.js.map +2 -2
  4. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  5. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +2 -2
  6. package/lib/cjs/src/api/command/Command.js +1 -1
  7. package/lib/cjs/src/api/command/Command.js.map +1 -1
  8. package/lib/cjs/src/api/command/Errors.js +1 -1
  9. package/lib/cjs/src/api/command/Errors.js.map +3 -3
  10. package/lib/cjs/src/api/command/model/CommandResult.js +1 -1
  11. package/lib/cjs/src/api/command/model/CommandResult.js.map +1 -1
  12. package/lib/cjs/src/api/command/os/CloseAppCommand.js +1 -1
  13. package/lib/cjs/src/api/command/os/CloseAppCommand.js.map +2 -2
  14. package/lib/cjs/src/api/command/os/CloseAppCommand.test.js +1 -1
  15. package/lib/cjs/src/api/command/os/CloseAppCommand.test.js.map +2 -2
  16. package/lib/cjs/src/api/command/os/GetAppAndVersionCommand.js +1 -1
  17. package/lib/cjs/src/api/command/os/GetAppAndVersionCommand.js.map +2 -2
  18. package/lib/cjs/src/api/command/os/GetAppAndVersionCommand.test.js +1 -1
  19. package/lib/cjs/src/api/command/os/GetAppAndVersionCommand.test.js.map +2 -2
  20. package/lib/cjs/src/api/command/os/GetBatteryStatusCommand.js +1 -1
  21. package/lib/cjs/src/api/command/os/GetBatteryStatusCommand.js.map +2 -2
  22. package/lib/cjs/src/api/command/os/GetBatteryStatusCommand.test.js +1 -1
  23. package/lib/cjs/src/api/command/os/GetBatteryStatusCommand.test.js.map +3 -3
  24. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +1 -1
  25. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +2 -2
  26. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +1 -1
  27. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +2 -2
  28. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  29. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +2 -2
  30. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  31. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +2 -2
  32. package/lib/cjs/src/api/command/os/ListAppsCommand.js +1 -1
  33. package/lib/cjs/src/api/command/os/ListAppsCommand.js.map +2 -2
  34. package/lib/cjs/src/api/command/os/ListAppsCommand.test.js +1 -1
  35. package/lib/cjs/src/api/command/os/ListAppsCommand.test.js.map +2 -2
  36. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +1 -1
  37. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +2 -2
  38. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +1 -1
  39. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +2 -2
  40. package/lib/cjs/src/api/command/os/LoadCertificateCommand.js +1 -1
  41. package/lib/cjs/src/api/command/os/LoadCertificateCommand.js.map +2 -2
  42. package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js +1 -1
  43. package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js.map +3 -3
  44. package/lib/cjs/src/api/command/os/OpenAppCommand.js +1 -1
  45. package/lib/cjs/src/api/command/os/OpenAppCommand.js.map +2 -2
  46. package/lib/cjs/src/api/command/os/OpenAppCommand.test.js +1 -1
  47. package/lib/cjs/src/api/command/os/OpenAppCommand.test.js.map +2 -2
  48. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  49. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js.map +2 -2
  50. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  51. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  52. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  53. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  54. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  55. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  56. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  57. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  58. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
  59. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +2 -2
  60. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +1 -1
  61. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +1 -1
  62. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
  63. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +2 -2
  64. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -1
  65. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +1 -1
  66. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
  67. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +2 -2
  68. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -1
  69. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +1 -1
  70. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  71. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  72. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +1 -1
  73. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +2 -2
  74. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +1 -1
  75. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +2 -2
  76. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +1 -1
  77. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +2 -2
  78. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +1 -1
  79. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +2 -2
  80. package/lib/cjs/src/api/index.js +1 -1
  81. package/lib/cjs/src/api/index.js.map +2 -2
  82. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.js +1 -1
  83. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.js.map +3 -3
  84. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  85. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +2 -2
  86. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  87. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  88. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +1 -1
  89. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  90. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +2 -2
  91. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +1 -1
  92. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  93. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  94. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  95. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  96. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  97. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +2 -2
  98. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +1 -1
  99. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  100. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  101. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  102. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  103. package/lib/cjs/src/api/secure-channel/task/types.js +1 -1
  104. package/lib/cjs/src/api/secure-channel/task/types.js.map +2 -2
  105. package/lib/cjs/src/api/secure-channel/utils.js +1 -1
  106. package/lib/cjs/src/api/secure-channel/utils.js.map +3 -3
  107. package/lib/cjs/src/api/secure-channel/utils.test.js +1 -1
  108. package/lib/cjs/src/api/secure-channel/utils.test.js.map +3 -3
  109. package/lib/cjs/src/api/transport/model/ConnectedDevice.js +1 -1
  110. package/lib/cjs/src/api/transport/model/ConnectedDevice.js.map +3 -3
  111. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  112. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  113. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.js +1 -1
  114. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.js.map +3 -3
  115. package/lib/cjs/src/internal/crypto/CryptoService.js +2 -0
  116. package/lib/cjs/src/internal/crypto/CryptoService.js.map +7 -0
  117. package/lib/cjs/src/internal/crypto/NobleCryptoService.js +2 -0
  118. package/lib/cjs/src/internal/crypto/NobleCryptoService.js.map +7 -0
  119. package/lib/cjs/src/internal/crypto/NobleCryptoService.test.js +2 -0
  120. package/lib/cjs/src/internal/crypto/NobleCryptoService.test.js.map +7 -0
  121. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
  122. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  123. package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js +1 -1
  124. package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js.map +2 -2
  125. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  126. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  127. package/lib/cjs/src/internal/device-session/model/DeviceSession.test.js +2 -0
  128. package/lib/cjs/src/internal/device-session/model/DeviceSession.test.js.map +7 -0
  129. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js +1 -1
  130. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +2 -2
  131. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  132. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  133. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  134. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +2 -2
  135. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  136. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  137. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  138. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
  139. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.js +1 -1
  140. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.js.map +3 -3
  141. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  142. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  143. package/lib/cjs/src/internal/device-session/service/DeviceSessionService.js +1 -1
  144. package/lib/cjs/src/internal/device-session/service/DeviceSessionService.js.map +1 -1
  145. package/lib/cjs/src/internal/device-session/service/IntentQueueService.js +2 -0
  146. package/lib/cjs/src/internal/device-session/service/IntentQueueService.js.map +7 -0
  147. package/lib/cjs/src/internal/device-session/service/IntentQueueService.test.js +2 -0
  148. package/lib/cjs/src/internal/device-session/service/IntentQueueService.test.js.map +7 -0
  149. package/lib/cjs/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.js +2 -0
  150. package/lib/cjs/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.js.map +7 -0
  151. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  152. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  153. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  154. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
  155. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js +1 -1
  156. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js.map +2 -2
  157. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  158. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  159. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
  160. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
  161. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.js +1 -1
  162. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.js.map +3 -3
  163. package/lib/cjs/src/internal/discovery/use-case/ReconnectUseCase.js +2 -0
  164. package/lib/cjs/src/internal/discovery/use-case/ReconnectUseCase.js.map +7 -0
  165. package/lib/cjs/src/internal/discovery/use-case/ReconnectUseCase.test.js +2 -0
  166. package/lib/cjs/src/internal/discovery/use-case/ReconnectUseCase.test.js.map +7 -0
  167. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  168. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  169. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  170. package/lib/esm/package.json +45 -40
  171. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  172. package/lib/esm/src/api/DeviceManagementKit.js.map +2 -2
  173. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  174. package/lib/esm/src/api/DeviceManagementKit.test.js.map +2 -2
  175. package/lib/esm/src/api/command/Errors.js +1 -1
  176. package/lib/esm/src/api/command/Errors.js.map +3 -3
  177. package/lib/esm/src/api/command/model/CommandResult.js +1 -1
  178. package/lib/esm/src/api/command/model/CommandResult.js.map +1 -1
  179. package/lib/esm/src/api/command/os/CloseAppCommand.js +1 -1
  180. package/lib/esm/src/api/command/os/CloseAppCommand.js.map +2 -2
  181. package/lib/esm/src/api/command/os/CloseAppCommand.test.js +1 -1
  182. package/lib/esm/src/api/command/os/CloseAppCommand.test.js.map +2 -2
  183. package/lib/esm/src/api/command/os/GetAppAndVersionCommand.js +1 -1
  184. package/lib/esm/src/api/command/os/GetAppAndVersionCommand.js.map +2 -2
  185. package/lib/esm/src/api/command/os/GetAppAndVersionCommand.test.js +1 -1
  186. package/lib/esm/src/api/command/os/GetAppAndVersionCommand.test.js.map +2 -2
  187. package/lib/esm/src/api/command/os/GetBatteryStatusCommand.js +1 -1
  188. package/lib/esm/src/api/command/os/GetBatteryStatusCommand.js.map +2 -2
  189. package/lib/esm/src/api/command/os/GetBatteryStatusCommand.test.js +1 -1
  190. package/lib/esm/src/api/command/os/GetBatteryStatusCommand.test.js.map +3 -3
  191. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +1 -1
  192. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +2 -2
  193. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +1 -1
  194. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +2 -2
  195. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  196. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +2 -2
  197. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  198. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +2 -2
  199. package/lib/esm/src/api/command/os/ListAppsCommand.js +1 -1
  200. package/lib/esm/src/api/command/os/ListAppsCommand.js.map +2 -2
  201. package/lib/esm/src/api/command/os/ListAppsCommand.test.js +1 -1
  202. package/lib/esm/src/api/command/os/ListAppsCommand.test.js.map +2 -2
  203. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +1 -1
  204. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +2 -2
  205. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +1 -1
  206. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +2 -2
  207. package/lib/esm/src/api/command/os/LoadCertificateCommand.js +1 -1
  208. package/lib/esm/src/api/command/os/LoadCertificateCommand.js.map +2 -2
  209. package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js +1 -1
  210. package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js.map +3 -3
  211. package/lib/esm/src/api/command/os/OpenAppCommand.js +1 -1
  212. package/lib/esm/src/api/command/os/OpenAppCommand.js.map +2 -2
  213. package/lib/esm/src/api/command/os/OpenAppCommand.test.js +1 -1
  214. package/lib/esm/src/api/command/os/OpenAppCommand.test.js.map +2 -2
  215. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  216. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js.map +2 -2
  217. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  218. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  219. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  220. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  221. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  222. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  223. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
  224. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +2 -2
  225. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
  226. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +2 -2
  227. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
  228. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +2 -2
  229. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  230. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  231. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +1 -1
  232. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +3 -3
  233. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +1 -1
  234. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +3 -3
  235. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +1 -1
  236. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +3 -3
  237. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +1 -1
  238. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +3 -3
  239. package/lib/esm/src/api/index.js +1 -1
  240. package/lib/esm/src/api/index.js.map +3 -3
  241. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.js +1 -1
  242. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.js.map +3 -3
  243. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  244. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
  245. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  246. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  247. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  248. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +2 -2
  249. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  250. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  251. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  252. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  253. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +2 -2
  254. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  255. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  256. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  257. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  258. package/lib/esm/src/api/secure-channel/task/types.js +1 -1
  259. package/lib/esm/src/api/secure-channel/task/types.js.map +2 -2
  260. package/lib/esm/src/api/secure-channel/utils.js +1 -1
  261. package/lib/esm/src/api/secure-channel/utils.js.map +3 -3
  262. package/lib/esm/src/api/secure-channel/utils.test.js +1 -1
  263. package/lib/esm/src/api/secure-channel/utils.test.js.map +3 -3
  264. package/lib/esm/src/api/transport/model/ConnectedDevice.js +1 -1
  265. package/lib/esm/src/api/transport/model/ConnectedDevice.js.map +3 -3
  266. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  267. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  268. package/lib/esm/src/api/transport/model/TransportConnectedDevice.js +1 -1
  269. package/lib/esm/src/api/transport/model/TransportConnectedDevice.js.map +3 -3
  270. package/lib/esm/src/internal/crypto/CryptoService.js +1 -0
  271. package/lib/esm/src/internal/crypto/CryptoService.js.map +7 -0
  272. package/lib/esm/src/internal/crypto/NobleCryptoService.js +2 -0
  273. package/lib/esm/src/internal/crypto/NobleCryptoService.js.map +7 -0
  274. package/lib/esm/src/internal/crypto/NobleCryptoService.test.js +2 -0
  275. package/lib/esm/src/internal/crypto/NobleCryptoService.test.js.map +7 -0
  276. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
  277. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  278. package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js +1 -1
  279. package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js.map +2 -2
  280. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  281. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  282. package/lib/esm/src/internal/device-session/model/DeviceSession.test.js +2 -0
  283. package/lib/esm/src/internal/device-session/model/DeviceSession.test.js.map +7 -0
  284. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js +1 -1
  285. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +2 -2
  286. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  287. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  288. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  289. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +2 -2
  290. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  291. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  292. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  293. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
  294. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.js +1 -1
  295. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.js.map +3 -3
  296. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  297. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  298. package/lib/esm/src/internal/device-session/service/IntentQueueService.js +2 -0
  299. package/lib/esm/src/internal/device-session/service/IntentQueueService.js.map +7 -0
  300. package/lib/esm/src/internal/device-session/service/IntentQueueService.test.js +2 -0
  301. package/lib/esm/src/internal/device-session/service/IntentQueueService.test.js.map +7 -0
  302. package/lib/esm/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.js +2 -0
  303. package/lib/esm/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.js.map +7 -0
  304. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  305. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  306. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  307. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
  308. package/lib/esm/src/internal/discovery/di/discoveryTypes.js +1 -1
  309. package/lib/esm/src/internal/discovery/di/discoveryTypes.js.map +2 -2
  310. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  311. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  312. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
  313. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
  314. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.js +1 -1
  315. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.js.map +3 -3
  316. package/lib/esm/src/internal/discovery/use-case/ReconnectUseCase.js +2 -0
  317. package/lib/esm/src/internal/discovery/use-case/ReconnectUseCase.js.map +7 -0
  318. package/lib/esm/src/internal/discovery/use-case/ReconnectUseCase.test.js +2 -0
  319. package/lib/esm/src/internal/discovery/use-case/ReconnectUseCase.test.js.map +7 -0
  320. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  321. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  322. package/lib/types/src/api/DeviceManagementKit.d.ts +22 -0
  323. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  324. package/lib/types/src/api/command/Command.d.ts +4 -0
  325. package/lib/types/src/api/command/Command.d.ts.map +1 -1
  326. package/lib/types/src/api/command/Errors.d.ts +2 -2
  327. package/lib/types/src/api/command/Errors.d.ts.map +1 -1
  328. package/lib/types/src/api/command/model/CommandResult.d.ts +3 -3
  329. package/lib/types/src/api/command/model/CommandResult.d.ts.map +1 -1
  330. package/lib/types/src/api/command/os/CloseAppCommand.d.ts +1 -0
  331. package/lib/types/src/api/command/os/CloseAppCommand.d.ts.map +1 -1
  332. package/lib/types/src/api/command/os/GetAppAndVersionCommand.d.ts +1 -0
  333. package/lib/types/src/api/command/os/GetAppAndVersionCommand.d.ts.map +1 -1
  334. package/lib/types/src/api/command/os/GetBatteryStatusCommand.d.ts +1 -0
  335. package/lib/types/src/api/command/os/GetBatteryStatusCommand.d.ts.map +1 -1
  336. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +1 -0
  337. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -1
  338. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +1 -0
  339. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  340. package/lib/types/src/api/command/os/ListAppsCommand.d.ts +1 -0
  341. package/lib/types/src/api/command/os/ListAppsCommand.d.ts.map +1 -1
  342. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +1 -0
  343. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -1
  344. package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts +1 -0
  345. package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts.map +1 -1
  346. package/lib/types/src/api/command/os/OpenAppCommand.d.ts +1 -0
  347. package/lib/types/src/api/command/os/OpenAppCommand.d.ts.map +1 -1
  348. package/lib/types/src/api/device-action/DeviceAction.d.ts +0 -1
  349. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  350. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  351. package/lib/types/src/api/device-action/os/Errors.d.ts +5 -0
  352. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  353. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -1
  354. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +1 -0
  355. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -1
  356. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -1
  357. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +3 -2
  358. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -1
  359. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -1
  360. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +1 -0
  361. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -1
  362. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +2 -2
  363. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -1
  364. package/lib/types/src/api/index.d.ts +1 -1
  365. package/lib/types/src/api/index.d.ts.map +1 -1
  366. package/lib/types/src/api/logger-subscriber/service/ConsoleLogger.d.ts +1 -0
  367. package/lib/types/src/api/logger-subscriber/service/ConsoleLogger.d.ts.map +1 -1
  368. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -1
  369. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +1 -0
  370. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -1
  371. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -1
  372. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +1 -0
  373. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -1
  374. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -1
  375. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +1 -0
  376. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -1
  377. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
  378. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +1 -0
  379. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -1
  380. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +4 -0
  381. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -1
  382. package/lib/types/src/api/secure-channel/task/types.d.ts +7 -0
  383. package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -1
  384. package/lib/types/src/api/secure-channel/utils.d.ts +18 -1
  385. package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -1
  386. package/lib/types/src/api/transport/model/ConnectedDevice.d.ts +3 -2
  387. package/lib/types/src/api/transport/model/ConnectedDevice.d.ts.map +1 -1
  388. package/lib/types/src/api/transport/model/Errors.d.ts +5 -0
  389. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  390. package/lib/types/src/api/transport/model/TransportConnectedDevice.d.ts +3 -1
  391. package/lib/types/src/api/transport/model/TransportConnectedDevice.d.ts.map +1 -1
  392. package/lib/types/src/internal/crypto/CryptoService.d.ts +12 -0
  393. package/lib/types/src/internal/crypto/CryptoService.d.ts.map +1 -0
  394. package/lib/types/src/internal/crypto/NobleCryptoService.d.ts +8 -0
  395. package/lib/types/src/internal/crypto/NobleCryptoService.d.ts.map +1 -0
  396. package/lib/types/src/internal/crypto/NobleCryptoService.test.d.ts +2 -0
  397. package/lib/types/src/internal/crypto/NobleCryptoService.test.d.ts.map +1 -0
  398. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  399. package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts +1 -0
  400. package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts.map +1 -1
  401. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +12 -2
  402. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  403. package/lib/types/src/internal/device-session/model/DeviceSession.test.d.ts +2 -0
  404. package/lib/types/src/internal/device-session/model/DeviceSession.test.d.ts.map +1 -0
  405. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts +3 -1
  406. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts.map +1 -1
  407. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts +0 -1
  408. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts.map +1 -1
  409. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts +1 -0
  410. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -1
  411. package/lib/types/src/internal/device-session/service/DefaultDeviceSessionService.d.ts +7 -5
  412. package/lib/types/src/internal/device-session/service/DefaultDeviceSessionService.d.ts.map +1 -1
  413. package/lib/types/src/internal/device-session/service/DeviceSessionService.d.ts +28 -1
  414. package/lib/types/src/internal/device-session/service/DeviceSessionService.d.ts.map +1 -1
  415. package/lib/types/src/internal/device-session/service/IntentQueueService.d.ts +101 -0
  416. package/lib/types/src/internal/device-session/service/IntentQueueService.d.ts.map +1 -0
  417. package/lib/types/src/internal/device-session/service/IntentQueueService.test.d.ts +2 -0
  418. package/lib/types/src/internal/device-session/service/IntentQueueService.test.d.ts.map +1 -0
  419. package/lib/types/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.d.ts +19 -0
  420. package/lib/types/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.d.ts.map +1 -0
  421. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  422. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts +1 -0
  423. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts.map +1 -1
  424. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts +3 -2
  425. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts.map +1 -1
  426. package/lib/types/src/internal/discovery/use-case/DisconnectUseCase.d.ts.map +1 -1
  427. package/lib/types/src/internal/discovery/use-case/ReconnectUseCase.d.ts +32 -0
  428. package/lib/types/src/internal/discovery/use-case/ReconnectUseCase.d.ts.map +1 -0
  429. package/lib/types/src/internal/discovery/use-case/ReconnectUseCase.test.d.ts +2 -0
  430. package/lib/types/src/internal/discovery/use-case/ReconnectUseCase.test.d.ts.map +1 -0
  431. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +1 -1
  432. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  433. package/package.json +33 -28
  434. package/lib/cjs/src/internal/device-session/service/MutexService.js +0 -2
  435. package/lib/cjs/src/internal/device-session/service/MutexService.js.map +0 -7
  436. package/lib/cjs/src/internal/device-session/service/MutexService.test.js +0 -2
  437. package/lib/cjs/src/internal/device-session/service/MutexService.test.js.map +0 -7
  438. package/lib/esm/src/internal/device-session/service/MutexService.js +0 -2
  439. package/lib/esm/src/internal/device-session/service/MutexService.js.map +0 -7
  440. package/lib/esm/src/internal/device-session/service/MutexService.test.js +0 -2
  441. package/lib/esm/src/internal/device-session/service/MutexService.test.js.map +0 -7
  442. package/lib/types/src/internal/device-session/service/MutexService.d.ts +0 -6
  443. package/lib/types/src/internal/device-session/service/MutexService.d.ts.map +0 -1
  444. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts +0 -2
  445. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-action/task/GetFirmwareMetadataTask.test.ts"],
4
- "sourcesContent": ["import { EitherAsync } from \"purify-ts\";\n\nimport { InvalidStatusWordError } from \"@api/command/Errors\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport {\n type FinalFirmware,\n type McuFirmware,\n type OsuFirmware,\n} from \"@internal/manager-api/model/Firmware\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { GetFirmwareMetadataTask } from \"./GetFirmwareMetadataTask\";\n\ndescribe(\"GetFirmwareMetadataTask\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n const OS_VERSION = {\n mcuSephVersion: \"mcu_version\",\n mcuBootloaderVersion: \"bl_version\",\n seVersion: \"se_version\",\n } as GetOsVersionResponse;\n\n const CUSTOM_IMAGE_SIZE = 97;\n\n const DEVICE_VERSION = {\n id: 7,\n };\n\n const FIRMWARE_VERSION = {\n id: 361,\n version: \"1.6.0\",\n perso: \"perso_11\",\n } as FinalFirmware;\n\n const OSU_VERSION = {\n id: 362,\n perso: \"perso_11\",\n } as OsuFirmware;\n\n const NEXT_FIRMWARE_VERSION = {\n id: 363,\n version: \"1.7.0\",\n perso: \"perso_11\",\n mcuVersions: [1],\n } as FinalFirmware;\n\n const MCUS = [\n {\n id: 3,\n name: \"other_version\",\n },\n {\n id: 1,\n name: \"mcu_version\",\n },\n ] as McuFirmware[];\n\n const MANAGER_MOCK = {\n getDeviceVersion: vi.fn(),\n getFirmwareVersion: vi.fn(),\n getLatestFirmwareVersion: vi.fn(),\n getNextFirmwareVersion: vi.fn(),\n getMcuList: vi.fn(),\n };\n\n beforeEach(() => {\n vi.clearAllMocks();\n\n apiMock.getManagerApiService.mockReturnValue(\n MANAGER_MOCK as unknown as ManagerApiService,\n );\n MANAGER_MOCK.getDeviceVersion.mockReturnValue(\n EitherAsync(async () => DEVICE_VERSION),\n );\n MANAGER_MOCK.getFirmwareVersion.mockReturnValue(\n EitherAsync(async () => FIRMWARE_VERSION),\n );\n MANAGER_MOCK.getLatestFirmwareVersion.mockReturnValue(\n EitherAsync(async () => OSU_VERSION),\n );\n MANAGER_MOCK.getNextFirmwareVersion.mockReturnValue(\n EitherAsync(async () => NEXT_FIRMWARE_VERSION),\n );\n MANAGER_MOCK.getMcuList.mockReturnValue(EitherAsync(async () => MCUS));\n });\n\n it(\"success with no firmware update available\", async () => {\n // GIVEN\n apiMock.sendCommand\n .mockResolvedValueOnce(CommandResultFactory({ data: OS_VERSION }))\n .mockResolvedValueOnce(CommandResultFactory({ data: CUSTOM_IMAGE_SIZE }));\n MANAGER_MOCK.getLatestFirmwareVersion.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE_VERSION,\n firmwareVersion: {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: OS_VERSION,\n },\n firmwareUpdateContext: {\n currentFirmware: FIRMWARE_VERSION,\n availableUpdate: undefined,\n },\n customImage: { size: CUSTOM_IMAGE_SIZE },\n },\n }),\n );\n });\n\n it(\"success with a firmware update available\", async () => {\n // GIVEN\n apiMock.sendCommand\n .mockResolvedValueOnce(CommandResultFactory({ data: OS_VERSION }))\n .mockResolvedValueOnce(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE_VERSION,\n firmwareVersion: {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: OS_VERSION,\n },\n firmwareUpdateContext: {\n currentFirmware: FIRMWARE_VERSION,\n availableUpdate: {\n osuFirmware: OSU_VERSION,\n finalFirmware: NEXT_FIRMWARE_VERSION,\n mcuUpdateRequired: false,\n },\n },\n customImage: {},\n },\n }),\n );\n expect(MANAGER_MOCK.getDeviceVersion).toHaveBeenCalledWith(OS_VERSION);\n expect(MANAGER_MOCK.getFirmwareVersion).toHaveBeenCalledWith(\n OS_VERSION,\n DEVICE_VERSION,\n );\n expect(MANAGER_MOCK.getLatestFirmwareVersion).toHaveBeenCalledWith(\n FIRMWARE_VERSION,\n DEVICE_VERSION,\n );\n expect(MANAGER_MOCK.getNextFirmwareVersion).toHaveBeenCalledWith(\n OSU_VERSION,\n );\n });\n\n it(\"success with a firmware update available and MCU update\", async () => {\n // GIVEN\n apiMock.sendCommand\n .mockResolvedValueOnce(CommandResultFactory({ data: OS_VERSION }))\n .mockResolvedValueOnce(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n const nextFirmware = {\n ...NEXT_FIRMWARE_VERSION,\n mcuVersions: [3],\n };\n MANAGER_MOCK.getNextFirmwareVersion.mockReturnValue(\n EitherAsync(async () => nextFirmware),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE_VERSION,\n firmwareVersion: {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: OS_VERSION,\n },\n firmwareUpdateContext: {\n currentFirmware: FIRMWARE_VERSION,\n availableUpdate: {\n osuFirmware: OSU_VERSION,\n finalFirmware: nextFirmware,\n mcuUpdateRequired: true,\n },\n },\n customImage: {},\n },\n }),\n );\n });\n\n it(\"should fail when OS version cannot be retrieved\", async () => {\n // GIVEN\n apiMock.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n });\n\n it(\"should fail if device version cannot be fetched\", async () => {\n // GIVEN\n apiMock.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ data: OS_VERSION }),\n );\n MANAGER_MOCK.getDeviceVersion.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\n \"Cannot fetch current firmware metadata\",\n ),\n }),\n );\n });\n\n it(\"should fail if firmware version cannot be fetched\", async () => {\n // GIVEN\n apiMock.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ data: OS_VERSION }),\n );\n MANAGER_MOCK.getFirmwareVersion.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\n \"Cannot fetch current firmware metadata\",\n ),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CAAC,CAC3C,EACAO,EAAa,mBAAmB,uBAC9B,eAAY,MAAO,CAAE,OAAAC,CAAO,IAAM,CAChCA,EAAO,IAAI,MAAM,OAAO,CAAC,CAC3B,CAAC,CACH,EAGA,MAAMC,EAAS,MAAM,IAAI,0BAAwBV,CAAO,EAAE,IAAI,EAG9D,OAAOU,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yBACT,wCACF,CACF,CAAC,CACH,CACF,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { EitherAsync } from \"purify-ts\";\n\nimport {\n InvalidGetFirmwareMetadataResponseError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport {\n type FinalFirmware,\n type McuFirmware,\n type OsuFirmware,\n} from \"@internal/manager-api/model/Firmware\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { GetFirmwareMetadataTask } from \"./GetFirmwareMetadataTask\";\n\ndescribe(\"GetFirmwareMetadataTask\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n const OS_VERSION = {\n mcuSephVersion: \"mcu_version\",\n mcuBootloaderVersion: \"bl_version\",\n seVersion: \"se_version\",\n } as GetOsVersionResponse;\n\n const CUSTOM_IMAGE_SIZE = 97;\n\n const DEVICE_VERSION = {\n id: 7,\n };\n\n const FIRMWARE_VERSION = {\n id: 361,\n version: \"1.6.0\",\n perso: \"perso_11\",\n } as FinalFirmware;\n\n const OSU_VERSION = {\n id: 362,\n perso: \"perso_11\",\n } as OsuFirmware;\n\n const NEXT_FIRMWARE_VERSION = {\n id: 363,\n version: \"1.7.0\",\n perso: \"perso_11\",\n mcuVersions: [1],\n } as FinalFirmware;\n\n const MCUS = [\n {\n id: 3,\n name: \"other_version\",\n },\n {\n id: 1,\n name: \"mcu_version\",\n },\n ] as McuFirmware[];\n\n const MANAGER_MOCK = {\n getDeviceVersion: vi.fn(),\n getFirmwareVersion: vi.fn(),\n getLatestFirmwareVersion: vi.fn(),\n getNextFirmwareVersion: vi.fn(),\n getMcuList: vi.fn(),\n };\n\n beforeEach(() => {\n vi.clearAllMocks();\n\n apiMock.getManagerApiService.mockReturnValue(\n MANAGER_MOCK as unknown as ManagerApiService,\n );\n MANAGER_MOCK.getDeviceVersion.mockReturnValue(\n EitherAsync(async () => DEVICE_VERSION),\n );\n MANAGER_MOCK.getFirmwareVersion.mockReturnValue(\n EitherAsync(async () => FIRMWARE_VERSION),\n );\n MANAGER_MOCK.getLatestFirmwareVersion.mockReturnValue(\n EitherAsync(async () => OSU_VERSION),\n );\n MANAGER_MOCK.getNextFirmwareVersion.mockReturnValue(\n EitherAsync(async () => NEXT_FIRMWARE_VERSION),\n );\n MANAGER_MOCK.getMcuList.mockReturnValue(EitherAsync(async () => MCUS));\n });\n\n it(\"success with no firmware update available\", async () => {\n // GIVEN\n apiMock.sendCommand\n .mockResolvedValueOnce(CommandResultFactory({ data: OS_VERSION }))\n .mockResolvedValueOnce(CommandResultFactory({ data: CUSTOM_IMAGE_SIZE }));\n MANAGER_MOCK.getLatestFirmwareVersion.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE_VERSION,\n firmwareVersion: {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: OS_VERSION,\n },\n firmwareUpdateContext: {\n currentFirmware: FIRMWARE_VERSION,\n availableUpdate: undefined,\n },\n customImage: { size: CUSTOM_IMAGE_SIZE },\n },\n }),\n );\n });\n\n it(\"success with a firmware update available\", async () => {\n // GIVEN\n apiMock.sendCommand\n .mockResolvedValueOnce(CommandResultFactory({ data: OS_VERSION }))\n .mockResolvedValueOnce(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE_VERSION,\n firmwareVersion: {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: OS_VERSION,\n },\n firmwareUpdateContext: {\n currentFirmware: FIRMWARE_VERSION,\n availableUpdate: {\n osuFirmware: OSU_VERSION,\n finalFirmware: NEXT_FIRMWARE_VERSION,\n mcuUpdateRequired: false,\n },\n },\n customImage: {},\n },\n }),\n );\n expect(MANAGER_MOCK.getDeviceVersion).toHaveBeenCalledWith(OS_VERSION);\n expect(MANAGER_MOCK.getFirmwareVersion).toHaveBeenCalledWith(\n OS_VERSION,\n DEVICE_VERSION,\n );\n expect(MANAGER_MOCK.getLatestFirmwareVersion).toHaveBeenCalledWith(\n FIRMWARE_VERSION,\n DEVICE_VERSION,\n );\n expect(MANAGER_MOCK.getNextFirmwareVersion).toHaveBeenCalledWith(\n OSU_VERSION,\n );\n });\n\n it(\"success with a firmware update available and MCU update\", async () => {\n // GIVEN\n apiMock.sendCommand\n .mockResolvedValueOnce(CommandResultFactory({ data: OS_VERSION }))\n .mockResolvedValueOnce(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n const nextFirmware = {\n ...NEXT_FIRMWARE_VERSION,\n mcuVersions: [3],\n };\n MANAGER_MOCK.getNextFirmwareVersion.mockReturnValue(\n EitherAsync(async () => nextFirmware),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n deviceVersion: DEVICE_VERSION,\n firmware: FIRMWARE_VERSION,\n firmwareVersion: {\n mcu: \"mcu_version\",\n bootloader: \"bl_version\",\n os: \"se_version\",\n metadata: OS_VERSION,\n },\n firmwareUpdateContext: {\n currentFirmware: FIRMWARE_VERSION,\n availableUpdate: {\n osuFirmware: OSU_VERSION,\n finalFirmware: nextFirmware,\n mcuUpdateRequired: true,\n },\n },\n customImage: {},\n },\n }),\n );\n });\n\n it(\"should fail when OS version cannot be retrieved\", async () => {\n // GIVEN\n apiMock.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({ error: new InvalidStatusWordError(\"error\") }),\n );\n });\n\n it(\"should fail if device version cannot be fetched with InvalidGetFirmwareMetadataResponseError\", async () => {\n // GIVEN\n apiMock.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ data: OS_VERSION }),\n );\n MANAGER_MOCK.getDeviceVersion.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidGetFirmwareMetadataResponseError(),\n }),\n );\n });\n\n it(\"should fail if firmware version cannot be fetched with InvalidGetFirmwareMetadataResponseError\", async () => {\n // GIVEN\n apiMock.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ data: OS_VERSION }),\n );\n MANAGER_MOCK.getFirmwareVersion.mockReturnValueOnce(\n EitherAsync(async ({ throwE }) => {\n throwE(new Error(\"error\"));\n }),\n );\n\n // WHEN\n const result = await new GetFirmwareMetadataTask(apiMock).run();\n\n // THEN\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidGetFirmwareMetadataResponseError(),\n }),\n );\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA4B,qBAE5BC,EAGO,+BACPC,EAAqC,4CAErCC,EAAgD,6DAQhDC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C3B,CAAC,CACH,EAGA,MAAMC,EAAS,MAAM,IAAI,0BAAwBV,CAAO,EAAE,IAAI,EAG9D,OAAOU,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yCACb,CAAC,CACH,CACF,CAAC,CACH,CAAC",
6
6
  "names": ["import_purify_ts", "import_Errors", "import_CommandResult", "import_makeInternalApi", "import_GetFirmwareMetadataTask", "apiMock", "OS_VERSION", "CUSTOM_IMAGE_SIZE", "DEVICE_VERSION", "FIRMWARE_VERSION", "OSU_VERSION", "NEXT_FIRMWARE_VERSION", "MCUS", "MANAGER_MOCK", "throwE", "result", "nextFirmware"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var D=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var de=Object.prototype.hasOwnProperty;var De=(p,o)=>{for(var i in o)D(p,i,{get:o[i],enumerable:!0})},d=(p,o,i,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of Ae(o))!de.call(p,s)&&s!==i&&D(p,s,{get:()=>o[s],enumerable:!(l=xe(o,s))||l.enumerable});return p},r=(p,o,i)=>(d(p,o,"default"),i&&d(i,o,"default"));var le=p=>d(D({},"__esModule",{value:!0}),p);var e={};De(e,{APDU_MAX_PAYLOAD:()=>c.APDU_MAX_PAYLOAD,Apdu:()=>u.Apdu,ApduBuilder:()=>c.ApduBuilder,ApduParser:()=>v.ApduParser,ApduResponse:()=>Y.ApduResponse,AppAlreadyInstalledDAError:()=>t.AppAlreadyInstalledDAError,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>q.BleDeviceInfos,ByteArrayBuilder:()=>S.ByteArrayBuilder,ByteArrayParser:()=>C.ByteArrayParser,CallTaskInAppDeviceAction:()=>T.CallTaskInAppDeviceAction,CloseAppCommand:()=>L.CloseAppCommand,CommandResultFactory:()=>n.CommandResultFactory,CommandResultStatus:()=>n.CommandResultStatus,CommandUtils:()=>I.CommandUtils,ConnectedDevice:()=>ae.ConnectedDevice,ConsoleLogger:()=>ne.ConsoleLogger,DeviceActionStatus:()=>b.DeviceActionStatus,DeviceConnectionStateMachine:()=>se.DeviceConnectionStateMachine,DeviceLockedError:()=>t.DeviceLockedError,DeviceManagementKit:()=>te.DeviceManagementKit,DeviceManagementKitBuilder:()=>pe.DeviceManagementKitBuilder,DeviceModel:()=>m.DeviceModel,DeviceModelId:()=>m.DeviceModelId,DeviceSessionStateType:()=>j.DeviceSessionStateType,DeviceStatus:()=>O.DeviceStatus,FramerUtils:()=>oe.FramerUtils,GenuineCheckDeviceAction:()=>z.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>g.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>U.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>P.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>B.GetOsVersionCommand,GlobalCommandError:()=>x.GlobalCommandError,GlobalCommandErrorHandler:()=>x.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>V.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>J.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>k.InstallOrUpdateAppsDeviceAction,InvalidStatusWordError:()=>y.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>m.LEDGER_VENDOR_ID,ListAppsCommand:()=>E.ListAppsCommand,ListAppsDeviceAction:()=>W.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>_.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>Q.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>G.LoadCertificateCommand,LogLevel:()=>ie.LogLevel,OpenAppCommand:()=>M.OpenAppCommand,OpenAppDeviceAction:()=>F.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>H.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>t.OutOfMemoryDAError,RefusedByUserDAError:()=>t.RefusedByUserDAError,SecureChannelError:()=>$.SecureChannelError,SendCommandInAppDeviceAction:()=>w.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>X.StaticDeviceModelDataSource,TransportConnectedDevice:()=>ce.TransportConnectedDevice,TransportDeviceModel:()=>N.TransportDeviceModel,UninstallAppDeviceAction:()=>Z.UninstallAppDeviceAction,UnknownDAError:()=>t.UnknownDAError,UnsupportedFirmwareDAError:()=>t.UnsupportedFirmwareDAError,UserInteractionRequired:()=>h.UserInteractionRequired,WebLogsExporterLogger:()=>me.WebLogsExporterLogger,XStateDeviceAction:()=>K.XStateDeviceAction,base64StringToBuffer:()=>A.base64StringToBuffer,bufferToHexaString:()=>a.bufferToHexaString,connectedDeviceStubBuilder:()=>fe.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>ee.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>re.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>a.hexaStringToBuffer,isBase64String:()=>A.isBase64String,isCommandErrorCode:()=>R.isCommandErrorCode,isHexaString:()=>a.isHexaString,isSuccessCommandResult:()=>n.isSuccessCommandResult});module.exports=le(e);var u=require("./apdu/model/Apdu"),c=require("./apdu/utils/ApduBuilder"),v=require("./apdu/utils/ApduParser");r(e,require("./apdu/utils/AppBuilderError"),module.exports);var S=require("./apdu/utils/ByteArrayBuilder"),C=require("./apdu/utils/ByteArrayParser"),y=require("./command/Errors"),n=require("./command/model/CommandResult"),L=require("./command/os/CloseAppCommand"),g=require("./command/os/GetAppAndVersionCommand"),f=require("./command/os/GetBatteryStatusCommand"),B=require("./command/os/GetOsVersionCommand"),E=require("./command/os/ListAppsCommand"),G=require("./command/os/LoadCertificateCommand"),M=require("./command/os/OpenAppCommand"),R=require("./command/utils/CommandErrors"),I=require("./command/utils/CommandUtils"),x=require("./command/utils/GlobalCommandError"),m=require("./device/DeviceModel"),O=require("./device/DeviceStatus"),b=require("./device-action/model/DeviceActionState"),h=require("./device-action/model/UserInteractionRequired"),T=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),t=require("./device-action/os/Errors"),U=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),P=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),V=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),k=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),W=require("./device-action/os/ListApps/ListAppsDeviceAction"),_=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),F=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),H=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),w=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),K=require("./device-action/xstate-utils/XStateDeviceAction"),X=require("./device-model/data/StaticDeviceModelDataSource"),q=require("./device-model/model/BleDeviceInfos"),N=require("./device-model/model/DeviceModel"),Y=require("./device-session/ApduResponse");r(e,require("./device-session/data/FramerConst"),module.exports);var j=require("./device-session/DeviceSessionState"),z=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),J=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),Q=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),Z=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),$=require("../internal/secure-channel/model/Errors"),ee=require("./device-session/service/DefaultApduReceiverService.stub"),re=require("./device-session/service/DefaultApduSenderService.stub"),oe=require("./device-session/utils/FramerUtils"),te=require("./DeviceManagementKit"),pe=require("./DeviceManagementKitBuilder");r(e,require("./Error"),module.exports);var ie=require("./logger-subscriber/model/LogLevel"),ne=require("./logger-subscriber/service/ConsoleLogger"),me=require("./logger-subscriber/service/WebLogsExporterLogger"),ae=require("./transport/model/ConnectedDevice"),se=require("./transport/model/DeviceConnectionStateMachine");r(e,require("./transport/model/Errors"),module.exports);var ce=require("./transport/model/TransportConnectedDevice"),fe=require("./transport/model/TransportConnectedDevice.stub");r(e,require("./types"),module.exports);var A=require("./utils/Base64String"),a=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,AppAlreadyInstalledDAError,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,RefusedByUserDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
1
+ "use strict";var l=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var Ae=Object.prototype.hasOwnProperty;var De=(p,o)=>{for(var i in o)l(p,i,{get:o[i],enumerable:!0})},D=(p,o,i,v)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of de(o))!Ae.call(p,s)&&s!==i&&l(p,s,{get:()=>o[s],enumerable:!(v=xe(o,s))||v.enumerable});return p},r=(p,o,i)=>(D(p,o,"default"),i&&D(i,o,"default"));var le=p=>D(l({},"__esModule",{value:!0}),p);var e={};De(e,{APDU_MAX_PAYLOAD:()=>c.APDU_MAX_PAYLOAD,Apdu:()=>u.Apdu,ApduBuilder:()=>c.ApduBuilder,ApduParser:()=>S.ApduParser,ApduResponse:()=>Y.ApduResponse,AppAlreadyInstalledDAError:()=>t.AppAlreadyInstalledDAError,BatteryStatusType:()=>x.BatteryStatusType,BleDeviceInfos:()=>q.BleDeviceInfos,ByteArrayBuilder:()=>C.ByteArrayBuilder,ByteArrayParser:()=>y.ByteArrayParser,CallTaskInAppDeviceAction:()=>T.CallTaskInAppDeviceAction,CloseAppCommand:()=>E.CloseAppCommand,CommandResultFactory:()=>n.CommandResultFactory,CommandResultStatus:()=>n.CommandResultStatus,CommandUtils:()=>I.CommandUtils,ConnectedDevice:()=>ae.ConnectedDevice,ConsoleLogger:()=>ne.ConsoleLogger,DeviceActionStatus:()=>b.DeviceActionStatus,DeviceConnectionStateMachine:()=>se.DeviceConnectionStateMachine,DeviceLockedError:()=>t.DeviceLockedError,DeviceManagementKit:()=>te.DeviceManagementKit,DeviceManagementKitBuilder:()=>pe.DeviceManagementKitBuilder,DeviceModel:()=>m.DeviceModel,DeviceModelId:()=>m.DeviceModelId,DeviceSessionStateType:()=>j.DeviceSessionStateType,DeviceStatus:()=>O.DeviceStatus,FramerUtils:()=>oe.FramerUtils,GenuineCheckDeviceAction:()=>z.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>L.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>x.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>U.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>P.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>g.GetOsVersionCommand,GlobalCommandError:()=>d.GlobalCommandError,GlobalCommandErrorHandler:()=>d.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>V.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>J.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>k.InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError:()=>f.InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError:()=>f.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>m.LEDGER_VENDOR_ID,ListAppsCommand:()=>B.ListAppsCommand,ListAppsDeviceAction:()=>F.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>W.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>Q.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>G.LoadCertificateCommand,LogLevel:()=>ie.LogLevel,OpenAppCommand:()=>M.OpenAppCommand,OpenAppDeviceAction:()=>_.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>w.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>t.OutOfMemoryDAError,RefusedByUserDAError:()=>t.RefusedByUserDAError,SecureChannelError:()=>$.SecureChannelError,SendCommandInAppDeviceAction:()=>H.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>X.StaticDeviceModelDataSource,TransportConnectedDevice:()=>ce.TransportConnectedDevice,TransportDeviceModel:()=>N.TransportDeviceModel,UninstallAppDeviceAction:()=>Z.UninstallAppDeviceAction,UnknownDAError:()=>t.UnknownDAError,UnsupportedFirmwareDAError:()=>t.UnsupportedFirmwareDAError,UserInteractionRequired:()=>h.UserInteractionRequired,WebLogsExporterLogger:()=>me.WebLogsExporterLogger,XStateDeviceAction:()=>K.XStateDeviceAction,base64StringToBuffer:()=>A.base64StringToBuffer,bufferToHexaString:()=>a.bufferToHexaString,connectedDeviceStubBuilder:()=>fe.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>ee.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>re.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>a.hexaStringToBuffer,isBase64String:()=>A.isBase64String,isCommandErrorCode:()=>R.isCommandErrorCode,isHexaString:()=>a.isHexaString,isSuccessCommandResult:()=>n.isSuccessCommandResult});module.exports=le(e);var u=require("./apdu/model/Apdu"),c=require("./apdu/utils/ApduBuilder"),S=require("./apdu/utils/ApduParser");r(e,require("./apdu/utils/AppBuilderError"),module.exports);var C=require("./apdu/utils/ByteArrayBuilder"),y=require("./apdu/utils/ByteArrayParser"),f=require("./command/Errors"),n=require("./command/model/CommandResult"),E=require("./command/os/CloseAppCommand"),L=require("./command/os/GetAppAndVersionCommand"),x=require("./command/os/GetBatteryStatusCommand"),g=require("./command/os/GetOsVersionCommand"),B=require("./command/os/ListAppsCommand"),G=require("./command/os/LoadCertificateCommand"),M=require("./command/os/OpenAppCommand"),R=require("./command/utils/CommandErrors"),I=require("./command/utils/CommandUtils"),d=require("./command/utils/GlobalCommandError"),m=require("./device/DeviceModel"),O=require("./device/DeviceStatus"),b=require("./device-action/model/DeviceActionState"),h=require("./device-action/model/UserInteractionRequired"),T=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),t=require("./device-action/os/Errors"),U=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),P=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),V=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),k=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),F=require("./device-action/os/ListApps/ListAppsDeviceAction"),W=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),_=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),w=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),H=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),K=require("./device-action/xstate-utils/XStateDeviceAction"),X=require("./device-model/data/StaticDeviceModelDataSource"),q=require("./device-model/model/BleDeviceInfos"),N=require("./device-model/model/DeviceModel"),Y=require("./device-session/ApduResponse");r(e,require("./device-session/data/FramerConst"),module.exports);var j=require("./device-session/DeviceSessionState"),z=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),J=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),Q=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),Z=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),$=require("../internal/secure-channel/model/Errors"),ee=require("./device-session/service/DefaultApduReceiverService.stub"),re=require("./device-session/service/DefaultApduSenderService.stub"),oe=require("./device-session/utils/FramerUtils"),te=require("./DeviceManagementKit"),pe=require("./DeviceManagementKitBuilder");r(e,require("./Error"),module.exports);var ie=require("./logger-subscriber/model/LogLevel"),ne=require("./logger-subscriber/service/ConsoleLogger"),me=require("./logger-subscriber/service/WebLogsExporterLogger"),ae=require("./transport/model/ConnectedDevice"),se=require("./transport/model/DeviceConnectionStateMachine");r(e,require("./transport/model/Errors"),module.exports);var ce=require("./transport/model/TransportConnectedDevice"),fe=require("./transport/model/TransportConnectedDevice.stub");r(e,require("./types"),module.exports);var A=require("./utils/Base64String"),a=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,AppAlreadyInstalledDAError,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,RefusedByUserDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/index.ts"],
4
- "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
- "mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,s5GAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAAuC,+BACvCC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1ChB,EAOO,wCACPiB,EAA8C,iFAC9CC,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAgD,qFAChDC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAAoD,6FACpDC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BhB,EAAqC,+CACrCiB,EAA6B,4CAC7BhC,EAAAN,EAAc,gDAxFd,gBAyFA,IAAAuC,EAGO,kDACPC,EAAyC,mFACzCC,EAAuC,+EACvCC,EAA8C,6FAC9CC,EAAyC,mFACzClC,EAAmC,iDAEnCmC,GAAsD,uEACtDC,GAAoD,qEACpDC,GAA4B,iDAC5BC,GAAoC,oCACpCC,GAA2C,2CAC3C1C,EAAAN,EAAc,sBAxGd,gBAyGA,IAAAiD,GAAyB,iDACzBC,GAA8B,wDAC9BC,GAAsC,gEACtCC,GAAgC,gDAChCC,GAGO,6DACP/C,EAAAN,EAAc,uCAjHd,gBAkHA,IAAAsD,GAAyC,yDACzCA,GAA2C,8DAC3ChD,EAAAN,EAAc,sBApHd,gBAqHA,IAAAuD,EAAqD,mCACrDC,EAIO",
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 {\n InvalidGetFirmwareMetadataResponseError,\n InvalidStatusWordError,\n} 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 AppAlreadyInstalledDAError,\n DeviceLockedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
+ "mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,4+GAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAGO,+BACPC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1ChB,EAOO,wCACPiB,EAA8C,iFAC9CC,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAgD,qFAChDC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAAoD,6FACpDC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BhB,EAAqC,+CACrCiB,EAA6B,4CAC7BhC,EAAAN,EAAc,gDA3Fd,gBA4FA,IAAAuC,EAGO,kDACPC,EAAyC,mFACzCC,EAAuC,+EACvCC,EAA8C,6FAC9CC,EAAyC,mFACzClC,EAAmC,iDAEnCmC,GAAsD,uEACtDC,GAAoD,qEACpDC,GAA4B,iDAC5BC,GAAoC,oCACpCC,GAA2C,2CAC3C1C,EAAAN,EAAc,sBA3Gd,gBA4GA,IAAAiD,GAAyB,iDACzBC,GAA8B,wDAC9BC,GAAsC,gEACtCC,GAAgC,gDAChCC,GAGO,6DACP/C,EAAAN,EAAc,uCApHd,gBAqHA,IAAAsD,GAAyC,yDACzCA,GAA2C,8DAC3ChD,EAAAN,EAAc,sBAvHd,gBAwHA,IAAAuD,EAAqD,mCACrDC,EAIO",
6
6
  "names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_Base64String", "import_HexaString"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var b=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},n=(t,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of L(e))!g.call(t,r)&&r!==o&&i(t,r,{get:()=>e[r],enumerable:!(l=c(e,r))||l.enumerable});return t};var s=t=>n(i({},"__esModule",{value:!0}),t);var f={};b(f,{ConsoleLogger:()=>v});module.exports=s(f);var a=require("../../logger-subscriber/model/LogLevel");class v{maxLevel;constructor(e=a.LogLevel.Debug){this.maxLevel=e}log(e,o,l){const r=`[${l.tag}]`;switch(e){case a.LogLevel.Info:{this.maxLevel>=a.LogLevel.Info&&console.info(r,o,l.data);break}case a.LogLevel.Warning:{this.maxLevel>=a.LogLevel.Warning&&console.warn(r,o,l.data);break}case a.LogLevel.Debug:{this.maxLevel>=a.LogLevel.Debug&&console.debug(r,o,l.data);break}case a.LogLevel.Error:{this.maxLevel>=a.LogLevel.Error&&console.error(r,o,l.data);break}case a.LogLevel.Fatal:{this.maxLevel>=a.LogLevel.Fatal&&console.error(r,o,l.data);break}default:console.log(r,o,l.data)}}}0&&(module.exports={ConsoleLogger});
1
+ "use strict";var l=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var L=(o,e)=>{for(var a in e)l(o,a,{get:e[a],enumerable:!0})},h=(o,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of s(e))!c.call(o,r)&&r!==a&&l(o,r,{get:()=>e[r],enumerable:!(i=g(e,r))||i.enumerable});return o};var n=o=>h(l({},"__esModule",{value:!0}),o);var v={};L(v,{ConsoleLogger:()=>b});module.exports=n(v);var t=require("../../logger-subscriber/model/LogLevel");class b{maxLevel;constructor(e=t.LogLevel.Debug){this.maxLevel=e}log(e,a,i){const r=`[${i.tag}]`;switch(e){case t.LogLevel.Info:{this.maxLevel>=t.LogLevel.Info&&this.logWithData(r,console.info,a,i);break}case t.LogLevel.Warning:{this.maxLevel>=t.LogLevel.Warning&&this.logWithData(r,console.warn,a,i);break}case t.LogLevel.Debug:{this.maxLevel>=t.LogLevel.Debug&&this.logWithData(r,console.debug,a,i);break}case t.LogLevel.Error:{this.maxLevel>=t.LogLevel.Error&&this.logWithData(r,console.error,a,i);break}case t.LogLevel.Fatal:{this.maxLevel>=t.LogLevel.Fatal&&this.logWithData(r,console.error,a,i);break}default:this.logWithData(r,console.log,a,i)}}logWithData(e,a,i,r){r.data?a(e,i,r.data):a(e,i)}}0&&(module.exports={ConsoleLogger});
2
2
  //# sourceMappingURL=ConsoleLogger.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/logger-subscriber/service/ConsoleLogger.ts"],
4
- "sourcesContent": ["import { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { type LogSubscriberOptions } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\n\nexport class ConsoleLogger implements LoggerSubscriberService {\n private readonly maxLevel: LogLevel;\n\n constructor(level: LogLevel = LogLevel.Debug) {\n this.maxLevel = level;\n }\n\n log(\n level: LogLevel | null,\n message: string,\n options: LogSubscriberOptions,\n ): void {\n const tag = `[${options.tag}]`;\n\n switch (level) {\n case LogLevel.Info: {\n if (this.maxLevel >= LogLevel.Info) {\n console.info(tag, message, options.data);\n }\n break;\n }\n case LogLevel.Warning: {\n if (this.maxLevel >= LogLevel.Warning) {\n console.warn(tag, message, options.data);\n }\n break;\n }\n case LogLevel.Debug: {\n if (this.maxLevel >= LogLevel.Debug) {\n console.debug(tag, message, options.data);\n }\n break;\n }\n case LogLevel.Error: {\n if (this.maxLevel >= LogLevel.Error) {\n console.error(tag, message, options.data);\n }\n break;\n }\n case LogLevel.Fatal: {\n if (this.maxLevel >= LogLevel.Fatal) {\n console.error(tag, message, options.data);\n }\n break;\n }\n default:\n console.log(tag, message, options.data);\n }\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,iDAIlB,MAAMF,CAAiD,CAC3C,SAEjB,YAAYG,EAAkB,WAAS,MAAO,CAC5C,KAAK,SAAWA,CAClB,CAEA,IACEA,EACAC,EACAC,EACM,CACN,MAAMC,EAAM,IAAID,EAAQ,GAAG,IAE3B,OAAQF,EAAO,CACb,KAAK,WAAS,KAAM,CACd,KAAK,UAAY,WAAS,MAC5B,QAAQ,KAAKG,EAAKF,EAASC,EAAQ,IAAI,EAEzC,KACF,CACA,KAAK,WAAS,QAAS,CACjB,KAAK,UAAY,WAAS,SAC5B,QAAQ,KAAKC,EAAKF,EAASC,EAAQ,IAAI,EAEzC,KACF,CACA,KAAK,WAAS,MAAO,CACf,KAAK,UAAY,WAAS,OAC5B,QAAQ,MAAMC,EAAKF,EAASC,EAAQ,IAAI,EAE1C,KACF,CACA,KAAK,WAAS,MAAO,CACf,KAAK,UAAY,WAAS,OAC5B,QAAQ,MAAMC,EAAKF,EAASC,EAAQ,IAAI,EAE1C,KACF,CACA,KAAK,WAAS,MAAO,CACf,KAAK,UAAY,WAAS,OAC5B,QAAQ,MAAMC,EAAKF,EAASC,EAAQ,IAAI,EAE1C,KACF,CACA,QACE,QAAQ,IAAIC,EAAKF,EAASC,EAAQ,IAAI,CAC1C,CACF,CACF",
6
- "names": ["ConsoleLogger_exports", "__export", "ConsoleLogger", "__toCommonJS", "import_LogLevel", "level", "message", "options", "tag"]
4
+ "sourcesContent": ["import { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { type LogSubscriberOptions } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\n\nexport class ConsoleLogger implements LoggerSubscriberService {\n private readonly maxLevel: LogLevel;\n\n constructor(level: LogLevel = LogLevel.Debug) {\n this.maxLevel = level;\n }\n\n log(\n level: LogLevel | null,\n message: string,\n options: LogSubscriberOptions,\n ): void {\n const tag = `[${options.tag}]`;\n\n switch (level) {\n case LogLevel.Info: {\n if (this.maxLevel >= LogLevel.Info) {\n this.logWithData(tag, console.info, message, options);\n }\n break;\n }\n case LogLevel.Warning: {\n if (this.maxLevel >= LogLevel.Warning) {\n this.logWithData(tag, console.warn, message, options);\n }\n break;\n }\n case LogLevel.Debug: {\n if (this.maxLevel >= LogLevel.Debug) {\n this.logWithData(tag, console.debug, message, options);\n }\n break;\n }\n case LogLevel.Error: {\n if (this.maxLevel >= LogLevel.Error) {\n this.logWithData(tag, console.error, message, options);\n }\n break;\n }\n case LogLevel.Fatal: {\n if (this.maxLevel >= LogLevel.Fatal) {\n this.logWithData(tag, console.error, message, options);\n }\n break;\n }\n default:\n this.logWithData(tag, console.log, message, options);\n }\n }\n\n private logWithData(\n tag: string,\n logFunction: (...args: unknown[]) => void,\n message: string,\n options: LogSubscriberOptions,\n ): void {\n if (options.data) {\n logFunction(tag, message, options.data);\n } else {\n logFunction(tag, message);\n }\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,iDAIlB,MAAMF,CAAiD,CAC3C,SAEjB,YAAYG,EAAkB,WAAS,MAAO,CAC5C,KAAK,SAAWA,CAClB,CAEA,IACEA,EACAC,EACAC,EACM,CACN,MAAMC,EAAM,IAAID,EAAQ,GAAG,IAE3B,OAAQF,EAAO,CACb,KAAK,WAAS,KAAM,CACd,KAAK,UAAY,WAAS,MAC5B,KAAK,YAAYG,EAAK,QAAQ,KAAMF,EAASC,CAAO,EAEtD,KACF,CACA,KAAK,WAAS,QAAS,CACjB,KAAK,UAAY,WAAS,SAC5B,KAAK,YAAYC,EAAK,QAAQ,KAAMF,EAASC,CAAO,EAEtD,KACF,CACA,KAAK,WAAS,MAAO,CACf,KAAK,UAAY,WAAS,OAC5B,KAAK,YAAYC,EAAK,QAAQ,MAAOF,EAASC,CAAO,EAEvD,KACF,CACA,KAAK,WAAS,MAAO,CACf,KAAK,UAAY,WAAS,OAC5B,KAAK,YAAYC,EAAK,QAAQ,MAAOF,EAASC,CAAO,EAEvD,KACF,CACA,KAAK,WAAS,MAAO,CACf,KAAK,UAAY,WAAS,OAC5B,KAAK,YAAYC,EAAK,QAAQ,MAAOF,EAASC,CAAO,EAEvD,KACF,CACA,QACE,KAAK,YAAYC,EAAK,QAAQ,IAAKF,EAASC,CAAO,CACvD,CACF,CAEQ,YACNC,EACAC,EACAH,EACAC,EACM,CACFA,EAAQ,KACVE,EAAYD,EAAKF,EAASC,EAAQ,IAAI,EAEtCE,EAAYD,EAAKF,CAAO,CAE5B,CACF",
6
+ "names": ["ConsoleLogger_exports", "__export", "ConsoleLogger", "__toCommonJS", "import_LogLevel", "level", "message", "options", "tag", "logFunction"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=require("../../device-model/model/DeviceModel.stub"),o=require("../../../internal/device-session/data/DeviceSessionRefresherConst"),s=require("../../../internal/device-session/model/DeviceSession"),c=require("./WebLogsExporterLogger");describe("getJSONStringifyReplacer",()=>{it("should return a function that replaces Uint8Array correctly",()=>{const e=(0,c.getJSONStringifyReplacer)(),t=new Uint8Array([1,2,3]),r=e("key",t);expect(r).toEqual({hex:"0x010203",readableHex:"01 02 03",value:"1,2,3"})}),it("should return a function that replaces DeviceSession",()=>{const e=(0,i.deviceModelStubBuilder)(),t=(0,c.getJSONStringifyReplacer)(),r={deviceModel:(0,i.deviceModelStubBuilder)(),type:"USB",id:"mockedDeviceId",sendApdu:vi.fn(),transport:"USB"},n=new s.DeviceSession({connectedDevice:r,id:"mockedSessionId"},vi.fn(),{},{},o.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS),a=JSON.stringify(n,t),l=`{"id":"mockedSessionId","connectedDevice":{"deviceModel":${JSON.stringify(e)},"type":"USB","id":"mockedDeviceId"}}`;n.close(),expect(a).toEqual(l)}),it("should return a function that replaces circular references",()=>{const e={name:"Alice"};e.self=e;const t='{"name":"Alice","self":"[Circular]"}',r=JSON.stringify(e,(0,c.getJSONStringifyReplacer)());expect(r).toEqual(t)})});
1
+ "use strict";var i=require("../../device-model/model/DeviceModel.stub"),o=require("../../../internal/device-session/data/DeviceSessionRefresherConst"),s=require("../../../internal/device-session/model/DeviceSession.stub"),c=require("./WebLogsExporterLogger");describe("getJSONStringifyReplacer",()=>{it("should return a function that replaces Uint8Array correctly",()=>{const e=(0,c.getJSONStringifyReplacer)(),t=new Uint8Array([1,2,3]),r=e("key",t);expect(r).toEqual({hex:"0x010203",readableHex:"01 02 03",value:"1,2,3"})}),it("should return a function that replaces DeviceSession",()=>{const e=(0,i.deviceModelStubBuilder)(),t=(0,c.getJSONStringifyReplacer)(),r={deviceModel:(0,i.deviceModelStubBuilder)(),type:"USB",id:"mockedDeviceId",sendApdu:vi.fn(),transport:"USB"},n=(0,s.deviceSessionStubBuilder)({connectedDevice:r,id:"mockedSessionId"},vi.fn(),{},{},o.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS),a=JSON.stringify(n,t),l=`{"id":"mockedSessionId","connectedDevice":{"deviceModel":${JSON.stringify(e)},"type":"USB","id":"mockedDeviceId"}}`;n.close(),expect(a).toEqual(l)}),it("should return a function that replaces circular references",()=>{const e={name:"Alice"};e.self=e;const t='{"name":"Alice","self":"[Circular]"}',r=JSON.stringify(e,(0,c.getJSONStringifyReplacer)());expect(r).toEqual(t)})});
2
2
  //# sourceMappingURL=WebLogsExporterLogger.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/logger-subscriber/service/WebLogsExporterLogger.test.ts"],
4
- "sourcesContent": ["import { deviceModelStubBuilder } from \"@api/device-model/model/DeviceModel.stub\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { getJSONStringifyReplacer } from \"./WebLogsExporterLogger\";\n\ndescribe(\"getJSONStringifyReplacer\", () => {\n it(\"should return a function that replaces Uint8Array correctly\", () => {\n const replacer = getJSONStringifyReplacer();\n const value = new Uint8Array([1, 2, 3]);\n const result = replacer(\"key\", value);\n expect(result).toEqual({\n hex: \"0x010203\",\n readableHex: \"01 02 03\",\n value: \"1,2,3\",\n });\n });\n\n it(\"should return a function that replaces DeviceSession\", () => {\n const stubDeviceModel = deviceModelStubBuilder();\n const replacer = getJSONStringifyReplacer();\n\n const connectedDevice: TransportConnectedDevice = {\n deviceModel: deviceModelStubBuilder(),\n type: \"USB\",\n id: \"mockedDeviceId\",\n sendApdu: vi.fn(),\n transport: \"USB\",\n };\n\n const value = new DeviceSession(\n {\n connectedDevice,\n id: \"mockedSessionId\",\n },\n vi.fn(),\n {} as ManagerApiService,\n {} as SecureChannelService,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n const result = JSON.stringify(value, replacer);\n const expected = `{\"id\":\"mockedSessionId\",\"connectedDevice\":{\"deviceModel\":${JSON.stringify(\n stubDeviceModel,\n )},\"type\":\"USB\",\"id\":\"mockedDeviceId\"}}`;\n value.close();\n expect(result).toEqual(expected);\n });\n\n it(\"should return a function that replaces circular references\", () => {\n interface CircularObject {\n name: string;\n self?: CircularObject;\n }\n\n const obj: CircularObject = { name: \"Alice\" };\n obj.self = obj;\n\n const expected = '{\"name\":\"Alice\",\"self\":\"[Circular]\"}';\n const result = JSON.stringify(obj, getJSONStringifyReplacer());\n expect(result).toEqual(expected);\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAuC,oDAEvCC,EAAyD,qEACzDC,EAA8B,wDAI9BC,EAAyC,mCAEzC,SAAS,2BAA4B,IAAM,CACzC,GAAG,8DAA+D,IAAM,CACtE,MAAMC,KAAW,4BAAyB,EACpCC,EAAQ,IAAI,WAAW,CAAC,EAAG,EAAG,CAAC,CAAC,EAChCC,EAASF,EAAS,MAAOC,CAAK,EACpC,OAAOC,CAAM,EAAE,QAAQ,CACrB,IAAK,WACL,YAAa,WACb,MAAO,OACT,CAAC,CACH,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMC,KAAkB,0BAAuB,EACzCH,KAAW,4BAAyB,EAEpCI,EAA4C,CAChD,eAAa,0BAAuB,EACpC,KAAM,MACN,GAAI,iBACJ,SAAU,GAAG,GAAG,EAChB,UAAW,KACb,EAEMH,EAAQ,IAAI,gBAChB,CACE,gBAAAG,EACA,GAAI,iBACN,EACA,GAAG,GAAG,EACN,CAAC,EACD,CAAC,EACD,0CACF,EACMF,EAAS,KAAK,UAAUD,EAAOD,CAAQ,EACvCK,EAAW,4DAA4D,KAAK,UAChFF,CACF,CAAC,wCACDF,EAAM,MAAM,EACZ,OAAOC,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,EAED,GAAG,6DAA8D,IAAM,CAMrE,MAAMC,EAAsB,CAAE,KAAM,OAAQ,EAC5CA,EAAI,KAAOA,EAEX,MAAMD,EAAW,uCACXH,EAAS,KAAK,UAAUI,KAAK,4BAAyB,CAAC,EAC7D,OAAOJ,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { deviceModelStubBuilder } from \"@api/device-model/model/DeviceModel.stub\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { getJSONStringifyReplacer } from \"./WebLogsExporterLogger\";\n\ndescribe(\"getJSONStringifyReplacer\", () => {\n it(\"should return a function that replaces Uint8Array correctly\", () => {\n const replacer = getJSONStringifyReplacer();\n const value = new Uint8Array([1, 2, 3]);\n const result = replacer(\"key\", value);\n expect(result).toEqual({\n hex: \"0x010203\",\n readableHex: \"01 02 03\",\n value: \"1,2,3\",\n });\n });\n\n it(\"should return a function that replaces DeviceSession\", () => {\n const stubDeviceModel = deviceModelStubBuilder();\n const replacer = getJSONStringifyReplacer();\n\n const connectedDevice: TransportConnectedDevice = {\n deviceModel: deviceModelStubBuilder(),\n type: \"USB\",\n id: \"mockedDeviceId\",\n sendApdu: vi.fn(),\n transport: \"USB\",\n };\n\n const value = deviceSessionStubBuilder(\n {\n connectedDevice,\n id: \"mockedSessionId\",\n },\n vi.fn(),\n {} as ManagerApiService,\n {} as SecureChannelService,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n const result = JSON.stringify(value, replacer);\n const expected = `{\"id\":\"mockedSessionId\",\"connectedDevice\":{\"deviceModel\":${JSON.stringify(\n stubDeviceModel,\n )},\"type\":\"USB\",\"id\":\"mockedDeviceId\"}}`;\n value.close();\n expect(result).toEqual(expected);\n });\n\n it(\"should return a function that replaces circular references\", () => {\n interface CircularObject {\n name: string;\n self?: CircularObject;\n }\n\n const obj: CircularObject = { name: \"Alice\" };\n obj.self = obj;\n\n const expected = '{\"name\":\"Alice\",\"self\":\"[Circular]\"}';\n const result = JSON.stringify(obj, getJSONStringifyReplacer());\n expect(result).toEqual(expected);\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAuC,oDAEvCC,EAAyD,qEACzDC,EAAyC,6DAIzCC,EAAyC,mCAEzC,SAAS,2BAA4B,IAAM,CACzC,GAAG,8DAA+D,IAAM,CACtE,MAAMC,KAAW,4BAAyB,EACpCC,EAAQ,IAAI,WAAW,CAAC,EAAG,EAAG,CAAC,CAAC,EAChCC,EAASF,EAAS,MAAOC,CAAK,EACpC,OAAOC,CAAM,EAAE,QAAQ,CACrB,IAAK,WACL,YAAa,WACb,MAAO,OACT,CAAC,CACH,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMC,KAAkB,0BAAuB,EACzCH,KAAW,4BAAyB,EAEpCI,EAA4C,CAChD,eAAa,0BAAuB,EACpC,KAAM,MACN,GAAI,iBACJ,SAAU,GAAG,GAAG,EAChB,UAAW,KACb,EAEMH,KAAQ,4BACZ,CACE,gBAAAG,EACA,GAAI,iBACN,EACA,GAAG,GAAG,EACN,CAAC,EACD,CAAC,EACD,0CACF,EACMF,EAAS,KAAK,UAAUD,EAAOD,CAAQ,EACvCK,EAAW,4DAA4D,KAAK,UAChFF,CACF,CAAC,wCACDF,EAAM,MAAM,EACZ,OAAOC,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,EAED,GAAG,6DAA8D,IAAM,CAMrE,MAAMC,EAAsB,CAAE,KAAM,OAAQ,EAC5CA,EAAI,KAAOA,EAEX,MAAMD,EAAW,uCACXH,EAAS,KAAK,UAAUI,KAAK,4BAAyB,CAAC,EAC7D,OAAOJ,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,CACH,CAAC",
6
6
  "names": ["import_DeviceModel", "import_DeviceSessionRefresherConst", "import_DeviceSession", "import_WebLogsExporterLogger", "replacer", "value", "result", "stubDeviceModel", "connectedDevice", "expected", "obj"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var g=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var O=(o,t)=>{for(var s in t)g(o,s,{get:t[s],enumerable:!0})},A=(o,t,s,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of x(t))!w.call(o,a)&&a!==s&&g(o,a,{get:()=>t[a],enumerable:!(u=I(t,a))||u.enumerable});return o};var F=o=>A(g({},"__esModule",{value:!0}),o);var M={};O(M,{GenuineCheckDeviceAction:()=>T});module.exports=F(M);var m=require("purify-ts"),n=require("xstate"),d=require("../../../command/model/CommandResult"),D=require("../../../command/os/GetOsVersionCommand"),l=require("../../../device-action/model/UserInteractionRequired"),V=require("../../../device-action/os/Const"),k=require("../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),C=require("../../../device-action/xstate-utils/XStateDeviceAction"),G=require("../../../device-session/DeviceSessionState"),f=require("../../../secure-channel/task/ConnectToSecureChannelTask"),h=require("../../../secure-channel/task/types"),E=require("../../../secure-channel/utils");class T extends C.XStateDeviceAction{makeStateMachine(t){const{getOsVersion:s,getDeviceVersion:u,getFirmwareVersion:a,genuineCheck:v,getDeviceSessionState:i,setDeviceSessionState:c}=this.extractDependencies(t),p=this.input.unlockTimeout??V.DEFAULT_UNLOCK_TIMEOUT_MS,S=new k.GoToDashboardDeviceAction({input:{unlockTimeout:p}}).makeStateMachine(t);return(0,n.setup)({types:{input:{},context:{},output:{}},actors:{goToDashboard:S,getOsVersion:(0,n.fromPromise)(s),getDeviceVersion:(0,n.fromPromise)(u),getFirmwareVersion:(0,n.fromPromise)(a),genuineCheck:(0,n.fromObservable)(v)},guards:{hasError:e=>e.context._internalState.error!==null},actions:{assignErrorFromEvent:(0,n.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"GenuineCheckDeviceAction",initial:"DeviceReady",context:e=>({input:{unlockTimeout:e.input.unlockTimeout},intermediateValue:{requiredUserInteraction:l.UserInteractionRequired.None},_internalState:{error:null,result:{isGenuine:!1},getOsVersionResponse:null,deviceVersion:null,firmwareVersion:null}}),states:{DeviceReady:{always:{target:"GoToDashboard"}},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:e=>({unlockTimeout:e.context.input.unlockTimeout}),onSnapshot:{actions:(0,n.assign)({intermediateValue:e=>({...e.context.intermediateValue,requiredUserInteraction:e.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetOsVersion"}]},GetOsVersion:{invoke:{id:"getOsVersion",src:"getOsVersion",input:e=>{},onDone:{target:"GetOsVersionCheck",actions:(0,n.assign)({_internalState:e=>{if((0,d.isSuccessCommandResult)(e.event.output)){const r=i(),y=e.event.output.data.secureElementFlags.isSecureConnectionAllowed;return r.sessionStateType!==G.DeviceSessionStateType.Connected&&c({...r,isSecureConnectionAllowed:y}),{...e.context._internalState,getOsVersionResponse:e.event.output.data}}return{...e.context._internalState,error:e.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetDeviceVersion"}]},GetDeviceVersion:{invoke:{id:"getDeviceVersion",src:"getDeviceVersion",input:e=>({deviceInfo:e.context._internalState.getOsVersionResponse}),onDone:{target:"GetDeviceVersionCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:r=>({...e.context._internalState,deviceVersion:r}),Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetDeviceVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetFirmwareVersion"}]},GetFirmwareVersion:{invoke:{id:"getFirmwareVersion",src:"getFirmwareVersion",input:e=>({deviceInfo:e.context._internalState.getOsVersionResponse,deviceVersion:e.context._internalState.deviceVersion}),onDone:{target:"GetFirmwareVersionCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:r=>({...e.context._internalState,firmwareVersion:r}),Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetFirmwareVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GenuineCheck"}]},GenuineCheck:{invoke:{id:"genuineCheck",src:"genuineCheck",input:e=>({deviceInfo:e.context._internalState.getOsVersionResponse,finalFirmware:e.context._internalState.firmwareVersion}),onSnapshot:{actions:(0,n.assign)({intermediateValue:e=>{switch(e.event.snapshot.context?.type){case h.SecureChannelEventType.PermissionRequested:return{requiredUserInteraction:l.UserInteractionRequired.AllowSecureConnection};case h.SecureChannelEventType.PermissionGranted:return{requiredUserInteraction:l.UserInteractionRequired.None};default:return{...e.context.intermediateValue}}},_internalState:e=>e.event.snapshot.context?.type===h.SecureChannelEventType.Error?{...e.context._internalState,error:e.event.snapshot.context.error.mapDAErrors()}:e.event.snapshot.context?.type===h.SecureChannelEventType.Result?{...e.context._internalState,result:{isGenuine:(0,E.isDeviceGenuine)(e.event.snapshot.context.payload)}}:e.context._internalState})},onDone:{target:"GenuineCheckCheck"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GenuineCheckCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success"}]},Success:{type:"final"},Error:{type:"final"}},output:e=>e.context._internalState.error?(0,m.Left)(e.context._internalState.error):(0,m.Right)(e.context._internalState.result)})}extractDependencies(t){return{getOsVersion:()=>t.sendCommand(new D.GetOsVersionCommand),getDeviceVersion:({input:i})=>{const{deviceInfo:c}=i;return t.getManagerApiService().getDeviceVersion(c)},getFirmwareVersion:({input:i})=>{const{deviceInfo:c,deviceVersion:p}=i;return t.getManagerApiService().getFirmwareVersion(c,p)},genuineCheck:({input:i})=>{const{deviceInfo:c,finalFirmware:p}=i,S=t.getSecureChannelService().genuineCheck(c,p);return new f.ConnectToSecureChannelTask(t,{connection:S}).run()},getDeviceSessionState:()=>t.getDeviceSessionState(),setDeviceSessionState:i=>t.setDeviceSessionState(i)}}}0&&(module.exports={GenuineCheckDeviceAction});
1
+ "use strict";var d=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var O=(o,t)=>{for(var s in t)d(o,s,{get:t[s],enumerable:!0})},A=(o,t,s,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of E(t))!w.call(o,a)&&a!==s&&d(o,a,{get:()=>t[a],enumerable:!(p=y(t,a))||p.enumerable});return o};var F=o=>A(d({},"__esModule",{value:!0}),o);var M={};O(M,{GenuineCheckDeviceAction:()=>T});module.exports=F(M);var m=require("purify-ts"),n=require("xstate"),v=require("../../../command/model/CommandResult"),D=require("../../../command/os/GetOsVersionCommand"),l=require("../../../device-action/model/UserInteractionRequired"),V=require("../../../device-action/os/Const"),k=require("../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),C=require("../../../device-action/xstate-utils/XStateDeviceAction"),G=require("../../../device-session/DeviceSessionState"),f=require("../../../secure-channel/task/ConnectToSecureChannelTask"),u=require("../../../secure-channel/task/types"),x=require("../../../secure-channel/utils");class T extends C.XStateDeviceAction{makeStateMachine(t){const{getOsVersion:s,getDeviceVersion:p,getFirmwareVersion:a,genuineCheck:g,getDeviceSessionState:i,setDeviceSessionState:c}=this.extractDependencies(t),h=this.input.unlockTimeout??V.DEFAULT_UNLOCK_TIMEOUT_MS,S=new k.GoToDashboardDeviceAction({input:{unlockTimeout:h}}).makeStateMachine(t);return(0,n.setup)({types:{input:{},context:{},output:{}},actors:{goToDashboard:S,getOsVersion:(0,n.fromPromise)(s),getDeviceVersion:(0,n.fromPromise)(p),getFirmwareVersion:(0,n.fromPromise)(a),genuineCheck:(0,n.fromObservable)(g)},guards:{hasError:e=>e.context._internalState.error!==null},actions:{assignErrorFromEvent:(0,n.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"GenuineCheckDeviceAction",initial:"DeviceReady",context:e=>({input:{unlockTimeout:e.input.unlockTimeout},intermediateValue:{requiredUserInteraction:l.UserInteractionRequired.None},_internalState:{error:null,result:{isGenuine:!1},getOsVersionResponse:null,deviceVersion:null,firmwareVersion:null}}),states:{DeviceReady:{always:{target:"GoToDashboard"}},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:e=>({unlockTimeout:e.context.input.unlockTimeout}),onSnapshot:{actions:(0,n.assign)({intermediateValue:e=>({...e.context.intermediateValue,requiredUserInteraction:e.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetOsVersion"}]},GetOsVersion:{invoke:{id:"getOsVersion",src:"getOsVersion",input:e=>{},onDone:{target:"GetOsVersionCheck",actions:(0,n.assign)({_internalState:e=>{if((0,v.isSuccessCommandResult)(e.event.output)){const r=i(),I=e.event.output.data.secureElementFlags.isSecureConnectionAllowed;return r.sessionStateType!==G.DeviceSessionStateType.Connected&&c({...r,isSecureConnectionAllowed:I}),{...e.context._internalState,getOsVersionResponse:e.event.output.data}}return{...e.context._internalState,error:e.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetDeviceVersion"}]},GetDeviceVersion:{invoke:{id:"getDeviceVersion",src:"getDeviceVersion",input:e=>({deviceInfo:e.context._internalState.getOsVersionResponse}),onDone:{target:"GetDeviceVersionCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:r=>({...e.context._internalState,deviceVersion:r}),Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetDeviceVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetFirmwareVersion"}]},GetFirmwareVersion:{invoke:{id:"getFirmwareVersion",src:"getFirmwareVersion",input:e=>({deviceInfo:e.context._internalState.getOsVersionResponse,deviceVersion:e.context._internalState.deviceVersion}),onDone:{target:"GetFirmwareVersionCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:r=>({...e.context._internalState,firmwareVersion:r}),Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetFirmwareVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GenuineCheck"}]},GenuineCheck:{invoke:{id:"genuineCheck",src:"genuineCheck",input:e=>({deviceInfo:e.context._internalState.getOsVersionResponse,finalFirmware:e.context._internalState.firmwareVersion}),onSnapshot:{actions:(0,n.assign)({intermediateValue:e=>{switch(e.event.snapshot.context?.type){case u.SecureChannelEventType.DeviceId:return{...e.context.intermediateValue,deviceId:e.event.snapshot.context.payload.deviceId};case u.SecureChannelEventType.PermissionRequested:return{...e.context.intermediateValue,requiredUserInteraction:l.UserInteractionRequired.AllowSecureConnection};case u.SecureChannelEventType.PermissionGranted:return{...e.context.intermediateValue,requiredUserInteraction:l.UserInteractionRequired.None};default:return{...e.context.intermediateValue}}},_internalState:e=>e.event.snapshot.context?.type===u.SecureChannelEventType.Error?{...e.context._internalState,error:e.event.snapshot.context.error.mapDAErrors()}:e.event.snapshot.context?.type===u.SecureChannelEventType.Result?{...e.context._internalState,result:{isGenuine:(0,x.isDeviceGenuine)(e.event.snapshot.context.payload)}}:e.context._internalState})},onDone:{target:"GenuineCheckCheck"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GenuineCheckCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success"}]},Success:{type:"final"},Error:{type:"final"}},output:e=>e.context._internalState.error?(0,m.Left)(e.context._internalState.error):(0,m.Right)(e.context._internalState.result)})}extractDependencies(t){return{getOsVersion:()=>t.sendCommand(new D.GetOsVersionCommand),getDeviceVersion:({input:i})=>{const{deviceInfo:c}=i;return t.getManagerApiService().getDeviceVersion(c)},getFirmwareVersion:({input:i})=>{const{deviceInfo:c,deviceVersion:h}=i;return t.getManagerApiService().getFirmwareVersion(c,h)},genuineCheck:({input:i})=>{const{deviceInfo:c,finalFirmware:h}=i,S=t.getSecureChannelService().genuineCheck(c,h);return new f.ConnectToSecureChannelTask(t,{connection:S}).run()},getDeviceSessionState:()=>t.getDeviceSessionState(),setDeviceSessionState:i=>t.setDeviceSessionState(i)}}}0&&(module.exports={GenuineCheckDeviceAction});
2
2
  //# sourceMappingURL=GenuineCheckDeviceAction.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.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 { 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 {\n type GenuineCheckDAError,\n type GenuineCheckDAInput,\n type GenuineCheckDAIntermediateValue,\n type GenuineCheckDAOutput,\n type GenuineCheckStateMachineInternalState,\n type MachineDependencies,\n} from \"@api/secure-channel/device-action/GenuineCheck/types\";\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 { isDeviceGenuine } from \"@api/secure-channel/utils\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\n\nexport class GenuineCheckDeviceAction extends XStateDeviceAction<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n> {\n override makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n > {\n type types = StateMachineTypes<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n >;\n\n const {\n getOsVersion,\n getDeviceVersion,\n getFirmwareVersion,\n genuineCheck,\n getDeviceSessionState,\n setDeviceSessionState,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\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 goToDashboard: goToDashboardMachine,\n getOsVersion: fromPromise(getOsVersion),\n getDeviceVersion: fromPromise(getDeviceVersion),\n getFirmwareVersion: fromPromise(getFirmwareVersion),\n genuineCheck: fromObservable(genuineCheck),\n },\n guards: {\n hasError: (_) => _.context._internalState.error !== null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"],\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QHEwDsCuBLNYDCAFmAMYDWAImAG5bFgCCxALlgPZoB0lNdASmAEMIATwDEAbQAMAXUSgADq1hYW7OSAAeiAIwB2AGwAWDvskBOAKwAmC9YvbJADkMAaEMMQBmT2ZPazuo6SFp6SDpKG+gC+UW6omDj4RGTctAzMbJzIrAAqrOQCsAQARqwCAE4QohDsYBw4VKykdVC5+YUlZZVSskggisqqaOpaCFaGntocEwaOFkYR2oa6bh4IZsEcuta6Nmbajp76tjFx6Ni4hCQU1GmMQxzZeQVFpRVVYOXlrOUc8gA2AiYADMfgBbDitZ4dN7dGTqAYqTIjRDjSbTTyzeaGRbLVaIOa6LY7PYHI4nWIgeIXJLXVJ0e6ZR5tF6dd5XMgSeF9RFDFFjQ5WExhXQbYKGRxWKwrdyoo4cbT+UUOQz+UyeU5U86JDk3HjpB5PdqvLoQXUSbS9BRKJFqPqjKyC4V6MUWCVSmVrfySBVKsxSyxmAKSaKU6k65J6u4ZdiPMBMADysAAap9lOxqrV6mhGs1IfGk6nyum0D0ETa+favJFPNNDBtHAcQ8cQ-j1qEOJ43d5JMFG8dDJrw5dI-SDUzUImU2nMuayzyK8iq2NDELtoFVWZ9JilmY2-X9BxnNvbLYjBMzEPtSO6bcGTGsgXp8XZ5GLVb+ou7aAHaviRu1R3es220Kx-A4EMbEmVcg0kaUrwSG8UjvcdY0nMcixLTNcGzXMWnjDCZ3YedrUGJcf0QAxjElRZMWcSx5hAqxzA4Cw5i3XtRWcKUEJpXUx0ZNCCJQzDMlET5vl+AEgVBcoIRgJhCJfYjuVI21hmXKij2Y1U6PrM8230bQLE7Gs3X9MxVwpM5ENpZD9UEx9FJEoi0DnVTPzI79NB0MCh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MA221hHDnJqjiOm9dHasRqmVR0cx+w7OGa1URXcKkGOmVIhAkhR5Q1Yvwt0JTmL1ReXEt5OjYwAGUMDEDoLAeA3yjFjEsD0+Yug9AzFhp4ECBghQ4qMuclsl9dmwM4AAUQeuUQ5+VvA1S2JKbOzEWZ1xPm6Q8QiJSSwdkcDUMQohAA */\n id: \"GenuineCheckDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n error: null,\n result: { isGenuine: false },\n getOsVersionResponse: null,\n deviceVersion: null,\n firmwareVersion: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"GoToDashboard\",\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<GenuineCheckStateMachineInternalState>({\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: \"GetDeviceVersion\",\n },\n ],\n },\n GetDeviceVersion: {\n invoke: {\n id: \"getDeviceVersion\",\n src: \"getDeviceVersion\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n }),\n onDone: {\n target: \"GetDeviceVersionCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: (deviceVersion) => ({\n ..._.context._internalState,\n deviceVersion,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetDeviceVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n { target: \"GetFirmwareVersion\" },\n ],\n },\n GetFirmwareVersion: {\n invoke: {\n id: \"getFirmwareVersion\",\n src: \"getFirmwareVersion\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n deviceVersion: _.context._internalState.deviceVersion!,\n }),\n onDone: {\n target: \"GetFirmwareVersionCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: (firmwareVersion) => ({\n ..._.context._internalState,\n firmwareVersion,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetFirmwareVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n { target: \"GenuineCheck\" },\n ],\n },\n GenuineCheck: {\n invoke: {\n id: \"genuineCheck\",\n src: \"genuineCheck\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n finalFirmware: _.context._internalState.firmwareVersion!,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => {\n switch (_.event.snapshot.context?.type) {\n case SecureChannelEventType.PermissionRequested: {\n return {\n requiredUserInteraction:\n UserInteractionRequired.AllowSecureConnection,\n };\n }\n case SecureChannelEventType.PermissionGranted: {\n return {\n requiredUserInteraction: UserInteractionRequired.None,\n };\n }\n default:\n return {\n ..._.context.intermediateValue,\n };\n }\n },\n _internalState: (_) => {\n if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Error\n ) {\n return {\n ..._.context._internalState,\n error: _.event.snapshot.context.error.mapDAErrors(),\n };\n } else if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Result\n ) {\n return {\n ..._.context._internalState,\n result: {\n isGenuine: isDeviceGenuine(\n _.event.snapshot.context.payload,\n ),\n },\n };\n }\n return _.context._internalState;\n },\n }),\n },\n onDone: {\n target: \"GenuineCheckCheck\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GenuineCheckCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (_) => {\n if (_.context._internalState.error) {\n return Left(_.context._internalState.error);\n } else {\n return Right(_.context._internalState.result);\n }\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getOsVersion = () =>\n internalApi.sendCommand(new GetOsVersionCommand());\n\n const getDeviceVersion = ({\n input,\n }: Input<{ deviceInfo: GetOsVersionResponse }>) => {\n const { deviceInfo } = input;\n return internalApi.getManagerApiService().getDeviceVersion(deviceInfo);\n };\n\n const getFirmwareVersion = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n deviceVersion: DeviceVersion;\n }>) => {\n const { deviceInfo, deviceVersion } = input;\n return internalApi\n .getManagerApiService()\n .getFirmwareVersion(deviceInfo, deviceVersion);\n };\n\n const genuineCheck = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n finalFirmware: FinalFirmware;\n }>) => {\n const { deviceInfo, finalFirmware } = input;\n const eitherConnection = internalApi\n .getSecureChannelService()\n .genuineCheck(deviceInfo, finalFirmware);\n return new ConnectToSecureChannelTask(internalApi, {\n connection: eitherConnection,\n }).run();\n };\n\n return {\n getOsVersion,\n getDeviceVersion,\n getFirmwareVersion,\n genuineCheck,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2D,kBAE3DC,EAAuC,4CACvCC,EAGO,+CAEPC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAA0C,yEAE1CC,EAGO,8DACPC,EAGO,kDASPC,EAA2C,+DAC3CC,EAAuC,0CAEvCC,EAAgC,qCAIzB,MAAMb,UAAiC,oBAM5C,CACS,iBACPc,EAOA,CASA,KAAM,CACJ,aAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,aAAAC,EACA,sBAAAC,EACA,sBAAAC,CACF,EAAI,KAAK,oBAAoBN,CAAW,EAElCO,EAAgB,KAAK,MAAM,eAAiB,4BAE5CC,EAAuB,IAAI,4BAA0B,CACzD,MAAO,CACL,cAAAD,CACF,CACF,CAAC,EAAE,iBAAiBP,CAAW,EAE/B,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,cAAeQ,EACf,gBAAc,eAAYP,CAAY,EAC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CACE,OAAQ,SACV,CACF,CACF,EACA,QAAS,CACP,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAASA,GACHA,EAAE,QAAQ,eAAe,SACpB,QAAKA,EAAE,QAAQ,eAAe,KAAK,KAEnC,SAAMA,EAAE,QAAQ,eAAe,MAAM,CAGlD,CAAC,CACH,CAEA,oBAAoBT,EAA+C,CAsCjE,MAAO,CACL,aAtCmB,IACnBA,EAAY,YAAY,IAAI,qBAAqB,EAsCjD,iBApCuB,CAAC,CACxB,MAAAe,CACF,IAAmD,CACjD,KAAM,CAAE,WAAAC,CAAW,EAAID,EACvB,OAAOf,EAAY,qBAAqB,EAAE,iBAAiBgB,CAAU,CACvE,EAgCE,mBA9ByB,CAAC,CAC1B,MAAAD,CACF,IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,cAAAH,CAAc,EAAIE,EACtC,OAAOf,EACJ,qBAAqB,EACrB,mBAAmBgB,EAAYH,CAAa,CACjD,EAqBE,aAnBmB,CAAC,CACpB,MAAAE,CACF,IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,cAAAC,CAAc,EAAIF,EAChCG,EAAmBlB,EACtB,wBAAwB,EACxB,aAAagB,EAAYC,CAAa,EACzC,OAAO,IAAI,6BAA2BjB,EAAa,CACjD,WAAYkB,CACd,CAAC,EAAE,IAAI,CACT,EAOE,sBAAuB,IAAMlB,EAAY,sBAAsB,EAC/D,sBAAwBmB,GACtBnB,EAAY,sBAAsBmB,CAAK,CAC3C,CACF,CACF",
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 { 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 {\n type GenuineCheckDAError,\n type GenuineCheckDAInput,\n type GenuineCheckDAIntermediateValue,\n type GenuineCheckDAOutput,\n type GenuineCheckStateMachineInternalState,\n type MachineDependencies,\n} from \"@api/secure-channel/device-action/GenuineCheck/types\";\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 { isDeviceGenuine } from \"@api/secure-channel/utils\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\n\nexport class GenuineCheckDeviceAction extends XStateDeviceAction<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n> {\n override makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n > {\n type types = StateMachineTypes<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n >;\n\n const {\n getOsVersion,\n getDeviceVersion,\n getFirmwareVersion,\n genuineCheck,\n getDeviceSessionState,\n setDeviceSessionState,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\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 goToDashboard: goToDashboardMachine,\n getOsVersion: fromPromise(getOsVersion),\n getDeviceVersion: fromPromise(getDeviceVersion),\n getFirmwareVersion: fromPromise(getFirmwareVersion),\n genuineCheck: fromObservable(genuineCheck),\n },\n guards: {\n hasError: (_) => _.context._internalState.error !== null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"],\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QHEwDsCuBLNYDCAFmAMYDWAImAG5bFgCCxALlgPZoB0lNdASmAEMIATwDEAbQAMAXUSgADq1hYW7OSAAeiAIwB2AGwAWDvskBOAKwAmC9YvbJADkMAaEMMQBmT2ZPazuo6SFp6SDpKG+gC+UW6omDj4RGTctAzMbJzIrAAqrOQCsAQARqwCAE4QohDsYBw4VKykdVC5+YUlZZVSskggisqqaOpaCFaGntocEwaOFkYR2oa6bh4IZsEcuta6Nmbajp76tjFx6Ni4hCQU1GmMQxzZeQVFpRVVYOXlrOUc8gA2AiYADMfgBbDitZ4dN7dGTqAYqTIjRDjSbTTyzeaGRbLVaIOa6LY7PYHI4nWIgeIXJLXVJ0e6ZR5tF6dd5XMgSeF9RFDFFjQ5WExhXQbYKGRxWKwrdyoo4cbT+UUOQz+UyeU5U86JDk3HjpB5PdqvLoQXUSbS9BRKJFqPqjKyC4V6MUWCVSmVrfySBVKsxSyxmAKSaKU6k65J6u4ZdiPMBMADysAAap9lOxqrV6mhGs1IfGk6nyum0D0ETa+favJFPNNDBtHAcQ8cQ-j1qEOJ43d5JMFG8dDJrw5dI-SDUzUImU2nMuayzyK8iq2NDELtoFVWZ9JilmY2-X9Bx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72H3GLaYtUdJBjFjXERK8u7iNcrqSRQtEAb0lAqSUuh971iPk7AkbEOCq28KBYmjttFa10UpEshjCajBxCZeqngaL2BCttGxBV-C1kpm6L2U8kZQMSjA86qUPGvmuF4-kh8pgGCahEJqsNTyVSmPMZu9VoqQK1BHSh-t3rTRuhI-uyD-p022PYkKys3YKIASfMCxhljRT0OYfex0b7xMqWInmtT9H0PqYw1EIVRYYL0MFJqRwtrSnHs3BwmIQiOFcZ3ISFS0kx3mMA221hHDnJqjiOm9dHasRqmVR0cx+w7OGa1URXcKkGOmVIhAkhR5Q1Yvwt0JTmL1ReXEt5OjYwAGUMDEDoLAeA3yjFjEsD0+Yug9AzFhp4ECBghQ4qMuclsl9dmwM4AAUQeuUQ5+VvA1S2JKbOzEWZ1xPm6Q8QiJSSwdkcDUMQohAA */\n id: \"GenuineCheckDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n error: null,\n result: { isGenuine: false },\n getOsVersionResponse: null,\n deviceVersion: null,\n firmwareVersion: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"GoToDashboard\",\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<GenuineCheckStateMachineInternalState>({\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: \"GetDeviceVersion\",\n },\n ],\n },\n GetDeviceVersion: {\n invoke: {\n id: \"getDeviceVersion\",\n src: \"getDeviceVersion\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n }),\n onDone: {\n target: \"GetDeviceVersionCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: (deviceVersion) => ({\n ..._.context._internalState,\n deviceVersion,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetDeviceVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n { target: \"GetFirmwareVersion\" },\n ],\n },\n GetFirmwareVersion: {\n invoke: {\n id: \"getFirmwareVersion\",\n src: \"getFirmwareVersion\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n deviceVersion: _.context._internalState.deviceVersion!,\n }),\n onDone: {\n target: \"GetFirmwareVersionCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: (firmwareVersion) => ({\n ..._.context._internalState,\n firmwareVersion,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetFirmwareVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n { target: \"GenuineCheck\" },\n ],\n },\n GenuineCheck: {\n invoke: {\n id: \"genuineCheck\",\n src: \"genuineCheck\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n finalFirmware: _.context._internalState.firmwareVersion!,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => {\n switch (_.event.snapshot.context?.type) {\n case SecureChannelEventType.DeviceId: {\n return {\n ..._.context.intermediateValue,\n deviceId: _.event.snapshot.context.payload.deviceId,\n };\n }\n case SecureChannelEventType.PermissionRequested: {\n return {\n ..._.context.intermediateValue,\n requiredUserInteraction:\n UserInteractionRequired.AllowSecureConnection,\n };\n }\n case SecureChannelEventType.PermissionGranted: {\n return {\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n };\n }\n default:\n return {\n ..._.context.intermediateValue,\n };\n }\n },\n _internalState: (_) => {\n if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Error\n ) {\n return {\n ..._.context._internalState,\n error: _.event.snapshot.context.error.mapDAErrors(),\n };\n } else if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Result\n ) {\n return {\n ..._.context._internalState,\n result: {\n isGenuine: isDeviceGenuine(\n _.event.snapshot.context.payload,\n ),\n },\n };\n }\n return _.context._internalState;\n },\n }),\n },\n onDone: {\n target: \"GenuineCheckCheck\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GenuineCheckCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (_) => {\n if (_.context._internalState.error) {\n return Left(_.context._internalState.error);\n } else {\n return Right(_.context._internalState.result);\n }\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getOsVersion = () =>\n internalApi.sendCommand(new GetOsVersionCommand());\n\n const getDeviceVersion = ({\n input,\n }: Input<{ deviceInfo: GetOsVersionResponse }>) => {\n const { deviceInfo } = input;\n return internalApi.getManagerApiService().getDeviceVersion(deviceInfo);\n };\n\n const getFirmwareVersion = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n deviceVersion: DeviceVersion;\n }>) => {\n const { deviceInfo, deviceVersion } = input;\n return internalApi\n .getManagerApiService()\n .getFirmwareVersion(deviceInfo, deviceVersion);\n };\n\n const genuineCheck = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n finalFirmware: FinalFirmware;\n }>) => {\n const { deviceInfo, finalFirmware } = input;\n const eitherConnection = internalApi\n .getSecureChannelService()\n .genuineCheck(deviceInfo, finalFirmware);\n return new ConnectToSecureChannelTask(internalApi, {\n connection: eitherConnection,\n }).run();\n };\n\n return {\n getOsVersion,\n getDeviceVersion,\n getFirmwareVersion,\n genuineCheck,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2D,kBAE3DC,EAAuC,4CACvCC,EAGO,+CAEPC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAA0C,yEAE1CC,EAGO,8DACPC,EAGO,kDASPC,EAA2C,+DAC3CC,EAAuC,0CAEvCC,EAAgC,qCAIzB,MAAMb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IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,cAAAC,CAAc,EAAIF,EAChCG,EAAmBlB,EACtB,wBAAwB,EACxB,aAAagB,EAAYC,CAAa,EACzC,OAAO,IAAI,6BAA2BjB,EAAa,CACjD,WAAYkB,CACd,CAAC,EAAE,IAAI,CACT,EAOE,sBAAuB,IAAMlB,EAAY,sBAAsB,EAC/D,sBAAwBmB,GACtBnB,EAAY,sBAAsBmB,CAAK,CAC3C,CACF,CACF",
6
6
  "names": ["GenuineCheckDeviceAction_exports", "__export", "GenuineCheckDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_GetOsVersionCommand", "import_UserInteractionRequired", "import_Const", "import_GoToDashboardDeviceAction", "import_XStateDeviceAction", "import_DeviceSessionState", "import_ConnectToSecureChannelTask", "import_types", "import_utils", "internalApi", "getOsVersion", "getDeviceVersion", "getFirmwareVersion", "genuineCheck", "getDeviceSessionState", "setDeviceSessionState", "unlockTimeout", "goToDashboardMachine", "_", "error", "currentState", "isSecureConnectionAllowed", "deviceVersion", "firmwareVersion", "input", "deviceInfo", "finalFirmware", "eitherConnection", "state"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/secure-channel/device-action/GenuineCheck/types.ts"],
4
- "sourcesContent": ["import { type EitherAsync } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport {\n type GetOsVersionCommandResult,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { type UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { type SecureChannelEvent } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport {\n type CommandErrorResult,\n type DeviceSessionState,\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n} from \"@api/types\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\nimport type { SecureChannelDAErrors } from \"@internal/secure-channel/model/Errors\";\n\nexport type GenuineCheckDAOutput = { isGenuine: boolean };\n\nexport type GenuineCheckDAInput = GoToDashboardDAInput;\n\nexport type GenuineCheckDAError =\n | CommandErrorResult[\"error\"]\n | GoToDashboardDAError\n | HttpFetchApiError\n | SecureChannelDAErrors\n | UnknownDAError;\n\nexport type GenuineCheckDARequiredInteraction =\n | UserInteractionRequired.None\n | UserInteractionRequired.UnlockDevice\n | UserInteractionRequired.AllowSecureConnection;\n\nexport type GenuineCheckDAIntermediateValue = {\n requiredUserInteraction: GenuineCheckDARequiredInteraction;\n};\n\nexport type GenuineCheckDAState = DeviceActionState<\n GenuineCheckDAOutput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue\n>;\n\nexport type GenuineCheckStateMachineInternalState = {\n error: GenuineCheckDAError | null;\n result: { isGenuine: boolean };\n getOsVersionResponse: GetOsVersionResponse | null;\n deviceVersion: DeviceVersion | null;\n firmwareVersion: FinalFirmware | null;\n};\n\nexport type MachineDependencies = {\n getOsVersion: () => Promise<GetOsVersionCommandResult>;\n getDeviceVersion: (\n args: Input<{ deviceInfo: GetOsVersionResponse }>,\n ) => EitherAsync<HttpFetchApiError, DeviceVersion>;\n getFirmwareVersion: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n deviceVersion: DeviceVersion;\n }>,\n ) => EitherAsync<HttpFetchApiError, FinalFirmware>;\n genuineCheck: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n finalFirmware: FinalFirmware;\n }>,\n ) => Observable<SecureChannelEvent>;\n getDeviceSessionState: () => DeviceSessionState;\n setDeviceSessionState: (state: DeviceSessionState) => DeviceSessionState;\n};\n"],
4
+ "sourcesContent": ["import { type EitherAsync } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport {\n type GetOsVersionCommandResult,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { type UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { type SecureChannelEvent } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport {\n type CommandErrorResult,\n type DeviceSessionState,\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n} from \"@api/types\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\nimport type { SecureChannelDAErrors } from \"@internal/secure-channel/model/Errors\";\n\nexport type GenuineCheckDAOutput = { isGenuine: boolean };\n\nexport type GenuineCheckDAInput = GoToDashboardDAInput;\n\nexport type GenuineCheckDAError =\n | CommandErrorResult[\"error\"]\n | GoToDashboardDAError\n | HttpFetchApiError\n | SecureChannelDAErrors\n | UnknownDAError;\n\nexport type GenuineCheckDARequiredInteraction =\n | UserInteractionRequired.None\n | UserInteractionRequired.UnlockDevice\n | UserInteractionRequired.AllowSecureConnection;\n\nexport type GenuineCheckDAIntermediateValue = {\n requiredUserInteraction: GenuineCheckDARequiredInteraction;\n deviceId?: Uint8Array;\n};\n\nexport type GenuineCheckDAState = DeviceActionState<\n GenuineCheckDAOutput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue\n>;\n\nexport type GenuineCheckStateMachineInternalState = {\n error: GenuineCheckDAError | null;\n result: { isGenuine: boolean };\n getOsVersionResponse: GetOsVersionResponse | null;\n deviceVersion: DeviceVersion | null;\n firmwareVersion: FinalFirmware | null;\n};\n\nexport type MachineDependencies = {\n getOsVersion: () => Promise<GetOsVersionCommandResult>;\n getDeviceVersion: (\n args: Input<{ deviceInfo: GetOsVersionResponse }>,\n ) => EitherAsync<HttpFetchApiError, DeviceVersion>;\n getFirmwareVersion: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n deviceVersion: DeviceVersion;\n }>,\n ) => EitherAsync<HttpFetchApiError, FinalFirmware>;\n genuineCheck: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n finalFirmware: FinalFirmware;\n }>,\n ) => Observable<SecureChannelEvent>;\n getDeviceSessionState: () => DeviceSessionState;\n setDeviceSessionState: (state: DeviceSessionState) => DeviceSessionState;\n};\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var S=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var M=(r,n)=>{for(var i in n)S(r,i,{get:n[i],enumerable:!0})},C=(r,n,i,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of O(n))!k.call(r,o)&&o!==i&&S(r,o,{get:()=>n[o],enumerable:!(l=L(n,o))||l.enumerable});return r};var N=r=>C(S({},"__esModule",{value:!0}),r);var R={};M(R,{InstallAppDeviceAction:()=>G});module.exports=N(R);var d=require("purify-ts"),a=require("xstate"),h=require("../../../command/model/CommandResult"),D=require("../../../command/os/GetOsVersionCommand"),v=require("../../../device-action/model/UserInteractionRequired"),f=require("../../../device-action/os/Const"),m=require("../../../device-action/os/Errors"),x=require("../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),y=require("../../../device-action/xstate-utils/XStateDeviceAction"),I=require("../../../device-session/DeviceSessionState"),E=require("../../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),V=require("../../../secure-channel/task/ConnectToSecureChannelTask"),g=require("../../../secure-channel/task/types");class G extends y.XStateDeviceAction{makeStateMachine(n){const{getOsVersion:i,getAppList:l,installApp:o,getDeviceSessionState:s,setDeviceSessionState:p}=this.extractDependencies(n),u=this.input.unlockTimeout??f.DEFAULT_UNLOCK_TIMEOUT_MS,A=new E.ListInstalledAppsDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n),T=new x.GoToDashboardDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n);return(0,a.setup)({types:{input:{},context:{},output:{}},actors:{listInstalledApps:A,goToDashboard:T,getOsVersion:(0,a.fromPromise)(i),getAppList:(0,a.fromPromise)(l),installApp:(0,a.fromObservable)(o)},guards:{hasError:t=>t.context._internalState.error!==null,appInstalled:t=>t.context._internalState.installedApps.some(e=>e.name===t.context.input.appName),appNotFound:t=>t.context._internalState.appList.findIndex(({versionName:e})=>e===t.context.input.appName)===-1,depAppNotInstalled:t=>{const e=t.context._internalState.appList.find(({versionName:c})=>c===t.context.input.appName);return e?.parentName?t.context._internalState.installedApps.findIndex(({name:c})=>c===e.parentName)===-1:!1}},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:t.event.error})}),assignAppNotFound:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new m.UnknownDAError("App to install not found in manager API")})}),assignDepAppNotInstalled:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new m.UnknownDAError("Dep app is not installed on the device")})}),cleanupDeviceState:()=>{const t=s();t.sessionStateType!==I.DeviceSessionStateType.Connected&&p({...t,installedApps:[],appsUpdates:void 0})}}}).createMachine({id:"InstallAppDeviceAction",initial:"DeviceReady",context:t=>({input:{unlockTimeout:t.input.unlockTimeout,appName:t.input.appName},intermediateValue:{requiredUserInteraction:v.UserInteractionRequired.None,progress:0},_internalState:{error:null,installedApps:[],getOsVersionResponse:null,appList:[]}}),states:{DeviceReady:{always:{target:"ListInstalledApps"}},ListInstalledApps:{value:"ListInstalledApps",invoke:{id:"listInstalledApps",src:"listInstalledApps",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"ListInstalledAppsCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:({installedApps:e})=>({...t.context._internalState,installedApps:e}),Left:e=>({...t.context._internalState,error:e})})})}}},ListInstalledAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success",guard:"appInstalled"},{target:"GoToDashboard"}]},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:()=>t.context._internalState,Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetOsVersion"}]},GetOsVersion:{invoke:{id:"getOsVersion",src:"getOsVersion",input:t=>{},onDone:{target:"GetOsVersionCheck",actions:(0,a.assign)({_internalState:t=>{if((0,h.isSuccessCommandResult)(t.event.output)){const e=s(),c=t.event.output.data.secureElementFlags.isSecureConnectionAllowed;return e.sessionStateType!==I.DeviceSessionStateType.Connected&&p({...e,isSecureConnectionAllowed:c}),{...t.context._internalState,getOsVersionResponse:t.event.output.data}}return{...t.context._internalState,error:t.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetAppList"}]},GetAppList:{invoke:{id:"getAppList",src:"getAppList",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse}),onDone:{target:"GetAppListCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:e=>({...t.context._internalState,appList:e}),Left:e=>({...t.context._internalState,error:e})})})}}},GetAppListCheck:{always:[{target:"Error",guard:"hasError"},{target:"Error",guard:"appNotFound",actions:"assignAppNotFound"},{target:"Error",guard:"depAppNotInstalled",actions:"assignDepAppNotInstalled"},{target:"InstallApp"}]},InstallApp:{invoke:{id:"installApp",src:"installApp",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse,app:t.context._internalState.appList.find(({versionName:e})=>e===t.context.input.appName)}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>t.event.snapshot.context?.type===g.SecureChannelEventType.Progress?{...t.context.intermediateValue,progress:t.event.snapshot.context.payload.progress}:{...t.context.intermediateValue},_internalState:t=>t.event.snapshot.context?.type===g.SecureChannelEventType.Error?{...t.context._internalState,error:t.event.snapshot.context.error.mapInstallDAErrors()}:t.context._internalState})},onDone:{target:"ListInstalledApps",actions:"cleanupDeviceState"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},Success:{type:"final",description:"App installed successfully"},Error:{type:"final"}},output:({context:t})=>t._internalState.error?(0,d.Left)(t._internalState.error):(0,d.Right)(void 0)})}extractDependencies(n){return{getOsVersion:()=>n.sendCommand(new D.GetOsVersionCommand),getAppList:({input:s})=>{const{deviceInfo:p}=s;return n.getManagerApiService().getAppList(p)},installApp:({input:s})=>{const{deviceInfo:p,app:u}=s,A=n.getSecureChannelService().installApp(p,u);return new V.ConnectToSecureChannelTask(n,{connection:A}).run()},getDeviceSessionState:()=>n.getDeviceSessionState(),setDeviceSessionState:s=>n.setDeviceSessionState(s)}}}0&&(module.exports={InstallAppDeviceAction});
1
+ "use strict";var m=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var M=(r,n)=>{for(var i in n)m(r,i,{get:n[i],enumerable:!0})},C=(r,n,i,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of O(n))!k.call(r,o)&&o!==i&&m(r,o,{get:()=>n[o],enumerable:!(l=L(n,o))||l.enumerable});return r};var N=r=>C(m({},"__esModule",{value:!0}),r);var R={};M(R,{InstallAppDeviceAction:()=>G});module.exports=N(R);var A=require("purify-ts"),a=require("xstate"),h=require("../../../command/model/CommandResult"),D=require("../../../command/os/GetOsVersionCommand"),v=require("../../../device-action/model/UserInteractionRequired"),f=require("../../../device-action/os/Const"),I=require("../../../device-action/os/Errors"),x=require("../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),y=require("../../../device-action/xstate-utils/XStateDeviceAction"),g=require("../../../device-session/DeviceSessionState"),E=require("../../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),V=require("../../../secure-channel/task/ConnectToSecureChannelTask"),d=require("../../../secure-channel/task/types");class G extends y.XStateDeviceAction{makeStateMachine(n){const{getOsVersion:i,getAppList:l,installApp:o,getDeviceSessionState:s,setDeviceSessionState:p}=this.extractDependencies(n),u=this.input.unlockTimeout??f.DEFAULT_UNLOCK_TIMEOUT_MS,S=new E.ListInstalledAppsDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n),T=new x.GoToDashboardDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n);return(0,a.setup)({types:{input:{},context:{},output:{}},actors:{listInstalledApps:S,goToDashboard:T,getOsVersion:(0,a.fromPromise)(i),getAppList:(0,a.fromPromise)(l),installApp:(0,a.fromObservable)(o)},guards:{hasError:t=>t.context._internalState.error!==null,appInstalled:t=>t.context._internalState.installedApps.some(e=>e.name===t.context.input.appName),appNotFound:t=>t.context._internalState.appList.findIndex(({versionName:e})=>e===t.context.input.appName)===-1,depAppNotInstalled:t=>{const e=t.context._internalState.appList.find(({versionName:c})=>c===t.context.input.appName);return e?.parentName?t.context._internalState.installedApps.findIndex(({name:c})=>c===e.parentName)===-1:!1}},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:t.event.error})}),assignAppNotFound:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new I.UnknownDAError("App to install not found in manager API")})}),assignDepAppNotInstalled:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new I.UnknownDAError("Dep app is not installed on the device")})}),cleanupDeviceState:()=>{const t=s();t.sessionStateType!==g.DeviceSessionStateType.Connected&&p({...t,installedApps:[],appsUpdates:void 0})}}}).createMachine({id:"InstallAppDeviceAction",initial:"DeviceReady",context:t=>({input:{unlockTimeout:t.input.unlockTimeout,appName:t.input.appName},intermediateValue:{requiredUserInteraction:v.UserInteractionRequired.None,progress:0},_internalState:{error:null,installedApps:[],getOsVersionResponse:null,appList:[]}}),states:{DeviceReady:{always:{target:"ListInstalledApps"}},ListInstalledApps:{value:"ListInstalledApps",invoke:{id:"listInstalledApps",src:"listInstalledApps",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"ListInstalledAppsCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:({installedApps:e})=>({...t.context._internalState,installedApps:e}),Left:e=>({...t.context._internalState,error:e})})})}}},ListInstalledAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success",guard:"appInstalled"},{target:"GoToDashboard"}]},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:()=>t.context._internalState,Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetOsVersion"}]},GetOsVersion:{invoke:{id:"getOsVersion",src:"getOsVersion",input:t=>{},onDone:{target:"GetOsVersionCheck",actions:(0,a.assign)({_internalState:t=>{if((0,h.isSuccessCommandResult)(t.event.output)){const e=s(),c=t.event.output.data.secureElementFlags.isSecureConnectionAllowed;return e.sessionStateType!==g.DeviceSessionStateType.Connected&&p({...e,isSecureConnectionAllowed:c}),{...t.context._internalState,getOsVersionResponse:t.event.output.data}}return{...t.context._internalState,error:t.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetAppList"}]},GetAppList:{invoke:{id:"getAppList",src:"getAppList",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse}),onDone:{target:"GetAppListCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:e=>({...t.context._internalState,appList:e}),Left:e=>({...t.context._internalState,error:e})})})}}},GetAppListCheck:{always:[{target:"Error",guard:"hasError"},{target:"Error",guard:"appNotFound",actions:"assignAppNotFound"},{target:"Error",guard:"depAppNotInstalled",actions:"assignDepAppNotInstalled"},{target:"InstallApp"}]},InstallApp:{invoke:{id:"installApp",src:"installApp",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse,app:t.context._internalState.appList.find(({versionName:e})=>e===t.context.input.appName)}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>t.event.snapshot.context?.type===d.SecureChannelEventType.DeviceId?{...t.context.intermediateValue,deviceId:t.event.snapshot.context.payload.deviceId}:t.event.snapshot.context?.type===d.SecureChannelEventType.Progress?{...t.context.intermediateValue,progress:t.event.snapshot.context.payload.progress}:{...t.context.intermediateValue},_internalState:t=>t.event.snapshot.context?.type===d.SecureChannelEventType.Error?{...t.context._internalState,error:t.event.snapshot.context.error.mapInstallDAErrors()}:t.context._internalState})},onDone:{target:"ListInstalledApps",actions:"cleanupDeviceState"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},Success:{type:"final",description:"App installed successfully"},Error:{type:"final"}},output:({context:t})=>t._internalState.error?(0,A.Left)(t._internalState.error):(0,A.Right)(void 0)})}extractDependencies(n){return{getOsVersion:()=>n.sendCommand(new D.GetOsVersionCommand),getAppList:({input:s})=>{const{deviceInfo:p}=s;return n.getManagerApiService().getAppList(p)},installApp:({input:s})=>{const{deviceInfo:p,app:u}=s,S=n.getSecureChannelService().installApp(p,u);return new V.ConnectToSecureChannelTask(n,{connection:S}).run()},getDeviceSessionState:()=>n.getDeviceSessionState(),setDeviceSessionState:s=>n.setDeviceSessionState(s)}}}0&&(module.exports={InstallAppDeviceAction});
2
2
  //# sourceMappingURL=InstallAppDeviceAction.js.map