@ledgerhq/device-management-kit 0.0.0-signer-eth-plugin-fix-20250331141239 → 0.0.0-transaction-unfunded-20250917151052

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 (779) hide show
  1. package/README.md +43 -6
  2. package/lib/cjs/package.json +22 -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/apdu/utils/ByteArrayBuilder.js +1 -1
  12. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  13. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  14. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  15. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js +1 -1
  16. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  17. package/lib/cjs/src/api/command/di/commandModule.js +1 -1
  18. package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
  19. package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
  20. package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
  21. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  22. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  23. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  24. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  25. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  26. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  27. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  28. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  29. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
  30. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  31. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  32. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  33. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  34. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  35. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
  36. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  37. package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
  38. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +3 -3
  39. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
  40. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +3 -3
  41. package/lib/cjs/src/api/command/utils/GlobalCommandError.js +1 -1
  42. package/lib/cjs/src/api/command/utils/GlobalCommandError.js.map +2 -2
  43. package/lib/cjs/src/api/device/DeviceModel.js +1 -1
  44. package/lib/cjs/src/api/device/DeviceModel.js.map +2 -2
  45. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  46. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  47. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  48. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  49. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  50. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  51. package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
  52. package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
  53. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
  54. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  55. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +1 -1
  56. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  57. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  58. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  59. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  60. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  61. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -1
  62. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
  63. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  64. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  65. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  66. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  67. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  68. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  69. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +2 -0
  70. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  71. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  72. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  73. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  74. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  75. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  76. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  77. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
  78. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
  79. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  80. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  81. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  82. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  83. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
  84. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  85. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  86. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  87. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  88. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  89. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  90. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +2 -2
  91. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
  92. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +1 -1
  93. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  94. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  95. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  96. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  97. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
  98. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  99. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  100. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  101. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  102. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  103. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
  104. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  105. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  106. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  107. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  108. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  109. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  110. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  111. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  112. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  113. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  114. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  115. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  116. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  117. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  118. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  119. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  120. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  121. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  122. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +2 -2
  123. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  124. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  125. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  126. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  127. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  128. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
  129. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
  130. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  131. package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
  132. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
  133. package/lib/cjs/src/api/index.js +1 -1
  134. package/lib/cjs/src/api/index.js.map +3 -3
  135. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  136. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  137. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +1 -1
  138. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  139. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  140. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +1 -1
  141. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +1 -1
  142. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  143. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  144. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  145. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  146. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  147. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  148. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +1 -1
  149. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +1 -1
  150. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  151. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  152. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  153. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  154. package/lib/cjs/src/api/secure-channel/task/types.js +1 -1
  155. package/lib/cjs/src/api/secure-channel/task/types.js.map +2 -2
  156. package/lib/cjs/src/api/secure-channel/utils.js +1 -1
  157. package/lib/cjs/src/api/secure-channel/utils.js.map +3 -3
  158. package/lib/cjs/src/api/secure-channel/utils.test.js +1 -1
  159. package/lib/cjs/src/api/secure-channel/utils.test.js.map +3 -3
  160. package/lib/cjs/src/api/transport/model/DeviceApduSender.js +2 -0
  161. package/lib/cjs/src/api/transport/model/DeviceApduSender.js.map +7 -0
  162. package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
  163. package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
  164. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  165. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  166. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  167. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  168. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
  169. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  170. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  171. package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
  172. package/lib/cjs/src/api/types.js +1 -1
  173. package/lib/cjs/src/api/types.js.map +1 -1
  174. package/lib/cjs/src/api/utils/AppName.js +2 -0
  175. package/lib/cjs/src/api/utils/AppName.js.map +7 -0
  176. package/lib/cjs/src/api/utils/AppName.test.js +2 -0
  177. package/lib/cjs/src/api/utils/AppName.test.js.map +7 -0
  178. package/lib/cjs/src/api/utils/HexaString.js +1 -1
  179. package/lib/cjs/src/api/utils/HexaString.js.map +3 -3
  180. package/lib/cjs/src/api/utils/HexaString.test.js +1 -1
  181. package/lib/cjs/src/api/utils/HexaString.test.js.map +2 -2
  182. package/lib/cjs/src/di.js +1 -1
  183. package/lib/cjs/src/di.js.map +2 -2
  184. package/lib/cjs/src/internal/config/di/configModule.js +1 -1
  185. package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
  186. package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
  187. package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
  188. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
  189. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  190. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  191. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  192. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
  193. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  194. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
  195. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  196. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  197. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  198. package/lib/cjs/src/internal/device-session/model/DevicePinger.js +1 -1
  199. package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +3 -3
  200. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  201. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  202. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  203. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  204. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  205. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +3 -3
  206. package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
  207. package/lib/cjs/src/internal/device-session/model/Frame.js.map +3 -3
  208. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  209. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  210. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  211. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  212. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  213. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  214. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  215. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  216. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  217. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  218. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  219. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  220. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  221. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  222. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  223. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  224. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  225. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  226. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  227. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  228. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  229. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  230. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  231. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  232. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  233. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  234. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
  235. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  236. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  237. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  238. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  239. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  240. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  241. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  242. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
  243. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  244. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  245. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  246. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  247. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  248. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  249. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  250. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  251. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  252. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js +1 -1
  253. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  254. package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
  255. package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
  256. package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
  257. package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
  258. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  259. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  260. package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
  261. package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
  262. package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
  263. package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
  264. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  265. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  266. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  267. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  268. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
  269. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
  270. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  271. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  272. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  273. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  274. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  275. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  276. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  277. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  278. package/lib/cjs/src/internal/secure-channel/model/Errors.js +1 -1
  279. package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +3 -3
  280. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  281. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  282. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  283. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  284. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +1 -1
  285. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +1 -1
  286. package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
  287. package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
  288. package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
  289. package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
  290. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
  291. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  292. package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
  293. package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
  294. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  295. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  296. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
  297. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  298. package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
  299. package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
  300. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  301. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  302. package/lib/esm/package.json +22 -23
  303. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  304. package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
  305. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  306. package/lib/esm/src/api/DeviceManagementKit.test.js.map +3 -3
  307. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  308. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  309. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  310. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  311. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  312. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  313. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +1 -1
  314. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  315. package/lib/esm/src/api/command/di/commandModule.js +1 -1
  316. package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
  317. package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
  318. package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
  319. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  320. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  321. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  322. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  323. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  324. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  325. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  326. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  327. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
  328. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  329. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  330. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  331. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  332. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  333. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
  334. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  335. package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
  336. package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
  337. package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
  338. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +3 -3
  339. package/lib/esm/src/api/command/utils/GlobalCommandError.js +1 -1
  340. package/lib/esm/src/api/command/utils/GlobalCommandError.js.map +2 -2
  341. package/lib/esm/src/api/device/DeviceModel.js +1 -1
  342. package/lib/esm/src/api/device/DeviceModel.js.map +2 -2
  343. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  344. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  345. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  346. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  347. package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
  348. package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
  349. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
  350. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  351. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +1 -1
  352. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  353. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  354. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  355. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  356. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  357. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  358. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  359. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  360. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  361. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  362. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  363. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  364. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  365. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  366. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  367. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  368. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  369. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  370. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  371. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  372. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  373. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  374. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  375. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  376. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  377. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  378. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  379. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  380. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  381. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  382. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  383. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  384. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  385. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  386. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  387. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  388. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  389. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  390. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  391. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  392. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  393. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  394. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  395. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  396. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  397. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  398. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  399. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  400. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  401. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  402. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  403. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  404. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  405. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  406. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  407. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  408. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  409. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  410. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +2 -2
  411. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  412. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  413. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  414. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  415. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  416. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  417. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  418. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  419. package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
  420. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  421. package/lib/esm/src/api/index.js +1 -1
  422. package/lib/esm/src/api/index.js.map +3 -3
  423. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  424. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  425. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  426. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  427. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  428. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  429. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  430. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  431. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  432. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  433. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  434. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  435. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  436. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  437. package/lib/esm/src/api/secure-channel/task/types.js +1 -1
  438. package/lib/esm/src/api/secure-channel/task/types.js.map +2 -2
  439. package/lib/esm/src/api/secure-channel/utils.js +1 -1
  440. package/lib/esm/src/api/secure-channel/utils.js.map +3 -3
  441. package/lib/esm/src/api/secure-channel/utils.test.js +1 -1
  442. package/lib/esm/src/api/secure-channel/utils.test.js.map +3 -3
  443. package/lib/esm/src/api/transport/model/DeviceApduSender.js +1 -0
  444. package/lib/esm/src/api/transport/model/DeviceApduSender.js.map +7 -0
  445. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  446. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  447. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  448. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  449. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  450. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  451. package/lib/esm/src/api/utils/AppName.js +2 -0
  452. package/lib/esm/src/api/utils/AppName.js.map +7 -0
  453. package/lib/esm/src/api/utils/AppName.test.js +2 -0
  454. package/lib/esm/src/api/utils/AppName.test.js.map +7 -0
  455. package/lib/esm/src/api/utils/HexaString.js +1 -1
  456. package/lib/esm/src/api/utils/HexaString.js.map +3 -3
  457. package/lib/esm/src/api/utils/HexaString.test.js +1 -1
  458. package/lib/esm/src/api/utils/HexaString.test.js.map +2 -2
  459. package/lib/esm/src/di.js +1 -1
  460. package/lib/esm/src/di.js.map +3 -3
  461. package/lib/esm/src/internal/config/di/configModule.js +1 -1
  462. package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
  463. package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
  464. package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
  465. package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
  466. package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  467. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  468. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  469. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
  470. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  471. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
  472. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  473. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  474. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  475. package/lib/esm/src/internal/device-session/model/DevicePinger.js +1 -1
  476. package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +3 -3
  477. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  478. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  479. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  480. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  481. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  482. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +3 -3
  483. package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
  484. package/lib/esm/src/internal/device-session/model/Frame.js.map +3 -3
  485. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  486. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  487. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  488. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  489. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  490. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  491. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  492. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  493. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  494. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  495. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  496. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  497. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  498. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  499. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  500. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  501. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  502. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  503. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  504. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  505. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  506. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  507. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  508. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  509. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  510. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  511. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
  512. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  513. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  514. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  515. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  516. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  517. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  518. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  519. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  520. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  521. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  522. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  523. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  524. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  525. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  526. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  527. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js +1 -1
  528. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  529. package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
  530. package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
  531. package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
  532. package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
  533. package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
  534. package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
  535. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  536. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  537. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  538. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  539. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  540. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  541. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  542. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  543. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  544. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  545. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  546. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  547. package/lib/esm/src/internal/secure-channel/model/Errors.js +1 -1
  548. package/lib/esm/src/internal/secure-channel/model/Errors.js.map +3 -3
  549. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  550. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  551. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  552. package/lib/esm/src/internal/send/di/sendModule.js +1 -1
  553. package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
  554. package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
  555. package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
  556. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
  557. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  558. package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
  559. package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
  560. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  561. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  562. package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
  563. package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  564. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  565. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  566. package/lib/types/src/api/DeviceManagementKit.d.ts +15 -1
  567. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  568. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  569. package/lib/types/src/api/DmkConfig.d.ts +2 -0
  570. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  571. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  572. package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
  573. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +66 -0
  574. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
  575. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +1 -0
  576. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts.map +1 -1
  577. package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
  578. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
  579. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
  580. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
  581. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
  582. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +30 -2
  583. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  584. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
  585. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
  586. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
  587. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
  588. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  589. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
  590. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
  591. package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
  592. package/lib/types/src/api/command/utils/CommandUtils.d.ts +4 -0
  593. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  594. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts +1 -1
  595. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts.map +1 -1
  596. package/lib/types/src/api/device/DeviceModel.d.ts +2 -1
  597. package/lib/types/src/api/device/DeviceModel.d.ts.map +1 -1
  598. package/lib/types/src/api/device-action/DeviceAction.d.ts +3 -1
  599. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  600. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  601. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +5 -0
  602. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  603. package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
  604. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +1 -0
  605. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts.map +1 -1
  606. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
  607. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +1 -1
  608. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  609. package/lib/types/src/api/device-action/os/Errors.d.ts +20 -0
  610. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  611. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts +58 -0
  612. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
  613. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
  614. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
  615. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +28 -0
  616. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
  617. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  618. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
  619. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
  620. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  621. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
  622. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
  623. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
  624. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
  625. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +65 -0
  626. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
  627. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
  628. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +0 -1
  629. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
  630. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
  631. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
  632. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
  633. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
  634. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +24 -0
  635. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
  636. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  637. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -1
  638. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  639. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
  640. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
  641. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
  642. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
  643. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
  644. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
  645. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
  646. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
  647. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
  648. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
  649. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
  650. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
  651. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
  652. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
  653. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
  654. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
  655. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts +1 -0
  656. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts.map +1 -1
  657. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  658. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
  659. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  660. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  661. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +93 -0
  662. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  663. package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
  664. package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
  665. package/lib/types/src/api/index.d.ts +6 -1
  666. package/lib/types/src/api/index.d.ts.map +1 -1
  667. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -1
  668. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +2 -1
  669. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -1
  670. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -1
  671. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +2 -1
  672. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -1
  673. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -1
  674. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +2 -1
  675. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -1
  676. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
  677. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +2 -1
  678. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -1
  679. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +5 -2
  680. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -1
  681. package/lib/types/src/api/secure-channel/task/types.d.ts +6 -1
  682. package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -1
  683. package/lib/types/src/api/secure-channel/utils.d.ts +0 -11
  684. package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -1
  685. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts +17 -0
  686. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts.map +1 -0
  687. package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
  688. package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
  689. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +63 -0
  690. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -0
  691. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts +2 -0
  692. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts.map +1 -0
  693. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +1 -1
  694. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
  695. package/lib/types/src/api/transport/model/Errors.d.ts +27 -3
  696. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  697. package/lib/types/src/api/transport/model/Transport.d.ts +1 -1
  698. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  699. package/lib/types/src/api/types.d.ts +6 -2
  700. package/lib/types/src/api/types.d.ts.map +1 -1
  701. package/lib/types/src/api/utils/AppName.d.ts +2 -0
  702. package/lib/types/src/api/utils/AppName.d.ts.map +1 -0
  703. package/lib/types/src/api/utils/AppName.test.d.ts +2 -0
  704. package/lib/types/src/api/utils/AppName.test.d.ts.map +1 -0
  705. package/lib/types/src/api/utils/HexaString.d.ts +4 -3
  706. package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
  707. package/lib/types/src/di.d.ts.map +1 -1
  708. package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
  709. package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
  710. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
  711. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
  712. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  713. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +1 -1
  714. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -1
  715. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +3 -1
  716. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  717. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  718. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -1
  719. package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
  720. package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.d.ts.map +1 -1
  721. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +3 -1
  722. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
  723. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -1
  724. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  725. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts +1 -1
  726. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -1
  727. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts +1 -1
  728. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
  729. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +4 -2
  730. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
  731. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
  732. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +24 -5
  733. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  734. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +51 -6
  735. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  736. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +104 -18
  737. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
  738. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +7 -0
  739. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  740. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  741. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts +1 -0
  742. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts.map +1 -1
  743. package/lib/types/src/internal/manager-api/model/Application.d.ts +12 -12
  744. package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
  745. package/lib/types/src/internal/manager-api/model/Const.d.ts +2 -0
  746. package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
  747. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +17 -3
  748. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  749. package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
  750. package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
  751. package/lib/types/src/internal/manager-api/model/Params.d.ts +20 -6
  752. package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
  753. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +9 -3
  754. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  755. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +42 -7
  756. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  757. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +13 -0
  758. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -0
  759. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts +2 -0
  760. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts.map +1 -0
  761. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
  762. package/lib/types/src/internal/secure-channel/model/Errors.d.ts +22 -2
  763. package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -1
  764. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +2 -2
  765. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -1
  766. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +3 -3
  767. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -1
  768. package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
  769. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +9 -1
  770. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
  771. package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
  772. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +2 -0
  773. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
  774. package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -1
  775. package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
  776. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +1 -0
  777. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
  778. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  779. package/package.json +18 -19
@@ -1,2 +1,2 @@
1
- import{ApduBuilder as g}from"../../apdu/utils/ApduBuilder";import{ApduParser as u}from"../../apdu/utils/ApduParser";import{CommandResultFactory as s}from"../../command/model/CommandResult";import{CommandUtils as y}from"../../command/utils/CommandUtils";import{GlobalCommandErrorHandler as V}from"../../command/utils/GlobalCommandError";import{DeviceModelId as x}from"../../device/DeviceModel";import{SecureElementFlagsParser as S}from"./SecureElementFlagsParser";class v{args=void 0;getApdu(){const r={cla:224,ins:1,p1:0,p2:0};return new g(r).build()}parseResponse(r,d){if(!y.isSuccessResponse(r))return s({error:V.handle(r)});const e=new u(r),a=parseInt(e.encodeToHexaString(e.extractFieldByLength(4)),16),i=e.encodeToString(e.extractFieldLVEncoded()),o=e.extractFieldLVEncoded()??new Uint8Array(0),m={...new S(o).generalDeviceState()},l=e.encodeToString(e.extractFieldLVEncoded()),c=e.encodeToString(e.extractFieldLVEncoded());let t="00";d===x.NANO_X&&(t=e.encodeToHexaString(e.extractFieldLVEncoded()));const p=e.encodeToHexaString(e.extractFieldLVEncoded()),n=e.encodeToHexaString(e.extractFieldLVEncoded());return s({data:{targetId:a,seVersion:i,seFlags:o,mcuSephVersion:l,mcuBootloaderVersion:c,hwVersion:t,langId:p,recoverState:n||"0",secureElementFlags:m}})}}export{v as GetOsVersionCommand};
1
+ import{coerce as u,gte as s}from"semver";import{ApduBuilder as v}from"../../apdu/utils/ApduBuilder";import{ApduParser as O}from"../../apdu/utils/ApduParser";import{InvalidStatusWordError as b}from"../../command/Errors";import{CommandResultFactory as f}from"../../command/model/CommandResult";import{CommandUtils as F}from"../../command/utils/CommandUtils";import{GlobalCommandErrorHandler as N}from"../../command/utils/GlobalCommandError";import{DeviceModelId as t}from"../../device/DeviceModel";import{SecureElementFlagsParser as E}from"./SecureElementFlagsParser";class P{args=void 0;getApdu(){const r={cla:224,ins:1,p1:0,p2:0};return new v(r).build()}parseResponse(r,n){if(!F.isSuccessResponse(r))return f({error:N.handle(r)});const e=new O(r),d=e.extract32BitUInt();if(d===void 0)return f({error:new b("Missing target ID in OS version")});let a=e.encodeToString(e.extractFieldLVEncoded()),c=e.extractFieldLVEncoded()??new Uint8Array(0);const x={...new E(c).generalDeviceState()};a||(a="0.0.0",c=new Uint8Array);const g=(d&4026531840)!==805306368,I=a.includes("-osu");let i="",S="",m="",p="",y,l,V,A;if(g){m=a,y=d;const o=e.extractFieldLVEncoded();o&&(o.length>=5?(i=e.encodeToString(o),l=parseInt(e.encodeToHexaString(e.extractFieldLVEncoded()),16)):l=parseInt(e.encodeToHexaString(o),16))}else{if(i=a,l=d,S=e.encodeToString(e.extractFieldLVEncoded()),this.isBootloaderVersionSupported(i,n)&&(m=e.encodeToString(e.extractFieldLVEncoded())),this.isHardwareVersionSupported(i,n)?p=e.encodeToHexaString(e.extractFieldLVEncoded()):p="00",this.isLocalizationSupported(i,n)){const o=e.extractFieldLVEncoded();o!==void 0&&(V=parseInt(e.encodeToHexaString(o),16))}if(this.isRecoverSupported(i,n)){const o=e.extractFieldLVEncoded();o!==void 0&&(A=parseInt(e.encodeToHexaString(o),16))}}return f({data:{isBootloader:g,isOsu:I,targetId:d,seTargetId:l,mcuTargetId:y,seVersion:i,seFlags:c,mcuSephVersion:S,mcuBootloaderVersion:m,hwVersion:p,langId:V,recoverState:A,secureElementFlags:x}})}isBootloaderVersionSupported(r,n){const e=u(r)??"";switch(n){case t.NANO_S:case t.NANO_X:return s(e,"2.0.0");default:return!0}}isHardwareVersionSupported(r,n){const e=u(r)??"";switch(n){case t.NANO_X:return s(e,"2.0.0");default:return!1}}isLocalizationSupported(r,n){const e=u(r)??"";switch(n){case t.NANO_S:return!1;case t.NANO_SP:return s(e,"1.1.0");case t.NANO_X:return s(e,"2.1.0");default:return!0}}isRecoverSupported(r,n){const e=u(r)??"";switch(n){case t.NANO_S:return!1;case t.NANO_SP:return s(e,"1.1.2");case t.NANO_X:return s(e,"2.2.3");case t.STAX:return s(e,"1.4.0");case t.FLEX:return s(e,"1.0.1");default:return!0}}}export{P as GetOsVersionCommand};
2
2
  //# sourceMappingURL=GetOsVersionCommand.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/os/GetOsVersionCommand.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 {\n type CommandResult,\n CommandResultFactory,\n} from \"@api/command/model/CommandResult\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { GlobalCommandErrorHandler } from \"@api/command/utils/GlobalCommandError\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport {\n type DeviceGeneralState,\n type EndorsementInformation,\n type OnboardingStatus,\n type WordsInformation,\n} from \"@api/device/SecureElementFlags\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { SecureElementFlagsParser } from \"./SecureElementFlagsParser\";\n\n/**\n * Response of the GetOsVersionCommand.\n */\nexport type GetOsVersionResponse = {\n /**\n * Target identifier.\n */\n readonly targetId: number;\n\n /**\n * Version of BOLOS on the secure element (SE).\n * {@link https://developers.ledger.com/docs/device-app/architecture/bolos/hardware-architecture | Hardware Architecture}\n */\n readonly seVersion: string;\n\n /**\n * Secure element flags.\n * Used to represent the current state of the secure element.\n */\n readonly seFlags: Uint8Array;\n\n /**\n * Version of the microcontroller unit (MCU) SEPH, which is the SE-MCU link protocol.\n * {@link https://developers.ledger.com/docs/device-app/architecture/bolos/hardware-architecture | Hardware Architecture}\n */\n readonly mcuSephVersion: string;\n\n /**\n * Version of the MCU bootloader.\n */\n readonly mcuBootloaderVersion: string;\n\n /**\n * Hardware revision version.\n * Only available for Ledger Nano X in which case it's \"00\" or \"01\".\n */\n readonly hwVersion: string;\n\n /**\n * Identifier of the installed language pack.\n * Can be one of:\n * - \"00\": English\n * - \"01\": French\n * - \"02\": Spanish\n */\n readonly langId: string; // [SHOULD] be an enum\n\n /**\n * State for Ledger Recover. // [SHOULD] Add more information about this field\n */\n readonly recoverState: string;\n\n /**\n * The parsed secure element flags.\n */\n readonly secureElementFlags: DeviceGeneralState &\n EndorsementInformation &\n WordsInformation &\n OnboardingStatus;\n};\n\nexport type GetOsVersionCommandResult = CommandResult<GetOsVersionResponse>;\n\n/**\n * Command to get information about the device firmware.\n */\nexport class GetOsVersionCommand implements Command<GetOsVersionResponse> {\n readonly args = undefined;\n\n getApdu(): Apdu {\n const getOsVersionApduArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x01,\n p1: 0x00,\n p2: 0x00,\n };\n return new ApduBuilder(getOsVersionApduArgs).build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n deviceModelId: DeviceModelId,\n ): GetOsVersionCommandResult {\n if (!CommandUtils.isSuccessResponse(apduResponse)) {\n return CommandResultFactory({\n error: GlobalCommandErrorHandler.handle(apduResponse),\n });\n }\n const parser = new ApduParser(apduResponse);\n\n const targetId = parseInt(\n parser.encodeToHexaString(parser.extractFieldByLength(4)),\n 16,\n );\n const seVersion = parser.encodeToString(parser.extractFieldLVEncoded());\n const seFlags = parser.extractFieldLVEncoded() ?? new Uint8Array(0);\n const seFlagsParser = new SecureElementFlagsParser(seFlags);\n // This is the parsed secure element flags.\n const secureElementFlags = { ...seFlagsParser.generalDeviceState() };\n\n const mcuSephVersion = parser.encodeToString(\n parser.extractFieldLVEncoded(),\n );\n const mcuBootloaderVersion = parser.encodeToString(\n parser.extractFieldLVEncoded(),\n );\n\n let hwVersion = \"00\";\n if (deviceModelId === DeviceModelId.NANO_X) {\n hwVersion = parser.encodeToHexaString(parser.extractFieldLVEncoded());\n }\n\n const langId = parser.encodeToHexaString(parser.extractFieldLVEncoded());\n const recoverState = parser.encodeToHexaString(\n parser.extractFieldLVEncoded(),\n );\n\n return CommandResultFactory({\n data: {\n targetId,\n seVersion,\n seFlags,\n mcuSephVersion,\n mcuBootloaderVersion,\n hwVersion,\n langId,\n recoverState: recoverState ? recoverState : \"0\",\n secureElementFlags,\n },\n });\n }\n}\n"],
5
- "mappings": "AACA,OAAS,eAAAA,MAAyC,8BAClD,OAAS,cAAAC,MAAkB,6BAE3B,OAEE,wBAAAC,MACK,mCACP,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,6BAAAC,MAAiC,wCAC1C,OAAS,iBAAAC,MAAqB,0BAS9B,OAAS,4BAAAC,MAAgC,6BAoElC,MAAMC,CAA6D,CAC/D,KAAO,OAEhB,SAAgB,CACd,MAAMC,EAAwC,CAC5C,IAAK,IACL,IAAK,EACL,GAAI,EACJ,GAAI,CACN,EACA,OAAO,IAAIR,EAAYQ,CAAoB,EAAE,MAAM,CACrD,CAEA,cACEC,EACAC,EAC2B,CAC3B,GAAI,CAACP,EAAa,kBAAkBM,CAAY,EAC9C,OAAOP,EAAqB,CAC1B,MAAOE,EAA0B,OAAOK,CAAY,CACtD,CAAC,EAEH,MAAME,EAAS,IAAIV,EAAWQ,CAAY,EAEpCG,EAAW,SACfD,EAAO,mBAAmBA,EAAO,qBAAqB,CAAC,CAAC,EACxD,EACF,EACME,EAAYF,EAAO,eAAeA,EAAO,sBAAsB,CAAC,EAChEG,EAAUH,EAAO,sBAAsB,GAAK,IAAI,WAAW,CAAC,EAG5DI,EAAqB,CAAE,GAFP,IAAIT,EAAyBQ,CAAO,EAEZ,mBAAmB,CAAE,EAE7DE,EAAiBL,EAAO,eAC5BA,EAAO,sBAAsB,CAC/B,EACMM,EAAuBN,EAAO,eAClCA,EAAO,sBAAsB,CAC/B,EAEA,IAAIO,EAAY,KACZR,IAAkBL,EAAc,SAClCa,EAAYP,EAAO,mBAAmBA,EAAO,sBAAsB,CAAC,GAGtE,MAAMQ,EAASR,EAAO,mBAAmBA,EAAO,sBAAsB,CAAC,EACjES,EAAeT,EAAO,mBAC1BA,EAAO,sBAAsB,CAC/B,EAEA,OAAOT,EAAqB,CAC1B,KAAM,CACJ,SAAAU,EACA,UAAAC,EACA,QAAAC,EACA,eAAAE,EACA,qBAAAC,EACA,UAAAC,EACA,OAAAC,EACA,aAAcC,GAA8B,IAC5C,mBAAAL,CACF,CACF,CAAC,CACH,CACF",
6
- "names": ["ApduBuilder", "ApduParser", "CommandResultFactory", "CommandUtils", "GlobalCommandErrorHandler", "DeviceModelId", "SecureElementFlagsParser", "GetOsVersionCommand", "getOsVersionApduArgs", "apduResponse", "deviceModelId", "parser", "targetId", "seVersion", "seFlags", "secureElementFlags", "mcuSephVersion", "mcuBootloaderVersion", "hwVersion", "langId", "recoverState"]
4
+ "sourcesContent": ["import { coerce, gte } from \"semver\";\n\nimport { 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 { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { GlobalCommandErrorHandler } from \"@api/command/utils/GlobalCommandError\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport {\n type DeviceGeneralState,\n type EndorsementInformation,\n type OnboardingStatus,\n type WordsInformation,\n} from \"@api/device/SecureElementFlags\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { SecureElementFlagsParser } from \"./SecureElementFlagsParser\";\n\n/**\n * Response of the GetOsVersionCommand.\n */\nexport type GetOsVersionResponse = {\n /**\n * Indicated if the device is running in bootloader mode.\n * It can happens during a firmware update process.\n */\n readonly isBootloader: boolean;\n\n /**\n * Indicated if the device firmware is an OS Updater (OSU).\n * It can happens during a firmware update process.\n */\n readonly isOsu: boolean;\n\n /**\n * Target identifier.\n */\n readonly targetId: number;\n\n /**\n * Target identifier of the secure element.\n * Not always available when the device is in bootloader mode.\n */\n readonly seTargetId: number | undefined;\n\n /**\n * Target identifier of the microcontroller unit (MCU).\n * Only available when the device is in bootloader mode.\n */\n readonly mcuTargetId: number | undefined;\n\n /**\n * Version of BOLOS on the secure element (SE).\n * {@link https://developers.ledger.com/docs/device-app/architecture/bolos/hardware-architecture | Hardware Architecture}\n */\n readonly seVersion: string;\n\n /**\n * Secure element flags.\n * Used to represent the current state of the secure element.\n */\n readonly seFlags: Uint8Array;\n\n /**\n * Version of the microcontroller unit (MCU) SEPH, which is the SE-MCU link protocol.\n * {@link https://developers.ledger.com/docs/device-app/architecture/bolos/hardware-architecture | Hardware Architecture}\n */\n readonly mcuSephVersion: string;\n\n /**\n * Version of the MCU bootloader.\n */\n readonly mcuBootloaderVersion: string;\n\n /**\n * Hardware revision version.\n * Only available for Ledger Nano X in which case it's \"00\" or \"01\".\n */\n readonly hwVersion: string;\n\n /**\n * Identifier of the installed language pack.\n * Can be one of:\n * - \"00\": English\n * - \"01\": French\n * - \"02\": Spanish\n * - \"03\": Portuguese\n * - \"04\": German\n * - \"05\": Russian\n * - \"06\": Turkish\n */\n readonly langId: number | undefined;\n\n /**\n * State for Ledger Recover. // [SHOULD] Add more information about this field\n */\n readonly recoverState: number | undefined;\n\n /**\n * The parsed secure element flags.\n */\n readonly secureElementFlags: DeviceGeneralState &\n EndorsementInformation &\n WordsInformation &\n OnboardingStatus;\n};\n\nexport type GetOsVersionCommandResult = CommandResult<GetOsVersionResponse>;\n\n/**\n * Command to get information about the device firmware.\n */\nexport class GetOsVersionCommand implements Command<GetOsVersionResponse> {\n readonly args = undefined;\n\n getApdu(): Apdu {\n const getOsVersionApduArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x01,\n p1: 0x00,\n p2: 0x00,\n };\n return new ApduBuilder(getOsVersionApduArgs).build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n deviceModelId: DeviceModelId,\n ): GetOsVersionCommandResult {\n if (!CommandUtils.isSuccessResponse(apduResponse)) {\n return CommandResultFactory({\n error: GlobalCommandErrorHandler.handle(apduResponse),\n });\n }\n const parser = new ApduParser(apduResponse);\n const targetId = parser.extract32BitUInt();\n if (targetId === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Missing target ID in OS version\"),\n });\n }\n\n let version = parser.encodeToString(parser.extractFieldLVEncoded());\n let seFlags = parser.extractFieldLVEncoded() ?? new Uint8Array(0);\n const seFlagsParser = new SecureElementFlagsParser(seFlags);\n // This is the parsed secure element flags.\n const secureElementFlags = { ...seFlagsParser.generalDeviceState() };\n\n // Handle old firmwares with no version\n if (!version) {\n version = \"0.0.0\";\n seFlags = new Uint8Array();\n }\n\n const isBootloader = (targetId & 0xf0000000) !== 0x30000000;\n const isOsu = version.includes(\"-osu\");\n let seVersion: string = \"\";\n let mcuSephVersion: string = \"\";\n let mcuBootloaderVersion: string = \"\";\n let hwVersion: string = \"\";\n let mcuTargetId: number | undefined = undefined;\n let seTargetId: number | undefined = undefined;\n let langId: number | undefined = undefined;\n let recoverState: number | undefined = undefined;\n\n if (isBootloader) {\n mcuBootloaderVersion = version;\n mcuTargetId = targetId;\n\n const seData = parser.extractFieldLVEncoded();\n if (seData) {\n if (seData.length >= 5) {\n // It means it's a version followed by the seTargetId\n seVersion = parser.encodeToString(seData);\n seTargetId = parseInt(\n parser.encodeToHexaString(parser.extractFieldLVEncoded()),\n 16,\n );\n } else {\n // It's the seTargetId\n seTargetId = parseInt(parser.encodeToHexaString(seData), 16);\n }\n }\n } else {\n seVersion = version;\n seTargetId = targetId;\n\n mcuSephVersion = parser.encodeToString(parser.extractFieldLVEncoded());\n\n if (this.isBootloaderVersionSupported(seVersion, deviceModelId)) {\n mcuBootloaderVersion = parser.encodeToString(\n parser.extractFieldLVEncoded(),\n );\n }\n\n if (this.isHardwareVersionSupported(seVersion, deviceModelId)) {\n hwVersion = parser.encodeToHexaString(parser.extractFieldLVEncoded());\n } else {\n hwVersion = \"00\";\n }\n\n if (this.isLocalizationSupported(seVersion, deviceModelId)) {\n const langIdBuffer = parser.extractFieldLVEncoded();\n if (langIdBuffer !== undefined) {\n langId = parseInt(parser.encodeToHexaString(langIdBuffer), 16);\n }\n }\n\n if (this.isRecoverSupported(seVersion, deviceModelId)) {\n const recoverStateBuffer = parser.extractFieldLVEncoded();\n if (recoverStateBuffer !== undefined) {\n recoverState = parseInt(\n parser.encodeToHexaString(recoverStateBuffer),\n 16,\n );\n }\n }\n }\n\n return CommandResultFactory({\n data: {\n isBootloader,\n isOsu,\n targetId,\n seTargetId,\n mcuTargetId,\n seVersion,\n seFlags,\n mcuSephVersion,\n mcuBootloaderVersion,\n hwVersion,\n langId,\n recoverState,\n secureElementFlags,\n },\n });\n }\n\n private isBootloaderVersionSupported(\n seVersion: string,\n deviceModelId: DeviceModelId,\n ): boolean {\n const version = coerce(seVersion) ?? \"\";\n switch (deviceModelId) {\n case DeviceModelId.NANO_S:\n case DeviceModelId.NANO_X:\n return gte(version, \"2.0.0\");\n default:\n return true;\n }\n }\n\n private isHardwareVersionSupported(\n seVersion: string,\n deviceModelId: DeviceModelId,\n ): boolean {\n const version = coerce(seVersion) ?? \"\";\n switch (deviceModelId) {\n case DeviceModelId.NANO_X:\n return gte(version, \"2.0.0\");\n default:\n return false;\n }\n }\n\n private isLocalizationSupported(\n seVersion: string,\n deviceModelId: DeviceModelId,\n ): boolean {\n const version = coerce(seVersion) ?? \"\";\n switch (deviceModelId) {\n case DeviceModelId.NANO_S:\n return false;\n case DeviceModelId.NANO_SP:\n return gte(version, \"1.1.0\");\n case DeviceModelId.NANO_X:\n return gte(version, \"2.1.0\");\n default:\n return true;\n }\n }\n\n private isRecoverSupported(\n seVersion: string,\n deviceModelId: DeviceModelId,\n ): boolean {\n const version = coerce(seVersion) ?? \"\";\n switch (deviceModelId) {\n case DeviceModelId.NANO_S:\n return false;\n case DeviceModelId.NANO_SP:\n return gte(version, \"1.1.2\");\n case DeviceModelId.NANO_X:\n return gte(version, \"2.2.3\");\n case DeviceModelId.STAX:\n return gte(version, \"1.4.0\");\n case DeviceModelId.FLEX:\n return gte(version, \"1.0.1\");\n default:\n return true;\n }\n }\n}\n"],
5
+ "mappings": "AAAA,OAAS,UAAAA,EAAQ,OAAAC,MAAW,SAG5B,OAAS,eAAAC,MAAyC,8BAClD,OAAS,cAAAC,MAAkB,6BAE3B,OAAS,0BAAAC,MAA8B,sBACvC,OAEE,wBAAAC,MACK,mCACP,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,6BAAAC,MAAiC,wCAC1C,OAAS,iBAAAC,MAAqB,0BAS9B,OAAS,4BAAAC,MAAgC,6BAgGlC,MAAMC,CAA6D,CAC/D,KAAO,OAEhB,SAAgB,CACd,MAAMC,EAAwC,CAC5C,IAAK,IACL,IAAK,EACL,GAAI,EACJ,GAAI,CACN,EACA,OAAO,IAAIT,EAAYS,CAAoB,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,EAAe,CACrB,KAAKL,EAAc,OACjB,MAAO,GACT,KAAKA,EAAc,QACjB,OAAOP,EAAIe,EAAS,OAAO,EAC7B,KAAKR,EAAc,OACjB,OAAOP,EAAIe,EAAS,OAAO,EAC7B,KAAKR,EAAc,KACjB,OAAOP,EAAIe,EAAS,OAAO,EAC7B,KAAKR,EAAc,KACjB,OAAOP,EAAIe,EAAS,OAAO,EAC7B,QACE,MAAO,EACX,CACF,CACF",
6
+ "names": ["coerce", "gte", "ApduBuilder", "ApduParser", "InvalidStatusWordError", "CommandResultFactory", "CommandUtils", "GlobalCommandErrorHandler", "DeviceModelId", "SecureElementFlagsParser", "GetOsVersionCommand", "getOsVersionApduArgs", "apduResponse", "deviceModelId", "parser", "targetId", "version", "seFlags", "secureElementFlags", "isBootloader", "isOsu", "seVersion", "mcuSephVersion", "mcuBootloaderVersion", "hwVersion", "mcuTargetId", "seTargetId", "langId", "recoverState", "seData", "langIdBuffer", "recoverStateBuffer"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{CommandResultFactory as o,isSuccessCommandResult as a}from"../../command/model/CommandResult";import{DeviceModelId as s}from"../../device/DeviceModel";import{ApduResponse as r}from"../../device-session/ApduResponse";import{getOsVersionCommandResponseMockBuilder as n}from"./__mocks__/GetOsVersionCommand";import{GetOsVersionCommand as d}from"./GetOsVersionCommand";const c=Uint8Array.from([224,1,0,0,0]),p=Uint8Array.from([51,0,0,4,5,50,46,50,46,51,4,230,0,0,0,4,50,46,51,48,4,49,46,49,54,1,0,1,0,1,0,144,0]),i=new r({statusCode:Uint8Array.from([144,0]),data:p}),m=Uint8Array.from([51,16,0,4,5,49,46,49,46,49,4,230,0,0,0,4,52,46,48,51,4,51,46,49,50,1,0,1,0,144,0]),S=new r({statusCode:Uint8Array.from([144,0]),data:m}),A=Uint8Array.from([51,32,0,4,5,49,46,51,46,48,4,230,0,0,0,4,53,46,50,52,4,48,46,52,56,1,0,1,0,144,0]),O=new r({statusCode:Uint8Array.from([144,0]),data:A});describe("GetOsVersionCommand",()=>{let t;beforeEach(()=>{t=new d}),describe("getApdu",()=>{it("should return the GetOsVersion apdu",()=>{const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(c)})}),describe("parseResponse",()=>{describe("Nano X",()=>{it("should parse the LNX response",()=>{const e=t.parseResponse(i,s.NANO_X),x=o({data:n(s.NANO_X)});expect(e).toStrictEqual(x)})}),describe("Nano S Plus",()=>{it("should parse the LNSP response",()=>{const e=t.parseResponse(S,s.NANO_SP),x=o({data:n(s.NANO_SP)});expect(e).toStrictEqual(x)})}),describe("Stax",()=>{it("should parse the STAX response",()=>{const e=t.parseResponse(O,s.STAX),x=o({data:n(s.STAX)});expect(e).toStrictEqual(x)})}),describe("Error handling",()=>{it("should return an error if the response is not successful",()=>{const e=new r({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])}),x=t.parseResponse(e,s.NANO_S);expect(a(x)).toBeFalsy()})})})});
1
+ import{CommandResultFactory as o,isSuccessCommandResult as n}from"../../command/model/CommandResult";import{DeviceModelId as t}from"../../device/DeviceModel";import{ApduResponse as r}from"../../device-session/ApduResponse";import{getOsVersionCommandResponseMockBuilder as a}from"./__mocks__/GetOsVersionCommand";import{GetOsVersionCommand as d}from"./GetOsVersionCommand";const i=Uint8Array.from([224,1,0,0,0]),c=Uint8Array.from([51,0,0,4,5,50,46,50,46,51,4,230,0,0,0,4,50,46,51,48,4,49,46,49,54,1,0,1,0,1,0,144,0]),u=new r({statusCode:Uint8Array.from([144,0]),data:c}),l=Uint8Array.from([51,16,0,4,5,49,46,49,46,49,4,230,0,0,0,4,52,46,48,51,4,51,46,49,50,1,0,1,0,144,0]),p=new r({statusCode:Uint8Array.from([144,0]),data:l}),S=Uint8Array.from([51,32,0,4,5,49,46,51,46,48,4,230,0,0,0,4,53,46,50,52,4,48,46,52,56,1,0,1,0,144,0]),m=new r({statusCode:Uint8Array.from([144,0]),data:S}),O=Uint8Array.from([5,1,0,3,4,49,46,49,54,4,244,216,170,67,5,50,46,50,46,51,4,51,0,0,4,144,0]),A=new r({statusCode:Uint8Array.from([144,0]),data:O}),f=Uint8Array.from([51,0,0,4,0,4,238,0,0,0,4,50,46,51,48,1,1,1,0,1,0,144,0]),_=new r({statusCode:Uint8Array.from([144,0]),data:f});describe("GetOsVersionCommand",()=>{let s;beforeEach(()=>{s=new d}),describe("getApdu",()=>{it("should return the GetOsVersion apdu",()=>{const e=s.getApdu();expect(e.getRawApdu()).toStrictEqual(i)})}),describe("parseResponse",()=>{describe("Nano X",()=>{it("should parse the LNX response",()=>{const e=s.parseResponse(u,t.NANO_X),x=o({data:a(t.NANO_X)});expect(e).toStrictEqual(x)})}),describe("Nano S Plus",()=>{it("should parse the LNSP response",()=>{const e=s.parseResponse(p,t.NANO_SP),x=o({data:a(t.NANO_SP)});expect(e).toStrictEqual(x)})}),describe("Stax",()=>{it("should parse the STAX response",()=>{const e=s.parseResponse(m,t.STAX),x=o({data:a(t.STAX)});expect(e).toStrictEqual(x)})}),describe("Bootloader",()=>{it("should parse the bootloader response",()=>{const e=s.parseResponse(A,t.STAX),x=o({data:{isBootloader:!0,isOsu:!1,targetId:83951619,seTargetId:855638020,seVersion:"2.2.3",seFlags:new Uint8Array([244,216,170,67]),mcuTargetId:83951619,mcuSephVersion:"",mcuBootloaderVersion:"1.16",hwVersion:"",langId:void 0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!0,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!1,isInRecoveryMode:!1}}});expect(e).toStrictEqual(x)})}),describe("Old firmware",()=>{it("should parse the old firmware response",()=>{const e=s.parseResponse(_,t.NANO_X),x=o({data:{isBootloader:!1,isOsu:!1,targetId:855638020,seTargetId:855638020,seVersion:"0.0.0",seFlags:new Uint8Array,mcuTargetId:void 0,mcuSephVersion:"2.30",mcuBootloaderVersion:"",hwVersion:"00",langId:void 0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!0,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1}}});expect(e).toStrictEqual(x)})}),describe("Error handling",()=>{it("should return an error if the response is not successful",()=>{const e=new r({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])}),x=s.parseResponse(e,t.NANO_S);expect(n(x)).toBeFalsy()})})})});
2
2
  //# sourceMappingURL=GetOsVersionCommand.test.js.map
@@ -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": "AAAA,OACE,wBAAAA,EACA,0BAAAC,MACK,mCACP,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,gBAAAC,MAAoB,mCAE7B,OAAS,0CAAAC,MAA8C,kCACvD,OAAS,uBAAAC,MAA2B,wBAEpC,MAAMC,EAAsB,WAAW,KAAK,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,EAEpEC,EAAyB,WAAW,KAAK,CAC7C,GAAM,EAAM,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,GAAM,EAAM,IAAM,EACxE,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EACxE,EAAM,EAAM,EAAM,EAAM,EAAM,IAAM,CACtC,CAAC,EACKC,EAAoB,IAAIL,EAAa,CACzC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAMI,CACR,CAAC,EAEKE,EAAyB,WAAW,KAAK,CAC7C,GAAM,GAAM,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,GAAM,EAAM,IAAM,EACxE,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EACxE,EAAM,EAAM,EAAM,IAAM,CAC1B,CAAC,EACKC,EAAqB,IAAIP,EAAa,CAC1C,WAAY,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,EAEMc,EAAWhB,EAAqB,CACpC,KAAMI,EAAuCF,EAAc,IAAI,CACjE,CAAC,EAED,OAAOa,CAAM,EAAE,cAAcC,CAAQ,CACvC,CAAC,CACH,CAAC,EAED,SAAS,iBAAkB,IAAM,CAC/B,GAAG,2DAA4D,IAAM,CACnE,MAAMC,EAAW,IAAId,EAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EACKe,EAASL,EAAQ,cAAcI,EAAUf,EAAc,MAAM,EAEnE,OAAOD,EAAuBiB,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["CommandResultFactory", "isSuccessCommandResult", "DeviceModelId", "ApduResponse", "getOsVersionCommandResponseMockBuilder", "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": "AAAA,OACE,wBAAAA,EACA,0BAAAC,MACK,mCACP,OAAS,iBAAAC,MAA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AED,OAAOmB,CAAM,EAAE,cAAcC,CAAQ,CACvC,CAAC,CACH,CAAC,EAED,SAAS,iBAAkB,IAAM,CAC/B,GAAG,2DAA4D,IAAM,CACnE,MAAMC,EAAW,IAAIlB,EAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EACKmB,EAASL,EAAQ,cAAcI,EAAUnB,EAAc,MAAM,EAEnE,OAAOD,EAAuBqB,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["CommandResultFactory", "isSuccessCommandResult", "DeviceModelId", "ApduResponse", "getOsVersionCommandResponseMockBuilder", "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
+ import{ApduBuilder as p}from"../../apdu/utils/ApduBuilder";import{ApduParser as c}from"../../apdu/utils/ApduParser";import{InvalidStatusWordError as s}from"../../command/Errors";import{CommandResultFactory as o}from"../../command/model/CommandResult";import{isCommandErrorCode as L}from"../../command/utils/CommandErrors";import{CommandUtils as C}from"../../command/utils/CommandUtils";import{GlobalCommandErrorHandler as l}from"../../command/utils/GlobalCommandError";import{DeviceExchangeError as f}from"../../Error";import{bufferToHexaString as d}from"../../utils/HexaString";const i={"662d":{message:"Invalid LIST_ARG, first command must be sent with P1_LIST_LANGUAGE_PACKS_FIRST."}};class A extends f{constructor({message:r,errorCode:e}){super({message:r,errorCode:e,tag:"ListLanguagePackCommandError"})}}class _{constructor(r){this.args=r}getApdu(){const r={cla:224,ins:52,p1:this.args.firstChunk?0:1,p2:0};return new p(r).build()}parseResponse(r){const e=new c(r);if(!C.isSuccessResponse(r)){const a=e.encodeToHexaString(r.statusCode);return L(a,i)?o({error:new A({...i[a],errorCode:a})}):o({error:l.handle(r)})}if(e.extract8BitUInt()===void 0)return o({data:void 0});e.extract8BitUInt();const t=e.extractFieldLVEncoded();if(t===void 0)return o({error:new s("Failed to get language pack id")});const n=e.extractFieldLVEncoded();if(n===void 0)return o({error:new s("Failed to get language pack size")});const u=parseInt(d(t),16),g=parseInt(d(n),16);return o({data:{id:u,size:g}})}}export{_ as ListLanguagePackCommand,A as 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": "AACA,OAAS,eAAAA,MAAyC,8BAClD,OAAS,cAAAC,MAAkB,6BAE3B,OAAS,0BAAAC,MAA8B,sBACvC,OAEE,wBAAAC,MACK,mCACP,OAEE,sBAAAC,MACK,mCACP,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,6BAAAC,MAAiC,wCAE1C,OAAgC,uBAAAC,MAA2B,aAC3D,OAAS,sBAAAC,MAA0B,wBAenC,MAAMC,EAAkE,CACtE,OAAQ,CACN,QACE,iFACJ,CACF,EAOO,MAAMC,UAAqCH,CAAgD,CAChG,YAAY,CACV,QAAAI,EACA,UAAAC,CACF,EAAiD,CAC/C,MAAM,CAAE,QAAAD,EAAS,UAAAC,EAAW,IAAK,8BAA+B,CAAC,CACnE,CACF,CAEO,MAAMC,CAOb,CACE,YAAoBC,EAAmC,CAAnC,UAAAA,CAAoC,CAExD,SAAgB,CACd,MAAMC,EAA4B,CAChC,IAAK,IACL,IAAK,GACL,GAAI,KAAK,KAAK,WAAa,EAAO,EAClC,GAAI,CACN,EACA,OAAO,IAAIf,EAAYe,CAAQ,EAAE,MAAM,CACzC,CAEA,cAAcC,EAA2D,CACvE,MAAMC,EAAS,IAAIhB,EAAWe,CAAY,EAE1C,GAAI,CAACX,EAAa,kBAAkBW,CAAY,EAAG,CACjD,MAAMJ,EAAYK,EAAO,mBAAmBD,EAAa,UAAU,EACnE,OAAIZ,EAAmBQ,EAAWH,CAAoB,EAC7CN,EAAqB,CAC1B,MAAO,IAAIO,EAA6B,CACtC,GAAGD,EAAqBG,CAAS,EACjC,UAAAA,CACF,CAAC,CACH,CAAC,EAEIT,EAAqB,CAC1B,MAAOG,EAA0B,OAAOU,CAAY,CACtD,CAAC,CACH,CAGA,GADmBC,EAAO,gBAAgB,IACvB,OAEjB,OAAOd,EAAqB,CAC1B,KAAM,MACR,CAAC,EAGHc,EAAO,gBAAgB,EACvB,MAAMC,EAAWD,EAAO,sBAAsB,EAC9C,GAAIC,IAAa,OACf,OAAOf,EAAqB,CAC1B,MAAO,IAAID,EAAuB,gCAAgC,CACpE,CAAC,EAGH,MAAMiB,EAAaF,EAAO,sBAAsB,EAChD,GAAIE,IAAe,OACjB,OAAOhB,EAAqB,CAC1B,MAAO,IAAID,EAAuB,kCAAkC,CACtE,CAAC,EAGH,MAAMkB,EAAK,SAASZ,EAAmBU,CAAQ,EAAG,EAAE,EAC9CG,EAAO,SAASb,EAAmBW,CAAU,EAAG,EAAE,EACxD,OAAOhB,EAAqB,CAC1B,KAAM,CAAE,GAAAiB,EAAI,KAAAC,CAAK,CACnB,CAAC,CACH,CACF",
6
+ "names": ["ApduBuilder", "ApduParser", "InvalidStatusWordError", "CommandResultFactory", "isCommandErrorCode", "CommandUtils", "GlobalCommandErrorHandler", "DeviceExchangeError", "bufferToHexaString", "LANGUAGE_PACK_ERRORS", "ListLanguagePackCommandError", "message", "errorCode", "ListLanguagePackCommand", "args", "apduArgs", "apduResponse", "parser", "idBuffer", "sizeBuffer", "id", "size"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{InvalidStatusWordError as a}from"../../command/Errors";import{CommandResultFactory as r}from"../../command/model/CommandResult";import{isSuccessCommandResult as u}from"../../command/model/CommandResult";import{ListLanguagePackCommand as o}from"../../command/os/ListLanguagePackCommand";import{ApduResponse as n}from"../../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({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({firstChunk:!1});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(d)}),it("should parse result successfully",()=>{const e=new n({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(r({data:{id:1,size:20480}}))}),it("should parse empty result successfully",()=>{const e=new n({statusCode:new Uint8Array([144,0]),data:new Uint8Array([])}),s=t.parseResponse(e);expect(s).toStrictEqual(r({data:void 0}))}),it("should fail on invalid id",()=>{const e=new n({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15])}),s=t.parseResponse(e);expect(s).toStrictEqual(r({error:new a("Failed to get language pack id")}))}),it("should fail on invalid size",()=>{const e=new n({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15,1,1])}),s=t.parseResponse(e);expect(s).toStrictEqual(r({error:new a("Failed to get language pack size")}))}),it("should fail on device error",()=>{const e=new n({statusCode:new Uint8Array([102,45]),data:new Uint8Array([])}),s=t.parseResponse(e);expect(u(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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IAAIL,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EACKM,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,cACbT,EAAqB,CACnB,KAAM,MACR,CAAC,CACH,CACF,CAAC,EAED,GAAG,4BAA6B,IAAM,CACpC,MAAMQ,EAAyB,IAAIL,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,EAAI,CAAC,CACnC,CAAC,EACKM,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,cACbT,EAAqB,CACnB,MAAO,IAAID,EAAuB,gCAAgC,CACpE,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMS,EAAyB,IAAIL,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,GAAM,EAAM,CAAI,CAAC,CAC/C,CAAC,EACKM,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,cACbT,EAAqB,CACnB,MAAO,IAAID,EAAuB,kCAAkC,CACtE,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMS,EAAyB,IAAIL,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,EAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EACKM,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOP,EAAuBQ,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC",
6
+ "names": ["InvalidStatusWordError", "CommandResultFactory", "isSuccessCommandResult", "ListLanguagePackCommand", "ApduResponse", "LIST_LANGUAGE_PACK_APDU", "LIST_LANGUAGE_PACK_CONTINUE_APDU", "command", "apdu", "response", "result"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{DeviceModelId as e}from"../../../device/DeviceModel";const o=(s=e.NANO_SP,r={})=>({[e.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},...r},[e.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},...r},[e.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}},[e.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},...r},[e.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},...r}})[s];export{o as getOsVersionCommandResponseMockBuilder};
1
+ import{DeviceModelId as e}from"../../../device/DeviceModel";const o=(r=e.NANO_SP,s={})=>({[e.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},...s},[e.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},...s},[e.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}},[e.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},...s},[e.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},...s},[e.APEX]:{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}}})[r];export{o as 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": "AACA,OAAS,iBAAAA,MAAqB,0BAEvB,MAAMC,EAAyC,CACpDC,EAA+BF,EAAc,QAC7CG,EAAuC,CAAC,KAEvC,CACC,CAACH,EAAc,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,GAAGG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,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGG,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.APEX]: {\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 },\n })[deviceModelId];\n"],
5
+ "mappings": "AACA,OAAS,iBAAAA,MAAqB,0BAEvB,MAAMC,EAAyC,CACpDC,EAA+BF,EAAc,QAC7CG,EAAuC,CAAC,KAEvC,CACC,CAACH,EAAc,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,GAAGG,CACL,EACA,CAACH,EAAc,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,GAAGG,CACL,EACA,CAACH,EAAc,MAAM,EAAG,CACtB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IA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AChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,CACF,CACF,GAAGE,CAAa",
6
6
  "names": ["DeviceModelId", "getOsVersionCommandResponseMockBuilder", "deviceModelId", "props"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var S=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var g=(i,r,s,o)=>{for(var e=o>1?void 0:o?v(r,s):r,n=i.length-1,c;n>=0;n--)(c=i[n])&&(e=(o?c(r,s,e):c(e))||e);return o&&e&&S(r,s,e),e},a=(i,r)=>(s,o)=>r(s,o,i);import{inject as m,injectable as d}from"inversify";import{deviceSessionTypes as p}from"../../../internal/device-session/di/deviceSessionTypes";import{loggerTypes as l}from"../../../internal/logger-publisher/di/loggerTypes";let t=class{_sessionService;_logger;constructor(r,s){this._sessionService=r,this._logger=s("SendCommandUseCase")}async execute({sessionId:r,command:s}){return this._sessionService.getDeviceSessionById(r).caseOf({Right:async e=>await e.sendCommand(s),Left:e=>{throw this._logger.error("Error getting session",{data:{error:e}}),e}})}};t=g([d(),a(0,m(p.DeviceSessionService)),a(1,m(l.LoggerPublisherServiceFactory))],t);export{t as SendCommandUseCase};
1
+ var S=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var g=(t,e,r,s)=>{for(var o=s>1?void 0:s?d(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=(s?c(e,r,o):c(o))||o);return s&&o&&S(e,r,o),o},a=(t,e)=>(r,s)=>e(r,s,t);import{inject as m,injectable as v}from"inversify";import{deviceSessionTypes as p}from"../../../internal/device-session/di/deviceSessionTypes";import{loggerTypes as l}from"../../../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:s}){return this._sessionService.getDeviceSessionById(e).caseOf({Right:async i=>await i.sendCommand(r,s),Left:i=>{throw this._logger.error("Error getting session",{data:{error:i}}),i}})}};n=g([v(),a(0,m(p.DeviceSessionService)),a(1,m(l.LoggerPublisherServiceFactory))],n);export{n as 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": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAKnC,OAAS,sBAAAC,MAA0B,iDAEnC,OAAS,eAAAC,MAAmB,4CAiBrB,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,CADNC,EAAW,EAKPC,EAAA,EAAAC,EAAOC,EAAmB,oBAAoB,GAE9CF,EAAA,EAAAC,EAAOE,EAAY,6BAA6B,IANxCZ",
6
- "names": ["inject", "injectable", "deviceSessionTypes", "loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "deviceSession", "error", "__decorateClass", "injectable", "__decorateParam", "inject", "deviceSessionTypes", "loggerTypes"]
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": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAKnC,OAAS,sBAAAC,MAA0B,iDAEnC,OAAS,eAAAC,MAAmB,4CAqBrB,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,CADNC,EAAW,EAKPC,EAAA,EAAAC,EAAOC,EAAmB,oBAAoB,GAE9CF,EAAA,EAAAC,EAAOE,EAAY,6BAA6B,IANxCb",
6
+ "names": ["inject", "injectable", "deviceSessionTypes", "loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "abortTimeout", "deviceSession", "error", "__decorateClass", "injectable", "__decorateParam", "inject", "deviceSessionTypes", "loggerTypes"]
7
7
  }
@@ -1,2 +1,2 @@
1
- class s{static isValidStatusCode(e){return e.length===2}static isSuccessResponse({statusCode:e}){return s.isValidStatusCode(e)?e[0]===144&&e[1]===0:!1}static isLockedDeviceResponse({statusCode:e}){return s.isValidStatusCode(e)?e[0]===85&&e[1]===21:!1}}export{s as CommandUtils};
1
+ class e{static isValidStatusCode(r){return r.length===2}static isSuccessResponse({statusCode:r}){return e.isValidStatusCode(r)?r[0]===144&&r[1]===0:!1}static isLockedDeviceResponse({statusCode:r}){return e.isValidStatusCode(r)?r[0]===85&&r[1]===21||r[0]===105&&r[1]===130||r[0]===83&&r[1]===3:!1}static isRefusedByUser({statusCode:r}){return e.isValidStatusCode(r)?r[0]===85&&r[1]===1||r[0]===105&&r[1]===133:!1}static isAppAlreadyInstalled({statusCode:r}){return e.isValidStatusCode(r)?r[0]===106&&r[1]===128||r[0]===106&&r[1]===129||r[0]===106&&r[1]===142||r[0]===106&&r[1]===143:!1}static isOutOfMemory({statusCode:r}){return e.isValidStatusCode(r)?r[0]===106&&r[1]===132||r[0]===106&&r[1]===133||r[0]===81&&r[1]===2||r[0]===81&&r[1]===3:!1}static isApduThatTriggersDisconnection(r){const x=new Map;return x.set("openApp",new Uint8Array([224,216,0,0])),x.set("closeApp",new Uint8Array([176,167,0,0])),Array.from(x.values()).some(n=>{for(let i=0;i<4;i++)if(n[i]!==r[i])return!1;return!0})}}export{e as 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": "AAEO,MAAMA,CAAa,CACxB,OAAO,kBAAkBC,EAAwB,CAC/C,OAAOA,EAAW,SAAW,CAC/B,CAEA,OAAO,kBAAkB,CAAE,WAAAA,CAAW,EAAiB,CACrD,OAAKD,EAAa,kBAAkBC,CAAU,EAIvCA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,EAH1C,EAIX,CAEA,OAAO,uBAAuB,CAAE,WAAAA,CAAW,EAAiB,CAC1D,OAAKD,EAAa,kBAAkBC,CAAU,EAIvCA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,GAH1C,EAIX,CACF",
6
- "names": ["CommandUtils", "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 (\n (statusCode[0] === 0x55 && statusCode[1] === 0x15) ||\n (statusCode[0] === 0x69 && statusCode[1] === 0x82) ||\n (statusCode[0] === 0x53 && statusCode[1] === 0x03)\n );\n }\n\n static isRefusedByUser({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return (\n (statusCode[0] === 0x55 && statusCode[1] === 0x01) ||\n (statusCode[0] === 0x69 && statusCode[1] === 0x85)\n );\n }\n\n static isAppAlreadyInstalled({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return (\n (statusCode[0] === 0x6a && statusCode[1] === 0x80) ||\n (statusCode[0] === 0x6a && statusCode[1] === 0x81) ||\n (statusCode[0] === 0x6a && statusCode[1] === 0x8e) ||\n (statusCode[0] === 0x6a && statusCode[1] === 0x8f)\n );\n }\n\n static isOutOfMemory({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return (\n (statusCode[0] === 0x6a && statusCode[1] === 0x84) ||\n (statusCode[0] === 0x6a && statusCode[1] === 0x85) ||\n (statusCode[0] === 0x51 && statusCode[1] === 0x02) ||\n (statusCode[0] === 0x51 && statusCode[1] === 0x03)\n );\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": "AAEO,MAAMA,CAAa,CACxB,OAAO,kBAAkBC,EAAwB,CAC/C,OAAOA,EAAW,SAAW,CAC/B,CAEA,OAAO,kBAAkB,CAAE,WAAAA,CAAW,EAAiB,CACrD,OAAKD,EAAa,kBAAkBC,CAAU,EAIvCA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,EAH1C,EAIX,CAEA,OAAO,uBAAuB,CAAE,WAAAA,CAAW,EAAiB,CAC1D,OAAKD,EAAa,kBAAkBC,CAAU,EAK3CA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,IAC5CA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,KAC5CA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,EANtC,EAQX,CAEA,OAAO,gBAAgB,CAAE,WAAAA,CAAW,EAAiB,CACnD,OAAKD,EAAa,kBAAkBC,CAAU,EAK3CA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,GAC5CA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,IALtC,EAOX,CAEA,OAAO,sBAAsB,CAAE,WAAAA,CAAW,EAAiB,CACzD,OAAKD,EAAa,kBAAkBC,CAAU,EAK3CA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,KAC5CA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,KAC5CA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,KAC5CA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,IAPtC,EASX,CAEA,OAAO,cAAc,CAAE,WAAAA,CAAW,EAAiB,CACjD,OAAKD,EAAa,kBAAkBC,CAAU,EAK3CA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,KAC5CA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,KAC5CA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,GAC5CA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,EAPtC,EASX,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,QAAS,EAAI,EAAG,EAAI,EAAG,IACrB,GAAIA,EAAM,CAAC,IAAMF,EAAK,CAAC,EACrB,MAAO,GAGX,MAAO,EACT,CAAC,CACH,CACF",
6
+ "names": ["CommandUtils", "statusCode", "apdu", "apduMap", "value"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ApduResponse as t}from"../../device-session/ApduResponse";import{CommandUtils as s}from"./CommandUtils";describe("CommandUtils",()=>{describe("static isSuccessResponse",()=>{it("should return true if the status code is 0x9000",()=>{const e=new t({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(s.isSuccessResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x9000",()=>{const e=new t({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])});expect(s.isSuccessResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new t({statusCode:Uint8Array.from([85]),data:Uint8Array.from([])});expect(s.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.isValidStatusCode(e)).toBe(!0)}),it("should return false if the status code is not 2 bytes long",()=>{const e=Uint8Array.from([144]);expect(s.isValidStatusCode(e)).toBe(!1)})}),describe("static isLockedDeviceResponse",()=>{it("should return true if the status code is 0x5515",()=>{const e=new t({statusCode:Uint8Array.from([85,21]),data:Uint8Array.from([])});expect(s.isLockedDeviceResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x5515",()=>{const e=new t({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(s.isLockedDeviceResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new t({statusCode:Uint8Array.from([144]),data:Uint8Array.from([])});expect(s.isLockedDeviceResponse(e)).toBe(!1)})})});
1
+ import{CloseAppCommand as r}from"../../command/os/CloseAppCommand";import{GetAppAndVersionCommand as o}from"../../command/os/GetAppAndVersionCommand";import{OpenAppCommand as a}from"../../command/os/OpenAppCommand";import{ApduResponse as s}from"../../device-session/ApduResponse";import{CommandUtils as t}from"./CommandUtils";describe("CommandUtils",()=>{describe("static isSuccessResponse",()=>{it("should return true if the status code is 0x9000",()=>{const e=new s({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.isSuccessResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x9000",()=>{const e=new s({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])});expect(t.isSuccessResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s({statusCode:Uint8Array.from([85]),data:Uint8Array.from([])});expect(t.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.isValidStatusCode(e)).toBe(!0)}),it("should return false if the status code is not 2 bytes long",()=>{const e=Uint8Array.from([144]);expect(t.isValidStatusCode(e)).toBe(!1)})}),describe("static isLockedDeviceResponse",()=>{it("should return true if the status code is 0x5515",()=>{const e=new s({statusCode:Uint8Array.from([85,21]),data:Uint8Array.from([])});expect(t.isLockedDeviceResponse(e)).toBe(!0)}),it("should return true if the status code is 0x6982",()=>{const e=new s({statusCode:Uint8Array.from([105,130]),data:Uint8Array.from([])});expect(t.isLockedDeviceResponse(e)).toBe(!0)}),it("should return true if the status code is 0x5303",()=>{const e=new s({statusCode:Uint8Array.from([83,3]),data:Uint8Array.from([])});expect(t.isLockedDeviceResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x5515",()=>{const e=new s({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.isLockedDeviceResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s({statusCode:Uint8Array.from([144]),data:Uint8Array.from([])});expect(t.isLockedDeviceResponse(e)).toBe(!1)})}),describe("static isRefusedByUser",()=>{it("should return true if the status code is 0x5501",()=>{const e=new s({statusCode:Uint8Array.from([85,1]),data:Uint8Array.from([])});expect(t.isRefusedByUser(e)).toBe(!0)}),it("should return true if the status code is 0x6985",()=>{const e=new s({statusCode:Uint8Array.from([105,133]),data:Uint8Array.from([])});expect(t.isRefusedByUser(e)).toBe(!0)}),it("should return false if the status code is not 0x5501",()=>{const e=new s({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.isRefusedByUser(e)).toBe(!1)})}),describe("static isAppAlreadyInstalled",()=>{it("should return true if the status code is 0x6a80",()=>{const e=new s({statusCode:Uint8Array.from([106,128]),data:Uint8Array.from([])});expect(t.isAppAlreadyInstalled(e)).toBe(!0)}),it("should return true if the status code is 0x6a81",()=>{const e=new s({statusCode:Uint8Array.from([106,129]),data:Uint8Array.from([])});expect(t.isAppAlreadyInstalled(e)).toBe(!0)}),it("should return true if the status code is 0x6a8e",()=>{const e=new s({statusCode:Uint8Array.from([106,142]),data:Uint8Array.from([])});expect(t.isAppAlreadyInstalled(e)).toBe(!0)}),it("should return true if the status code is 0x6a8f",()=>{const e=new s({statusCode:Uint8Array.from([106,143]),data:Uint8Array.from([])});expect(t.isAppAlreadyInstalled(e)).toBe(!0)}),it("should return false if the status code is not 0x6a80",()=>{const e=new s({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.isAppAlreadyInstalled(e)).toBe(!1)})}),describe("static isOutOfMemory",()=>{it("should return true if the status code is 0x6a84",()=>{const e=new s({statusCode:Uint8Array.from([106,132]),data:Uint8Array.from([])});expect(t.isOutOfMemory(e)).toBe(!0)}),it("should return true if the status code is 0x6a85",()=>{const e=new s({statusCode:Uint8Array.from([106,133]),data:Uint8Array.from([])});expect(t.isOutOfMemory(e)).toBe(!0)}),it("should return true if the status code is 0x5102",()=>{const e=new s({statusCode:Uint8Array.from([81,2]),data:Uint8Array.from([])});expect(t.isOutOfMemory(e)).toBe(!0)}),it("should return true if the status code is 0x5103",()=>{const e=new s({statusCode:Uint8Array.from([81,3]),data:Uint8Array.from([])});expect(t.isOutOfMemory(e)).toBe(!0)}),it("should return false if the status code is not 0x6a84",()=>{const e=new s({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.isOutOfMemory(e)).toBe(!1)})}),describe("static isApduThatTriggersDisconnection",()=>{it("should return true if the APDU is openApp",()=>{const e=new a({appName:"test"}).getApdu().getRawApdu();expect(t.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return true if the APDU is closeApp",()=>{const e=new r().getApdu().getRawApdu();expect(t.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return false if the APDU is not a known one",()=>{const e=new o().getApdu().getRawApdu();expect(t.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,OAAS,gBAAAA,MAAoB,mCAE7B,OAAS,gBAAAC,MAAoB,iBAE7B,SAAS,eAAgB,IAAM,CAC7B,SAAS,2BAA4B,IAAM,CACzC,GAAG,kDAAmD,IAAM,CAC1D,MAAMC,EAAW,IAAIF,EAAa,CAChC,W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AwD,IAAM,CAC/D,MAAMA,EAAW,IAAIF,EAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAOC,EAAa,uBAAuBC,CAAQ,CAAC,EAAE,KAAK,EAAK,CAClE,CAAC,EAED,GAAG,6DAA8D,IAAM,CACrE,MAAMA,EAAW,IAAIF,EAAa,CAChC,WAAY,WAAW,KAAK,CAAC,GAAI,CAAC,EAClC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAOC,EAAa,uBAAuBC,CAAQ,CAAC,EAAE,KAAK,EAAK,CAClE,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["ApduResponse", "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 true if the status code is 0x6982\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x69, 0x82]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(true);\n });\n\n it(\"should return true if the status code is 0x5303\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x53, 0x03]),\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 isRefusedByUser\", () => {\n it(\"should return true if the status code is 0x5501\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55, 0x01]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isRefusedByUser(response)).toBe(true);\n });\n\n it(\"should return true if the status code is 0x6985\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x69, 0x85]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isRefusedByUser(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x5501\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isRefusedByUser(response)).toBe(false);\n });\n });\n\n describe(\"static isAppAlreadyInstalled\", () => {\n it(\"should return true if the status code is 0x6a80\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6a, 0x80]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isAppAlreadyInstalled(response)).toBe(true);\n });\n\n it(\"should return true if the status code is 0x6a81\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6a, 0x81]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isAppAlreadyInstalled(response)).toBe(true);\n });\n\n it(\"should return true if the status code is 0x6a8e\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6a, 0x8e]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isAppAlreadyInstalled(response)).toBe(true);\n });\n\n it(\"should return true if the status code is 0x6a8f\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6a, 0x8f]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isAppAlreadyInstalled(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x6a80\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isAppAlreadyInstalled(response)).toBe(false);\n });\n });\n\n describe(\"static isOutOfMemory\", () => {\n it(\"should return true if the status code is 0x6a84\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6a, 0x84]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isOutOfMemory(response)).toBe(true);\n });\n\n it(\"should return true if the status code is 0x6a85\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6a, 0x85]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isOutOfMemory(response)).toBe(true);\n });\n\n it(\"should return true if the status code is 0x5102\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x51, 0x02]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isOutOfMemory(response)).toBe(true);\n });\n\n it(\"should return true if the status code is 0x5103\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x51, 0x03]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isOutOfMemory(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x6a84\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isOutOfMemory(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": "AAAA,OAAS,mBAAAA,MAAuB,kCAChC,OAAS,2BAAAC,MAA+B,0CACxC,OAAS,kBAAAC,MAAsB,iCAC/B,OAAS,gBAAAC,MAAoB,mCAE7B,OAAS,gBAAAC,MAAoB,iBAE7B,SAAS,eAAgB,IAAM,CAC7B,SAAS,2BAA4B,IAAM,CACzC,GAAG,kDAAmD,IAAM,CAC1D,MAAMC,EAAW,IAAIF,EAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EAC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wD,IAAM,CAC/D,MAAMA,EAAW,IAAIF,EAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAOC,EAAa,cAAcC,CAAQ,CAAC,EAAE,KAAK,EAAK,CACzD,CAAC,CACH,CAAC,EAED,SAAS,yCAA0C,IAAM,CACvD,GAAG,4CAA6C,IAAM,CACpD,MAAME,EAAO,IAAIL,EAAe,CAAE,QAAS,MAAO,CAAC,EAChD,QAAQ,EACR,WAAW,EAEd,OAAOE,EAAa,gCAAgCG,CAAI,CAAC,EAAE,KAAK,EAAI,CACtE,CAAC,EAED,GAAG,6CAA8C,IAAM,CACrD,MAAMA,EAAO,IAAIP,EAAgB,EAAE,QAAQ,EAAE,WAAW,EAExD,OAAOI,EAAa,gCAAgCG,CAAI,CAAC,EAAE,KAAK,EAAI,CACtE,CAAC,EAED,GAAG,qDAAsD,IAAM,CAC7D,MAAMA,EAAO,IAAIN,EAAwB,EAAE,QAAQ,EAAE,WAAW,EAEhE,OAAOG,EAAa,gCAAgCG,CAAI,CAAC,EAAE,KAAK,EAAK,CACvE,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["CloseAppCommand", "GetAppAndVersionCommand", "OpenAppCommand", "ApduResponse", "CommandUtils", "response", "statusCode", "apdu"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ApduParser as a}from"../../apdu/utils/ApduParser";import{DeviceExchangeError as t,UnknownDeviceExchangeError as s}from"../../Error";import{isCommandErrorCode as m}from"./CommandErrors";class d extends t{constructor(r){super({tag:"GlobalCommandError",...r})}}const e={5515:{message:"Device is locked.",tag:"DeviceLockedError"},5501:{message:"Action refused on device.",tag:"ActionRefusedError"},5502:{message:"Pin is not set",tag:"PinNotSetError"},5223:{message:"Device internal error",tag:"DeviceInternalError"}};class C{static handle(r){const o=new a(r).encodeToHexaString(r.statusCode);return m(o,e)?new d({...e[o],errorCode:o}):new s({message:"UnknownError",errorCode:o})}}export{e as GLOBAL_ERRORS,d as GlobalCommandError,C as GlobalCommandErrorHandler};
1
+ import{ApduParser as a}from"../../apdu/utils/ApduParser";import{DeviceExchangeError as t,UnknownDeviceExchangeError as s}from"../../Error";import{isCommandErrorCode as m}from"./CommandErrors";class d extends t{constructor(r){super({tag:"GlobalCommandError",...r})}}const o={5515:{message:"Device is locked.",tag:"DeviceLockedError"},5501:{message:"Action refused on device.",tag:"ActionRefusedError"},5502:{message:"Pin is not set",tag:"PinNotSetError"},5223:{message:"Device internal error",tag:"DeviceInternalError"},"6e00":{message:"CLA not supported",tag:"DeviceInternalError"},"6d00":{message:"INS not supported",tag:"DeviceInternalError"}};class p{static handle(r){const e=new a(r).encodeToHexaString(r.statusCode);return m(e,o)?new d({...o[e],errorCode:e}):new s({message:"UnknownError",errorCode:e})}}export{o as GLOBAL_ERRORS,d as GlobalCommandError,p as GlobalCommandErrorHandler};
2
2
  //# sourceMappingURL=GlobalCommandError.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/utils/GlobalCommandError.ts"],
4
- "sourcesContent": ["import { ApduParser } from \"@api/apdu/utils/ApduParser\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type CommandErrorArgs,\n DeviceExchangeError,\n UnknownDeviceExchangeError,\n} from \"@api/Error\";\n\nimport { type CommandErrors, isCommandErrorCode } from \"./CommandErrors\";\n\n/**\n * Status word list of global errors that any command could result\n */\nexport type GlobalCommandErrorStatusCode = \"5515\" | \"5501\" | \"5502\" | \"5223\";\n\n/**\n * Global command error class\n */\nexport class GlobalCommandError extends DeviceExchangeError<GlobalCommandErrorStatusCode> {\n constructor(args: CommandErrorArgs<GlobalCommandErrorStatusCode>) {\n super({ tag: \"GlobalCommandError\", ...args });\n }\n}\n\n/**\n * Global errors dictionary that links a global status code to an error message\n */\nexport const GLOBAL_ERRORS: CommandErrors<GlobalCommandErrorStatusCode> = {\n \"5515\": { message: \"Device is locked.\", tag: \"DeviceLockedError\" },\n \"5501\": { message: \"Action refused on device.\", tag: \"ActionRefusedError\" },\n \"5502\": { message: \"Pin is not set\", tag: \"PinNotSetError\" },\n \"5223\": { message: \"Device internal error\", tag: \"DeviceInternalError\" },\n};\n\n/**\n * Global error handler utility class\n */\nexport class GlobalCommandErrorHandler {\n /**\n * Static method to get a handled GlobalCommandError or an unhandled DmkError from an apdu response\n * @param apduResponse\n */\n static handle(\n apduResponse: ApduResponse,\n ): GlobalCommandError | UnknownDeviceExchangeError {\n const parser = new ApduParser(apduResponse);\n const errorCode = parser.encodeToHexaString(apduResponse.statusCode);\n if (isCommandErrorCode(errorCode, GLOBAL_ERRORS)) {\n return new GlobalCommandError({ ...GLOBAL_ERRORS[errorCode], errorCode });\n }\n return new UnknownDeviceExchangeError({\n message: \"UnknownError\",\n errorCode,\n });\n }\n}\n"],
5
- "mappings": "AAAA,OAAS,cAAAA,MAAkB,6BAE3B,OAEE,uBAAAC,EACA,8BAAAC,MACK,aAEP,OAA6B,sBAAAC,MAA0B,kBAUhD,MAAMC,UAA2BH,CAAkD,CACxF,YAAYI,EAAsD,CAChE,MAAM,CAAE,IAAK,qBAAsB,GAAGA,CAAK,CAAC,CAC9C,CACF,CAKO,MAAMC,EAA6D,CACxE,KAAQ,CAAE,QAAS,oBAAqB,IAAK,mBAAoB,EACjE,KAAQ,CAAE,QAAS,4BAA6B,IAAK,oBAAqB,EAC1E,KAAQ,CAAE,QAAS,iBAAkB,IAAK,gBAAiB,EAC3D,KAAQ,CAAE,QAAS,wBAAyB,IAAK,qBAAsB,CACzE,EAKO,MAAMC,CAA0B,CAKrC,OAAO,OACLC,EACiD,CAEjD,MAAMC,EADS,IAAIT,EAAWQ,CAAY,EACjB,mBAAmBA,EAAa,UAAU,EACnE,OAAIL,EAAmBM,EAAWH,CAAa,EACtC,IAAIF,EAAmB,CAAE,GAAGE,EAAcG,CAAS,EAAG,UAAAA,CAAU,CAAC,EAEnE,IAAIP,EAA2B,CACpC,QAAS,eACT,UAAAO,CACF,CAAC,CACH,CACF",
4
+ "sourcesContent": ["import { ApduParser } from \"@api/apdu/utils/ApduParser\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type CommandErrorArgs,\n DeviceExchangeError,\n UnknownDeviceExchangeError,\n} from \"@api/Error\";\n\nimport { type CommandErrors, isCommandErrorCode } from \"./CommandErrors\";\n\n/**\n * Status word list of global errors that any command could result\n */\nexport type GlobalCommandErrorStatusCode =\n | \"5515\"\n | \"5501\"\n | \"5502\"\n | \"5223\"\n | \"6e00\"\n | \"6d00\";\n\n/**\n * Global command error class\n */\nexport class GlobalCommandError extends DeviceExchangeError<GlobalCommandErrorStatusCode> {\n constructor(args: CommandErrorArgs<GlobalCommandErrorStatusCode>) {\n super({ tag: \"GlobalCommandError\", ...args });\n }\n}\n\n/**\n * Global errors dictionary that links a global status code to an error message\n */\nexport const GLOBAL_ERRORS: CommandErrors<GlobalCommandErrorStatusCode> = {\n \"5515\": { message: \"Device is locked.\", tag: \"DeviceLockedError\" },\n \"5501\": { message: \"Action refused on device.\", tag: \"ActionRefusedError\" },\n \"5502\": { message: \"Pin is not set\", tag: \"PinNotSetError\" },\n \"5223\": { message: \"Device internal error\", tag: \"DeviceInternalError\" },\n \"6e00\": { message: \"CLA not supported\", tag: \"DeviceInternalError\" },\n \"6d00\": { message: \"INS not supported\", tag: \"DeviceInternalError\" },\n};\n\n/**\n * Global error handler utility class\n */\nexport class GlobalCommandErrorHandler {\n /**\n * Static method to get a handled GlobalCommandError or an unhandled DmkError from an apdu response\n * @param apduResponse\n */\n static handle(\n apduResponse: ApduResponse,\n ): GlobalCommandError | UnknownDeviceExchangeError {\n const parser = new ApduParser(apduResponse);\n const errorCode = parser.encodeToHexaString(apduResponse.statusCode);\n if (isCommandErrorCode(errorCode, GLOBAL_ERRORS)) {\n return new GlobalCommandError({ ...GLOBAL_ERRORS[errorCode], errorCode });\n }\n return new UnknownDeviceExchangeError({\n message: \"UnknownError\",\n errorCode,\n });\n }\n}\n"],
5
+ "mappings": "AAAA,OAAS,cAAAA,MAAkB,6BAE3B,OAEE,uBAAAC,EACA,8BAAAC,MACK,aAEP,OAA6B,sBAAAC,MAA0B,kBAgBhD,MAAMC,UAA2BH,CAAkD,CACxF,YAAYI,EAAsD,CAChE,MAAM,CAAE,IAAK,qBAAsB,GAAGA,CAAK,CAAC,CAC9C,CACF,CAKO,MAAMC,EAA6D,CACxE,KAAQ,CAAE,QAAS,oBAAqB,IAAK,mBAAoB,EACjE,KAAQ,CAAE,QAAS,4BAA6B,IAAK,oBAAqB,EAC1E,KAAQ,CAAE,QAAS,iBAAkB,IAAK,gBAAiB,EAC3D,KAAQ,CAAE,QAAS,wBAAyB,IAAK,qBAAsB,EACvE,OAAQ,CAAE,QAAS,oBAAqB,IAAK,qBAAsB,EACnE,OAAQ,CAAE,QAAS,oBAAqB,IAAK,qBAAsB,CACrE,EAKO,MAAMC,CAA0B,CAKrC,OAAO,OACLC,EACiD,CAEjD,MAAMC,EADS,IAAIT,EAAWQ,CAAY,EACjB,mBAAmBA,EAAa,UAAU,EACnE,OAAIL,EAAmBM,EAAWH,CAAa,EACtC,IAAIF,EAAmB,CAAE,GAAGE,EAAcG,CAAS,EAAG,UAAAA,CAAU,CAAC,EAEnE,IAAIP,EAA2B,CACpC,QAAS,eACT,UAAAO,CACF,CAAC,CACH,CACF",
6
6
  "names": ["ApduParser", "DeviceExchangeError", "UnknownDeviceExchangeError", "isCommandErrorCode", "GlobalCommandError", "args", "GLOBAL_ERRORS", "GlobalCommandErrorHandler", "apduResponse", "errorCode"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var t=(e=>(e.NANO_S="nanoS",e.NANO_SP="nanoSP",e.NANO_X="nanoX",e.STAX="stax",e.FLEX="flex",e))(t||{});class a{id;model;name;constructor({id:n,model:o,name:r}){this.id=n,this.model=o,this.name=r}}const l=11415;export{a as DeviceModel,t as DeviceModelId,l as LEDGER_VENDOR_ID};
1
+ var t=(e=>(e.NANO_S="nanoS",e.NANO_SP="nanoSP",e.NANO_X="nanoX",e.STAX="stax",e.FLEX="flex",e.APEX="apexp",e))(t||{});class i{id;model;name;constructor({id:n,model:o,name:r}){this.id=n,this.model=o,this.name=r}}const l=11415;export{i as DeviceModel,t as DeviceModelId,l as LEDGER_VENDOR_ID};
2
2
  //# sourceMappingURL=DeviceModel.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/api/device/DeviceModel.ts"],
4
- "sourcesContent": ["export enum DeviceModelId {\n NANO_S = \"nanoS\",\n NANO_SP = \"nanoSP\",\n NANO_X = \"nanoX\",\n STAX = \"stax\",\n FLEX = \"flex\",\n}\n\n/**\n * Unique identifier for a device.\n *\n * NB: This identifier is generated at runtime and is not persisted. It cannot\n * be used to identify a device across sessions.\n * There is in fact no way to identify a device across sessions, which is a\n * privacy feature of Ledger devices.\n */\nexport type DeviceId = string;\n\nexport type DeviceModelArgs = {\n readonly id: DeviceId;\n readonly model: DeviceModelId;\n readonly name: string;\n};\n\nexport class DeviceModel {\n public readonly id: DeviceId;\n public readonly model: DeviceModelId;\n public readonly name: string;\n\n constructor({ id, model, name }: DeviceModelArgs) {\n this.id = id;\n this.model = model;\n this.name = name;\n }\n}\n\nexport const LEDGER_VENDOR_ID = 0x2c97;\n"],
5
- "mappings": "AAAO,IAAKA,OACVA,EAAA,OAAS,QACTA,EAAA,QAAU,SACVA,EAAA,OAAS,QACTA,EAAA,KAAO,OACPA,EAAA,KAAO,OALGA,OAAA,IAwBL,MAAMC,CAAY,CACP,GACA,MACA,KAEhB,YAAY,CAAE,GAAAC,EAAI,MAAAC,EAAO,KAAAC,CAAK,EAAoB,CAChD,KAAK,GAAKF,EACV,KAAK,MAAQC,EACb,KAAK,KAAOC,CACd,CACF,CAEO,MAAMC,EAAmB",
4
+ "sourcesContent": ["export enum DeviceModelId {\n NANO_S = \"nanoS\",\n NANO_SP = \"nanoSP\",\n NANO_X = \"nanoX\",\n STAX = \"stax\",\n FLEX = \"flex\",\n APEX = \"apexp\",\n}\n\n/**\n * Unique identifier for a device.\n *\n * NB: This identifier is generated at runtime and is not persisted. It cannot\n * be used to identify a device across sessions.\n * There is in fact no way to identify a device across sessions, which is a\n * privacy feature of Ledger devices.\n */\nexport type DeviceId = string;\n\nexport type DeviceModelArgs = {\n readonly id: DeviceId;\n readonly model: DeviceModelId;\n readonly name: string;\n};\n\nexport class DeviceModel {\n public readonly id: DeviceId;\n public readonly model: DeviceModelId;\n public readonly name: string;\n\n constructor({ id, model, name }: DeviceModelArgs) {\n this.id = id;\n this.model = model;\n this.name = name;\n }\n}\n\nexport const LEDGER_VENDOR_ID = 0x2c97;\n"],
5
+ "mappings": "AAAO,IAAKA,OACVA,EAAA,OAAS,QACTA,EAAA,QAAU,SACVA,EAAA,OAAS,QACTA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,QANGA,OAAA,IAyBL,MAAMC,CAAY,CACP,GACA,MACA,KAEhB,YAAY,CAAE,GAAAC,EAAI,MAAAC,EAAO,KAAAC,CAAK,EAAoB,CAChD,KAAK,GAAKF,EACV,KAAK,MAAQC,EACb,KAAK,KAAOC,CACd,CACF,CAEO,MAAMC,EAAmB",
6
6
  "names": ["DeviceModelId", "DeviceModel", "id", "model", "name", "LEDGER_VENDOR_ID"]
7
7
  }
@@ -1,2 +1,2 @@
1
- const e=vi.fn(),n=vi.fn(),t=vi.fn(),i=vi.fn(),c=vi.fn(),o=vi.fn(),s=vi.fn(),a=vi.fn();function r(){return{sendApdu:e,sendCommand:n,getDeviceSessionState:t,getDeviceSessionStateObservable:i,setDeviceSessionState:c,getManagerApiService:o,getSecureChannelService:s,disableRefresher:a}}export{r as makeDeviceActionInternalApiMock};
1
+ const e=vi.fn(),n=vi.fn(),t=vi.fn(),i=vi.fn(),c=vi.fn(),o=vi.fn(),s=vi.fn(),a=vi.fn(),r=vi.fn();function v(){return{sendApdu:e,sendCommand:n,getDeviceModel:t,getDeviceSessionState:i,getDeviceSessionStateObservable:c,setDeviceSessionState:o,getManagerApiService:s,getSecureChannelService:a,disableRefresher:r}}export{v as 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": "AAIA,MAAMA,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,SAASC,GAAuD,CACrE,MAAO,CACL,SAAUR,EACV,YAAaC,EACb,sBAAuBC,EACvB,gCAAiCC,EACjC,sBAAuBC,EACvB,qBAAsBC,EACtB,wBAAyBC,EACzB,iBAAkBC,CACpB,CACF",
6
- "names": ["sendApduMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "getSecureChannelServiceMock", "disableRefresherMock", "makeDeviceActionInternalApiMock"]
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": "AAIA,MAAMA,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,SAASC,GAAuD,CACrE,MAAO,CACL,SAAUT,EACV,YAAaC,EACb,eAAgBC,EAChB,sBAAuBC,EACvB,gCAAiCC,EACjC,sBAAuBC,EACvB,qBAAsBC,EACtB,wBAAyBC,EACzB,iBAAkBC,CACpB,CACF",
6
+ "names": ["sendApduMock", "sendCommandMock", "apiGetDeviceModelMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "getSecureChannelServiceMock", "disableRefresherMock", "makeDeviceActionInternalApiMock"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Left as i,Right as n}from"purify-ts";import{assign as r,createMachine as a}from"xstate";import{UserInteractionRequired as p}from"../../device-action/model/UserInteractionRequired";import{UnknownDAError as c}from"../../device-action/os/Errors";import{GetDeviceStatusDeviceAction as m}from"../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as s}from"../../device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{ListAppsDeviceAction as d}from"../../device-action/os/ListApps/ListAppsDeviceAction";import{ListInstalledAppsDeviceAction as l}from"../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";const v=(e,o=!1)=>{d.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>a({id:"MockListAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:r({intermediateValue:()=>({requiredUserInteraction:p.AllowListApps})})},done:{type:"final"}},output:()=>o?i(new c("ListApps failed")):n(e)}))}))},h=(e=!1)=>{s.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>a({id:"MockGoToDashboardDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:r({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:()=>e?i(new c("GoToDashboard failed")):n(void 0)}))}))},L=(e=[{currentApp:"BOLOS",currentAppVersion:"1.0.0"}])=>{const o=vi.fn();for(const t of e)o.mockImplementationOnce(()=>"currentApp"in t?n(t):i(t));m.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>a({id:"MockGetDeviceStatusDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:r({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:o}))}))},S=(e=[])=>{l.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>a({id:"MockListInstalledAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:r({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:e.reduce((o,t)=>o.mockImplementationOnce(()=>"installedApps"in t?n(t):i(t)),vi.fn()).mockImplementation(()=>n([]))}))}))};export{L as setupGetDeviceStatusMock,h as setupGoToDashboardMock,v as setupListAppsMock,S as setupListInstalledAppsMock};
1
+ import{Left as o,Right as a}from"purify-ts";import{assign as i,createMachine as r}from"xstate";import{UserInteractionRequired as p}from"../../device-action/model/UserInteractionRequired";import{UnknownDAError as c}from"../../device-action/os/Errors";import{GetDeviceMetadataDeviceAction as m}from"../../device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction";import{GetDeviceStatusDeviceAction as s}from"../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as d}from"../../device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{InstallOrUpdateAppsDeviceAction as l}from"../../device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction";import{ListAppsDeviceAction as u}from"../../device-action/os/ListApps/ListAppsDeviceAction";import{OpenAppDeviceAction as f}from"../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{ListInstalledAppsDeviceAction as A}from"../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";const V=(e,t=!1)=>{u.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockListAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.AllowListApps})})},done:{type:"final"}},output:()=>t?o(new c("ListApps failed")):a(e)}))}))},L=(e,t=!1)=>{m.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockGetDeviceMetadataDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:()=>t?o(new c("GetDeviceMetadata failed")):a(e)}))}))},q=(e,t,n=!1)=>{l.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockInstallOrUpdateAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>t})},done:{type:"final"}},output:()=>n?o(new c("InstallOrUpdateApps failed")):a(e)}))}))},w=(e=!1)=>{f.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({initial:"ready",states:{ready:{entry:i({intermediateValue:{requiredUserInteraction:p.ConfirmOpenApp}}),after:{0:"done"}},done:{type:"final"}},output:()=>e?o(new c("OpenApp failed")):a(void 0)}))}))},x=(e=!1)=>{d.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockGoToDashboardDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:()=>e?o(new c("GoToDashboard failed")):a(void 0)}))}))},b=(e=[{currentApp:"BOLOS",currentAppVersion:"1.0.0"}])=>{const t=vi.fn();for(const n of e)t.mockImplementationOnce(()=>"currentApp"in n?a(n):o(n));s.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockGetDeviceStatusDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:t}))}))},T=(e=[])=>{A.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockListInstalledAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:e.reduce((t,n)=>t.mockImplementationOnce(()=>"installedApps"in n?a(n):o(n)),vi.fn()).mockImplementation(()=>a([]))}))}))};export{L as setupGetDeviceMetadataMock,b as setupGetDeviceStatusMock,x as setupGoToDashboardMock,q as setupInstallOrUpdateAppsMock,V as setupListAppsMock,T as setupListInstalledAppsMock,w as setupOpenAppMock};
2
2
  //# sourceMappingURL=setupTestMachine.js.map