@ledgerhq/device-management-kit 0.6.4 → 0.7.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 (716) hide show
  1. package/README.md +61 -8
  2. package/lib/cjs/package.json +23 -23
  3. package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
  4. package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
  5. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  6. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +3 -3
  7. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
  8. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
  9. package/lib/cjs/src/api/DmkConfig.js +1 -1
  10. package/lib/cjs/src/api/DmkConfig.js.map +1 -1
  11. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  12. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  13. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  14. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  15. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  16. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  17. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  18. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  19. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
  20. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  21. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  22. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  23. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  24. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  25. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
  26. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  27. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  28. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  29. package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
  30. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +3 -3
  31. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
  32. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +3 -3
  33. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  34. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  35. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  36. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  37. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  38. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  39. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  40. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  41. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  42. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  43. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -1
  44. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
  45. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  46. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  47. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  48. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  49. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  50. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  51. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +2 -0
  52. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  53. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  54. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  55. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  56. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  57. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
  58. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
  59. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  60. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  61. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  62. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  63. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
  64. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  65. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  66. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  67. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  68. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  69. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  70. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  71. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
  72. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  73. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  74. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  75. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  76. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  77. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  78. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  79. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  80. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  81. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  82. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  83. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  84. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  85. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  86. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  87. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  88. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  89. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  90. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  91. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  92. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  93. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  94. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  95. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  96. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  97. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
  98. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
  99. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  100. package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
  101. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
  102. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +1 -1
  103. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +3 -3
  104. package/lib/cjs/src/api/index.js +1 -1
  105. package/lib/cjs/src/api/index.js.map +3 -3
  106. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  107. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
  108. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  109. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  110. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +1 -1
  111. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +3 -3
  112. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
  113. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
  114. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
  115. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
  116. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +2 -0
  117. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
  118. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  119. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  120. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +1 -1
  121. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +3 -3
  122. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  123. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  124. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
  125. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
  126. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
  127. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
  128. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +2 -0
  129. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
  130. package/lib/cjs/src/api/secure-channel/utils.test.js +1 -1
  131. package/lib/cjs/src/api/secure-channel/utils.test.js.map +2 -2
  132. package/lib/cjs/src/api/transport/model/DeviceApduSender.js +2 -0
  133. package/lib/cjs/src/api/transport/model/DeviceApduSender.js.map +7 -0
  134. package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
  135. package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
  136. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  137. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  138. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
  139. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  140. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  141. package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
  142. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
  143. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
  144. package/lib/cjs/src/api/types.js +1 -1
  145. package/lib/cjs/src/api/types.js.map +1 -1
  146. package/lib/cjs/src/di.js +1 -1
  147. package/lib/cjs/src/di.js.map +2 -2
  148. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
  149. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  150. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
  151. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
  152. package/lib/cjs/src/internal/device-session/model/DevicePinger.js +2 -0
  153. package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +7 -0
  154. package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js +2 -0
  155. package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
  156. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  157. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  158. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  159. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  160. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js +2 -0
  161. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
  162. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
  163. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
  164. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  165. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  166. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  167. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
  168. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
  169. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
  170. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
  171. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
  172. package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
  173. package/lib/cjs/src/internal/device-session/model/Frame.js.map +3 -3
  174. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  175. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  176. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  177. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  178. package/lib/cjs/src/internal/device-session/service/MutexService.js +2 -0
  179. package/lib/cjs/src/internal/device-session/service/MutexService.js.map +7 -0
  180. package/lib/cjs/src/internal/device-session/service/MutexService.test.js +2 -0
  181. package/lib/cjs/src/internal/device-session/service/MutexService.test.js.map +7 -0
  182. package/lib/cjs/src/internal/device-session/service/RefresherService.js +1 -1
  183. package/lib/cjs/src/internal/device-session/service/RefresherService.js.map +3 -3
  184. package/lib/cjs/src/internal/device-session/service/RefresherService.test.js +1 -1
  185. package/lib/cjs/src/internal/device-session/service/RefresherService.test.js.map +3 -3
  186. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  187. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  188. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  189. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  190. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  191. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  192. package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
  193. package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
  194. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  195. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  196. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  197. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  198. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  199. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  200. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  201. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  202. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  203. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  204. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
  205. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
  206. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  207. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  208. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  209. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  210. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  211. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  212. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  213. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  214. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  215. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  216. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  217. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  218. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  219. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  220. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
  221. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  222. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  223. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  224. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  225. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  226. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  227. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  228. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  229. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  230. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js +1 -1
  231. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  232. package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
  233. package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
  234. package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
  235. package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
  236. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  237. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  238. package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
  239. package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
  240. package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
  241. package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
  242. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  243. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  244. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  245. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  246. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
  247. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
  248. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  249. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  250. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  251. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  252. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +1 -1
  253. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +2 -2
  254. package/lib/cjs/src/internal/secure-channel/model/Params.js +1 -1
  255. package/lib/cjs/src/internal/secure-channel/model/Params.js.map +1 -1
  256. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  257. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  258. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  259. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  260. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +1 -1
  261. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +1 -1
  262. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
  263. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  264. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  265. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  266. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  267. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  268. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
  269. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  270. package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
  271. package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
  272. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  273. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  274. package/lib/esm/package.json +23 -23
  275. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  276. package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
  277. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  278. package/lib/esm/src/api/DeviceManagementKit.test.js.map +3 -3
  279. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  280. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  281. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  282. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  283. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  284. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  285. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  286. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  287. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  288. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  289. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
  290. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  291. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  292. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  293. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  294. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  295. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
  296. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  297. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  298. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  299. package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
  300. package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
  301. package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
  302. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +3 -3
  303. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  304. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  305. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  306. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  307. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  308. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  309. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  310. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  311. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  312. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  313. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  314. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  315. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  316. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  317. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  318. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  319. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  320. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  321. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  322. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  323. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  324. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  325. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  326. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  327. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  328. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  329. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  330. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  331. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  332. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  333. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  334. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  335. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  336. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  337. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  338. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  339. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  340. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  341. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  342. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  343. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  344. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  345. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  346. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  347. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  348. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  349. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  350. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  351. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  352. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  353. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  354. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  355. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  356. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  357. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  358. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  359. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  360. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  361. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  362. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  363. package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
  364. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  365. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +1 -1
  366. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +3 -3
  367. package/lib/esm/src/api/index.js +1 -1
  368. package/lib/esm/src/api/index.js.map +3 -3
  369. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  370. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
  371. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  372. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  373. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +1 -1
  374. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +3 -3
  375. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
  376. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
  377. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
  378. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
  379. package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js +1 -0
  380. package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
  381. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  382. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  383. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +1 -1
  384. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +3 -3
  385. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  386. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
  387. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
  388. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
  389. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
  390. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js +1 -0
  391. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
  392. package/lib/esm/src/api/secure-channel/utils.test.js +1 -1
  393. package/lib/esm/src/api/secure-channel/utils.test.js.map +2 -2
  394. package/lib/esm/src/api/transport/model/DeviceApduSender.js +1 -0
  395. package/lib/esm/src/api/transport/model/DeviceApduSender.js.map +7 -0
  396. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  397. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  398. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  399. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  400. package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
  401. package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
  402. package/lib/esm/src/di.js +1 -1
  403. package/lib/esm/src/di.js.map +3 -3
  404. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
  405. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  406. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
  407. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
  408. package/lib/esm/src/internal/device-session/model/DevicePinger.js +2 -0
  409. package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +7 -0
  410. package/lib/esm/src/internal/device-session/model/DevicePinger.test.js +2 -0
  411. package/lib/esm/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
  412. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  413. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  414. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  415. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  416. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js +2 -0
  417. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
  418. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
  419. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
  420. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  421. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  422. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  423. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
  424. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
  425. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
  426. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
  427. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
  428. package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
  429. package/lib/esm/src/internal/device-session/model/Frame.js.map +3 -3
  430. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  431. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  432. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  433. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  434. package/lib/esm/src/internal/device-session/service/MutexService.js +2 -0
  435. package/lib/esm/src/internal/device-session/service/MutexService.js.map +7 -0
  436. package/lib/esm/src/internal/device-session/service/MutexService.test.js +2 -0
  437. package/lib/esm/src/internal/device-session/service/MutexService.test.js.map +7 -0
  438. package/lib/esm/src/internal/device-session/service/RefresherService.js +1 -1
  439. package/lib/esm/src/internal/device-session/service/RefresherService.js.map +3 -3
  440. package/lib/esm/src/internal/device-session/service/RefresherService.test.js +1 -1
  441. package/lib/esm/src/internal/device-session/service/RefresherService.test.js.map +3 -3
  442. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  443. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  444. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  445. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  446. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  447. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  448. package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
  449. package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
  450. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  451. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  452. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  453. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  454. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  455. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  456. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  457. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  458. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  459. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  460. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
  461. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
  462. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  463. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  464. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  465. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  466. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  467. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  468. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  469. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  470. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  471. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  472. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  473. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  474. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  475. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  476. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  477. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  478. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  479. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  480. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  481. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  482. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  483. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  484. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js +1 -1
  485. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  486. package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
  487. package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
  488. package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
  489. package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
  490. package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
  491. package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
  492. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  493. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  494. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  495. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  496. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  497. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  498. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  499. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  500. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +1 -1
  501. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +2 -2
  502. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  503. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  504. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  505. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  506. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
  507. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  508. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  509. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  510. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  511. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  512. package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
  513. package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  514. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  515. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  516. package/lib/types/src/api/DeviceManagementKit.d.ts +16 -2
  517. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  518. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  519. package/lib/types/src/api/DmkConfig.d.ts +2 -0
  520. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  521. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
  522. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
  523. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
  524. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
  525. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +30 -2
  526. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  527. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
  528. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
  529. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
  530. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
  531. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  532. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
  533. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
  534. package/lib/types/src/api/command/utils/CommandUtils.d.ts +1 -0
  535. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  536. package/lib/types/src/api/device-action/DeviceAction.d.ts +3 -1
  537. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  538. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  539. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +9 -0
  540. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  541. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
  542. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +1 -0
  543. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  544. package/lib/types/src/api/device-action/os/Errors.d.ts +10 -0
  545. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  546. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts +58 -0
  547. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
  548. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
  549. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
  550. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +27 -0
  551. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
  552. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  553. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
  554. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  555. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
  556. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
  557. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
  558. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
  559. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +64 -0
  560. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
  561. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
  562. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
  563. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
  564. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
  565. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +25 -0
  566. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
  567. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  568. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -0
  569. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  570. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
  571. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
  572. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
  573. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
  574. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
  575. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
  576. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
  577. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
  578. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
  579. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
  580. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
  581. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
  582. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
  583. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
  584. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
  585. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
  586. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  587. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
  588. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  589. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  590. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +93 -0
  591. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  592. package/lib/types/src/api/index.d.ts +8 -1
  593. package/lib/types/src/api/index.d.ts.map +1 -1
  594. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts +3 -3
  595. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -1
  596. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.d.ts +1 -0
  597. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts +8 -0
  598. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -0
  599. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts +2 -0
  600. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts.map +1 -0
  601. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +44 -0
  602. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -0
  603. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts +3 -3
  604. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -1
  605. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.d.ts +1 -0
  606. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +1 -3
  607. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -1
  608. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts +8 -0
  609. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -0
  610. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts +2 -0
  611. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts.map +1 -0
  612. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +41 -0
  613. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -0
  614. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts +17 -0
  615. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts.map +1 -0
  616. package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
  617. package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
  618. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +62 -0
  619. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -0
  620. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +1 -1
  621. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
  622. package/lib/types/src/api/transport/model/Errors.d.ts +22 -3
  623. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  624. package/lib/types/src/api/transport/model/Transport.d.ts +1 -1
  625. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  626. package/lib/types/src/api/types.d.ts +8 -2
  627. package/lib/types/src/api/types.d.ts.map +1 -1
  628. package/lib/types/src/di.d.ts.map +1 -1
  629. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
  630. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
  631. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts +6 -1
  632. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts.map +1 -1
  633. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +18 -0
  634. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -0
  635. package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts +2 -0
  636. package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts.map +1 -0
  637. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +21 -12
  638. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  639. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts +2 -2
  640. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  641. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts +35 -0
  642. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts.map +1 -0
  643. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts +2 -0
  644. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts.map +1 -0
  645. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts +17 -79
  646. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts.map +1 -1
  647. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts +20 -0
  648. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -0
  649. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts +2 -0
  650. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts.map +1 -0
  651. package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
  652. package/lib/types/src/internal/device-session/service/MutexService.d.ts +6 -0
  653. package/lib/types/src/internal/device-session/service/MutexService.d.ts.map +1 -0
  654. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts +2 -0
  655. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts.map +1 -0
  656. package/lib/types/src/internal/device-session/service/RefresherService.d.ts +7 -2
  657. package/lib/types/src/internal/device-session/service/RefresherService.d.ts.map +1 -1
  658. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +3 -1
  659. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
  660. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts +3 -0
  661. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -0
  662. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts +8 -1
  663. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts.map +1 -1
  664. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts +1 -1
  665. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -1
  666. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts +1 -1
  667. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts.map +1 -1
  668. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts +1 -1
  669. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
  670. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +4 -2
  671. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
  672. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +24 -5
  673. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  674. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +51 -6
  675. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  676. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +104 -18
  677. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
  678. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +7 -0
  679. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  680. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  681. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts +1 -0
  682. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts.map +1 -1
  683. package/lib/types/src/internal/manager-api/model/Application.d.ts +12 -12
  684. package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
  685. package/lib/types/src/internal/manager-api/model/Const.d.ts +2 -0
  686. package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
  687. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +17 -3
  688. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  689. package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
  690. package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
  691. package/lib/types/src/internal/manager-api/model/Params.d.ts +20 -6
  692. package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
  693. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +9 -3
  694. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  695. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +42 -7
  696. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  697. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +13 -0
  698. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -0
  699. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts +2 -0
  700. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts.map +1 -0
  701. package/lib/types/src/internal/secure-channel/model/Params.d.ts +3 -5
  702. package/lib/types/src/internal/secure-channel/model/Params.d.ts.map +1 -1
  703. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +7 -7
  704. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -1
  705. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +41 -7
  706. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -1
  707. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +5 -1
  708. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
  709. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +2 -0
  710. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
  711. package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -1
  712. package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
  713. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +1 -0
  714. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
  715. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  716. package/package.json +15 -15
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/os/GetOsVersionCommand.test.ts"],
4
- "sourcesContent": ["import {\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { getOsVersionCommandResponseMockBuilder } from \"./__mocks__/GetOsVersionCommand\";\nimport { GetOsVersionCommand } from \"./GetOsVersionCommand\";\n\nconst GET_OS_VERSION_APDU = Uint8Array.from([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\nconst LNX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x00, 0x00, 0x04, 0x05, 0x32, 0x2e, 0x32, 0x2e, 0x33, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x32, 0x2e, 0x33, 0x30, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x01,\n 0x00, 0x01, 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNX_RESPONSE_DATA_GOOD,\n});\n\nconst LNSP_REPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x10, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x31, 0x2e, 0x31, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x34, 0x2e, 0x30, 0x33, 0x04, 0x33, 0x2e, 0x31, 0x32, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNSP_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNSP_REPONSE_DATA_GOOD,\n});\n\nconst STAX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x20, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x33, 0x2e, 0x30, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x35, 0x2e, 0x32, 0x34, 0x04, 0x30, 0x2e, 0x34, 0x38, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst STAX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: STAX_RESPONSE_DATA_GOOD,\n});\n\ndescribe(\"GetOsVersionCommand\", () => {\n let command: GetOsVersionCommand;\n\n beforeEach(() => {\n command = new GetOsVersionCommand();\n });\n\n describe(\"getApdu\", () => {\n it(\"should return the GetOsVersion apdu\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(GET_OS_VERSION_APDU);\n });\n });\n\n describe(\"parseResponse\", () => {\n describe(\"Nano X\", () => {\n it(\"should parse the LNX response\", () => {\n const parsed = command.parseResponse(\n LNX_RESPONSE_GOOD,\n DeviceModelId.NANO_X,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_X),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Nano S Plus\", () => {\n it(\"should parse the LNSP response\", () => {\n const parsed = command.parseResponse(\n LNSP_RESPONSE_GOOD,\n DeviceModelId.NANO_SP,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_SP),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Stax\", () => {\n it(\"should parse the STAX response\", () => {\n const parsed = command.parseResponse(\n STAX_RESPONSE_GOOD,\n DeviceModelId.STAX,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.STAX),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Error handling\", () => {\n it(\"should return an error if the response is not successful\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n const result = command.parseResponse(response, DeviceModelId.NANO_S);\n\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n });\n });\n});\n"],
5
- "mappings": "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",
6
- "names": ["import_CommandResult", "import_DeviceModel", "import_ApduResponse", "import_GetOsVersionCommand", "GET_OS_VERSION_APDU", "LNX_RESPONSE_DATA_GOOD", "LNX_RESPONSE_GOOD", "LNSP_REPONSE_DATA_GOOD", "LNSP_RESPONSE_GOOD", "STAX_RESPONSE_DATA_GOOD", "STAX_RESPONSE_GOOD", "command", "apdu", "parsed", "expected", "response", "result"]
4
+ "sourcesContent": ["import {\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { getOsVersionCommandResponseMockBuilder } from \"./__mocks__/GetOsVersionCommand\";\nimport { GetOsVersionCommand } from \"./GetOsVersionCommand\";\n\nconst GET_OS_VERSION_APDU = Uint8Array.from([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\nconst LNX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x00, 0x00, 0x04, 0x05, 0x32, 0x2e, 0x32, 0x2e, 0x33, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x32, 0x2e, 0x33, 0x30, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x01,\n 0x00, 0x01, 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNX_RESPONSE_DATA_GOOD,\n});\n\nconst LNSP_REPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x10, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x31, 0x2e, 0x31, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x34, 0x2e, 0x30, 0x33, 0x04, 0x33, 0x2e, 0x31, 0x32, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNSP_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNSP_REPONSE_DATA_GOOD,\n});\n\nconst STAX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x20, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x33, 0x2e, 0x30, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x35, 0x2e, 0x32, 0x34, 0x04, 0x30, 0x2e, 0x34, 0x38, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst STAX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: STAX_RESPONSE_DATA_GOOD,\n});\n\nconst BL_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x05, 0x01, 0x00, 0x03, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x04, 0xf4, 0xd8, 0xaa,\n 0x43, 0x05, 0x32, 0x2e, 0x32, 0x2e, 0x33, 0x04, 0x33, 0x00, 0x00, 0x04, 0x90,\n 0x00,\n]);\nconst BL_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: BL_RESPONSE_DATA_GOOD,\n});\n\nconst OLD_FM_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x00, 0x00, 0x04, 0x00, 0x04, 0xee, 0x00, 0x00, 0x00, 0x04, 0x32, 0x2e,\n 0x33, 0x30, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst OLD_FM_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: OLD_FM_RESPONSE_DATA_GOOD,\n});\n\ndescribe(\"GetOsVersionCommand\", () => {\n let command: GetOsVersionCommand;\n\n beforeEach(() => {\n command = new GetOsVersionCommand();\n });\n\n describe(\"getApdu\", () => {\n it(\"should return the GetOsVersion apdu\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(GET_OS_VERSION_APDU);\n });\n });\n\n describe(\"parseResponse\", () => {\n describe(\"Nano X\", () => {\n it(\"should parse the LNX response\", () => {\n const parsed = command.parseResponse(\n LNX_RESPONSE_GOOD,\n DeviceModelId.NANO_X,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_X),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Nano S Plus\", () => {\n it(\"should parse the LNSP response\", () => {\n const parsed = command.parseResponse(\n LNSP_RESPONSE_GOOD,\n DeviceModelId.NANO_SP,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_SP),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Stax\", () => {\n it(\"should parse the STAX response\", () => {\n const parsed = command.parseResponse(\n STAX_RESPONSE_GOOD,\n DeviceModelId.STAX,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.STAX),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Bootloader\", () => {\n it(\"should parse the bootloader response\", () => {\n const parsed = command.parseResponse(\n BL_RESPONSE_GOOD,\n DeviceModelId.STAX,\n );\n\n const expected = CommandResultFactory({\n data: {\n isBootloader: true,\n isOsu: false,\n targetId: 83951619,\n seTargetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xf4, 0xd8, 0xaa, 0x43]),\n mcuTargetId: 83951619,\n mcuSephVersion: \"\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"\",\n langId: undefined,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: true,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: false,\n isInRecoveryMode: false,\n },\n },\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Old firmware\", () => {\n it(\"should parse the old firmware response\", () => {\n const parsed = command.parseResponse(\n OLD_FM_RESPONSE_GOOD,\n DeviceModelId.NANO_X,\n );\n\n const expected = CommandResultFactory({\n data: {\n isBootloader: false,\n isOsu: false,\n targetId: 855638020,\n seTargetId: 855638020,\n seVersion: \"0.0.0\",\n seFlags: new Uint8Array(),\n mcuTargetId: undefined,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"\",\n hwVersion: \"00\",\n langId: undefined,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: true,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n },\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Error handling\", () => {\n it(\"should return an error if the response is not successful\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n const result = command.parseResponse(response, DeviceModelId.NANO_S);\n\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n });\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["import_CommandResult", "import_DeviceModel", "import_ApduResponse", "import_GetOsVersionCommand", "GET_OS_VERSION_APDU", "LNX_RESPONSE_DATA_GOOD", "LNX_RESPONSE_GOOD", "LNSP_REPONSE_DATA_GOOD", "LNSP_RESPONSE_GOOD", "STAX_RESPONSE_DATA_GOOD", "STAX_RESPONSE_GOOD", "BL_RESPONSE_DATA_GOOD", "BL_RESPONSE_GOOD", "OLD_FM_RESPONSE_DATA_GOOD", "OLD_FM_RESPONSE_GOOD", "command", "apdu", "parsed", "expected", "response", "result"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var R=(o,r)=>{for(var e in r)d(o,e,{get:r[e],enumerable:!0})},I=(o,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of x(r))!y.call(o,a)&&a!==e&&d(o,a,{get:()=>r[a],enumerable:!(n=P(r,a))||n.enumerable});return o};var S=o=>I(d({},"__esModule",{value:!0}),o);var B={};R(B,{ListLanguagePackCommand:()=>b,ListLanguagePackCommandError:()=>A});module.exports=S(B);var p=require("../../apdu/utils/ApduBuilder"),c=require("../../apdu/utils/ApduParser"),i=require("../../command/Errors"),t=require("../../command/model/CommandResult"),L=require("../../command/utils/CommandErrors"),C=require("../../command/utils/CommandUtils"),l=require("../../command/utils/GlobalCommandError"),f=require("../../Error"),m=require("../../utils/HexaString");const g={"662d":{message:"Invalid LIST_ARG, first command must be sent with P1_LIST_LANGUAGE_PACKS_FIRST."}};class A extends f.DeviceExchangeError{constructor({message:r,errorCode:e}){super({message:r,errorCode:e,tag:"ListLanguagePackCommandError"})}}class b{constructor(r){this.args=r}getApdu(){const r={cla:224,ins:52,p1:this.args.firstChunk?0:1,p2:0};return new p.ApduBuilder(r).build()}parseResponse(r){const e=new c.ApduParser(r);if(!C.CommandUtils.isSuccessResponse(r)){const s=e.encodeToHexaString(r.statusCode);return(0,L.isCommandErrorCode)(s,g)?(0,t.CommandResultFactory)({error:new A({...g[s],errorCode:s})}):(0,t.CommandResultFactory)({error:l.GlobalCommandErrorHandler.handle(r)})}if(e.extract8BitUInt()===void 0)return(0,t.CommandResultFactory)({data:void 0});e.extract8BitUInt();const a=e.extractFieldLVEncoded();if(a===void 0)return(0,t.CommandResultFactory)({error:new i.InvalidStatusWordError("Failed to get language pack id")});const u=e.extractFieldLVEncoded();if(u===void 0)return(0,t.CommandResultFactory)({error:new i.InvalidStatusWordError("Failed to get language pack size")});const E=parseInt((0,m.bufferToHexaString)(a),16),k=parseInt((0,m.bufferToHexaString)(u),16);return(0,t.CommandResultFactory)({data:{id:E,size:k}})}}0&&(module.exports={ListLanguagePackCommand,ListLanguagePackCommandError});
2
+ //# sourceMappingURL=ListLanguagePackCommand.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/command/os/ListLanguagePackCommand.ts"],
4
+ "sourcesContent": ["import { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder, type ApduBuilderArgs } from \"@api/apdu/utils/ApduBuilder\";\nimport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nimport { type Command } from \"@api/command/Command\";\nimport { InvalidStatusWordError } from \"@api/command/Errors\";\nimport {\n type CommandResult,\n CommandResultFactory,\n} from \"@api/command/model/CommandResult\";\nimport {\n type CommandErrors,\n isCommandErrorCode,\n} from \"@api/command/utils/CommandErrors\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { GlobalCommandErrorHandler } from \"@api/command/utils/GlobalCommandError\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type CommandErrorArgs, DeviceExchangeError } from \"@api/Error\";\nimport { bufferToHexaString } from \"@api/utils/HexaString\";\n\nexport type ListLanguagePackCommandArgs = {\n readonly firstChunk: boolean;\n};\n\nexport type ListLanguagePackResponse =\n | {\n readonly id: number;\n readonly size: number;\n }\n | undefined;\n\nexport type ListLanguagePackErrorCodes = \"662d\";\n\nconst LANGUAGE_PACK_ERRORS: CommandErrors<ListLanguagePackErrorCodes> = {\n \"662d\": {\n message:\n \"Invalid LIST_ARG, first command must be sent with P1_LIST_LANGUAGE_PACKS_FIRST.\",\n },\n};\n\nexport type ListLanguagePackCommandResult = CommandResult<\n ListLanguagePackResponse,\n ListLanguagePackErrorCodes\n>;\n\nexport class ListLanguagePackCommandError extends DeviceExchangeError<ListLanguagePackErrorCodes> {\n constructor({\n message,\n errorCode,\n }: CommandErrorArgs<ListLanguagePackErrorCodes>) {\n super({ message, errorCode, tag: \"ListLanguagePackCommandError\" });\n }\n}\n\nexport class ListLanguagePackCommand\n implements\n Command<\n ListLanguagePackResponse,\n ListLanguagePackCommandArgs,\n ListLanguagePackErrorCodes\n >\n{\n constructor(private args: ListLanguagePackCommandArgs) {}\n\n getApdu(): Apdu {\n const apduArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x34,\n p1: this.args.firstChunk ? 0x00 : 0x01,\n p2: 0x00,\n };\n return new ApduBuilder(apduArgs).build();\n }\n\n parseResponse(apduResponse: ApduResponse): ListLanguagePackCommandResult {\n const parser = new ApduParser(apduResponse);\n\n if (!CommandUtils.isSuccessResponse(apduResponse)) {\n const errorCode = parser.encodeToHexaString(apduResponse.statusCode);\n if (isCommandErrorCode(errorCode, LANGUAGE_PACK_ERRORS)) {\n return CommandResultFactory({\n error: new ListLanguagePackCommandError({\n ...LANGUAGE_PACK_ERRORS[errorCode],\n errorCode,\n }),\n });\n }\n return CommandResultFactory({\n error: GlobalCommandErrorHandler.handle(apduResponse),\n });\n }\n\n const tlvVersion = parser.extract8BitUInt();\n if (tlvVersion === undefined) {\n // No more language package\n return CommandResultFactory({\n data: undefined,\n });\n }\n\n parser.extract8BitUInt(); // total length\n const idBuffer = parser.extractFieldLVEncoded();\n if (idBuffer === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack id\"),\n });\n }\n\n const sizeBuffer = parser.extractFieldLVEncoded();\n if (sizeBuffer === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack size\"),\n });\n }\n\n const id = parseInt(bufferToHexaString(idBuffer), 16);\n const size = parseInt(bufferToHexaString(sizeBuffer), 16);\n return CommandResultFactory({\n data: { id, size },\n });\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,EAAA,iCAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAAkD,uCAClDC,EAA2B,sCAE3BC,EAAuC,+BACvCC,EAGO,4CACPC,EAGO,4CACPC,EAA6B,2CAC7BC,EAA0C,iDAE1CC,EAA2D,sBAC3DC,EAAmC,iCAenC,MAAMC,EAAkE,CACtE,OAAQ,CACN,QACE,iFACJ,CACF,EAOO,MAAMX,UAAqC,qBAAgD,CAChG,YAAY,CACV,QAAAY,EACA,UAAAC,CACF,EAAiD,CAC/C,MAAM,CAAE,QAAAD,EAAS,UAAAC,EAAW,IAAK,8BAA+B,CAAC,CACnE,CACF,CAEO,MAAMd,CAOb,CACE,YAAoBe,EAAmC,CAAnC,UAAAA,CAAoC,CAExD,SAAgB,CACd,MAAMC,EAA4B,CAChC,IAAK,IACL,IAAK,GACL,GAAI,KAAK,KAAK,WAAa,EAAO,EAClC,GAAI,CACN,EACA,OAAO,IAAI,cAAYA,CAAQ,EAAE,MAAM,CACzC,CAEA,cAAcC,EAA2D,CACvE,MAAMC,EAAS,IAAI,aAAWD,CAAY,EAE1C,GAAI,CAAC,eAAa,kBAAkBA,CAAY,EAAG,CACjD,MAAMH,EAAYI,EAAO,mBAAmBD,EAAa,UAAU,EACnE,SAAI,sBAAmBH,EAAWF,CAAoB,KAC7C,wBAAqB,CAC1B,MAAO,IAAIX,EAA6B,CACtC,GAAGW,EAAqBE,CAAS,EACjC,UAAAA,CACF,CAAC,CACH,CAAC,KAEI,wBAAqB,CAC1B,MAAO,4BAA0B,OAAOG,CAAY,CACtD,CAAC,CACH,CAGA,GADmBC,EAAO,gBAAgB,IACvB,OAEjB,SAAO,wBAAqB,CAC1B,KAAM,MACR,CAAC,EAGHA,EAAO,gBAAgB,EACvB,MAAMC,EAAWD,EAAO,sBAAsB,EAC9C,GAAIC,IAAa,OACf,SAAO,wBAAqB,CAC1B,MAAO,IAAI,yBAAuB,gCAAgC,CACpE,CAAC,EAGH,MAAMC,EAAaF,EAAO,sBAAsB,EAChD,GAAIE,IAAe,OACjB,SAAO,wBAAqB,CAC1B,MAAO,IAAI,yBAAuB,kCAAkC,CACtE,CAAC,EAGH,MAAMC,EAAK,YAAS,sBAAmBF,CAAQ,EAAG,EAAE,EAC9CG,EAAO,YAAS,sBAAmBF,CAAU,EAAG,EAAE,EACxD,SAAO,wBAAqB,CAC1B,KAAM,CAAE,GAAAC,EAAI,KAAAC,CAAK,CACnB,CAAC,CACH,CACF",
6
+ "names": ["ListLanguagePackCommand_exports", "__export", "ListLanguagePackCommand", "ListLanguagePackCommandError", "__toCommonJS", "import_ApduBuilder", "import_ApduParser", "import_Errors", "import_CommandResult", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_Error", "import_HexaString", "LANGUAGE_PACK_ERRORS", "message", "errorCode", "args", "apduArgs", "apduResponse", "parser", "idBuffer", "sizeBuffer", "id", "size"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=require("../../command/Errors"),r=require("../../command/model/CommandResult"),u=require("../../command/model/CommandResult"),o=require("../../command/os/ListLanguagePackCommand"),n=require("../../device-session/ApduResponse");const i=new Uint8Array([224,52,0,0,0]),d=new Uint8Array([224,52,1,0,0]);describe("ListLanguagePackCommand",()=>{let t;beforeEach(()=>{t=new o.ListLanguagePackCommand({firstChunk:!0})}),it("should return the correct APDU",()=>{const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(i)}),it("should return the correct next chunks APDU",()=>{t=new o.ListLanguagePackCommand({firstChunk:!1});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(d)}),it("should parse result successfully",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15,1,1,4,0,0,80,0,5,48,46,48,46,52,0])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({data:{id:1,size:20480}}))}),it("should parse empty result successfully",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({data:void 0}))}),it("should fail on invalid id",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({error:new a.InvalidStatusWordError("Failed to get language pack id")}))}),it("should fail on invalid size",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15,1,1])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({error:new a.InvalidStatusWordError("Failed to get language pack size")}))}),it("should fail on device error",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([102,45]),data:new Uint8Array([])}),s=t.parseResponse(e);expect((0,u.isSuccessCommandResult)(s)).toBeFalsy()})});
2
+ //# sourceMappingURL=ListLanguagePackCommand.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/command/os/ListLanguagePackCommand.test.ts"],
4
+ "sourcesContent": ["import { InvalidStatusWordError } from \"@api/command/Errors\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport { ListLanguagePackCommand } from \"@api/command/os/ListLanguagePackCommand\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nconst LIST_LANGUAGE_PACK_APDU = new Uint8Array([0xe0, 0x34, 0x00, 0x00, 0x00]);\nconst LIST_LANGUAGE_PACK_CONTINUE_APDU = new Uint8Array([\n 0xe0, 0x34, 0x01, 0x00, 0x00,\n]);\n\ndescribe(\"ListLanguagePackCommand\", () => {\n let command: ListLanguagePackCommand;\n\n beforeEach(() => {\n command = new ListLanguagePackCommand({ firstChunk: true });\n });\n\n it(\"should return the correct APDU\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(LIST_LANGUAGE_PACK_APDU);\n });\n\n it(\"should return the correct next chunks APDU\", () => {\n command = new ListLanguagePackCommand({ firstChunk: false });\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(LIST_LANGUAGE_PACK_CONTINUE_APDU);\n });\n\n it(\"should parse result successfully\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([\n 0x01, 0x0f, 0x01, 0x01, 0x04, 0x00, 0x00, 0x50, 0x00, 0x05, 0x30, 0x2e,\n 0x30, 0x2e, 0x34, 0x00,\n ]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n id: 1,\n size: 20480,\n },\n }),\n );\n });\n\n it(\"should parse empty result successfully\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: undefined,\n }),\n );\n });\n\n it(\"should fail on invalid id\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0x01, 0x0f]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack id\"),\n }),\n );\n });\n\n it(\"should fail on invalid size\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0x01, 0x0f, 0x01, 0x01]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack size\"),\n }),\n );\n });\n\n it(\"should fail on device error\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x66, 0x2d]),\n data: new Uint8Array([]),\n });\n const result = command.parseResponse(response);\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAuC,+BACvCC,EAAqC,4CACrCA,EAAuC,4CACvCC,EAAwC,mDACxCC,EAA6B,4CAE7B,MAAMC,EAA0B,IAAI,WAAW,CAAC,IAAM,GAAM,EAAM,EAAM,CAAI,CAAC,EACvEC,EAAmC,IAAI,WAAW,CACtD,IAAM,GAAM,EAAM,EAAM,CAC1B,CAAC,EAED,SAAS,0BAA2B,IAAM,CACxC,IAAIC,EAEJ,WAAW,IAAM,CACfA,EAAU,IAAI,0BAAwB,CAAE,WAAY,EAAK,CAAC,CAC5D,CAAC,EAED,GAAG,iCAAkC,IAAM,CACzC,MAAMC,EAAOD,EAAQ,QAAQ,EAC7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cAAcH,CAAuB,CACjE,CAAC,EAED,GAAG,6CAA8C,IAAM,CACrDE,EAAU,IAAI,0BAAwB,CAAE,WAAY,EAAM,CAAC,EAC3D,MAAMC,EAAOD,EAAQ,QAAQ,EAC7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cAAcF,CAAgC,CAC1E,CAAC,EAED,GAAG,mCAAoC,IAAM,CAC3C,MAAMG,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CACnB,EAAM,GAAM,EAAM,EAAM,EAAM,EAAM,EAAM,GAAM,EAAM,EAAM,GAAM,GAClE,GAAM,GAAM,GAAM,CACpB,CAAC,CACH,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,iBACb,wBAAqB,CACnB,KAAM,CACJ,GAAI,EACJ,KAAM,KACR,CACF,CAAC,CACH,CACF,CAAC,EAED,GAAG,yCAA0C,IAAM,CACjD,MAAMD,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,iBACb,wBAAqB,CACnB,KAAM,MACR,CAAC,CACH,CACF,CAAC,EAED,GAAG,4BAA6B,IAAM,CACpC,MAAMD,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,EAAI,CAAC,CACnC,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yBAAuB,gCAAgC,CACpE,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMD,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,GAAM,EAAM,CAAI,CAAC,CAC/C,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yBAAuB,kCAAkC,CACtE,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMD,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,EAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,UAAO,0BAAuBC,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC",
6
+ "names": ["import_Errors", "import_CommandResult", "import_ListLanguagePackCommand", "import_ApduResponse", "LIST_LANGUAGE_PACK_APDU", "LIST_LANGUAGE_PACK_CONTINUE_APDU", "command", "apdu", "response", "result"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var t=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var u=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},c=(r,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!d.call(r,i)&&i!==o&&t(r,i,{get:()=>e[i],enumerable:!(n=a(e,i))||n.enumerable});return r};var V=r=>c(t({},"__esModule",{value:!0}),r);var S={};u(S,{getOsVersionCommandResponseMockBuilder:()=>m});module.exports=V(S);var s=require("../../../device/DeviceModel");const m=(r=s.DeviceModelId.NANO_SP,e={})=>({[s.DeviceModelId.NANO_SP]:{targetId:856686596,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuSephVersion:"4.03",mcuBootloaderVersion:"3.12",hwVersion:"00",langId:"00",recoverState:"00",secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[s.DeviceModelId.NANO_S]:{targetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:"00",recoverState:"00",secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[s.DeviceModelId.NANO_X]:{targetId:855638020,seVersion:"2.2.3",seFlags:new Uint8Array([230,0,0,0]),mcuSephVersion:"2.30",mcuBootloaderVersion:"1.16",hwVersion:"00",langId:"00",recoverState:"00",secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1}},[s.DeviceModelId.STAX]:{targetId:857735172,seVersion:"1.3.0",seFlags:new Uint8Array([230,0,0,0]),mcuSephVersion:"5.24",mcuBootloaderVersion:"0.48",hwVersion:"00",langId:"00",recoverState:"00",secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[s.DeviceModelId.FLEX]:{targetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:"00",recoverState:"00",secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e}})[r];0&&(module.exports={getOsVersionCommandResponseMockBuilder});
1
+ "use strict";var t=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var u=(s,e)=>{for(var o in e)t(s,o,{get:e[o],enumerable:!0})},c=(s,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of d(e))!l.call(s,i)&&i!==o&&t(s,i,{get:()=>e[i],enumerable:!(a=n(e,i))||a.enumerable});return s};var f=s=>c(t({},"__esModule",{value:!0}),s);var m={};u(m,{getOsVersionCommandResponseMockBuilder:()=>g});module.exports=f(m);var r=require("../../../device/DeviceModel");const g=(s=r.DeviceModelId.NANO_SP,e={})=>({[r.DeviceModelId.NANO_SP]:{isBootloader:!1,isOsu:!1,targetId:856686596,seTargetId:856686596,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"4.03",mcuBootloaderVersion:"3.12",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[r.DeviceModelId.NANO_S]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[r.DeviceModelId.NANO_X]:{isBootloader:!1,isOsu:!1,targetId:855638020,seTargetId:855638020,seVersion:"2.2.3",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"2.30",mcuBootloaderVersion:"1.16",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1}},[r.DeviceModelId.STAX]:{isBootloader:!1,isOsu:!1,targetId:857735172,seTargetId:857735172,seVersion:"1.3.0",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"5.24",mcuBootloaderVersion:"0.48",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[r.DeviceModelId.FLEX]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e}})[s];0&&(module.exports={getOsVersionCommandResponseMockBuilder});
2
2
  //# sourceMappingURL=GetOsVersionCommand.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/command/os/__mocks__/GetOsVersionCommand.ts"],
4
- "sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n targetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_S]: {\n targetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_X]: {\n targetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n },\n [DeviceModelId.STAX]: {\n targetId: 857735172,\n seVersion: \"1.3.0\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuSephVersion: \"5.24\",\n mcuBootloaderVersion: \"0.48\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.FLEX]: {\n targetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n })[deviceModelId];\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA8B,mCAEvB,MAAMF,EAAyC,CACpDG,EAA+B,gBAAc,QAC7CC,EAAuC,CAAC,KAEvC,CACC,CAAC,gBAAc,OAAO,EAAG,CACvB,SAAU,UACV,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,KACR,aAAc,KACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,SAAU,UACV,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,KACR,aAAc,KACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,SAAU,UACV,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,KACR,aAAc,KACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,CACF,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,SAAU,UACV,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,KACR,aAAc,KACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,SAAU,UACV,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,KACR,aAAc,KACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,CACF,GAAGD,CAAa",
4
+ "sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n isBootloader: false,\n isOsu: false,\n targetId: 856686596,\n seTargetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_S]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_X]: {\n isBootloader: false,\n isOsu: false,\n targetId: 855638020,\n seTargetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n },\n [DeviceModelId.STAX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 857735172,\n seTargetId: 857735172,\n seVersion: \"1.3.0\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"5.24\",\n mcuBootloaderVersion: \"0.48\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.FLEX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n })[deviceModelId];\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA8B,mCAEvB,MAAMF,EAAyC,CACpDG,EAA+B,gBAAc,QAC7CC,EAAuC,CAAC,KAEvC,CACC,CAAC,gBAAc,OAAO,EAAG,CACvB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,EACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,EACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,EACR,aAAc,EACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,CACF,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,EACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,EACR,aAAc,EACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,CACF,GAAGD,CAAa",
6
6
  "names": ["GetOsVersionCommand_exports", "__export", "getOsVersionCommandResponseMockBuilder", "__toCommonJS", "import_DeviceModel", "deviceModelId", "props"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var y=(o,e)=>{for(var s in e)c(o,s,{get:e[s],enumerable:!0})},C=(o,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!u.call(o,r)&&r!==s&&c(o,r,{get:()=>e[r],enumerable:!(i=S(e,r))||i.enumerable});return o};var h=o=>C(c({},"__esModule",{value:!0}),o),v=(o,e,s,i)=>{for(var r=i>1?void 0:i?S(e,s):e,a=o.length-1,g;a>=0;a--)(g=o[a])&&(r=(i?g(e,s,r):g(r))||r);return i&&r&&c(e,s,r),r},m=(o,e)=>(s,i)=>e(s,i,o);var f={};y(f,{SendCommandUseCase:()=>t});module.exports=h(f);var n=require("inversify"),d=require("../../../internal/device-session/di/deviceSessionTypes"),p=require("../../../internal/logger-publisher/di/loggerTypes");let t=class{_sessionService;_logger;constructor(e,s){this._sessionService=e,this._logger=s("SendCommandUseCase")}async execute({sessionId:e,command:s}){return this._sessionService.getDeviceSessionById(e).caseOf({Right:async r=>await r.sendCommand(s),Left:r=>{throw this._logger.error("Error getting session",{data:{error:r}}),r}})}};t=v([(0,n.injectable)(),m(0,(0,n.inject)(d.deviceSessionTypes.DeviceSessionService)),m(1,(0,n.inject)(p.loggerTypes.LoggerPublisherServiceFactory))],t);0&&(module.exports={SendCommandUseCase});
1
+ "use strict";var a=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var y=(o,e)=>{for(var r in e)a(o,r,{get:e[r],enumerable:!0})},C=(o,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!u.call(o,s)&&s!==r&&a(o,s,{get:()=>e[s],enumerable:!(i=S(e,s))||i.enumerable});return o};var h=o=>C(a({},"__esModule",{value:!0}),o),d=(o,e,r,i)=>{for(var s=i>1?void 0:i?S(e,r):e,t=o.length-1,g;t>=0;t--)(g=o[t])&&(s=(i?g(e,r,s):g(s))||s);return i&&s&&a(e,r,s),s},m=(o,e)=>(r,i)=>e(r,i,o);var f={};y(f,{SendCommandUseCase:()=>n});module.exports=h(f);var c=require("inversify"),v=require("../../../internal/device-session/di/deviceSessionTypes"),p=require("../../../internal/logger-publisher/di/loggerTypes");let n=class{_sessionService;_logger;constructor(e,r){this._sessionService=e,this._logger=r("SendCommandUseCase")}async execute({sessionId:e,command:r,abortTimeout:i}){return this._sessionService.getDeviceSessionById(e).caseOf({Right:async t=>await t.sendCommand(r,i),Left:t=>{throw this._logger.error("Error getting session",{data:{error:t}}),t}})}};n=d([(0,c.injectable)(),m(0,(0,c.inject)(v.deviceSessionTypes.DeviceSessionService)),m(1,(0,c.inject)(p.loggerTypes.LoggerPublisherServiceFactory))],n);0&&(module.exports={SendCommandUseCase});
2
2
  //# sourceMappingURL=SendCommandUseCase.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/use-case/SendCommandUseCase.ts"],
4
- "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { Command } from \"@api/command/Command\";\nimport { CommandResult } from \"@api/command/model/CommandResult\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\n\nexport type SendCommandUseCaseArgs<Response, ErrorStatusCodes, Args = void> = {\n /**\n * The device session id.\n */\n readonly sessionId: string;\n /**\n * The command to send.\n */\n readonly command: Command<Response, ErrorStatusCodes, Args>;\n};\n\n/**\n * Sends a command to a device through a device session.\n */\n@injectable()\nexport class SendCommandUseCase {\n private readonly _sessionService: DeviceSessionService;\n private readonly _logger: LoggerPublisherService;\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._sessionService = sessionService;\n this._logger = loggerFactory(\"SendCommandUseCase\");\n }\n\n /**\n * Sends a command to a device through a device session.\n *\n * @param sessionId - The device session id.\n * @param command - The command to send.\n * @returns The response from the command.\n */\n async execute<Response, Args, ErrorStatusCodes>({\n sessionId,\n command,\n }: SendCommandUseCaseArgs<Response, Args, ErrorStatusCodes>): Promise<\n CommandResult<Response, ErrorStatusCodes>\n > {\n const deviceSessionOrError =\n this._sessionService.getDeviceSessionById(sessionId);\n\n return deviceSessionOrError.caseOf({\n // Case device session found\n Right: async (deviceSession) =>\n await deviceSession.sendCommand<Response, Args, ErrorStatusCodes>(\n command,\n ),\n // Case device session not found\n Left: (error) => {\n this._logger.error(\"Error getting session\", {\n data: { error },\n });\n throw error;\n },\n });\n }\n}\n"],
5
- "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAAmC,0DAEnCC,EAA4B,qDAiBrB,IAAMC,EAAN,KAAyB,CACb,gBACA,QACjB,YAEEC,EAEAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,QAAUC,EAAc,oBAAoB,CACnD,CASA,MAAM,QAA0C,CAC9C,UAAAC,EACA,QAAAC,CACF,EAEE,CAIA,OAFE,KAAK,gBAAgB,qBAAqBD,CAAS,EAEzB,OAAO,CAEjC,MAAO,MAAOE,GACZ,MAAMA,EAAc,YAClBD,CACF,EAEF,KAAOE,GAAU,CACf,WAAK,QAAQ,MAAM,wBAAyB,CAC1C,KAAM,CAAE,MAAAA,CAAM,CAChB,CAAC,EACKA,CACR,CACF,CAAC,CACH,CACF,EA5CaN,EAANO,EAAA,IADN,cAAW,EAKPC,EAAA,eAAO,qBAAmB,oBAAoB,GAE9CA,EAAA,eAAO,cAAY,6BAA6B,IANxCR",
6
- "names": ["SendCommandUseCase_exports", "__export", "SendCommandUseCase", "__toCommonJS", "import_inversify", "import_deviceSessionTypes", "import_loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "deviceSession", "error", "__decorateClass", "__decorateParam"]
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { Command } from \"@api/command/Command\";\nimport { CommandResult } from \"@api/command/model/CommandResult\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\n\nexport type SendCommandUseCaseArgs<Response, ErrorStatusCodes, Args = void> = {\n /**\n * The device session id.\n */\n readonly sessionId: string;\n /**\n * The command to send.\n */\n readonly command: Command<Response, ErrorStatusCodes, Args>;\n /**\n * The timeout to abort the command.\n */\n readonly abortTimeout?: number;\n};\n\n/**\n * Sends a command to a device through a device session.\n */\n@injectable()\nexport class SendCommandUseCase {\n private readonly _sessionService: DeviceSessionService;\n private readonly _logger: LoggerPublisherService;\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._sessionService = sessionService;\n this._logger = loggerFactory(\"SendCommandUseCase\");\n }\n\n /**\n * Sends a command to a device through a device session.\n *\n * @param sessionId - The device session id.\n * @param command - The command to send.\n * @returns The response from the command.\n */\n async execute<Response, Args, ErrorStatusCodes>({\n sessionId,\n command,\n abortTimeout,\n }: SendCommandUseCaseArgs<Response, Args, ErrorStatusCodes>): Promise<\n CommandResult<Response, ErrorStatusCodes>\n > {\n const deviceSessionOrError =\n this._sessionService.getDeviceSessionById(sessionId);\n\n return deviceSessionOrError.caseOf({\n // Case device session found\n Right: async (deviceSession) =>\n await deviceSession.sendCommand<Response, Args, ErrorStatusCodes>(\n command,\n abortTimeout,\n ),\n // Case device session not found\n Left: (error) => {\n this._logger.error(\"Error getting session\", {\n data: { error },\n });\n throw error;\n },\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAAmC,0DAEnCC,EAA4B,qDAqBrB,IAAMC,EAAN,KAAyB,CACb,gBACA,QACjB,YAEEC,EAEAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,QAAUC,EAAc,oBAAoB,CACnD,CASA,MAAM,QAA0C,CAC9C,UAAAC,EACA,QAAAC,EACA,aAAAC,CACF,EAEE,CAIA,OAFE,KAAK,gBAAgB,qBAAqBF,CAAS,EAEzB,OAAO,CAEjC,MAAO,MAAOG,GACZ,MAAMA,EAAc,YAClBF,EACAC,CACF,EAEF,KAAOE,GAAU,CACf,WAAK,QAAQ,MAAM,wBAAyB,CAC1C,KAAM,CAAE,MAAAA,CAAM,CAChB,CAAC,EACKA,CACR,CACF,CAAC,CACH,CACF,EA9CaP,EAANQ,EAAA,IADN,cAAW,EAKPC,EAAA,eAAO,qBAAmB,oBAAoB,GAE9CA,EAAA,eAAO,cAAY,6BAA6B,IANxCT",
6
+ "names": ["SendCommandUseCase_exports", "__export", "SendCommandUseCase", "__toCommonJS", "import_inversify", "import_deviceSessionTypes", "import_loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "abortTimeout", "deviceSession", "error", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var d=require("purify-ts"),i=require("../../command/model/CommandResult"),p=require("../../../internal/device-session/model/DeviceSession.stub"),f=require("../../../internal/device-session/service/DefaultDeviceSessionService"),l=require("../../../internal/logger-publisher/service/DefaultLoggerPublisherService"),v=require("../../../internal/manager-api/data/AxiosManagerApiDataSource"),g=require("../../../internal/manager-api/service/DefaultManagerApiService"),D=require("../../../internal/secure-channel/data/DefaultSecureChannelDataSource"),C=require("../../../internal/secure-channel/service/DefaultSecureChannelService"),a=require("./SendCommandUseCase");let o,t,n,c,m,u;const S="fakeSessionId";let s;describe("SendCommandUseCase",()=>{beforeEach(()=>{o=new l.DefaultLoggerPublisherService([],"send-command-use-case"),t=new f.DefaultDeviceSessionService(()=>o),c=new v.AxiosManagerApiDataSource({}),n=new g.DefaultManagerApiService(c),u=new D.DefaultSecureChannelDataSource({}),m=new C.DefaultSecureChannelService(u),s={getApdu:vi.fn(),parseResponse:vi.fn()}}),afterEach(()=>{vi.restoreAllMocks()}),it("should send a command to a connected device",async()=>{const e=(0,p.deviceSessionStubBuilder)({},()=>o,n,m);t.addDeviceSession(e);const r=new a.SendCommandUseCase(t,()=>o);vi.spyOn(e,"sendCommand").mockResolvedValue({status:i.CommandResultStatus.Success,data:void 0});const h=await r.execute({sessionId:S,command:s});e.close(),expect(h).toStrictEqual({status:i.CommandResultStatus.Success,data:void 0})}),it("should throw an error if the session is not found",async()=>{const e=new a.SendCommandUseCase(t,()=>o);vi.spyOn(t,"getDeviceSessionById").mockReturnValue((0,d.Left)({_tag:"DeviceSessionNotFound"}));const r=e.execute({sessionId:S,command:s});await expect(r).rejects.toMatchObject({_tag:"DeviceSessionNotFound"})})});
1
+ "use strict";var d=require("purify-ts"),i=require("../../command/model/CommandResult"),p=require("../../../internal/device-session/data/DeviceSessionRefresherConst"),f=require("../../../internal/device-session/model/DeviceSession.stub"),l=require("../../../internal/device-session/service/DefaultDeviceSessionService"),v=require("../../../internal/logger-publisher/service/DefaultLoggerPublisherService"),g=require("../../../internal/manager-api/data/AxiosManagerApiDataSource"),D=require("../../../internal/manager-api/service/DefaultManagerApiService"),C=require("../../../internal/secure-channel/data/DefaultSecureChannelDataSource"),h=require("../../../internal/secure-channel/service/DefaultSecureChannelService"),a=require("./SendCommandUseCase");let o,t,n,c,m,u;const S="fakeSessionId";let s;describe("SendCommandUseCase",()=>{beforeEach(()=>{o=new v.DefaultLoggerPublisherService([],"send-command-use-case"),t=new l.DefaultDeviceSessionService(()=>o),c=new g.AxiosManagerApiDataSource({}),n=new D.DefaultManagerApiService(c),u=new C.DefaultSecureChannelDataSource({}),m=new h.DefaultSecureChannelService(u),s={getApdu:vi.fn(),parseResponse:vi.fn()}}),afterEach(()=>{vi.restoreAllMocks()}),it("should send a command to a connected device",async()=>{const e=(0,f.deviceSessionStubBuilder)({},()=>o,n,m,p.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS);t.addDeviceSession(e);const r=new a.SendCommandUseCase(t,()=>o);vi.spyOn(e,"sendCommand").mockResolvedValue({status:i.CommandResultStatus.Success,data:void 0});const y=await r.execute({sessionId:S,command:s});e.close(),expect(y).toStrictEqual({status:i.CommandResultStatus.Success,data:void 0})}),it("should throw an error if the session is not found",async()=>{const e=new a.SendCommandUseCase(t,()=>o);vi.spyOn(t,"getDeviceSessionById").mockReturnValue((0,d.Left)({_tag:"DeviceSessionNotFound"}));const r=e.execute({sessionId:S,command:s});await expect(r).rejects.toMatchObject({_tag:"DeviceSessionNotFound"})})});
2
2
  //# sourceMappingURL=SendCommandUseCase.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/use-case/SendCommandUseCase.test.ts"],
4
- "sourcesContent": ["import { Left } from \"purify-ts\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { CommandResultStatus } from \"@api/command/model/CommandResult\";\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { SendCommandUseCase } from \"./SendCommandUseCase\";\n\nlet logger: LoggerPublisherService;\nlet sessionService: DeviceSessionService;\nlet managerApi: ManagerApiService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet secureChannel: SecureChannelService;\nlet secureChannelDataSource: SecureChannelDataSource;\nconst fakeSessionId = \"fakeSessionId\";\nlet command: Command<{ status: string }>;\n\ndescribe(\"SendCommandUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService([], \"send-command-use-case\");\n sessionService = new DefaultDeviceSessionService(() => logger);\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n command = {\n getApdu: vi.fn(),\n parseResponse: vi.fn(),\n };\n });\n\n afterEach(() => {\n vi.restoreAllMocks();\n });\n\n it(\"should send a command to a connected device\", async () => {\n const deviceSession = deviceSessionStubBuilder(\n {},\n () => logger,\n managerApi,\n secureChannel,\n );\n sessionService.addDeviceSession(deviceSession);\n const useCase = new SendCommandUseCase(sessionService, () => logger);\n\n vi.spyOn(deviceSession, \"sendCommand\").mockResolvedValue({\n status: CommandResultStatus.Success,\n data: undefined,\n });\n\n const response = await useCase.execute<{ status: string }, void, void>({\n sessionId: fakeSessionId,\n command,\n });\n\n deviceSession.close();\n\n expect(response).toStrictEqual({\n status: CommandResultStatus.Success,\n data: undefined,\n });\n });\n\n it(\"should throw an error if the session is not found\", async () => {\n const useCase = new SendCommandUseCase(sessionService, () => logger);\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockReturnValue(\n Left({ _tag: \"DeviceSessionNotFound\" }),\n );\n\n const res = useCase.execute<{ status: string }, void, void>({\n sessionId: fakeSessionId,\n command,\n });\n\n await expect(res).rejects.toMatchObject({ _tag: \"DeviceSessionNotFound\" });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAqB,qBAGrBC,EAAoC,4CAGpCC,EAAyC,6DACzCC,EAA4C,wEAE5CC,EAA8C,4EAC9CC,EAA0C,gEAE1CC,EAAyC,kEAEzCC,EAA+C,wEAE/CC,EAA4C,wEAG5CC,EAAmC,gCAEnC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,MAAMC,EAAgB,gBACtB,IAAIC,EAEJ,SAAS,qBAAsB,IAAM,CACnC,WAAW,IAAM,CACfP,EAAS,IAAI,gCAA8B,CAAC,EAAG,uBAAuB,EACtEC,EAAiB,IAAI,8BAA4B,IAAMD,CAAM,EAC7DG,EAAuB,IAAI,4BAA0B,CAAC,CAAc,EACpED,EAAa,IAAI,2BAAyBC,CAAoB,EAC9DE,EAA0B,IAAI,iCAC5B,CAAC,CACH,EACAD,EAAgB,IAAI,8BAA4BC,CAAuB,EACvEE,EAAU,CACR,QAAS,GAAG,GAAG,EACf,cAAe,GAAG,GAAG,CACvB,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,gBAAgB,CACrB,CAAC,EAED,GAAG,8CAA+C,SAAY,CAC5D,MAAMC,KAAgB,4BACpB,CAAC,EACD,IAAMR,EACNE,EACAE,CACF,EACAH,EAAe,iBAAiBO,CAAa,EAC7C,MAAMC,EAAU,IAAI,qBAAmBR,EAAgB,IAAMD,CAAM,EAEnE,GAAG,MAAMQ,EAAe,aAAa,EAAE,kBAAkB,CACvD,OAAQ,sBAAoB,QAC5B,KAAM,MACR,CAAC,EAED,MAAME,EAAW,MAAMD,EAAQ,QAAwC,CACrE,UAAWH,EACX,QAAAC,CACF,CAAC,EAEDC,EAAc,MAAM,EAEpB,OAAOE,CAAQ,EAAE,cAAc,CAC7B,OAAQ,sBAAoB,QAC5B,KAAM,MACR,CAAC,CACH,CAAC,EAED,GAAG,oDAAqD,SAAY,CAClE,MAAMD,EAAU,IAAI,qBAAmBR,EAAgB,IAAMD,CAAM,EACnE,GAAG,MAAMC,EAAgB,sBAAsB,EAAE,mBAC/C,QAAK,CAAE,KAAM,uBAAwB,CAAC,CACxC,EAEA,MAAMU,EAAMF,EAAQ,QAAwC,CAC1D,UAAWH,EACX,QAAAC,CACF,CAAC,EAED,MAAM,OAAOI,CAAG,EAAE,QAAQ,cAAc,CAAE,KAAM,uBAAwB,CAAC,CAC3E,CAAC,CACH,CAAC",
6
- "names": ["import_purify_ts", "import_CommandResult", "import_DeviceSession", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_SendCommandUseCase", "logger", "sessionService", "managerApi", "managerApiDataSource", "secureChannel", "secureChannelDataSource", "fakeSessionId", "command", "deviceSession", "useCase", "response", "res"]
4
+ "sourcesContent": ["import { Left } from \"purify-ts\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { CommandResultStatus } from \"@api/command/model/CommandResult\";\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { SendCommandUseCase } from \"./SendCommandUseCase\";\n\nlet logger: LoggerPublisherService;\nlet sessionService: DeviceSessionService;\nlet managerApi: ManagerApiService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet secureChannel: SecureChannelService;\nlet secureChannelDataSource: SecureChannelDataSource;\nconst fakeSessionId = \"fakeSessionId\";\nlet command: Command<{ status: string }>;\n\ndescribe(\"SendCommandUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService([], \"send-command-use-case\");\n sessionService = new DefaultDeviceSessionService(() => logger);\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n command = {\n getApdu: vi.fn(),\n parseResponse: vi.fn(),\n };\n });\n\n afterEach(() => {\n vi.restoreAllMocks();\n });\n\n it(\"should send a command to a connected device\", async () => {\n const deviceSession = deviceSessionStubBuilder(\n {},\n () => logger,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n sessionService.addDeviceSession(deviceSession);\n const useCase = new SendCommandUseCase(sessionService, () => logger);\n\n vi.spyOn(deviceSession, \"sendCommand\").mockResolvedValue({\n status: CommandResultStatus.Success,\n data: undefined,\n });\n\n const response = await useCase.execute<{ status: string }, void, void>({\n sessionId: fakeSessionId,\n command,\n });\n\n deviceSession.close();\n\n expect(response).toStrictEqual({\n status: CommandResultStatus.Success,\n data: undefined,\n });\n });\n\n it(\"should throw an error if the session is not found\", async () => {\n const useCase = new SendCommandUseCase(sessionService, () => logger);\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockReturnValue(\n Left({ _tag: \"DeviceSessionNotFound\" }),\n );\n\n const res = useCase.execute<{ status: string }, void, void>({\n sessionId: fakeSessionId,\n command,\n });\n\n await expect(res).rejects.toMatchObject({ _tag: \"DeviceSessionNotFound\" });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAqB,qBAGrBC,EAAoC,4CAGpCC,EAAyD,qEACzDC,EAAyC,6DACzCC,EAA4C,wEAE5CC,EAA8C,4EAC9CC,EAA0C,gEAE1CC,EAAyC,kEAEzCC,EAA+C,wEAE/CC,EAA4C,wEAG5CC,EAAmC,gCAEnC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,MAAMC,EAAgB,gBACtB,IAAIC,EAEJ,SAAS,qBAAsB,IAAM,CACnC,WAAW,IAAM,CACfP,EAAS,IAAI,gCAA8B,CAAC,EAAG,uBAAuB,EACtEC,EAAiB,IAAI,8BAA4B,IAAMD,CAAM,EAC7DG,EAAuB,IAAI,4BAA0B,CAAC,CAAc,EACpED,EAAa,IAAI,2BAAyBC,CAAoB,EAC9DE,EAA0B,IAAI,iCAC5B,CAAC,CACH,EACAD,EAAgB,IAAI,8BAA4BC,CAAuB,EACvEE,EAAU,CACR,QAAS,GAAG,GAAG,EACf,cAAe,GAAG,GAAG,CACvB,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,gBAAgB,CACrB,CAAC,EAED,GAAG,8CAA+C,SAAY,CAC5D,MAAMC,KAAgB,4BACpB,CAAC,EACD,IAAMR,EACNE,EACAE,EACA,0CACF,EACAH,EAAe,iBAAiBO,CAAa,EAC7C,MAAMC,EAAU,IAAI,qBAAmBR,EAAgB,IAAMD,CAAM,EAEnE,GAAG,MAAMQ,EAAe,aAAa,EAAE,kBAAkB,CACvD,OAAQ,sBAAoB,QAC5B,KAAM,MACR,CAAC,EAED,MAAME,EAAW,MAAMD,EAAQ,QAAwC,CACrE,UAAWH,EACX,QAAAC,CACF,CAAC,EAEDC,EAAc,MAAM,EAEpB,OAAOE,CAAQ,EAAE,cAAc,CAC7B,OAAQ,sBAAoB,QAC5B,KAAM,MACR,CAAC,CACH,CAAC,EAED,GAAG,oDAAqD,SAAY,CAClE,MAAMD,EAAU,IAAI,qBAAmBR,EAAgB,IAAMD,CAAM,EACnE,GAAG,MAAMC,EAAgB,sBAAsB,EAAE,mBAC/C,QAAK,CAAE,KAAM,uBAAwB,CAAC,CACxC,EAEA,MAAMU,EAAMF,EAAQ,QAAwC,CAC1D,UAAWH,EACX,QAAAC,CACF,CAAC,EAED,MAAM,OAAOI,CAAG,EAAE,QAAQ,cAAc,CAAE,KAAM,uBAAwB,CAAC,CAC3E,CAAC,CACH,CAAC",
6
+ "names": ["import_purify_ts", "import_CommandResult", "import_DeviceSessionRefresherConst", "import_DeviceSession", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_SendCommandUseCase", "logger", "sessionService", "managerApi", "managerApiDataSource", "secureChannel", "secureChannelDataSource", "fakeSessionId", "command", "deviceSession", "useCase", "response", "res"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var o=(s,e)=>{for(var r in e)n(s,r,{get:e[r],enumerable:!0})},l=(s,e,r,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c(e))!u.call(s,i)&&i!==r&&n(s,i,{get:()=>e[i],enumerable:!(p=a(e,i))||p.enumerable});return s};var d=s=>l(n({},"__esModule",{value:!0}),s);var f={};o(f,{CommandUtils:()=>t});module.exports=d(f);class t{static isValidStatusCode(e){return e.length===2}static isSuccessResponse({statusCode:e}){return t.isValidStatusCode(e)?e[0]===144&&e[1]===0:!1}static isLockedDeviceResponse({statusCode:e}){return t.isValidStatusCode(e)?e[0]===85&&e[1]===21:!1}}0&&(module.exports={CommandUtils});
1
+ "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var s in e)a(t,s,{get:e[s],enumerable:!0})},x=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of o(e))!u.call(t,r)&&r!==s&&a(t,r,{get:()=>e[r],enumerable:!(i=p(e,r))||i.enumerable});return t};var A=t=>x(a({},"__esModule",{value:!0}),t);var l={};c(l,{CommandUtils:()=>n});module.exports=A(l);class n{static isValidStatusCode(e){return e.length===2}static isSuccessResponse({statusCode:e}){return n.isValidStatusCode(e)?e[0]===144&&e[1]===0:!1}static isLockedDeviceResponse({statusCode:e}){return n.isValidStatusCode(e)?e[0]===85&&e[1]===21:!1}static isApduThatTriggersDisconnection(e){const s=new Map;return s.set("openApp",new Uint8Array([224,216,0,0])),s.set("closeApp",new Uint8Array([176,167,0,0])),Array.from(s.values()).some(i=>{for(let r=0;r<4;r++)if(i[r]!==e[r])return!1;return!0})}}0&&(module.exports={CommandUtils});
2
2
  //# sourceMappingURL=CommandUtils.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/utils/CommandUtils.ts"],
4
- "sourcesContent": ["import { type ApduResponse } from \"@api/device-session/ApduResponse\";\n\nexport class CommandUtils {\n static isValidStatusCode(statusCode: Uint8Array) {\n return statusCode.length === 2;\n }\n\n static isSuccessResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x90 && statusCode[1] === 0x00;\n }\n\n static isLockedDeviceResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x55 && statusCode[1] === 0x15;\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAEO,MAAME,CAAa,CACxB,OAAO,kBAAkBE,EAAwB,CAC/C,OAAOA,EAAW,SAAW,CAC/B,CAEA,OAAO,kBAAkB,CAAE,WAAAA,CAAW,EAAiB,CACrD,OAAKF,EAAa,kBAAkBE,CAAU,EAIvCA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,EAH1C,EAIX,CAEA,OAAO,uBAAuB,CAAE,WAAAA,CAAW,EAAiB,CAC1D,OAAKF,EAAa,kBAAkBE,CAAU,EAIvCA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,GAH1C,EAIX,CACF",
6
- "names": ["CommandUtils_exports", "__export", "CommandUtils", "__toCommonJS", "statusCode"]
4
+ "sourcesContent": ["import { type ApduResponse } from \"@api/device-session/ApduResponse\";\n\nexport class CommandUtils {\n static isValidStatusCode(statusCode: Uint8Array) {\n return statusCode.length === 2;\n }\n\n static isSuccessResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x90 && statusCode[1] === 0x00;\n }\n\n static isLockedDeviceResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x55 && statusCode[1] === 0x15;\n }\n\n static isApduThatTriggersDisconnection(apdu: Uint8Array) {\n /**\n * Map of known APDUs that trigger a disconnection.\n */\n const apduMap = new Map();\n apduMap.set(\"openApp\", new Uint8Array([0xe0, 0xd8, 0x00, 0x00]));\n apduMap.set(\"closeApp\", new Uint8Array([0xb0, 0xa7, 0x00, 0x00]));\n // TODO: add more APDUs that trigger a disconnection (e.g firmware flashing ?)\n\n // check if apdu first 4 UintArray is included in apduMap\n return Array.from(apduMap.values()).some((value: Uint8Array) => {\n for (let i = 0; i < 4; i++) {\n if (value[i] !== apdu[i]) {\n return false;\n }\n }\n return true;\n });\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAEO,MAAME,CAAa,CACxB,OAAO,kBAAkBE,EAAwB,CAC/C,OAAOA,EAAW,SAAW,CAC/B,CAEA,OAAO,kBAAkB,CAAE,WAAAA,CAAW,EAAiB,CACrD,OAAKF,EAAa,kBAAkBE,CAAU,EAIvCA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,EAH1C,EAIX,CAEA,OAAO,uBAAuB,CAAE,WAAAA,CAAW,EAAiB,CAC1D,OAAKF,EAAa,kBAAkBE,CAAU,EAIvCA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,GAH1C,EAIX,CAEA,OAAO,gCAAgCC,EAAkB,CAIvD,MAAMC,EAAU,IAAI,IACpB,OAAAA,EAAQ,IAAI,UAAW,IAAI,WAAW,CAAC,IAAM,IAAM,EAAM,CAAI,CAAC,CAAC,EAC/DA,EAAQ,IAAI,WAAY,IAAI,WAAW,CAAC,IAAM,IAAM,EAAM,CAAI,CAAC,CAAC,EAIzD,MAAM,KAAKA,EAAQ,OAAO,CAAC,EAAE,KAAMC,GAAsB,CAC9D,QAASC,EAAI,EAAGA,EAAI,EAAGA,IACrB,GAAID,EAAMC,CAAC,IAAMH,EAAKG,CAAC,EACrB,MAAO,GAGX,MAAO,EACT,CAAC,CACH,CACF",
6
+ "names": ["CommandUtils_exports", "__export", "CommandUtils", "__toCommonJS", "statusCode", "apdu", "apduMap", "value", "i"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("../../device-session/ApduResponse"),s=require("./CommandUtils");describe("CommandUtils",()=>{describe("static isSuccessResponse",()=>{it("should return true if the status code is 0x9000",()=>{const e=new t.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(s.CommandUtils.isSuccessResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x9000",()=>{const e=new t.ApduResponse({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])});expect(s.CommandUtils.isSuccessResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new t.ApduResponse({statusCode:Uint8Array.from([85]),data:Uint8Array.from([])});expect(s.CommandUtils.isSuccessResponse(e)).toBe(!1)})}),describe("static isValidStatusCode",()=>{it("should return true if the status code is 2 bytes long",()=>{const e=Uint8Array.from([144,0]);expect(s.CommandUtils.isValidStatusCode(e)).toBe(!0)}),it("should return false if the status code is not 2 bytes long",()=>{const e=Uint8Array.from([144]);expect(s.CommandUtils.isValidStatusCode(e)).toBe(!1)})}),describe("static isLockedDeviceResponse",()=>{it("should return true if the status code is 0x5515",()=>{const e=new t.ApduResponse({statusCode:Uint8Array.from([85,21]),data:Uint8Array.from([])});expect(s.CommandUtils.isLockedDeviceResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x5515",()=>{const e=new t.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(s.CommandUtils.isLockedDeviceResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new t.ApduResponse({statusCode:Uint8Array.from([144]),data:Uint8Array.from([])});expect(s.CommandUtils.isLockedDeviceResponse(e)).toBe(!1)})})});
1
+ "use strict";var o=require("../../command/os/CloseAppCommand"),r=require("../../command/os/GetAppAndVersionCommand"),i=require("../../command/os/OpenAppCommand"),s=require("../../device-session/ApduResponse"),t=require("./CommandUtils");describe("CommandUtils",()=>{describe("static isSuccessResponse",()=>{it("should return true if the status code is 0x9000",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.CommandUtils.isSuccessResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x9000",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])});expect(t.CommandUtils.isSuccessResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([85]),data:Uint8Array.from([])});expect(t.CommandUtils.isSuccessResponse(e)).toBe(!1)})}),describe("static isValidStatusCode",()=>{it("should return true if the status code is 2 bytes long",()=>{const e=Uint8Array.from([144,0]);expect(t.CommandUtils.isValidStatusCode(e)).toBe(!0)}),it("should return false if the status code is not 2 bytes long",()=>{const e=Uint8Array.from([144]);expect(t.CommandUtils.isValidStatusCode(e)).toBe(!1)})}),describe("static isLockedDeviceResponse",()=>{it("should return true if the status code is 0x5515",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([85,21]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x5515",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!1)})}),describe("static isApduThatTriggersDisconnection",()=>{it("should return true if the APDU is openApp",()=>{const e=new i.OpenAppCommand({appName:"test"}).getApdu().getRawApdu();expect(t.CommandUtils.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return true if the APDU is closeApp",()=>{const e=new o.CloseAppCommand().getApdu().getRawApdu();expect(t.CommandUtils.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return false if the APDU is not a known one",()=>{const e=new r.GetAppAndVersionCommand().getApdu().getRawApdu();expect(t.CommandUtils.isApduThatTriggersDisconnection(e)).toBe(!1)})})});
2
2
  //# sourceMappingURL=CommandUtils.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/utils/CommandUtils.test.ts"],
4
- "sourcesContent": ["import { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { CommandUtils } from \"./CommandUtils\";\n\ndescribe(\"CommandUtils\", () => {\n describe(\"static isSuccessResponse\", () => {\n it(\"should return true if the status code is 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isValidStatusCode\", () => {\n it(\"should return true if the status code is 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90, 0x00]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(true);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(false);\n });\n });\n\n describe(\"static isLockedDeviceResponse\", () => {\n it(\"should return true if the status code is 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAA6B,4CAE7BC,EAA6B,0BAE7B,SAAS,eAAgB,IAAM,CAC7B,SAAS,2BAA4B,IAAM,CACzC,GAAG,kDAAmD,IAAM,CAC1D,MAAMC,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAO,eAAa,kBAAkBA,CAAQ,CAAC,EAAE,KAAK,EAAI,CAC5D,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMA,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAO,eAAa,kBAAkBA,CAAQ,CAAC,EAAE,KAAK,EAAK,CAC7D,CAAC,EAED,GAAG,6DAA8D,IAAM,CACrE,MAAMA,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,EAAI,CAAC,EAClC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAO,eAAa,kBAAkBA,CAAQ,CAAC,EAAE,KAAK,EAAK,CAC7D,CAAC,CACH,CAAC,EAED,SAAS,2BAA4B,IAAM,CACzC,GAAG,wDAAyD,IAAM,CAChE,MAAMC,EAAa,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EAE/C,OAAO,eAAa,kBAAkBA,CAAU,CAAC,EAAE,KAAK,EAAI,CAC9D,CAAC,EAED,GAAG,6DAA8D,IAAM,CACrE,MAAMA,EAAa,WAAW,KAAK,CAAC,GAAI,CAAC,EAEzC,OAAO,eAAa,kBAAkBA,CAAU,CAAC,EAAE,KAAK,EAAK,CAC/D,CAAC,CACH,CAAC,EAED,SAAS,gCAAiC,IAAM,CAC9C,GAAG,kDAAmD,IAAM,CAC1D,MAAMD,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,GAAM,EAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAO,eAAa,uBAAuBA,CAAQ,CAAC,EAAE,KAAK,EAAI,CACjE,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMA,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAO,eAAa,uBAAuBA,CAAQ,CAAC,EAAE,KAAK,EAAK,CAClE,CAAC,EAED,GAAG,6DAA8D,IAAM,CACrE,MAAMA,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,GAAI,CAAC,EAClC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAO,eAAa,uBAAuBA,CAAQ,CAAC,EAAE,KAAK,EAAK,CAClE,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["import_ApduResponse", "import_CommandUtils", "response", "statusCode"]
4
+ "sourcesContent": ["import { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nimport { GetAppAndVersionCommand } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { OpenAppCommand } from \"@api/command/os/OpenAppCommand\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { CommandUtils } from \"./CommandUtils\";\n\ndescribe(\"CommandUtils\", () => {\n describe(\"static isSuccessResponse\", () => {\n it(\"should return true if the status code is 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isValidStatusCode\", () => {\n it(\"should return true if the status code is 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90, 0x00]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(true);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(false);\n });\n });\n\n describe(\"static isLockedDeviceResponse\", () => {\n it(\"should return true if the status code is 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isApduThatTriggersDisconnection\", () => {\n it(\"should return true if the APDU is openApp\", () => {\n const apdu = new OpenAppCommand({ appName: \"test\" })\n .getApdu()\n .getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(true);\n });\n\n it(\"should return true if the APDU is closeApp\", () => {\n const apdu = new CloseAppCommand().getApdu().getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(true);\n });\n\n it(\"should return false if the APDU is not a known one\", () => {\n const apdu = new GetAppAndVersionCommand().getApdu().getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(false);\n });\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_OpenAppCommand", "import_ApduResponse", "import_CommandUtils", "response", "statusCode", "apdu"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var m=(r,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of s(e))!p.call(r,t)&&t!==i&&n(r,t,{get:()=>e[t],enumerable:!(o=a(e,t))||o.enumerable});return r};var c=r=>m(n({},"__esModule",{value:!0}),r);var d={};module.exports=c(d);
1
+ "use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var m=(r,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of s(e))!p.call(r,t)&&t!==n&&i(r,t,{get:()=>e[t],enumerable:!(o=a(e,t))||o.enumerable});return r};var c=r=>m(i({},"__esModule",{value:!0}),r);var d={};module.exports=c(d);
2
2
  //# sourceMappingURL=DeviceAction.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/api/device-action/DeviceAction.ts"],
4
- "sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { type DmkError } from \"@api/Error\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { type DeviceActionState } from \"./model/DeviceActionState\";\n\nexport type InternalApi = {\n readonly sendApdu: (\n apdu: Uint8Array,\n ) => Promise<Either<DmkError, ApduResponse>>;\n readonly sendCommand: <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n ) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly getDeviceSessionStateObservable: () => Observable<DeviceSessionState>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly disableRefresher: (blockerId: string) => () => void;\n readonly getManagerApiService: () => ManagerApiService;\n readonly getSecureChannelService: () => SecureChannelService;\n};\n\nexport type DeviceActionIntermediateValue = {\n readonly requiredUserInteraction: string;\n};\n\nexport type ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> = {\n readonly observable: Observable<\n DeviceActionState<Output, Error, IntermediateValue>\n >;\n cancel(): void;\n};\n\nexport interface DeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n> {\n readonly input: Input;\n\n _execute(\n params: InternalApi,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue>;\n}\n"],
4
+ "sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { type DmkError } from \"@api/Error\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { type DeviceActionState } from \"./model/DeviceActionState\";\n\nexport type InternalApi = {\n readonly sendApdu: (\n apdu: Uint8Array,\n ) => Promise<Either<DmkError, ApduResponse>>;\n readonly sendCommand: <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n readonly getDeviceModel: () => TransportDeviceModel;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly getDeviceSessionStateObservable: () => Observable<DeviceSessionState>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly disableRefresher: (blockerId: string) => () => void;\n readonly getManagerApiService: () => ManagerApiService;\n readonly getSecureChannelService: () => SecureChannelService;\n};\n\nexport type DeviceActionIntermediateValue = {\n readonly requiredUserInteraction: string;\n};\n\nexport type ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> = {\n readonly observable: Observable<\n DeviceActionState<Output, Error, IntermediateValue>\n >;\n cancel(): void;\n};\n\nexport interface DeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n> {\n readonly input: Input;\n\n _execute(\n params: InternalApi,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue>;\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["DeviceAction_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var v=(n,e)=>{for(var i in e)c(n,i,{get:e[i],enumerable:!0})},S=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!r.call(n,t)&&t!==i&&c(n,t,{get:()=>e[t],enumerable:!(o=s(e,t))||o.enumerable});return n};var p=n=>S(c({},"__esModule",{value:!0}),n);var b={};v(b,{makeDeviceActionInternalApiMock:()=>D});module.exports=p(b);const f=vi.fn(),M=vi.fn(),d=vi.fn(),k=vi.fn(),l=vi.fn(),m=vi.fn(),g=vi.fn(),A=vi.fn();function D(){return{sendApdu:f,sendCommand:M,getDeviceSessionState:d,getDeviceSessionStateObservable:k,setDeviceSessionState:l,getManagerApiService:m,getSecureChannelService:g,disableRefresher:A}}0&&(module.exports={makeDeviceActionInternalApiMock});
1
+ "use strict";var c=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var v=(n,e)=>{for(var i in e)c(n,i,{get:e[i],enumerable:!0})},S=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!r.call(n,t)&&t!==i&&c(n,t,{get:()=>e[t],enumerable:!(o=s(e,t))||o.enumerable});return n};var M=n=>S(c({},"__esModule",{value:!0}),n);var u={};v(u,{makeDeviceActionInternalApiMock:()=>b});module.exports=M(u);const p=vi.fn(),d=vi.fn(),f=vi.fn(),k=vi.fn(),l=vi.fn(),g=vi.fn(),m=vi.fn(),D=vi.fn(),A=vi.fn();function b(){return{sendApdu:p,sendCommand:d,getDeviceModel:f,getDeviceSessionState:k,getDeviceSessionStateObservable:l,setDeviceSessionState:g,getManagerApiService:m,getSecureChannelService:D,disableRefresher:A}}0&&(module.exports={makeDeviceActionInternalApiMock});
2
2
  //# sourceMappingURL=makeInternalApi.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-action/__test-utils__/makeInternalApi.ts"],
4
- "sourcesContent": ["import { type Mocked } from \"vitest\";\n\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\n\nconst sendApduMock = vi.fn();\nconst sendCommandMock = vi.fn();\nconst apiGetDeviceSessionStateMock = vi.fn();\nconst apiGetDeviceSessionStateObservableMock = vi.fn();\nconst setDeviceSessionStateMock = vi.fn();\nconst getManagerApiServiceMock = vi.fn();\nconst getSecureChannelServiceMock = vi.fn();\nconst disableRefresherMock = vi.fn();\n\nexport function makeDeviceActionInternalApiMock(): Mocked<InternalApi> {\n return {\n sendApdu: sendApduMock,\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n getDeviceSessionStateObservable: apiGetDeviceSessionStateObservableMock,\n setDeviceSessionState: setDeviceSessionStateMock,\n getManagerApiService: getManagerApiServiceMock,\n getSecureChannelService: getSecureChannelServiceMock,\n disableRefresher: disableRefresherMock,\n };\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,IAAA,eAAAC,EAAAH,GAIA,MAAMI,EAAe,GAAG,GAAG,EACrBC,EAAkB,GAAG,GAAG,EACxBC,EAA+B,GAAG,GAAG,EACrCC,EAAyC,GAAG,GAAG,EAC/CC,EAA4B,GAAG,GAAG,EAClCC,EAA2B,GAAG,GAAG,EACjCC,EAA8B,GAAG,GAAG,EACpCC,EAAuB,GAAG,GAAG,EAE5B,SAAST,GAAuD,CACrE,MAAO,CACL,SAAUE,EACV,YAAaC,EACb,sBAAuBC,EACvB,gCAAiCC,EACjC,sBAAuBC,EACvB,qBAAsBC,EACtB,wBAAyBC,EACzB,iBAAkBC,CACpB,CACF",
6
- "names": ["makeInternalApi_exports", "__export", "makeDeviceActionInternalApiMock", "__toCommonJS", "sendApduMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "getSecureChannelServiceMock", "disableRefresherMock"]
4
+ "sourcesContent": ["import { type Mocked } from \"vitest\";\n\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\n\nconst sendApduMock = vi.fn();\nconst sendCommandMock = vi.fn();\nconst apiGetDeviceModelMock = vi.fn();\nconst apiGetDeviceSessionStateMock = vi.fn();\nconst apiGetDeviceSessionStateObservableMock = vi.fn();\nconst setDeviceSessionStateMock = vi.fn();\nconst getManagerApiServiceMock = vi.fn();\nconst getSecureChannelServiceMock = vi.fn();\nconst disableRefresherMock = vi.fn();\n\nexport function makeDeviceActionInternalApiMock(): Mocked<InternalApi> {\n return {\n sendApdu: sendApduMock,\n sendCommand: sendCommandMock,\n getDeviceModel: apiGetDeviceModelMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n getDeviceSessionStateObservable: apiGetDeviceSessionStateObservableMock,\n setDeviceSessionState: setDeviceSessionStateMock,\n getManagerApiService: getManagerApiServiceMock,\n getSecureChannelService: getSecureChannelServiceMock,\n disableRefresher: disableRefresherMock,\n };\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,IAAA,eAAAC,EAAAH,GAIA,MAAMI,EAAe,GAAG,GAAG,EACrBC,EAAkB,GAAG,GAAG,EACxBC,EAAwB,GAAG,GAAG,EAC9BC,EAA+B,GAAG,GAAG,EACrCC,EAAyC,GAAG,GAAG,EAC/CC,EAA4B,GAAG,GAAG,EAClCC,EAA2B,GAAG,GAAG,EACjCC,EAA8B,GAAG,GAAG,EACpCC,EAAuB,GAAG,GAAG,EAE5B,SAASV,GAAuD,CACrE,MAAO,CACL,SAAUE,EACV,YAAaC,EACb,eAAgBC,EAChB,sBAAuBC,EACvB,gCAAiCC,EACjC,sBAAuBC,EACvB,qBAAsBC,EACtB,wBAAyBC,EACzB,iBAAkBC,CACpB,CACF",
6
+ "names": ["makeInternalApi_exports", "__export", "makeDeviceActionInternalApiMock", "__toCommonJS", "sendApduMock", "sendCommandMock", "apiGetDeviceModelMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "getSecureChannelServiceMock", "disableRefresherMock"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var A=(t,e)=>{for(var o in e)p(t,o,{get:e[o],enumerable:!0})},y=(t,e,o,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!k.call(t,i)&&i!==o&&p(t,i,{get:()=>e[i],enumerable:!(m=f(e,i))||m.enumerable});return t};var D=t=>y(p({},"__esModule",{value:!0}),t);var h={};A(h,{setupGetDeviceStatusMock:()=>I,setupGoToDashboardMock:()=>v,setupListAppsMock:()=>M});module.exports=D(h);var r=require("purify-ts"),n=require("xstate"),a=require("../../device-action/model/UserInteractionRequired"),c=require("../../device-action/os/Errors"),s=require("../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),d=require("../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),u=require("../../device-action/os/ListApps/ListAppsDeviceAction");const M=(t,e=!1)=>{u.ListAppsDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,n.createMachine)({id:"MockListAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,n.assign)({intermediateValue:()=>({requiredUserInteraction:a.UserInteractionRequired.AllowListApps})})},done:{type:"final"}},output:()=>e?(0,r.Left)(new c.UnknownDAError("ListApps failed")):(0,r.Right)(t)}))}))},v=(t=!1)=>{d.GoToDashboardDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,n.createMachine)({id:"MockGoToDashboardDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,n.assign)({intermediateValue:()=>({requiredUserInteraction:a.UserInteractionRequired.None})})},done:{type:"final"}},output:()=>t?(0,r.Left)(new c.UnknownDAError("GoToDashboard failed")):(0,r.Right)(void 0)}))}))},I=(t=[{currentApp:"BOLOS",currentAppVersion:"1.0.0"}])=>{const e=vi.fn();for(const o of t)e.mockImplementationOnce(()=>"currentApp"in o?(0,r.Right)(o):(0,r.Left)(o));s.GetDeviceStatusDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,n.createMachine)({id:"MockGetDeviceStatusDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,n.assign)({intermediateValue:()=>({requiredUserInteraction:a.UserInteractionRequired.None})})},done:{type:"final"}},output:e}))}))};0&&(module.exports={setupGetDeviceStatusMock,setupGoToDashboardMock,setupListAppsMock});
1
+ "use strict";var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var M=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},v=(e,t,o,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of I(t))!D.call(e,p)&&p!==o&&c(e,p,{get:()=>t[p],enumerable:!(m=y(t,p))||m.enumerable});return e};var O=e=>v(c({},"__esModule",{value:!0}),e);var w={};M(w,{setupGetDeviceMetadataMock:()=>h,setupGetDeviceStatusMock:()=>L,setupGoToDashboardMock:()=>V,setupInstallOrUpdateAppsMock:()=>G,setupListAppsMock:()=>U,setupListInstalledAppsMock:()=>q,setupOpenAppMock:()=>S});module.exports=O(w);var n=require("purify-ts"),a=require("xstate"),i=require("../../device-action/model/UserInteractionRequired"),r=require("../../device-action/os/Errors"),s=require("../../device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),d=require("../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),l=require("../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),u=require("../../device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),f=require("../../device-action/os/ListApps/ListAppsDeviceAction"),A=require("../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),k=require("../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction");const U=(e,t=!1)=>{f.ListAppsDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockListAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.AllowListApps})})},done:{type:"final"}},output:()=>t?(0,n.Left)(new r.UnknownDAError("ListApps failed")):(0,n.Right)(e)}))}))},h=(e,t=!1)=>{s.GetDeviceMetadataDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockGetDeviceMetadataDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.None})})},done:{type:"final"}},output:()=>t?(0,n.Left)(new r.UnknownDAError("GetDeviceMetadata failed")):(0,n.Right)(e)}))}))},G=(e,t,o=!1)=>{u.InstallOrUpdateAppsDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockInstallOrUpdateAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>t})},done:{type:"final"}},output:()=>o?(0,n.Left)(new r.UnknownDAError("InstallOrUpdateApps failed")):(0,n.Right)(e)}))}))},S=(e=!1)=>{A.OpenAppDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({initial:"ready",states:{ready:{entry:(0,a.assign)({intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.ConfirmOpenApp}}),after:{0:"done"}},done:{type:"final"}},output:()=>e?(0,n.Left)(new r.UnknownDAError("OpenApp failed")):(0,n.Right)(void 0)}))}))},V=(e=!1)=>{l.GoToDashboardDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockGoToDashboardDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.None})})},done:{type:"final"}},output:()=>e?(0,n.Left)(new r.UnknownDAError("GoToDashboard failed")):(0,n.Right)(void 0)}))}))},L=(e=[{currentApp:"BOLOS",currentAppVersion:"1.0.0"}])=>{const t=vi.fn();for(const o of e)t.mockImplementationOnce(()=>"currentApp"in o?(0,n.Right)(o):(0,n.Left)(o));d.GetDeviceStatusDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockGetDeviceStatusDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.None})})},done:{type:"final"}},output:t}))}))},q=(e=[])=>{k.ListInstalledAppsDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockListInstalledAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.None})})},done:{type:"final"}},output:e.reduce((t,o)=>t.mockImplementationOnce(()=>"installedApps"in o?(0,n.Right)(o):(0,n.Left)(o)),vi.fn()).mockImplementation(()=>(0,n.Right)([]))}))}))};0&&(module.exports={setupGetDeviceMetadataMock,setupGetDeviceStatusMock,setupGoToDashboardMock,setupInstallOrUpdateAppsMock,setupListAppsMock,setupListInstalledAppsMock,setupOpenAppMock});
2
2
  //# sourceMappingURL=setupTestMachine.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-action/__test-utils__/setupTestMachine.ts"],
4
- "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nimport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nimport { type DmkError } from \"@api/Error\";\n\nimport { type BTC_APP } from \"./data\";\n\ntype App = typeof BTC_APP;\n\nexport const setupListAppsMock = (apps: App[], error = false) => {\n (ListAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockListAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"ListApps failed\"))\n : Right(apps);\n },\n }),\n ),\n }));\n};\n\nexport const setupGoToDashboardMock = (error: boolean = false) => {\n (GoToDashboardDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGoToDashboardDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"GoToDashboard failed\"))\n : Right(undefined);\n },\n }),\n ),\n }));\n};\n\nexport const setupGetDeviceStatusMock = (\n outputs: ReadonlyArray<\n { currentApp: string; currentAppVersion: string } | DmkError\n > = [\n {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n ],\n) => {\n const outputFn = vi.fn();\n\n for (const output of outputs) {\n outputFn.mockImplementationOnce(() =>\n \"currentApp\" in output ? Right(output) : Left(output),\n );\n }\n (GetDeviceStatusDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGetDeviceStatusDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: outputFn,\n }),\n ),\n }));\n};\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,EAAA,2BAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAA4B,qBAE5BC,EAAsC,kBAEtCC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAqC,+DAO9B,MAAMR,EAAoB,CAACS,EAAaC,EAAQ,KAAU,CAC9D,uBAA8B,mBAAmB,KAAO,CACvD,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,OAC3C,iBAAc,CACZ,GAAI,2BACJ,QAAS,QACT,OAAQ,CACN,MAAO,CACL,MAAO,CACL,EAAG,MACL,EACA,SAAO,UAAO,CACZ,kBAAmB,KAAO,CACxB,wBAAyB,0BAAwB,aACnD,EACF,CAAC,CACH,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQ,IACCA,KACH,QAAK,IAAI,iBAAe,iBAAiB,CAAC,KAC1C,SAAMD,CAAI,CAElB,CAAC,CACH,CACF,EAAE,CACJ,EAEaV,EAAyB,CAACW,EAAiB,KAAU,CAC/D,4BAAmC,mBAAmB,KAAO,CAC5D,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,OAC3C,iBAAc,CACZ,GAAI,gCACJ,QAAS,QACT,OAAQ,CACN,MAAO,CACL,MAAO,CACL,EAAG,MACL,EACA,SAAO,UAAO,CACZ,kBAAmB,KAAO,CACxB,wBAAyB,0BAAwB,IACnD,EACF,CAAC,CACH,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQ,IACCA,KACH,QAAK,IAAI,iBAAe,sBAAsB,CAAC,KAC/C,SAAM,MAAS,CAEvB,CAAC,CACH,CACF,EAAE,CACJ,EAEaZ,EAA2B,CACtCa,EAEI,CACF,CACE,WAAY,QACZ,kBAAmB,OACrB,CACF,IACG,CACH,MAAMC,EAAW,GAAG,GAAG,EAEvB,UAAWC,KAAUF,EACnBC,EAAS,uBAAuB,IAC9B,eAAgBC,KAAS,SAAMA,CAAM,KAAI,QAAKA,CAAM,CACtD,EAED,8BAAqC,mBAAmB,KAAO,CAC9D,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,OAC3C,iBAAc,CACZ,GAAI,kCACJ,QAAS,QACT,OAAQ,CACN,MAAO,CACL,MAAO,CACL,EAAG,MACL,EACA,SAAO,UAAO,CACZ,kBAAmB,KAAO,CACxB,wBAAyB,0BAAwB,IACnD,EACF,CAAC,CACH,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQD,CACV,CAAC,CACH,CACF,EAAE,CACJ",
6
- "names": ["setupTestMachine_exports", "__export", "setupGetDeviceStatusMock", "setupGoToDashboardMock", "setupListAppsMock", "__toCommonJS", "import_purify_ts", "import_xstate", "import_UserInteractionRequired", "import_Errors", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_ListAppsDeviceAction", "apps", "error", "outputs", "outputFn", "output"]
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nimport { type GetDeviceMetadataDAOutput } from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nimport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nimport {\n type InstallOrUpdateAppsDAIntermediateValue,\n type InstallOrUpdateAppsDAOutput,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type DmkError } from \"@api/Error\";\nimport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nimport { type InstalledApp } from \"@api/secure-channel/device-action/ListInstalledApps/types\";\n\nimport { type BTC_APP } from \"./data\";\n\ntype App = typeof BTC_APP;\n\nexport const setupListAppsMock = (apps: App[], error = false) => {\n (ListAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockListAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"ListApps failed\"))\n : Right(apps);\n },\n }),\n ),\n }));\n};\n\nexport const setupGetDeviceMetadataMock = (\n metadata: GetDeviceMetadataDAOutput,\n error = false,\n) => {\n (GetDeviceMetadataDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGetDeviceMetadataDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"GetDeviceMetadata failed\"))\n : Right(metadata);\n },\n }),\n ),\n }));\n};\n\nexport const setupInstallOrUpdateAppsMock = (\n result: InstallOrUpdateAppsDAOutput,\n intermediateValue: InstallOrUpdateAppsDAIntermediateValue,\n error = false,\n) => {\n (InstallOrUpdateAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockInstallOrUpdateAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => intermediateValue,\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"InstallOrUpdateApps failed\"))\n : Right(result);\n },\n }),\n ),\n }));\n};\n\nexport const setupOpenAppMock = (error: boolean = false) => {\n (OpenAppDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n initial: \"ready\",\n states: {\n ready: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n }),\n after: {\n 0: \"done\",\n },\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"OpenApp failed\"))\n : Right(undefined);\n },\n }),\n ),\n }));\n};\n\nexport const setupGoToDashboardMock = (error: boolean = false) => {\n (GoToDashboardDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGoToDashboardDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"GoToDashboard failed\"))\n : Right(undefined);\n },\n }),\n ),\n }));\n};\n\nexport const setupGetDeviceStatusMock = (\n outputs: ReadonlyArray<\n { currentApp: string; currentAppVersion: string } | DmkError\n > = [\n {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n ],\n) => {\n const outputFn = vi.fn();\n\n for (const output of outputs) {\n outputFn.mockImplementationOnce(() =>\n \"currentApp\" in output ? Right(output) : Left(output),\n );\n }\n (GetDeviceStatusDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGetDeviceStatusDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: outputFn,\n }),\n ),\n }));\n};\n\nexport const setupListInstalledAppsMock = (\n outputs: Array<{ installedApps: InstalledApp[] } | DmkError> = [],\n) => {\n (ListInstalledAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockListInstalledAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: outputs\n .reduce(\n (mockFn, output) =>\n mockFn.mockImplementationOnce(() =>\n \"installedApps\" in output ? Right(output) : Left(output),\n ),\n vi.fn(),\n )\n .mockImplementation(() => Right([])),\n }),\n ),\n }));\n};\n"],
5
+ "mappings": "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",
6
+ "names": ["setupTestMachine_exports", "__export", "setupGetDeviceMetadataMock", "setupGetDeviceStatusMock", "setupGoToDashboardMock", "setupInstallOrUpdateAppsMock", "setupListAppsMock", "setupListInstalledAppsMock", "setupOpenAppMock", "__toCommonJS", "import_purify_ts", "import_xstate", "import_UserInteractionRequired", "import_Errors", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_OpenAppDeviceAction", "import_ListInstalledAppsDeviceAction", "apps", "error", "metadata", "result", "intermediateValue", "outputs", "outputFn", "output", "mockFn"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var I=(r,t)=>{for(var s in t)o(r,s,{get:t[s],enumerable:!0})},C=(r,t,s,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T(t))!m.call(r,n)&&n!==s&&o(r,n,{get:()=>t[n],enumerable:!(e=A(t,n))||e.enumerable});return r};var d=r=>C(o({},"__esModule",{value:!0}),r);var S={};I(S,{CallTaskInAppDeviceAction:()=>D});module.exports=d(S);var p=require("purify-ts"),a=require("xstate"),l=require("../../../command/model/CommandResult"),i=require("../../../device-action/model/UserInteractionRequired"),c=require("../../../device-action/os/Errors"),u=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),k=require("../../../device-action/xstate-utils/XStateDeviceAction");class D extends k.XStateDeviceAction{makeStateMachine(t){const{callTask:s}=this.extractDependencies(t);return(0,a.setup)({types:{input:{},context:{},output:{}},actors:{callTask:(0,a.fromPromise)(s),openAppStateMachine:new u.OpenAppDeviceAction({input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames}}).makeStateMachine(t)},guards:{noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"CallTaskInAppDeviceAction",initial:"OpenAppDeviceAction",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.None},_internalState:{taskResponse:null,error:null}}),states:{OpenAppDeviceAction:{invoke:{id:"openAppStateMachine",input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames},src:"openAppStateMachine",onSnapshot:{actions:(0,a.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{actions:(0,a.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:n=>({...e.context._internalState,error:n})})}),target:"CheckOpenAppDeviceActionResult"}}},CheckOpenAppDeviceActionResult:{always:[{target:"CallTask",guard:"noInternalError"},"Error"]},CallTask:{entry:(0,a.assign)({intermediateValue:{requiredUserInteraction:this.input.requiredUserInteraction}}),exit:(0,a.assign)({intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.None}}),invoke:{id:"callTask",src:"callTask",input:e=>e.context.input.task,onDone:{target:"CallTaskResultCheck",actions:[(0,a.assign)({_internalState:({event:e,context:n})=>(0,l.isSuccessCommandResult)(e.output)?{...n._internalState,taskResponse:e.output.data}:{...n._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},CallTaskResultCheck:{always:[{target:"Success",guard:"noInternalError"},"Error"]},Success:{type:"final"},Error:{type:"final"}},output:({context:e})=>e._internalState.taskResponse?(0,p.Right)(e._internalState.taskResponse):(0,p.Left)(e._internalState.error||new c.UnknownDAError("No error in final state"))})}extractDependencies(t){return{callTask:s=>s.input(t)}}}0&&(module.exports={CallTaskInAppDeviceAction});
1
+ "use strict";var o=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var I=(r,t)=>{for(var s in t)o(r,s,{get:t[s],enumerable:!0})},C=(r,t,s,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T(t))!m.call(r,n)&&n!==s&&o(r,n,{get:()=>t[n],enumerable:!(e=A(t,n))||e.enumerable});return r};var d=r=>C(o({},"__esModule",{value:!0}),r);var S={};I(S,{CallTaskInAppDeviceAction:()=>D});module.exports=d(S);var p=require("purify-ts"),a=require("xstate"),l=require("../../../command/model/CommandResult"),i=require("../../../device-action/model/UserInteractionRequired"),c=require("../../../device-action/os/Errors"),u=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),k=require("../../../device-action/xstate-utils/XStateDeviceAction");class D extends k.XStateDeviceAction{makeStateMachine(t){const{callTask:s}=this.extractDependencies(t);return(0,a.setup)({types:{input:{},context:{},output:{}},actors:{callTask:(0,a.fromPromise)(s),openAppStateMachine:new u.OpenAppDeviceAction({input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames}}).makeStateMachine(t)},guards:{skipOpenApp:()=>this.input.skipOpenApp,noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"CallTaskInAppDeviceAction",initial:"InitialState",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.None},_internalState:{taskResponse:null,error:null}}),states:{InitialState:{always:[{target:"CallTask",guard:"skipOpenApp"},"OpenAppDeviceAction"]},OpenAppDeviceAction:{invoke:{id:"openAppStateMachine",input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames},src:"openAppStateMachine",onSnapshot:{actions:(0,a.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{actions:(0,a.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:n=>({...e.context._internalState,error:n})})}),target:"CheckOpenAppDeviceActionResult"}}},CheckOpenAppDeviceActionResult:{always:[{target:"CallTask",guard:"noInternalError"},"Error"]},CallTask:{entry:(0,a.assign)({intermediateValue:{requiredUserInteraction:this.input.requiredUserInteraction}}),exit:(0,a.assign)({intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.None}}),invoke:{id:"callTask",src:"callTask",input:e=>e.context.input.task,onDone:{target:"CallTaskResultCheck",actions:[(0,a.assign)({_internalState:({event:e,context:n})=>(0,l.isSuccessCommandResult)(e.output)?{...n._internalState,taskResponse:e.output.data}:{...n._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},CallTaskResultCheck:{always:[{target:"Success",guard:"noInternalError"},"Error"]},Success:{type:"final"},Error:{type:"final"}},output:({context:e})=>e._internalState.taskResponse?(0,p.Right)(e._internalState.taskResponse):(0,p.Left)(e._internalState.error||new c.UnknownDAError("No error in final state"))})}extractDependencies(t){return{callTask:s=>s.input(t)}}}0&&(module.exports={CallTaskInAppDeviceAction});
2
2
  //# sourceMappingURL=CallTaskInAppDeviceAction.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.ts"],
4
- "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport {\n type CommandResult,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\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 CallTaskInAppDAError,\n type CallTaskInAppDAInput,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAInternalState,\n type CallTaskInAppDAOutput,\n} from \"./CallTaskInAppDeviceActionTypes\";\n\n/**\n * Tries to open an app on the device, and if it is successful, calls a task\n * in the app.\n * The output will be the result of the task.\n *\n * ```ts\n * input: {\n * appName: string;\n * task: (internalApi: InternalApi) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n * requiredUserInteraction: UserInteraction;\n * }\n * ```\n *\n * Example of usage:\n *\n * ```ts\n * const deviceAction = new CallTaskInAppDeviceAction({\n * input: {\n * appName: \"MyApp\",\n * task: async (internalApi: InternalApi) => internalApi.sendCommand(new MyAppSpecificCommand()),\n * requiredUserInteraction: UserInteractionRequired.None,\n * },\n * });\n * dmk.executeDeviceAction({ sessionId: \"mySessionId\", deviceAction });\n * ```\n */\nexport class CallTaskInAppDeviceAction<\n TaskResponse,\n TaskErrorCodes,\n UserInteraction extends UserInteractionRequired,\n> extends XStateDeviceAction<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n > {\n type types = StateMachineTypes<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n >;\n\n const { callTask } = this.extractDependencies(internalAPI);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n callTask: fromPromise(callTask),\n openAppStateMachine: new OpenAppDeviceAction({\n input: {\n appName: this.input.appName,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n }).makeStateMachine(internalAPI),\n },\n guards: {\n noInternalError: ({ context }) => context._internalState.error === null,\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 id: \"CallTaskInAppDeviceAction\",\n initial: \"OpenAppDeviceAction\",\n context: ({ input }) => {\n return {\n input: input,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n taskResponse: null,\n error: null,\n },\n };\n },\n states: {\n OpenAppDeviceAction: {\n invoke: {\n id: \"openAppStateMachine\",\n input: {\n appName: this.input.appName,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n src: \"openAppStateMachine\",\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n >({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n target: \"CheckOpenAppDeviceActionResult\",\n },\n },\n },\n CheckOpenAppDeviceActionResult: {\n always: [\n {\n target: \"CallTask\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n CallTask: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: this.input.requiredUserInteraction,\n },\n }),\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n }),\n invoke: {\n id: \"callTask\",\n src: \"callTask\",\n input: (_: { context: types[\"context\"] }) => _.context.input.task,\n onDone: {\n target: \"CallTaskResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n taskResponse: event.output.data,\n };\n }\n return {\n ...context._internalState,\n error: event.output.error,\n };\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n CallTaskResultCheck: {\n always: [\n {\n target: \"Success\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.taskResponse\n ? Right(context._internalState.taskResponse)\n : Left(\n context._internalState.error ||\n new UnknownDAError(\"No error in final state\"),\n ),\n });\n }\n\n extractDependencies(internalApi: InternalApi) {\n return {\n callTask: (_: {\n input: (\n internalApi: InternalApi,\n ) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n }): Promise<CommandResult<TaskResponse, TaskErrorCodes>> =>\n _.input(internalApi),\n };\n }\n}\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport {\n type CommandResult,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\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 CallTaskInAppDAError,\n type CallTaskInAppDAInput,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAInternalState,\n type CallTaskInAppDAOutput,\n} from \"./CallTaskInAppDeviceActionTypes\";\n\n/**\n * Tries to open an app on the device, and if it is successful, calls a task\n * in the app.\n * The output will be the result of the task.\n *\n * ```ts\n * input: {\n * appName: string;\n * task: (internalApi: InternalApi) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n * requiredUserInteraction: UserInteraction;\n * }\n * ```\n *\n * Example of usage:\n *\n * ```ts\n * const deviceAction = new CallTaskInAppDeviceAction({\n * input: {\n * appName: \"MyApp\",\n * task: async (internalApi: InternalApi) => internalApi.sendCommand(new MyAppSpecificCommand()),\n * requiredUserInteraction: UserInteractionRequired.None,\n * },\n * });\n * dmk.executeDeviceAction({ sessionId: \"mySessionId\", deviceAction });\n * ```\n */\nexport class CallTaskInAppDeviceAction<\n TaskResponse,\n TaskErrorCodes,\n UserInteraction extends UserInteractionRequired,\n> extends XStateDeviceAction<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n > {\n type types = StateMachineTypes<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n >;\n\n const { callTask } = this.extractDependencies(internalAPI);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n callTask: fromPromise(callTask),\n openAppStateMachine: new OpenAppDeviceAction({\n input: {\n appName: this.input.appName,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n }).makeStateMachine(internalAPI),\n },\n guards: {\n skipOpenApp: () => this.input.skipOpenApp,\n noInternalError: ({ context }) => context._internalState.error === null,\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 id: \"CallTaskInAppDeviceAction\",\n initial: \"InitialState\",\n context: ({ input }) => {\n return {\n input: input,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n taskResponse: null,\n error: null,\n },\n };\n },\n states: {\n InitialState: {\n always: [\n {\n target: \"CallTask\",\n guard: \"skipOpenApp\",\n },\n \"OpenAppDeviceAction\",\n ],\n },\n OpenAppDeviceAction: {\n invoke: {\n id: \"openAppStateMachine\",\n input: {\n appName: this.input.appName,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n src: \"openAppStateMachine\",\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n >({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n target: \"CheckOpenAppDeviceActionResult\",\n },\n },\n },\n CheckOpenAppDeviceActionResult: {\n always: [\n {\n target: \"CallTask\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n CallTask: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: this.input.requiredUserInteraction,\n },\n }),\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n }),\n invoke: {\n id: \"callTask\",\n src: \"callTask\",\n input: (_: { context: types[\"context\"] }) => _.context.input.task,\n onDone: {\n target: \"CallTaskResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n taskResponse: event.output.data,\n };\n }\n return {\n ...context._internalState,\n error: event.output.error,\n };\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n CallTaskResultCheck: {\n always: [\n {\n target: \"Success\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.taskResponse\n ? Right(context._internalState.taskResponse)\n : Left(\n context._internalState.error ||\n new UnknownDAError(\"No error in final state\"),\n ),\n });\n }\n\n extractDependencies(internalApi: InternalApi) {\n return {\n callTask: (_: {\n input: (\n internalApi: InternalApi,\n ) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n }): Promise<CommandResult<TaskResponse, TaskErrorCodes>> =>\n _.input(internalApi),\n };\n }\n}\n"],
5
+ "mappings": "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",
6
6
  "names": ["CallTaskInAppDeviceAction_exports", "__export", "CallTaskInAppDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_UserInteractionRequired", "import_Errors", "import_OpenAppDeviceAction", "import_XStateDeviceAction", "internalAPI", "callTask", "context", "_", "input", "error", "event", "internalApi"]
7
7
  }