@ledgerhq/device-management-kit 0.0.0-wip-20250214170223 → 0.0.0-wrong-error-when-in-experimental-provider-20251021161219

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 (1076) hide show
  1. package/README.md +64 -11
  2. package/lib/cjs/index.js.map +1 -1
  3. package/lib/cjs/package.json +22 -23
  4. package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
  5. package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
  6. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  7. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +3 -3
  8. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
  9. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
  10. package/lib/cjs/src/api/DmkConfig.js +1 -1
  11. package/lib/cjs/src/api/DmkConfig.js.map +1 -1
  12. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  13. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  14. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  15. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  16. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js +1 -1
  17. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  18. package/lib/cjs/src/api/command/Errors.js +1 -1
  19. package/lib/cjs/src/api/command/Errors.js.map +3 -3
  20. package/lib/cjs/src/api/command/di/commandModule.js +1 -1
  21. package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
  22. package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
  23. package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
  24. package/lib/cjs/src/api/command/model/CommandResult.js +1 -1
  25. package/lib/cjs/src/api/command/model/CommandResult.js.map +2 -2
  26. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  27. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  28. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  29. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  30. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  31. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  32. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  33. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  34. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
  35. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  36. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  37. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  38. package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js +2 -0
  39. package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js.map +7 -0
  40. package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.js +2 -0
  41. package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.js.map +7 -0
  42. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  43. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  44. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
  45. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  46. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  47. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  48. package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
  49. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +2 -2
  50. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
  51. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +2 -2
  52. package/lib/cjs/src/api/command/utils/GlobalCommandError.js +1 -1
  53. package/lib/cjs/src/api/command/utils/GlobalCommandError.js.map +2 -2
  54. package/lib/cjs/src/api/device/DeviceModel.js +1 -1
  55. package/lib/cjs/src/api/device/DeviceModel.js.map +2 -2
  56. package/lib/cjs/src/api/device/SecureElementFlags.js +2 -0
  57. package/lib/cjs/src/api/device/SecureElementFlags.js.map +7 -0
  58. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  59. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  60. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  61. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  62. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  63. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  64. package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
  65. package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
  66. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
  67. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  68. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +1 -1
  69. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  70. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  71. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  72. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  73. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  74. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -1
  75. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
  76. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  77. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  78. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  79. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  80. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  81. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  82. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +2 -0
  83. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  84. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  85. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
  86. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  87. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  88. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  89. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  90. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
  91. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +2 -2
  92. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
  93. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
  94. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  95. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  96. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  97. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  98. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
  99. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  100. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  101. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  102. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
  103. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
  104. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
  105. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
  106. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  107. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  108. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  109. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +2 -2
  110. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
  111. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +1 -1
  112. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  113. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  114. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  115. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  116. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
  117. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  118. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  119. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  120. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  121. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  122. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
  123. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  124. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  125. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  126. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  127. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  128. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  129. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  130. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  131. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  132. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  133. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  134. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  135. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  136. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  137. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  138. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  139. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  140. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  141. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
  142. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  143. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  144. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  145. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  146. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  147. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
  148. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
  149. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  150. package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
  151. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
  152. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.js +2 -0
  153. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.js.map +7 -0
  154. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +2 -0
  155. package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +7 -0
  156. package/lib/cjs/src/api/index.js +1 -1
  157. package/lib/cjs/src/api/index.js.map +3 -3
  158. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  159. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
  160. package/lib/cjs/src/api/secure-channel/constants.js +2 -0
  161. package/lib/cjs/src/api/secure-channel/constants.js.map +7 -0
  162. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +2 -0
  163. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +7 -0
  164. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +2 -0
  165. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +7 -0
  166. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js +2 -0
  167. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +7 -0
  168. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
  169. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
  170. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
  171. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
  172. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +2 -0
  173. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
  174. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +2 -0
  175. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +7 -0
  176. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +2 -0
  177. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +7 -0
  178. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +2 -0
  179. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +7 -0
  180. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
  181. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
  182. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
  183. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
  184. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +2 -0
  185. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
  186. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +2 -0
  187. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +7 -0
  188. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +2 -0
  189. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +7 -0
  190. package/lib/cjs/src/api/secure-channel/task/types.js +2 -0
  191. package/lib/cjs/src/api/secure-channel/task/types.js.map +7 -0
  192. package/lib/cjs/src/api/secure-channel/types.js +2 -0
  193. package/lib/cjs/src/api/secure-channel/types.js.map +7 -0
  194. package/lib/cjs/src/api/secure-channel/utils.js +2 -0
  195. package/lib/cjs/src/api/secure-channel/utils.js.map +7 -0
  196. package/lib/cjs/src/api/secure-channel/utils.test.js +2 -0
  197. package/lib/cjs/src/api/secure-channel/utils.test.js.map +7 -0
  198. package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
  199. package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
  200. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
  201. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
  202. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  203. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  204. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js +1 -1
  205. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
  206. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  207. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  208. package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
  209. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
  210. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
  211. package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js +1 -1
  212. package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js.map +1 -1
  213. package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js +1 -1
  214. package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
  215. package/lib/cjs/src/api/types.js +1 -1
  216. package/lib/cjs/src/api/types.js.map +1 -1
  217. package/lib/cjs/src/api/utils/AppName.js +2 -0
  218. package/lib/cjs/src/api/utils/AppName.js.map +7 -0
  219. package/lib/cjs/src/api/utils/AppName.test.js +2 -0
  220. package/lib/cjs/src/api/utils/AppName.test.js.map +7 -0
  221. package/lib/cjs/src/api/utils/HexaString.js +1 -1
  222. package/lib/cjs/src/api/utils/HexaString.js.map +3 -3
  223. package/lib/cjs/src/api/utils/HexaString.test.js +1 -1
  224. package/lib/cjs/src/api/utils/HexaString.test.js.map +2 -2
  225. package/lib/cjs/src/di.js +1 -1
  226. package/lib/cjs/src/di.js.map +2 -2
  227. package/lib/cjs/src/internal/config/di/configModule.js +1 -1
  228. package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
  229. package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
  230. package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
  231. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
  232. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  233. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  234. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  235. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
  236. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  237. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
  238. package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
  239. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
  240. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  241. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  242. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  243. package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js +1 -1
  244. package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js.map +2 -2
  245. package/lib/cjs/src/internal/device-session/model/DevicePinger.js +2 -0
  246. package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +7 -0
  247. package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js +2 -0
  248. package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
  249. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  250. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  251. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  252. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  253. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js +2 -0
  254. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
  255. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
  256. package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
  257. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  258. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  259. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  260. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
  261. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
  262. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
  263. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
  264. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
  265. package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
  266. package/lib/cjs/src/internal/device-session/model/Frame.js.map +3 -3
  267. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  268. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  269. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  270. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  271. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  272. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  273. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  274. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  275. package/lib/cjs/src/internal/device-session/service/MutexService.js +2 -0
  276. package/lib/cjs/src/internal/device-session/service/MutexService.js.map +7 -0
  277. package/lib/cjs/src/internal/device-session/service/MutexService.test.js +2 -0
  278. package/lib/cjs/src/internal/device-session/service/MutexService.test.js.map +7 -0
  279. package/lib/cjs/src/internal/device-session/service/RefresherService.js +2 -0
  280. package/lib/cjs/src/internal/device-session/service/RefresherService.js.map +7 -0
  281. package/lib/cjs/src/internal/device-session/service/RefresherService.test.js +2 -0
  282. package/lib/cjs/src/internal/device-session/service/RefresherService.test.js.map +7 -0
  283. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  284. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +2 -2
  285. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  286. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  287. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  288. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  289. package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
  290. package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
  291. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  292. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  293. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  294. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
  295. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js +1 -1
  296. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js.map +2 -2
  297. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  298. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  299. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
  300. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
  301. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  302. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  303. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  304. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  305. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  306. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  307. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
  308. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
  309. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
  310. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
  311. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
  312. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
  313. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  314. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  315. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  316. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  317. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  318. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  319. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  320. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  321. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  322. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  323. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
  324. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  325. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  326. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  327. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  328. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  329. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  330. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  331. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
  332. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  333. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  334. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  335. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  336. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  337. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  338. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  339. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  340. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  341. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js +1 -1
  342. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  343. package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
  344. package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
  345. package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
  346. package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
  347. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  348. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  349. package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
  350. package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
  351. package/lib/cjs/src/internal/manager-api/model/Params.js +2 -0
  352. package/lib/cjs/src/internal/manager-api/model/Params.js.map +7 -0
  353. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  354. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  355. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  356. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  357. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
  358. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
  359. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  360. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  361. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  362. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  363. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +1 -1
  364. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +2 -2
  365. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +1 -1
  366. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +2 -2
  367. package/lib/cjs/src/internal/secure-channel/data/SecureChannelDataSource.js.map +1 -1
  368. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  369. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  370. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  371. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  372. package/lib/cjs/src/internal/secure-channel/model/Errors.js +1 -1
  373. package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +3 -3
  374. package/lib/cjs/src/internal/secure-channel/model/Params.js +1 -1
  375. package/lib/cjs/src/internal/secure-channel/model/Params.js.map +1 -1
  376. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  377. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  378. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  379. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  380. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +1 -1
  381. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +1 -1
  382. package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
  383. package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
  384. package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
  385. package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
  386. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
  387. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  388. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  389. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  390. package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
  391. package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
  392. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  393. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  394. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
  395. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  396. package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
  397. package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
  398. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  399. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  400. package/lib/esm/package.json +22 -23
  401. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  402. package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
  403. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  404. package/lib/esm/src/api/DeviceManagementKit.test.js.map +3 -3
  405. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  406. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  407. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  408. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  409. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  410. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  411. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +1 -1
  412. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  413. package/lib/esm/src/api/command/Errors.js +1 -1
  414. package/lib/esm/src/api/command/Errors.js.map +3 -3
  415. package/lib/esm/src/api/command/di/commandModule.js +1 -1
  416. package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
  417. package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
  418. package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
  419. package/lib/esm/src/api/command/model/CommandResult.js +1 -1
  420. package/lib/esm/src/api/command/model/CommandResult.js.map +2 -2
  421. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  422. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  423. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  424. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  425. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  426. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  427. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  428. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  429. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
  430. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  431. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  432. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  433. package/lib/esm/src/api/command/os/SecureElementFlagsParser.js +2 -0
  434. package/lib/esm/src/api/command/os/SecureElementFlagsParser.js.map +7 -0
  435. package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.js +2 -0
  436. package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.js.map +7 -0
  437. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  438. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  439. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
  440. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  441. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  442. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  443. package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
  444. package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
  445. package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
  446. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +2 -2
  447. package/lib/esm/src/api/command/utils/GlobalCommandError.js +1 -1
  448. package/lib/esm/src/api/command/utils/GlobalCommandError.js.map +2 -2
  449. package/lib/esm/src/api/device/DeviceModel.js +1 -1
  450. package/lib/esm/src/api/device/DeviceModel.js.map +2 -2
  451. package/lib/esm/src/api/device/SecureElementFlags.js +1 -0
  452. package/lib/esm/src/api/device/SecureElementFlags.js.map +7 -0
  453. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  454. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  455. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  456. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  457. package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
  458. package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
  459. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
  460. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  461. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +1 -1
  462. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  463. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  464. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  465. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  466. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  467. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  468. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  469. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  470. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  471. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  472. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  473. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  474. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  475. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  476. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
  477. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  478. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  479. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  480. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  481. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
  482. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +2 -2
  483. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  484. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  485. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  486. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  487. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  488. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  489. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  490. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  491. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
  492. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
  493. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
  494. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
  495. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  496. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  497. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  498. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  499. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  500. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  501. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  502. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  503. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  504. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  505. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  506. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  507. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  508. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  509. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  510. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  511. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  512. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  513. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  514. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  515. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  516. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  517. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  518. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  519. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  520. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  521. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  522. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  523. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  524. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  525. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  526. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
  527. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  528. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  529. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  530. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  531. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  532. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  533. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  534. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  535. package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
  536. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  537. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.js +2 -0
  538. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.js.map +7 -0
  539. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +2 -0
  540. package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +7 -0
  541. package/lib/esm/src/api/index.js +1 -1
  542. package/lib/esm/src/api/index.js.map +3 -3
  543. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  544. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
  545. package/lib/esm/src/api/secure-channel/constants.js +2 -0
  546. package/lib/esm/src/api/secure-channel/constants.js.map +7 -0
  547. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +2 -0
  548. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +7 -0
  549. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +2 -0
  550. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +7 -0
  551. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/types.js +1 -0
  552. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/types.js.map +7 -0
  553. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
  554. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
  555. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
  556. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
  557. package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js +1 -0
  558. package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
  559. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +2 -0
  560. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +7 -0
  561. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +2 -0
  562. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +7 -0
  563. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js +2 -0
  564. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +7 -0
  565. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
  566. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
  567. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
  568. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
  569. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js +1 -0
  570. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
  571. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +2 -0
  572. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +7 -0
  573. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +2 -0
  574. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +7 -0
  575. package/lib/esm/src/api/secure-channel/task/types.js +2 -0
  576. package/lib/esm/src/api/secure-channel/task/types.js.map +7 -0
  577. package/lib/esm/src/api/secure-channel/types.js +1 -0
  578. package/lib/esm/src/api/secure-channel/types.js.map +7 -0
  579. package/lib/esm/src/api/secure-channel/utils.js +2 -0
  580. package/lib/esm/src/api/secure-channel/utils.js.map +7 -0
  581. package/lib/esm/src/api/secure-channel/utils.test.js +2 -0
  582. package/lib/esm/src/api/secure-channel/utils.test.js.map +7 -0
  583. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
  584. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
  585. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  586. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  587. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  588. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  589. package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
  590. package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
  591. package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js +1 -1
  592. package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
  593. package/lib/esm/src/api/utils/AppName.js +2 -0
  594. package/lib/esm/src/api/utils/AppName.js.map +7 -0
  595. package/lib/esm/src/api/utils/AppName.test.js +2 -0
  596. package/lib/esm/src/api/utils/AppName.test.js.map +7 -0
  597. package/lib/esm/src/api/utils/HexaString.js +1 -1
  598. package/lib/esm/src/api/utils/HexaString.js.map +3 -3
  599. package/lib/esm/src/api/utils/HexaString.test.js +1 -1
  600. package/lib/esm/src/api/utils/HexaString.test.js.map +2 -2
  601. package/lib/esm/src/di.js +1 -1
  602. package/lib/esm/src/di.js.map +3 -3
  603. package/lib/esm/src/internal/config/di/configModule.js +1 -1
  604. package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
  605. package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
  606. package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
  607. package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
  608. package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  609. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  610. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  611. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
  612. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  613. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
  614. package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
  615. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
  616. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  617. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  618. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  619. package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js +1 -1
  620. package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js.map +2 -2
  621. package/lib/esm/src/internal/device-session/model/DevicePinger.js +2 -0
  622. package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +7 -0
  623. package/lib/esm/src/internal/device-session/model/DevicePinger.test.js +2 -0
  624. package/lib/esm/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
  625. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  626. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  627. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  628. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  629. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js +2 -0
  630. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
  631. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
  632. package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
  633. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
  634. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
  635. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  636. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
  637. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
  638. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
  639. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
  640. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
  641. package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
  642. package/lib/esm/src/internal/device-session/model/Frame.js.map +3 -3
  643. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  644. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  645. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  646. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  647. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  648. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  649. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  650. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  651. package/lib/esm/src/internal/device-session/service/MutexService.js +2 -0
  652. package/lib/esm/src/internal/device-session/service/MutexService.js.map +7 -0
  653. package/lib/esm/src/internal/device-session/service/MutexService.test.js +2 -0
  654. package/lib/esm/src/internal/device-session/service/MutexService.test.js.map +7 -0
  655. package/lib/esm/src/internal/device-session/service/RefresherService.js +2 -0
  656. package/lib/esm/src/internal/device-session/service/RefresherService.js.map +7 -0
  657. package/lib/esm/src/internal/device-session/service/RefresherService.test.js +2 -0
  658. package/lib/esm/src/internal/device-session/service/RefresherService.test.js.map +7 -0
  659. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  660. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +2 -2
  661. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  662. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  663. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  664. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  665. package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
  666. package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
  667. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  668. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  669. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  670. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
  671. package/lib/esm/src/internal/discovery/di/discoveryTypes.js +1 -1
  672. package/lib/esm/src/internal/discovery/di/discoveryTypes.js.map +2 -2
  673. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  674. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  675. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
  676. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
  677. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  678. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  679. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  680. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  681. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  682. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  683. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
  684. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
  685. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
  686. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
  687. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
  688. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
  689. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  690. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  691. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  692. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  693. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  694. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  695. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  696. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  697. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  698. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  699. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
  700. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  701. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  702. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  703. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  704. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  705. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  706. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  707. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  708. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  709. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  710. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  711. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  712. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  713. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  714. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  715. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js +1 -1
  716. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  717. package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
  718. package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
  719. package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
  720. package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
  721. package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
  722. package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
  723. package/lib/esm/src/internal/manager-api/model/Params.js +1 -0
  724. package/lib/esm/src/internal/manager-api/model/Params.js.map +7 -0
  725. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  726. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  727. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  728. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  729. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  730. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  731. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  732. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  733. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +1 -1
  734. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +2 -2
  735. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +1 -1
  736. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +2 -2
  737. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  738. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  739. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  740. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  741. package/lib/esm/src/internal/secure-channel/model/Errors.js +1 -1
  742. package/lib/esm/src/internal/secure-channel/model/Errors.js.map +3 -3
  743. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  744. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  745. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  746. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  747. package/lib/esm/src/internal/send/di/sendModule.js +1 -1
  748. package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
  749. package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
  750. package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
  751. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
  752. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  753. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  754. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  755. package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
  756. package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
  757. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  758. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  759. package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
  760. package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  761. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  762. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  763. package/lib/types/src/api/DeviceManagementKit.d.ts +31 -11
  764. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  765. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  766. package/lib/types/src/api/DmkConfig.d.ts +2 -0
  767. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  768. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  769. package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
  770. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +66 -0
  771. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
  772. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +1 -0
  773. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts.map +1 -1
  774. package/lib/types/src/api/command/Errors.d.ts +5 -0
  775. package/lib/types/src/api/command/Errors.d.ts.map +1 -1
  776. package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
  777. package/lib/types/src/api/command/model/CommandResult.d.ts +3 -3
  778. package/lib/types/src/api/command/model/CommandResult.d.ts.map +1 -1
  779. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
  780. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
  781. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
  782. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
  783. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +38 -4
  784. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  785. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
  786. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
  787. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
  788. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
  789. package/lib/types/src/api/command/os/SecureElementFlagsParser.d.ts +43 -0
  790. package/lib/types/src/api/command/os/SecureElementFlagsParser.d.ts.map +1 -0
  791. package/lib/types/src/api/command/os/SecureElementFlagsParser.test.d.ts +2 -0
  792. package/lib/types/src/api/command/os/SecureElementFlagsParser.test.d.ts.map +1 -0
  793. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  794. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
  795. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
  796. package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
  797. package/lib/types/src/api/command/utils/CommandUtils.d.ts +3 -0
  798. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  799. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts +1 -1
  800. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts.map +1 -1
  801. package/lib/types/src/api/device/DeviceModel.d.ts +2 -1
  802. package/lib/types/src/api/device/DeviceModel.d.ts.map +1 -1
  803. package/lib/types/src/api/device/SecureElementFlags.d.ts +41 -0
  804. package/lib/types/src/api/device/SecureElementFlags.d.ts.map +1 -0
  805. package/lib/types/src/api/device-action/DeviceAction.d.ts +4 -1
  806. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  807. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  808. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +9 -0
  809. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  810. package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
  811. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +5 -2
  812. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts.map +1 -1
  813. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
  814. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +1 -1
  815. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  816. package/lib/types/src/api/device-action/os/Errors.d.ts +20 -0
  817. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  818. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts +58 -0
  819. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
  820. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
  821. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
  822. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +28 -0
  823. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
  824. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts +1 -1
  825. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  826. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
  827. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
  828. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  829. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
  830. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
  831. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
  832. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
  833. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +65 -0
  834. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
  835. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts +1 -1
  836. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts.map +1 -1
  837. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
  838. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +0 -1
  839. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
  840. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
  841. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
  842. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
  843. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
  844. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +24 -0
  845. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
  846. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  847. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -1
  848. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  849. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
  850. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
  851. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
  852. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
  853. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
  854. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
  855. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
  856. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
  857. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
  858. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
  859. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
  860. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
  861. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
  862. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
  863. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
  864. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
  865. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts +1 -0
  866. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts.map +1 -1
  867. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  868. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
  869. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  870. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  871. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +97 -0
  872. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  873. package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
  874. package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
  875. package/lib/types/src/api/device-session/use-case/{ToggleDeviceSessionRefresher.d.ts → DisableDeviceSessionRefresher.d.ts} +6 -6
  876. package/lib/types/src/api/device-session/use-case/DisableDeviceSessionRefresher.d.ts.map +1 -0
  877. package/lib/types/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.d.ts +2 -0
  878. package/lib/types/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.d.ts.map +1 -0
  879. package/lib/types/src/api/index.d.ts +10 -2
  880. package/lib/types/src/api/index.d.ts.map +1 -1
  881. package/lib/types/src/api/secure-channel/constants.d.ts +2 -0
  882. package/lib/types/src/api/secure-channel/constants.d.ts.map +1 -0
  883. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts +8 -0
  884. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -0
  885. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.d.ts +2 -0
  886. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.d.ts.map +1 -0
  887. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +49 -0
  888. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -0
  889. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts +8 -0
  890. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -0
  891. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts +2 -0
  892. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts.map +1 -0
  893. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +45 -0
  894. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -0
  895. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts +8 -0
  896. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -0
  897. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.d.ts +2 -0
  898. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.d.ts.map +1 -0
  899. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +58 -0
  900. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -0
  901. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts +8 -0
  902. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -0
  903. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts +2 -0
  904. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts.map +1 -0
  905. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +42 -0
  906. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -0
  907. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +26 -0
  908. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -0
  909. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.test.d.ts +2 -0
  910. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.test.d.ts.map +1 -0
  911. package/lib/types/src/api/secure-channel/task/types.d.ts +110 -0
  912. package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -0
  913. package/lib/types/src/api/secure-channel/types.d.ts +4 -0
  914. package/lib/types/src/api/secure-channel/types.d.ts.map +1 -0
  915. package/lib/types/src/api/secure-channel/utils.d.ts +19 -0
  916. package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -0
  917. package/lib/types/src/api/secure-channel/utils.test.d.ts +2 -0
  918. package/lib/types/src/api/secure-channel/utils.test.d.ts.map +1 -0
  919. package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
  920. package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
  921. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +17 -14
  922. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -1
  923. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts +2 -0
  924. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts.map +1 -0
  925. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +1 -1
  926. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
  927. package/lib/types/src/api/transport/model/Errors.d.ts +12 -3
  928. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  929. package/lib/types/src/api/transport/model/Transport.d.ts +2 -2
  930. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  931. package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts +1 -1
  932. package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts.map +1 -1
  933. package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts +1 -1
  934. package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts.map +1 -1
  935. package/lib/types/src/api/types.d.ts +9 -2
  936. package/lib/types/src/api/types.d.ts.map +1 -1
  937. package/lib/types/src/api/utils/AppName.d.ts +2 -0
  938. package/lib/types/src/api/utils/AppName.d.ts.map +1 -0
  939. package/lib/types/src/api/utils/AppName.test.d.ts +2 -0
  940. package/lib/types/src/api/utils/AppName.test.d.ts.map +1 -0
  941. package/lib/types/src/api/utils/HexaString.d.ts +4 -3
  942. package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
  943. package/lib/types/src/di.d.ts.map +1 -1
  944. package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
  945. package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
  946. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
  947. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
  948. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts +6 -1
  949. package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts.map +1 -1
  950. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  951. package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts +1 -1
  952. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +18 -0
  953. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -0
  954. package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts +2 -0
  955. package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts.map +1 -0
  956. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +22 -9
  957. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  958. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts +2 -2
  959. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  960. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts +35 -0
  961. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts.map +1 -0
  962. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts +2 -0
  963. package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts.map +1 -0
  964. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts +17 -79
  965. package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts.map +1 -1
  966. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts +20 -0
  967. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -0
  968. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts +2 -0
  969. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts.map +1 -0
  970. package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
  971. package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.d.ts.map +1 -1
  972. package/lib/types/src/internal/device-session/service/MutexService.d.ts +6 -0
  973. package/lib/types/src/internal/device-session/service/MutexService.d.ts.map +1 -0
  974. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts +2 -0
  975. package/lib/types/src/internal/device-session/service/MutexService.test.d.ts.map +1 -0
  976. package/lib/types/src/internal/device-session/service/RefresherService.d.ts +15 -0
  977. package/lib/types/src/internal/device-session/service/RefresherService.d.ts.map +1 -0
  978. package/lib/types/src/internal/device-session/service/RefresherService.test.d.ts +2 -0
  979. package/lib/types/src/internal/device-session/service/RefresherService.test.d.ts.map +1 -0
  980. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +1 -1
  981. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
  982. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts +3 -0
  983. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -0
  984. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  985. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts +1 -1
  986. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts.map +1 -1
  987. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts +8 -1
  988. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts.map +1 -1
  989. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts +24 -0
  990. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -0
  991. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts +2 -0
  992. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts.map +1 -0
  993. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts +1 -1
  994. package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts.map +1 -1
  995. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts +1 -1
  996. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
  997. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +4 -2
  998. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
  999. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
  1000. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +27 -7
  1001. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  1002. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +62 -12
  1003. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  1004. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +106 -17
  1005. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
  1006. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +8 -0
  1007. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  1008. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  1009. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts +1 -0
  1010. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts.map +1 -1
  1011. package/lib/types/src/internal/manager-api/model/Application.d.ts +14 -11
  1012. package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
  1013. package/lib/types/src/internal/manager-api/model/Const.d.ts +2 -0
  1014. package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
  1015. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +17 -3
  1016. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  1017. package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
  1018. package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
  1019. package/lib/types/src/internal/manager-api/model/Params.d.ts +57 -0
  1020. package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -0
  1021. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +13 -7
  1022. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  1023. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +71 -5
  1024. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  1025. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +13 -0
  1026. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -0
  1027. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts +2 -0
  1028. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts.map +1 -0
  1029. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts +3 -3
  1030. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts.map +1 -1
  1031. package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts +13 -13
  1032. package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts.map +1 -1
  1033. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
  1034. package/lib/types/src/internal/secure-channel/model/Errors.d.ts +27 -1
  1035. package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -1
  1036. package/lib/types/src/internal/secure-channel/model/Params.d.ts +3 -5
  1037. package/lib/types/src/internal/secure-channel/model/Params.d.ts.map +1 -1
  1038. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +7 -6
  1039. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -1
  1040. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +42 -6
  1041. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -1
  1042. package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
  1043. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +9 -1
  1044. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
  1045. package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
  1046. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +2 -2
  1047. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
  1048. package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -3
  1049. package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
  1050. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +1 -1
  1051. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
  1052. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  1053. package/package.json +20 -21
  1054. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js +0 -2
  1055. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js.map +0 -7
  1056. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +0 -2
  1057. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +0 -7
  1058. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
  1059. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
  1060. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
  1061. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
  1062. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js +0 -2
  1063. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js.map +0 -7
  1064. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +0 -2
  1065. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +0 -7
  1066. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
  1067. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
  1068. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
  1069. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
  1070. package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.d.ts.map +0 -1
  1071. package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.d.ts +0 -2
  1072. package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.d.ts.map +0 -1
  1073. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts +0 -13
  1074. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts.map +0 -1
  1075. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts +0 -2
  1076. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";var r=require("../../command/model/CommandResult"),x=require("../../device/DeviceModel"),o=require("../../device-session/ApduResponse"),n=require("./__mocks__/GetOsVersionCommand"),a=require("./GetOsVersionCommand");const d=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]),p=new o.ApduResponse({statusCode:Uint8Array.from([144,0]),data:c}),i=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]),m=new o.ApduResponse({statusCode:Uint8Array.from([144,0]),data:i}),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]),A=new o.ApduResponse({statusCode:Uint8Array.from([144,0]),data:S});describe("GetOsVersionCommand",()=>{let t;beforeEach(()=>{t=new a.GetOsVersionCommand}),describe("getApdu",()=>{it("should return the GetOsVersion apdu",()=>{const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(d)})}),describe("parseResponse",()=>{describe("Nano X",()=>{it("should parse the LNX response",()=>{const e=t.parseResponse(p,x.DeviceModelId.NANO_X),s=(0,r.CommandResultFactory)({data:(0,n.getOsVersionCommandResponseMockBuilder)(x.DeviceModelId.NANO_X)});expect(e).toStrictEqual(s)})}),describe("Nano S Plus",()=>{it("should parse the LNSP response",()=>{const e=t.parseResponse(m,x.DeviceModelId.NANO_SP),s=(0,r.CommandResultFactory)({data:(0,n.getOsVersionCommandResponseMockBuilder)(x.DeviceModelId.NANO_SP)});expect(e).toStrictEqual(s)})}),describe("Stax",()=>{it("should parse the STAX response",()=>{const e=t.parseResponse(A,x.DeviceModelId.STAX),s=(0,r.CommandResultFactory)({data:(0,n.getOsVersionCommandResponseMockBuilder)(x.DeviceModelId.STAX)});expect(e).toStrictEqual(s)})}),describe("Error handling",()=>{it("should return an error if the response is not successful",()=>{const e=new o.ApduResponse({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])}),s=t.parseResponse(e,x.DeviceModelId.NANO_S);expect((0,r.isSuccessCommandResult)(s)).toBeFalsy()})})})});
1
+ "use strict";var r=require("../../command/model/CommandResult"),t=require("../../device/DeviceModel"),o=require("../../device-session/ApduResponse"),a=require("./__mocks__/GetOsVersionCommand"),n=require("./GetOsVersionCommand");const d=Uint8Array.from([224,1,0,0,0]),i=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]),c=new o.ApduResponse({statusCode:Uint8Array.from([144,0]),data:i}),u=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]),l=new o.ApduResponse({statusCode:Uint8Array.from([144,0]),data:u}),p=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]),S=new o.ApduResponse({statusCode:Uint8Array.from([144,0]),data:p}),m=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]),O=new o.ApduResponse({statusCode:Uint8Array.from([144,0]),data:m}),A=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]),f=new o.ApduResponse({statusCode:Uint8Array.from([144,0]),data:A});describe("GetOsVersionCommand",()=>{let s;beforeEach(()=>{s=new n.GetOsVersionCommand}),describe("getApdu",()=>{it("should return the GetOsVersion apdu",()=>{const e=s.getApdu();expect(e.getRawApdu()).toStrictEqual(d)})}),describe("parseResponse",()=>{describe("Nano X",()=>{it("should parse the LNX response",()=>{const e=s.parseResponse(c,t.DeviceModelId.NANO_X),x=(0,r.CommandResultFactory)({data:(0,a.getOsVersionCommandResponseMockBuilder)(t.DeviceModelId.NANO_X)});expect(e).toStrictEqual(x)})}),describe("Nano S Plus",()=>{it("should parse the LNSP response",()=>{const e=s.parseResponse(l,t.DeviceModelId.NANO_SP),x=(0,r.CommandResultFactory)({data:(0,a.getOsVersionCommandResponseMockBuilder)(t.DeviceModelId.NANO_SP)});expect(e).toStrictEqual(x)})}),describe("Stax",()=>{it("should parse the STAX response",()=>{const e=s.parseResponse(S,t.DeviceModelId.STAX),x=(0,r.CommandResultFactory)({data:(0,a.getOsVersionCommandResponseMockBuilder)(t.DeviceModelId.STAX)});expect(e).toStrictEqual(x)})}),describe("Bootloader",()=>{it("should parse the bootloader response",()=>{const e=s.parseResponse(O,t.DeviceModelId.STAX),x=(0,r.CommandResultFactory)({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(f,t.DeviceModelId.NANO_X),x=(0,r.CommandResultFactory)({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 o.ApduResponse({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])}),x=s.parseResponse(e,t.DeviceModelId.NANO_S);expect((0,r.isSuccessCommandResult)(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,IAAAA,EAGO,4CACPC,EAA8B,mCAC9BC,EAA6B,4CAE7BC,EAAuD,2CACvDA,EAAoC,iCAEpC,MAAMC,EAAsB,WAAW,KAAK,CAAC,I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AAE,cAAcR,CAAmB,CAC7D,CAAC,CACH,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,SAAS,SAAU,IAAM,CACvB,GAAG,gCAAiC,IAAM,CACxC,MAAMS,EAASF,EAAQ,cACrBL,EACA,gBAAc,MAChB,EAEMQ,KAAW,wBAAqB,CACpC,QAAM,0CAAuC,gBAAc,MAAM,CACnE,CAAC,EAED,OAAOD,CAAM,EAAE,cAAcC,CAAQ,CACvC,CAAC,CACH,CAAC,EAED,SAAS,cAAe,IAAM,CAC5B,GAAG,iCAAkC,IAAM,CACzC,MAAMD,EAASF,EAAQ,cACrBH,EACA,gBAAc,OAChB,EAEMM,KAAW,wBAAqB,CACpC,QAAM,0CAAuC,gBAAc,OAAO,CACpE,CAAC,EAED,OAAOD,CAAM,EAAE,cAAcC,CAAQ,CACvC,CAAC,CACH,CAAC,EAED,SAAS,OAAQ,IAAM,CACrB,GAAG,iCAAkC,IAAM,CACzC,MAAMD,EAASF,EAAQ,cACrBD,EACA,gBAAc,IAChB,EAEMI,KAAW,wBAAqB,CACpC,QAAM,0CAAuC,gBAAc,IAAI,CACjE,CAAC,EAED,OAAOD,CAAM,EAAE,cAAcC,CAAQ,CACvC,CAAC,CACH,CAAC,EAED,SAAS,iBAAkB,IAAM,CAC/B,GAAG,2DAA4D,IAAM,CACnE,MAAMC,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EACKC,EAASL,EAAQ,cAAcI,EAAU,gBAAc,MAAM,EAEnE,UAAO,0BAAuBC,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["import_CommandResult", "import_DeviceModel", "import_ApduResponse", "import_GetOsVersionCommand", "GET_OS_VERSION_APDU", "LNX_RESPONSE_DATA_GOOD", "LNX_RESPONSE_GOOD", "LNSP_REPONSE_DATA_GOOD", "LNSP_RESPONSE_GOOD", "STAX_RESPONSE_DATA_GOOD", "STAX_RESPONSE_GOOD", "command", "apdu", "parsed", "expected", "response", "result"]
4
+ "sourcesContent": ["import {\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { getOsVersionCommandResponseMockBuilder } from \"./__mocks__/GetOsVersionCommand\";\nimport { GetOsVersionCommand } from \"./GetOsVersionCommand\";\n\nconst GET_OS_VERSION_APDU = Uint8Array.from([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\nconst LNX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x00, 0x00, 0x04, 0x05, 0x32, 0x2e, 0x32, 0x2e, 0x33, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x32, 0x2e, 0x33, 0x30, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x01,\n 0x00, 0x01, 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNX_RESPONSE_DATA_GOOD,\n});\n\nconst LNSP_REPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x10, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x31, 0x2e, 0x31, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x34, 0x2e, 0x30, 0x33, 0x04, 0x33, 0x2e, 0x31, 0x32, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNSP_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNSP_REPONSE_DATA_GOOD,\n});\n\nconst STAX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x20, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x33, 0x2e, 0x30, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x35, 0x2e, 0x32, 0x34, 0x04, 0x30, 0x2e, 0x34, 0x38, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst STAX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: STAX_RESPONSE_DATA_GOOD,\n});\n\nconst BL_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x05, 0x01, 0x00, 0x03, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x04, 0xf4, 0xd8, 0xaa,\n 0x43, 0x05, 0x32, 0x2e, 0x32, 0x2e, 0x33, 0x04, 0x33, 0x00, 0x00, 0x04, 0x90,\n 0x00,\n]);\nconst BL_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: BL_RESPONSE_DATA_GOOD,\n});\n\nconst OLD_FM_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x00, 0x00, 0x04, 0x00, 0x04, 0xee, 0x00, 0x00, 0x00, 0x04, 0x32, 0x2e,\n 0x33, 0x30, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst OLD_FM_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: OLD_FM_RESPONSE_DATA_GOOD,\n});\n\ndescribe(\"GetOsVersionCommand\", () => {\n let command: GetOsVersionCommand;\n\n beforeEach(() => {\n command = new GetOsVersionCommand();\n });\n\n describe(\"getApdu\", () => {\n it(\"should return the GetOsVersion apdu\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(GET_OS_VERSION_APDU);\n });\n });\n\n describe(\"parseResponse\", () => {\n describe(\"Nano X\", () => {\n it(\"should parse the LNX response\", () => {\n const parsed = command.parseResponse(\n LNX_RESPONSE_GOOD,\n DeviceModelId.NANO_X,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_X),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Nano S Plus\", () => {\n it(\"should parse the LNSP response\", () => {\n const parsed = command.parseResponse(\n LNSP_RESPONSE_GOOD,\n DeviceModelId.NANO_SP,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_SP),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Stax\", () => {\n it(\"should parse the STAX response\", () => {\n const parsed = command.parseResponse(\n STAX_RESPONSE_GOOD,\n DeviceModelId.STAX,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.STAX),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Bootloader\", () => {\n it(\"should parse the bootloader response\", () => {\n const parsed = command.parseResponse(\n BL_RESPONSE_GOOD,\n DeviceModelId.STAX,\n );\n\n const expected = CommandResultFactory({\n data: {\n isBootloader: true,\n isOsu: false,\n targetId: 83951619,\n seTargetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xf4, 0xd8, 0xaa, 0x43]),\n mcuTargetId: 83951619,\n mcuSephVersion: \"\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"\",\n langId: undefined,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: true,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: false,\n isInRecoveryMode: false,\n },\n },\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Old firmware\", () => {\n it(\"should parse the old firmware response\", () => {\n const parsed = command.parseResponse(\n OLD_FM_RESPONSE_GOOD,\n DeviceModelId.NANO_X,\n );\n\n const expected = CommandResultFactory({\n data: {\n isBootloader: false,\n isOsu: false,\n targetId: 855638020,\n seTargetId: 855638020,\n seVersion: \"0.0.0\",\n seFlags: new Uint8Array(),\n mcuTargetId: undefined,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"\",\n hwVersion: \"00\",\n langId: undefined,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: true,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n },\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Error handling\", () => {\n it(\"should return an error if the response is not successful\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n const result = command.parseResponse(response, DeviceModelId.NANO_S);\n\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAGO,4CACPC,EAA8B,mCAC9BC,EAA6B,4CAE7BC,EAAuD,2CACvDA,EAAoC,iCAEpC,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,IAAI,eAAa,CACzC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAMD,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,EA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ACF,CAAC,EAED,OAAOD,CAAM,EAAE,cAAcC,CAAQ,CACvC,CAAC,CACH,CAAC,EAED,SAAS,eAAgB,IAAM,CAC7B,GAAG,yCAA0C,IAAM,CACjD,MAAMD,EAASF,EAAQ,cACrBD,EACA,gBAAc,MAChB,EAEMI,KAAW,wBAAqB,CACpC,KAAM,CACJ,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WACb,YAAa,OACb,eAAgB,OAChB,qBAAsB,GACtB,UAAW,KACX,OAAQ,OACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,CACF,CACF,CAAC,EAED,OAAOD,CAAM,EAAE,cAAcC,CAAQ,CACvC,CAAC,CACH,CAAC,EAED,SAAS,iBAAkB,IAAM,CAC/B,GAAG,2DAA4D,IAAM,CACnE,MAAMC,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EACKC,EAASL,EAAQ,cAAcI,EAAU,gBAAc,MAAM,EAEnE,UAAO,0BAAuBC,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_CommandResult", "import_DeviceModel", "import_ApduResponse", "import_GetOsVersionCommand", "GET_OS_VERSION_APDU", "LNX_RESPONSE_DATA_GOOD", "LNX_RESPONSE_GOOD", "LNSP_REPONSE_DATA_GOOD", "LNSP_RESPONSE_GOOD", "STAX_RESPONSE_DATA_GOOD", "STAX_RESPONSE_GOOD", "BL_RESPONSE_DATA_GOOD", "BL_RESPONSE_GOOD", "OLD_FM_RESPONSE_DATA_GOOD", "OLD_FM_RESPONSE_GOOD", "command", "apdu", "parsed", "expected", "response", "result"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var R=(o,r)=>{for(var e in r)d(o,e,{get:r[e],enumerable:!0})},I=(o,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of x(r))!y.call(o,a)&&a!==e&&d(o,a,{get:()=>r[a],enumerable:!(n=P(r,a))||n.enumerable});return o};var S=o=>I(d({},"__esModule",{value:!0}),o);var B={};R(B,{ListLanguagePackCommand:()=>b,ListLanguagePackCommandError:()=>A});module.exports=S(B);var p=require("../../apdu/utils/ApduBuilder"),c=require("../../apdu/utils/ApduParser"),i=require("../../command/Errors"),t=require("../../command/model/CommandResult"),L=require("../../command/utils/CommandErrors"),C=require("../../command/utils/CommandUtils"),l=require("../../command/utils/GlobalCommandError"),f=require("../../Error"),m=require("../../utils/HexaString");const g={"662d":{message:"Invalid LIST_ARG, first command must be sent with P1_LIST_LANGUAGE_PACKS_FIRST."}};class A extends f.DeviceExchangeError{constructor({message:r,errorCode:e}){super({message:r,errorCode:e,tag:"ListLanguagePackCommandError"})}}class b{constructor(r){this.args=r}getApdu(){const r={cla:224,ins:52,p1:this.args.firstChunk?0:1,p2:0};return new p.ApduBuilder(r).build()}parseResponse(r){const e=new c.ApduParser(r);if(!C.CommandUtils.isSuccessResponse(r)){const s=e.encodeToHexaString(r.statusCode);return(0,L.isCommandErrorCode)(s,g)?(0,t.CommandResultFactory)({error:new A({...g[s],errorCode:s})}):(0,t.CommandResultFactory)({error:l.GlobalCommandErrorHandler.handle(r)})}if(e.extract8BitUInt()===void 0)return(0,t.CommandResultFactory)({data:void 0});e.extract8BitUInt();const a=e.extractFieldLVEncoded();if(a===void 0)return(0,t.CommandResultFactory)({error:new i.InvalidStatusWordError("Failed to get language pack id")});const u=e.extractFieldLVEncoded();if(u===void 0)return(0,t.CommandResultFactory)({error:new i.InvalidStatusWordError("Failed to get language pack size")});const E=parseInt((0,m.bufferToHexaString)(a),16),k=parseInt((0,m.bufferToHexaString)(u),16);return(0,t.CommandResultFactory)({data:{id:E,size:k}})}}0&&(module.exports={ListLanguagePackCommand,ListLanguagePackCommandError});
2
+ //# sourceMappingURL=ListLanguagePackCommand.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/command/os/ListLanguagePackCommand.ts"],
4
+ "sourcesContent": ["import { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder, type ApduBuilderArgs } from \"@api/apdu/utils/ApduBuilder\";\nimport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nimport { type Command } from \"@api/command/Command\";\nimport { InvalidStatusWordError } from \"@api/command/Errors\";\nimport {\n type CommandResult,\n CommandResultFactory,\n} from \"@api/command/model/CommandResult\";\nimport {\n type CommandErrors,\n isCommandErrorCode,\n} from \"@api/command/utils/CommandErrors\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { GlobalCommandErrorHandler } from \"@api/command/utils/GlobalCommandError\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type CommandErrorArgs, DeviceExchangeError } from \"@api/Error\";\nimport { bufferToHexaString } from \"@api/utils/HexaString\";\n\nexport type ListLanguagePackCommandArgs = {\n readonly firstChunk: boolean;\n};\n\nexport type ListLanguagePackResponse =\n | {\n readonly id: number;\n readonly size: number;\n }\n | undefined;\n\nexport type ListLanguagePackErrorCodes = \"662d\";\n\nconst LANGUAGE_PACK_ERRORS: CommandErrors<ListLanguagePackErrorCodes> = {\n \"662d\": {\n message:\n \"Invalid LIST_ARG, first command must be sent with P1_LIST_LANGUAGE_PACKS_FIRST.\",\n },\n};\n\nexport type ListLanguagePackCommandResult = CommandResult<\n ListLanguagePackResponse,\n ListLanguagePackErrorCodes\n>;\n\nexport class ListLanguagePackCommandError extends DeviceExchangeError<ListLanguagePackErrorCodes> {\n constructor({\n message,\n errorCode,\n }: CommandErrorArgs<ListLanguagePackErrorCodes>) {\n super({ message, errorCode, tag: \"ListLanguagePackCommandError\" });\n }\n}\n\nexport class ListLanguagePackCommand\n implements\n Command<\n ListLanguagePackResponse,\n ListLanguagePackCommandArgs,\n ListLanguagePackErrorCodes\n >\n{\n constructor(private args: ListLanguagePackCommandArgs) {}\n\n getApdu(): Apdu {\n const apduArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x34,\n p1: this.args.firstChunk ? 0x00 : 0x01,\n p2: 0x00,\n };\n return new ApduBuilder(apduArgs).build();\n }\n\n parseResponse(apduResponse: ApduResponse): ListLanguagePackCommandResult {\n const parser = new ApduParser(apduResponse);\n\n if (!CommandUtils.isSuccessResponse(apduResponse)) {\n const errorCode = parser.encodeToHexaString(apduResponse.statusCode);\n if (isCommandErrorCode(errorCode, LANGUAGE_PACK_ERRORS)) {\n return CommandResultFactory({\n error: new ListLanguagePackCommandError({\n ...LANGUAGE_PACK_ERRORS[errorCode],\n errorCode,\n }),\n });\n }\n return CommandResultFactory({\n error: GlobalCommandErrorHandler.handle(apduResponse),\n });\n }\n\n const tlvVersion = parser.extract8BitUInt();\n if (tlvVersion === undefined) {\n // No more language package\n return CommandResultFactory({\n data: undefined,\n });\n }\n\n parser.extract8BitUInt(); // total length\n const idBuffer = parser.extractFieldLVEncoded();\n if (idBuffer === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack id\"),\n });\n }\n\n const sizeBuffer = parser.extractFieldLVEncoded();\n if (sizeBuffer === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack size\"),\n });\n }\n\n const id = parseInt(bufferToHexaString(idBuffer), 16);\n const size = parseInt(bufferToHexaString(sizeBuffer), 16);\n return CommandResultFactory({\n data: { id, size },\n });\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,EAAA,iCAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAAkD,uCACl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AuB,kCAAkC,CACtE,CAAC,EAGH,MAAMC,EAAK,YAAS,sBAAmBF,CAAQ,EAAG,EAAE,EAC9CG,EAAO,YAAS,sBAAmBF,CAAU,EAAG,EAAE,EACxD,SAAO,wBAAqB,CAC1B,KAAM,CAAE,GAAAC,EAAI,KAAAC,CAAK,CACnB,CAAC,CACH,CACF",
6
+ "names": ["ListLanguagePackCommand_exports", "__export", "ListLanguagePackCommand", "ListLanguagePackCommandError", "__toCommonJS", "import_ApduBuilder", "import_ApduParser", "import_Errors", "import_CommandResult", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_Error", "import_HexaString", "LANGUAGE_PACK_ERRORS", "message", "errorCode", "args", "apduArgs", "apduResponse", "parser", "idBuffer", "sizeBuffer", "id", "size"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=require("../../command/Errors"),r=require("../../command/model/CommandResult"),u=require("../../command/model/CommandResult"),o=require("../../command/os/ListLanguagePackCommand"),n=require("../../device-session/ApduResponse");const i=new Uint8Array([224,52,0,0,0]),d=new Uint8Array([224,52,1,0,0]);describe("ListLanguagePackCommand",()=>{let t;beforeEach(()=>{t=new o.ListLanguagePackCommand({firstChunk:!0})}),it("should return the correct APDU",()=>{const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(i)}),it("should return the correct next chunks APDU",()=>{t=new o.ListLanguagePackCommand({firstChunk:!1});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(d)}),it("should parse result successfully",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15,1,1,4,0,0,80,0,5,48,46,48,46,52,0])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({data:{id:1,size:20480}}))}),it("should parse empty result successfully",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({data:void 0}))}),it("should fail on invalid id",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({error:new a.InvalidStatusWordError("Failed to get language pack id")}))}),it("should fail on invalid size",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15,1,1])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({error:new a.InvalidStatusWordError("Failed to get language pack size")}))}),it("should fail on device error",()=>{const e=new n.ApduResponse({statusCode:new Uint8Array([102,45]),data:new Uint8Array([])}),s=t.parseResponse(e);expect((0,u.isSuccessCommandResult)(s)).toBeFalsy()})});
2
+ //# sourceMappingURL=ListLanguagePackCommand.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/command/os/ListLanguagePackCommand.test.ts"],
4
+ "sourcesContent": ["import { InvalidStatusWordError } from \"@api/command/Errors\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport { ListLanguagePackCommand } from \"@api/command/os/ListLanguagePackCommand\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nconst LIST_LANGUAGE_PACK_APDU = new Uint8Array([0xe0, 0x34, 0x00, 0x00, 0x00]);\nconst LIST_LANGUAGE_PACK_CONTINUE_APDU = new Uint8Array([\n 0xe0, 0x34, 0x01, 0x00, 0x00,\n]);\n\ndescribe(\"ListLanguagePackCommand\", () => {\n let command: ListLanguagePackCommand;\n\n beforeEach(() => {\n command = new ListLanguagePackCommand({ firstChunk: true });\n });\n\n it(\"should return the correct APDU\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(LIST_LANGUAGE_PACK_APDU);\n });\n\n it(\"should return the correct next chunks APDU\", () => {\n command = new ListLanguagePackCommand({ firstChunk: false });\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(LIST_LANGUAGE_PACK_CONTINUE_APDU);\n });\n\n it(\"should parse result successfully\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([\n 0x01, 0x0f, 0x01, 0x01, 0x04, 0x00, 0x00, 0x50, 0x00, 0x05, 0x30, 0x2e,\n 0x30, 0x2e, 0x34, 0x00,\n ]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n id: 1,\n size: 20480,\n },\n }),\n );\n });\n\n it(\"should parse empty result successfully\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: undefined,\n }),\n );\n });\n\n it(\"should fail on invalid id\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0x01, 0x0f]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack id\"),\n }),\n );\n });\n\n it(\"should fail on invalid size\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0x01, 0x0f, 0x01, 0x01]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack size\"),\n }),\n );\n });\n\n it(\"should fail on device error\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x66, 0x2d]),\n data: new Uint8Array([]),\n });\n const result = command.parseResponse(response);\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAuC,+BACvCC,EAAqC,4CACrCA,EAAuC,4CACvCC,EAAwC,mDACxCC,EAA6B,4CAE7B,MAAMC,EAA0B,IAAI,WAAW,CAAC,IAAM,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,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,EAAI,CAAC,CACnC,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yBAAuB,gCAAgC,CACpE,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMD,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,GAAM,EAAM,CAAI,CAAC,CAC/C,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yBAAuB,kCAAkC,CACtE,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMD,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,EAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,UAAO,0BAAuBC,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC",
6
+ "names": ["import_Errors", "import_CommandResult", "import_ListLanguagePackCommand", "import_ApduResponse", "LIST_LANGUAGE_PACK_APDU", "LIST_LANGUAGE_PACK_CONTINUE_APDU", "command", "apdu", "response", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},l=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of a(e))!h.call(t,r)&&r!==n&&i(t,r,{get:()=>e[r],enumerable:!(o=s(e,r))||o.enumerable});return t};var d=t=>l(i({},"__esModule",{value:!0}),t);var B={};c(B,{SecureElementFlagsParser:()=>m});module.exports=d(B);class m{constructor(e){this.seFlags=e;if(this.seFlags.length!==4)throw new Error("Invalid secure element flags length")}generalDeviceState(){const e=this.seFlags[0]??0;return{isPinValidated:this._checkNthBitInByte(e,1),hasMcuSerialNumber:this._checkNthBitInByte(e,2),hasValidCertificate:this._checkNthBitInByte(e,3),isCustomAuthorityConnectionAllowed:this._checkNthBitInByte(e,4),isSecureConnectionAllowed:this._checkNthBitInByte(e,5),isOnboarded:this._checkNthBitInByte(e,6),isMcuCodeSigned:this._checkNthBitInByte(e,7),isInRecoveryMode:this._checkNthBitInByte(e,8)}}endorsementInformation(){throw new Error("Not implemented")}wordsInformation(){throw new Error("Not implemented")}onboardingStatus(){throw new Error("Not implemented")}_checkNthBitInByte(e,n){return(e>>8-n&1)===1}}0&&(module.exports={SecureElementFlagsParser});
2
+ //# sourceMappingURL=SecureElementFlagsParser.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/command/os/SecureElementFlagsParser.ts"],
4
+ "sourcesContent": ["import {\n type DeviceGeneralState,\n type EndorsementInformation,\n type OnboardingStatus,\n type WordsInformation,\n} from \"@api/device/SecureElementFlags\";\n\n/**\n * Secure element flags parser class.\n */\nexport class SecureElementFlagsParser {\n /**\n * Creates an instance of SecureElementFlags parser.\n * @param seFlags - The secure element flags as an Uint8Array, it comes from the response of the GetOsVersionCommand.\n */\n constructor(private readonly seFlags: Uint8Array) {\n if (this.seFlags.length !== 4) {\n throw new Error(\"Invalid secure element flags length\");\n }\n }\n\n /**\n * Retrieves the general device state based on the secure element flags, which is the first byte of the flags.\n * @returns {DeviceGeneralState}\n */\n generalDeviceState(): DeviceGeneralState {\n const firstByte = this.seFlags[0] ?? 0x00;\n\n return {\n isPinValidated: this._checkNthBitInByte(firstByte, 1),\n hasMcuSerialNumber: this._checkNthBitInByte(firstByte, 2),\n hasValidCertificate: this._checkNthBitInByte(firstByte, 3),\n isCustomAuthorityConnectionAllowed: this._checkNthBitInByte(firstByte, 4),\n isSecureConnectionAllowed: this._checkNthBitInByte(firstByte, 5),\n isOnboarded: this._checkNthBitInByte(firstByte, 6),\n isMcuCodeSigned: this._checkNthBitInByte(firstByte, 7),\n isInRecoveryMode: this._checkNthBitInByte(firstByte, 8),\n };\n }\n\n /**\n * Retrieves the endorsement information based on the secure element flags, which is the second byte of the flags.\n * @returns {EndorsementInformation}\n * @throws Will throw an error if the method is not implemented.\n */\n endorsementInformation(): EndorsementInformation {\n throw new Error(\"Not implemented\");\n }\n\n /**\n * Retrieves the words information based on the secure element flags, which is the third byte of the flags.\n * @returns {WordsInformation}\n * @throws Will throw an error if the method is not implemented.\n */\n wordsInformation(): WordsInformation {\n throw new Error(\"Not implemented\");\n }\n\n /**\n * Retrieves the onboarding status based on the secure element flags, which is the fourth byte of the flags.\n * @returns {OnboardingStatus}\n * @throws Will throw an error if the method is not implemented.\n */\n onboardingStatus(): OnboardingStatus {\n throw new Error(\"Not implemented\");\n }\n\n /**\n * Check the nth bit in a byte, returns true if the bit is set, false otherwise.\n * @param byte - The byte to check.\n * @param n - The bit number to check.\n * @returns {boolean} - True if the bit is set, false otherwise.\n */\n _checkNthBitInByte(byte: number, n: number): boolean {\n return ((byte >> (8 - n)) & 1) === 1;\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAUO,MAAME,CAAyB,CAKpC,YAA6BE,EAAqB,CAArB,aAAAA,EAC3B,GAAI,KAAK,QAAQ,SAAW,EAC1B,MAAM,IAAI,MAAM,qCAAqC,CAEzD,CAMA,oBAAyC,CACvC,MAAMC,EAAY,KAAK,QAAQ,CAAC,GAAK,EAErC,MAAO,CACL,eAAgB,KAAK,mBAAmBA,EAAW,CAAC,EACpD,mBAAoB,KAAK,mBAAmBA,EAAW,CAAC,EACxD,oBAAqB,KAAK,mBAAmBA,EAAW,CAAC,EACzD,mCAAoC,KAAK,mBAAmBA,EAAW,CAAC,EACxE,0BAA2B,KAAK,mBAAmBA,EAAW,CAAC,EAC/D,YAAa,KAAK,mBAAmBA,EAAW,CAAC,EACjD,gBAAiB,KAAK,mBAAmBA,EAAW,CAAC,EACrD,iBAAkB,KAAK,mBAAmBA,EAAW,CAAC,CACxD,CACF,CAOA,wBAAiD,CAC/C,MAAM,IAAI,MAAM,iBAAiB,CACnC,CAOA,kBAAqC,CACnC,MAAM,IAAI,MAAM,iBAAiB,CACnC,CAOA,kBAAqC,CACnC,MAAM,IAAI,MAAM,iBAAiB,CACnC,CAQA,mBAAmBC,EAAc,EAAoB,CACnD,OAASA,GAAS,EAAI,EAAM,KAAO,CACrC,CACF",
6
+ "names": ["SecureElementFlagsParser_exports", "__export", "SecureElementFlagsParser", "__toCommonJS", "seFlags", "firstByte", "byte"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("vitest"),n=require("./SecureElementFlagsParser");(0,e.describe)("SecureElementFlagsParser",()=>{(0,e.it)("should throw an error if the secure element flags length is not 4",()=>{(0,e.expect)(()=>new n.SecureElementFlagsParser(new Uint8Array([0,1,2]))).toThrow("Invalid secure element flags length")}),(0,e.it)("should correctly parse the general device state",()=>{const o=new Uint8Array([170,0,0,0]),t=new n.SecureElementFlagsParser(o),r={isPinValidated:!0,hasMcuSerialNumber:!1,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!0,isOnboarded:!1,isMcuCodeSigned:!0,isInRecoveryMode:!1};(0,e.expect)(t.generalDeviceState()).toEqual(r)}),(0,e.it)("should throw an error for endorsementInformation method",()=>{const o=new Uint8Array([0,0,0,0]),t=new n.SecureElementFlagsParser(o);(0,e.expect)(()=>t.endorsementInformation()).toThrow("Not implemented")}),(0,e.it)("should throw an error for wordsInformation method",()=>{const o=new Uint8Array([0,0,0,0]),t=new n.SecureElementFlagsParser(o);(0,e.expect)(()=>t.wordsInformation()).toThrow("Not implemented")}),(0,e.it)("should throw an error for onboardingStatus method",()=>{const o=new Uint8Array([0,0,0,0]),t=new n.SecureElementFlagsParser(o);(0,e.expect)(()=>t.onboardingStatus()).toThrow("Not implemented")}),(0,e.it)("should correctly check the nth bit in a byte",()=>{const o=new Uint8Array([0,0,0,0]),t=new n.SecureElementFlagsParser(o),r=170;(0,e.expect)(t._checkNthBitInByte(r,1)).toBe(!0),(0,e.expect)(t._checkNthBitInByte(r,2)).toBe(!1),(0,e.expect)(t._checkNthBitInByte(r,3)).toBe(!0),(0,e.expect)(t._checkNthBitInByte(r,4)).toBe(!1),(0,e.expect)(t._checkNthBitInByte(r,5)).toBe(!0),(0,e.expect)(t._checkNthBitInByte(r,6)).toBe(!1),(0,e.expect)(t._checkNthBitInByte(r,7)).toBe(!0),(0,e.expect)(t._checkNthBitInByte(r,8)).toBe(!1)})});
2
+ //# sourceMappingURL=SecureElementFlagsParser.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/command/os/SecureElementFlagsParser.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport { type DeviceGeneralState } from \"@api/device/SecureElementFlags\";\n\nimport { SecureElementFlagsParser } from \"./SecureElementFlagsParser\";\n\ndescribe(\"SecureElementFlagsParser\", () => {\n it(\"should throw an error if the secure element flags length is not 4\", () => {\n expect(\n () => new SecureElementFlagsParser(new Uint8Array([0x00, 0x01, 0x02])),\n ).toThrow(\"Invalid secure element flags length\");\n });\n\n it(\"should correctly parse the general device state\", () => {\n const seFlags = new Uint8Array([0b10101010, 0x00, 0x00, 0x00]);\n const parser = new SecureElementFlagsParser(seFlags);\n const expectedState: DeviceGeneralState = {\n isPinValidated: true,\n hasMcuSerialNumber: false,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: true,\n isOnboarded: false,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n };\n expect(parser.generalDeviceState()).toEqual(expectedState);\n });\n\n it(\"should throw an error for endorsementInformation method\", () => {\n const seFlags = new Uint8Array([0x00, 0x00, 0x00, 0x00]);\n const parser = new SecureElementFlagsParser(seFlags);\n expect(() => parser.endorsementInformation()).toThrow(\"Not implemented\");\n });\n\n it(\"should throw an error for wordsInformation method\", () => {\n const seFlags = new Uint8Array([0x00, 0x00, 0x00, 0x00]);\n const parser = new SecureElementFlagsParser(seFlags);\n expect(() => parser.wordsInformation()).toThrow(\"Not implemented\");\n });\n\n it(\"should throw an error for onboardingStatus method\", () => {\n const seFlags = new Uint8Array([0x00, 0x00, 0x00, 0x00]);\n const parser = new SecureElementFlagsParser(seFlags);\n expect(() => parser.onboardingStatus()).toThrow(\"Not implemented\");\n });\n\n it(\"should correctly check the nth bit in a byte\", () => {\n const seFlags = new Uint8Array([0x00, 0x00, 0x00, 0x00]);\n const parser = new SecureElementFlagsParser(seFlags);\n const byte = 0b10101010;\n expect(parser._checkNthBitInByte(byte, 1)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 2)).toBe(false);\n expect(parser._checkNthBitInByte(byte, 3)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 4)).toBe(false);\n expect(parser._checkNthBitInByte(byte, 5)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 6)).toBe(false);\n expect(parser._checkNthBitInByte(byte, 7)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 8)).toBe(false);\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAqC,kBAIrCC,EAAyC,yCAEzC,YAAS,2BAA4B,IAAM,IACzC,MAAG,oEAAqE,IAAM,IAC5E,UACE,IAAM,IAAI,2BAAyB,IAAI,WAAW,CAAC,EAAM,EAAM,CAAI,CAAC,CAAC,CACvE,EAAE,QAAQ,qCAAqC,CACjD,CAAC,KAED,MAAG,kDAAmD,IAAM,CAC1D,MAAMC,EAAU,IAAI,WAAW,CAA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BE,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,KACrD,UAAOF,EAAO,mBAAmBE,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,KACpD,UAAOF,EAAO,mBAAmBE,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,KACrD,UAAOF,EAAO,mBAAmBE,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,KACpD,UAAOF,EAAO,mBAAmBE,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,CACvD,CAAC,CACH,CAAC",
6
+ "names": ["import_vitest", "import_SecureElementFlagsParser", "seFlags", "parser", "expectedState", "byte"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var t=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var c=(o,e)=>{for(var n in e)t(o,n,{get:e[n],enumerable:!0})},l=(o,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of V(e))!d.call(o,r)&&r!==n&&t(o,r,{get:()=>e[r],enumerable:!(i=a(e,r))||i.enumerable});return o};var g=o=>l(t({},"__esModule",{value:!0}),o);var S={};c(S,{getOsVersionCommandResponseMockBuilder:()=>m});module.exports=g(S);var s=require("../../../device/DeviceModel");const m=(o=s.DeviceModelId.NANO_SP,e={})=>({[s.DeviceModelId.NANO_SP]:{targetId:856686596,seVersion:"1.1.1",seFlags:3858759680,mcuSephVersion:"4.03",mcuBootloaderVersion:"3.12",hwVersion:"00",langId:"00",recoverState:"00",...e},[s.DeviceModelId.NANO_S]:{targetId:858783748,seVersion:"1.1.1",seFlags:3858759680,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:"00",recoverState:"00",...e},[s.DeviceModelId.NANO_X]:{targetId:855638020,seVersion:"2.2.3",seFlags:3858759680,mcuSephVersion:"2.30",mcuBootloaderVersion:"1.16",hwVersion:"00",langId:"00",recoverState:"00"},[s.DeviceModelId.STAX]:{targetId:857735172,seVersion:"1.3.0",seFlags:3858759680,mcuSephVersion:"5.24",mcuBootloaderVersion:"0.48",hwVersion:"00",langId:"00",recoverState:"00",...e},[s.DeviceModelId.FLEX]:{targetId:858783748,seVersion:"1.1.1",seFlags:3858759680,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:"00",recoverState:"00",...e}})[o];0&&(module.exports={getOsVersionCommandResponseMockBuilder});
1
+ "use strict";var t=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var u=(s,e)=>{for(var o in e)t(s,o,{get:e[o],enumerable:!0})},c=(s,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of d(e))!l.call(s,i)&&i!==o&&t(s,i,{get:()=>e[i],enumerable:!(a=n(e,i))||a.enumerable});return s};var f=s=>c(t({},"__esModule",{value:!0}),s);var m={};u(m,{getOsVersionCommandResponseMockBuilder:()=>g});module.exports=f(m);var r=require("../../../device/DeviceModel");const g=(s=r.DeviceModelId.NANO_SP,e={})=>({[r.DeviceModelId.NANO_SP]:{isBootloader:!1,isOsu:!1,targetId:856686596,seTargetId:856686596,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"4.03",mcuBootloaderVersion:"3.12",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[r.DeviceModelId.NANO_S]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[r.DeviceModelId.NANO_X]:{isBootloader:!1,isOsu:!1,targetId:855638020,seTargetId:855638020,seVersion:"2.2.3",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"2.30",mcuBootloaderVersion:"1.16",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1}},[r.DeviceModelId.STAX]:{isBootloader:!1,isOsu:!1,targetId:857735172,seTargetId:857735172,seVersion:"1.3.0",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"5.24",mcuBootloaderVersion:"0.48",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[r.DeviceModelId.FLEX]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...e},[r.DeviceModelId.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}}})[s];0&&(module.exports={getOsVersionCommandResponseMockBuilder});
2
2
  //# sourceMappingURL=GetOsVersionCommand.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/command/os/__mocks__/GetOsVersionCommand.ts"],
4
- "sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n targetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: 3858759680,\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n ...props,\n },\n [DeviceModelId.NANO_S]: {\n targetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: 3858759680,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n ...props,\n },\n [DeviceModelId.NANO_X]: {\n targetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: 3858759680,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n },\n [DeviceModelId.STAX]: {\n targetId: 857735172,\n seVersion: \"1.3.0\",\n seFlags: 3858759680,\n mcuSephVersion: \"5.24\",\n mcuBootloaderVersion: \"0.48\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n ...props,\n },\n [DeviceModelId.FLEX]: {\n targetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: 3858759680,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: \"00\",\n recoverState: \"00\",\n ...props,\n },\n })[deviceModelId];\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA8B,mCAEvB,MAAMF,EAAyC,CACpDG,EAA+B,gBAAc,QAC7CC,EAAuC,CAAC,KAEvC,CACC,CAAC,gBAAc,OAAO,EAAG,CACvB,SAAU,UACV,UAAW,QACX,QAAS,WACT,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,KACR,aAAc,KACd,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,SAAU,UACV,UAAW,QACX,QAAS,WACT,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,KACR,aAAc,KACd,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,SAAU,UACV,UAAW,QACX,QAAS,WACT,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,KACR,aAAc,IAChB,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,SAAU,UACV,UAAW,QACX,QAAS,WACT,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,KACR,aAAc,KACd,GAAGA,CACL,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,SAAU,UACV,UAAW,QACX,QAAS,WACT,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,KACR,aAAc,KACd,GAAGA,CACL,CACF,GAAGD,CAAa",
4
+ "sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n isBootloader: false,\n isOsu: false,\n targetId: 856686596,\n seTargetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_S]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_X]: {\n isBootloader: false,\n isOsu: false,\n targetId: 855638020,\n seTargetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n },\n [DeviceModelId.STAX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 857735172,\n seTargetId: 857735172,\n seVersion: \"1.3.0\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"5.24\",\n mcuBootloaderVersion: \"0.48\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.FLEX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA8B,mCAEvB,MAAMF,EAAyC,CACpDG,EAA+B,gBAAc,QAC7CC,EAAuC,CAAC,KAEvC,CACC,CAAC,gBAAc,OAAO,EAAG,CACvB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,EACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,EACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ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CACF,CACF,GAAGD,CAAa",
6
6
  "names": ["GetOsVersionCommand_exports", "__export", "getOsVersionCommandResponseMockBuilder", "__toCommonJS", "import_DeviceModel", "deviceModelId", "props"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var y=(o,e)=>{for(var s in e)c(o,s,{get:e[s],enumerable:!0})},C=(o,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!u.call(o,r)&&r!==s&&c(o,r,{get:()=>e[r],enumerable:!(i=S(e,r))||i.enumerable});return o};var h=o=>C(c({},"__esModule",{value:!0}),o),v=(o,e,s,i)=>{for(var r=i>1?void 0:i?S(e,s):e,a=o.length-1,g;a>=0;a--)(g=o[a])&&(r=(i?g(e,s,r):g(r))||r);return i&&r&&c(e,s,r),r},m=(o,e)=>(s,i)=>e(s,i,o);var f={};y(f,{SendCommandUseCase:()=>t});module.exports=h(f);var n=require("inversify"),d=require("../../../internal/device-session/di/deviceSessionTypes"),p=require("../../../internal/logger-publisher/di/loggerTypes");let t=class{_sessionService;_logger;constructor(e,s){this._sessionService=e,this._logger=s("SendCommandUseCase")}async execute({sessionId:e,command:s}){return this._sessionService.getDeviceSessionById(e).caseOf({Right:async r=>await r.sendCommand(s),Left:r=>{throw this._logger.error("Error getting session",{data:{error:r}}),r}})}};t=v([(0,n.injectable)(),m(0,(0,n.inject)(d.deviceSessionTypes.DeviceSessionService)),m(1,(0,n.inject)(p.loggerTypes.LoggerPublisherServiceFactory))],t);0&&(module.exports={SendCommandUseCase});
1
+ "use strict";var a=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var y=(o,e)=>{for(var r in e)a(o,r,{get:e[r],enumerable:!0})},C=(o,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!u.call(o,s)&&s!==r&&a(o,s,{get:()=>e[s],enumerable:!(i=S(e,s))||i.enumerable});return o};var h=o=>C(a({},"__esModule",{value:!0}),o),d=(o,e,r,i)=>{for(var s=i>1?void 0:i?S(e,r):e,t=o.length-1,g;t>=0;t--)(g=o[t])&&(s=(i?g(e,r,s):g(s))||s);return i&&s&&a(e,r,s),s},m=(o,e)=>(r,i)=>e(r,i,o);var f={};y(f,{SendCommandUseCase:()=>n});module.exports=h(f);var c=require("inversify"),v=require("../../../internal/device-session/di/deviceSessionTypes"),p=require("../../../internal/logger-publisher/di/loggerTypes");let n=class{_sessionService;_logger;constructor(e,r){this._sessionService=e,this._logger=r("SendCommandUseCase")}async execute({sessionId:e,command:r,abortTimeout:i}){return this._sessionService.getDeviceSessionById(e).caseOf({Right:async t=>await t.sendCommand(r,i),Left:t=>{throw this._logger.error("Error getting session",{data:{error:t}}),t}})}};n=d([(0,c.injectable)(),m(0,(0,c.inject)(v.deviceSessionTypes.DeviceSessionService)),m(1,(0,c.inject)(p.loggerTypes.LoggerPublisherServiceFactory))],n);0&&(module.exports={SendCommandUseCase});
2
2
  //# sourceMappingURL=SendCommandUseCase.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/use-case/SendCommandUseCase.ts"],
4
- "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { Command } from \"@api/command/Command\";\nimport { CommandResult } from \"@api/command/model/CommandResult\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\n\nexport type SendCommandUseCaseArgs<Response, ErrorStatusCodes, Args = void> = {\n /**\n * The device session id.\n */\n readonly sessionId: string;\n /**\n * The command to send.\n */\n readonly command: Command<Response, ErrorStatusCodes, Args>;\n};\n\n/**\n * Sends a command to a device through a device session.\n */\n@injectable()\nexport class SendCommandUseCase {\n private readonly _sessionService: DeviceSessionService;\n private readonly _logger: LoggerPublisherService;\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._sessionService = sessionService;\n this._logger = loggerFactory(\"SendCommandUseCase\");\n }\n\n /**\n * Sends a command to a device through a device session.\n *\n * @param sessionId - The device session id.\n * @param command - The command to send.\n * @returns The response from the command.\n */\n async execute<Response, Args, ErrorStatusCodes>({\n sessionId,\n command,\n }: SendCommandUseCaseArgs<Response, Args, ErrorStatusCodes>): Promise<\n CommandResult<Response, ErrorStatusCodes>\n > {\n const deviceSessionOrError =\n this._sessionService.getDeviceSessionById(sessionId);\n\n return deviceSessionOrError.caseOf({\n // Case device session found\n Right: async (deviceSession) =>\n await deviceSession.sendCommand<Response, Args, ErrorStatusCodes>(\n command,\n ),\n // Case device session not found\n Left: (error) => {\n this._logger.error(\"Error getting session\", {\n data: { error },\n });\n throw error;\n },\n });\n }\n}\n"],
5
- "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAAmC,0DAEnCC,EAA4B,qDAiBrB,IAAMC,EAAN,KAAyB,CACb,gBACA,QACjB,YAEEC,EAEAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,QAAUC,EAAc,oBAAoB,CACnD,CASA,MAAM,QAA0C,CAC9C,UAAAC,EACA,QAAAC,CACF,EAEE,CAIA,OAFE,KAAK,gBAAgB,qBAAqBD,CAAS,EAEzB,OAAO,CAEjC,MAAO,MAAOE,GACZ,MAAMA,EAAc,YAClBD,CACF,EAEF,KAAOE,GAAU,CACf,WAAK,QAAQ,MAAM,wBAAyB,CAC1C,KAAM,CAAE,MAAAA,CAAM,CAChB,CAAC,EACKA,CACR,CACF,CAAC,CACH,CACF,EA5CaN,EAANO,EAAA,IADN,cAAW,EAKPC,EAAA,eAAO,qBAAmB,oBAAoB,GAE9CA,EAAA,eAAO,cAAY,6BAA6B,IANxCR",
6
- "names": ["SendCommandUseCase_exports", "__export", "SendCommandUseCase", "__toCommonJS", "import_inversify", "import_deviceSessionTypes", "import_loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "deviceSession", "error", "__decorateClass", "__decorateParam"]
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { Command } from \"@api/command/Command\";\nimport { CommandResult } from \"@api/command/model/CommandResult\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\n\nexport type SendCommandUseCaseArgs<Response, ErrorStatusCodes, Args = void> = {\n /**\n * The device session id.\n */\n readonly sessionId: string;\n /**\n * The command to send.\n */\n readonly command: Command<Response, ErrorStatusCodes, Args>;\n /**\n * The timeout to abort the command.\n */\n readonly abortTimeout?: number;\n};\n\n/**\n * Sends a command to a device through a device session.\n */\n@injectable()\nexport class SendCommandUseCase {\n private readonly _sessionService: DeviceSessionService;\n private readonly _logger: LoggerPublisherService;\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._sessionService = sessionService;\n this._logger = loggerFactory(\"SendCommandUseCase\");\n }\n\n /**\n * Sends a command to a device through a device session.\n *\n * @param sessionId - The device session id.\n * @param command - The command to send.\n * @returns The response from the command.\n */\n async execute<Response, Args, ErrorStatusCodes>({\n sessionId,\n command,\n abortTimeout,\n }: SendCommandUseCaseArgs<Response, Args, ErrorStatusCodes>): Promise<\n CommandResult<Response, ErrorStatusCodes>\n > {\n const deviceSessionOrError =\n this._sessionService.getDeviceSessionById(sessionId);\n\n return deviceSessionOrError.caseOf({\n // Case device session found\n Right: async (deviceSession) =>\n await deviceSession.sendCommand<Response, Args, ErrorStatusCodes>(\n command,\n abortTimeout,\n ),\n // Case device session not found\n Left: (error) => {\n this._logger.error(\"Error getting session\", {\n data: { error },\n });\n throw error;\n },\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAAmC,0DAEnCC,EAA4B,qDAqBrB,IAAMC,EAAN,KAAyB,CACb,gBACA,QACjB,YAEEC,EAEAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,QAAUC,EAAc,oBAAoB,CACnD,CASA,MAAM,QAA0C,CAC9C,UAAAC,EACA,QAAAC,EACA,aAAAC,CACF,EAEE,CAIA,OAFE,KAAK,gBAAgB,qBAAqBF,CAAS,EAEzB,OAAO,CAEjC,MAAO,MAAOG,GACZ,MAAMA,EAAc,YAClBF,EACAC,CACF,EAEF,KAAOE,GAAU,CACf,WAAK,QAAQ,MAAM,wBAAyB,CAC1C,KAAM,CAAE,MAAAA,CAAM,CAChB,CAAC,EACKA,CACR,CACF,CAAC,CACH,CACF,EA9CaP,EAANQ,EAAA,IADN,cAAW,EAKPC,EAAA,eAAO,qBAAmB,oBAAoB,GAE9CA,EAAA,eAAO,cAAY,6BAA6B,IANxCT",
6
+ "names": ["SendCommandUseCase_exports", "__export", "SendCommandUseCase", "__toCommonJS", "import_inversify", "import_deviceSessionTypes", "import_loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "abortTimeout", "deviceSession", "error", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var d=require("purify-ts"),i=require("../../command/model/CommandResult"),p=require("../../../internal/device-session/model/DeviceSession.stub"),f=require("../../../internal/device-session/service/DefaultDeviceSessionService"),l=require("../../../internal/logger-publisher/service/DefaultLoggerPublisherService"),v=require("../../../internal/manager-api/data/AxiosManagerApiDataSource"),g=require("../../../internal/manager-api/service/DefaultManagerApiService"),D=require("../../../internal/secure-channel/data/DefaultSecureChannelDataSource"),C=require("../../../internal/secure-channel/service/DefaultSecureChannelService"),a=require("./SendCommandUseCase");let o,t,n,c,m,u;const S="fakeSessionId";let s;describe("SendCommandUseCase",()=>{beforeEach(()=>{o=new l.DefaultLoggerPublisherService([],"send-command-use-case"),t=new f.DefaultDeviceSessionService(()=>o),c=new v.AxiosManagerApiDataSource({}),n=new g.DefaultManagerApiService(c),u=new D.DefaultSecureChannelDataSource({}),m=new C.DefaultSecureChannelService(u),s={getApdu:vi.fn(),parseResponse:vi.fn()}}),afterEach(()=>{vi.restoreAllMocks()}),it("should send a command to a connected device",async()=>{const e=(0,p.deviceSessionStubBuilder)({},()=>o,n,m);t.addDeviceSession(e);const r=new a.SendCommandUseCase(t,()=>o);vi.spyOn(e,"sendCommand").mockResolvedValue({status:i.CommandResultStatus.Success,data:void 0});const h=await r.execute({sessionId:S,command:s});e.close(),expect(h).toStrictEqual({status:i.CommandResultStatus.Success,data:void 0})}),it("should throw an error if the session is not found",async()=>{const e=new a.SendCommandUseCase(t,()=>o);vi.spyOn(t,"getDeviceSessionById").mockReturnValue((0,d.Left)({_tag:"DeviceSessionNotFound"}));const r=e.execute({sessionId:S,command:s});await expect(r).rejects.toMatchObject({_tag:"DeviceSessionNotFound"})})});
1
+ "use strict";var d=require("purify-ts"),i=require("../../command/model/CommandResult"),p=require("../../../internal/device-session/data/DeviceSessionRefresherConst"),f=require("../../../internal/device-session/model/DeviceSession.stub"),l=require("../../../internal/device-session/service/DefaultDeviceSessionService"),v=require("../../../internal/logger-publisher/service/DefaultLoggerPublisherService"),g=require("../../../internal/manager-api/data/AxiosManagerApiDataSource"),D=require("../../../internal/manager-api/service/DefaultManagerApiService"),C=require("../../../internal/secure-channel/data/DefaultSecureChannelDataSource"),h=require("../../../internal/secure-channel/service/DefaultSecureChannelService"),a=require("./SendCommandUseCase");let o,t,n,c,m,u;const S="fakeSessionId";let s;describe("SendCommandUseCase",()=>{beforeEach(()=>{o=new v.DefaultLoggerPublisherService([],"send-command-use-case"),t=new l.DefaultDeviceSessionService(()=>o),c=new g.AxiosManagerApiDataSource({}),n=new D.DefaultManagerApiService(c),u=new C.DefaultSecureChannelDataSource({}),m=new h.DefaultSecureChannelService(u),s={getApdu:vi.fn(),parseResponse:vi.fn()}}),afterEach(()=>{vi.restoreAllMocks()}),it("should send a command to a connected device",async()=>{const e=(0,f.deviceSessionStubBuilder)({},()=>o,n,m,p.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS);t.addDeviceSession(e);const r=new a.SendCommandUseCase(t,()=>o);vi.spyOn(e,"sendCommand").mockResolvedValue({status:i.CommandResultStatus.Success,data:void 0});const y=await r.execute({sessionId:S,command:s});e.close(),expect(y).toStrictEqual({status:i.CommandResultStatus.Success,data:void 0})}),it("should throw an error if the session is not found",async()=>{const e=new a.SendCommandUseCase(t,()=>o);vi.spyOn(t,"getDeviceSessionById").mockReturnValue((0,d.Left)({_tag:"DeviceSessionNotFound"}));const r=e.execute({sessionId:S,command:s});await expect(r).rejects.toMatchObject({_tag:"DeviceSessionNotFound"})})});
2
2
  //# sourceMappingURL=SendCommandUseCase.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/use-case/SendCommandUseCase.test.ts"],
4
- "sourcesContent": ["import { Left } from \"purify-ts\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { CommandResultStatus } from \"@api/command/model/CommandResult\";\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { SendCommandUseCase } from \"./SendCommandUseCase\";\n\nlet logger: LoggerPublisherService;\nlet sessionService: DeviceSessionService;\nlet managerApi: ManagerApiService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet secureChannel: SecureChannelService;\nlet secureChannelDataSource: SecureChannelDataSource;\nconst fakeSessionId = \"fakeSessionId\";\nlet command: Command<{ status: string }>;\n\ndescribe(\"SendCommandUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService([], \"send-command-use-case\");\n sessionService = new DefaultDeviceSessionService(() => logger);\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n command = {\n getApdu: vi.fn(),\n parseResponse: vi.fn(),\n };\n });\n\n afterEach(() => {\n vi.restoreAllMocks();\n });\n\n it(\"should send a command to a connected device\", async () => {\n const deviceSession = deviceSessionStubBuilder(\n {},\n () => logger,\n managerApi,\n secureChannel,\n );\n sessionService.addDeviceSession(deviceSession);\n const useCase = new SendCommandUseCase(sessionService, () => logger);\n\n vi.spyOn(deviceSession, \"sendCommand\").mockResolvedValue({\n status: CommandResultStatus.Success,\n data: undefined,\n });\n\n const response = await useCase.execute<{ status: string }, void, void>({\n sessionId: fakeSessionId,\n command,\n });\n\n deviceSession.close();\n\n expect(response).toStrictEqual({\n status: CommandResultStatus.Success,\n data: undefined,\n });\n });\n\n it(\"should throw an error if the session is not found\", async () => {\n const useCase = new SendCommandUseCase(sessionService, () => logger);\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockReturnValue(\n Left({ _tag: \"DeviceSessionNotFound\" }),\n );\n\n const res = useCase.execute<{ status: string }, void, void>({\n sessionId: fakeSessionId,\n command,\n });\n\n await expect(res).rejects.toMatchObject({ _tag: \"DeviceSessionNotFound\" });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAqB,qBAGrBC,EAAoC,4CAGpCC,EAAyC,6DACzCC,EAA4C,wEAE5CC,EAA8C,4EAC9CC,EAA0C,gEAE1CC,EAAyC,kEAEzCC,EAA+C,wEAE/CC,EAA4C,wEAG5CC,EAAmC,gCAEnC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,MAAMC,EAAgB,gBACtB,IAAIC,EAEJ,SAAS,qBAAsB,IAAM,CACnC,WAAW,IAAM,CACfP,EAAS,IAAI,gCAA8B,CAAC,EAAG,uBAAuB,EACtEC,EAAiB,IAAI,8BAA4B,IAAMD,CAAM,EAC7DG,EAAuB,IAAI,4BAA0B,CAAC,CAAc,EACpED,EAAa,IAAI,2BAAyBC,CAAoB,EAC9DE,EAA0B,IAAI,iCAC5B,CAAC,CACH,EACAD,EAAgB,IAAI,8BAA4BC,CAAuB,EACvEE,EAAU,CACR,QAAS,GAAG,GAAG,EACf,cAAe,GAAG,GAAG,CACvB,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,gBAAgB,CACrB,CAAC,EAED,GAAG,8CAA+C,SAAY,CAC5D,MAAMC,KAAgB,4BACpB,CAAC,EACD,IAAMR,EACNE,EACAE,CACF,EACAH,EAAe,iBAAiBO,CAAa,EAC7C,MAAMC,EAAU,IAAI,qBAAmBR,EAAgB,IAAMD,CAAM,EAEnE,GAAG,MAAMQ,EAAe,aAAa,EAAE,kBAAkB,CACvD,OAAQ,sBAAoB,QAC5B,KAAM,MACR,CAAC,EAED,MAAME,EAAW,MAAMD,EAAQ,QAAwC,CACrE,UAAWH,EACX,QAAAC,CACF,CAAC,EAEDC,EAAc,MAAM,EAEpB,OAAOE,CAAQ,EAAE,cAAc,CAC7B,OAAQ,sBAAoB,QAC5B,KAAM,MACR,CAAC,CACH,CAAC,EAED,GAAG,oDAAqD,SAAY,CAClE,MAAMD,EAAU,IAAI,qBAAmBR,EAAgB,IAAMD,CAAM,EACnE,GAAG,MAAMC,EAAgB,sBAAsB,EAAE,mBAC/C,QAAK,CAAE,KAAM,uBAAwB,CAAC,CACxC,EAEA,MAAMU,EAAMF,EAAQ,QAAwC,CAC1D,UAAWH,EACX,QAAAC,CACF,CAAC,EAED,MAAM,OAAOI,CAAG,EAAE,QAAQ,cAAc,CAAE,KAAM,uBAAwB,CAAC,CAC3E,CAAC,CACH,CAAC",
6
- "names": ["import_purify_ts", "import_CommandResult", "import_DeviceSession", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_SendCommandUseCase", "logger", "sessionService", "managerApi", "managerApiDataSource", "secureChannel", "secureChannelDataSource", "fakeSessionId", "command", "deviceSession", "useCase", "response", "res"]
4
+ "sourcesContent": ["import { Left } from \"purify-ts\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { CommandResultStatus } from \"@api/command/model/CommandResult\";\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { SendCommandUseCase } from \"./SendCommandUseCase\";\n\nlet logger: LoggerPublisherService;\nlet sessionService: DeviceSessionService;\nlet managerApi: ManagerApiService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet secureChannel: SecureChannelService;\nlet secureChannelDataSource: SecureChannelDataSource;\nconst fakeSessionId = \"fakeSessionId\";\nlet command: Command<{ status: string }>;\n\ndescribe(\"SendCommandUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService([], \"send-command-use-case\");\n sessionService = new DefaultDeviceSessionService(() => logger);\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n command = {\n getApdu: vi.fn(),\n parseResponse: vi.fn(),\n };\n });\n\n afterEach(() => {\n vi.restoreAllMocks();\n });\n\n it(\"should send a command to a connected device\", async () => {\n const deviceSession = deviceSessionStubBuilder(\n {},\n () => logger,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n sessionService.addDeviceSession(deviceSession);\n const useCase = new SendCommandUseCase(sessionService, () => logger);\n\n vi.spyOn(deviceSession, \"sendCommand\").mockResolvedValue({\n status: CommandResultStatus.Success,\n data: undefined,\n });\n\n const response = await useCase.execute<{ status: string }, void, void>({\n sessionId: fakeSessionId,\n command,\n });\n\n deviceSession.close();\n\n expect(response).toStrictEqual({\n status: CommandResultStatus.Success,\n data: undefined,\n });\n });\n\n it(\"should throw an error if the session is not found\", async () => {\n const useCase = new SendCommandUseCase(sessionService, () => logger);\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockReturnValue(\n Left({ _tag: \"DeviceSessionNotFound\" }),\n );\n\n const res = useCase.execute<{ status: string }, void, void>({\n sessionId: fakeSessionId,\n command,\n });\n\n await expect(res).rejects.toMatchObject({ _tag: \"DeviceSessionNotFound\" });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAqB,qBAGrBC,EAAoC,4CAGpCC,EAAyD,qEACzDC,EAAyC,6DACzCC,EAA4C,wEAE5CC,EAA8C,4EAC9CC,EAA0C,gEAE1CC,EAAyC,kEAEzCC,EAA+C,wEAE/CC,EAA4C,wEAG5CC,EAAmC,gCAEnC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,MAAMC,EAAgB,gBACtB,IAAIC,EAEJ,SAAS,qBAAsB,IAAM,CACnC,WAAW,IAAM,CACfP,EAAS,IAAI,gCAA8B,CAAC,EAAG,uBAAuB,EACtEC,EAAiB,IAAI,8BAA4B,IAAMD,CAAM,EAC7DG,EAAuB,IAAI,4BAA0B,CAAC,CAAc,EACpED,EAAa,IAAI,2BAAyBC,CAAoB,EAC9DE,EAA0B,IAAI,iCAC5B,CAAC,CACH,EACAD,EAAgB,IAAI,8BAA4BC,CAAuB,EACvEE,EAAU,CACR,QAAS,GAAG,GAAG,EACf,cAAe,GAAG,GAAG,CACvB,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,gBAAgB,CACrB,CAAC,EAED,GAAG,8CAA+C,SAAY,CAC5D,MAAMC,KAAgB,4BACpB,CAAC,EACD,IAAMR,EACNE,EACAE,EACA,0CACF,EACAH,EAAe,iBAAiBO,CAAa,EAC7C,MAAMC,EAAU,IAAI,qBAAmBR,EAAgB,IAAMD,CAAM,EAEnE,GAAG,MAAMQ,EAAe,aAAa,EAAE,kBAAkB,CACvD,OAAQ,sBAAoB,QAC5B,KAAM,MACR,CAAC,EAED,MAAME,EAAW,MAAMD,EAAQ,QAAwC,CACrE,UAAWH,EACX,QAAAC,CACF,CAAC,EAEDC,EAAc,MAAM,EAEpB,OAAOE,CAAQ,EAAE,cAAc,CAC7B,OAAQ,sBAAoB,QAC5B,KAAM,MACR,CAAC,CACH,CAAC,EAED,GAAG,oDAAqD,SAAY,CAClE,MAAMD,EAAU,IAAI,qBAAmBR,EAAgB,IAAMD,CAAM,EACnE,GAAG,MAAMC,EAAgB,sBAAsB,EAAE,mBAC/C,QAAK,CAAE,KAAM,uBAAwB,CAAC,CACxC,EAEA,MAAMU,EAAMF,EAAQ,QAAwC,CAC1D,UAAWH,EACX,QAAAC,CACF,CAAC,EAED,MAAM,OAAOI,CAAG,EAAE,QAAQ,cAAc,CAAE,KAAM,uBAAwB,CAAC,CAC3E,CAAC,CACH,CAAC",
6
+ "names": ["import_purify_ts", "import_CommandResult", "import_DeviceSessionRefresherConst", "import_DeviceSession", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_SendCommandUseCase", "logger", "sessionService", "managerApi", "managerApiDataSource", "secureChannel", "secureChannelDataSource", "fakeSessionId", "command", "deviceSession", "useCase", "response", "res"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var s in e)a(t,s,{get:e[s],enumerable:!0})},x=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of o(e))!u.call(t,r)&&r!==s&&a(t,r,{get:()=>e[r],enumerable:!(i=p(e,r))||i.enumerable});return t};var A=t=>x(a({},"__esModule",{value:!0}),t);var l={};c(l,{CommandUtils:()=>n});module.exports=A(l);class n{static isValidStatusCode(e){return e.length===2}static isSuccessResponse({statusCode:e}){return n.isValidStatusCode(e)?e[0]===144&&e[1]===0:!1}static isLockedDeviceResponse({statusCode:e}){return n.isValidStatusCode(e)?e[0]===85&&e[1]===21:!1}static isApduThatTriggersDisconnection(e){const s=new Map;return s.set("openApp",new Uint8Array([224,216,0,0])),s.set("closeApp",new Uint8Array([176,167,0,0])),Array.from(s.values()).some(i=>{for(let r=0;r<4;r++)if(i[r]!==e[r])return!1;return!0})}}0&&(module.exports={CommandUtils});
1
+ "use strict";var f=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var a=(x,r)=>{for(var i in r)f(x,i,{get:r[i],enumerable:!0})},y=(x,r,i,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of c(r))!l.call(x,e)&&e!==i&&f(x,e,{get:()=>r[e],enumerable:!(p=A(r,e))||p.enumerable});return x};var R=x=>y(f({},"__esModule",{value:!0}),x);var S={};a(S,{CommandUtils:()=>n});module.exports=R(S);class n{static isValidStatusCode(r){return r.length===2}static isSuccessResponse({statusCode:r}){return n.isValidStatusCode(r)?r[0]===144&&r[1]===0:!1}static isLockedDeviceResponse({statusCode:r}){return n.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 n.isValidStatusCode(r)?r[0]===85&&r[1]===1||r[0]===105&&r[1]===133:!1}static isAppAlreadyInstalled({statusCode:r}){return n.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 n.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 i=new Map;return i.set("openApp",new Uint8Array([224,216,0,0])),i.set("closeApp",new Uint8Array([176,167,0,0])),Array.from(i.values()).some(p=>{for(let e=0;e<4;e++)if(p[e]!==r[e])return!1;return!0})}}0&&(module.exports={CommandUtils});
2
2
  //# sourceMappingURL=CommandUtils.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/utils/CommandUtils.ts"],
4
- "sourcesContent": ["import { type ApduResponse } from \"@api/device-session/ApduResponse\";\n\nexport class CommandUtils {\n static isValidStatusCode(statusCode: Uint8Array) {\n return statusCode.length === 2;\n }\n\n static isSuccessResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x90 && statusCode[1] === 0x00;\n }\n\n static isLockedDeviceResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x55 && statusCode[1] === 0x15;\n }\n\n static isApduThatTriggersDisconnection(apdu: Uint8Array) {\n /**\n * Map of known APDUs that trigger a disconnection.\n */\n const apduMap = new Map();\n apduMap.set(\"openApp\", new Uint8Array([0xe0, 0xd8, 0x00, 0x00]));\n apduMap.set(\"closeApp\", new Uint8Array([0xb0, 0xa7, 0x00, 0x00]));\n // TODO: add more APDUs that trigger a disconnection (e.g firmware flashing ?)\n\n // check if apdu first 4 UintArray is included in apduMap\n return Array.from(apduMap.values()).some((value: Uint8Array) => {\n for (let i = 0; i < 4; i++) {\n if (value[i] !== apdu[i]) {\n return false;\n }\n }\n return true;\n });\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAEO,MAAME,CAAa,CACxB,OAAO,kBAAkBE,EAAwB,CAC/C,OAAOA,EAAW,SAAW,CAC/B,CAEA,OAAO,kBAAkB,CAAE,WAAAA,CAAW,EAAiB,CACrD,OAAKF,EAAa,kBAAkBE,CAAU,EAIvCA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,EAH1C,EAIX,CAEA,OAAO,uBAAuB,CAAE,WAAAA,CAAW,EAAiB,CAC1D,OAAKF,EAAa,kBAAkBE,CAAU,EAIvCA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,GAH1C,EAIX,CAEA,OAAO,gCAAgCC,EAAkB,CAIvD,MAAMC,EAAU,IAAI,IACpB,OAAAA,EAAQ,IAAI,UAAW,IAAI,WAAW,CAAC,IAAM,IAAM,EAAM,CAAI,CAAC,CAAC,EAC/DA,EAAQ,IAAI,WAAY,IAAI,WAAW,CAAC,IAAM,IAAM,EAAM,CAAI,CAAC,CAAC,EAIzD,MAAM,KAAKA,EAAQ,OAAO,CAAC,EAAE,KAAMC,GAAsB,CAC9D,QAASC,EAAI,EAAGA,EAAI,EAAGA,IACrB,GAAID,EAAMC,CAAC,IAAMH,EAAKG,CAAC,EACrB,MAAO,GAGX,MAAO,EACT,CAAC,CACH,CACF",
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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,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,QAASC,EAAI,EAAGA,EAAI,EAAGA,IACrB,GAAID,EAAMC,CAAC,IAAMH,EAAKG,CAAC,EACrB,MAAO,GAGX,MAAO,EACT,CAAC,CACH,CACF",
6
6
  "names": ["CommandUtils_exports", "__export", "CommandUtils", "__toCommonJS", "statusCode", "apdu", "apduMap", "value", "i"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=require("../../command/os/CloseAppCommand"),r=require("../../command/os/GetAppAndVersionCommand"),i=require("../../command/os/OpenAppCommand"),s=require("../../device-session/ApduResponse"),t=require("./CommandUtils");describe("CommandUtils",()=>{describe("static isSuccessResponse",()=>{it("should return true if the status code is 0x9000",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.CommandUtils.isSuccessResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x9000",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])});expect(t.CommandUtils.isSuccessResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([85]),data:Uint8Array.from([])});expect(t.CommandUtils.isSuccessResponse(e)).toBe(!1)})}),describe("static isValidStatusCode",()=>{it("should return true if the status code is 2 bytes long",()=>{const e=Uint8Array.from([144,0]);expect(t.CommandUtils.isValidStatusCode(e)).toBe(!0)}),it("should return false if the status code is not 2 bytes long",()=>{const e=Uint8Array.from([144]);expect(t.CommandUtils.isValidStatusCode(e)).toBe(!1)})}),describe("static isLockedDeviceResponse",()=>{it("should return true if the status code is 0x5515",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([85,21]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x5515",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!1)})}),describe("static isApduThatTriggersDisconnection",()=>{it("should return true if the APDU is openApp",()=>{const e=new i.OpenAppCommand({appName:"test"}).getApdu().getRawApdu();expect(t.CommandUtils.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return true if the APDU is closeApp",()=>{const e=new o.CloseAppCommand().getApdu().getRawApdu();expect(t.CommandUtils.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return false if the APDU is not a known one",()=>{const e=new r.GetAppAndVersionCommand().getApdu().getRawApdu();expect(t.CommandUtils.isApduThatTriggersDisconnection(e)).toBe(!1)})})});
1
+ "use strict";var r=require("../../command/os/CloseAppCommand"),o=require("../../command/os/GetAppAndVersionCommand"),a=require("../../command/os/OpenAppCommand"),s=require("../../device-session/ApduResponse"),t=require("./CommandUtils");describe("CommandUtils",()=>{describe("static isSuccessResponse",()=>{it("should return true if the status code is 0x9000",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.CommandUtils.isSuccessResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x9000",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])});expect(t.CommandUtils.isSuccessResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([85]),data:Uint8Array.from([])});expect(t.CommandUtils.isSuccessResponse(e)).toBe(!1)})}),describe("static isValidStatusCode",()=>{it("should return true if the status code is 2 bytes long",()=>{const e=Uint8Array.from([144,0]);expect(t.CommandUtils.isValidStatusCode(e)).toBe(!0)}),it("should return false if the status code is not 2 bytes long",()=>{const e=Uint8Array.from([144]);expect(t.CommandUtils.isValidStatusCode(e)).toBe(!1)})}),describe("static isLockedDeviceResponse",()=>{it("should return true if the status code is 0x5515",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([85,21]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!0)}),it("should return true if the status code is 0x6982",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([105,130]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!0)}),it("should return true if the status code is 0x5303",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([83,3]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x5515",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144]),data:Uint8Array.from([])});expect(t.CommandUtils.isLockedDeviceResponse(e)).toBe(!1)})}),describe("static isRefusedByUser",()=>{it("should return true if the status code is 0x5501",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([85,1]),data:Uint8Array.from([])});expect(t.CommandUtils.isRefusedByUser(e)).toBe(!0)}),it("should return true if the status code is 0x6985",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([105,133]),data:Uint8Array.from([])});expect(t.CommandUtils.isRefusedByUser(e)).toBe(!0)}),it("should return false if the status code is not 0x5501",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.CommandUtils.isRefusedByUser(e)).toBe(!1)})}),describe("static isAppAlreadyInstalled",()=>{it("should return true if the status code is 0x6a80",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([106,128]),data:Uint8Array.from([])});expect(t.CommandUtils.isAppAlreadyInstalled(e)).toBe(!0)}),it("should return true if the status code is 0x6a81",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([106,129]),data:Uint8Array.from([])});expect(t.CommandUtils.isAppAlreadyInstalled(e)).toBe(!0)}),it("should return true if the status code is 0x6a8e",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([106,142]),data:Uint8Array.from([])});expect(t.CommandUtils.isAppAlreadyInstalled(e)).toBe(!0)}),it("should return true if the status code is 0x6a8f",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([106,143]),data:Uint8Array.from([])});expect(t.CommandUtils.isAppAlreadyInstalled(e)).toBe(!0)}),it("should return false if the status code is not 0x6a80",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.CommandUtils.isAppAlreadyInstalled(e)).toBe(!1)})}),describe("static isOutOfMemory",()=>{it("should return true if the status code is 0x6a84",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([106,132]),data:Uint8Array.from([])});expect(t.CommandUtils.isOutOfMemory(e)).toBe(!0)}),it("should return true if the status code is 0x6a85",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([106,133]),data:Uint8Array.from([])});expect(t.CommandUtils.isOutOfMemory(e)).toBe(!0)}),it("should return true if the status code is 0x5102",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([81,2]),data:Uint8Array.from([])});expect(t.CommandUtils.isOutOfMemory(e)).toBe(!0)}),it("should return true if the status code is 0x5103",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([81,3]),data:Uint8Array.from([])});expect(t.CommandUtils.isOutOfMemory(e)).toBe(!0)}),it("should return false if the status code is not 0x6a84",()=>{const e=new s.ApduResponse({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.CommandUtils.isOutOfMemory(e)).toBe(!1)})}),describe("static isApduThatTriggersDisconnection",()=>{it("should return true if the APDU is openApp",()=>{const e=new a.OpenAppCommand({appName:"test"}).getApdu().getRawApdu();expect(t.CommandUtils.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return true if the APDU is closeApp",()=>{const e=new r.CloseAppCommand().getApdu().getRawApdu();expect(t.CommandUtils.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return false if the APDU is not a known one",()=>{const e=new o.GetAppAndVersionCommand().getApdu().getRawApdu();expect(t.CommandUtils.isApduThatTriggersDisconnection(e)).toBe(!1)})})});
2
2
  //# sourceMappingURL=CommandUtils.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/command/utils/CommandUtils.test.ts"],
4
- "sourcesContent": ["import { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nimport { GetAppAndVersionCommand } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { OpenAppCommand } from \"@api/command/os/OpenAppCommand\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { CommandUtils } from \"./CommandUtils\";\n\ndescribe(\"CommandUtils\", () => {\n describe(\"static isSuccessResponse\", () => {\n it(\"should return true if the status code is 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isValidStatusCode\", () => {\n it(\"should return true if the status code is 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90, 0x00]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(true);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(false);\n });\n });\n\n describe(\"static isLockedDeviceResponse\", () => {\n it(\"should return true if the status code is 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isApduThatTriggersDisconnection\", () => {\n it(\"should return true if the APDU is openApp\", () => {\n const apdu = new OpenAppCommand({ appName: \"test\" })\n .getApdu()\n .getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(true);\n });\n\n it(\"should return true if the APDU is closeApp\", () => {\n const apdu = new CloseAppCommand().getApdu().getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(true);\n });\n\n it(\"should return false if the APDU is not a known one\", () => {\n const apdu = new GetAppAndVersionCommand().getApdu().getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDis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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,IAAAA,EAAgC,2CAChCC,EAAwC,mDACxCC,EAA+B,0CAC/BC,EAA6B,4CAE7BC,EAA6B,0BAE7B,SAAS,eAAgB,IAAM,CAC7B,SAAS,2BAA4B,IAAM,CACzC,GAAG,kDAAmD,IAAM,CAC1D,MAAMC,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAO,eAAa,kBAAkBA,CAAQ,CAAC,EAAE,KAAK,EAAI,CAC5D,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMA,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAO,eAAa,kBAAkBA,CAAQ,CAAC,EAAE,KAAK,EAAK,CAC7D,CAAC,EAED,GAAG,6DAA8D,IAAM,CACrE,MAAMA,EAAW,IAAI,eAAa,CAChC,WAAY,WAAW,KAAK,CAAC,EAAI,CAAC,EAClC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAO,eAAa,kBAAkBA,CAAQ,CAAC,EAAE,KAAK,EAAK,CAC7D,CAAC,CACH,CAAC,E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0BAAwB,EAAE,QAAQ,EAAE,WAAW,EAEhE,OAAO,eAAa,gCAAgCA,CAAI,CAAC,EAAE,KAAK,EAAK,CACvE,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_OpenAppCommand", "import_ApduResponse", "import_CommandUtils", "response", "statusCode", "apdu"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var p=(o,r)=>{for(var n in r)s(o,n,{get:r[n],enumerable:!0})},g=(o,r,n,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of l(r))!C.call(o,a)&&a!==n&&s(o,a,{get:()=>r[a],enumerable:!(e=i(r,a))||e.enumerable});return o};var u=o=>g(s({},"__esModule",{value:!0}),o);var G={};p(G,{GLOBAL_ERRORS:()=>m,GlobalCommandError:()=>c,GlobalCommandErrorHandler:()=>x});module.exports=u(G);var d=require("../../apdu/utils/ApduParser"),t=require("../../Error"),E=require("./CommandErrors");class c extends t.DeviceExchangeError{constructor(r){super({tag:"GlobalCommandError",...r})}}const m={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 x{static handle(r){const e=new d.ApduParser(r).encodeToHexaString(r.statusCode);return(0,E.isCommandErrorCode)(e,m)?new c({...m[e],errorCode:e}):new t.UnknownDeviceExchangeError({message:"UnknownError",errorCode:e})}}0&&(module.exports={GLOBAL_ERRORS,GlobalCommandError,GlobalCommandErrorHandler});
1
+ "use strict";var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var C=(e,r)=>{for(var n in r)s(e,n,{get:r[n],enumerable:!0})},g=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of l(r))!p.call(e,a)&&a!==n&&s(e,a,{get:()=>r[a],enumerable:!(o=i(r,a))||o.enumerable});return e};var u=e=>g(s({},"__esModule",{value:!0}),e);var x={};C(x,{GLOBAL_ERRORS:()=>m,GlobalCommandError:()=>c,GlobalCommandErrorHandler:()=>v});module.exports=u(x);var d=require("../../apdu/utils/ApduParser"),t=require("../../Error"),E=require("./CommandErrors");class c extends t.DeviceExchangeError{constructor(r){super({tag:"GlobalCommandError",...r})}}const m={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 v{static handle(r){const o=new d.ApduParser(r).encodeToHexaString(r.statusCode);return(0,E.isCommandErrorCode)(o,m)?new c({...m[o],errorCode:o}):new t.UnknownDeviceExchangeError({message:"UnknownError",errorCode:o})}}0&&(module.exports={GLOBAL_ERRORS,GlobalCommandError,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,uBAAAC,EAAA,8BAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAA2B,sCAE3BC,EAIO,sBAEPC,EAAuD,2BAUhD,MAAML,UAA2B,qBAAkD,CACxF,YAAYM,EAAsD,CAChE,MAAM,CAAE,IAAK,qBAAsB,GAAGA,CAAK,CAAC,CAC9C,CACF,CAKO,MAAMP,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,MAAME,CAA0B,CAKrC,OAAO,OACLM,EACiD,CAEjD,MAAMC,EADS,IAAI,aAAWD,CAAY,EACjB,mBAAmBA,EAAa,UAAU,EACnE,SAAI,sBAAmBC,EAAWT,CAAa,EACtC,IAAIC,EAAmB,CAAE,GAAGD,EAAcS,CAAS,EAAG,UAAAA,CAAU,CAAC,EAEnE,IAAI,6BAA2B,CACpC,QAAS,eACT,UAAAA,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,uBAAAC,EAAA,8BAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAA2B,sCAE3BC,EAIO,sBAEPC,EAAuD,2BAgBhD,MAAML,UAA2B,qBAAkD,CACxF,YAAYM,EAAsD,CAChE,MAAM,CAAE,IAAK,qBAAsB,GAAGA,CAAK,CAAC,CAC9C,CACF,CAKO,MAAMP,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,MAAME,CAA0B,CAKrC,OAAO,OACLM,EACiD,CAEjD,MAAMC,EADS,IAAI,aAAWD,CAAY,EACjB,mBAAmBA,EAAa,UAAU,EACnE,SAAI,sBAAmBC,EAAWT,CAAa,EACtC,IAAIC,EAAmB,CAAE,GAAGD,EAAcS,CAAS,EAAG,UAAAA,CAAU,CAAC,EAEnE,IAAI,6BAA2B,CACpC,QAAS,eACT,UAAAA,CACF,CAAC,CACH,CACF",
6
6
  "names": ["GlobalCommandError_exports", "__export", "GLOBAL_ERRORS", "GlobalCommandError", "GlobalCommandErrorHandler", "__toCommonJS", "import_ApduParser", "import_Error", "import_CommandErrors", "args", "apduResponse", "errorCode"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(n,e)=>{for(var o in e)a(n,o,{get:e[o],enumerable:!0})},x=(n,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!c.call(n,r)&&r!==o&&a(n,r,{get:()=>e[r],enumerable:!(i=s(e,r))||i.enumerable});return n};var y=n=>x(a({},"__esModule",{value:!0}),n);var A={};p(A,{DeviceModel:()=>m,DeviceModelId:()=>l,LEDGER_VENDOR_ID:()=>N});module.exports=y(A);var l=(t=>(t.NANO_S="nanoS",t.NANO_SP="nanoSP",t.NANO_X="nanoX",t.STAX="stax",t.FLEX="flex",t))(l||{});class m{id;model;name;constructor({id:e,model:o,name:i}){this.id=e,this.model=o,this.name=i}}const N=11415;0&&(module.exports={DeviceModel,DeviceModelId,LEDGER_VENDOR_ID});
1
+ "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(n,e)=>{for(var o in e)i(n,o,{get:e[o],enumerable:!0})},x=(n,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!c.call(n,t)&&t!==o&&i(n,t,{get:()=>e[t],enumerable:!(a=s(e,t))||a.enumerable});return n};var y=n=>x(i({},"__esModule",{value:!0}),n);var N={};d(N,{DeviceModel:()=>m,DeviceModelId:()=>l,LEDGER_VENDOR_ID:()=>A});module.exports=y(N);var l=(r=>(r.NANO_S="nanoS",r.NANO_SP="nanoSP",r.NANO_X="nanoX",r.STAX="stax",r.FLEX="flex",r.APEX="apexp",r))(l||{});class m{id;model;name;constructor({id:e,model:o,name:a}){this.id=e,this.model=o,this.name=a}}const A=11415;0&&(module.exports={DeviceModel,DeviceModelId,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,kBAAAC,EAAA,qBAAAC,IAAA,eAAAC,EAAAL,GAAO,IAAKG,OACVA,EAAA,OAAS,QACTA,EAAA,QAAU,SACVA,EAAA,OAAS,QACTA,EAAA,KAAO,OACPA,EAAA,KAAO,OALGA,OAAA,IAwBL,MAAMD,CAAY,CACP,GACA,MACA,KAEhB,YAAY,CAAE,GAAAI,EAAI,MAAAC,EAAO,KAAAC,CAAK,EAAoB,CAChD,KAAK,GAAKF,EACV,KAAK,MAAQC,EACb,KAAK,KAAOC,CACd,CACF,CAEO,MAAMJ,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,kBAAAC,EAAA,qBAAAC,IAAA,eAAAC,EAAAL,GAAO,IAAKG,OACVA,EAAA,OAAS,QACTA,EAAA,QAAU,SACVA,EAAA,OAAS,QACTA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,QANGA,OAAA,IAyBL,MAAMD,CAAY,CACP,GACA,MACA,KAEhB,YAAY,CAAE,GAAAI,EAAI,MAAAC,EAAO,KAAAC,CAAK,EAAoB,CAChD,KAAK,GAAKF,EACV,KAAK,MAAQC,EACb,KAAK,KAAOC,CACd,CACF,CAEO,MAAMJ,EAAmB",
6
6
  "names": ["DeviceModel_exports", "__export", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "__toCommonJS", "id", "model", "name"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var s=(e,o,i,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of l(o))!d.call(e,n)&&n!==i&&a(e,n,{get:()=>o[n],enumerable:!(t=r(o,n))||t.enumerable});return e};var b=e=>s(a({},"__esModule",{value:!0}),e);var u={};module.exports=b(u);
2
+ //# sourceMappingURL=SecureElementFlags.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/api/device/SecureElementFlags.ts"],
4
+ "sourcesContent": ["/**\n * Represents the general state of a device, the information comes from the first byte of the secure element flags.\n */\nexport type DeviceGeneralState = {\n /**\n * Indicates whether the device's PIN has been validated.\n */\n isPinValidated: boolean;\n\n /**\n * Indicates whether the device has a MCU serial number.\n */\n hasMcuSerialNumber: boolean;\n\n /**\n * Indicates whether the device has a personalized valid Ledger certificate.\n */\n hasValidCertificate: boolean;\n\n /**\n * Indicates whether the device is allowed to connect with a custom certificate authority.\n */\n isCustomAuthorityConnectionAllowed: boolean;\n\n /**\n * Indicates whether the device is allowed to commnunicate with secure connection.\n */\n isSecureConnectionAllowed: boolean;\n\n /**\n * Indicates whether the device has been onboarded.\n */\n isOnboarded: boolean;\n\n /**\n * Indicates whether the MCU code on the device is signed.\n */\n isMcuCodeSigned: boolean;\n\n /**\n * Indicates whether the device is in recovery mode.\n */\n isInRecoveryMode: boolean;\n};\n\n// 2nd byte of the secure element flags, placeholder for the endorsement information\nexport type EndorsementInformation = unknown;\n\n// 3rd byte of the secure element flags, placeholder for the words information\nexport type WordsInformation = unknown;\n\n// 4th byte of the secure element flags, placeholder for the onboarding status\nexport type OnboardingStatus = unknown;\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["SecureElementFlags_exports", "__toCommonJS"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var m=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of s(e))!p.call(t,r)&&r!==i&&n(t,r,{get:()=>e[r],enumerable:!(o=a(e,r))||o.enumerable});return t};var c=t=>m(n({},"__esModule",{value:!0}),t);var d={};module.exports=c(d);
1
+ "use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var m=(r,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of s(e))!p.call(r,t)&&t!==n&&i(r,t,{get:()=>e[t],enumerable:!(o=a(e,t))||o.enumerable});return r};var c=r=>m(i({},"__esModule",{value:!0}),r);var d={};module.exports=c(d);
2
2
  //# sourceMappingURL=DeviceAction.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/api/device-action/DeviceAction.ts"],
4
- "sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { type DmkError } from \"@api/Error\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { type DeviceActionState } from \"./model/DeviceActionState\";\n\nexport type InternalApi = {\n readonly sendApdu: (\n apdu: Uint8Array,\n ) => Promise<Either<DmkError, ApduResponse>>;\n readonly sendCommand: <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n ) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly getDeviceSessionStateObservable: () => Observable<DeviceSessionState>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly getManagerApiService: () => ManagerApiService;\n readonly getSecureChannelService: () => SecureChannelService;\n};\n\nexport type DeviceActionIntermediateValue = {\n readonly requiredUserInteraction: string;\n};\n\nexport type ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> = {\n readonly observable: Observable<\n DeviceActionState<Output, Error, IntermediateValue>\n >;\n cancel(): void;\n};\n\nexport interface DeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n> {\n readonly input: Input;\n\n _execute(\n params: InternalApi,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue>;\n}\n"],
4
+ "sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { type DmkError } from \"@api/Error\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { type DeviceActionState } from \"./model/DeviceActionState\";\n\nexport type InternalApi = {\n readonly sendApdu: (\n apdu: Uint8Array,\n ) => Promise<Either<DmkError, ApduResponse>>;\n readonly sendCommand: <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n readonly getDeviceModel: () => TransportDeviceModel;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly getDeviceSessionStateObservable: () => Observable<DeviceSessionState>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly disableRefresher: (blockerId: string) => () => void;\n readonly getManagerApiService: () => ManagerApiService;\n readonly getSecureChannelService: () => SecureChannelService;\n};\n\nexport type DeviceActionIntermediateValue = {\n readonly requiredUserInteraction: string;\n};\n\nexport type ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> = {\n readonly observable: Observable<\n DeviceActionState<Output, Error, IntermediateValue>\n >;\n cancel(): void;\n};\n\nexport interface DeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n> {\n readonly input: Input;\n\n _execute(\n params: InternalApi,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue>;\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["DeviceAction_exports", "__toCommonJS"]
7
7
  }