@ledgerhq/device-management-kit 0.0.0-develop-20241017000946 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1236) hide show
  1. package/lib/cjs/index.js +1 -6126
  2. package/lib/cjs/index.js.map +4 -4
  3. package/lib/cjs/package.json +64 -0
  4. package/lib/cjs/src/api/DeviceManagementKit.js +2 -0
  5. package/lib/cjs/src/api/DeviceManagementKit.js.map +7 -0
  6. package/lib/cjs/src/api/DeviceManagementKit.test.js +2 -0
  7. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +7 -0
  8. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +2 -0
  9. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +7 -0
  10. package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js +2 -0
  11. package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js.map +7 -0
  12. package/lib/cjs/src/api/DmkConfig.js +2 -0
  13. package/lib/cjs/src/api/DmkConfig.js.map +7 -0
  14. package/lib/cjs/src/api/Error.js +2 -0
  15. package/lib/cjs/src/api/Error.js.map +7 -0
  16. package/lib/cjs/src/api/apdu/model/Apdu.js +2 -0
  17. package/lib/cjs/src/api/apdu/model/Apdu.js.map +7 -0
  18. package/lib/cjs/src/api/apdu/model/Apdu.test.js +2 -0
  19. package/lib/cjs/src/api/apdu/model/Apdu.test.js.map +7 -0
  20. package/lib/cjs/src/api/apdu/utils/ApduBuilder.js +2 -0
  21. package/lib/cjs/src/api/apdu/utils/ApduBuilder.js.map +7 -0
  22. package/lib/cjs/src/api/apdu/utils/ApduBuilder.test.js +2 -0
  23. package/lib/cjs/src/api/apdu/utils/ApduBuilder.test.js.map +7 -0
  24. package/lib/cjs/src/api/apdu/utils/ApduParser.js +2 -0
  25. package/lib/cjs/src/api/apdu/utils/ApduParser.js.map +7 -0
  26. package/lib/cjs/src/api/apdu/utils/ApduParser.test.js +2 -0
  27. package/lib/cjs/src/api/apdu/utils/ApduParser.test.js.map +7 -0
  28. package/lib/cjs/src/api/apdu/utils/AppBuilderError.js +2 -0
  29. package/lib/cjs/src/api/apdu/utils/AppBuilderError.js.map +7 -0
  30. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js +2 -0
  31. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +7 -0
  32. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +2 -0
  33. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +7 -0
  34. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js +2 -0
  35. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +7 -0
  36. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js +2 -0
  37. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js.map +7 -0
  38. package/lib/cjs/src/api/command/Command.js +2 -0
  39. package/lib/cjs/src/api/command/Command.js.map +7 -0
  40. package/lib/cjs/src/api/command/Errors.js +2 -0
  41. package/lib/cjs/src/api/command/Errors.js.map +7 -0
  42. package/lib/cjs/src/api/command/di/commandModule.js +2 -0
  43. package/lib/cjs/src/api/command/di/commandModule.js.map +7 -0
  44. package/lib/cjs/src/api/command/di/commandModule.test.js +2 -0
  45. package/lib/cjs/src/api/command/di/commandModule.test.js.map +7 -0
  46. package/lib/cjs/src/api/command/di/commandTypes.js +2 -0
  47. package/lib/cjs/src/api/command/di/commandTypes.js.map +7 -0
  48. package/lib/cjs/src/api/command/model/CommandResult.js +2 -0
  49. package/lib/cjs/src/api/command/model/CommandResult.js.map +7 -0
  50. package/lib/cjs/src/api/command/model/CommandResult.test.js +2 -0
  51. package/lib/cjs/src/api/command/model/CommandResult.test.js.map +7 -0
  52. package/lib/cjs/src/api/command/os/CloseAppCommand.js +2 -0
  53. package/lib/cjs/src/api/command/os/CloseAppCommand.js.map +7 -0
  54. package/lib/cjs/src/api/command/os/CloseAppCommand.test.js +2 -0
  55. package/lib/cjs/src/api/command/os/CloseAppCommand.test.js.map +7 -0
  56. package/lib/cjs/src/api/command/os/GetAppAndVersionCommand.js +2 -0
  57. package/lib/cjs/src/api/command/os/GetAppAndVersionCommand.js.map +7 -0
  58. package/lib/cjs/src/api/command/os/GetAppAndVersionCommand.test.js +2 -0
  59. package/lib/cjs/src/api/command/os/GetAppAndVersionCommand.test.js.map +7 -0
  60. package/lib/cjs/src/api/command/os/GetBatteryStatusCommand.js +2 -0
  61. package/lib/cjs/src/api/command/os/GetBatteryStatusCommand.js.map +7 -0
  62. package/lib/cjs/src/api/command/os/GetBatteryStatusCommand.test.js +2 -0
  63. package/lib/cjs/src/api/command/os/GetBatteryStatusCommand.test.js.map +7 -0
  64. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +2 -0
  65. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +7 -0
  66. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +2 -0
  67. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +7 -0
  68. package/lib/cjs/src/api/command/os/ListAppsCommand.js +2 -0
  69. package/lib/cjs/src/api/command/os/ListAppsCommand.js.map +7 -0
  70. package/lib/cjs/src/api/command/os/ListAppsCommand.test.js +2 -0
  71. package/lib/cjs/src/api/command/os/ListAppsCommand.test.js.map +7 -0
  72. package/lib/cjs/src/api/command/os/OpenAppCommand.js +2 -0
  73. package/lib/cjs/src/api/command/os/OpenAppCommand.js.map +7 -0
  74. package/lib/cjs/src/api/command/os/OpenAppCommand.test.js +2 -0
  75. package/lib/cjs/src/api/command/os/OpenAppCommand.test.js.map +7 -0
  76. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +2 -0
  77. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +7 -0
  78. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js +2 -0
  79. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js.map +7 -0
  80. package/lib/cjs/src/api/command/utils/CommandErrors.js +2 -0
  81. package/lib/cjs/src/api/command/utils/CommandErrors.js.map +7 -0
  82. package/lib/cjs/src/api/command/utils/CommandUtils.js +2 -0
  83. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +7 -0
  84. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +2 -0
  85. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +7 -0
  86. package/lib/cjs/src/api/command/utils/GlobalCommandError.js +2 -0
  87. package/lib/cjs/src/api/command/utils/GlobalCommandError.js.map +7 -0
  88. package/lib/cjs/src/api/command/utils/GlobalCommandError.test.js +2 -0
  89. package/lib/cjs/src/api/command/utils/GlobalCommandError.test.js.map +7 -0
  90. package/lib/cjs/src/api/device/DeviceModel.js +2 -0
  91. package/lib/cjs/src/api/device/DeviceModel.js.map +7 -0
  92. package/lib/cjs/src/api/device/DeviceStatus.js +2 -0
  93. package/lib/cjs/src/api/device/DeviceStatus.js.map +7 -0
  94. package/lib/cjs/src/api/device-action/DeviceAction.js +2 -0
  95. package/lib/cjs/src/api/device-action/DeviceAction.js.map +7 -0
  96. package/lib/cjs/src/api/device-action/__test-utils__/data.js +2 -0
  97. package/lib/cjs/src/api/device-action/__test-utils__/data.js.map +7 -0
  98. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +2 -0
  99. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +7 -0
  100. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +2 -0
  101. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +7 -0
  102. package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js +2 -0
  103. package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +7 -0
  104. package/lib/cjs/src/api/device-action/di/deviceActionModule.js +2 -0
  105. package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +7 -0
  106. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +2 -0
  107. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +7 -0
  108. package/lib/cjs/src/api/device-action/di/deviceActionTypes.js +2 -0
  109. package/lib/cjs/src/api/device-action/di/deviceActionTypes.js.map +7 -0
  110. package/lib/cjs/src/api/device-action/model/DeviceActionState.js +2 -0
  111. package/lib/cjs/src/api/device-action/model/DeviceActionState.js.map +7 -0
  112. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +2 -0
  113. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +7 -0
  114. package/lib/cjs/src/api/device-action/os/Const.js +2 -0
  115. package/lib/cjs/src/api/device-action/os/Const.js.map +7 -0
  116. package/lib/cjs/src/api/device-action/os/Errors.js +2 -0
  117. package/lib/cjs/src/api/device-action/os/Errors.js.map +7 -0
  118. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +2 -0
  119. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +7 -0
  120. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +2 -0
  121. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +7 -0
  122. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/types.js +2 -0
  123. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/types.js.map +7 -0
  124. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +2 -0
  125. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +7 -0
  126. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +2 -0
  127. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +7 -0
  128. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +2 -0
  129. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +7 -0
  130. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +2 -0
  131. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +7 -0
  132. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +2 -0
  133. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +7 -0
  134. package/lib/cjs/src/api/device-action/os/ListApps/types.js +2 -0
  135. package/lib/cjs/src/api/device-action/os/ListApps/types.js.map +7 -0
  136. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +2 -0
  137. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +7 -0
  138. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +2 -0
  139. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +7 -0
  140. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/types.js +2 -0
  141. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/types.js.map +7 -0
  142. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +2 -0
  143. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +7 -0
  144. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +2 -0
  145. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +7 -0
  146. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +2 -0
  147. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +7 -0
  148. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +2 -0
  149. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +7 -0
  150. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +2 -0
  151. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +7 -0
  152. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +2 -0
  153. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +7 -0
  154. package/lib/cjs/src/api/device-action/use-case/ExecuteDeviceActionUseCase.js +2 -0
  155. package/lib/cjs/src/api/device-action/use-case/ExecuteDeviceActionUseCase.js.map +7 -0
  156. package/lib/cjs/src/api/device-action/xstate-utils/StateMachineTypes.js +2 -0
  157. package/lib/cjs/src/api/device-action/xstate-utils/StateMachineTypes.js.map +7 -0
  158. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +2 -0
  159. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +7 -0
  160. package/lib/cjs/src/api/device-session/ApduResponse.js +2 -0
  161. package/lib/cjs/src/api/device-session/ApduResponse.js.map +7 -0
  162. package/lib/cjs/src/api/device-session/ApduResponse.stub.js +2 -0
  163. package/lib/cjs/src/api/device-session/ApduResponse.stub.js.map +7 -0
  164. package/lib/cjs/src/api/device-session/DeviceSessionState.js +2 -0
  165. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +7 -0
  166. package/lib/cjs/src/api/device-session/types.js +2 -0
  167. package/lib/cjs/src/api/device-session/types.js.map +7 -0
  168. package/lib/cjs/src/api/discovery/ConnectionType.js +2 -0
  169. package/lib/cjs/src/api/discovery/ConnectionType.js.map +7 -0
  170. package/lib/cjs/src/api/index.js +2 -0
  171. package/lib/cjs/src/api/index.js.map +7 -0
  172. package/lib/cjs/src/api/logger-subscriber/__mocks__/ConsoleLogger.js +2 -0
  173. package/lib/cjs/src/api/logger-subscriber/__mocks__/ConsoleLogger.js.map +7 -0
  174. package/lib/cjs/src/api/logger-subscriber/model/LogLevel.js +2 -0
  175. package/lib/cjs/src/api/logger-subscriber/model/LogLevel.js.map +7 -0
  176. package/lib/cjs/src/api/logger-subscriber/model/LogSubscriberOptions.js +2 -0
  177. package/lib/cjs/src/api/logger-subscriber/model/LogSubscriberOptions.js.map +7 -0
  178. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.js +2 -0
  179. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.js.map +7 -0
  180. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js +2 -0
  181. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +7 -0
  182. package/lib/cjs/src/api/logger-subscriber/service/LoggerSubscriberService.js +2 -0
  183. package/lib/cjs/src/api/logger-subscriber/service/LoggerSubscriberService.js.map +7 -0
  184. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.js +2 -0
  185. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.js.map +7 -0
  186. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +2 -0
  187. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +7 -0
  188. package/lib/cjs/src/api/transport/model/ConnectedDevice.js +2 -0
  189. package/lib/cjs/src/api/transport/model/ConnectedDevice.js.map +7 -0
  190. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js +2 -0
  191. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +7 -0
  192. package/lib/cjs/src/api/transport/model/Transport.js +2 -0
  193. package/lib/cjs/src/api/transport/model/Transport.js.map +7 -0
  194. package/lib/cjs/src/api/transport/model/TransportIdentifier.js +2 -0
  195. package/lib/cjs/src/api/transport/model/TransportIdentifier.js.map +7 -0
  196. package/lib/cjs/src/api/types.js +2 -0
  197. package/lib/cjs/src/api/types.js.map +7 -0
  198. package/lib/cjs/src/api/utils/Base64String.js +2 -0
  199. package/lib/cjs/src/api/utils/Base64String.js.map +7 -0
  200. package/lib/cjs/src/api/utils/Base64String.test.js +2 -0
  201. package/lib/cjs/src/api/utils/Base64String.test.js.map +7 -0
  202. package/lib/cjs/src/api/utils/HexaString.js +2 -0
  203. package/lib/cjs/src/api/utils/HexaString.js.map +7 -0
  204. package/lib/cjs/src/api/utils/HexaString.test.js +2 -0
  205. package/lib/cjs/src/api/utils/HexaString.test.js.map +7 -0
  206. package/lib/cjs/src/di.js +2 -0
  207. package/lib/cjs/src/di.js.map +7 -0
  208. package/lib/cjs/src/di.stub.js +2 -0
  209. package/lib/cjs/src/di.stub.js.map +7 -0
  210. package/lib/cjs/src/index.js +2 -0
  211. package/lib/cjs/src/index.js.map +7 -0
  212. package/lib/cjs/src/internal/config/data/ConfigDataSource.js +2 -0
  213. package/lib/cjs/src/internal/config/data/ConfigDataSource.js.map +7 -0
  214. package/lib/cjs/src/internal/config/data/Dto.js +2 -0
  215. package/lib/cjs/src/internal/config/data/Dto.js.map +7 -0
  216. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.js +2 -0
  217. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.js.map +7 -0
  218. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.stub.js +2 -0
  219. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.stub.js.map +7 -0
  220. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js +2 -0
  221. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js.map +7 -0
  222. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.js +2 -0
  223. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.js.map +7 -0
  224. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.stub.js +2 -0
  225. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.stub.js.map +7 -0
  226. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js +2 -0
  227. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js.map +7 -0
  228. package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js +2 -0
  229. package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +7 -0
  230. package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +2 -0
  231. package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +7 -0
  232. package/lib/cjs/src/internal/config/di/configModule.js +2 -0
  233. package/lib/cjs/src/internal/config/di/configModule.js.map +7 -0
  234. package/lib/cjs/src/internal/config/di/configModule.test.js +2 -0
  235. package/lib/cjs/src/internal/config/di/configModule.test.js.map +7 -0
  236. package/lib/cjs/src/internal/config/di/configTypes.js +2 -0
  237. package/lib/cjs/src/internal/config/di/configTypes.js.map +7 -0
  238. package/lib/cjs/src/internal/config/model/Config.js +2 -0
  239. package/lib/cjs/src/internal/config/model/Config.js.map +7 -0
  240. package/lib/cjs/src/internal/config/model/Errors.js +2 -0
  241. package/lib/cjs/src/internal/config/model/Errors.js.map +7 -0
  242. package/lib/cjs/src/internal/config/service/ConfigService.js +2 -0
  243. package/lib/cjs/src/internal/config/service/ConfigService.js.map +7 -0
  244. package/lib/cjs/src/internal/config/service/DefaultConfigService.js +2 -0
  245. package/lib/cjs/src/internal/config/service/DefaultConfigService.js.map +7 -0
  246. package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js +2 -0
  247. package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js.map +7 -0
  248. package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.js +2 -0
  249. package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.js.map +7 -0
  250. package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js +2 -0
  251. package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +7 -0
  252. package/lib/cjs/src/internal/device-model/data/DeviceModelDataSource.js +2 -0
  253. package/lib/cjs/src/internal/device-model/data/DeviceModelDataSource.js.map +7 -0
  254. package/lib/cjs/src/internal/device-model/data/StaticDeviceModelDataSource.js +2 -0
  255. package/lib/cjs/src/internal/device-model/data/StaticDeviceModelDataSource.js.map +7 -0
  256. package/lib/cjs/src/internal/device-model/data/StaticDeviceModelDataSource.test.js +2 -0
  257. package/lib/cjs/src/internal/device-model/data/StaticDeviceModelDataSource.test.js.map +7 -0
  258. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +2 -0
  259. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +7 -0
  260. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +2 -0
  261. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +7 -0
  262. package/lib/cjs/src/internal/device-model/di/deviceModelTypes.js +2 -0
  263. package/lib/cjs/src/internal/device-model/di/deviceModelTypes.js.map +7 -0
  264. package/lib/cjs/src/internal/device-model/model/DeviceModel.js +2 -0
  265. package/lib/cjs/src/internal/device-model/model/DeviceModel.js.map +7 -0
  266. package/lib/cjs/src/internal/device-model/model/DeviceModel.stub.js +2 -0
  267. package/lib/cjs/src/internal/device-model/model/DeviceModel.stub.js.map +7 -0
  268. package/lib/cjs/src/internal/device-model/model/DeviceModel.test.js +2 -0
  269. package/lib/cjs/src/internal/device-model/model/DeviceModel.test.js.map +7 -0
  270. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +2 -0
  271. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +7 -0
  272. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js +2 -0
  273. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +7 -0
  274. package/lib/cjs/src/internal/device-session/data/FramerConst.js +2 -0
  275. package/lib/cjs/src/internal/device-session/data/FramerConst.js.map +7 -0
  276. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +2 -0
  277. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +7 -0
  278. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +2 -0
  279. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +7 -0
  280. package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js +2 -0
  281. package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js.map +7 -0
  282. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +2 -0
  283. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +7 -0
  284. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js +2 -0
  285. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js.map +7 -0
  286. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js +2 -0
  287. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js.map +7 -0
  288. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +2 -0
  289. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +7 -0
  290. package/lib/cjs/src/internal/device-session/model/Errors.js +2 -0
  291. package/lib/cjs/src/internal/device-session/model/Errors.js.map +7 -0
  292. package/lib/cjs/src/internal/device-session/model/Frame.js +2 -0
  293. package/lib/cjs/src/internal/device-session/model/Frame.js.map +7 -0
  294. package/lib/cjs/src/internal/device-session/model/FrameHeader.js +2 -0
  295. package/lib/cjs/src/internal/device-session/model/FrameHeader.js.map +7 -0
  296. package/lib/cjs/src/internal/device-session/service/ApduReceiverService.js +2 -0
  297. package/lib/cjs/src/internal/device-session/service/ApduReceiverService.js.map +7 -0
  298. package/lib/cjs/src/internal/device-session/service/ApduSenderService.js +2 -0
  299. package/lib/cjs/src/internal/device-session/service/ApduSenderService.js.map +7 -0
  300. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js +2 -0
  301. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js.map +7 -0
  302. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.stub.js +2 -0
  303. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.stub.js.map +7 -0
  304. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.test.js +2 -0
  305. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.test.js.map +7 -0
  306. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +2 -0
  307. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +7 -0
  308. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.stub.js +2 -0
  309. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.stub.js.map +7 -0
  310. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +2 -0
  311. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +7 -0
  312. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.js +2 -0
  313. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.js.map +7 -0
  314. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js +2 -0
  315. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +7 -0
  316. package/lib/cjs/src/internal/device-session/service/DeviceSessionService.js +2 -0
  317. package/lib/cjs/src/internal/device-session/service/DeviceSessionService.js.map +7 -0
  318. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +2 -0
  319. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +7 -0
  320. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseState.test.js +2 -0
  321. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseState.test.js.map +7 -0
  322. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.js +2 -0
  323. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.js.map +7 -0
  324. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +2 -0
  325. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +7 -0
  326. package/lib/cjs/src/internal/device-session/utils/FramerUtils.js +2 -0
  327. package/lib/cjs/src/internal/device-session/utils/FramerUtils.js.map +7 -0
  328. package/lib/cjs/src/internal/device-session/utils/FramerUtils.test.js +2 -0
  329. package/lib/cjs/src/internal/device-session/utils/FramerUtils.test.js.map +7 -0
  330. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +2 -0
  331. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +7 -0
  332. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +2 -0
  333. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +7 -0
  334. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js +2 -0
  335. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js.map +7 -0
  336. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js +2 -0
  337. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js.map +7 -0
  338. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js +2 -0
  339. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js.map +7 -0
  340. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.js +2 -0
  341. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.js.map +7 -0
  342. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +2 -0
  343. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +7 -0
  344. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.js +2 -0
  345. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.js.map +7 -0
  346. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +2 -0
  347. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +7 -0
  348. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.js +2 -0
  349. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.js.map +7 -0
  350. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +2 -0
  351. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +7 -0
  352. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +2 -0
  353. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +7 -0
  354. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +2 -0
  355. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +7 -0
  356. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +2 -0
  357. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +7 -0
  358. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +2 -0
  359. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +7 -0
  360. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +2 -0
  361. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +7 -0
  362. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +2 -0
  363. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +7 -0
  364. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +2 -0
  365. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +7 -0
  366. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +2 -0
  367. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +7 -0
  368. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +2 -0
  369. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +7 -0
  370. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +2 -0
  371. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +7 -0
  372. package/lib/cjs/src/internal/logger-publisher/di/loggerTypes.js +2 -0
  373. package/lib/cjs/src/internal/logger-publisher/di/loggerTypes.js.map +7 -0
  374. package/lib/cjs/src/internal/logger-publisher/model/LogPublisherOptions.js +2 -0
  375. package/lib/cjs/src/internal/logger-publisher/model/LogPublisherOptions.js.map +7 -0
  376. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js +2 -0
  377. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js.map +7 -0
  378. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +2 -0
  379. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +7 -0
  380. package/lib/cjs/src/internal/logger-publisher/service/LoggerPublisherService.js +2 -0
  381. package/lib/cjs/src/internal/logger-publisher/service/LoggerPublisherService.js.map +7 -0
  382. package/lib/cjs/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.js +2 -0
  383. package/lib/cjs/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.js.map +7 -0
  384. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +2 -0
  385. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +7 -0
  386. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +2 -0
  387. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +7 -0
  388. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +2 -0
  389. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +7 -0
  390. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +2 -0
  391. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +7 -0
  392. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +2 -0
  393. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +7 -0
  394. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +2 -0
  395. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +7 -0
  396. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +2 -0
  397. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +7 -0
  398. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js +2 -0
  399. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js.map +7 -0
  400. package/lib/cjs/src/internal/manager-api/model/Const.js +2 -0
  401. package/lib/cjs/src/internal/manager-api/model/Const.js.map +7 -0
  402. package/lib/cjs/src/internal/manager-api/model/Errors.js +2 -0
  403. package/lib/cjs/src/internal/manager-api/model/Errors.js.map +7 -0
  404. package/lib/cjs/src/internal/manager-api/model/ManagerApiType.js +2 -0
  405. package/lib/cjs/src/internal/manager-api/model/ManagerApiType.js.map +7 -0
  406. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +2 -0
  407. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +7 -0
  408. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +2 -0
  409. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +7 -0
  410. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +2 -0
  411. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +7 -0
  412. package/lib/cjs/src/internal/send/di/sendModule.js +2 -0
  413. package/lib/cjs/src/internal/send/di/sendModule.js.map +7 -0
  414. package/lib/cjs/src/internal/send/di/sendModule.test.js +2 -0
  415. package/lib/cjs/src/internal/send/di/sendModule.test.js.map +7 -0
  416. package/lib/cjs/src/internal/send/di/sendTypes.js +2 -0
  417. package/lib/cjs/src/internal/send/di/sendTypes.js.map +7 -0
  418. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +2 -0
  419. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +7 -0
  420. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +2 -0
  421. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +7 -0
  422. package/lib/cjs/src/internal/transport/ble/di/bleDiTypes.js +2 -0
  423. package/lib/cjs/src/internal/transport/ble/di/bleDiTypes.js.map +7 -0
  424. package/lib/cjs/src/internal/transport/ble/di/bleModule.js +2 -0
  425. package/lib/cjs/src/internal/transport/ble/di/bleModule.js.map +7 -0
  426. package/lib/cjs/src/internal/transport/ble/di/bleModule.test.js +2 -0
  427. package/lib/cjs/src/internal/transport/ble/di/bleModule.test.js.map +7 -0
  428. package/lib/cjs/src/internal/transport/ble/model/BleDevice.stub.js +2 -0
  429. package/lib/cjs/src/internal/transport/ble/model/BleDevice.stub.js.map +7 -0
  430. package/lib/cjs/src/internal/transport/ble/model/BleDeviceInfos.js +2 -0
  431. package/lib/cjs/src/internal/transport/ble/model/BleDeviceInfos.js.map +7 -0
  432. package/lib/cjs/src/internal/transport/ble/service/BleDeviceConnectionFactory.js +2 -0
  433. package/lib/cjs/src/internal/transport/ble/service/BleDeviceConnectionFactory.js.map +7 -0
  434. package/lib/cjs/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.js +2 -0
  435. package/lib/cjs/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.js.map +7 -0
  436. package/lib/cjs/src/internal/transport/ble/transport/BleDeviceConnection.js +2 -0
  437. package/lib/cjs/src/internal/transport/ble/transport/BleDeviceConnection.js.map +7 -0
  438. package/lib/cjs/src/internal/transport/ble/transport/BleDeviceConnection.test.js +2 -0
  439. package/lib/cjs/src/internal/transport/ble/transport/BleDeviceConnection.test.js.map +7 -0
  440. package/lib/cjs/src/internal/transport/ble/transport/WebBleTransport.js +2 -0
  441. package/lib/cjs/src/internal/transport/ble/transport/WebBleTransport.js.map +7 -0
  442. package/lib/cjs/src/internal/transport/ble/transport/WebBleTransport.test.js +2 -0
  443. package/lib/cjs/src/internal/transport/ble/transport/WebBleTransport.test.js.map +7 -0
  444. package/lib/cjs/src/internal/transport/ble/transport/__mocks__/WebBleTransport.js +2 -0
  445. package/lib/cjs/src/internal/transport/ble/transport/__mocks__/WebBleTransport.js.map +7 -0
  446. package/lib/cjs/src/internal/transport/data/TransportDataSource.js +2 -0
  447. package/lib/cjs/src/internal/transport/data/TransportDataSource.js.map +7 -0
  448. package/lib/cjs/src/internal/transport/di/transportDiTypes.js +2 -0
  449. package/lib/cjs/src/internal/transport/di/transportDiTypes.js.map +7 -0
  450. package/lib/cjs/src/internal/transport/di/transportModule.js +2 -0
  451. package/lib/cjs/src/internal/transport/di/transportModule.js.map +7 -0
  452. package/lib/cjs/src/internal/transport/mockserver/MockserverTransport.js +2 -0
  453. package/lib/cjs/src/internal/transport/mockserver/MockserverTransport.js.map +7 -0
  454. package/lib/cjs/src/internal/transport/model/DeviceConnection.js +2 -0
  455. package/lib/cjs/src/internal/transport/model/DeviceConnection.js.map +7 -0
  456. package/lib/cjs/src/internal/transport/model/Errors.js +2 -0
  457. package/lib/cjs/src/internal/transport/model/Errors.js.map +7 -0
  458. package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.js +2 -0
  459. package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.js.map +7 -0
  460. package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.stub.js +2 -0
  461. package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.stub.js.map +7 -0
  462. package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.test.js +2 -0
  463. package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.test.js.map +7 -0
  464. package/lib/cjs/src/internal/transport/model/InternalDiscoveredDevice.js +2 -0
  465. package/lib/cjs/src/internal/transport/model/InternalDiscoveredDevice.js.map +7 -0
  466. package/lib/cjs/src/internal/transport/usb/data/UsbHidConfig.js +2 -0
  467. package/lib/cjs/src/internal/transport/usb/data/UsbHidConfig.js.map +7 -0
  468. package/lib/cjs/src/internal/transport/usb/di/usbDiTypes.js +2 -0
  469. package/lib/cjs/src/internal/transport/usb/di/usbDiTypes.js.map +7 -0
  470. package/lib/cjs/src/internal/transport/usb/di/usbModule.js +2 -0
  471. package/lib/cjs/src/internal/transport/usb/di/usbModule.js.map +7 -0
  472. package/lib/cjs/src/internal/transport/usb/di/usbModule.test.js +2 -0
  473. package/lib/cjs/src/internal/transport/usb/di/usbModule.test.js.map +7 -0
  474. package/lib/cjs/src/internal/transport/usb/model/HIDDevice.stub.js +2 -0
  475. package/lib/cjs/src/internal/transport/usb/model/HIDDevice.stub.js.map +7 -0
  476. package/lib/cjs/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.js +2 -0
  477. package/lib/cjs/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.js.map +7 -0
  478. package/lib/cjs/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.js +2 -0
  479. package/lib/cjs/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.js.map +7 -0
  480. package/lib/cjs/src/internal/transport/usb/transport/UsbHidDeviceConnection.js +2 -0
  481. package/lib/cjs/src/internal/transport/usb/transport/UsbHidDeviceConnection.js.map +7 -0
  482. package/lib/cjs/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.js +2 -0
  483. package/lib/cjs/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.js.map +7 -0
  484. package/lib/cjs/src/internal/transport/usb/transport/WebUsbHidTransport.js +2 -0
  485. package/lib/cjs/src/internal/transport/usb/transport/WebUsbHidTransport.js.map +7 -0
  486. package/lib/cjs/src/internal/transport/usb/transport/WebUsbHidTransport.test.js +2 -0
  487. package/lib/cjs/src/internal/transport/usb/transport/WebUsbHidTransport.test.js.map +7 -0
  488. package/lib/cjs/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.js +2 -0
  489. package/lib/cjs/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.js.map +7 -0
  490. package/lib/esm/index.js +1 -26507
  491. package/lib/esm/index.js.map +4 -4
  492. package/lib/esm/package.json +64 -0
  493. package/lib/esm/src/api/DeviceManagementKit.js +2 -0
  494. package/lib/esm/src/api/DeviceManagementKit.js.map +7 -0
  495. package/lib/esm/src/api/DeviceManagementKit.test.js +2 -0
  496. package/lib/esm/src/api/DeviceManagementKit.test.js.map +7 -0
  497. package/lib/esm/src/api/DeviceManagementKitBuilder.js +2 -0
  498. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +7 -0
  499. package/lib/esm/src/api/DeviceManagementKitBuilder.test.js +2 -0
  500. package/lib/esm/src/api/DeviceManagementKitBuilder.test.js.map +7 -0
  501. package/lib/esm/src/api/DmkConfig.js +1 -0
  502. package/lib/esm/src/api/DmkConfig.js.map +7 -0
  503. package/lib/esm/src/api/Error.js +2 -0
  504. package/lib/esm/src/api/Error.js.map +7 -0
  505. package/lib/esm/src/api/apdu/model/Apdu.js +2 -0
  506. package/lib/esm/src/api/apdu/model/Apdu.js.map +7 -0
  507. package/lib/esm/src/api/apdu/model/Apdu.test.js +2 -0
  508. package/lib/esm/src/api/apdu/model/Apdu.test.js.map +7 -0
  509. package/lib/esm/src/api/apdu/utils/ApduBuilder.js +2 -0
  510. package/lib/esm/src/api/apdu/utils/ApduBuilder.js.map +7 -0
  511. package/lib/esm/src/api/apdu/utils/ApduBuilder.test.js +2 -0
  512. package/lib/esm/src/api/apdu/utils/ApduBuilder.test.js.map +7 -0
  513. package/lib/esm/src/api/apdu/utils/ApduParser.js +2 -0
  514. package/lib/esm/src/api/apdu/utils/ApduParser.js.map +7 -0
  515. package/lib/esm/src/api/apdu/utils/ApduParser.test.js +2 -0
  516. package/lib/esm/src/api/apdu/utils/ApduParser.test.js.map +7 -0
  517. package/lib/esm/src/api/apdu/utils/AppBuilderError.js +2 -0
  518. package/lib/esm/src/api/apdu/utils/AppBuilderError.js.map +7 -0
  519. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js +2 -0
  520. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +7 -0
  521. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +2 -0
  522. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +7 -0
  523. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +2 -0
  524. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js.map +7 -0
  525. package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js +2 -0
  526. package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js.map +7 -0
  527. package/lib/esm/src/api/command/Command.js +1 -0
  528. package/lib/esm/src/api/command/Command.js.map +7 -0
  529. package/lib/esm/src/api/command/Errors.js +2 -0
  530. package/lib/esm/src/api/command/Errors.js.map +7 -0
  531. package/lib/esm/src/api/command/di/commandModule.js +2 -0
  532. package/lib/esm/src/api/command/di/commandModule.js.map +7 -0
  533. package/lib/esm/src/api/command/di/commandModule.test.js +2 -0
  534. package/lib/esm/src/api/command/di/commandModule.test.js.map +7 -0
  535. package/lib/esm/src/api/command/di/commandTypes.js +2 -0
  536. package/lib/esm/src/api/command/di/commandTypes.js.map +7 -0
  537. package/lib/esm/src/api/command/model/CommandResult.js +2 -0
  538. package/lib/esm/src/api/command/model/CommandResult.js.map +7 -0
  539. package/lib/esm/src/api/command/model/CommandResult.test.js +2 -0
  540. package/lib/esm/src/api/command/model/CommandResult.test.js.map +7 -0
  541. package/lib/esm/src/api/command/os/CloseAppCommand.js +2 -0
  542. package/lib/esm/src/api/command/os/CloseAppCommand.js.map +7 -0
  543. package/lib/esm/src/api/command/os/CloseAppCommand.test.js +2 -0
  544. package/lib/esm/src/api/command/os/CloseAppCommand.test.js.map +7 -0
  545. package/lib/esm/src/api/command/os/GetAppAndVersionCommand.js +2 -0
  546. package/lib/esm/src/api/command/os/GetAppAndVersionCommand.js.map +7 -0
  547. package/lib/esm/src/api/command/os/GetAppAndVersionCommand.test.js +2 -0
  548. package/lib/esm/src/api/command/os/GetAppAndVersionCommand.test.js.map +7 -0
  549. package/lib/esm/src/api/command/os/GetBatteryStatusCommand.js +2 -0
  550. package/lib/esm/src/api/command/os/GetBatteryStatusCommand.js.map +7 -0
  551. package/lib/esm/src/api/command/os/GetBatteryStatusCommand.test.js +2 -0
  552. package/lib/esm/src/api/command/os/GetBatteryStatusCommand.test.js.map +7 -0
  553. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +2 -0
  554. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +7 -0
  555. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +2 -0
  556. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +7 -0
  557. package/lib/esm/src/api/command/os/ListAppsCommand.js +2 -0
  558. package/lib/esm/src/api/command/os/ListAppsCommand.js.map +7 -0
  559. package/lib/esm/src/api/command/os/ListAppsCommand.test.js +2 -0
  560. package/lib/esm/src/api/command/os/ListAppsCommand.test.js.map +7 -0
  561. package/lib/esm/src/api/command/os/OpenAppCommand.js +2 -0
  562. package/lib/esm/src/api/command/os/OpenAppCommand.js.map +7 -0
  563. package/lib/esm/src/api/command/os/OpenAppCommand.test.js +2 -0
  564. package/lib/esm/src/api/command/os/OpenAppCommand.test.js.map +7 -0
  565. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +2 -0
  566. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +7 -0
  567. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js +2 -0
  568. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js.map +7 -0
  569. package/lib/esm/src/api/command/utils/CommandErrors.js +2 -0
  570. package/lib/esm/src/api/command/utils/CommandErrors.js.map +7 -0
  571. package/lib/esm/src/api/command/utils/CommandUtils.js +2 -0
  572. package/lib/esm/src/api/command/utils/CommandUtils.js.map +7 -0
  573. package/lib/esm/src/api/command/utils/CommandUtils.test.js +2 -0
  574. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +7 -0
  575. package/lib/esm/src/api/command/utils/GlobalCommandError.js +2 -0
  576. package/lib/esm/src/api/command/utils/GlobalCommandError.js.map +7 -0
  577. package/lib/esm/src/api/command/utils/GlobalCommandError.test.js +2 -0
  578. package/lib/esm/src/api/command/utils/GlobalCommandError.test.js.map +7 -0
  579. package/lib/esm/src/api/device/DeviceModel.js +2 -0
  580. package/lib/esm/src/api/device/DeviceModel.js.map +7 -0
  581. package/lib/esm/src/api/device/DeviceStatus.js +2 -0
  582. package/lib/esm/src/api/device/DeviceStatus.js.map +7 -0
  583. package/lib/esm/src/api/device-action/DeviceAction.js +1 -0
  584. package/lib/esm/src/api/device-action/DeviceAction.js.map +7 -0
  585. package/lib/esm/src/api/device-action/__test-utils__/data.js +2 -0
  586. package/lib/esm/src/api/device-action/__test-utils__/data.js.map +7 -0
  587. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +2 -0
  588. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +7 -0
  589. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +2 -0
  590. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +7 -0
  591. package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js +2 -0
  592. package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +7 -0
  593. package/lib/esm/src/api/device-action/di/deviceActionModule.js +2 -0
  594. package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +7 -0
  595. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +2 -0
  596. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +7 -0
  597. package/lib/esm/src/api/device-action/di/deviceActionTypes.js +2 -0
  598. package/lib/esm/src/api/device-action/di/deviceActionTypes.js.map +7 -0
  599. package/lib/esm/src/api/device-action/model/DeviceActionState.js +2 -0
  600. package/lib/esm/src/api/device-action/model/DeviceActionState.js.map +7 -0
  601. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +2 -0
  602. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +7 -0
  603. package/lib/esm/src/api/device-action/os/Const.js +2 -0
  604. package/lib/esm/src/api/device-action/os/Const.js.map +7 -0
  605. package/lib/esm/src/api/device-action/os/Errors.js +2 -0
  606. package/lib/esm/src/api/device-action/os/Errors.js.map +7 -0
  607. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +2 -0
  608. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +7 -0
  609. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +2 -0
  610. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +7 -0
  611. package/lib/esm/src/api/device-action/os/GetDeviceStatus/types.js +1 -0
  612. package/lib/esm/src/api/device-action/os/GetDeviceStatus/types.js.map +7 -0
  613. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +2 -0
  614. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +7 -0
  615. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +2 -0
  616. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +7 -0
  617. package/lib/esm/src/api/device-action/os/GoToDashboard/types.js +1 -0
  618. package/lib/esm/src/api/device-action/os/GoToDashboard/types.js.map +7 -0
  619. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +2 -0
  620. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +7 -0
  621. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +2 -0
  622. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +7 -0
  623. package/lib/esm/src/api/device-action/os/ListApps/types.js +1 -0
  624. package/lib/esm/src/api/device-action/os/ListApps/types.js.map +7 -0
  625. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +2 -0
  626. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +7 -0
  627. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +2 -0
  628. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +7 -0
  629. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/types.js +1 -0
  630. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/types.js.map +7 -0
  631. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +2 -0
  632. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +7 -0
  633. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +2 -0
  634. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +7 -0
  635. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -0
  636. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/types.js.map +7 -0
  637. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +2 -0
  638. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +7 -0
  639. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +2 -0
  640. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +7 -0
  641. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -0
  642. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +7 -0
  643. package/lib/esm/src/api/device-action/use-case/ExecuteDeviceActionUseCase.js +2 -0
  644. package/lib/esm/src/api/device-action/use-case/ExecuteDeviceActionUseCase.js.map +7 -0
  645. package/lib/esm/src/api/device-action/xstate-utils/StateMachineTypes.js +1 -0
  646. package/lib/esm/src/api/device-action/xstate-utils/StateMachineTypes.js.map +7 -0
  647. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +2 -0
  648. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +7 -0
  649. package/lib/esm/src/api/device-session/ApduResponse.js +2 -0
  650. package/lib/esm/src/api/device-session/ApduResponse.js.map +7 -0
  651. package/lib/esm/src/api/device-session/ApduResponse.stub.js +2 -0
  652. package/lib/esm/src/api/device-session/ApduResponse.stub.js.map +7 -0
  653. package/lib/esm/src/api/device-session/DeviceSessionState.js +2 -0
  654. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +7 -0
  655. package/lib/esm/src/api/device-session/types.js +1 -0
  656. package/lib/esm/src/api/device-session/types.js.map +7 -0
  657. package/lib/esm/src/api/discovery/ConnectionType.js +1 -0
  658. package/lib/esm/src/api/discovery/ConnectionType.js.map +7 -0
  659. package/lib/esm/src/api/index.js +2 -0
  660. package/lib/esm/src/api/index.js.map +7 -0
  661. package/lib/esm/src/api/logger-subscriber/__mocks__/ConsoleLogger.js +2 -0
  662. package/lib/esm/src/api/logger-subscriber/__mocks__/ConsoleLogger.js.map +7 -0
  663. package/lib/esm/src/api/logger-subscriber/model/LogLevel.js +2 -0
  664. package/lib/esm/src/api/logger-subscriber/model/LogLevel.js.map +7 -0
  665. package/lib/esm/src/api/logger-subscriber/model/LogSubscriberOptions.js +1 -0
  666. package/lib/esm/src/api/logger-subscriber/model/LogSubscriberOptions.js.map +7 -0
  667. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.js +2 -0
  668. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.js.map +7 -0
  669. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js +2 -0
  670. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +7 -0
  671. package/lib/esm/src/api/logger-subscriber/service/LoggerSubscriberService.js +1 -0
  672. package/lib/esm/src/api/logger-subscriber/service/LoggerSubscriberService.js.map +7 -0
  673. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.js +2 -0
  674. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.js.map +7 -0
  675. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +2 -0
  676. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +7 -0
  677. package/lib/esm/src/api/transport/model/ConnectedDevice.js +2 -0
  678. package/lib/esm/src/api/transport/model/ConnectedDevice.js.map +7 -0
  679. package/lib/esm/src/api/transport/model/DiscoveredDevice.js +1 -0
  680. package/lib/esm/src/api/transport/model/DiscoveredDevice.js.map +7 -0
  681. package/lib/esm/src/api/transport/model/Transport.js +1 -0
  682. package/lib/esm/src/api/transport/model/Transport.js.map +7 -0
  683. package/lib/esm/src/api/transport/model/TransportIdentifier.js +2 -0
  684. package/lib/esm/src/api/transport/model/TransportIdentifier.js.map +7 -0
  685. package/lib/esm/src/api/types.js +1 -0
  686. package/lib/esm/src/api/types.js.map +7 -0
  687. package/lib/esm/src/api/utils/Base64String.js +2 -0
  688. package/lib/esm/src/api/utils/Base64String.js.map +7 -0
  689. package/lib/esm/src/api/utils/Base64String.test.js +2 -0
  690. package/lib/esm/src/api/utils/Base64String.test.js.map +7 -0
  691. package/lib/esm/src/api/utils/HexaString.js +2 -0
  692. package/lib/esm/src/api/utils/HexaString.js.map +7 -0
  693. package/lib/esm/src/api/utils/HexaString.test.js +2 -0
  694. package/lib/esm/src/api/utils/HexaString.test.js.map +7 -0
  695. package/lib/esm/src/di.js +2 -0
  696. package/lib/esm/src/di.js.map +7 -0
  697. package/lib/esm/src/di.stub.js +2 -0
  698. package/lib/esm/src/di.stub.js.map +7 -0
  699. package/lib/esm/src/index.js +2 -0
  700. package/lib/esm/src/index.js.map +7 -0
  701. package/lib/esm/src/internal/config/data/ConfigDataSource.js +1 -0
  702. package/lib/esm/src/internal/config/data/ConfigDataSource.js.map +7 -0
  703. package/lib/esm/src/internal/config/data/Dto.js +1 -0
  704. package/lib/esm/src/internal/config/data/Dto.js.map +7 -0
  705. package/lib/esm/src/internal/config/data/LocalConfigDataSource.js +2 -0
  706. package/lib/esm/src/internal/config/data/LocalConfigDataSource.js.map +7 -0
  707. package/lib/esm/src/internal/config/data/LocalConfigDataSource.stub.js +2 -0
  708. package/lib/esm/src/internal/config/data/LocalConfigDataSource.stub.js.map +7 -0
  709. package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js +2 -0
  710. package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js.map +7 -0
  711. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.js +2 -0
  712. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.js.map +7 -0
  713. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.stub.js +2 -0
  714. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.stub.js.map +7 -0
  715. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js +2 -0
  716. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js.map +7 -0
  717. package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js +2 -0
  718. package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +7 -0
  719. package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +2 -0
  720. package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +7 -0
  721. package/lib/esm/src/internal/config/di/configModule.js +2 -0
  722. package/lib/esm/src/internal/config/di/configModule.js.map +7 -0
  723. package/lib/esm/src/internal/config/di/configModule.test.js +2 -0
  724. package/lib/esm/src/internal/config/di/configModule.test.js.map +7 -0
  725. package/lib/esm/src/internal/config/di/configTypes.js +2 -0
  726. package/lib/esm/src/internal/config/di/configTypes.js.map +7 -0
  727. package/lib/esm/src/internal/config/model/Config.js +2 -0
  728. package/lib/esm/src/internal/config/model/Config.js.map +7 -0
  729. package/lib/esm/src/internal/config/model/Errors.js +2 -0
  730. package/lib/esm/src/internal/config/model/Errors.js.map +7 -0
  731. package/lib/esm/src/internal/config/service/ConfigService.js +1 -0
  732. package/lib/esm/src/internal/config/service/ConfigService.js.map +7 -0
  733. package/lib/esm/src/internal/config/service/DefaultConfigService.js +2 -0
  734. package/lib/esm/src/internal/config/service/DefaultConfigService.js.map +7 -0
  735. package/lib/esm/src/internal/config/service/DefaultConfigService.test.js +2 -0
  736. package/lib/esm/src/internal/config/service/DefaultConfigService.test.js.map +7 -0
  737. package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.js +2 -0
  738. package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.js.map +7 -0
  739. package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js +2 -0
  740. package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +7 -0
  741. package/lib/esm/src/internal/device-model/data/DeviceModelDataSource.js +1 -0
  742. package/lib/esm/src/internal/device-model/data/DeviceModelDataSource.js.map +7 -0
  743. package/lib/esm/src/internal/device-model/data/StaticDeviceModelDataSource.js +2 -0
  744. package/lib/esm/src/internal/device-model/data/StaticDeviceModelDataSource.js.map +7 -0
  745. package/lib/esm/src/internal/device-model/data/StaticDeviceModelDataSource.test.js +2 -0
  746. package/lib/esm/src/internal/device-model/data/StaticDeviceModelDataSource.test.js.map +7 -0
  747. package/lib/esm/src/internal/device-model/di/deviceModelModule.js +2 -0
  748. package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +7 -0
  749. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +2 -0
  750. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +7 -0
  751. package/lib/esm/src/internal/device-model/di/deviceModelTypes.js +2 -0
  752. package/lib/esm/src/internal/device-model/di/deviceModelTypes.js.map +7 -0
  753. package/lib/esm/src/internal/device-model/model/DeviceModel.js +2 -0
  754. package/lib/esm/src/internal/device-model/model/DeviceModel.js.map +7 -0
  755. package/lib/esm/src/internal/device-model/model/DeviceModel.stub.js +2 -0
  756. package/lib/esm/src/internal/device-model/model/DeviceModel.stub.js.map +7 -0
  757. package/lib/esm/src/internal/device-model/model/DeviceModel.test.js +2 -0
  758. package/lib/esm/src/internal/device-model/model/DeviceModel.test.js.map +7 -0
  759. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +2 -0
  760. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +7 -0
  761. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js +2 -0
  762. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +7 -0
  763. package/lib/esm/src/internal/device-session/data/FramerConst.js +2 -0
  764. package/lib/esm/src/internal/device-session/data/FramerConst.js.map +7 -0
  765. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +2 -0
  766. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +7 -0
  767. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +2 -0
  768. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +7 -0
  769. package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js +2 -0
  770. package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js.map +7 -0
  771. package/lib/esm/src/internal/device-session/model/DeviceSession.js +2 -0
  772. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +7 -0
  773. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js +2 -0
  774. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js.map +7 -0
  775. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js +2 -0
  776. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js.map +7 -0
  777. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +2 -0
  778. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +7 -0
  779. package/lib/esm/src/internal/device-session/model/Errors.js +2 -0
  780. package/lib/esm/src/internal/device-session/model/Errors.js.map +7 -0
  781. package/lib/esm/src/internal/device-session/model/Frame.js +2 -0
  782. package/lib/esm/src/internal/device-session/model/Frame.js.map +7 -0
  783. package/lib/esm/src/internal/device-session/model/FrameHeader.js +2 -0
  784. package/lib/esm/src/internal/device-session/model/FrameHeader.js.map +7 -0
  785. package/lib/esm/src/internal/device-session/service/ApduReceiverService.js +1 -0
  786. package/lib/esm/src/internal/device-session/service/ApduReceiverService.js.map +7 -0
  787. package/lib/esm/src/internal/device-session/service/ApduSenderService.js +1 -0
  788. package/lib/esm/src/internal/device-session/service/ApduSenderService.js.map +7 -0
  789. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js +2 -0
  790. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js.map +7 -0
  791. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.stub.js +2 -0
  792. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.stub.js.map +7 -0
  793. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.test.js +2 -0
  794. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.test.js.map +7 -0
  795. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +2 -0
  796. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +7 -0
  797. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.stub.js +2 -0
  798. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.stub.js.map +7 -0
  799. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +2 -0
  800. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +7 -0
  801. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.js +2 -0
  802. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.js.map +7 -0
  803. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js +2 -0
  804. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +7 -0
  805. package/lib/esm/src/internal/device-session/service/DeviceSessionService.js +1 -0
  806. package/lib/esm/src/internal/device-session/service/DeviceSessionService.js.map +7 -0
  807. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +2 -0
  808. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +7 -0
  809. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseState.test.js +2 -0
  810. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseState.test.js.map +7 -0
  811. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.js +2 -0
  812. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.js.map +7 -0
  813. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +2 -0
  814. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +7 -0
  815. package/lib/esm/src/internal/device-session/utils/FramerUtils.js +2 -0
  816. package/lib/esm/src/internal/device-session/utils/FramerUtils.js.map +7 -0
  817. package/lib/esm/src/internal/device-session/utils/FramerUtils.test.js +2 -0
  818. package/lib/esm/src/internal/device-session/utils/FramerUtils.test.js.map +7 -0
  819. package/lib/esm/src/internal/discovery/di/discoveryModule.js +2 -0
  820. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +7 -0
  821. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +2 -0
  822. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +7 -0
  823. package/lib/esm/src/internal/discovery/di/discoveryTypes.js +2 -0
  824. package/lib/esm/src/internal/discovery/di/discoveryTypes.js.map +7 -0
  825. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js +2 -0
  826. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js.map +7 -0
  827. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js +2 -0
  828. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js.map +7 -0
  829. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.js +2 -0
  830. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.js.map +7 -0
  831. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +2 -0
  832. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +7 -0
  833. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.js +2 -0
  834. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.js.map +7 -0
  835. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +2 -0
  836. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +7 -0
  837. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.js +2 -0
  838. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.js.map +7 -0
  839. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +2 -0
  840. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +7 -0
  841. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +2 -0
  842. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +7 -0
  843. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +2 -0
  844. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +7 -0
  845. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +2 -0
  846. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +7 -0
  847. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +2 -0
  848. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +7 -0
  849. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +2 -0
  850. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +7 -0
  851. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +2 -0
  852. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +7 -0
  853. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +2 -0
  854. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +7 -0
  855. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +2 -0
  856. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +7 -0
  857. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +2 -0
  858. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +7 -0
  859. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +2 -0
  860. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +7 -0
  861. package/lib/esm/src/internal/logger-publisher/di/loggerTypes.js +2 -0
  862. package/lib/esm/src/internal/logger-publisher/di/loggerTypes.js.map +7 -0
  863. package/lib/esm/src/internal/logger-publisher/model/LogPublisherOptions.js +1 -0
  864. package/lib/esm/src/internal/logger-publisher/model/LogPublisherOptions.js.map +7 -0
  865. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js +2 -0
  866. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js.map +7 -0
  867. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +2 -0
  868. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +7 -0
  869. package/lib/esm/src/internal/logger-publisher/service/LoggerPublisherService.js +1 -0
  870. package/lib/esm/src/internal/logger-publisher/service/LoggerPublisherService.js.map +7 -0
  871. package/lib/esm/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.js +2 -0
  872. package/lib/esm/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.js.map +7 -0
  873. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +2 -0
  874. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +7 -0
  875. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +2 -0
  876. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +7 -0
  877. package/lib/esm/src/internal/manager-api/data/ManagerApiDataSource.js +1 -0
  878. package/lib/esm/src/internal/manager-api/data/ManagerApiDataSource.js.map +7 -0
  879. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +2 -0
  880. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +7 -0
  881. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +2 -0
  882. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +7 -0
  883. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +2 -0
  884. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +7 -0
  885. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +2 -0
  886. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +7 -0
  887. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js +2 -0
  888. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js.map +7 -0
  889. package/lib/esm/src/internal/manager-api/model/Const.js +2 -0
  890. package/lib/esm/src/internal/manager-api/model/Const.js.map +7 -0
  891. package/lib/esm/src/internal/manager-api/model/Errors.js +2 -0
  892. package/lib/esm/src/internal/manager-api/model/Errors.js.map +7 -0
  893. package/lib/esm/src/internal/manager-api/model/ManagerApiType.js +2 -0
  894. package/lib/esm/src/internal/manager-api/model/ManagerApiType.js.map +7 -0
  895. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +2 -0
  896. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +7 -0
  897. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +2 -0
  898. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +7 -0
  899. package/lib/esm/src/internal/manager-api/service/ManagerApiService.js +1 -0
  900. package/lib/esm/src/internal/manager-api/service/ManagerApiService.js.map +7 -0
  901. package/lib/esm/src/internal/send/di/sendModule.js +2 -0
  902. package/lib/esm/src/internal/send/di/sendModule.js.map +7 -0
  903. package/lib/esm/src/internal/send/di/sendModule.test.js +2 -0
  904. package/lib/esm/src/internal/send/di/sendModule.test.js.map +7 -0
  905. package/lib/esm/src/internal/send/di/sendTypes.js +2 -0
  906. package/lib/esm/src/internal/send/di/sendTypes.js.map +7 -0
  907. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +2 -0
  908. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +7 -0
  909. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +2 -0
  910. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +7 -0
  911. package/lib/esm/src/internal/transport/ble/di/bleDiTypes.js +2 -0
  912. package/lib/esm/src/internal/transport/ble/di/bleDiTypes.js.map +7 -0
  913. package/lib/esm/src/internal/transport/ble/di/bleModule.js +2 -0
  914. package/lib/esm/src/internal/transport/ble/di/bleModule.js.map +7 -0
  915. package/lib/esm/src/internal/transport/ble/di/bleModule.test.js +2 -0
  916. package/lib/esm/src/internal/transport/ble/di/bleModule.test.js.map +7 -0
  917. package/lib/esm/src/internal/transport/ble/model/BleDevice.stub.js +2 -0
  918. package/lib/esm/src/internal/transport/ble/model/BleDevice.stub.js.map +7 -0
  919. package/lib/esm/src/internal/transport/ble/model/BleDeviceInfos.js +2 -0
  920. package/lib/esm/src/internal/transport/ble/model/BleDeviceInfos.js.map +7 -0
  921. package/lib/esm/src/internal/transport/ble/service/BleDeviceConnectionFactory.js +2 -0
  922. package/lib/esm/src/internal/transport/ble/service/BleDeviceConnectionFactory.js.map +7 -0
  923. package/lib/esm/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.js +2 -0
  924. package/lib/esm/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.js.map +7 -0
  925. package/lib/esm/src/internal/transport/ble/transport/BleDeviceConnection.js +2 -0
  926. package/lib/esm/src/internal/transport/ble/transport/BleDeviceConnection.js.map +7 -0
  927. package/lib/esm/src/internal/transport/ble/transport/BleDeviceConnection.test.js +2 -0
  928. package/lib/esm/src/internal/transport/ble/transport/BleDeviceConnection.test.js.map +7 -0
  929. package/lib/esm/src/internal/transport/ble/transport/WebBleTransport.js +2 -0
  930. package/lib/esm/src/internal/transport/ble/transport/WebBleTransport.js.map +7 -0
  931. package/lib/esm/src/internal/transport/ble/transport/WebBleTransport.test.js +2 -0
  932. package/lib/esm/src/internal/transport/ble/transport/WebBleTransport.test.js.map +7 -0
  933. package/lib/esm/src/internal/transport/ble/transport/__mocks__/WebBleTransport.js +2 -0
  934. package/lib/esm/src/internal/transport/ble/transport/__mocks__/WebBleTransport.js.map +7 -0
  935. package/lib/esm/src/internal/transport/data/TransportDataSource.js +2 -0
  936. package/lib/esm/src/internal/transport/data/TransportDataSource.js.map +7 -0
  937. package/lib/esm/src/internal/transport/di/transportDiTypes.js +2 -0
  938. package/lib/esm/src/internal/transport/di/transportDiTypes.js.map +7 -0
  939. package/lib/esm/src/internal/transport/di/transportModule.js +2 -0
  940. package/lib/esm/src/internal/transport/di/transportModule.js.map +7 -0
  941. package/lib/esm/src/internal/transport/mockserver/MockserverTransport.js +2 -0
  942. package/lib/esm/src/internal/transport/mockserver/MockserverTransport.js.map +7 -0
  943. package/lib/esm/src/internal/transport/model/DeviceConnection.js +1 -0
  944. package/lib/esm/src/internal/transport/model/DeviceConnection.js.map +7 -0
  945. package/lib/esm/src/internal/transport/model/Errors.js +2 -0
  946. package/lib/esm/src/internal/transport/model/Errors.js.map +7 -0
  947. package/lib/esm/src/internal/transport/model/InternalConnectedDevice.js +2 -0
  948. package/lib/esm/src/internal/transport/model/InternalConnectedDevice.js.map +7 -0
  949. package/lib/esm/src/internal/transport/model/InternalConnectedDevice.stub.js +2 -0
  950. package/lib/esm/src/internal/transport/model/InternalConnectedDevice.stub.js.map +7 -0
  951. package/lib/esm/src/internal/transport/model/InternalConnectedDevice.test.js +2 -0
  952. package/lib/esm/src/internal/transport/model/InternalConnectedDevice.test.js.map +7 -0
  953. package/lib/esm/src/internal/transport/model/InternalDiscoveredDevice.js +1 -0
  954. package/lib/esm/src/internal/transport/model/InternalDiscoveredDevice.js.map +7 -0
  955. package/lib/esm/src/internal/transport/usb/data/UsbHidConfig.js +2 -0
  956. package/lib/esm/src/internal/transport/usb/data/UsbHidConfig.js.map +7 -0
  957. package/lib/esm/src/internal/transport/usb/di/usbDiTypes.js +2 -0
  958. package/lib/esm/src/internal/transport/usb/di/usbDiTypes.js.map +7 -0
  959. package/lib/esm/src/internal/transport/usb/di/usbModule.js +2 -0
  960. package/lib/esm/src/internal/transport/usb/di/usbModule.js.map +7 -0
  961. package/lib/esm/src/internal/transport/usb/di/usbModule.test.js +2 -0
  962. package/lib/esm/src/internal/transport/usb/di/usbModule.test.js.map +7 -0
  963. package/lib/esm/src/internal/transport/usb/model/HIDDevice.stub.js +2 -0
  964. package/lib/esm/src/internal/transport/usb/model/HIDDevice.stub.js.map +7 -0
  965. package/lib/esm/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.js +2 -0
  966. package/lib/esm/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.js.map +7 -0
  967. package/lib/esm/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.js +2 -0
  968. package/lib/esm/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.js.map +7 -0
  969. package/lib/esm/src/internal/transport/usb/transport/UsbHidDeviceConnection.js +2 -0
  970. package/lib/esm/src/internal/transport/usb/transport/UsbHidDeviceConnection.js.map +7 -0
  971. package/lib/esm/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.js +2 -0
  972. package/lib/esm/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.js.map +7 -0
  973. package/lib/esm/src/internal/transport/usb/transport/WebUsbHidTransport.js +2 -0
  974. package/lib/esm/src/internal/transport/usb/transport/WebUsbHidTransport.js.map +7 -0
  975. package/lib/esm/src/internal/transport/usb/transport/WebUsbHidTransport.test.js +2 -0
  976. package/lib/esm/src/internal/transport/usb/transport/WebUsbHidTransport.test.js.map +7 -0
  977. package/lib/esm/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.js +2 -0
  978. package/lib/esm/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.js.map +7 -0
  979. package/lib/types/src/api/{DeviceSdk.d.ts → DeviceManagementKit.d.ts} +38 -23
  980. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -0
  981. package/lib/types/src/api/DeviceManagementKit.test.d.ts +2 -0
  982. package/lib/types/src/api/DeviceManagementKit.test.d.ts.map +1 -0
  983. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts +35 -0
  984. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -0
  985. package/lib/types/src/api/DeviceManagementKitBuilder.test.d.ts +2 -0
  986. package/lib/types/src/api/DeviceManagementKitBuilder.test.d.ts.map +1 -0
  987. package/lib/types/src/api/DmkConfig.d.ts +5 -0
  988. package/lib/types/src/api/DmkConfig.d.ts.map +1 -0
  989. package/lib/types/src/api/Error.d.ts +2 -2
  990. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts +1 -1
  991. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  992. package/lib/types/src/api/apdu/utils/ApduParser.d.ts +2 -2
  993. package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
  994. package/lib/types/src/api/apdu/utils/AppBuilderError.d.ts +5 -5
  995. package/lib/types/src/api/apdu/utils/AppBuilderError.d.ts.map +1 -1
  996. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +1 -1
  997. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
  998. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +1 -1
  999. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts.map +1 -1
  1000. package/lib/types/src/api/command/Command.d.ts +4 -4
  1001. package/lib/types/src/api/command/Command.d.ts.map +1 -1
  1002. package/lib/types/src/api/command/Errors.d.ts +6 -6
  1003. package/lib/types/src/api/command/Errors.d.ts.map +1 -1
  1004. package/lib/types/src/api/command/model/CommandResult.d.ts +3 -3
  1005. package/lib/types/src/api/command/model/CommandResult.d.ts.map +1 -1
  1006. package/lib/types/src/api/command/os/CloseAppCommand.d.ts +4 -4
  1007. package/lib/types/src/api/command/os/CloseAppCommand.d.ts.map +1 -1
  1008. package/lib/types/src/api/command/os/GetAppAndVersionCommand.d.ts +4 -4
  1009. package/lib/types/src/api/command/os/GetAppAndVersionCommand.d.ts.map +1 -1
  1010. package/lib/types/src/api/command/os/GetBatteryStatusCommand.d.ts +4 -4
  1011. package/lib/types/src/api/command/os/GetBatteryStatusCommand.d.ts.map +1 -1
  1012. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +4 -4
  1013. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  1014. package/lib/types/src/api/command/os/ListAppsCommand.d.ts +5 -5
  1015. package/lib/types/src/api/command/os/ListAppsCommand.d.ts.map +1 -1
  1016. package/lib/types/src/api/command/os/OpenAppCommand.d.ts +5 -5
  1017. package/lib/types/src/api/command/os/OpenAppCommand.d.ts.map +1 -1
  1018. package/lib/types/src/api/command/utils/CommandErrors.d.ts +1 -1
  1019. package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
  1020. package/lib/types/src/api/command/utils/CommandUtils.d.ts +1 -1
  1021. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  1022. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts +4 -4
  1023. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts.map +1 -1
  1024. package/lib/types/src/api/device-action/DeviceAction.d.ts +8 -8
  1025. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  1026. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts +1 -1
  1027. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  1028. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +4 -4
  1029. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  1030. package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts +4 -4
  1031. package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts.map +1 -1
  1032. package/lib/types/src/api/device-action/os/Errors.d.ts +4 -4
  1033. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  1034. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts +5 -5
  1035. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  1036. package/lib/types/src/api/device-action/os/GetDeviceStatus/types.d.ts +6 -6
  1037. package/lib/types/src/api/device-action/os/GetDeviceStatus/types.d.ts.map +1 -1
  1038. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts +5 -5
  1039. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
  1040. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +5 -5
  1041. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  1042. package/lib/types/src/api/device-action/os/ListApps/ListAppsDeviceAction.d.ts +4 -4
  1043. package/lib/types/src/api/device-action/os/ListApps/ListAppsDeviceAction.d.ts.map +1 -1
  1044. package/lib/types/src/api/device-action/os/ListApps/types.d.ts +6 -6
  1045. package/lib/types/src/api/device-action/os/ListApps/types.d.ts.map +1 -1
  1046. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts +9 -9
  1047. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts.map +1 -1
  1048. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/types.d.ts +8 -8
  1049. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/types.d.ts.map +1 -1
  1050. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts +7 -9
  1051. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
  1052. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +7 -6
  1053. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
  1054. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts +6 -6
  1055. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  1056. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +3 -3
  1057. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  1058. package/lib/types/src/api/device-action/use-case/ExecuteDeviceActionUseCase.d.ts +3 -3
  1059. package/lib/types/src/api/device-action/xstate-utils/StateMachineTypes.d.ts +1 -1
  1060. package/lib/types/src/api/device-action/xstate-utils/StateMachineTypes.d.ts.map +1 -1
  1061. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts +6 -6
  1062. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts.map +1 -1
  1063. package/lib/types/src/api/device-session/ApduResponse.stub.d.ts +1 -1
  1064. package/lib/types/src/api/device-session/ApduResponse.stub.d.ts.map +1 -1
  1065. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +4 -4
  1066. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  1067. package/lib/types/src/api/index.d.ts +3 -3
  1068. package/lib/types/src/api/index.d.ts.map +1 -1
  1069. package/lib/types/src/api/logger-subscriber/service/ConsoleLogger.d.ts +2 -2
  1070. package/lib/types/src/api/logger-subscriber/service/ConsoleLogger.d.ts.map +1 -1
  1071. package/lib/types/src/api/logger-subscriber/service/LoggerSubscriberService.d.ts +9 -4
  1072. package/lib/types/src/api/logger-subscriber/service/LoggerSubscriberService.d.ts.map +1 -1
  1073. package/lib/types/src/api/logger-subscriber/service/WebLogsExporterLogger.d.ts +2 -2
  1074. package/lib/types/src/api/logger-subscriber/service/WebLogsExporterLogger.d.ts.map +1 -1
  1075. package/lib/types/src/api/transport/model/ConnectedDevice.d.ts +7 -4
  1076. package/lib/types/src/api/transport/model/ConnectedDevice.d.ts.map +1 -1
  1077. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +2 -2
  1078. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
  1079. package/lib/types/src/api/transport/model/Transport.d.ts +10 -9
  1080. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  1081. package/lib/types/src/api/transport/model/TransportIdentifier.d.ts +1 -0
  1082. package/lib/types/src/api/transport/model/TransportIdentifier.d.ts.map +1 -1
  1083. package/lib/types/src/api/types.d.ts +1 -1
  1084. package/lib/types/src/api/types.d.ts.map +1 -1
  1085. package/lib/types/src/di.d.ts +5 -5
  1086. package/lib/types/src/di.d.ts.map +1 -1
  1087. package/lib/types/src/internal/config/data/ConfigDataSource.d.ts +3 -3
  1088. package/lib/types/src/internal/config/data/ConfigDataSource.d.ts.map +1 -1
  1089. package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts +1 -1
  1090. package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts.map +1 -1
  1091. package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts +1 -1
  1092. package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts.map +1 -1
  1093. package/lib/types/src/internal/config/di/configTypes.d.ts +1 -1
  1094. package/lib/types/src/internal/config/service/ConfigService.d.ts +2 -2
  1095. package/lib/types/src/internal/config/service/ConfigService.d.ts.map +1 -1
  1096. package/lib/types/src/internal/config/service/DefaultConfigService.d.ts +1 -1
  1097. package/lib/types/src/internal/config/use-case/GetDmkVersionUseCase.d.ts +12 -0
  1098. package/lib/types/src/internal/config/use-case/{GetSdkVersionUseCase.d.ts.map → GetDmkVersionUseCase.d.ts.map} +1 -1
  1099. package/lib/types/src/internal/config/use-case/GetDmkVersionUseCase.test.d.ts +2 -0
  1100. package/lib/types/src/internal/config/use-case/GetDmkVersionUseCase.test.d.ts.map +1 -0
  1101. package/lib/types/src/internal/device-model/data/DeviceModelDataSource.d.ts +5 -2
  1102. package/lib/types/src/internal/device-model/data/DeviceModelDataSource.d.ts.map +1 -1
  1103. package/lib/types/src/internal/device-model/data/StaticDeviceModelDataSource.d.ts +3 -0
  1104. package/lib/types/src/internal/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  1105. package/lib/types/src/internal/device-model/model/DeviceModel.stub.d.ts +1 -1
  1106. package/lib/types/src/internal/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  1107. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts +2 -0
  1108. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts.map +1 -0
  1109. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  1110. package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts +0 -1
  1111. package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts.map +1 -1
  1112. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +11 -11
  1113. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  1114. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts +2 -2
  1115. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  1116. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts +28 -4
  1117. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts.map +1 -1
  1118. package/lib/types/src/internal/device-session/model/Errors.d.ts +6 -6
  1119. package/lib/types/src/internal/device-session/model/Errors.d.ts.map +1 -1
  1120. package/lib/types/src/internal/device-session/model/Frame.d.ts +1 -1
  1121. package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
  1122. package/lib/types/src/internal/device-session/model/FrameHeader.d.ts +1 -1
  1123. package/lib/types/src/internal/device-session/model/FrameHeader.d.ts.map +1 -1
  1124. package/lib/types/src/internal/device-session/service/ApduReceiverService.d.ts +4 -4
  1125. package/lib/types/src/internal/device-session/service/ApduReceiverService.d.ts.map +1 -1
  1126. package/lib/types/src/internal/device-session/service/ApduSenderService.d.ts +1 -1
  1127. package/lib/types/src/internal/device-session/service/ApduSenderService.d.ts.map +1 -1
  1128. package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.stub.d.ts +3 -3
  1129. package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
  1130. package/lib/types/src/internal/device-session/service/DefaultApduSenderService.stub.d.ts +3 -3
  1131. package/lib/types/src/internal/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
  1132. package/lib/types/src/internal/device-session/service/DefaultDeviceSessionService.d.ts +4 -1
  1133. package/lib/types/src/internal/device-session/service/DefaultDeviceSessionService.d.ts.map +1 -1
  1134. package/lib/types/src/internal/device-session/service/DeviceSessionService.d.ts +7 -5
  1135. package/lib/types/src/internal/device-session/service/DeviceSessionService.d.ts.map +1 -1
  1136. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseState.test.d.ts +2 -0
  1137. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseState.test.d.ts.map +1 -0
  1138. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  1139. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts +3 -0
  1140. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts.map +1 -1
  1141. package/lib/types/src/internal/discovery/use-case/DisconnectUseCase.d.ts +1 -1
  1142. package/lib/types/src/internal/discovery/use-case/GetConnectedDeviceUseCase.d.ts.map +1 -1
  1143. package/lib/types/src/internal/{device-session/use-case/ListDeviceSessionsUseCase.d.ts → discovery/use-case/ListConnectedDevicesUseCase.d.ts} +5 -5
  1144. package/lib/types/src/internal/discovery/use-case/ListConnectedDevicesUseCase.d.ts.map +1 -0
  1145. package/lib/types/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.d.ts +2 -0
  1146. package/lib/types/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.d.ts.map +1 -0
  1147. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts +14 -0
  1148. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts.map +1 -0
  1149. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.d.ts +2 -0
  1150. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.d.ts.map +1 -0
  1151. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts +13 -0
  1152. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts.map +1 -0
  1153. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts +2 -0
  1154. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts.map +1 -0
  1155. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts +1 -1
  1156. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
  1157. package/lib/types/src/internal/logger-publisher/service/LoggerPublisherService.d.ts +2 -2
  1158. package/lib/types/src/internal/logger-publisher/service/LoggerPublisherService.d.ts.map +1 -1
  1159. package/lib/types/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.d.ts +1 -1
  1160. package/lib/types/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.d.ts.map +1 -1
  1161. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +2 -2
  1162. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +3 -3
  1163. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  1164. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +1 -1
  1165. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  1166. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts +2 -2
  1167. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  1168. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts +1 -1
  1169. package/lib/types/src/internal/manager-api/model/Errors.d.ts +2 -2
  1170. package/lib/types/src/internal/manager-api/model/Errors.d.ts.map +1 -1
  1171. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +4 -4
  1172. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  1173. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +1 -1
  1174. package/lib/types/src/internal/transport/ble/di/bleDiTypes.d.ts +4 -0
  1175. package/lib/types/src/internal/transport/ble/di/bleDiTypes.d.ts.map +1 -0
  1176. package/lib/types/src/internal/transport/ble/di/bleModule.d.ts +3 -0
  1177. package/lib/types/src/internal/transport/ble/di/bleModule.d.ts.map +1 -0
  1178. package/lib/types/src/internal/transport/ble/di/bleModule.test.d.ts +2 -0
  1179. package/lib/types/src/internal/transport/ble/di/bleModule.test.d.ts.map +1 -0
  1180. package/lib/types/src/internal/transport/ble/model/BleDevice.stub.d.ts +3 -0
  1181. package/lib/types/src/internal/transport/ble/model/BleDevice.stub.d.ts.map +1 -0
  1182. package/lib/types/src/internal/transport/ble/model/BleDeviceInfos.d.ts +10 -0
  1183. package/lib/types/src/internal/transport/ble/model/BleDeviceInfos.d.ts.map +1 -0
  1184. package/lib/types/src/internal/transport/ble/service/BleDeviceConnectionFactory.d.ts +13 -0
  1185. package/lib/types/src/internal/transport/ble/service/BleDeviceConnectionFactory.d.ts.map +1 -0
  1186. package/lib/types/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.d.ts +3 -0
  1187. package/lib/types/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.d.ts.map +1 -0
  1188. package/lib/types/src/internal/transport/ble/transport/BleDeviceConnection.d.ts +104 -0
  1189. package/lib/types/src/internal/transport/ble/transport/BleDeviceConnection.d.ts.map +1 -0
  1190. package/lib/types/src/internal/transport/ble/transport/BleDeviceConnection.test.d.ts +2 -0
  1191. package/lib/types/src/internal/transport/ble/transport/BleDeviceConnection.test.d.ts.map +1 -0
  1192. package/lib/types/src/internal/transport/ble/transport/WebBleTransport.d.ts +97 -0
  1193. package/lib/types/src/internal/transport/ble/transport/WebBleTransport.d.ts.map +1 -0
  1194. package/lib/types/src/internal/transport/ble/transport/WebBleTransport.test.d.ts +2 -0
  1195. package/lib/types/src/internal/transport/ble/transport/WebBleTransport.test.d.ts.map +1 -0
  1196. package/lib/types/src/internal/transport/ble/transport/__mocks__/WebBleTransport.d.ts +14 -0
  1197. package/lib/types/src/internal/transport/ble/transport/__mocks__/WebBleTransport.d.ts.map +1 -0
  1198. package/lib/types/src/internal/transport/data/TransportDataSource.d.ts +2 -2
  1199. package/lib/types/src/internal/transport/data/TransportDataSource.d.ts.map +1 -1
  1200. package/lib/types/src/internal/transport/di/transportDiTypes.d.ts +1 -1
  1201. package/lib/types/src/internal/transport/di/transportModule.d.ts +4 -4
  1202. package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
  1203. package/lib/types/src/internal/transport/mockserver/MockserverTransport.d.ts +6 -5
  1204. package/lib/types/src/internal/transport/mockserver/MockserverTransport.d.ts.map +1 -1
  1205. package/lib/types/src/internal/transport/model/DeviceConnection.d.ts +5 -5
  1206. package/lib/types/src/internal/transport/model/DeviceConnection.d.ts.map +1 -1
  1207. package/lib/types/src/internal/transport/model/Errors.d.ts +34 -14
  1208. package/lib/types/src/internal/transport/model/Errors.d.ts.map +1 -1
  1209. package/lib/types/src/internal/transport/model/InternalConnectedDevice.d.ts +5 -5
  1210. package/lib/types/src/internal/transport/model/InternalConnectedDevice.d.ts.map +1 -1
  1211. package/lib/types/src/internal/transport/model/InternalConnectedDevice.stub.d.ts +1 -1
  1212. package/lib/types/src/internal/transport/model/InternalConnectedDevice.stub.d.ts.map +1 -1
  1213. package/lib/types/src/internal/transport/model/InternalDiscoveredDevice.d.ts +3 -3
  1214. package/lib/types/src/internal/transport/model/InternalDiscoveredDevice.d.ts.map +1 -1
  1215. package/lib/types/src/internal/transport/usb/transport/UsbHidDeviceConnection.d.ts +2 -2
  1216. package/lib/types/src/internal/transport/usb/transport/WebUsbHidTransport.d.ts +27 -33
  1217. package/lib/types/src/internal/transport/usb/transport/WebUsbHidTransport.d.ts.map +1 -1
  1218. package/lib/types/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.d.ts +2 -1
  1219. package/lib/types/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.d.ts.map +1 -1
  1220. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  1221. package/package.json +17 -13
  1222. package/lib/types/src/api/DeviceSdk.d.ts.map +0 -1
  1223. package/lib/types/src/api/DeviceSdk.test.d.ts +0 -2
  1224. package/lib/types/src/api/DeviceSdk.test.d.ts.map +0 -1
  1225. package/lib/types/src/api/DeviceSdkBuilder.d.ts +0 -35
  1226. package/lib/types/src/api/DeviceSdkBuilder.d.ts.map +0 -1
  1227. package/lib/types/src/api/DeviceSdkBuilder.test.d.ts +0 -2
  1228. package/lib/types/src/api/DeviceSdkBuilder.test.d.ts.map +0 -1
  1229. package/lib/types/src/api/SdkConfig.d.ts +0 -5
  1230. package/lib/types/src/api/SdkConfig.d.ts.map +0 -1
  1231. package/lib/types/src/internal/config/use-case/GetSdkVersionUseCase.d.ts +0 -12
  1232. package/lib/types/src/internal/config/use-case/GetSdkVersionUseCase.test.d.ts +0 -2
  1233. package/lib/types/src/internal/config/use-case/GetSdkVersionUseCase.test.d.ts.map +0 -1
  1234. package/lib/types/src/internal/device-session/use-case/ListDeviceSessionsUseCase.d.ts.map +0 -1
  1235. package/lib/types/src/internal/device-session/use-case/ListDeviceSessionsUseCase.test.d.ts +0 -2
  1236. package/lib/types/src/internal/device-session/use-case/ListDeviceSessionsUseCase.test.d.ts.map +0 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 { 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 });\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 });\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 });\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 });\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 });\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 });\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,OAAS,YAAAA,EAAU,cAAAC,MAAkB,OAErC,OAAS,wBAAAC,MAA4B,mCACrC,OACE,iBAAAC,EACA,sBAAAC,MACK,wCACP,OAAS,gBAAAC,MAAoB,2BAC7B,OAAS,mCAAAC,MAAuC,oDAChD,OAAS,0BAAAC,MAA8B,2DACvC,OAAS,sBAAAC,MAA0B,6CACnC,OAAS,2BAAAC,MAA+B,mDACxC,OACE,qBAAAC,EACA,2BAAAC,EACA,kBAAAC,MACK,+BACP,OAAS,0BAAAC,MAA8B,yCAEvC,OAAS,+BAAAC,MAAmC,gCAG5C,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,EAAIjB,EAAgC,EACpC,WAAW,IAAM,CACf,KAAK,cAAc,EACnBa,EAAsB,gBAAgB,EAAI,CAC5C,CAAC,EAED,SAAS,2CAA4C,IAAM,CACzD,GAAG,uDAAyDK,GAAS,CACnE,MAAMC,EAA6B,IAAIX,EAA4B,CACjE,MAAO,CAAE,cAAe,GAAI,CAC9B,CAAC,EAEDQ,EAA6B,gBAAgB,CAC3C,iBAAkBT,EAAuB,UACzC,aAAcR,EAAa,SAC7B,CAAC,EAEDgB,EAAgB,kBACdnB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ACvD,gBAAgBL,EAAwB,CAAC,EAE5C,MAAMM,EAAgD,CACpD,CACE,kBAAmB,CACjB,wBAAyBjB,EAAwB,YACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,kBAAmB,CACjB,wBAAyBC,EAAwB,IACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,MAAO,IAAII,EAAe,OAAO,EACjC,OAAQJ,EAAmB,KAC7B,CACF,EAEAD,EACEkB,EACAC,EACApB,EAAgC,EAChCkB,CACF,CACF,CAAC,CACH,CAAC,EAED,GAAG,yDAA2DA,GAAS,CACrEF,EAA6B,gBAAgB,CAC3C,iBAAkBT,EAAuB,0BACzC,aAAcR,EAAa,UAC3B,WAAY,CAAE,KAAM,mBAAoB,QAAS,OAAQ,EACzD,cAAe,CAAC,CAClB,CAAC,EAEDgB,EAAgB,kBACdnB,EAAqB,CACnB,KAAM,CACJ,KAAM,QACN,QAAS,OACX,CACF,CAAC,CACH,EAEA,MAAMuB,EAA6B,IAAIX,EAA4B,CACjE,MAAO,CAAE,cAAe,GAAI,CAC9B,CAAC,EAEKY,EAAgD,CACpD,CACE,OAAQlB,EAAmB,QAC3B,kBAAmB,CACjB,wBAAyBC,EAAwB,IACnD,CACF,EACA,CACE,OAAQD,EAAmB,OAC7B,CACF,EAEM,CAAE,OAAAuB,CAAO,EAAIxB,EACjBkB,EACAC,EACApB,EAAgC,EAChCkB,CACF,EACAO,EAAO,CACT,CAAC,CACH,CAAC",
6
+ "names": ["interval", "Observable", "CommandResultFactory", "GLOBAL_ERRORS", "GlobalCommandError", "DeviceStatus", "makeDeviceActionInternalApiMock", "testDeviceActionStates", "DeviceActionStatus", "UserInteractionRequired", "DeviceLockedError", "DeviceNotOnboardedError", "UnknownDAError", "DeviceSessionStateType", "GetDeviceStatusDeviceAction", "getAppAndVersionMock", "getDeviceSessionStateMock", "waitForDeviceUnlockMock", "setDeviceSessionState", "isDeviceOnboardedMock", "extractDependenciesMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "done", "getDeviceStateDeviceAction", "expectedStates", "inner", "i", "error", "o", "cancel"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Left as D,Right as l}from"purify-ts";import{assign as n,fromPromise as p,setup as S}from"xstate";import{isSuccessCommandResult as c}from"../../../command/model/CommandResult";import{CloseAppCommand as A}from"../../../command/os/CloseAppCommand";import{GetAppAndVersionCommand as m}from"../../../command/os/GetAppAndVersionCommand";import{UserInteractionRequired as h}from"../../../device-action/model/UserInteractionRequired";import{DEFAULT_UNLOCK_TIMEOUT_MS as v}from"../../../device-action/os/Const";import{UnknownDAError as y}from"../../../device-action/os/Errors";import{GetDeviceStatusDeviceAction as g}from"../../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{XStateDeviceAction as T}from"../../../device-action/xstate-utils/XStateDeviceAction";import{DeviceSessionStateType as G}from"../../../device-session/DeviceSessionState";class w extends T{makeStateMachine(r){const{getDeviceSessionState:o,setDeviceSessionState:s,closeApp:a,getAppAndVersion:u}=this.extractDependencies(r),i=this.input.unlockTimeout??v,d=new g({input:{unlockTimeout:i}}).makeStateMachine(r);return S({types:{input:{unlockTimeout:i},context:{},output:{}},actors:{getAppAndVersion:p(u),closeApp:p(a),getDeviceStatus:d},guards:{hasError:({context:e})=>e._internalState.error!==null,isDashboardOpen:({context:e})=>e._internalState.currentApp==="BOLOS"},actions:{assignErrorFromEvent:n({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"GoToDashboardDeviceAction",initial:"DeviceReady",context:e=>{const t=o();return{input:{unlockTimeout:e.input.unlockTimeout},intermediateValue:{requiredUserInteraction:h.None},_internalState:{currentApp:"currentApp"in t?t.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:n({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{target:"CheckDeviceStatus",actions:n({_internalState:e=>e.event.output.caseOf({Right:t=>({...e.context._internalState,currentApp:t.currentApp}),Left:t=>({...e.context._internalState,error:t})})})}}},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:n({_internalState:e=>({...e.context._internalState,error:new y("currentApp === null")})})},{target:"CloseApp"}]},CloseApp:{invoke:{src:"closeApp",onDone:{target:"CloseAppCheck",actions:n({_internalState:e=>c(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:n({_internalState:e=>{if(c(e.event.output)){const t=o();return t.sessionStateType!==G.Connected&&s({...t,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?D(e.context._internalState.error):l(void 0)})}extractDependencies(r){return{closeApp:async()=>r.sendCommand(new A),getAppAndVersion:async()=>r.sendCommand(new m),getDeviceSessionState:()=>r.getDeviceSessionState(),setDeviceSessionState:a=>r.setDeviceSessionState(a)}}}export{w as GoToDashboardDeviceAction};
2
+ //# sourceMappingURL=GoToDashboardDeviceAction.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 N4IgpgJg5mDOIC5QHED2AVVARAhrAFgEao4BOEWYAbgJYDGYAgnQC42oB2AdJbQwEpgcEAJ4BiANoAGALqJQAB1SwabTvJAAPRAHYAjFwDMATikA2MwA5DOnQBYArGeOGANCBGI9VrlcvmpRyknQwcAXzD3NExcA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5oLrPTL2M-FC5UqSrOPejDbrbMraniZ+4nGV6J6OmqwbJsl3jPY2wQ2YaKy6W8sVpZYbs+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": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAC5B,OAAS,UAAAC,EAAQ,eAAAC,EAAa,SAAAC,MAAa,SAE3C,OAAS,0BAAAC,MAA8B,mCACvC,OACE,mBAAAC,MAEK,kCACP,OACE,2BAAAC,MAEK,0CAEP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,6BAAAC,MAAiC,8BAC1C,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,+BAAAC,MAAmC,oEAE5C,OAEE,sBAAAC,MACK,qDACP,OAEE,0BAAAC,MACK,yCA2BA,MAAMC,UAAkCF,CAM7C,CACA,iBACEG,EAOA,CASA,KAAM,CACJ,sBAAAC,EACA,sBAAAC,EACA,SAAAC,EACA,iBAAAC,CACF,EAAI,KAAK,oBAAoBJ,CAAW,EAElCK,EAAgB,KAAK,MAAM,eAAiBX,EAE5CY,EAAyB,IAAIV,EAA4B,CAC7D,MAAO,CACL,cAAAS,CACF,CACF,CAAC,EAAE,iBAAiBL,CAAW,EAC/B,OAAOX,EAAM,CACX,MAAO,CACL,MAAO,CACL,cAAAgB,CACF,EACA,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,iBAAkBjB,EAAYgB,CAAgB,EAC9C,SAAUhB,EAAYe,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,OAC1C,EACA,QAAS,CAO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AAMQ,EAAY,sBAAsB,EAC/D,sBAAwBY,GACtBZ,EAAY,sBAAsBY,CAAK,CAC3C,CACF,CACF",
6
+ "names": ["Left", "Right", "assign", "fromPromise", "setup", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "UserInteractionRequired", "DEFAULT_UNLOCK_TIMEOUT_MS", "UnknownDAError", "GetDeviceStatusDeviceAction", "XStateDeviceAction", "DeviceSessionStateType", "GoToDashboardDeviceAction", "internalApi", "getDeviceSessionState", "setDeviceSessionState", "closeApp", "getAppAndVersion", "unlockTimeout", "getDeviceStatusMachine", "context", "_", "sessionState", "output", "error", "state"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{CommandResultFactory as i}from"../../../command/model/CommandResult";import{GLOBAL_ERRORS as g,GlobalCommandError as N}from"../../../command/utils/GlobalCommandError";import{DeviceStatus as s}from"../../../device/DeviceStatus";import{makeDeviceActionInternalApiMock as a}from"../../../device-action/__test-utils__/makeInternalApi";import{setupGetDeviceStatusMock as c}from"../../../device-action/__test-utils__/setupTestMachine";import{testDeviceActionStates as u}from"../../../device-action/__test-utils__/testDeviceActionStates";import{DeviceActionStatus as e}from"../../../device-action/model/DeviceActionState";import{UserInteractionRequired as t}from"../../../device-action/model/UserInteractionRequired";import{UnknownDAError as v}from"../../../device-action/os/Errors";import{DeviceSessionStateType as d}from"../../../device-session/DeviceSessionState";import{UnknownDeviceExchangeError as V}from"../../../../../src";import{GoToDashboardDeviceAction as p}from"./GoToDashboardDeviceAction";jest.mock("@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction");describe("GoToDashboardDeviceAction",()=>{const m=jest.fn(),D=jest.fn(),l=jest.fn(),h=jest.fn();function A(){return{closeApp:m,getAppAndVersion:D,getDeviceSessionState:l,setDeviceSessionState:h}}const{sendCommand:k,getDeviceSessionState:S}=a();beforeEach(()=>{jest.resetAllMocks()}),describe("without overriding `extractDependencies`",()=>{it("should run the device action with device already on dashboard",o=>{c();const n=new p({input:{unlockTimeout:500}});S.mockReturnValue({sessionStateType:d.ReadyWithoutSecureChannel,deviceStatus:s.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"},installedApps:[]});const r=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{output:void 0,status:e.Completed}];u(n,r,a(),o)}),it("should run the device action with device not on dashboard",o=>{c([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p({input:{unlockTimeout:500}});S.mockReturnValue({sessionStateType:d.ReadyWithoutSecureChannel,deviceStatus:s.CONNECTED,currentApp:{name:"Bitcoin",version:"1.0.0"},installedApps:[]}),k.mockResolvedValueOnce(i({data:void 0})).mockResolvedValueOnce(i({data:{name:"BOLOS",version:"1.5.0"}}));const r=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{output:void 0,status:e.Completed}];u(n,r,a(),o)})}),describe("success cases",()=>{it("should success if the device is already on dashboard",o=>{c();const n=new p({input:{unlockTimeout:500}});l.mockReturnValue({sessionStateType:d.Connected,deviceStatus:s.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.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{output:void 0,status:e.Completed}];u(n,r,a(),o)}),it("should success if the device is not on dashboard",o=>{c();const n=new p({input:{unlockTimeout:500}});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.Connected,deviceStatus:s.CONNECTED}),m.mockResolvedValue(i({data:void 0})),D.mockReturnValue(i({data:{name:"BOLOS",version:"1.5.0"}}));const r=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{output:void 0,status:e.Completed}];u(n,r,a(),o)})}),describe("error cases",()=>{it("should return an error if GetDeviceStatus return an error",o=>{c([new v("Unknown error")]);const n=new p({input:{unlockTimeout:500}});S.mockReturnValue({sessionStateType:d.ReadyWithoutSecureChannel,deviceStatus:s.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"},installedApps:[]});const r=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Error,error:new v("Unknown error")}];u(n,r,a(),o)}),describe("not on dashboard",()=>{it("should return an error if closeApp fails",o=>{c([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p({input:{}});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.Connected,deviceStatus:s.CONNECTED,currentApp:"Bitcoin"}),m.mockReturnValue(i({error:new V("Close app failed")}));const r=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Error,error:new V("Close app failed")}];u(n,r,a(),o)}),it("should return an error if getAppAndVersion fails",o=>{c([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p({input:{unlockTimeout:500}}),r=new N({...g[5501],errorCode:"5501"});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.Connected,deviceStatus:s.CONNECTED,currentApp:"Bitcoin"}),m.mockResolvedValue(i({data:void 0})),D.mockResolvedValue(i({error:r}));const T=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Error,error:r}];u(n,T,a(),o)}),it("should return an error if getAppAndVersion does not return an app name",o=>{c([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p({input:{unlockTimeout:500}});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.Connected,deviceStatus:s.CONNECTED,currentApp:"Bitcoin"}),m.mockResolvedValue(i({data:void 0})),D.mockResolvedValue(i({data:{name:null,version:"1.0.0"}}));const r=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Error,error:new v("currentApp === null")}];u(n,r,a(),o)})})})});
2
+ //# sourceMappingURL=GoToDashboardDeviceAction.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.ts"],
4
+ "sourcesContent": ["import { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n} from \"@api/command/utils/GlobalCommandError\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { setupGetDeviceStatusMock } from \"@api/device-action/__test-utils__/setupTestMachine\";\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 { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport { UnknownDeviceExchangeError } from \"@root/src\";\n\nimport { GoToDashboardDeviceAction } from \"./GoToDashboardDeviceAction\";\nimport { type GoToDashboardDAState } from \"./types\";\n\njest.mock(\"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\");\n\ndescribe(\"GoToDashboardDeviceAction\", () => {\n const closeAppMock = jest.fn();\n const getAppAndVersionMock = jest.fn();\n const getDeviceSessionStateMock = jest.fn();\n const setDeviceSessionStateMock = jest.fn();\n\n function extractDependenciesMock() {\n return {\n closeApp: closeAppMock,\n getAppAndVersion: getAppAndVersionMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n setDeviceSessionState: setDeviceSessionStateMock,\n };\n }\n\n const {\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n } = makeDeviceActionInternalApiMock();\n\n beforeEach(() => {\n jest.resetAllMocks();\n });\n\n describe(\"without overriding `extractDependencies`\", () => {\n it(\"should run the device action with device already on dashboard\", (done) => {\n setupGetDeviceStatusMock();\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"BOLOS\", version: \"1.5.0\" },\n installedApps: [],\n });\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GetDeviceStatus events (mocked for tests)\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with device not on dashboard\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"Bitcoin\", version: \"1.0.0\" },\n installedApps: [],\n });\n\n sendCommandMock\n .mockResolvedValueOnce(CommandResultFactory({ data: undefined }))\n .mockResolvedValueOnce(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.5.0\",\n },\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"success cases\", () => {\n it(\"should success if the device is already on dashboard\", (done) => {\n setupGetDeviceStatusMock();\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"BOLOS\", version: \"1.5.0\" },\n });\n\n getAppAndVersionMock.mockReturnValue({\n app: \"BOLOS\",\n version: \"1.5.0\",\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should success if the device is not on dashboard\", (done) => {\n setupGetDeviceStatusMock();\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n });\n\n closeAppMock.mockResolvedValue(CommandResultFactory({ data: undefined }));\n getAppAndVersionMock.mockReturnValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.5.0\",\n },\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"error cases\", () => {\n it(\"should return an error if GetDeviceStatus return an error\", (done) => {\n setupGetDeviceStatusMock([new UnknownDAError(\"Unknown error\")]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"BOLOS\", version: \"1.5.0\" },\n installedApps: [],\n });\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"Unknown error\"),\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n describe(\"not on dashboard\", () => {\n it(\"should return an error if closeApp fails\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: {},\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"Bitcoin\",\n });\n\n closeAppMock.mockReturnValue(\n CommandResultFactory({\n error: new UnknownDeviceExchangeError(\"Close app failed\"),\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDeviceExchangeError(\"Close app failed\"),\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return an error if getAppAndVersion fails\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n const error = new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5501\"],\n errorCode: \"5501\",\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"Bitcoin\",\n });\n\n closeAppMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n error,\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return an error if getAppAndVersion does not return an app name\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"Bitcoin\",\n });\n\n closeAppMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: null,\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"currentApp === null\"),\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,wBAAAA,MAA4B,mCACrC,OACE,iBAAAC,EACA,sBAAAC,MACK,wCACP,OAAS,gBAAAC,MAAoB,2BAC7B,OAAS,mCAAAC,MAAuC,oDAChD,OAAS,4BAAAC,MAAgC,qDACzC,OAAS,0BAAAC,MAA8B,2DACvC,OAAS,sBAAAC,MAA0B,6CACnC,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,0BAAAC,MAA8B,yCACvC,OAAS,8BAAAC,MAAkC,YAE3C,OAAS,6BAAAC,MAAiC,8BAG1C,KAAK,KAAK,mEAAmE,EAE7E,SAAS,4BAA6B,IAAM,CAC1C,MAAMC,EAAe,KAAK,GAAG,EACvBC,EAAuB,KAAK,GAAG,EAC/BC,EAA4B,KAAK,GAAG,EACpCC,EAA4B,KAAK,GAAG,EAE1C,SAASC,GAA0B,CACjC,MAAO,CACL,SAAUJ,EACV,iBAAkBC,EAClB,sBAAuBC,EACv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AC,EACAlB,EAAgC,EAChCgB,CACF,CACF,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["CommandResultFactory", "GLOBAL_ERRORS", "GlobalCommandError", "DeviceStatus", "makeDeviceActionInternalApiMock", "setupGetDeviceStatusMock", "testDeviceActionStates", "DeviceActionStatus", "UserInteractionRequired", "UnknownDAError", "DeviceSessionStateType", "UnknownDeviceExchangeError", "GoToDashboardDeviceAction", "closeAppMock", "getAppAndVersionMock", "getDeviceSessionStateMock", "setDeviceSessionStateMock", "extractDependenciesMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "done", "goToDashboardDeviceAction", "expectedStates", "error"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Left as u,Right as c}from"purify-ts";import{assign as e,fromPromise as l,setup as A}from"xstate";import{isSuccessCommandResult as i}from"../../../command/model/CommandResult";import{ListAppsCommand as m}from"../../../command/os/ListAppsCommand";import{UserInteractionRequired as a}from"../../../device-action/model/UserInteractionRequired";import{DEFAULT_UNLOCK_TIMEOUT_MS as d}from"../../../device-action/os/Const";import{GoToDashboardDeviceAction as h}from"../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{XStateDeviceAction as D}from"../../../device-action/xstate-utils/XStateDeviceAction";class I extends D{makeStateMachine(n){const{listApps:s}=this.extractDependencies(n),r=this.input.unlockTimeout??d,o=new h({input:{unlockTimeout:r}}).makeStateMachine(n);return A({types:{input:{unlockTimeout:r},context:{},output:{}},actors:{listApps:l(s),goToDashboard:o},guards:{hasError:({context:t})=>t._internalState.error!==null,hasMoreApps:t=>t.context._internalState.shouldContinue},actions:{assignAllowListApps:e({intermediateValue:t=>({requiredUserInteraction:a.AllowListApps})}),assignErrorFromEvent:e({_internalState:t=>({...t.context._internalState,error:t.event.error})})}}).createMachine({id:"ListAppsDeviceAction",initial:"DeviceReady",context:t=>({input:{unlockTimeout:t.input.unlockTimeout},intermediateValue:{requiredUserInteraction:a.None},_internalState:{error:null,apps:[],shouldContinue:!1}}),states:{DeviceReady:{always:{target:"GoToDashboard"}},GoToDashboard:{invoke:{id:"dashboard",src:"goToDashboard",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:e({intermediateValue:t=>t.event.snapshot.context.intermediateValue})},onDone:{target:"GoToDashboardCheck",actions:e({_internalState:t=>t.event.output.caseOf({Right:()=>t.context._internalState,Left:p=>({...t.context._internalState,error:p})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"ListApps"}]},ListApps:{entry:"assignAllowListApps",invoke:{src:"listApps",input:t=>!1,onDone:{target:"Continue",actions:e({_internalState:t=>i(t.event.output)?{...t.context._internalState,apps:t.context._internalState.apps.concat(t.event.output.data),shouldContinue:t.event.output.data.length===2}:{...t.context._internalState,error:t.event.output.error},intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:a.None})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},ListAppsCheck:{always:[{target:"Error",guard:"hasError"},"ListAppsContinue"]},ListAppsContinue:{invoke:{src:"listApps",input:t=>!0,onDone:{target:"Continue",actions:e({_internalState:t=>i(t.event.output)?{...t.context._internalState,apps:t.context._internalState.apps.concat(t.event.output.data),shouldContinue:t.event.output.data.length===2}:{...t.context._internalState,error:t.event.output.error}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},Continue:{always:[{target:"ListAppsContinue",guard:"hasMoreApps"},{target:"Success"}]},Success:{type:"final"},Error:{type:"final"}},output:t=>t.context._internalState.error?u(t.context._internalState.error):c(t.context._internalState.apps)})}extractDependencies(n){return{listApps:async({input:r})=>{const o=new m({isContinue:r});return n.sendCommand(o)}}}}export{I as ListAppsDeviceAction};
2
+ //# sourceMappingURL=ListAppsDeviceAction.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/api/device-action/os/ListApps/ListAppsDeviceAction.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 type AppResponse,\n ListAppsCommand,\n type ListAppsCommandResult,\n} from \"@api/command/os/ListAppsCommand\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\n\nimport {\n type ListAppsDAError,\n type ListAppsDAInput,\n type ListAppsDAIntermediateValue,\n type ListAppsDAOutput,\n} from \"./types\";\n\ntype ListAppsMachineInternalState = {\n readonly error: ListAppsDAError | null;\n readonly apps: AppResponse[];\n readonly shouldContinue: boolean;\n};\n\nexport type MachineDependencies = {\n readonly listApps: ({\n input,\n }: {\n input: boolean;\n }) => Promise<ListAppsCommandResult>;\n};\n\nexport type ExtractMachineDependencies = (\n internalApi: InternalApi,\n) => MachineDependencies;\n\nexport class ListAppsDeviceAction extends XStateDeviceAction<\n ListAppsDAOutput,\n ListAppsDAInput,\n ListAppsDAError,\n ListAppsDAIntermediateValue,\n ListAppsMachineInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n ListAppsDAOutput,\n ListAppsDAInput,\n ListAppsDAError,\n ListAppsDAIntermediateValue,\n ListAppsMachineInternalState\n > {\n type types = StateMachineTypes<\n ListAppsDAOutput,\n ListAppsDAInput,\n ListAppsDAError,\n ListAppsDAIntermediateValue,\n ListAppsMachineInternalState\n >;\n\n const { listApps } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const goToDashboardMachine = new GoToDashboardDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalApi);\n\n return setup({\n types: {\n input: {\n unlockTimeout,\n } as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n listApps: fromPromise<ListAppsCommandResult, boolean>(listApps),\n goToDashboard: goToDashboardMachine,\n },\n guards: {\n hasError: ({ context }: { context: types[\"context\"] }) => {\n return context._internalState.error !== null;\n },\n hasMoreApps: (_) => _.context._internalState.shouldContinue,\n },\n actions: {\n assignAllowListApps: assign({\n intermediateValue: (_) =>\n ({\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n }) satisfies types[\"context\"][\"intermediateValue\"],\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 N4IgpgJg5mDOIC5QBkCWsAuBBADj2AImAG6oDGYWZGqA9gHYB0RpFASmAIYQCeAxAG0ADAF1EoHLVioaDcSAAeiAIwBOIYwAcANgDsyzat2HlAJgDMegDQgeKg412ntAVm3mdp1af0uAvn42aJi4+CzklNR0TADitAAqtAScsAAWAEa0nABOEHwQDGCMqPTEtADWRRApGVm5wmJIIJLSsvTySgguquaMACy6rvrKfSOqfTZ2CKZC2v3K2ou6xn2mms7+gSDB2HiEJBFUbYxxiclpmTl5YNnZtNmMOAA2nBgAZvcAtozVF3UQDXkLRk0Q6iG6vQGQ2UIzGE1siE0ykYLiEaLRuiECxcbmUASC6F2YQOFCO0ROCSSNUuuQAwqkwGRyoJRECpCC5E1OsosZpHAZBi5zKpuhjJohTBZHBt3N5UapVGp8dtCaF9qxIsdTlS-ld6YzmQJlI0JOy2mCEDyHPpNILhaKhLpxQg+kI+ZjzGZdD0seYPMqdmrwqSogxGIG9vlCsVShUihHiRqyWGE7AECUymRXtEGoCmsDzVyVAM+cpzGtzKjvdp1ppnZWNNosW4+sLNEJUdo+gHVXtg5ryam+Dc7g9nq8Ptlvqn+8mmKn07Gs21c6z82bQUXLSXGGWK1XVDW1s6XMZ+kKzLaZk3XD2Qn2SQOU738HwFJhXkVOG8MDcABTKKiaIAJR8DOj5zuGL6wHmpqtJuoDcjue6aA21a1s6ejIuo2imDiCy6H0PS6HeRLqocobztBtIMDQ9AAK5gFG9BFBmcZQfeiYUccqY0fQdGMYumbZgwq4ms0G6cohKiaC4pZCOMQjlu4bguPWqyMJKrhdpKmLLNopFBhBlEcWRfECUxI73I8LzvF8plGUmJm8bRJSCWxy45qIsESfBUmKBKMzIjMnpyTitp+uY9ZyburYWDCfQ1ro5aGQ+TnHOZblMT5BYIQFlqoaojDaCK5iuq2XY1s6iW6I4h54bJlheKlXEhhlrkMdlxpsn57RbgYbiMLMeFrLpMxCiewqOOV4xEai6x4sq9C0BAcDyOB6V5bl-mdAAtNozq7S4jAKqdFgKdW+4teRbXkv2HDcFMcEcn10kuqYzowrVTjaR4TXrNds4mdq5y1FcPUvRaazHaVl5Cq66hqQiCDjJpMplQYmijClWwbdx5Ig9S-z6kyEOFm97bIqsh4KsKZYlQdyOSnywrluYsxDJTmwEpxN1PlRvNk3l3IGMiOIDB2ZWtq6H3I5WtV9BePhYm6gymIDxk8dRHWMULO0SlicyyYBPRlt4jXRXM2hqN6lg8j0GubWGmWdXrr35QsOhDbJh5+l44XwlM5hOCixhej4Ip9Ei3a49BQPHAAyvRZAULA8Drr1UM4nMMxeM4NaoR4TrI0KOczX0cWKo7+NhgAorc9xu1DoxFYBuE6O2OgKfWZ46EYimzAsXYBAEQA */\n id: \"ListAppsDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n error: null,\n apps: [],\n shouldContinue: false,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"GoToDashboard\",\n },\n },\n GoToDashboard: {\n invoke: {\n id: \"dashboard\",\n src: \"goToDashboard\",\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: \"GoToDashboardCheck\",\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<ListAppsMachineInternalState>({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GoToDashboardCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"ListApps\",\n },\n ],\n },\n ListApps: {\n // NOTE: This is a timeout that is currently not used\n // We need to discuss this as a team, how do we want to\n // handle the case when the user does not validate or reject on the device\n // after: {\n // 15000: \"Error\",\n // actions: assign({\n // _internalState: (_) => ({\n // error: new UnknownDAError(\"ListAppsTimeout\"),\n // }),\n // }),\n // },\n entry: \"assignAllowListApps\",\n invoke: {\n src: \"listApps\",\n input: (_) => false,\n onDone: {\n target: \"Continue\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n return {\n ..._.context._internalState,\n apps: _.context._internalState.apps.concat(\n _.event.output.data,\n ),\n shouldContinue: _.event.output.data.length === 2,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n ListAppsCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n \"ListAppsContinue\",\n ],\n },\n ListAppsContinue: {\n invoke: {\n src: \"listApps\",\n input: (_) => true,\n onDone: {\n target: \"Continue\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n return {\n ..._.context._internalState,\n apps: _.context._internalState.apps.concat(\n _.event.output.data,\n ),\n shouldContinue: _.event.output.data.length === 2,\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 Continue: {\n always: [\n {\n target: \"ListAppsContinue\",\n guard: \"hasMoreApps\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (_) => {\n if (_.context._internalState.error) {\n return Left(_.context._internalState.error);\n }\n\n return Right(_.context._internalState.apps);\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const listApps = async ({ input }: { input: boolean }) => {\n const command = new ListAppsCommand({ isContinue: input });\n return internalApi.sendCommand(command);\n };\n\n return {\n listApps,\n };\n }\n}\n"],
5
+ "mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAC5B,OAAS,UAAAC,EAAQ,eAAAC,EAAa,SAAAC,MAAa,SAE3C,OAAS,0BAAAC,MAA8B,mCACvC,OAEE,mBAAAC,MAEK,kCAEP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,6BAAAC,MAAiC,8BAC1C,OAAS,6BAAAC,MAAiC,gEAE1C,OAEE,sBAAAC,MACK,qDA2BA,MAAMC,UAA6BD,CAMxC,CACA,iBACEE,EAOA,CASA,KAAM,CAAE,SAAAC,CAAS,EAAI,KAAK,oBAAoBD,CAAW,EAEnDE,EAAgB,KAAK,MAAM,eAAiBN,EAE5CO,EAAuB,IAAIN,EAA0B,CACzD,MAAO,CACL,cAAAK,CACF,CACF,CAAC,EAAE,i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ACR,CACF,EACA,OAASA,GACHA,EAAE,QAAQ,eAAe,MACpBjB,EAAKiB,EAAE,QAAQ,eAAe,KAAK,EAGrChB,EAAMgB,EAAE,QAAQ,eAAe,IAAI,CAE9C,CAAC,CACH,CAEA,oBAAoBL,EAA+C,CAMjE,MAAO,CACL,SANe,MAAO,CAAE,MAAAO,CAAM,IAA0B,CACxD,MAAMC,EAAU,IAAId,EAAgB,CAAE,WAAYa,CAAM,CAAC,EACzD,OAAOP,EAAY,YAAYQ,CAAO,CACxC,CAIA,CACF,CACF",
6
+ "names": ["Left", "Right", "assign", "fromPromise", "setup", "isSuccessCommandResult", "ListAppsCommand", "UserInteractionRequired", "DEFAULT_UNLOCK_TIMEOUT_MS", "GoToDashboardDeviceAction", "XStateDeviceAction", "ListAppsDeviceAction", "internalApi", "listApps", "unlockTimeout", "goToDashboardMachine", "context", "_", "error", "input", "command"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{CommandResultFactory as s}from"../../../command/model/CommandResult";import{GLOBAL_ERRORS as I,GlobalCommandError as U}from"../../../command/utils/GlobalCommandError";import{BTC_APP as a,CUSTOM_LOCK_SCREEN_APP as p,DOGECOIN_APP as P,ETH_APP as m,SOLANA_APP as A}from"../../../device-action/__test-utils__/data";import{makeDeviceActionInternalApiMock as o}from"../../../device-action/__test-utils__/makeInternalApi";import{setupGoToDashboardMock as u}from"../../../device-action/__test-utils__/setupTestMachine";import{testDeviceActionStates as c}from"../../../device-action/__test-utils__/testDeviceActionStates";import{DeviceActionStatus as e}from"../../../device-action/model/DeviceActionState";import{UserInteractionRequired as t}from"../../../device-action/model/UserInteractionRequired";import{UnknownDAError as V}from"../../../device-action/os/Errors";import{ListAppsDeviceAction as l}from"./ListAppsDeviceAction";jest.mock("@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction");describe("ListAppsDeviceAction",()=>{const{sendCommand:d}=o();beforeEach(()=>{jest.resetAllMocks()}),describe("success cases",()=>{it("should run the device action with no apps installed",i=>{u();const r=new l({input:{}});d.mockResolvedValue(s({data:[]}));const n=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{output:[],status:e.Completed}];c(r,n,o(),i)}),it("should run the device action with one app installed",i=>{u();const r=new l({input:{unlockTimeout:500}});d.mockResolvedValueOnce(s({data:[a]}));const n=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{output:[a],status:e.Completed}];c(r,n,o(),i)}),it("should run the device action with two app installed",i=>{u();const r=new l({input:{unlockTimeout:500}});d.mockResolvedValueOnce(s({data:[a,p]})).mockResolvedValueOnce(s({data:[]}));const n=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{output:[a,p],status:e.Completed}];c(r,n,o(),i)}),it("should run the device action with three app installed",i=>{u();const r=new l({input:{unlockTimeout:500}});d.mockResolvedValueOnce(s({data:[a,p]})).mockResolvedValueOnce(s({data:[m]}));const n=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{output:[a,p,m],status:e.Completed}];c(r,n,o(),i)}),it("should run the device action with four app installed",i=>{u();const r=new l({input:{unlockTimeout:500}});d.mockResolvedValueOnce(s({data:[a,p]})).mockResolvedValueOnce(s({data:[m,A]})).mockResolvedValueOnce(s({data:[]}));const n=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{output:[a,p,m,A],status:e.Completed}];c(r,n,o(),i)}),it("should run the device action with five app installed",i=>{u();const r=new l({input:{unlockTimeout:500}});d.mockResolvedValueOnce(s({data:[a,p]})).mockResolvedValueOnce(s({data:[m,A]})).mockResolvedValueOnce(s({data:[P]}));const n=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{output:[a,p,m,A,P],status:e.Completed}];c(r,n,o(),i)})}),describe("error cases",()=>{it("should return an error if GoTodashboard fails",i=>{u(!0);const r=new l({input:{unlockTimeout:500}});d.mockResolvedValue(s({data:[]}));const n=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{error:new V("GoToDashboard failed"),status:e.Error}];c(r,n,o(),i)}),it("should run the device action if GoTodashboard fails",i=>{u(!0);const r=new l({input:{unlockTimeout:500}});d.mockResolvedValue(s({data:[]}));const n=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{error:new V("GoToDashboard failed"),status:e.Error}];c(r,n,o(),i)}),it("should return an error if ListApps fails",i=>{u();const r=new l({input:{unlockTimeout:500}}),n=new U({errorCode:"5501",...I[5501]});d.mockResolvedValue(s({error:n}));const v=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{error:n,status:e.Error}];c(r,v,o(),i)}),it("should return an error if ListAppsContinue fails",i=>{u();const r=new l({input:{unlockTimeout:500}});d.mockResolvedValueOnce(s({data:[a,p]})).mockRejectedValueOnce(new V("mocked error"));const n=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{error:new V("mocked error"),status:e.Error}];c(r,n,o(),i)})})});
2
+ //# sourceMappingURL=ListAppsDeviceAction.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/api/device-action/os/ListApps/ListAppsDeviceAction.test.ts"],
4
+ "sourcesContent": ["import { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { type ListAppsResponse } from \"@api/command/os/ListAppsCommand\";\nimport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n} from \"@api/command/utils/GlobalCommandError\";\nimport {\n BTC_APP,\n CUSTOM_LOCK_SCREEN_APP,\n DOGECOIN_APP,\n ETH_APP,\n SOLANA_APP,\n} from \"@api/device-action/__test-utils__/data\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { setupGoToDashboardMock } from \"@api/device-action/__test-utils__/setupTestMachine\";\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 { UnknownDAError } from \"@api/device-action/os/Errors\";\n\nimport { ListAppsDeviceAction } from \"./ListAppsDeviceAction\";\nimport { type ListAppsDAState } from \"./types\";\n\njest.mock(\"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\");\n\ndescribe(\"ListAppsDeviceAction\", () => {\n const { sendCommand: sendCommandMock } = makeDeviceActionInternalApiMock();\n\n beforeEach(() => {\n jest.resetAllMocks();\n });\n\n describe(\"success cases\", () => {\n it(\"should run the device action with no apps installed\", (done) => {\n setupGoToDashboardMock();\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: {},\n });\n\n sendCommandMock.mockResolvedValue(CommandResultFactory({ data: [] }));\n\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListApps\n },\n {\n output: [],\n status: DeviceActionStatus.Completed, // Success\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with one app installed\", (done) => {\n setupGoToDashboardMock();\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n sendCommandMock.mockResolvedValueOnce(\n CommandResultFactory({ data: [BTC_APP] }),\n );\n\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListApps\n },\n {\n output: [BTC_APP],\n status: DeviceActionStatus.Completed, // Success\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with two app installed\", (done) => {\n setupGoToDashboardMock();\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n sendCommandMock\n .mockResolvedValueOnce(\n CommandResultFactory({ data: [BTC_APP, CUSTOM_LOCK_SCREEN_APP] }),\n )\n .mockResolvedValueOnce(CommandResultFactory({ data: [] }));\n\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListApps\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // ContinueListApps\n },\n {\n output: [BTC_APP, CUSTOM_LOCK_SCREEN_APP],\n status: DeviceActionStatus.Completed, // Success\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with three app installed\", (done) => {\n setupGoToDashboardMock();\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n sendCommandMock\n .mockResolvedValueOnce(\n CommandResultFactory({ data: [BTC_APP, CUSTOM_LOCK_SCREEN_APP] }),\n )\n .mockResolvedValueOnce(CommandResultFactory({ data: [ETH_APP] }));\n\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListApps\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // ContinueListApps\n },\n {\n output: [BTC_APP, CUSTOM_LOCK_SCREEN_APP, ETH_APP],\n status: DeviceActionStatus.Completed, // Success\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with four app installed\", (done) => {\n setupGoToDashboardMock();\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n sendCommandMock\n .mockResolvedValueOnce(\n CommandResultFactory({ data: [BTC_APP, CUSTOM_LOCK_SCREEN_APP] }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory({ data: [ETH_APP, SOLANA_APP] }),\n )\n .mockResolvedValueOnce(CommandResultFactory({ data: [] }));\n\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListApps\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // ContinueListApps\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // ContinueListApps\n },\n {\n output: [BTC_APP, CUSTOM_LOCK_SCREEN_APP, ETH_APP, SOLANA_APP],\n status: DeviceActionStatus.Completed, // Success\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with five app installed\", (done) => {\n setupGoToDashboardMock();\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n sendCommandMock\n .mockResolvedValueOnce(\n CommandResultFactory({ data: [BTC_APP, CUSTOM_LOCK_SCREEN_APP] }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory({ data: [ETH_APP, SOLANA_APP] }),\n )\n .mockResolvedValueOnce(CommandResultFactory({ data: [DOGECOIN_APP] }));\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListApps\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // ContinueListApps\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // ContinueListApps\n },\n {\n output: [\n BTC_APP,\n CUSTOM_LOCK_SCREEN_APP,\n ETH_APP,\n SOLANA_APP,\n DOGECOIN_APP,\n ] as ListAppsResponse,\n status: DeviceActionStatus.Completed, // Success\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"error cases\", () => {\n it(\"should return an error if GoTodashboard fails\", (done) => {\n setupGoToDashboardMock(true);\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n sendCommandMock.mockResolvedValue(CommandResultFactory({ data: [] }));\n\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n error: new UnknownDAError(\"GoToDashboard failed\"),\n status: DeviceActionStatus.Error, // Error\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action if GoTodashboard fails\", (done) => {\n setupGoToDashboardMock(true);\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n sendCommandMock.mockResolvedValue(CommandResultFactory({ data: [] }));\n\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n error: new UnknownDAError(\"GoToDashboard failed\"),\n status: DeviceActionStatus.Error, // Error\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return an error if ListApps fails\", (done) => {\n setupGoToDashboardMock();\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n const globalError = new GlobalCommandError({\n errorCode: \"5501\",\n ...GLOBAL_ERRORS[\"5501\"],\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n error: globalError,\n }),\n );\n\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListApps\n },\n {\n error: globalError,\n status: DeviceActionStatus.Error, // Error\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return an error if ListAppsContinue fails\", (done) => {\n setupGoToDashboardMock();\n const listAppsDeviceAction = new ListAppsDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n sendCommandMock\n .mockResolvedValueOnce(\n CommandResultFactory({ data: [BTC_APP, CUSTOM_LOCK_SCREEN_APP] }),\n )\n .mockRejectedValueOnce(new UnknownDAError(\"mocked error\"));\n\n const expectedStates: Array<ListAppsDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GoToDashboardCheck\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListApps\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // ContinueListApps\n },\n {\n error: new UnknownDAError(\"mocked error\"),\n status: DeviceActionStatus.Error, // Success\n },\n ];\n\n testDeviceActionStates(\n listAppsDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,wBAAAA,MAA4B,mCAErC,OACE,iBAAAC,EACA,sBAAAC,MACK,wCACP,OACE,WAAAC,EACA,0BAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,cAAAC,MACK,yCACP,OAAS,mCAAAC,MAAuC,oDAChD,OAAS,0BAAAC,MAA8B,qDACvC,OAAS,0BAAAC,MAA8B,2DACvC,OAAS,sBAAAC,MAA0B,6CACnC,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,kBAAAC,MAAsB,+BAE/B,OAAS,wBAAAC,MAA4B,yBAGrC,KAAK,KAAK,+DAA+D,EAEzE,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AE,CAAC,CAClE,EACC,sBAAsB,IAAIS,EAAe,cAAc,CAAC,EAE3D,MAAMK,EAAyC,CAC7C,CACE,kBAAmB,CACjB,wBAAyBN,EAAwB,IACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,kBAAmB,CACjB,wBAAyBC,EAAwB,IACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,kBAAmB,CACjB,wBAAyBC,EAAwB,aACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,kBAAmB,CACjB,wBAAyBC,EAAwB,IACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,MAAO,IAAIE,EAAe,cAAc,EACxC,OAAQF,EAAmB,KAC7B,CACF,EAEAD,EACEO,EACAC,EACAV,EAAgC,EAChCQ,CACF,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["CommandResultFactory", "GLOBAL_ERRORS", "GlobalCommandError", "BTC_APP", "CUSTOM_LOCK_SCREEN_APP", "DOGECOIN_APP", "ETH_APP", "SOLANA_APP", "makeDeviceActionInternalApiMock", "setupGoToDashboardMock", "testDeviceActionStates", "DeviceActionStatus", "UserInteractionRequired", "UnknownDAError", "ListAppsDeviceAction", "sendCommandMock", "done", "listAppsDeviceAction", "expectedStates", "globalError"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Left as l,Right as S}from"purify-ts";import{assign as s,fromCallback as M,fromPromise as m,setup as y}from"xstate";import{UserInteractionRequired as r}from"../../../device-action/model/UserInteractionRequired";import{DEFAULT_UNLOCK_TIMEOUT_MS as D}from"../../../device-action/os/Const";import{ListAppsDeviceAction as v}from"../../../device-action/os/ListApps/ListAppsDeviceAction";import{XStateDeviceAction as L}from"../../../device-action/xstate-utils/XStateDeviceAction";class O extends L{makeStateMachine(a){const{getAppsByHash:i,saveSessionState:o,getDeviceSessionState:c}=this.extractDependencies(a),p=this.input.unlockTimeout??D,A=new v({input:{unlockTimeout:p}}).makeStateMachine(a);return y({types:{input:{unlockTimeout:p},context:{},output:{}},actors:{listApps:A,getAppsByHash:m(i),saveSessionState:M(({input:t,sendBack:e})=>{const{appsWithMetadata:u}=t,h=u.filter(n=>n!==null),d={...c(),installedApps:h};try{o(d),e({type:"done"})}catch(n){e({type:"error",error:n})}})},guards:{hasError:({context:t})=>t._internalState.error!==null,hasNoAppsInstalled:({context:t})=>t._internalState.apps.length===0},actions:{assignErrorFromEvent:s({_internalState:t=>({...t.context._internalState,error:t.event.error})})}}).createMachine({id:"ListAppsWithMetadataDeviceAction",initial:"DeviceReady",context:t=>({input:t.input,_internalState:{error:null,apps:[],appsWithMetadata:[]},intermediateValue:{requiredUserInteraction:r.None}}),states:{DeviceReady:{always:{target:"ListApps"}},ListApps:{invoke:{id:"listApps",src:"listApps",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:s({intermediateValue:t=>t.event.snapshot.context.intermediateValue})},onDone:{target:"ListAppsCheck",actions:s({intermediateValue:t=>({requiredUserInteraction:r.None}),_internalState:t=>t.event.output.caseOf({Right:e=>({...t.context._internalState,apps:e}),Left:e=>({...t.context._internalState,error:e})})})}}},ListAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success",guard:"hasNoAppsInstalled",actions:s({_internalState:t=>({...t.context._internalState,appsWithMetadata:[]})})},{target:"FetchMetadata"}]},FetchMetadata:{invoke:{id:"getAppsByHash",src:"getAppsByHash",input:t=>t.context._internalState.apps,onDone:{target:"FetchMetadataCheck",actions:s({_internalState:t=>t.event.output.caseOf({Right:e=>({...t.context._internalState,appsWithMetadata:e}),Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},FetchMetadataCheck:{always:[{target:"Error",guard:"hasError"},{target:"SaveSession"}]},SaveSession:{invoke:{src:"saveSessionState",input:t=>({appsWithMetadata:t.context._internalState.appsWithMetadata})},on:{done:{target:"Success"},error:{target:"Error",actions:"assignErrorFromEvent"}}},Success:{type:"final"},Error:{type:"final"}},output:t=>t.context._internalState.error?l(t.context._internalState.error):S(t.context._internalState.appsWithMetadata)})}extractDependencies(a){return{getAppsByHash:({input:i})=>a.getMetadataForAppHashes(i),getDeviceSessionState:()=>a.getDeviceSessionState(),saveSessionState:i=>a.setDeviceSessionState(i)}}}export{O as ListAppsWithMetadataDeviceAction};
2
+ //# sourceMappingURL=ListAppsWithMetadataDeviceAction.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.ts"],
4
+ "sourcesContent": ["import { type EitherAsync, Left, Right } from \"purify-ts\";\nimport {\n type AnyEventObject,\n assign,\n fromCallback,\n fromPromise,\n setup,\n} from \"xstate\";\n\nimport { type ListAppsResponse } from \"@api/command/os/ListAppsCommand\";\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 { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nimport { type ListAppsDAOutput } from \"@api/device-action/os/ListApps/types\";\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 { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\nimport { type Application } from \"@internal/manager-api/model/ManagerApiType\";\n\nimport {\n type ListAppsWithMetadataDAError,\n type ListAppsWithMetadataDAInput,\n type ListAppsWithMetadataDAIntermediateValue,\n type ListAppsWithMetadataDAOutput,\n} from \"./types\";\n\ntype ListAppsWithMetadataMachineInternalState = {\n error: ListAppsWithMetadataDAError | null;\n apps: ListAppsResponse;\n appsWithMetadata: ListAppsWithMetadataDAOutput;\n};\n\nexport type MachineDependencies = {\n getAppsByHash: ({\n input,\n }: {\n input: ListAppsDAOutput;\n }) => EitherAsync<HttpFetchApiError, Array<Application | null>>;\n getDeviceSessionState: () => DeviceSessionState;\n saveSessionState: (state: DeviceSessionState) => DeviceSessionState;\n};\n\nexport class ListAppsWithMetadataDeviceAction extends XStateDeviceAction<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAInput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue,\n ListAppsWithMetadataMachineInternalState\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAInput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue,\n ListAppsWithMetadataMachineInternalState\n > {\n type types = StateMachineTypes<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAInput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue,\n ListAppsWithMetadataMachineInternalState\n >;\n\n const { getAppsByHash, saveSessionState, getDeviceSessionState } =\n this.extractDependencies(internalAPI);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const listAppsMachine = new ListAppsDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalAPI);\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 listApps: listAppsMachine,\n getAppsByHash: fromPromise(getAppsByHash),\n saveSessionState: fromCallback(\n ({\n input,\n sendBack,\n }: {\n sendBack: (event: AnyEventObject) => void;\n input: {\n appsWithMetadata: Array<Application | null>;\n };\n }) => {\n const { appsWithMetadata } = input;\n\n const filterted = appsWithMetadata.filter((app) => app !== null);\n\n const sessionState = getDeviceSessionState();\n const updatedState = {\n ...sessionState,\n installedApps: filterted,\n };\n try {\n saveSessionState(updatedState);\n sendBack({ type: \"done\" });\n } catch (error) {\n sendBack({ type: \"error\", error });\n }\n },\n ),\n },\n guards: {\n hasError: ({ context }: { context: types[\"context\"] }) => {\n return context._internalState.error !== null;\n },\n hasNoAppsInstalled: ({ context }: { context: types[\"context\"] }) =>\n context._internalState.apps.length === 0,\n },\n actions: {\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 N4IgpgJg5mDOIC5QBkCWsAuBBADj2A6qhgBYCyYGAhhFdQCJgBuqAxmFqxqgPYB2AOkYt2AJTA0AngGIA2gAYAuolA4esYrz4qQAD0QBGAJzyBADgBsAdgNWAzPIAs8+TceOANCEmILAJjMBKwsHOyMjAzN7SIBfGK80TFx8IlIKaloGZjYOLi0BROw8WGkIfjABVD4mHgBrCoAbdCL8BWUkEDUNbn4dfQQAVgCBIz9IgacQ6z8-Lx8Ef1N5OwsBlbs7dyNHCziE5uTCYnJKGjoqYRzOHsFCw+kwACdHnkeBHAa6ADNXgFsBJpJYptHRdTS9Dr9IaBUbjSYrKwzOaIMwGAQTFx2MxmOx+AYDKxGAZ7EB3YqpE4Zc6XdjXfJk-AAYRIYFYtTkSlB6nB2khKKGAj89jCRjCFmWdmRCD8LiCGIMMysqIsCpJDKOaVOmQu2VpeX4BQOxWZrPZsgM7VU3JufX5fkFwvCYolUqVjkFyxlA3FeO9VjVRpSx3SZyyIlyN0NQKZLLZcj8ls61q0toQZgFQo2TqM4o2UosjjsQRC8iFa1GfiJAejGspoZ14bpBoAYpRWHXtaVypVqnUKjAWrAAEKSAASVFgJBBHTBNr5CAM7gsAkcY3TZmW-iMiPzm0Flkc2PX8gMTmrg4pIe1NIj+VbGHbV-OD2er3enwwP0e-wHhxH48nacrW6FN50XHYVzXAYNxWSsd28RA7GMQUMUcaCLFFTZdniUlA1rJ8wyufVBHvR8tXOE04yApMQIhUB+kiVYBFLTYbBmPwCwsKUdjRRxghVMwAlWSIjHPQ5L3Iwi9UjUiOwo2MzQtLlaN5ejDEsAZmL8ViFRmTj8wLSDt3kbFtzGZYxPJYNJIbIjIwAZSoJgwHsuANH4Ls+DAajZ1AtTpQ4wJnH8UyHB9fNgiMjCzCdcUzEcSyg01KkpNvA1HOc1zYHcvgXxeR4fOTOi9EQPSgvkEKYrC0spQJIwRn4pw8QLAwQjiHC+B4CA4B0dUJJS2zpL8mieVTABaLiEIQMbNPCOb5vmyxEvwmybybQQb3EKRlNG+dV3zIVizCxwc3sPxlv6+s1uIqNBx2ud-ICWa1lPexsWMb18ycQUS3FfEFTsb0LusgbrsjdVKNqe7hv6CwogECwCxPQGhSsNCjHzVdmIMMKBgMBV8eMYHkqu3U0pIts5OoaHioY093QCEwMNFJV5Gg-NInRHGKoqnNSzR4mqcG8mBFkgiqEhmnVJKhdVndQTlncKxXCsfF829H6HFsEJvSFbD9hrS7rzJ9aBAyly3OG3zadK-nzAGUUzKsQlxQxqaQnq2xt1XNnnBMuxBfFsH8nsgBXVh2GyqXUzxCqBEB7YxlXGLIisV0cy5sLlcR53RUD1aTZugBRV9Hmj+dY+XBPV0XRnU9qyxzGiiqNwmOxgnamIgA */\n id: \"ListAppsWithMetadataDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: _.input,\n _internalState: {\n error: null,\n apps: [],\n appsWithMetadata: [],\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"ListApps\",\n },\n },\n ListApps: {\n invoke: {\n id: \"listApps\",\n src: \"listApps\",\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: \"ListAppsCheck\",\n actions: assign({\n intermediateValue: (_) => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n _internalState: (_) => {\n return _.event.output.caseOf({\n Right: (apps) => ({\n ..._.context._internalState,\n apps,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n },\n },\n },\n ListAppsCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n guard: \"hasNoAppsInstalled\",\n actions: assign({\n _internalState: (_) => {\n return {\n ..._.context._internalState,\n appsWithMetadata: [],\n };\n },\n }),\n },\n {\n target: \"FetchMetadata\",\n },\n ],\n },\n FetchMetadata: {\n invoke: {\n id: \"getAppsByHash\",\n src: \"getAppsByHash\",\n input: (_) => _.context._internalState.apps,\n onDone: {\n target: \"FetchMetadataCheck\",\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf({\n Right: (appsWithMetadata) => ({\n ..._.context._internalState,\n appsWithMetadata,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n FetchMetadataCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"SaveSession\",\n },\n ],\n },\n SaveSession: {\n invoke: {\n src: \"saveSessionState\",\n input: (_) => ({\n appsWithMetadata: _.context._internalState.appsWithMetadata,\n }),\n },\n on: {\n done: {\n target: \"Success\",\n },\n error: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\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(_.context._internalState.appsWithMetadata);\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n return {\n getAppsByHash: ({ input }) => internalApi.getMetadataForAppHashes(input),\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n saveSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
5
+ "mappings": "AAAA,OAA2B,QAAAA,EAAM,SAAAC,MAAa,YAC9C,OAEE,UAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,SAAAC,MACK,SAIP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,6BAAAC,MAAiC,8BAC1C,OAAS,wBAAAC,MAA4B,sDAGrC,OAEE,sBAAAC,MACK,qDA4BA,MAAMC,UAAyCD,CAMpD,CACA,iBACEE,EAOA,CASA,KAAM,CAAE,cAAAC,EAAe,iBAAAC,EAAkB,sBAAAC,CAAsB,EAC7D,KAAK,oBAAoBH,CAAW,EAEhCI,EAAgB,KAAK,MAAM,eAAiBR,EAE5CS,EAAkB,IAAIR,EAAqB,CAC/C,MAAO,CACL,cAAAO,CACF,CACF,CAAC,EAAE,iBAAiBJ,CAAW,EAE/B,OAAON,EAAM,CACX,MAAO,CACL,MAAO,CACL,cAAAU,CACF,EACA,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,SAAUC,EACV,cAAeZ,EAAYQ,CAAa,EACxC,iBAAkBT,EAChB,CAAC,CACC,MAAAc,EACA,SAAAC,CACF,IAKM,CACJ,KAAM,CAAE,iBAAAC,CAAiB,EAAIF,EAEvBG,EAAYD,EAAiB,OAAQE,GAAQA,IAAQ,IAAI,EAGzDC,EAAe,CACnB,GAFmBR,EAAsB,EAGzC,cAAeM,CACjB,EACA,GAAI,CACFP,EAAiBS,CAAY,EAC7BJ,EAAS,CAAE,KAAM,MAAO,CAAC,CAC3B,OAASK,EAAO,CACdL,EAAS,CAAE,KAAM,QAAS,MAAAK,CAAM,CAAC,CACnC,CACF,CACF,CACF,EACA,OAAQ,CACN,SAAU,CAAC,CAAE,QAAAC,CAAQ,IACZA,EAAQ,eAAe,QAAU,KAE1C,mBAAoB,CAAC,CAAE,Q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AAQ,eAAe,KACvC,OAAQ,CACN,OAAQ,qBACR,QAASvB,EAAO,CACd,eAAiBuB,GACRA,EAAE,MAAM,OAAO,OAAO,CAC3B,MAAQN,IAAsB,CAC5B,GAAGM,EAAE,QAAQ,eACb,iBAAAN,CACF,GACA,KAAOI,IAAW,CAChB,GAAGE,EAAE,QAAQ,eACb,MAAAF,CACF,EACF,CAAC,CAEL,CAAC,CACH,EACA,QAAS,CACP,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,mBAAoB,CAClB,OAAQ,CACN,CACE,OAAQ,QACR,MAAO,UACT,EACA,CACE,OAAQ,aACV,CACF,CACF,EACA,YAAa,CACX,OAAQ,CACN,IAAK,mBACL,MAAQE,IAAO,CACb,iBAAkBA,EAAE,QAAQ,eAAe,gBAC7C,EACF,EACA,GAAI,CACF,KAAM,CACJ,OAAQ,SACV,EACA,MAAO,CACL,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,QAAS,CACP,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAASA,GACHA,EAAE,QAAQ,eAAe,MACpBzB,EAAKyB,EAAE,QAAQ,eAAe,KAAK,EAGrCxB,EAAMwB,EAAE,QAAQ,eAAe,gBAAgB,CAE1D,CAAC,CACH,CAEA,oBAAoBE,EAA+C,CACjE,MAAO,CACL,cAAe,CAAC,CAAE,MAAAV,CAAM,IAAMU,EAAY,wBAAwBV,CAAK,EACvE,sBAAuB,IAAMU,EAAY,sBAAsB,EAC/D,iBAAmBC,GACjBD,EAAY,sBAAsBC,CAAK,CAC3C,CACF,CACF",
6
+ "names": ["Left", "Right", "assign", "fromCallback", "fromPromise", "setup", "UserInteractionRequired", "DEFAULT_UNLOCK_TIMEOUT_MS", "ListAppsDeviceAction", "XStateDeviceAction", "ListAppsWithMetadataDeviceAction", "internalAPI", "getAppsByHash", "saveSessionState", "getDeviceSessionState", "unlockTimeout", "listAppsMachine", "input", "sendBack", "appsWithMetadata", "filterted", "app", "updatedState", "error", "context", "_", "apps", "internalApi", "state"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Left as D,Right as l}from"purify-ts";import{DeviceStatus as M}from"../../../device/DeviceStatus";import{BTC_APP as u,BTC_APP_METADATA as p,CUSTOM_LOCK_SCREEN_APP as V,CUSTOM_LOCK_SCREEN_APP_METADATA as P,ETH_APP as I,ETH_APP_METADATA as g}from"../../../device-action/__test-utils__/data";import{makeDeviceActionInternalApiMock as n}from"../../../device-action/__test-utils__/makeInternalApi";import{setupListAppsMock as r}from"../../../device-action/__test-utils__/setupTestMachine";import{testDeviceActionStates as o}from"../../../device-action/__test-utils__/testDeviceActionStates";import{DeviceActionStatus as e}from"../../../device-action/model/DeviceActionState";import{UserInteractionRequired as t}from"../../../device-action/model/UserInteractionRequired";import{UnknownDAError as A}from"../../../device-action/os/Errors";import{DeviceSessionStateType as U}from"../../../device-session/DeviceSessionState";import{HttpFetchApiError as f}from"../../../../internal/manager-api/model/Errors";import{ListAppsWithMetadataDeviceAction as d}from"./ListAppsWithMetadataDeviceAction";jest.mock("@api/device-action/os/ListApps/ListAppsDeviceAction");describe("ListAppsWithMetadataDeviceAction",()=>{const{getMetadataForAppHashes:c}=n(),m=jest.fn(),h=jest.fn(),S=jest.fn();function v(){return{getAppsByHash:S,getDeviceSessionState:h,saveSessionState:m}}beforeEach(()=>{jest.resetAllMocks()}),describe("success case",()=>{it("should run the device actions with no apps installed",a=>{r([]);const i=new d({input:{}});c.mockResolvedValue(l([]));const s=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{status:e.Completed,output:[]}];o(i,s,n(),a)}),it("should run the device actions with 1 app installed",a=>{r([u]);const i=new d({input:{}});c.mockResolvedValue(l([p]));const s=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Completed,output:[p]}];o(i,s,n(),a)}),it("should run the device actions with 2 apps installed",a=>{r([u,I]);const i=new d({input:{}});c.mockResolvedValue(l([p,g]));const s=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Completed,output:[p,g]}];o(i,s,n(),a)}),it("should run the device actions with 1 app installed and a custom lock screen",a=>{r([u,V]);const i=new d({input:{}});c.mockResolvedValue(l([p,P]));const s=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Completed,output:[p,P]}];o(i,s,n(),a)})}),describe("error case",()=>{it("should error when ListApps fails",a=>{r([],!0);const i=new d({input:{}}),s=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{status:e.Error,error:new A("ListApps failed")}];o(i,s,n(),a)}),it("should error when getAppsByHash rejects",a=>{r([u]);const i=new d({input:{}});c.mockRejectedValue(new A("getAppsByHash failed"));const s=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Error,error:new A("getAppsByHash failed")}];o(i,s,n(),a)}),it("should error when getAppsByHash fails but error is known",a=>{r([u]);const i=new d({input:{}}),s=new f(new Error("Failed to fetch data"));c.mockResolvedValue(D(s));const w=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Error,error:s}];o(i,w,n(),a)}),it("should error when SaveSession fails",a=>{r([u]);const i=new d({input:{}});S.mockImplementation(async()=>Promise.resolve(l([p]))),jest.spyOn(i,"extractDependencies").mockReturnValue(v()),h.mockReturnValue({sessionStateType:U.ReadyWithoutSecureChannel,deviceStatus:M.CONNECTED,currentApp:"BOLOS",installedApps:[]}),m.mockImplementation(()=>{throw new A("SaveSession failed")});const s=[{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.AllowListApps},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{intermediateValue:{requiredUserInteraction:t.None},status:e.Pending},{status:e.Error,error:new A("SaveSession failed")}];o(i,s,n(),a)})})});
2
+ //# sourceMappingURL=ListAppsWithMetadataDeviceAction.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.ts"],
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n BTC_APP,\n BTC_APP_METADATA,\n CUSTOM_LOCK_SCREEN_APP,\n CUSTOM_LOCK_SCREEN_APP_METADATA,\n ETH_APP,\n ETH_APP_METADATA,\n} from \"@api/device-action/__test-utils__/data\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { setupListAppsMock } from \"@api/device-action/__test-utils__/setupTestMachine\";\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 { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport { HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\n\nimport { ListAppsWithMetadataDeviceAction } from \"./ListAppsWithMetadataDeviceAction\";\nimport { type ListAppsWithMetadataDAState } from \"./types\";\n\njest.mock(\"@api/device-action/os/ListApps/ListAppsDeviceAction\");\n\ndescribe(\"ListAppsWithMetadataDeviceAction\", () => {\n const {\n getMetadataForAppHashes: getMetadataForAppHashesMock,\n // getDeviceSessionState: apiGetDeviceSessionStateMock,\n // setDeviceSessionState: apiSetDeviceSessionStateMock,\n } = makeDeviceActionInternalApiMock();\n\n const saveSessionStateMock = jest.fn();\n const getDeviceSessionStateMock = jest.fn();\n const getAppsByHashMock = jest.fn();\n\n function extractDependenciesMock() {\n return {\n getAppsByHash: getAppsByHashMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n saveSessionState: saveSessionStateMock,\n };\n }\n\n beforeEach(() => {\n jest.resetAllMocks();\n });\n\n describe(\"success case\", () => {\n it(\"should run the device actions with no apps installed\", (done) => {\n setupListAppsMock([]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockResolvedValue(Right([]));\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n status: DeviceActionStatus.Completed,\n output: [],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device actions with 1 app installed\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockResolvedValue(Right([BTC_APP_METADATA]));\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Completed,\n output: [BTC_APP_METADATA],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device actions with 2 apps installed\", (done) => {\n setupListAppsMock([BTC_APP, ETH_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockResolvedValue(\n Right([BTC_APP_METADATA, ETH_APP_METADATA]),\n );\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Completed,\n output: [BTC_APP_METADATA, ETH_APP_METADATA],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device actions with 1 app installed and a custom lock screen\", (done) => {\n setupListAppsMock([BTC_APP, CUSTOM_LOCK_SCREEN_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockResolvedValue(\n Right([BTC_APP_METADATA, CUSTOM_LOCK_SCREEN_APP_METADATA]),\n );\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Completed,\n output: [BTC_APP_METADATA, CUSTOM_LOCK_SCREEN_APP_METADATA],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"error case\", () => {\n it(\"should error when ListApps fails\", (done) => {\n setupListAppsMock([], true);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"ListApps failed\"),\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should error when getAppsByHash rejects\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockRejectedValue(\n new UnknownDAError(\"getAppsByHash failed\"),\n );\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"getAppsByHash failed\"),\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should error when getAppsByHash fails but error is known\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n const error = new HttpFetchApiError(new Error(\"Failed to fetch data\"));\n\n getMetadataForAppHashesMock.mockResolvedValue(Left(error));\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n status: DeviceActionStatus.Error,\n error,\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should error when SaveSession fails\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getAppsByHashMock.mockImplementation(async () =>\n Promise.resolve(Right([BTC_APP_METADATA])),\n );\n\n jest\n .spyOn(listAppsWithMetadataDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"BOLOS\",\n installedApps: [],\n });\n\n saveSessionStateMock.mockImplementation(() => {\n throw new UnknownDAError(\"SaveSession failed\");\n });\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"SaveSession failed\"),\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAE5B,OAAS,gBAAAC,MAAoB,2BAC7B,OACE,WAAAC,EACA,oBAAAC,EACA,0BAAAC,EACA,mCAAAC,EACA,WAAAC,EACA,oBAAAC,MACK,yCACP,OAAS,mCAAAC,MAAuC,oDAChD,OAAS,qBAAAC,MAAyB,qDAClC,OAAS,0BAAAC,MAA8B,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ACzD,CACE,kBAAmB,CACjB,wBAAyBZ,EAAwB,IACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,kBAAmB,CACjB,wBAAyBC,EAAwB,aACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,kBAAmB,CACjB,wBAAyBC,EAAwB,IACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,kBAAmB,CACjB,wBAAyBC,EAAwB,IACnD,EACA,OAAQD,EAAmB,OAC7B,EACA,CACE,OAAQA,EAAmB,MAC3B,MAAO,IAAIE,EAAe,oBAAoB,CAChD,CACF,EAEAH,EACEa,EACAC,EACAhB,EAAgC,EAChCc,CACF,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["Left", "Right", "DeviceStatus", "BTC_APP", "BTC_APP_METADATA", "CUSTOM_LOCK_SCREEN_APP", "CUSTOM_LOCK_SCREEN_APP_METADATA", "ETH_APP", "ETH_APP_METADATA", "makeDeviceActionInternalApiMock", "setupListAppsMock", "testDeviceActionStates", "DeviceActionStatus", "UserInteractionRequired", "UnknownDAError", "DeviceSessionStateType", "HttpFetchApiError", "ListAppsWithMetadataDeviceAction", "getMetadataForAppHashesMock", "saveSessionStateMock", "getDeviceSessionStateMock", "getAppsByHashMock", "extractDependenciesMock", "done", "listAppsWithMetadataDeviceAction", "expectedStates", "error"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Left as D,Right as y}from"purify-ts";import{assign as t,fromPromise as c,setup as g}from"xstate";import{isSuccessCommandResult as u}from"../../../command/model/CommandResult";import{CloseAppCommand as O}from"../../../command/os/CloseAppCommand";import{OpenAppCommand as v}from"../../../command/os/OpenAppCommand";import{UserInteractionRequired as i}from"../../../device-action/model/UserInteractionRequired";import{DEFAULT_UNLOCK_TIMEOUT_MS as h}from"../../../device-action/os/Const";import{DeviceNotOnboardedError as E}from"../../../device-action/os/Errors";import{GetDeviceStatusDeviceAction as C}from"../../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{XStateDeviceAction as R}from"../../../device-action/xstate-utils/XStateDeviceAction";import{DeviceSessionStateType as l}from"../../../device-session/DeviceSessionState";class q extends R{makeStateMachine(r){const{closeApp:o,openApp:s,getDeviceSessionState:a,isDeviceOnboarded:A,setDeviceSessionState:d}=this.extractDependencies(r),S=this.input.unlockTimeout??h,m=new C({input:{unlockTimeout:S}}).makeStateMachine(r);return g({types:{input:{},context:{},output:{}},actors:{closeApp:c(o),openApp:c(s),getDeviceStatus:m},guards:{isDeviceOnboarded:()=>A(),isRequestedAppOpen:({context:e})=>{if(e._internalState.currentlyRunningApp===null)throw new Error("context.currentlyRunningApp === null");return e._internalState.currentlyRunningApp===e.input.appName},isDashboardOpen:({context:e})=>{if(e._internalState.currentlyRunningApp===null)throw new Error("context.currentlyRunningApp === null");return e._internalState.currentlyRunningApp==="BOLOS"},hasError:({context:e})=>e._internalState.error!==null},actions:{assignErrorDeviceNotOnboarded:t({_internalState:e=>({...e.context._internalState,error:new E})}),assignUserActionNeededOpenApp:t({intermediateValue:e=>({...e.context.intermediateValue,requiredUserInteraction:i.ConfirmOpenApp})}),assignNoUserActionNeeded:t({intermediateValue:e=>({...e.context.intermediateValue,requiredUserInteraction:i.None})}),assignErrorFromEvent:t({_internalState:e=>({...e.context._internalState,error:e.event.error})}),assignNoError:t({_internalState:e=>({...e.context._internalState,error:null})})}}).createMachine({id:"OpenAppDeviceAction",initial:"DeviceReady",context:({input:e})=>{const n=a(),{sessionStateType:p}=n;return{input:e,intermediateValue:{requiredUserInteraction:i.None},_internalState:{error:null,currentlyRunningApp:p===l.ReadyWithoutSecureChannel?n.currentApp.name:null}}},states:{DeviceReady:{always:{target:"OnboardingCheck"}},OnboardingCheck:{always:[{target:"GetDeviceStatus",guard:{type:"isDeviceOnboarded"}},{target:"Error",actions:"assignErrorDeviceNotOnboarded"}]},GetDeviceStatus:{invoke:{id:"deviceStatus",src:"getDeviceStatus",input:e=>({unlockTimeout:e.context.input.unlockTimeout}),onSnapshot:{actions:t({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{target:"CheckDeviceStatus",actions:t({_internalState:e=>e.event.output.caseOf({Right:n=>{const p=a();return p.sessionStateType!==l.Connected&&d({...p,currentApp:{name:n.currentApp,version:n.currentAppVersion}}),{...e.context._internalState,currentlyRunningApp:n.currentApp}},Left:n=>({...e.context._internalState,error:n})})})}}},CheckDeviceStatus:{always:[{target:"Error",guard:"hasError"},{target:"ApplicationReady",guard:"isRequestedAppOpen"},{target:"DashboardCheck"}]},DashboardCheck:{always:[{target:"OpenApplication",guard:"isDashboardOpen"},"CloseApplication"]},OpenApplication:{entry:"assignUserActionNeededOpenApp",exit:"assignNoUserActionNeeded",invoke:{src:"openApp",input:({context:e})=>({appName:e.input.appName}),onDone:{target:"OpenApplicationResultCheck",actions:t({_internalState:e=>u(e.event.output)?{...e.context._internalState,currentlyRunningApp:e.context.input.appName}:{...e.context._internalState,error:e.event.output.error}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},OpenApplicationResultCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetDeviceStatus"}]},CloseApplication:{invoke:{src:"closeApp",onDone:{target:"CloseApplicationResultCheck",actions:t({_internalState:e=>u(e.event.output)?{...e.context._internalState,currentlyRunningApp:"BOLOS"}:{...e.context._internalState,error:e.event.output.error}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},CloseApplicationResultCheck:{always:[{target:"Error",guard:"hasError"},{target:"OpenApplication"}]},ApplicationCheck:{always:[{target:"ApplicationReady",guard:"isRequestedAppOpen"},"DashboardCheck"]},ApplicationReady:{always:"Success"},Success:{type:"final",actions:"assignNoError"},Error:{type:"final"}},output:({context:e})=>e._internalState.error?D(e._internalState.error):y(void 0)})}extractDependencies(r){return{closeApp:async()=>r.sendCommand(new O),openApp:async a=>r.sendCommand(new v({appName:a.input.appName})),getDeviceSessionState:()=>r.getDeviceSessionState(),setDeviceSessionState:a=>r.setDeviceSessionState(a),isDeviceOnboarded:()=>!0}}}export{q as OpenAppDeviceAction};
2
+ //# sourceMappingURL=OpenAppDeviceAction.js.map