@ledgerhq/device-management-kit 0.0.0-signer-eth-20250122093657 → 0.0.0-transactionInspector-resolutionObj-20250916071327

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 (1217) hide show
  1. package/README.md +88 -39
  2. package/lib/cjs/index.js.map +1 -1
  3. package/lib/cjs/package.json +26 -26
  4. package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
  5. package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
  6. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  7. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +3 -3
  8. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
  9. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
  10. package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js +1 -1
  11. package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
  12. package/lib/cjs/src/api/DmkConfig.js +1 -1
  13. package/lib/cjs/src/api/DmkConfig.js.map +1 -1
  14. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  15. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  16. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  17. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  18. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js +1 -1
  19. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  20. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js +1 -1
  21. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js.map +2 -2
  22. package/lib/cjs/src/api/command/di/commandModule.js +1 -1
  23. package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
  24. package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
  25. package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
  26. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  27. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  28. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  29. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  30. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  31. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  32. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  33. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  34. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
  35. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  36. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  37. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  38. package/lib/cjs/src/api/command/os/LoadCertificateCommand.js +2 -0
  39. package/lib/cjs/src/api/command/os/LoadCertificateCommand.js.map +7 -0
  40. package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js +2 -0
  41. package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js.map +7 -0
  42. package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js +2 -0
  43. package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js.map +7 -0
  44. package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.js +2 -0
  45. package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.js.map +7 -0
  46. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  47. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  48. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
  49. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  50. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  51. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  52. package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
  53. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +3 -3
  54. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
  55. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +3 -3
  56. package/lib/cjs/src/api/command/utils/GlobalCommandError.js +1 -1
  57. package/lib/cjs/src/api/command/utils/GlobalCommandError.js.map +2 -2
  58. package/lib/cjs/src/api/device/DeviceModel.js +1 -1
  59. package/lib/cjs/src/api/device/DeviceModel.js.map +2 -2
  60. package/lib/cjs/src/api/device/SecureElementFlags.js +2 -0
  61. package/lib/cjs/src/api/device/SecureElementFlags.js.map +7 -0
  62. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  63. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  64. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  65. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  66. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  67. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  68. package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js +1 -1
  69. package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +3 -3
  70. package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
  71. package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
  72. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
  73. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  74. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +1 -1
  75. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  76. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +2 -0
  77. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +7 -0
  78. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +2 -0
  79. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +7 -0
  80. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +2 -0
  81. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +7 -0
  82. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  83. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  84. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  85. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  86. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  87. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  88. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +2 -0
  89. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  90. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  91. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  92. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  93. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
  94. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  95. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  96. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
  97. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
  98. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
  99. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
  100. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  101. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  102. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  103. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  104. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
  105. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  106. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  107. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  108. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
  109. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
  110. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
  111. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
  112. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
  113. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
  114. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  115. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  116. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  117. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  118. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
  119. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +1 -1
  120. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  121. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  122. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  123. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  124. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
  125. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  126. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  127. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  128. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  129. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
  130. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
  131. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  132. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  133. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  134. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  135. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  136. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  137. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  138. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  139. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  140. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  141. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  142. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  143. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  144. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  145. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  146. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  147. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  148. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  149. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
  150. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  151. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  152. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  153. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  154. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  155. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
  156. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
  157. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  158. package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
  159. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
  160. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.js +2 -0
  161. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.js.map +7 -0
  162. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +2 -0
  163. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +7 -0
  164. package/lib/cjs/src/api/index.js +1 -1
  165. package/lib/cjs/src/api/index.js.map +3 -3
  166. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
  167. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
  168. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  169. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
  170. package/lib/cjs/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js +1 -1
  171. package/lib/cjs/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js.map +2 -2
  172. package/lib/cjs/src/api/secure-channel/constants.js +2 -0
  173. package/lib/cjs/src/api/secure-channel/constants.js.map +7 -0
  174. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +2 -0
  175. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +7 -0
  176. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +2 -0
  177. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +7 -0
  178. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js +2 -0
  179. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +7 -0
  180. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
  181. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
  182. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
  183. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
  184. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +2 -0
  185. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
  186. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +2 -0
  187. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +7 -0
  188. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +2 -0
  189. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +7 -0
  190. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +2 -0
  191. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +7 -0
  192. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
  193. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
  194. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
  195. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
  196. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +2 -0
  197. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
  198. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +2 -0
  199. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +7 -0
  200. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +2 -0
  201. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +7 -0
  202. package/lib/cjs/src/api/secure-channel/task/types.js +2 -0
  203. package/lib/cjs/src/api/secure-channel/task/types.js.map +7 -0
  204. package/lib/cjs/src/api/secure-channel/types.js +2 -0
  205. package/lib/cjs/src/api/secure-channel/types.js.map +7 -0
  206. package/lib/cjs/src/api/secure-channel/utils.js +2 -0
  207. package/lib/cjs/src/api/secure-channel/utils.js.map +7 -0
  208. package/lib/cjs/src/api/secure-channel/utils.test.js +2 -0
  209. package/lib/cjs/src/api/secure-channel/utils.test.js.map +7 -0
  210. package/lib/cjs/src/api/transport/model/DeviceApduSender.js +2 -0
  211. package/lib/cjs/src/api/transport/model/DeviceApduSender.js.map +7 -0
  212. package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
  213. package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
  214. package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js +1 -1
  215. package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js.map +2 -2
  216. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  217. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  218. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  219. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  220. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js +1 -1
  221. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
  222. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  223. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  224. package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
  225. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js +1 -1
  226. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js.map +2 -2
  227. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
  228. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
  229. package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js +1 -1
  230. package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js.map +1 -1
  231. package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js +1 -1
  232. package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
  233. package/lib/cjs/src/api/types.js +1 -1
  234. package/lib/cjs/src/api/types.js.map +1 -1
  235. package/lib/cjs/src/api/utils/AppName.js +2 -0
  236. package/lib/cjs/src/api/utils/AppName.js.map +7 -0
  237. package/lib/cjs/src/api/utils/AppName.test.js +2 -0
  238. package/lib/cjs/src/api/utils/AppName.test.js.map +7 -0
  239. package/lib/cjs/src/api/utils/Base64String.test.js +1 -1
  240. package/lib/cjs/src/api/utils/Base64String.test.js.map +2 -2
  241. package/lib/cjs/src/api/utils/HexaString.js +1 -1
  242. package/lib/cjs/src/api/utils/HexaString.js.map +3 -3
  243. package/lib/cjs/src/api/utils/HexaString.test.js +1 -1
  244. package/lib/cjs/src/api/utils/HexaString.test.js.map +2 -2
  245. package/lib/cjs/src/di.js +1 -1
  246. package/lib/cjs/src/di.js.map +3 -3
  247. package/lib/cjs/src/di.stub.js +1 -1
  248. package/lib/cjs/src/di.stub.js.map +2 -2
  249. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js +1 -1
  250. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js.map +3 -3
  251. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js +1 -1
  252. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js.map +2 -2
  253. package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js +1 -1
  254. package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +2 -2
  255. package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +1 -1
  256. package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +2 -2
  257. package/lib/cjs/src/internal/config/di/configModule.js +1 -1
  258. package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
  259. package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
  260. package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
  261. package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js +1 -1
  262. package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js.map +2 -2
  263. package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js +1 -1
  264. package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +2 -2
  265. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
  266. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  267. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  268. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  269. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
  270. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  271. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
  272. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
  273. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
  274. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  275. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  276. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  277. package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js +1 -1
  278. package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js.map +2 -2
  279. package/lib/cjs/src/internal/device-session/model/DevicePinger.js +2 -0
  280. package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +7 -0
  281. package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js +2 -0
  282. package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
  283. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  284. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  285. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  286. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  287. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js +2 -0
  288. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
  289. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
  290. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
  291. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  292. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  293. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  294. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
  295. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
  296. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
  297. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
  298. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
  299. package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
  300. package/lib/cjs/src/internal/device-session/model/Frame.js.map +3 -3
  301. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  302. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  303. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.test.js +1 -1
  304. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.test.js.map +2 -2
  305. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  306. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  307. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  308. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  309. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  310. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  311. package/lib/cjs/src/internal/device-session/service/MutexService.js +2 -0
  312. package/lib/cjs/src/internal/device-session/service/MutexService.js.map +7 -0
  313. package/lib/cjs/src/internal/device-session/service/MutexService.test.js +2 -0
  314. package/lib/cjs/src/internal/device-session/service/MutexService.test.js.map +7 -0
  315. package/lib/cjs/src/internal/device-session/service/RefresherService.js +2 -0
  316. package/lib/cjs/src/internal/device-session/service/RefresherService.js.map +7 -0
  317. package/lib/cjs/src/internal/device-session/service/RefresherService.test.js +2 -0
  318. package/lib/cjs/src/internal/device-session/service/RefresherService.test.js.map +7 -0
  319. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  320. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  321. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  322. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  323. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  324. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  325. package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
  326. package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
  327. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  328. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  329. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  330. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
  331. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js +1 -1
  332. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js.map +2 -2
  333. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  334. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  335. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
  336. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
  337. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  338. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  339. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  340. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  341. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  342. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  343. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
  344. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
  345. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
  346. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
  347. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
  348. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
  349. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  350. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  351. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  352. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  353. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  354. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +3 -3
  355. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  356. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  357. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  358. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  359. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
  360. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  361. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  362. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  363. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js +1 -1
  364. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +2 -2
  365. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
  366. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +2 -2
  367. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  368. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  369. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  370. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  371. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
  372. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  373. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  374. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  375. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  376. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  377. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  378. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  379. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  380. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  381. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js +1 -1
  382. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  383. package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
  384. package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
  385. package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
  386. package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
  387. package/lib/cjs/src/internal/manager-api/model/Errors.js +1 -1
  388. package/lib/cjs/src/internal/manager-api/model/Errors.js.map +3 -3
  389. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  390. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  391. package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
  392. package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
  393. package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
  394. package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
  395. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  396. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  397. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  398. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  399. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
  400. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
  401. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  402. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  403. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  404. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  405. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +2 -0
  406. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +7 -0
  407. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +2 -0
  408. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +7 -0
  409. package/lib/cjs/src/internal/secure-channel/data/SecureChannelDataSource.js +2 -0
  410. package/lib/cjs/src/internal/secure-channel/data/SecureChannelDataSource.js.map +7 -0
  411. package/lib/cjs/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js +2 -0
  412. package/lib/cjs/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js.map +7 -0
  413. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +2 -0
  414. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +7 -0
  415. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +2 -0
  416. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +7 -0
  417. package/lib/cjs/src/internal/secure-channel/di/secureChannelTypes.js +2 -0
  418. package/lib/cjs/src/internal/secure-channel/di/secureChannelTypes.js.map +7 -0
  419. package/lib/cjs/src/internal/secure-channel/model/Const.js +2 -0
  420. package/lib/cjs/src/internal/secure-channel/model/Const.js.map +7 -0
  421. package/lib/cjs/src/internal/secure-channel/model/Errors.js +2 -0
  422. package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +7 -0
  423. package/lib/cjs/src/internal/secure-channel/model/Params.js +2 -0
  424. package/lib/cjs/src/internal/secure-channel/model/Params.js.map +7 -0
  425. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +2 -0
  426. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +7 -0
  427. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +2 -0
  428. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +7 -0
  429. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +2 -0
  430. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +7 -0
  431. package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
  432. package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
  433. package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
  434. package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
  435. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
  436. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  437. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  438. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  439. package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
  440. package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
  441. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  442. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  443. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
  444. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  445. package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js +1 -1
  446. package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js.map +2 -2
  447. package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
  448. package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
  449. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  450. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  451. package/lib/esm/package.json +26 -26
  452. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  453. package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
  454. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  455. package/lib/esm/src/api/DeviceManagementKit.test.js.map +3 -3
  456. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  457. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  458. package/lib/esm/src/api/DeviceManagementKitBuilder.test.js +1 -1
  459. package/lib/esm/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
  460. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  461. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  462. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  463. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  464. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +1 -1
  465. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  466. package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js +1 -1
  467. package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js.map +2 -2
  468. package/lib/esm/src/api/command/di/commandModule.js +1 -1
  469. package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
  470. package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
  471. package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
  472. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  473. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  474. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  475. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  476. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  477. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  478. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  479. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  480. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
  481. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  482. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  483. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  484. package/lib/esm/src/api/command/os/LoadCertificateCommand.js +2 -0
  485. package/lib/esm/src/api/command/os/LoadCertificateCommand.js.map +7 -0
  486. package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js +2 -0
  487. package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js.map +7 -0
  488. package/lib/esm/src/api/command/os/SecureElementFlagsParser.js +2 -0
  489. package/lib/esm/src/api/command/os/SecureElementFlagsParser.js.map +7 -0
  490. package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.js +2 -0
  491. package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.js.map +7 -0
  492. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  493. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  494. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
  495. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  496. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  497. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  498. package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
  499. package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
  500. package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
  501. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +3 -3
  502. package/lib/esm/src/api/command/utils/GlobalCommandError.js +1 -1
  503. package/lib/esm/src/api/command/utils/GlobalCommandError.js.map +2 -2
  504. package/lib/esm/src/api/device/DeviceModel.js +1 -1
  505. package/lib/esm/src/api/device/DeviceModel.js.map +2 -2
  506. package/lib/esm/src/api/device/SecureElementFlags.js +1 -0
  507. package/lib/esm/src/api/device/SecureElementFlags.js.map +7 -0
  508. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  509. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  510. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  511. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  512. package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js +1 -1
  513. package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +3 -3
  514. package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
  515. package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
  516. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
  517. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  518. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +1 -1
  519. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  520. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +2 -0
  521. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +7 -0
  522. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +2 -0
  523. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +7 -0
  524. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -0
  525. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +7 -0
  526. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  527. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  528. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  529. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  530. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  531. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  532. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  533. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  534. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  535. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  536. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  537. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
  538. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  539. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  540. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
  541. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
  542. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  543. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  544. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  545. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  546. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  547. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  548. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  549. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  550. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
  551. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
  552. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
  553. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
  554. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
  555. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
  556. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  557. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  558. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  559. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  560. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  561. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  562. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  563. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  564. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  565. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  566. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  567. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  568. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  569. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
  570. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  571. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  572. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  573. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  574. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  575. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  576. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  577. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  578. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  579. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  580. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  581. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  582. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  583. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  584. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  585. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  586. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  587. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
  588. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  589. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  590. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  591. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  592. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  593. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  594. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  595. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  596. package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
  597. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  598. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.js +2 -0
  599. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.js.map +7 -0
  600. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +2 -0
  601. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +7 -0
  602. package/lib/esm/src/api/index.js +1 -1
  603. package/lib/esm/src/api/index.js.map +3 -3
  604. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
  605. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
  606. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  607. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
  608. package/lib/esm/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js +1 -1
  609. package/lib/esm/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js.map +2 -2
  610. package/lib/esm/src/api/secure-channel/constants.js +2 -0
  611. package/lib/esm/src/api/secure-channel/constants.js.map +7 -0
  612. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +2 -0
  613. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +7 -0
  614. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +2 -0
  615. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +7 -0
  616. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/types.js +1 -0
  617. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/types.js.map +7 -0
  618. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
  619. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
  620. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
  621. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
  622. package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js +1 -0
  623. package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
  624. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +2 -0
  625. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +7 -0
  626. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +2 -0
  627. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +7 -0
  628. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js +2 -0
  629. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +7 -0
  630. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
  631. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
  632. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
  633. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
  634. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js +1 -0
  635. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
  636. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +2 -0
  637. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +7 -0
  638. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +2 -0
  639. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +7 -0
  640. package/lib/esm/src/api/secure-channel/task/types.js +2 -0
  641. package/lib/esm/src/api/secure-channel/task/types.js.map +7 -0
  642. package/lib/esm/src/api/secure-channel/types.js +1 -0
  643. package/lib/esm/src/api/secure-channel/types.js.map +7 -0
  644. package/lib/esm/src/api/secure-channel/utils.js +2 -0
  645. package/lib/esm/src/api/secure-channel/utils.js.map +7 -0
  646. package/lib/esm/src/api/secure-channel/utils.test.js +2 -0
  647. package/lib/esm/src/api/secure-channel/utils.test.js.map +7 -0
  648. package/lib/esm/src/api/transport/model/DeviceApduSender.js +1 -0
  649. package/lib/esm/src/api/transport/model/DeviceApduSender.js.map +7 -0
  650. package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js +1 -1
  651. package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js.map +2 -2
  652. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  653. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  654. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  655. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  656. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  657. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  658. package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js +1 -1
  659. package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js.map +2 -2
  660. package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
  661. package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
  662. package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js +1 -1
  663. package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
  664. package/lib/esm/src/api/utils/AppName.js +2 -0
  665. package/lib/esm/src/api/utils/AppName.js.map +7 -0
  666. package/lib/esm/src/api/utils/AppName.test.js +2 -0
  667. package/lib/esm/src/api/utils/AppName.test.js.map +7 -0
  668. package/lib/esm/src/api/utils/Base64String.test.js +1 -1
  669. package/lib/esm/src/api/utils/Base64String.test.js.map +2 -2
  670. package/lib/esm/src/api/utils/HexaString.js +1 -1
  671. package/lib/esm/src/api/utils/HexaString.js.map +3 -3
  672. package/lib/esm/src/api/utils/HexaString.test.js +1 -1
  673. package/lib/esm/src/api/utils/HexaString.test.js.map +2 -2
  674. package/lib/esm/src/di.js +1 -1
  675. package/lib/esm/src/di.js.map +3 -3
  676. package/lib/esm/src/di.stub.js +1 -1
  677. package/lib/esm/src/di.stub.js.map +2 -2
  678. package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js +1 -1
  679. package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js.map +3 -3
  680. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js +1 -1
  681. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js.map +2 -2
  682. package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js +1 -1
  683. package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +2 -2
  684. package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +1 -1
  685. package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +2 -2
  686. package/lib/esm/src/internal/config/di/configModule.js +1 -1
  687. package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
  688. package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
  689. package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
  690. package/lib/esm/src/internal/config/service/DefaultConfigService.test.js +1 -1
  691. package/lib/esm/src/internal/config/service/DefaultConfigService.test.js.map +2 -2
  692. package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js +1 -1
  693. package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +2 -2
  694. package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
  695. package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  696. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  697. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  698. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
  699. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  700. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
  701. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
  702. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
  703. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  704. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  705. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  706. package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js +1 -1
  707. package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js.map +2 -2
  708. package/lib/esm/src/internal/device-session/model/DevicePinger.js +2 -0
  709. package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +7 -0
  710. package/lib/esm/src/internal/device-session/model/DevicePinger.test.js +2 -0
  711. package/lib/esm/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
  712. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  713. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  714. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  715. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  716. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js +2 -0
  717. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
  718. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
  719. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
  720. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  721. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  722. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  723. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
  724. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
  725. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
  726. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
  727. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
  728. package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
  729. package/lib/esm/src/internal/device-session/model/Frame.js.map +3 -3
  730. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  731. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  732. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.test.js +1 -1
  733. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.test.js.map +2 -2
  734. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  735. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  736. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  737. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  738. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  739. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  740. package/lib/esm/src/internal/device-session/service/MutexService.js +2 -0
  741. package/lib/esm/src/internal/device-session/service/MutexService.js.map +7 -0
  742. package/lib/esm/src/internal/device-session/service/MutexService.test.js +2 -0
  743. package/lib/esm/src/internal/device-session/service/MutexService.test.js.map +7 -0
  744. package/lib/esm/src/internal/device-session/service/RefresherService.js +2 -0
  745. package/lib/esm/src/internal/device-session/service/RefresherService.js.map +7 -0
  746. package/lib/esm/src/internal/device-session/service/RefresherService.test.js +2 -0
  747. package/lib/esm/src/internal/device-session/service/RefresherService.test.js.map +7 -0
  748. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  749. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  750. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  751. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  752. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  753. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  754. package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
  755. package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
  756. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  757. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  758. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  759. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
  760. package/lib/esm/src/internal/discovery/di/discoveryTypes.js +1 -1
  761. package/lib/esm/src/internal/discovery/di/discoveryTypes.js.map +2 -2
  762. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  763. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  764. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
  765. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
  766. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  767. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  768. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  769. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  770. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  771. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  772. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
  773. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
  774. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
  775. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
  776. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
  777. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
  778. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  779. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  780. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  781. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  782. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  783. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +3 -3
  784. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  785. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  786. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  787. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  788. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
  789. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  790. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  791. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  792. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js +1 -1
  793. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +2 -2
  794. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
  795. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +2 -2
  796. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  797. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  798. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  799. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  800. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  801. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  802. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  803. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  804. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  805. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  806. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  807. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  808. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js +1 -1
  809. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  810. package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
  811. package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
  812. package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
  813. package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
  814. package/lib/esm/src/internal/manager-api/model/Errors.js +1 -1
  815. package/lib/esm/src/internal/manager-api/model/Errors.js.map +3 -3
  816. package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
  817. package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
  818. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  819. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  820. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  821. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  822. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  823. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  824. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  825. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  826. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +2 -0
  827. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +7 -0
  828. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +2 -0
  829. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +7 -0
  830. package/lib/esm/src/internal/secure-channel/data/SecureChannelDataSource.js +1 -0
  831. package/lib/esm/src/internal/secure-channel/data/SecureChannelDataSource.js.map +7 -0
  832. package/lib/esm/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js +2 -0
  833. package/lib/esm/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js.map +7 -0
  834. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +2 -0
  835. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +7 -0
  836. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +2 -0
  837. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +7 -0
  838. package/lib/esm/src/internal/secure-channel/di/secureChannelTypes.js +2 -0
  839. package/lib/esm/src/internal/secure-channel/di/secureChannelTypes.js.map +7 -0
  840. package/lib/esm/src/internal/secure-channel/model/Const.js +2 -0
  841. package/lib/esm/src/internal/secure-channel/model/Const.js.map +7 -0
  842. package/lib/esm/src/internal/secure-channel/model/Errors.js +2 -0
  843. package/lib/esm/src/internal/secure-channel/model/Errors.js.map +7 -0
  844. package/lib/esm/src/internal/secure-channel/model/Params.js +1 -0
  845. package/lib/esm/src/internal/secure-channel/model/Params.js.map +7 -0
  846. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js +2 -0
  847. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +7 -0
  848. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +2 -0
  849. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +7 -0
  850. package/lib/esm/src/internal/secure-channel/service/SecureChannelService.js +1 -0
  851. package/lib/esm/src/internal/secure-channel/service/SecureChannelService.js.map +7 -0
  852. package/lib/esm/src/internal/send/di/sendModule.js +1 -1
  853. package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
  854. package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
  855. package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
  856. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
  857. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  858. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  859. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  860. package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
  861. package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
  862. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  863. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  864. package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
  865. package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  866. package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js +1 -1
  867. package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js.map +2 -2
  868. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  869. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  870. package/lib/types/src/api/DeviceManagementKit.d.ts +30 -10
  871. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  872. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  873. package/lib/types/src/api/DmkConfig.d.ts +2 -0
  874. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  875. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  876. package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
  877. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +66 -0
  878. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
  879. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +1 -0
  880. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts.map +1 -1
  881. package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
  882. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
  883. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
  884. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
  885. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
  886. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +38 -4
  887. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  888. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
  889. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
  890. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
  891. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
  892. package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts +25 -0
  893. package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts.map +1 -0
  894. package/lib/types/src/api/command/os/LoadCertificateCommand.test.d.ts +2 -0
  895. package/lib/types/src/api/command/os/LoadCertificateCommand.test.d.ts.map +1 -0
  896. package/lib/types/src/api/command/os/SecureElementFlagsParser.d.ts +43 -0
  897. package/lib/types/src/api/command/os/SecureElementFlagsParser.d.ts.map +1 -0
  898. package/lib/types/src/api/command/os/SecureElementFlagsParser.test.d.ts +2 -0
  899. package/lib/types/src/api/command/os/SecureElementFlagsParser.test.d.ts.map +1 -0
  900. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  901. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
  902. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
  903. package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
  904. package/lib/types/src/api/command/utils/CommandUtils.d.ts +4 -0
  905. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  906. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts +1 -1
  907. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts.map +1 -1
  908. package/lib/types/src/api/device/DeviceModel.d.ts +2 -1
  909. package/lib/types/src/api/device/DeviceModel.d.ts.map +1 -1
  910. package/lib/types/src/api/device/SecureElementFlags.d.ts +41 -0
  911. package/lib/types/src/api/device/SecureElementFlags.d.ts.map +1 -0
  912. package/lib/types/src/api/device-action/DeviceAction.d.ts +9 -1
  913. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  914. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts +2 -1
  915. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  916. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +9 -0
  917. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  918. package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts +5 -2
  919. package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts.map +1 -1
  920. package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
  921. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +4 -2
  922. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts.map +1 -1
  923. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts +40 -0
  924. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -0
  925. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.d.ts +2 -0
  926. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.d.ts.map +1 -0
  927. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +19 -0
  928. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -0
  929. package/lib/types/src/api/device-action/os/Errors.d.ts +20 -0
  930. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  931. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts +58 -0
  932. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
  933. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
  934. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
  935. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +28 -0
  936. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
  937. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  938. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
  939. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
  940. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  941. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
  942. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
  943. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
  944. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
  945. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +65 -0
  946. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
  947. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts +1 -1
  948. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts.map +1 -1
  949. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
  950. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +0 -1
  951. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
  952. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
  953. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
  954. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
  955. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
  956. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +24 -0
  957. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
  958. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  959. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -1
  960. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  961. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
  962. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
  963. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
  964. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
  965. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
  966. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
  967. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
  968. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
  969. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
  970. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
  971. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
  972. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
  973. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
  974. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
  975. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
  976. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
  977. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts +1 -0
  978. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts.map +1 -1
  979. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  980. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
  981. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  982. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  983. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +97 -0
  984. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  985. package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
  986. package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
  987. package/lib/types/src/api/device-session/use-case/{ToggleDeviceSessionRefresher.d.ts → DisableDeviceSessionRefresher.d.ts} +6 -6
  988. package/lib/types/src/api/device-session/use-case/DisableDeviceSessionRefresher.d.ts.map +1 -0
  989. package/lib/types/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.d.ts +2 -0
  990. package/lib/types/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.d.ts.map +1 -0
  991. package/lib/types/src/api/index.d.ts +12 -1
  992. package/lib/types/src/api/index.d.ts.map +1 -1
  993. package/lib/types/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.d.ts +1 -1
  994. package/lib/types/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.d.ts.map +1 -1
  995. package/lib/types/src/api/secure-channel/constants.d.ts +2 -0
  996. package/lib/types/src/api/secure-channel/constants.d.ts.map +1 -0
  997. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts +8 -0
  998. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -0
  999. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.d.ts +2 -0
  1000. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.d.ts.map +1 -0
  1001. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +49 -0
  1002. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -0
  1003. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts +8 -0
  1004. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -0
  1005. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts +2 -0
  1006. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts.map +1 -0
  1007. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +45 -0
  1008. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -0
  1009. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts +8 -0
  1010. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -0
  1011. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.d.ts +2 -0
  1012. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.d.ts.map +1 -0
  1013. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +58 -0
  1014. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -0
  1015. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts +8 -0
  1016. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -0
  1017. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts +2 -0
  1018. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts.map +1 -0
  1019. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +42 -0
  1020. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -0
  1021. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +26 -0
  1022. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -0
  1023. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.test.d.ts +2 -0
  1024. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.test.d.ts.map +1 -0
  1025. package/lib/types/src/api/secure-channel/task/types.d.ts +110 -0
  1026. package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -0
  1027. package/lib/types/src/api/secure-channel/types.d.ts +4 -0
  1028. package/lib/types/src/api/secure-channel/types.d.ts.map +1 -0
  1029. package/lib/types/src/api/secure-channel/utils.d.ts +19 -0
  1030. package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -0
  1031. package/lib/types/src/api/secure-channel/utils.test.d.ts +2 -0
  1032. package/lib/types/src/api/secure-channel/utils.test.d.ts.map +1 -0
  1033. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts +17 -0
  1034. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts.map +1 -0
  1035. package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
  1036. package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
  1037. package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts +1 -1
  1038. package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts.map +1 -1
  1039. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +63 -0
  1040. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -0
  1041. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts +2 -0
  1042. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts.map +1 -0
  1043. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +2 -0
  1044. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
  1045. package/lib/types/src/api/transport/model/Errors.d.ts +27 -3
  1046. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  1047. package/lib/types/src/api/transport/model/Transport.d.ts +2 -2
  1048. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  1049. package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts +2 -0
  1050. package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts.map +1 -1
  1051. package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts +7 -7
  1052. package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts.map +1 -1
  1053. package/lib/types/src/api/types.d.ts +10 -2
  1054. package/lib/types/src/api/types.d.ts.map +1 -1
  1055. package/lib/types/src/api/utils/AppName.d.ts +2 -0
  1056. package/lib/types/src/api/utils/AppName.d.ts.map +1 -0
  1057. package/lib/types/src/api/utils/AppName.test.d.ts +2 -0
  1058. package/lib/types/src/api/utils/AppName.test.d.ts.map +1 -0
  1059. package/lib/types/src/api/utils/HexaString.d.ts +4 -3
  1060. package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
  1061. package/lib/types/src/di.d.ts.map +1 -1
  1062. package/lib/types/src/di.stub.d.ts +1 -1
  1063. package/lib/types/src/di.stub.d.ts.map +1 -1
  1064. package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts +1 -1
  1065. package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts.map +1 -1
  1066. package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts +3 -3
  1067. package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts.map +1 -1
  1068. package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
  1069. package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
  1070. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
  1071. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
  1072. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts +6 -1
  1073. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts.map +1 -1
  1074. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  1075. package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts +1 -1
  1076. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +18 -0
  1077. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -0
  1078. package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts +2 -0
  1079. package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts.map +1 -0
  1080. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +30 -12
  1081. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  1082. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts +3 -2
  1083. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  1084. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts +35 -0
  1085. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts.map +1 -0
  1086. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts +2 -0
  1087. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts.map +1 -0
  1088. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts +17 -79
  1089. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts.map +1 -1
  1090. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts +20 -0
  1091. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -0
  1092. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts +2 -0
  1093. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts.map +1 -0
  1094. package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
  1095. package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.d.ts.map +1 -1
  1096. package/lib/types/src/internal/device-session/service/MutexService.d.ts +6 -0
  1097. package/lib/types/src/internal/device-session/service/MutexService.d.ts.map +1 -0
  1098. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts +2 -0
  1099. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts.map +1 -0
  1100. package/lib/types/src/internal/device-session/service/RefresherService.d.ts +15 -0
  1101. package/lib/types/src/internal/device-session/service/RefresherService.d.ts.map +1 -0
  1102. package/lib/types/src/internal/device-session/service/RefresherService.test.d.ts +2 -0
  1103. package/lib/types/src/internal/device-session/service/RefresherService.test.d.ts.map +1 -0
  1104. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +3 -1
  1105. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
  1106. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts +3 -0
  1107. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -0
  1108. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  1109. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts +1 -1
  1110. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts.map +1 -1
  1111. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts +11 -2
  1112. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts.map +1 -1
  1113. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts +24 -0
  1114. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -0
  1115. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts +2 -0
  1116. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts.map +1 -0
  1117. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts +1 -1
  1118. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts.map +1 -1
  1119. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts +1 -1
  1120. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
  1121. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +4 -2
  1122. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
  1123. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
  1124. package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts +5 -5
  1125. package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts.map +1 -1
  1126. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +29 -18
  1127. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  1128. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +46 -40
  1129. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  1130. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +106 -17
  1131. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
  1132. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +11 -9
  1133. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  1134. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  1135. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts +1 -0
  1136. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts.map +1 -1
  1137. package/lib/types/src/internal/manager-api/model/Application.d.ts +14 -11
  1138. package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
  1139. package/lib/types/src/internal/manager-api/model/Const.d.ts +2 -1
  1140. package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
  1141. package/lib/types/src/internal/manager-api/model/Errors.d.ts +0 -6
  1142. package/lib/types/src/internal/manager-api/model/Errors.d.ts.map +1 -1
  1143. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +18 -0
  1144. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  1145. package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
  1146. package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
  1147. package/lib/types/src/internal/manager-api/model/Params.d.ts +33 -62
  1148. package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
  1149. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +13 -7
  1150. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  1151. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +71 -5
  1152. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  1153. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +13 -0
  1154. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -0
  1155. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts +2 -0
  1156. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts.map +1 -0
  1157. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts +18 -0
  1158. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts.map +1 -0
  1159. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.d.ts +2 -0
  1160. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.d.ts.map +1 -0
  1161. package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts +52 -0
  1162. package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts.map +1 -0
  1163. package/lib/types/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.d.ts +10 -0
  1164. package/lib/types/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.d.ts.map +1 -0
  1165. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts +9 -0
  1166. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -0
  1167. package/lib/types/src/internal/secure-channel/di/secureChannelModule.test.d.ts +2 -0
  1168. package/lib/types/src/internal/secure-channel/di/secureChannelModule.test.d.ts.map +1 -0
  1169. package/lib/types/src/internal/secure-channel/di/secureChannelTypes.d.ts +6 -0
  1170. package/lib/types/src/internal/secure-channel/di/secureChannelTypes.d.ts.map +1 -0
  1171. package/lib/types/src/internal/secure-channel/model/Const.d.ts +2 -0
  1172. package/lib/types/src/internal/secure-channel/model/Const.d.ts.map +1 -0
  1173. package/lib/types/src/internal/secure-channel/model/Errors.d.ts +34 -0
  1174. package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -0
  1175. package/lib/types/src/internal/secure-channel/model/Params.d.ts +84 -0
  1176. package/lib/types/src/internal/secure-channel/model/Params.d.ts.map +1 -0
  1177. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +21 -0
  1178. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -0
  1179. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.test.d.ts +2 -0
  1180. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.test.d.ts.map +1 -0
  1181. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +56 -0
  1182. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -0
  1183. package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
  1184. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +9 -1
  1185. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
  1186. package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
  1187. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +2 -0
  1188. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
  1189. package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -1
  1190. package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
  1191. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +7 -6
  1192. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
  1193. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  1194. package/package.json +24 -24
  1195. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js +0 -2
  1196. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js.map +0 -7
  1197. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +0 -2
  1198. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +0 -7
  1199. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
  1200. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
  1201. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
  1202. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
  1203. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js +0 -2
  1204. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js.map +0 -7
  1205. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +0 -2
  1206. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +0 -7
  1207. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
  1208. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
  1209. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
  1210. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
  1211. package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.d.ts.map +0 -1
  1212. package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.d.ts +0 -2
  1213. package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.d.ts.map +0 -1
  1214. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts +0 -13
  1215. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts.map +0 -1
  1216. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts +0 -2
  1217. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.ts"],
4
- "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { Observable } from \"rxjs\";\nimport { tap, timeout } from \"rxjs/operators\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionCommandResult,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\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 {\n DeviceLockedError,\n DeviceNotOnboardedError,\n} from \"@api/device-action/os/Errors\";\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\";\n\nimport {\n type GetDeviceStatusDAError,\n type GetDeviceStatusDAInput,\n type GetDeviceStatusDAIntermediateValue,\n type GetDeviceStatusDAOutput,\n} from \"./types\";\n\ntype GetDeviceStatusMachineInternalState = {\n readonly onboarded: boolean;\n readonly locked: boolean;\n readonly currentApp: string | null;\n readonly currentAppVersion: string | null;\n readonly error: GetDeviceStatusDAError | null;\n};\n\nexport type MachineDependencies = {\n readonly getAppAndVersion: () => Promise<GetAppAndVersionCommandResult>;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly waitForDeviceUnlock: (args: {\n input: { unlockTimeout: number };\n }) => Observable<void>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly isDeviceOnboarded: () => boolean;\n};\n\nexport type ExtractMachineDependencies = (\n internalApi: InternalApi,\n) => MachineDependencies;\n\nexport class GetDeviceStatusDeviceAction extends XStateDeviceAction<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n > {\n type types = StateMachineTypes<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n >;\n\n const {\n getAppAndVersion,\n getDeviceSessionState,\n setDeviceSessionState,\n waitForDeviceUnlock,\n isDeviceOnboarded,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n return setup({\n types: {\n input: {\n unlockTimeout,\n } as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n getAppAndVersion: fromPromise(getAppAndVersion),\n waitForDeviceUnlock: fromObservable(waitForDeviceUnlock),\n },\n guards: {\n isDeviceOnboarded: () => isDeviceOnboarded(), // TODO: we don't have this info for now, this can be derived from the \"flags\" obtained in the getVersion command\n isDeviceUnlocked: () =>\n getDeviceSessionState().deviceStatus !== DeviceStatus.LOCKED,\n hasError: ({ context }) => context._internalState.error !== null,\n },\n actions: {\n assignErrorDeviceNotOnboarded: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new DeviceNotOnboardedError(),\n }),\n }),\n assignErrorDeviceLocked: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new DeviceLockedError(),\n }),\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n }),\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n assignNoUserActionNeeded: assign({\n intermediateValue: (_) =>\n ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }) satisfies types[\"context\"][\"intermediateValue\"],\n }),\n assignUserActionUnlockNeeded: assign({\n intermediateValue: (_) =>\n ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n }) satisfies types[\"context\"][\"intermediateValue\"],\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QHEwBcAiYBuBLAxmAMpoCGaArrFnoQIL5q4D2AdgHQ0FgBKYpEAJ4BiANoAGALqJQAB2axcTNjJAAPRAFoArAHZx7AIwAmQ7oCcugMyHzANmMAWYwBoQgxI8vsAHOJM+VuLmVj5e2gC+EW6omDjcJORUXPSMLBwA8qwARsykAE4QuKxQAMIAFmD4ANZiUqryisqsqhoImo4O7OGhPj4h5n6Obh4IunZ2RoZ+ena6nYaGUTHoKcRklNTxqc3sWbkFRSUVVbWihtJIII1K6a1aVtoGTxOOjtbv84YjiObik7ofPM7GFDP9jNofMsQLE1olNmsGLsADLMGrFMqVGp1S5yBS3FRXNqaOzadjiHx2KyORbzcRBczmH4IbTOdjaabaKmdGy6XSRaIw1bbdZJLa0MBI9LsVHo45Ys4XBr45r3dps-n0ubaGxgx6PZlWULkkLBGmDCzGYzQ2Ei+HJEVStjsACqsDA+SdrBdrAANmjqmthBA2GB2MVsMxqmG3R6vT7-TU1hJcdcVXciYgglZycYQiYqRTQoZtMynDmbM4aW8rHYzD4BSs4hL7eLuF7Xe7PWk2AmA0GPflmPl2LJfeQAGbDgC2nbjPe9fv7IpTyqaGdAbXmxnZPkMNNM820VuZ+8M7Dsb3MznpwW31sFtpbGwdEo7dFksjorAgADUPYobAnNiIasGGEZRmGT4JC+bY7NKH5fj+-75IBrDAdUCAQfg5DpCmq5XDcqqZmMjgGDY-yGJeejjFRzJ2P47DZoEJb+Hyx42sKz5ioiC7sIh35-gB6QYcIg7DqO45oFO+SztBhCtrxuwCchwlAQqWGsJGOHNPh9SEemhKbogdLsIMTjmPuNF1nYZaOBW+5OPu9l1oCjZCs2ME8Y6fGIb6BC4WwdDYKQuDjtkvq8HAFC+mgokEXi65GeoiBguYZJOPSJa6Hm1hGsyuglkxxiUjYVjXlq7nyaKCI+cpn7+Tp6TBaF4WRXwsAxXFCpiEqBlJS0JFAo4vg+BCe55e8-QFUVVglVShjlWRtZ2FEgqsMwEBwKo1WKXVG5pgNaokmRZmQg4fyLHR7ieCNpjGPyx7aNo6UNo4nGeQpsFKdKax8AIoyJQSg3Ge0L07q9F3+Istk3Qg1IjUaZ7GNS-LlU4H1wt9+3OvseSFBiGFrsDx01mZ15mHooReFaVj0fZ5Jci5zissYIKY3a2NvnxsrVITCrE8RoMdDucxWgx1jpZCELDHDgKTC9jg6mNXKLDSHPcbV3O7LG3bNH2SYioLB3EmCI1-HuVL6Cj4hU6eNjsIVD3UrWfKXVCj5cV5Wvtr5n6CShaFE-1JMkWzPgXpCjh+Faw3Mjq5jdOlJhGvo-RzRr3uvr79VjgFzQtWFpARVFnWxcHQNCylCBm+eKPjJL4jWMEdNww4O46vSFVsfyD5Nlj3na9KRAUPghCwPAIdV20QIR7e-RzOYbNK98cN7ndgR-BSzgo+YmdfYPOfSgAovkQ75MbyVtItehmSrJgcijz2uHD+pmXyQSQnyVLs2tQA */\n id: \"GetDeviceStatusDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n const sessionState = getDeviceSessionState();\n const { sessionStateType } = sessionState;\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n onboarded: false, // we don't know how to check yet\n locked: sessionState.deviceStatus === DeviceStatus.LOCKED,\n currentApp:\n sessionStateType ===\n DeviceSessionStateType.ReadyWithoutSecureChannel\n ? sessionState.currentApp.name\n : null,\n currentAppVersion: null,\n error: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"OnboardingCheck\",\n },\n },\n OnboardingCheck: {\n // TODO: we don't have this info for now\n always: [\n {\n guard: {\n type: \"isDeviceOnboarded\",\n },\n target: \"LockingCheck\",\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n onboarded: true,\n }),\n }),\n },\n {\n target: \"Error\",\n actions: \"assignErrorDeviceNotOnboarded\",\n },\n ],\n },\n LockingCheck: {\n // We check if the device is locked in the session state\n always: [\n {\n target: \"AppAndVersionCheck\",\n guard: {\n type: \"isDeviceUnlocked\",\n },\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n locked: false,\n }),\n }),\n },\n {\n target: \"UserActionUnlockDevice\",\n },\n ],\n },\n UserActionUnlockDevice: {\n // we wait for the device to be unlocked (default timeout is 15s)\n entry: \"assignUserActionUnlockNeeded\",\n exit: \"assignNoUserActionNeeded\",\n invoke: {\n id: \"UserActionUnlockDevice\",\n src: \"waitForDeviceUnlock\",\n input: (_) => ({\n unlockTimeout,\n }),\n onDone: {\n target: \"AppAndVersionCheck\",\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n locked: false,\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorDeviceLocked\",\n },\n },\n },\n AppAndVersionCheck: {\n // We check the current app and version using the getAppAndVersion command\n invoke: {\n src: \"getAppAndVersion\",\n onDone: {\n target: \"ApplicationAvailableResultCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const state: DeviceSessionState = getDeviceSessionState();\n // Narrow the type to ReadyWithoutSecureChannelState or ReadyWithSecureChannelState\n if (\n state.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...state,\n currentApp: _.event.output.data,\n });\n }\n return {\n ..._.context._internalState,\n currentApp: _.event.output.data.name,\n currentAppVersion: _.event.output.data.version,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n ApplicationAvailableResultCheck: {\n always: [\n {\n guard: \"hasError\",\n target: \"Error\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (args) => {\n // TODO: instead we should rely on the current state (\"Success\" or \"Error\")\n const { context } = args;\n const { error, currentApp, currentAppVersion } = context._internalState;\n if (error) {\n return Left(error);\n }\n return Right<GetDeviceStatusDAOutput>({\n currentApp: currentApp!,\n currentAppVersion: currentAppVersion!,\n });\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getAppAndVersion = () => {\n return internalApi.sendCommand(new GetAppAndVersionCommand());\n };\n\n const waitForDeviceUnlock = ({\n input,\n }: {\n input: { unlockTimeout: number };\n }) =>\n new Observable<void>((subscriber) => {\n const inner = internalApi\n .getDeviceSessionStateObservable()\n .pipe(\n tap((state) => {\n if (state.deviceStatus === DeviceStatus.CONNECTED) {\n subscriber.complete();\n inner.unsubscribe();\n }\n }),\n )\n .subscribe();\n\n return () => {\n inner.unsubscribe();\n };\n }).pipe(timeout(input.unlockTimeout));\n\n return {\n getAppAndVersion,\n waitForDeviceUnlock,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n isDeviceOnboarded: () => true, // TODO: we don't have this info for now\n };\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2B,gBAC3BC,EAA6B,0BAC7BC,EAA2D,kBAE3DC,EAAuC,4CACvCC,EAGO,mDACPC,EAA6B,oCAE7BC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAGO,wCAEPC,EAGO,8DACPC,EAGO,kDAiCA,MA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";\nimport { Observable } from \"rxjs\";\nimport { tap, timeout } from \"rxjs/operators\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionCommandResult,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\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 {\n DeviceLockedError,\n DeviceNotOnboardedError,\n} from \"@api/device-action/os/Errors\";\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\";\n\nimport {\n type GetDeviceStatusDAError,\n type GetDeviceStatusDAInput,\n type GetDeviceStatusDAIntermediateValue,\n type GetDeviceStatusDAOutput,\n} from \"./types\";\n\ntype GetDeviceStatusMachineInternalState = {\n readonly onboarded: boolean;\n readonly locked: boolean;\n readonly currentApp: string | null;\n readonly currentAppVersion: string | null;\n readonly error: GetDeviceStatusDAError | null;\n};\n\nexport type MachineDependencies = {\n readonly getAppAndVersion: () => Promise<GetAppAndVersionCommandResult>;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly waitForDeviceUnlock: (args: {\n input: { unlockTimeout: number };\n }) => Observable<void>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly isDeviceOnboarded: () => boolean;\n};\n\nexport type ExtractMachineDependencies = (\n internalApi: InternalApi,\n) => MachineDependencies;\n\nexport class GetDeviceStatusDeviceAction extends XStateDeviceAction<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n > {\n type types = StateMachineTypes<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n >;\n\n const {\n getAppAndVersion,\n getDeviceSessionState,\n setDeviceSessionState,\n waitForDeviceUnlock,\n isDeviceOnboarded,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n return setup({\n types: {\n input: {\n unlockTimeout,\n } as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n getAppAndVersion: fromPromise(getAppAndVersion),\n waitForDeviceUnlock: fromObservable(waitForDeviceUnlock),\n },\n guards: {\n isDeviceOnboarded: () => isDeviceOnboarded(), // TODO: we don't have this info for now, this can be derived from the \"flags\" obtained in the getVersion command\n isDeviceLocked: ({ context }) => context._internalState.locked,\n hasError: ({ context }) => context._internalState.error !== null,\n },\n actions: {\n assignErrorDeviceNotOnboarded: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new DeviceNotOnboardedError(),\n }),\n }),\n assignErrorDeviceLocked: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new DeviceLockedError(),\n }),\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n }),\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n assignNoUserActionNeeded: assign({\n intermediateValue: (_) =>\n ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }) satisfies types[\"context\"][\"intermediateValue\"],\n }),\n assignUserActionUnlockNeeded: assign({\n intermediateValue: (_) =>\n ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n }) satisfies types[\"context\"][\"intermediateValue\"],\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QHEwBcAiYBuBLAxmAMpoCGaArrFnoQIL5q4D2AdgHQ0FgBKYpEAJ4BiANoAGALqJQAB2axcTNjJAAPRAFoArAHZx7AIwAmQ7oCcugMyHzANmMAWYwBoQgxI8vsAHOJM+VuLmVj5e2gC+EW6omDjcJORUXPSMLBwA8qwARsykAE4QuKxQAMIAFmD4ANZiUqryisqsqhoImo4O7OGhPj4h5n6Obh4IunZ2RoZ+ena6nYaGUTHoKcRklNTxqc3sWbkFRSUVVbWihtJIII1K6a1aVtoGTxOOjtbv84YjiObik7ofPM7GFDP9jNofMsQLE1olNmsGLsADLMGrFMqVGp1S5yBS3FRXNqaOzadjiHx2KyORbzcRBczmH4IbTOdjaabaKmdGy6XSRaIw1bbdZJLa0MBI9LsVHo45Ys4XBr45r3dps-n0ubaGxgx6PZlWULkkLBGmDCzGYzQ2Ei+HJEVStjsACqsDA+SdrBdrAANmjqmthBA2GB2MVsMxqmG3R6vT7-TU1hJcdcVXciYgglZycYQiYqRTQoZtMynDmbM4aW8rHYzD4BSs4hL7eLuF7Xe7PWk2AmA0GPflmPl2LJfeQAGbDgC2nbjPe9fv7IpTyqaGdAbXmxnZPkMNNM820VuZ+8M7Dsb3MznpwW31sFtpbGwdEo7dFksjorAgADUPYobAnNiIasGGEZRmGT4JC+bY7NKH5fj+-75IBrDAdUCAQfg5DpCmq5XDcqqZmMjgGDY-yGJeejjFRzJ2P47DZoEJb+Hyx42sKz5ioiC7sIh35-gB6QYcIg7DqO45oFO+SztBhCtrxuwCchwlAQqWGsJGOHNPh9SEemhKbogdLsIMTjmPuNF1nYZaOBW+5OPu9l1oCjZCs2ME8Y6fGIb6BC4WwdDYKQuDjtkvq8HAFC+mgokEXi65GeoiBguYZJOPSJa6Hm1hGsyuglkxxiUjYVjXlq7nyaKCI+cpn7+Tp6TBaF4WRXwsAxXFCpiEqBlJS0JFAo4vg+BCe55e8-QFUVVglVShjlWRtZ2FEgqsMwEBwKo1WKXVG5pgNaokmRZmQg4fyLHR7ieCNpjGPyx7aNo6UNo4nGeQpsFKdKax8AIoyJQSg3Ge0L07q9F3+Istk3Qg1IjUaZ7GNS-LlU4H1wt9+3OvseSFBiGFrsDx01mZ15mHooReFaVj0fZ5Jci5zissYIKY3a2NvnxsrVITCrE8RoMdDucxWgx1jpZCELDHDgKTC9jg6mNXKLDSHPcbV3O7LG3bNH2SYioLB3EmCI1-HuVL6Cj4hU6eNjsIVD3UrWfKXVCj5cV5Wvtr5n6CShaFE-1JMkWzPgXpCjh+Faw3Mjq5jdOlJhGvo-RzRr3uvr79VjgFzQtWFpARVFnWxcHQNCylCBm+eKPjJL4jWMEdNww4O46vSFVsfyD5Nlj3na9KRAUPghCwPAIdV20QIR7e-RzOYbNK98cN7ndgR-BSzgo+YmdfYPOfSgAovkQ75MbyVtItehmSrJgcijz2uHD+pmXyQSQnyVLs2tQA */\n id: \"GetDeviceStatusDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n const sessionState = getDeviceSessionState();\n const { sessionStateType } = sessionState;\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n onboarded: false, // we don't know how to check yet\n locked: false,\n currentApp:\n sessionStateType ===\n DeviceSessionStateType.ReadyWithoutSecureChannel\n ? sessionState.currentApp.name\n : null,\n currentAppVersion: null,\n error: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"OnboardingCheck\",\n },\n },\n OnboardingCheck: {\n // TODO: we don't have this info for now\n always: [\n {\n guard: {\n type: \"isDeviceOnboarded\",\n },\n target: \"AppAndVersionCheck\",\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n onboarded: true,\n }),\n }),\n },\n {\n target: \"Error\",\n actions: \"assignErrorDeviceNotOnboarded\",\n },\n ],\n },\n UserActionUnlockDevice: {\n // we wait for the device to be unlocked (default timeout is 15s)\n entry: \"assignUserActionUnlockNeeded\",\n exit: \"assignNoUserActionNeeded\",\n invoke: {\n id: \"UserActionUnlockDevice\",\n src: \"waitForDeviceUnlock\",\n input: (_) => ({\n unlockTimeout,\n }),\n onDone: {\n target: \"AppAndVersionCheck\",\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n locked: false,\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorDeviceLocked\",\n },\n },\n },\n AppAndVersionCheck: {\n // We check the current app and version using the getAppAndVersion command\n invoke: {\n src: \"getAppAndVersion\",\n onDone: {\n target: \"ApplicationAvailableResultCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const state: DeviceSessionState = getDeviceSessionState();\n if (\n state.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n // Update the current app\n setDeviceSessionState({\n ...state,\n currentApp: _.event.output.data,\n });\n } else {\n // The device can be set to Ready if GetAppAndVersionCommand was successful\n setDeviceSessionState({\n deviceModelId: state.deviceModelId,\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: _.event.output.data,\n installedApps: [],\n isSecureConnectionAllowed: false,\n });\n }\n return {\n ..._.context._internalState,\n locked: false,\n currentApp: _.event.output.data.name,\n currentAppVersion: _.event.output.data.version,\n };\n }\n if (\"errorCode\" in _.event.output.error) {\n if (_.event.output.error.errorCode === \"5515\") {\n // Locked device error\n return {\n ..._.context._internalState,\n locked: true,\n };\n } else if (_.event.output.error.errorCode === \"6e00\") {\n // CLA not supported\n // GetAppAndVersion should always be supported by the firmware or any app.\n // But on old firmware versions, that APDU was not supported in the dashboard.\n // On those firmwares, it fails with CLA_NOT_SUPPORTED in BOLOS, and INS_NOT_SUPPORTED\n // in applications. Therefore if CLA is not supported, we can consider we're on the\n // dashboard on an old firmware. We should therefore return that information to\n // ensure the user can still update his firmware and is not blocked at this step.\n return {\n ..._.context._internalState,\n locked: false,\n currentApp: \"BOLOS\",\n currentAppVersion: \"0.0.0\",\n };\n }\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n ApplicationAvailableResultCheck: {\n always: [\n {\n guard: \"hasError\",\n target: \"Error\",\n },\n {\n target: \"UserActionUnlockDevice\",\n guard: \"isDeviceLocked\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (args) => {\n // TODO: instead we should rely on the current state (\"Success\" or \"Error\")\n const { context } = args;\n const { error, currentApp, currentAppVersion } = context._internalState;\n if (error) {\n return Left(error);\n }\n return Right<GetDeviceStatusDAOutput>({\n currentApp: currentApp!,\n currentAppVersion: currentAppVersion!,\n });\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getAppAndVersion = () => {\n return internalApi.sendCommand(new GetAppAndVersionCommand());\n };\n\n const waitForDeviceUnlock = ({\n input,\n }: {\n input: { unlockTimeout: number };\n }) =>\n new Observable<void>((subscriber) => {\n const inner = internalApi\n .getDeviceSessionStateObservable()\n .pipe(\n tap((state) => {\n if (state.deviceStatus === DeviceStatus.CONNECTED) {\n subscriber.complete();\n inner.unsubscribe();\n }\n }),\n )\n .subscribe();\n\n return () => {\n inner.unsubscribe();\n };\n }).pipe(timeout(input.unlockTimeout));\n\n return {\n getAppAndVersion,\n waitForDeviceUnlock,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n isDeviceOnboar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,CACrB,CAAC,CACH,CACF,CAAC,CACH,CAEA,oBAAoBf,EAA+C,CA4BjE,MAAO,CACL,iBA5BuB,IAChBA,EAAY,YAAY,IAAI,yBAAyB,EA4B5D,oBAzB0B,CAAC,CAC3B,MAAAgB,CACF,IAGE,IAAI,aAAkBC,GAAe,CACnC,MAAMC,EAAQlB,EACX,gCAAgC,EAChC,QACC,OAAKW,GAAU,CACTA,EAAM,eAAiB,eAAa,YACtCM,EAAW,SAAS,EACpBC,EAAM,YAAY,EAEtB,CAAC,CACH,EACC,UAAU,EAEb,MAAO,IAAM,CACXA,EAAM,YAAY,CACpB,CACF,CAAC,EAAE,QAAK,WAAQF,EAAM,aAAa,CAAC,EAKpC,sBAAuB,IAAMhB,EAAY,sBAAsB,EAC/D,sBAAwBW,GACtBX,EAAY,sBAAsBW,CAAK,EACzC,kBAAmB,IAAM,EAC3B,CACF,CACF",
6
6
  "names": ["GetDeviceStatusDeviceAction_exports", "__export", "GetDeviceStatusDeviceAction", "__toCommonJS", "import_purify_ts", "import_rxjs", "import_operators", "import_xstate", "import_CommandResult", "import_GetAppAndVersionCommand", "import_DeviceStatus", "import_UserInteractionRequired", "import_Const", "import_Errors", "import_XStateDeviceAction", "import_DeviceSessionState", "internalApi", "getAppAndVersion", "getDeviceSessionState", "setDeviceSessionState", "waitForDeviceUnlock", "isDeviceOnboarded", "unlockTimeout", "context", "_", "sessionState", "sessionStateType", "state", "args", "error", "currentApp", "currentAppVersion", "input", "subscriber", "inner"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var u=require("rxjs"),v=require("../../../command/model/CommandResult"),y=require("../../../command/utils/GlobalCommandError"),S=require("../../../device/DeviceModel"),i=require("../../../device/DeviceStatus"),a=require("../../../device-action/__test-utils__/makeInternalApi"),d=require("../../../device-action/__test-utils__/testDeviceActionStates"),t=require("../../../device-action/model/DeviceActionState"),c=require("../../../device-action/model/UserInteractionRequired"),D=require("../../../device-action/os/Errors"),o=require("../../../device-session/DeviceSessionState"),p=require("./GetDeviceStatusDeviceAction");describe("GetDeviceStatusDeviceAction",()=>{const k=jest.fn(),l=jest.fn(),h=jest.fn(),f=jest.fn(),O=jest.fn();function A(){return{getAppAndVersion:k,getDeviceSessionState:l,waitForDeviceUnlock:h,setDeviceSessionState:f,isDeviceOnboarded:O}}const{sendCommand:R,getDeviceSessionState:V,getDeviceSessionStateObservable:E}=(0,a.makeDeviceActionInternalApiMock)();beforeEach(()=>{jest.resetAllMocks(),O.mockReturnValue(!0)}),describe("without overriding `extractDependencies`",()=>{it("should run the device action with an unlocked device",r=>{const e=new p.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});V.mockReturnValue({sessionStateType:o.DeviceSessionStateType.Connected,deviceStatus:i.DeviceStatus.CONNECTED,deviceModelId:S.DeviceModelId.FLEX}),R.mockResolvedValue((0,v.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}}));const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"},status:t.DeviceActionStatus.Completed}];(0,d.testDeviceActionStates)(e,n,(0,a.makeDeviceActionInternalApiMock)(),r)}),it("should run the device action with a locked device",r=>{const e=new p.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});V.mockReturnValue({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:S.DeviceModelId.FLEX}),E.mockImplementation(()=>new u.Observable(s=>{const m=(0,u.interval)(50).subscribe({next:C=>{C>2?(s.next({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:S.DeviceModelId.FLEX}),s.complete()):s.next({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:S.DeviceModelId.FLEX})}});return()=>{m.unsubscribe()}})),R.mockResolvedValue((0,v.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}}));const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.UnlockDevice},status:t.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"},status:t.DeviceActionStatus.Completed}];(0,d.testDeviceActionStates)(e,n,(0,a.makeDeviceActionInternalApiMock)(),r)})}),describe("success cases",()=>{it("should return the device status if the device is unlocked",r=>{l.mockReturnValue({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),k.mockResolvedValue((0,v.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}}));const e=new p.GetDeviceStatusDeviceAction({input:{unlockTimeout:void 0}});jest.spyOn(e,"extractDependencies").mockReturnValue(A());const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{status:t.DeviceActionStatus.Completed,output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"}}];(0,d.testDeviceActionStates)(e,n,(0,a.makeDeviceActionInternalApiMock)(),r)}),it("should return the device status if the device is locked and the user unlocks the device",r=>{l.mockReturnValue({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),k.mockResolvedValue((0,v.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}})),h.mockImplementation(()=>new u.Observable(s=>{const m=(0,u.interval)(50).subscribe({next:C=>{C>2?(s.next({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),s.complete()):s.next({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}})}});return()=>{m.unsubscribe()}}));const e=new p.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});jest.spyOn(e,"extractDependencies").mockReturnValue(A());const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.UnlockDevice},status:t.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{status:t.DeviceActionStatus.Completed,output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"}}];(0,d.testDeviceActionStates)(e,n,(0,a.makeDeviceActionInternalApiMock)(),r)})}),describe("errors cases",()=>{it("should end in an error if the device is not onboarded",r=>{l.mockReturnValue({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),O.mockReturnValue(!1);const e=new p.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});jest.spyOn(e,"extractDependencies").mockReturnValue(A());const n=[{error:new D.DeviceNotOnboardedError,status:t.DeviceActionStatus.Error}];(0,d.testDeviceActionStates)(e,n,(0,a.makeDeviceActionInternalApiMock)(),r)}),it("should end in an error if the device is locked and the user does not unlock",r=>{l.mockReturnValue({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),E.mockImplementation(()=>new u.Observable(s=>{const m=(0,u.interval)(200).subscribe({next:()=>{s.next({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:S.DeviceModelId.FLEX})}});return()=>{m.unsubscribe()}}));const e=new p.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});jest.spyOn(e,"extractDependencies").mockReturnValue(A());const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.UnlockDevice},status:t.DeviceActionStatus.Pending},{error:new D.DeviceLockedError("Device locked."),status:t.DeviceActionStatus.Error}];(0,d.testDeviceActionStates)(e,n,(0,a.makeDeviceActionInternalApiMock)(),r)}),it("should end in an error if the GetAppAndVersion command fails",r=>{l.mockReturnValue({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}});const e=new y.GlobalCommandError({...y.GLOBAL_ERRORS[5501],errorCode:"5501"});k.mockResolvedValue((0,v.CommandResultFactory)({error:e})),h.mockImplementation(()=>new u.Observable(m=>{const C=(0,u.interval)(50).subscribe({next:b=>{b>2?(m.next({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),m.complete()):m.next({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}})}});return()=>{C.unsubscribe()}}));const n=new p.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});jest.spyOn(n,"extractDependencies").mockReturnValue(A());const s=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.UnlockDevice},status:t.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{error:e,status:t.DeviceActionStatus.Error}];(0,d.testDeviceActionStates)(n,s,(0,a.makeDeviceActionInternalApiMock)(),r)}),it("should end in an error if getAppAndVersion actor throws an error",r=>{l.mockReturnValue({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),k.mockImplementation(()=>{throw new D.UnknownDAError("error")}),h.mockImplementation(()=>new u.Observable(s=>{s.complete()}));const e=new p.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});jest.spyOn(e,"extractDependencies").mockReturnValue(A());const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.UnlockDevice},status:t.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{error:new D.UnknownDAError("error"),status:t.DeviceActionStatus.Error}];(0,d.testDeviceActionStates)(e,n,(0,a.makeDeviceActionInternalApiMock)(),r)})}),it("should emit a stopped state if the action is cancelled",r=>{V.mockReturnValue({sessionStateType:o.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:S.DeviceModelId.FLEX}),R.mockResolvedValue((0,v.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}}));const e=new p.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}}),n=[{status:t.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None}},{status:t.DeviceActionStatus.Stopped}],{cancel:s}=(0,d.testDeviceActionStates)(e,n,(0,a.makeDeviceActionInternalApiMock)(),r);s()})});
1
+ "use strict";var v=require("rxjs"),d=require("../../../command/model/CommandResult"),m=require("../../../command/utils/GlobalCommandError"),D=require("../../../device/DeviceModel"),i=require("../../../device/DeviceStatus"),u=require("../../../device-action/__test-utils__/makeInternalApi"),p=require("../../../device-action/__test-utils__/testDeviceActionStates"),t=require("../../../device-action/model/DeviceActionState"),c=require("../../../device-action/model/UserInteractionRequired"),O=require("../../../device-action/os/Errors"),s=require("../../../device-session/DeviceSessionState"),l=require("./GetDeviceStatusDeviceAction");describe("GetDeviceStatusDeviceAction",()=>{const k=vi.fn(),A=vi.fn(),y=vi.fn(),w=vi.fn(),E=vi.fn();function C(){return{getAppAndVersion:k,getDeviceSessionState:A,waitForDeviceUnlock:y,setDeviceSessionState:w,isDeviceOnboarded:E}}const{sendCommand:V,getDeviceSessionState:R,getDeviceSessionStateObservable:N}=(0,u.makeDeviceActionInternalApiMock)();beforeEach(()=>{vi.resetAllMocks(),E.mockReturnValue(!0)}),describe("without overriding `extractDependencies`",()=>{it("should run the device action with an unlocked device",()=>new Promise((r,o)=>{const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});R.mockReturnValue({sessionStateType:s.DeviceSessionStateType.Connected,deviceStatus:i.DeviceStatus.CONNECTED,deviceModelId:D.DeviceModelId.NANO_X}),V.mockResolvedValue((0,d.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}}));const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"},status:t.DeviceActionStatus.Completed}];(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:r,onError:o})})),it("should run the device action with a locked device",()=>new Promise((r,o)=>{const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});R.mockReturnValue({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:D.DeviceModelId.NANO_X,isSecureConnectionAllowed:!1}),N.mockImplementation(()=>new v.Observable(a=>{const S=(0,v.interval)(50).subscribe({next:h=>{h>2?(a.next({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:D.DeviceModelId.NANO_X,isSecureConnectionAllowed:!1}),a.complete()):a.next({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:D.DeviceModelId.NANO_X,isSecureConnectionAllowed:!1})}});return()=>{S.unsubscribe()}})),V.mockResolvedValueOnce((0,d.CommandResultFactory)({error:new m.GlobalCommandError({...m.GLOBAL_ERRORS[5515],errorCode:"5515"})})).mockResolvedValueOnce((0,d.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}}));const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.UnlockDevice},status:t.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"},status:t.DeviceActionStatus.Completed}];(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:r,onError:o})})),it("should run the device action with an old firmware not supporting GetAppAndVersion",()=>new Promise((r,o)=>{const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});R.mockReturnValue({sessionStateType:s.DeviceSessionStateType.Connected,deviceStatus:i.DeviceStatus.CONNECTED,deviceModelId:D.DeviceModelId.NANO_X}),V.mockResolvedValue((0,d.CommandResultFactory)({error:new m.GlobalCommandError({...m.GLOBAL_ERRORS["6e00"],errorCode:"6e00"})}));const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{output:{currentApp:"BOLOS",currentAppVersion:"0.0.0"},status:t.DeviceActionStatus.Completed}];(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:r,onError:o})}))}),describe("success cases",()=>{it("should return the device status if the device is unlocked",()=>new Promise((r,o)=>{A.mockReturnValue({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),k.mockResolvedValue((0,d.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}}));const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:void 0}});vi.spyOn(e,"extractDependencies").mockReturnValue(C());const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{status:t.DeviceActionStatus.Completed,output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"}}];(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:()=>{expect(w).toHaveBeenCalledWith({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.0.0"}}),r()},onError:o})})),it("should return the device status and update session if the device is not ready",()=>new Promise((r,o)=>{A.mockReturnValue({sessionStateType:s.DeviceSessionStateType.Connected,deviceStatus:i.DeviceStatus.CONNECTED}),k.mockResolvedValue((0,d.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}}));const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:void 0}});vi.spyOn(e,"extractDependencies").mockReturnValue(C());const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{status:t.DeviceActionStatus.Completed,output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"}}];(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:()=>{expect(w).toHaveBeenCalledWith({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.0.0"},installedApps:[],isSecureConnectionAllowed:!1}),r()},onError:o})})),it("should return the device status if the device is locked and the user unlocks the device",()=>new Promise((r,o)=>{A.mockReturnValue({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),k.mockResolvedValueOnce((0,d.CommandResultFactory)({error:new m.GlobalCommandError({...m.GLOBAL_ERRORS[5515],errorCode:"5515"})})).mockResolvedValueOnce((0,d.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}})),y.mockImplementation(()=>new v.Observable(a=>{const S=(0,v.interval)(50).subscribe({next:h=>{h>2?(a.next({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),a.complete()):a.next({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}})}});return()=>{S.unsubscribe()}}));const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});vi.spyOn(e,"extractDependencies").mockReturnValue(C());const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.UnlockDevice},status:t.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{status:t.DeviceActionStatus.Completed,output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"}}];(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:r,onError:o})}))}),describe("errors cases",()=>{it("should end in an error if the device is not onboarded",()=>new Promise((r,o)=>{A.mockReturnValue({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),E.mockReturnValue(!1);const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});vi.spyOn(e,"extractDependencies").mockReturnValue(C());const n=[{error:new O.DeviceNotOnboardedError,status:t.DeviceActionStatus.Error}];(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:r,onError:o})})),it("should end in an error if the device is locked and the user does not unlock",()=>new Promise((r,o)=>{A.mockReturnValue({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),k.mockResolvedValue((0,d.CommandResultFactory)({error:new m.GlobalCommandError({...m.GLOBAL_ERRORS[5515],errorCode:"5515"})})),N.mockImplementation(()=>new v.Observable(a=>{const S=(0,v.interval)(200).subscribe({next:()=>{a.next({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:D.DeviceModelId.NANO_X,isSecureConnectionAllowed:!1})}});return()=>{S.unsubscribe()}}));const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});vi.spyOn(e,"extractDependencies").mockReturnValue(C());const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.UnlockDevice},status:t.DeviceActionStatus.Pending},{error:new O.DeviceLockedError("Device locked."),status:t.DeviceActionStatus.Error}];(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:r,onError:o})})),it("should end in an error if the GetAppAndVersion command fails",()=>new Promise((r,o)=>{A.mockReturnValue({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}});const e=new m.GlobalCommandError({...m.GLOBAL_ERRORS[5501],errorCode:"5501"});k.mockResolvedValue((0,d.CommandResultFactory)({error:e})),y.mockImplementation(()=>new v.Observable(S=>{const h=(0,v.interval)(50).subscribe({next:f=>{f>2?(S.next({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),S.complete()):S.next({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}})}});return()=>{h.unsubscribe()}}));const n=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});vi.spyOn(n,"extractDependencies").mockReturnValue(C());const a=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{error:e,status:t.DeviceActionStatus.Error}];(0,p.testDeviceActionStates)(n,a,(0,u.makeDeviceActionInternalApiMock)(),{onDone:r,onError:o})})),it("should end in an error if getAppAndVersion actor throws an error",()=>new Promise((r,o)=>{A.mockReturnValue({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),k.mockImplementation(()=>{throw new O.UnknownDAError("error")}),y.mockImplementation(()=>new v.Observable(a=>{a.complete()}));const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}});vi.spyOn(e,"extractDependencies").mockReturnValue(C());const n=[{intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None},status:t.DeviceActionStatus.Pending},{error:new O.UnknownDAError("error"),status:t.DeviceActionStatus.Error}];(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:r,onError:o})}))}),it("should emit a stopped state if the action is cancelled",()=>new Promise((r,o)=>{R.mockReturnValue({sessionStateType:s.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:i.DeviceStatus.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:D.DeviceModelId.NANO_X,isSecureConnectionAllowed:!1}),V.mockResolvedValue((0,d.CommandResultFactory)({data:{name:"BOLOS",version:"1.0.0"}}));const e=new l.GetDeviceStatusDeviceAction({input:{unlockTimeout:500}}),n=[{status:t.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:c.UserInteractionRequired.None}},{status:t.DeviceActionStatus.Stopped}],{cancel:a}=(0,p.testDeviceActionStates)(e,n,(0,u.makeDeviceActionInternalApiMock)(),{onDone:r,onError:o});a()}))});
2
2
  //# sourceMappingURL=GetDeviceStatusDeviceAction.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.ts"],
4
- "sourcesContent": ["import { interval, Observable } from \"rxjs\";\n\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n} from \"@api/command/utils/GlobalCommandError\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport {\n DeviceLockedError,\n DeviceNotOnboardedError,\n UnknownDAError,\n} from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\n\nimport { GetDeviceStatusDeviceAction } from \"./GetDeviceStatusDeviceAction\";\nimport { type GetDeviceStatusDAState } from \"./types\";\n\ndescribe(\"GetDeviceStatusDeviceAction\", () => {\n const getAppAndVersionMock = jest.fn();\n const getDeviceSessionStateMock = jest.fn();\n const waitForDeviceUnlockMock = jest.fn();\n const setDeviceSessionState = jest.fn();\n const isDeviceOnboardedMock = jest.fn();\n\n function extractDependenciesMock() {\n return {\n getAppAndVersion: getAppAndVersionMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n waitForDeviceUnlock: waitForDeviceUnlockMock,\n setDeviceSessionState: setDeviceSessionState,\n isDeviceOnboarded: isDeviceOnboardedMock,\n };\n }\n\n const {\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n getDeviceSessionStateObservable: apiGetDeviceSessionStateObservableMock,\n } = makeDeviceActionInternalApiMock();\n beforeEach(() => {\n jest.resetAllMocks();\n isDeviceOnboardedMock.mockReturnValue(true);\n });\n\n describe(\"without overriding `extractDependencies`\", () => {\n it(\"should run the device action with an unlocked device\", (done) => {\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: DeviceModelId.FLEX,\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with a locked device\", (done) => {\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n\n apiGetDeviceSessionStateObservableMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"success cases\", () => {\n it(\"should return the device status if the device is unlocked\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: undefined },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Completed,\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return the device status if the device is locked and the user unlocks the device\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Completed,\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"errors cases\", () => {\n it(\"should end in an error if the device is not onboarded\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n isDeviceOnboardedMock.mockReturnValue(false);\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n error: new DeviceNotOnboardedError(),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should end in an error if the device is locked and the user does not unlock\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n apiGetDeviceSessionStateObservableMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(200).subscribe({\n next: () => {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error: new DeviceLockedError(\"Device locked.\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should end in an error if the GetAppAndVersion command fails\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n const error = new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5501\"],\n errorCode: \"5501\",\n });\n\n getAppAndVersionMock.mockResolvedValue(CommandResultFactory({ error }));\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error,\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should end in an error if getAppAndVersion actor throws an error\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockImplementation(() => {\n throw new UnknownDAError(\"error\");\n });\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n o.complete();\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error: new UnknownDAError(\"error\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n it(\"should emit a stopped state if the action is cancelled\", (done) => {\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n status: DeviceActionStatus.Pending, // get app and version\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Stopped,\n },\n ];\n\n const { cancel } = testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n cancel();\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAqC,gBAErCC,EAAqC,4CACrCC,EAGO,iDACPC,EAA8B,mCAC9BC,EAA6B,oCAC7BC,EAAgD,6DAChDC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAIO,wCACPC,EAAuC,kDAEvCC,EAA4C,yCAG5C,SAAS,8BAA+B,IAAM,CAC5C,MAAMC,EAAuB,KAAK,GAAG,EAC/BC,EAA4B,KAAK,GAAG,EACpCC,EAA0B,KAAK,GAAG,EAClCC,EAAwB,KAAK,GAAG,EAChCC,EAAwB,KAAK,GAAG,EAEtC,SAASC,GAA0B,CACjC,MAAO,CACL,iBAAkBL,EAClB,sBAAuBC,EACvB,oBAAqBC,EACrB,sBAAuBC,EACvB,kBAAmBC,CACrB,CACF,CAEA,KAAM,CACJ,YAAaE,EACb,sBAAuBC,EACvB,gCAAiCC,CACnC,KAAI,mCAAgC,EACpC,WAAW,IAAM,CACf,KAAK,cAAc,EACnBJ,EAAsB,gBAAgB,EAAI,CAC5C,CAAC,EAED,SAAS,2CAA4C,IAAM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,CAC5C,MAAM,IAAI,iBAAe,OAAO,CAClC,CAAC,EAEDE,EAAwB,mBACtB,IACE,IAAI,aAAYU,GAAM,CACpBA,EAAE,SAAS,CACb,CAAC,CACL,EAEA,MAAMF,EAA6B,IAAI,8BAA4B,CACjE,MAAO,CAAE,cAAe,GAAI,CAC9B,CAAC,EAED,KACG,MAAMA,EAA4B,qBAAqB,EACvD,gBAAgBL,EAAwB,CAAC,EAE5C,MAAMM,EAAgD,CACpD,CACE,kBAAmB,CACjB,wBAAyB,0BAAwB,YACnD,EACA,OAAQ,qBAAmB,OAC7B,EACA,CACE,kBAAmB,CACjB,wBAAyB,0BAAwB,IACnD,EACA,OAAQ,qBAAmB,OAC7B,EACA,CACE,MAAO,IAAI,iBAAe,OAAO,EACjC,OAAQ,qBAAmB,KAC7B,CACF,KAEA,0BACED,EACAC,KACA,mCAAgC,EAChCF,CACF,CACF,CAAC,CACH,CAAC,EAED,GAAG,yDAA2DA,GAAS,CACrEF,EAA6B,gBAAgB,CAC3C,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,WAAY,CAAE,KAAM,mBAAoB,QAAS,OAAQ,EACzD,cAAe,CAAC,EAChB,cAAe,gBAAc,IAC/B,CAAC,EAEDD,EAAgB,qBACd,wBAAqB,CACnB,KAAM,CACJ,KAAM,QACN,QAAS,OACX,CACF,CAAC,CACH,EAEA,MAAMI,EAA6B,IAAI,8BAA4B,CACjE,MAAO,CAAE,cAAe,GAAI,CAC9B,CAAC,EAEKC,EAAgD,CACpD,CACE,OAAQ,qBAAmB,QAC3B,kBAAmB,CACjB,wBAAyB,0BAAwB,IACnD,CACF,EACA,CACE,OAAQ,qBAAmB,OAC7B,CACF,EAEM,CAAE,OAAAK,CAAO,KAAI,0BACjBN,EACAC,KACA,mCAAgC,EAChCF,CACF,EACAO,EAAO,CACT,CAAC,CACH,CAAC",
6
- "names": ["import_rxjs", "import_CommandResult", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_makeInternalApi", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_DeviceSessionState", "import_GetDeviceStatusDeviceAction", "getAppAndVersionMock", "getDeviceSessionStateMock", "waitForDeviceUnlockMock", "setDeviceSessionState", "isDeviceOnboardedMock", "extractDependenciesMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "done", "getDeviceStateDeviceAction", "expectedStates", "o", "inner", "i", "error", "cancel"]
4
+ "sourcesContent": ["import { interval, Observable } from \"rxjs\";\n\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n} from \"@api/command/utils/GlobalCommandError\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport {\n DeviceLockedError,\n DeviceNotOnboardedError,\n UnknownDAError,\n} from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\n\nimport { GetDeviceStatusDeviceAction } from \"./GetDeviceStatusDeviceAction\";\nimport { type GetDeviceStatusDAState } from \"./types\";\n\ndescribe(\"GetDeviceStatusDeviceAction\", () => {\n const getAppAndVersionMock = vi.fn();\n const getDeviceSessionStateMock = vi.fn();\n const waitForDeviceUnlockMock = vi.fn();\n const setDeviceSessionState = vi.fn();\n const isDeviceOnboardedMock = vi.fn();\n\n function extractDependenciesMock() {\n return {\n getAppAndVersion: getAppAndVersionMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n waitForDeviceUnlock: waitForDeviceUnlockMock,\n setDeviceSessionState: setDeviceSessionState,\n isDeviceOnboarded: isDeviceOnboardedMock,\n };\n }\n\n const {\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n getDeviceSessionStateObservable: apiGetDeviceSessionStateObservableMock,\n } = makeDeviceActionInternalApiMock();\n beforeEach(() => {\n vi.resetAllMocks();\n isDeviceOnboardedMock.mockReturnValue(true);\n });\n\n describe(\"without overriding `extractDependencies`\", () => {\n it(\"should run the device action with an unlocked device\", () =>\n new Promise<void>((resolve, reject) => {\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: DeviceModelId.NANO_X,\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should run the device action with a locked device\", () =>\n new Promise<void>((resolve, reject) => {\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.NANO_X,\n isSecureConnectionAllowed: false,\n });\n\n apiGetDeviceSessionStateObservableMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: {\n name: \"mockedCurrentApp\",\n version: \"1.0.0\",\n },\n installedApps: [],\n deviceModelId: DeviceModelId.NANO_X,\n isSecureConnectionAllowed: false,\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: {\n name: \"mockedCurrentApp\",\n version: \"1.0.0\",\n },\n installedApps: [],\n deviceModelId: DeviceModelId.NANO_X,\n isSecureConnectionAllowed: false,\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n sendCommandMock\n .mockResolvedValueOnce(\n CommandResultFactory({\n error: new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5515\"],\n errorCode: \"5515\",\n }),\n }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should run the device action with an old firmware not supporting GetAppAndVersion\", () =>\n new Promise<void>((resolve, reject) => {\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: DeviceModelId.NANO_X,\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n error: new GlobalCommandError({\n ...GLOBAL_ERRORS[\"6e00\"],\n errorCode: \"6e00\",\n }),\n }),\n );\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"0.0.0\",\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n\n describe(\"success cases\", () => {\n it(\"should return the device status if the device is unlocked\", () =>\n new Promise<void>((resolve, reject) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: undefined },\n });\n\n vi.spyOn(\n getDeviceStateDeviceAction,\n \"extractDependencies\",\n ).mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Completed,\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: () => {\n // Session should be updated with current app\n expect(setDeviceSessionState).toHaveBeenCalledWith({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n });\n resolve();\n },\n onError: reject,\n },\n );\n }));\n\n it(\"should return the device status and update session if the device is not ready\", () =>\n new Promise<void>((resolve, reject) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n });\n\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: undefined },\n });\n\n vi.spyOn(\n getDeviceStateDeviceAction,\n \"extractDependencies\",\n ).mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Completed,\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: () => {\n // Session should be set as ready if GetAppAndVersionCommand was successful\n expect(setDeviceSessionState).toHaveBeenCalledWith({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n installedApps: [],\n isSecureConnectionAllowed: false,\n });\n resolve();\n },\n onError: reject,\n },\n );\n }));\n\n it(\"should return the device status if the device is locked and the user unlocks the device\", () =>\n new Promise<void>((resolve, reject) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock\n .mockResolvedValueOnce(\n CommandResultFactory({\n error: new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5515\"],\n errorCode: \"5515\",\n }),\n }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: {\n name: \"mockedCurrentApp\",\n version: \"1.0.0\",\n },\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: {\n name: \"mockedCurrentApp\",\n version: \"1.0.0\",\n },\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n vi.spyOn(\n getDeviceStateDeviceAction,\n \"extractDependencies\",\n ).mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Completed,\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n\n describe(\"errors cases\", () => {\n it(\"should end in an error if the device is not onboarded\", () =>\n new Promise<void>((resolve, reject) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n isDeviceOnboardedMock.mockReturnValue(false);\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n vi.spyOn(\n getDeviceStateDeviceAction,\n \"extractDependencies\",\n ).mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n error: new DeviceNotOnboardedError(),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should end in an error if the device is locked and the user does not unlock\", () =>\n new Promise<void>((resolve, reject) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n error: new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5515\"],\n errorCode: \"5515\",\n }),\n }),\n );\n\n apiGetDeviceSessionStateObservableMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(200).subscribe({\n next: () => {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.NANO_X,\n isSecureConnectionAllowed: false,\n });\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n vi.spyOn(\n getDeviceStateDeviceAction,\n \"extractDependencies\",\n ).mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error: new DeviceLockedError(\"Device locked.\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should end in an error if the GetAppAndVersion command fails\", () =>\n new Promise<void>((resolve, reject) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n const error = new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5501\"],\n errorCode: \"5501\",\n });\n\n getAppAndVersionMock.mockResolvedValue(CommandResultFactory({ error }));\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: {\n name: \"mockedCurrentApp\",\n version: \"1.0.0\",\n },\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: {\n name: \"mockedCurrentApp\",\n version: \"1.0.0\",\n },\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n vi.spyOn(\n getDeviceStateDeviceAction,\n \"extractDependencies\",\n ).mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error,\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should end in an error if getAppAndVersion actor throws an error\", () =>\n new Promise<void>((resolve, reject) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockImplementation(() => {\n throw new UnknownDAError(\"error\");\n });\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n o.complete();\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n vi.spyOn(\n getDeviceStateDeviceAction,\n \"extractDependencies\",\n ).mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error: new UnknownDAError(\"error\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n\n it(\"should emit a stopped state if the action is cancelled\", () =>\n new Promise<void>((resolve, reject) => {\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.NANO_X,\n isSecureConnectionAllowed: false,\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n status: DeviceActionStatus.Pending, // get app and version\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Stopped,\n },\n ];\n\n const { cancel } = testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n cancel();\n }));\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAqC,gBAErCC,EAAqC,4CACrCC,EAGO,iDACPC,EAA8B,mCAC9BC,EAA6B,oCAC7BC,EAAgD,6DAChDC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAIO,wCACPC,EAAuC,kDAEvCC,EAA4C,yCAG5C,SAAS,8BAA+B,IAAM,CAC5C,MAAMC,EAAuB,GAAG,GAAG,EAC7BC,EAA4B,GAAG,GAAG,EAClCC,EAA0B,GAAG,GAAG,EAChCC,EAAwB,GAAG,GAAG,EAC9BC,EAAwB,GAAG,GAAG,EAEpC,SAASC,GAA0B,CACjC,MAAO,CACL,iBAAkBL,EAClB,sBAAuBC,EACvB,oBAAqBC,EACrB,sBAAuBC,EACvB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B,kBAAmB,CACjB,wBAAyB,0BAAwB,IACnD,CACF,EACA,CACE,OAAQ,qBAAmB,OAC7B,CACF,EAEM,CAAE,OAAAK,CAAO,KAAI,0BACjBN,EACAC,KACA,mCAAgC,EAChC,CACE,OAAQH,EACR,QAASC,CACX,CACF,EACAO,EAAO,CACT,CAAC,CAAC,CACN,CAAC",
6
+ "names": ["import_rxjs", "import_CommandResult", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_makeInternalApi", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_DeviceSessionState", "import_GetDeviceStatusDeviceAction", "getAppAndVersionMock", "getDeviceSessionStateMock", "waitForDeviceUnlockMock", "setDeviceSessionState", "isDeviceOnboardedMock", "extractDependenciesMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "resolve", "reject", "getDeviceStateDeviceAction", "expectedStates", "o", "inner", "i", "error", "cancel"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var f=(a,t)=>{for(var s in t)c(a,s,{get:t[s],enumerable:!0})},C=(a,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of b(t))!x.call(a,n)&&n!==s&&c(a,n,{get:()=>t[n],enumerable:!(i=G(t,n))||i.enumerable});return a};var E=a=>C(c({},"__esModule",{value:!0}),a);var k={};f(k,{GoToDashboardDeviceAction:()=>I});module.exports=E(k);var p=require("purify-ts"),r=require("xstate"),u=require("../../../command/model/CommandResult"),D=require("../../../command/os/CloseAppCommand"),l=require("../../../command/os/GetAppAndVersionCommand"),S=require("../../../device-action/model/UserInteractionRequired"),A=require("../../../device-action/os/Const"),m=require("../../../device-action/os/Errors"),h=require("../../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),v=require("../../../device-action/xstate-utils/XStateDeviceAction"),y=require("../../../device-session/DeviceSessionState");class I extends v.XStateDeviceAction{makeStateMachine(t){const{getDeviceSessionState:s,setDeviceSessionState:i,closeApp:n,getAppAndVersion:g}=this.extractDependencies(t),d=this.input.unlockTimeout??A.DEFAULT_UNLOCK_TIMEOUT_MS,T=new h.GetDeviceStatusDeviceAction({input:{unlockTimeout:d}}).makeStateMachine(t);return(0,r.setup)({types:{input:{unlockTimeout:d},context:{},output:{}},actors:{getAppAndVersion:(0,r.fromPromise)(g),closeApp:(0,r.fromPromise)(n),getDeviceStatus:T},guards:{hasError:({context:e})=>e._internalState.error!==null,isDashboardOpen:({context:e})=>e._internalState.currentApp==="BOLOS"},actions:{assignErrorFromEvent:(0,r.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"GoToDashboardDeviceAction",initial:"DeviceReady",context:e=>{const o=s();return{input:{unlockTimeout:e.input.unlockTimeout},intermediateValue:{requiredUserInteraction:S.UserInteractionRequired.None},_internalState:{currentApp:"currentApp"in o?o.currentApp.name:null,error:null}}},states:{DeviceReady:{always:{target:"GetDeviceStatus"}},GetDeviceStatus:{invoke:{id:"deviceStatus",src:"getDeviceStatus",input:e=>({unlockTimeout:e.context.input.unlockTimeout}),onSnapshot:{actions:(0,r.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{target:"CheckDeviceStatus",actions:(0,r.assign)({_internalState:e=>e.event.output.caseOf({Right:o=>({...e.context._internalState,currentApp:o.currentApp}),Left:o=>({...e.context._internalState,error:o})})})}}},CheckDeviceStatus:{always:[{target:"Error",guard:"hasError"},{target:"DashboardCheck"}]},DashboardCheck:{always:[{target:"Success",guard:"isDashboardOpen"},{target:"Error",guard:"hasError"},{target:"Error",guard:e=>e.context._internalState.currentApp===null,actions:(0,r.assign)({_internalState:e=>({...e.context._internalState,error:new m.UnknownDAError("currentApp === null")})})},{target:"CloseApp"}]},CloseApp:{invoke:{src:"closeApp",onDone:{target:"CloseAppCheck",actions:(0,r.assign)({_internalState:e=>(0,u.isSuccessCommandResult)(e.event.output)?e.context._internalState:{...e.context._internalState,error:e.event.output.error}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},CloseAppCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetAppAndVersion",reenter:!0}]},GetAppAndVersion:{invoke:{src:"getAppAndVersion",onDone:{target:"DashboardCheck",actions:(0,r.assign)({_internalState:e=>{if((0,u.isSuccessCommandResult)(e.event.output)){const o=s();return o.sessionStateType!==y.DeviceSessionStateType.Connected&&i({...o,currentApp:e.event.output.data}),{...e.context._internalState,currentApp:e.event.output.data.name}}return{...e.context._internalState,error:e.event.output.error}}})}}},Success:{type:"final"},Error:{type:"final"}},output:e=>e.context._internalState.error?(0,p.Left)(e.context._internalState.error):(0,p.Right)(void 0)})}extractDependencies(t){return{closeApp:async()=>t.sendCommand(new D.CloseAppCommand),getAppAndVersion:async()=>t.sendCommand(new l.GetAppAndVersionCommand),getDeviceSessionState:()=>t.getDeviceSessionState(),setDeviceSessionState:n=>t.setDeviceSessionState(n)}}}0&&(module.exports={GoToDashboardDeviceAction});
1
+ "use strict";var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var C=(a,t)=>{for(var s in t)c(a,s,{get:t[s],enumerable:!0})},E=(a,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of f(t))!x.call(a,n)&&n!==s&&c(a,n,{get:()=>t[n],enumerable:!(i=b(t,n))||i.enumerable});return a};var I=a=>E(c({},"__esModule",{value:!0}),a);var M={};C(M,{GoToDashboardDeviceAction:()=>k});module.exports=I(M);var p=require("purify-ts"),r=require("xstate"),u=require("../../../command/model/CommandResult"),D=require("../../../command/os/CloseAppCommand"),l=require("../../../command/os/GetAppAndVersionCommand"),S=require("../../../device-action/model/UserInteractionRequired"),A=require("../../../device-action/os/Const"),m=require("../../../device-action/os/Errors"),h=require("../../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),v=require("../../../device-action/xstate-utils/XStateDeviceAction"),y=require("../../../device-session/DeviceSessionState"),g=require("../../../utils/AppName");class k extends v.XStateDeviceAction{makeStateMachine(t){const{getDeviceSessionState:s,setDeviceSessionState:i,closeApp:n,getAppAndVersion:T}=this.extractDependencies(t),d=this.input.unlockTimeout??A.DEFAULT_UNLOCK_TIMEOUT_MS,G=new h.GetDeviceStatusDeviceAction({input:{unlockTimeout:d}}).makeStateMachine(t);return(0,r.setup)({types:{input:{unlockTimeout:d},context:{},output:{}},actors:{getAppAndVersion:(0,r.fromPromise)(T),closeApp:(0,r.fromPromise)(n),getDeviceStatus:G},guards:{hasError:({context:e})=>e._internalState.error!==null,isDashboardOpen:({context:e})=>e._internalState.currentApp!==null&&(0,g.isDashboardName)(e._internalState.currentApp)},actions:{assignErrorFromEvent:(0,r.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"GoToDashboardDeviceAction",initial:"DeviceReady",context:e=>{const o=s();return{input:{unlockTimeout:e.input.unlockTimeout},intermediateValue:{requiredUserInteraction:S.UserInteractionRequired.None},_internalState:{currentApp:"currentApp"in o?o.currentApp.name:null,error:null}}},states:{DeviceReady:{always:{target:"GetDeviceStatus"}},GetDeviceStatus:{invoke:{id:"deviceStatus",src:"getDeviceStatus",input:e=>({unlockTimeout:e.context.input.unlockTimeout}),onSnapshot:{actions:(0,r.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{target:"CheckDeviceStatus",actions:(0,r.assign)({_internalState:e=>e.event.output.caseOf({Right:o=>({...e.context._internalState,currentApp:o.currentApp}),Left:o=>({...e.context._internalState,error:o})})})}}},CheckDeviceStatus:{always:[{target:"Error",guard:"hasError"},{target:"DashboardCheck"}]},DashboardCheck:{always:[{target:"Success",guard:"isDashboardOpen"},{target:"Error",guard:"hasError"},{target:"Error",guard:e=>e.context._internalState.currentApp===null,actions:(0,r.assign)({_internalState:e=>({...e.context._internalState,error:new m.UnknownDAError("currentApp === null")})})},{target:"CloseApp"}]},CloseApp:{invoke:{src:"closeApp",onDone:{target:"CloseAppCheck",actions:(0,r.assign)({_internalState:e=>(0,u.isSuccessCommandResult)(e.event.output)?e.context._internalState:{...e.context._internalState,error:e.event.output.error}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},CloseAppCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetAppAndVersion",reenter:!0}]},GetAppAndVersion:{invoke:{src:"getAppAndVersion",onDone:{target:"DashboardCheck",actions:(0,r.assign)({_internalState:e=>{if((0,u.isSuccessCommandResult)(e.event.output)){const o=s();return o.sessionStateType!==y.DeviceSessionStateType.Connected&&i({...o,currentApp:e.event.output.data}),{...e.context._internalState,currentApp:e.event.output.data.name}}return{...e.context._internalState,error:e.event.output.error}}})}}},Success:{type:"final"},Error:{type:"final"}},output:e=>e.context._internalState.error?(0,p.Left)(e.context._internalState.error):(0,p.Right)(void 0)})}extractDependencies(t){return{closeApp:async()=>t.sendCommand(new D.CloseAppCommand),getAppAndVersion:async()=>t.sendCommand(new l.GetAppAndVersionCommand),getDeviceSessionState:()=>t.getDeviceSessionState(),setDeviceSessionState:n=>t.setDeviceSessionState(n)}}}0&&(module.exports={GoToDashboardDeviceAction});
2
2
  //# sourceMappingURL=GoToDashboardDeviceAction.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.ts"],
4
- "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n CloseAppCommand,\n type CloseAppCommandResult,\n} from \"@api/command/os/CloseAppCommand\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionCommandResult,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\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\";\n\nimport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n} from \"./types\";\n\ntype GoToDashboardMachineInternalState = {\n readonly currentApp: string | null;\n readonly error: GoToDashboardDAError | null;\n};\n\nexport type MachineDependencies = {\n readonly getAppAndVersion: () => Promise<GetAppAndVersionCommandResult>;\n readonly closeApp: () => Promise<CloseAppCommandResult>;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n};\n\nexport type ExtractMachineDependencies = (\n internalApi: InternalApi,\n) => MachineDependencies;\n\nexport class GoToDashboardDeviceAction extends XStateDeviceAction<\n GoToDashboardDAOutput,\n GoToDashboardDAInput,\n GoToDashboardDAError,\n GoToDashboardDAIntermediateValue,\n GoToDashboardMachineInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GoToDashboardDAOutput,\n GoToDashboardDAInput,\n GoToDashboardDAError,\n GoToDashboardDAIntermediateValue,\n GoToDashboardMachineInternalState\n > {\n type types = StateMachineTypes<\n GoToDashboardDAOutput,\n GoToDashboardDAInput,\n GoToDashboardDAError,\n GoToDashboardDAIntermediateValue,\n GoToDashboardMachineInternalState\n >;\n\n const {\n getDeviceSessionState,\n setDeviceSessionState,\n closeApp,\n getAppAndVersion,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const getDeviceStatusMachine = new GetDeviceStatusDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalApi);\n return setup({\n types: {\n input: {\n unlockTimeout,\n } as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n getAppAndVersion: fromPromise(getAppAndVersion),\n closeApp: fromPromise(closeApp),\n getDeviceStatus: getDeviceStatusMachine,\n },\n guards: {\n hasError: ({ context }: { context: types[\"context\"] }) => {\n return context._internalState.error !== null;\n },\n isDashboardOpen: ({ context }: { context: types[\"context\"] }) =>\n context._internalState.currentApp === \"BOLOS\",\n },\n actions: {\n // assignGetDeviceStatusUnknownError: assign({\n // _internalState: (_) => ({\n // ..._.context._internalState,\n // error: new UnknownDAError(\"GetDeviceUnknownStatusError\"),\n // }),\n // }),\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QHED2AVVARAhrAFgEao4BOEWYAbgJYDGYAgnQC42oB2AdJbQwEpgcEAJ4BiANoAGALqJQAB1SwabTvJAAPRAHYAjFwDMATikA2MwA5DOnQBYArGeOGANCBGI9VrlcvmpRyknQwcAXzD3NExcAmIyCmp6JlZ2bmQwFl5kgGUWHBYAV1gxCE4wLhoOKlQAawqIJIY8guLpOSQQJRU1Dg1tBAAmOy49QYcpHQdBvR0pMcszO3dPBEM7My4HYz1pqWNLPRsdJYiojGw8IhJybIZmXq4AYXwwOlq7sBaikvaNbtUaX6iDsgy2g3Wdksjn8JlBDhWiAchk2OkMgysB2RzlBZxA0UucRuiT4KUeLzeHyaX3yP0keg6imUgPUnQGgxmo3hdkcemMwwcG0RCGxXDRGMsWJRxlxkXxF1i1wSnweaR4V3i5Ap70ksn+zN6wIQfMs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ACirHsRXmMBjIi2JaRwEIDzeWtsDMmgUdCthwjadSaJFiWBumEIAA */\n id: \"GoToDashboardDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n const sessionState = getDeviceSessionState();\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n currentApp:\n \"currentApp\" in sessionState\n ? sessionState.currentApp.name\n : null,\n error: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"GetDeviceStatus\",\n },\n },\n GetDeviceStatus: {\n // We run the GetDeviceStatus flow to get information about the device state\n invoke: {\n id: \"deviceStatus\",\n src: \"getDeviceStatus\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n target: \"CheckDeviceStatus\",\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<GoToDashboardMachineInternalState>(\n {\n Right: (output) => ({\n ..._.context._internalState,\n currentApp: output.currentApp,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n },\n );\n },\n }),\n },\n // NOTE: The way we handle our DeviceActions means that we should never as we return an Either\n // onError: {\n // target: \"Error\",\n // actions: \"assignGetDeviceStatusUnknownError\",\n // },\n },\n },\n CheckDeviceStatus: {\n // We check the device status to see if we can have an error\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"DashboardCheck\",\n },\n ],\n },\n DashboardCheck: {\n // We check if the dashboard is open\n always: [\n {\n target: \"Success\",\n guard: \"isDashboardOpen\",\n },\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Error\",\n guard: (_) => {\n return _.context._internalState.currentApp === null;\n },\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\"currentApp === null\"),\n }),\n }),\n },\n {\n target: \"CloseApp\",\n },\n ],\n },\n CloseApp: {\n invoke: {\n src: \"closeApp\",\n onDone: {\n target: \"CloseAppCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n return _.context._internalState;\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n CloseAppCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetAppAndVersion\",\n reenter: true,\n },\n ],\n },\n GetAppAndVersion: {\n invoke: {\n src: \"getAppAndVersion\",\n onDone: {\n target: \"DashboardCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const state: DeviceSessionState = getDeviceSessionState();\n // Narrow the type to ReadyWithoutSecureChannelState or ReadyWithSecureChannelState\n if (\n state.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...state,\n currentApp: _.event.output.data,\n });\n }\n return {\n ..._.context._internalState,\n currentApp: _.event.output.data.name,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\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 }\n\n return Right(undefined);\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const closeApp = async () => internalApi.sendCommand(new CloseAppCommand());\n const getAppAndVersion = async () =>\n internalApi.sendCommand(new GetAppAndVersionCommand());\n\n return {\n closeApp,\n getAppAndVersion,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,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ACN,IAAK,mBACL,OAAQ,CACN,OAAQ,iBACR,WAAS,UAAO,CACd,eAAiBA,GAAM,CACrB,MAAI,0BAAuBA,EAAE,MAAM,MAAM,EAAG,CAC1C,MAAMI,EAA4BX,EAAsB,EAExD,OACEW,EAAM,mBACN,yBAAuB,WAEvBV,EAAsB,CACpB,GAAGU,EACH,WAAYJ,EAAE,MAAM,OAAO,IAC7B,CAAC,EAEI,CACL,GAAGA,EAAE,QAAQ,eACb,WAAYA,EAAE,MAAM,OAAO,KAAK,IAClC,CACF,CACA,MAAO,CACL,GAAGA,EAAE,QAAQ,eACb,MAAOA,EAAE,MAAM,OAAO,KACxB,CACF,CACF,CAAC,CACH,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,KAGrC,SAAM,MAAS,CAE1B,CAAC,CACH,CAEA,oBAAoBR,EAA+C,CAKjE,MAAO,CACL,SALe,SAAYA,EAAY,YAAY,IAAI,iBAAiB,EAMxE,iBALuB,SACvBA,EAAY,YAAY,IAAI,yBAAyB,EAKrD,sBAAuB,IAAMA,EAAY,sBAAsB,EAC/D,sBAAwBY,GACtBZ,EAAY,sBAAsBY,CAAK,CAC3C,CACF,CACF",
6
- "names": ["GoToDashboardDeviceAction_exports", "__export", "GoToDashboardDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_UserInteractionRequired", "import_Const", "import_Errors", "import_GetDeviceStatusDeviceAction", "import_XStateDeviceAction", "import_DeviceSessionState", "internalApi", "getDeviceSessionState", "setDeviceSessionState", "closeApp", "getAppAndVersion", "unlockTimeout", "getDeviceStatusMachine", "context", "_", "sessionState", "output", "error", "state"]
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n CloseAppCommand,\n type CloseAppCommandResult,\n} from \"@api/command/os/CloseAppCommand\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionCommandResult,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\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 { isDashboardName } from \"@api/utils/AppName\";\n\nimport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n} from \"./types\";\n\ntype GoToDashboardMachineInternalState = {\n readonly currentApp: string | null;\n readonly error: GoToDashboardDAError | null;\n};\n\nexport type MachineDependencies = {\n readonly getAppAndVersion: () => Promise<GetAppAndVersionCommandResult>;\n readonly closeApp: () => Promise<CloseAppCommandResult>;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n};\n\nexport type ExtractMachineDependencies = (\n internalApi: InternalApi,\n) => MachineDependencies;\n\nexport class GoToDashboardDeviceAction extends XStateDeviceAction<\n GoToDashboardDAOutput,\n GoToDashboardDAInput,\n GoToDashboardDAError,\n GoToDashboardDAIntermediateValue,\n GoToDashboardMachineInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GoToDashboardDAOutput,\n GoToDashboardDAInput,\n GoToDashboardDAError,\n GoToDashboardDAIntermediateValue,\n GoToDashboardMachineInternalState\n > {\n type types = StateMachineTypes<\n GoToDashboardDAOutput,\n GoToDashboardDAInput,\n GoToDashboardDAError,\n GoToDashboardDAIntermediateValue,\n GoToDashboardMachineInternalState\n >;\n\n const {\n getDeviceSessionState,\n setDeviceSessionState,\n closeApp,\n getAppAndVersion,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const getDeviceStatusMachine = new GetDeviceStatusDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalApi);\n return setup({\n types: {\n input: {\n unlockTimeout,\n } as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n getAppAndVersion: fromPromise(getAppAndVersion),\n closeApp: fromPromise(closeApp),\n getDeviceStatus: getDeviceStatusMachine,\n },\n guards: {\n hasError: ({ context }: { context: types[\"context\"] }) => {\n return context._internalState.error !== null;\n },\n isDashboardOpen: ({ context }: { context: types[\"context\"] }) =>\n context._internalState.currentApp !== null &&\n isDashboardName(context._internalState.currentApp),\n },\n actions: {\n // assignGetDeviceStatusUnknownError: assign({\n // _internalState: (_) => ({\n // ..._.context._internalState,\n // error: new UnknownDAError(\"GetDeviceUnknownStatusError\"),\n // }),\n // }),\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QHED2AVVARAhrAFgEao4BOEWYAbgJYDGYAgnQC42oB2AdJbQwEpgcEAJ4BiANoAGALqJQAB1SwabTvJAAPRAHYAjFwDMATikA2MwA5DOnQBYArGeOGANCBGI9VrlcvmpRyknQwcAXzD3NExcAmIyCmp6JlZ2bmQwFl5kgGUWHBYAV1gxCE4wLhoOKl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Jsl3jPY2wQ2YaKy6W8sVpZYbs+rmUzDl4y84T7rBDyZgOvsWvqd4EI67bU7AeJtlJc7zkbnyYrBORxGaVCDh6PhhtGAcJjjPye3EWHolxUGCV2YrMcfWhFi5TyjgUYb9h+2TFG+GMIUhRyUy7IXjV0RNH5tZ13VvUpRpjOYYpBWZCxzOnZNHQZGweSR7qhDLcMTqN9vcDkhR0AwsCq1Gq1GhyIxWvsSYWMZ-I9mTJGEbXsx7Av4Qb7ecsR48ACirHsRXmMBjIi2JaRwEIDzeWtsDMmgUdCthwjadSaJFiWBumEIAA */\n id: \"GoToDashboardDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n const sessionState = getDeviceSessionState();\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n currentApp:\n \"currentApp\" in sessionState\n ? sessionState.currentApp.name\n : null,\n error: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"GetDeviceStatus\",\n },\n },\n GetDeviceStatus: {\n // We run the GetDeviceStatus flow to get information about the device state\n invoke: {\n id: \"deviceStatus\",\n src: \"getDeviceStatus\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n target: \"CheckDeviceStatus\",\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<GoToDashboardMachineInternalState>(\n {\n Right: (output) => ({\n ..._.context._internalState,\n currentApp: output.currentApp,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n },\n );\n },\n }),\n },\n // NOTE: The way we handle our DeviceActions means that we should never as we return an Either\n // onError: {\n // target: \"Error\",\n // actions: \"assignGetDeviceStatusUnknownError\",\n // },\n },\n },\n CheckDeviceStatus: {\n // We check the device status to see if we can have an error\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"DashboardCheck\",\n },\n ],\n },\n DashboardCheck: {\n // We check if the dashboard is open\n always: [\n {\n target: \"Success\",\n guard: \"isDashboardOpen\",\n },\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Error\",\n guard: (_) => {\n return _.context._internalState.currentApp === null;\n },\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\"currentApp === null\"),\n }),\n }),\n },\n {\n target: \"CloseApp\",\n },\n ],\n },\n CloseApp: {\n invoke: {\n src: \"closeApp\",\n onDone: {\n target: \"CloseAppCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n return _.context._internalState;\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n CloseAppCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetAppAndVersion\",\n reenter: true,\n },\n ],\n },\n GetAppAndVersion: {\n invoke: {\n src: \"getAppAndVersion\",\n onDone: {\n target: \"DashboardCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const state: DeviceSessionState = getDeviceSessionState();\n // Narrow the type to ReadyWithoutSecureChannelState or ReadyWithSecureChannelState\n if (\n state.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...state,\n currentApp: _.event.output.data,\n });\n }\n return {\n ..._.context._internalState,\n currentApp: _.event.output.data.name,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\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 }\n\n return Right(undefined);\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const closeApp = async () => internalApi.sendCommand(new CloseAppCommand());\n const getAppAndVersion = async () =>\n internalApi.sendCommand(new GetAppAndVersionCommand());\n\n return {\n closeApp,\n getAppAndVersion,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2C,kBAE3CC,EAAuC,4CACvCC,EAGO,2CACPC,EAGO,mDAEPC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAA+B,wCAC/BC,EAA4C,6EAE5CC,EAGO,8DACPC,EAGO,kDACPC,EAAgC,8BA2BzB,MAAMb,UAAkC,oBAM7C,CACA,iBACEc,EAOA,CASA,KAAM,CACJ,sBAAAC,EACA,sBAAAC,EACA,SAAAC,EACA,iBAAAC,CACF,EAAI,KAAK,oBAAoBJ,CAAW,EAElCK,EAAgB,KAAK,MAAM,eAAiB,4BAE5CC,EAAyB,IAAI,8BAA4B,CAC7D,MAAO,CACL,cAAAD,CACF,CACF,CAAC,EAAE,iBAAiBL,CAAW,EAC/B,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CACL,cAAAK,CACF,EACA,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,oBAAkB,eAAYD,CAAgB,EAC9C,YAAU,eAAYD,CAAQ,EAC9B,gBAAiBG,CACnB,EACA,OAAQ,CACN,SAAU,CAAC,CAAE,QAAAC,CAAQ,IACZA,EAAQ,eAAe,QAAU,KAE1C,gBAAiB,CAAC,CAAE,QAAAA,CAAQ,IAC1BA,EAAQ,eAAe,aAAe,SACtC,mBAAgBA,EAAQ,eAAe,UAAU,CACrD,EACA,QAAS,CAOP,wBAAsB,UAAO,CAC3B,eAAiBC,IAAO,CACtB,GAAGA,EAAE,QAAQ,eACb,MAAOA,EAAE,MAAM,KACjB,EACF,CAAC,CAC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ceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_UserInteractionRequired", "import_Const", "import_Errors", "import_GetDeviceStatusDeviceAction", "import_XStateDeviceAction", "import_DeviceSessionState", "import_AppName", "internalApi", "getDeviceSessionState", "setDeviceSessionState", "closeApp", "getAppAndVersion", "unlockTimeout", "getDeviceStatusMachine", "context", "_", "sessionState", "output", "error", "state"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=require("../../../command/model/CommandResult"),V=require("../../../command/utils/GlobalCommandError"),S=require("../../../device/DeviceModel"),s=require("../../../device/DeviceStatus"),a=require("../../../device-action/__test-utils__/makeInternalApi"),c=require("../../../device-action/__test-utils__/setupTestMachine"),u=require("../../../device-action/__test-utils__/testDeviceActionStates"),e=require("../../../device-action/model/DeviceActionState"),t=require("../../../device-action/model/UserInteractionRequired"),v=require("../../../device-action/os/Errors"),d=require("../../../device-session/DeviceSessionState"),k=require("../../../../../src"),p=require("./GoToDashboardDeviceAction");jest.mock("@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction");describe("GoToDashboardDeviceAction",()=>{const m=jest.fn(),D=jest.fn(),l=jest.fn(),N=jest.fn();function A(){return{closeApp:m,getAppAndVersion:D,getDeviceSessionState:l,setDeviceSessionState:N}}const{sendCommand:T,getDeviceSessionState:h}=(0,a.makeDeviceActionInternalApiMock)();beforeEach(()=>{jest.resetAllMocks()}),describe("without overriding `extractDependencies`",()=>{it("should run the device action with device already on dashboard",o=>{(0,c.setupGetDeviceStatusMock)();const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});h.mockReturnValue({sessionStateType:d.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"},installedApps:[],deviceModelId:S.DeviceModelId.NANO_X});const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)}),it("should run the device action with device not on dashboard",o=>{(0,c.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});h.mockReturnValue({sessionStateType:d.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:{name:"Bitcoin",version:"1.0.0"},installedApps:[],deviceModelId:S.DeviceModelId.NANO_X}),T.mockResolvedValueOnce((0,i.CommandResultFactory)({data:void 0})).mockResolvedValueOnce((0,i.CommandResultFactory)({data:{name:"BOLOS",version:"1.5.0"}}));const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)})}),describe("success cases",()=>{it("should success if the device is already on dashboard",o=>{(0,c.setupGetDeviceStatusMock)();const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"}}),D.mockReturnValue({app:"BOLOS",version:"1.5.0"}),jest.spyOn(n,"extractDependencies").mockReturnValue(A());const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)}),it("should success if the device is not on dashboard",o=>{(0,c.setupGetDeviceStatusMock)();const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED}),m.mockResolvedValue((0,i.CommandResultFactory)({data:void 0})),D.mockReturnValue((0,i.CommandResultFactory)({data:{name:"BOLOS",version:"1.5.0"}}));const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)})}),describe("error cases",()=>{it("should return an error if GetDeviceStatus return an error",o=>{(0,c.setupGetDeviceStatusMock)([new v.UnknownDAError("Unknown error")]);const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});h.mockReturnValue({sessionStateType:d.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"},installedApps:[],deviceModelId:S.DeviceModelId.NANO_X});const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new v.UnknownDAError("Unknown error")}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)}),describe("not on dashboard",()=>{it("should return an error if closeApp fails",o=>{(0,c.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p.GoToDashboardDeviceAction({input:{}});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:"Bitcoin"}),m.mockReturnValue((0,i.CommandResultFactory)({error:new k.UnknownDeviceExchangeError("Close app failed")}));const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new k.UnknownDeviceExchangeError("Close app failed")}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)}),it("should return an error if getAppAndVersion fails",o=>{(0,c.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}}),r=new V.GlobalCommandError({...V.GLOBAL_ERRORS[5501],errorCode:"5501"});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:"Bitcoin"}),m.mockResolvedValue((0,i.CommandResultFactory)({data:void 0})),D.mockResolvedValue((0,i.CommandResultFactory)({error:r}));const g=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:r}];(0,u.testDeviceActionStates)(n,g,(0,a.makeDeviceActionInternalApiMock)(),o)}),it("should return an error if getAppAndVersion does not return an app name",o=>{(0,c.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:"Bitcoin"}),m.mockResolvedValue((0,i.CommandResultFactory)({data:void 0})),D.mockResolvedValue((0,i.CommandResultFactory)({data:{name:null,version:"1.0.0"}}));const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new v.UnknownDAError("currentApp === null")}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)})})})});
1
+ "use strict";var a=require("../../../command/model/CommandResult"),h=require("../../../command/utils/GlobalCommandError"),S=require("../../../device/DeviceModel"),c=require("../../../device/DeviceStatus"),s=require("../../../device-action/__test-utils__/makeInternalApi"),d=require("../../../device-action/__test-utils__/setupTestMachine"),u=require("../../../device-action/__test-utils__/testDeviceActionStates"),e=require("../../../device-action/model/DeviceActionState"),t=require("../../../device-action/model/UserInteractionRequired"),V=require("../../../device-action/os/Errors"),p=require("../../../device-session/DeviceSessionState"),N=require("../../../../../src"),l=require("./GoToDashboardDeviceAction");vi.mock("@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction");describe("GoToDashboardDeviceAction",()=>{const v=vi.fn(),D=vi.fn(),m=vi.fn(),T=vi.fn();function A(){return{closeApp:v,getAppAndVersion:D,getDeviceSessionState:m,setDeviceSessionState:T}}const{sendCommand:f,getDeviceSessionState:k}=(0,s.makeDeviceActionInternalApiMock)();beforeEach(()=>{vi.resetAllMocks()}),describe("without overriding `extractDependencies`",()=>{it("should run the device action with device already on dashboard",()=>new Promise((r,i)=>{(0,d.setupGetDeviceStatusMock)();const n=new l.GoToDashboardDeviceAction({input:{unlockTimeout:500}});k.mockReturnValue({sessionStateType:p.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:c.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"},installedApps:[],deviceModelId:S.DeviceModelId.NANO_X,isSecureConnectionAllowed:!1});const o=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,o,(0,s.makeDeviceActionInternalApiMock)(),{onDone:r,onError:i})})),it("should run the device action with device not on dashboard",()=>new Promise((r,i)=>{(0,d.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new l.GoToDashboardDeviceAction({input:{unlockTimeout:500}});k.mockReturnValue({sessionStateType:p.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:c.DeviceStatus.CONNECTED,currentApp:{name:"Bitcoin",version:"1.0.0"},installedApps:[],deviceModelId:S.DeviceModelId.NANO_X,isSecureConnectionAllowed:!1}),f.mockResolvedValueOnce((0,a.CommandResultFactory)({data:void 0})).mockResolvedValueOnce((0,a.CommandResultFactory)({data:{name:"BOLOS",version:"1.5.0"}}));const o=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,o,(0,s.makeDeviceActionInternalApiMock)(),{onDone:r,onError:i})}))}),describe("success cases",()=>{it("should success if the device is already on dashboard",()=>new Promise((r,i)=>{(0,d.setupGetDeviceStatusMock)();const n=new l.GoToDashboardDeviceAction({input:{unlockTimeout:500}});m.mockReturnValue({sessionStateType:p.DeviceSessionStateType.Connected,deviceStatus:c.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"}}),D.mockReturnValue({app:"BOLOS",version:"1.5.0"}),vi.spyOn(n,"extractDependencies").mockReturnValue(A());const o=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,o,(0,s.makeDeviceActionInternalApiMock)(),{onDone:r,onError:i})})),it("should success if the device is not on dashboard",()=>new Promise((r,i)=>{(0,d.setupGetDeviceStatusMock)();const n=new l.GoToDashboardDeviceAction({input:{unlockTimeout:500}});vi.spyOn(n,"extractDependencies").mockReturnValue(A()),m.mockReturnValue({sessionStateType:p.DeviceSessionStateType.Connected,deviceStatus:c.DeviceStatus.CONNECTED}),v.mockResolvedValue((0,a.CommandResultFactory)({data:void 0})),D.mockReturnValue((0,a.CommandResultFactory)({data:{name:"BOLOS",version:"1.5.0"}}));const o=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,o,(0,s.makeDeviceActionInternalApiMock)(),{onDone:r,onError:i})}))}),describe("error cases",()=>{it("should return an error if GetDeviceStatus return an error",()=>new Promise((r,i)=>{(0,d.setupGetDeviceStatusMock)([new V.UnknownDAError("Unknown error")]);const n=new l.GoToDashboardDeviceAction({input:{unlockTimeout:500}});k.mockReturnValue({sessionStateType:p.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:c.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"},installedApps:[],deviceModelId:S.DeviceModelId.NANO_X,isSecureConnectionAllowed:!1});const o=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new V.UnknownDAError("Unknown error")}];(0,u.testDeviceActionStates)(n,o,(0,s.makeDeviceActionInternalApiMock)(),{onDone:r,onError:i})})),describe("not on dashboard",()=>{it("should return an error if closeApp fails",()=>new Promise((r,i)=>{(0,d.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new l.GoToDashboardDeviceAction({input:{}});vi.spyOn(n,"extractDependencies").mockReturnValue(A()),m.mockReturnValue({sessionStateType:p.DeviceSessionStateType.Connected,deviceStatus:c.DeviceStatus.CONNECTED,currentApp:"Bitcoin"}),v.mockReturnValue((0,a.CommandResultFactory)({error:new N.UnknownDeviceExchangeError("Close app failed")}));const o=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new N.UnknownDeviceExchangeError("Close app failed")}];(0,u.testDeviceActionStates)(n,o,(0,s.makeDeviceActionInternalApiMock)(),{onDone:r,onError:i})})),it("should return an error if getAppAndVersion fails",()=>new Promise((r,i)=>{(0,d.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new l.GoToDashboardDeviceAction({input:{unlockTimeout:500}}),o=new h.GlobalCommandError({...h.GLOBAL_ERRORS[5501],errorCode:"5501"});vi.spyOn(n,"extractDependencies").mockReturnValue(A()),m.mockReturnValue({sessionStateType:p.DeviceSessionStateType.Connected,deviceStatus:c.DeviceStatus.CONNECTED,currentApp:"Bitcoin"}),v.mockResolvedValue((0,a.CommandResultFactory)({data:void 0})),D.mockResolvedValue((0,a.CommandResultFactory)({error:o}));const g=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:o}];(0,u.testDeviceActionStates)(n,g,(0,s.makeDeviceActionInternalApiMock)(),{onDone:r,onError:i})})),it("should return an error if getAppAndVersion does not return an app name",()=>new Promise((r,i)=>{(0,d.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new l.GoToDashboardDeviceAction({input:{unlockTimeout:500}});vi.spyOn(n,"extractDependencies").mockReturnValue(A()),m.mockReturnValue({sessionStateType:p.DeviceSessionStateType.Connected,deviceStatus:c.DeviceStatus.CONNECTED,currentApp:"Bitcoin"}),v.mockResolvedValue((0,a.CommandResultFactory)({data:void 0})),D.mockResolvedValue((0,a.CommandResultFactory)({data:{name:null,version:"1.0.0"}}));const o=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new V.UnknownDAError("currentApp === null")}];(0,u.testDeviceActionStates)(n,o,(0,s.makeDeviceActionInternalApiMock)(),{onDone:r,onError:i})}))})})});
2
2
  //# sourceMappingURL=GoToDashboardDeviceAction.test.js.map