@ledgerhq/device-management-kit 0.0.0-signer-eth-plugin-fix-20250331141239 → 0.0.0-test-recursive-stack-20251002122259

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 (780) hide show
  1. package/README.md +43 -6
  2. package/lib/cjs/package.json +22 -23
  3. package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
  4. package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
  5. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  6. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +3 -3
  7. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
  8. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
  9. package/lib/cjs/src/api/DmkConfig.js +1 -1
  10. package/lib/cjs/src/api/DmkConfig.js.map +1 -1
  11. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  12. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  13. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  14. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  15. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js +1 -1
  16. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  17. package/lib/cjs/src/api/command/di/commandModule.js +1 -1
  18. package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
  19. package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
  20. package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
  21. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  22. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  23. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  24. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  25. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  26. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  27. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  28. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  29. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
  30. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  31. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  32. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  33. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  34. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  35. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
  36. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  37. package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
  38. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +3 -3
  39. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
  40. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +3 -3
  41. package/lib/cjs/src/api/command/utils/GlobalCommandError.js +1 -1
  42. package/lib/cjs/src/api/command/utils/GlobalCommandError.js.map +2 -2
  43. package/lib/cjs/src/api/device/DeviceModel.js +1 -1
  44. package/lib/cjs/src/api/device/DeviceModel.js.map +2 -2
  45. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  46. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  47. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  48. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  49. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  50. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  51. package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
  52. package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
  53. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
  54. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  55. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +1 -1
  56. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  57. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  58. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  59. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  60. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  61. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -1
  62. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
  63. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  64. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  65. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  66. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  67. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  68. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  69. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +2 -0
  70. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  71. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  72. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
  73. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  74. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  75. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  76. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  77. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
  78. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
  79. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  80. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  81. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  82. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  83. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
  84. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  85. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  86. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  87. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  88. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  89. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  90. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +2 -2
  91. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
  92. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +1 -1
  93. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  94. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  95. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  96. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  97. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
  98. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  99. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  100. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  101. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  102. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  103. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
  104. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  105. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  106. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  107. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  108. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  109. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  110. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  111. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  112. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  113. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  114. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  115. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  116. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  117. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  118. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  119. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  120. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  121. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  122. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +2 -2
  123. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  124. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  125. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  126. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  127. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  128. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
  129. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
  130. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  131. package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
  132. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
  133. package/lib/cjs/src/api/index.js +1 -1
  134. package/lib/cjs/src/api/index.js.map +3 -3
  135. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  136. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  137. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +1 -1
  138. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  139. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  140. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +1 -1
  141. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +1 -1
  142. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  143. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  144. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  145. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  146. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  147. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  148. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +1 -1
  149. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +1 -1
  150. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  151. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  152. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  153. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  154. package/lib/cjs/src/api/secure-channel/task/types.js +1 -1
  155. package/lib/cjs/src/api/secure-channel/task/types.js.map +2 -2
  156. package/lib/cjs/src/api/secure-channel/utils.js +1 -1
  157. package/lib/cjs/src/api/secure-channel/utils.js.map +3 -3
  158. package/lib/cjs/src/api/secure-channel/utils.test.js +1 -1
  159. package/lib/cjs/src/api/secure-channel/utils.test.js.map +3 -3
  160. package/lib/cjs/src/api/transport/model/DeviceApduSender.js +2 -0
  161. package/lib/cjs/src/api/transport/model/DeviceApduSender.js.map +7 -0
  162. package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
  163. package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
  164. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  165. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  166. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  167. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  168. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
  169. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  170. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  171. package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
  172. package/lib/cjs/src/api/types.js +1 -1
  173. package/lib/cjs/src/api/types.js.map +1 -1
  174. package/lib/cjs/src/api/utils/AppName.js +2 -0
  175. package/lib/cjs/src/api/utils/AppName.js.map +7 -0
  176. package/lib/cjs/src/api/utils/AppName.test.js +2 -0
  177. package/lib/cjs/src/api/utils/AppName.test.js.map +7 -0
  178. package/lib/cjs/src/api/utils/HexaString.js +1 -1
  179. package/lib/cjs/src/api/utils/HexaString.js.map +3 -3
  180. package/lib/cjs/src/api/utils/HexaString.test.js +1 -1
  181. package/lib/cjs/src/api/utils/HexaString.test.js.map +2 -2
  182. package/lib/cjs/src/di.js +1 -1
  183. package/lib/cjs/src/di.js.map +2 -2
  184. package/lib/cjs/src/internal/config/di/configModule.js +1 -1
  185. package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
  186. package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
  187. package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
  188. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
  189. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  190. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  191. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  192. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
  193. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  194. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
  195. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  196. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  197. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  198. package/lib/cjs/src/internal/device-session/model/DevicePinger.js +1 -1
  199. package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +3 -3
  200. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  201. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  202. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  203. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  204. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  205. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +3 -3
  206. package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
  207. package/lib/cjs/src/internal/device-session/model/Frame.js.map +3 -3
  208. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  209. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  210. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  211. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  212. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  213. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  214. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  215. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  216. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  217. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  218. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  219. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  220. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  221. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  222. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  223. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  224. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  225. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  226. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  227. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  228. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  229. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  230. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  231. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  232. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  233. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  234. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
  235. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  236. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  237. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  238. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  239. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  240. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  241. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  242. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
  243. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  244. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  245. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  246. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  247. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  248. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  249. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  250. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  251. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  252. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js +1 -1
  253. package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  254. package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
  255. package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
  256. package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
  257. package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
  258. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  259. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  260. package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
  261. package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
  262. package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
  263. package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
  264. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  265. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  266. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  267. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  268. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
  269. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
  270. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  271. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  272. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  273. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  274. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  275. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  276. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  277. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  278. package/lib/cjs/src/internal/secure-channel/model/Errors.js +1 -1
  279. package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +3 -3
  280. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  281. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  282. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  283. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  284. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +1 -1
  285. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +1 -1
  286. package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
  287. package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
  288. package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
  289. package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
  290. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
  291. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  292. package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
  293. package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
  294. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  295. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  296. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
  297. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  298. package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
  299. package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
  300. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  301. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  302. package/lib/esm/package.json +22 -23
  303. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  304. package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
  305. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  306. package/lib/esm/src/api/DeviceManagementKit.test.js.map +3 -3
  307. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  308. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  309. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  310. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  311. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  312. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  313. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +1 -1
  314. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  315. package/lib/esm/src/api/command/di/commandModule.js +1 -1
  316. package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
  317. package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
  318. package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
  319. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  320. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  321. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  322. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  323. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  324. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  325. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  326. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  327. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
  328. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  329. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  330. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  331. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  332. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  333. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
  334. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  335. package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
  336. package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
  337. package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
  338. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +3 -3
  339. package/lib/esm/src/api/command/utils/GlobalCommandError.js +1 -1
  340. package/lib/esm/src/api/command/utils/GlobalCommandError.js.map +2 -2
  341. package/lib/esm/src/api/device/DeviceModel.js +1 -1
  342. package/lib/esm/src/api/device/DeviceModel.js.map +2 -2
  343. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  344. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  345. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  346. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  347. package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
  348. package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
  349. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
  350. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  351. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +1 -1
  352. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  353. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  354. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  355. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  356. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  357. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  358. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  359. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  360. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  361. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  362. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  363. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  364. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  365. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  366. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
  367. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  368. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  369. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  370. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  371. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  372. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  373. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  374. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  375. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  376. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  377. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  378. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  379. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  380. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  381. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  382. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  383. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  384. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  385. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  386. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  387. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  388. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  389. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  390. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  391. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  392. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  393. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  394. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  395. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  396. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  397. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  398. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  399. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  400. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  401. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  402. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  403. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  404. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  405. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  406. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  407. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  408. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  409. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  410. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +2 -2
  411. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  412. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  413. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  414. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  415. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  416. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  417. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  418. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  419. package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
  420. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  421. package/lib/esm/src/api/index.js +1 -1
  422. package/lib/esm/src/api/index.js.map +3 -3
  423. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  424. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  425. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  426. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  427. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  428. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  429. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  430. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  431. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  432. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  433. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  434. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  435. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  436. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  437. package/lib/esm/src/api/secure-channel/task/types.js +1 -1
  438. package/lib/esm/src/api/secure-channel/task/types.js.map +2 -2
  439. package/lib/esm/src/api/secure-channel/utils.js +1 -1
  440. package/lib/esm/src/api/secure-channel/utils.js.map +3 -3
  441. package/lib/esm/src/api/secure-channel/utils.test.js +1 -1
  442. package/lib/esm/src/api/secure-channel/utils.test.js.map +3 -3
  443. package/lib/esm/src/api/transport/model/DeviceApduSender.js +1 -0
  444. package/lib/esm/src/api/transport/model/DeviceApduSender.js.map +7 -0
  445. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  446. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  447. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  448. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  449. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  450. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  451. package/lib/esm/src/api/utils/AppName.js +2 -0
  452. package/lib/esm/src/api/utils/AppName.js.map +7 -0
  453. package/lib/esm/src/api/utils/AppName.test.js +2 -0
  454. package/lib/esm/src/api/utils/AppName.test.js.map +7 -0
  455. package/lib/esm/src/api/utils/HexaString.js +1 -1
  456. package/lib/esm/src/api/utils/HexaString.js.map +3 -3
  457. package/lib/esm/src/api/utils/HexaString.test.js +1 -1
  458. package/lib/esm/src/api/utils/HexaString.test.js.map +2 -2
  459. package/lib/esm/src/di.js +1 -1
  460. package/lib/esm/src/di.js.map +3 -3
  461. package/lib/esm/src/internal/config/di/configModule.js +1 -1
  462. package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
  463. package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
  464. package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
  465. package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
  466. package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  467. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  468. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  469. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
  470. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  471. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
  472. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  473. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  474. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  475. package/lib/esm/src/internal/device-session/model/DevicePinger.js +1 -1
  476. package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +3 -3
  477. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  478. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  479. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  480. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  481. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  482. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +3 -3
  483. package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
  484. package/lib/esm/src/internal/device-session/model/Frame.js.map +3 -3
  485. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  486. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  487. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  488. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  489. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  490. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  491. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  492. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  493. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  494. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  495. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  496. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  497. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  498. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  499. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  500. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  501. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  502. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  503. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  504. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  505. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  506. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
  507. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  508. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  509. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  510. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  511. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
  512. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  513. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  514. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  515. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  516. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  517. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  518. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  519. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  520. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  521. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  522. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  523. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  524. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  525. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  526. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  527. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js +1 -1
  528. package/lib/esm/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
  529. package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
  530. package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
  531. package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
  532. package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
  533. package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
  534. package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
  535. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  536. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  537. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  538. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  539. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
  540. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
  541. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
  542. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
  543. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  544. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  545. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  546. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  547. package/lib/esm/src/internal/secure-channel/model/Errors.js +1 -1
  548. package/lib/esm/src/internal/secure-channel/model/Errors.js.map +3 -3
  549. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  550. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  551. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  552. package/lib/esm/src/internal/send/di/sendModule.js +1 -1
  553. package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
  554. package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
  555. package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
  556. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
  557. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  558. package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
  559. package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
  560. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  561. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  562. package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
  563. package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  564. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  565. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  566. package/lib/types/src/api/DeviceManagementKit.d.ts +15 -1
  567. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  568. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  569. package/lib/types/src/api/DmkConfig.d.ts +2 -0
  570. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  571. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  572. package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
  573. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +66 -0
  574. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
  575. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +1 -0
  576. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts.map +1 -1
  577. package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
  578. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
  579. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
  580. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
  581. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
  582. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +30 -2
  583. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  584. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
  585. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
  586. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
  587. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
  588. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  589. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
  590. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
  591. package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
  592. package/lib/types/src/api/command/utils/CommandUtils.d.ts +4 -0
  593. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  594. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts +1 -1
  595. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts.map +1 -1
  596. package/lib/types/src/api/device/DeviceModel.d.ts +2 -1
  597. package/lib/types/src/api/device/DeviceModel.d.ts.map +1 -1
  598. package/lib/types/src/api/device-action/DeviceAction.d.ts +3 -1
  599. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  600. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  601. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +5 -0
  602. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  603. package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
  604. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +1 -0
  605. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts.map +1 -1
  606. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
  607. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +1 -1
  608. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  609. package/lib/types/src/api/device-action/os/Errors.d.ts +20 -0
  610. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  611. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts +58 -0
  612. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
  613. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
  614. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
  615. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +28 -0
  616. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
  617. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts +1 -1
  618. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  619. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
  620. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
  621. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  622. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
  623. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
  624. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
  625. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
  626. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +65 -0
  627. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
  628. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
  629. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +0 -1
  630. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
  631. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
  632. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
  633. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
  634. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
  635. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +24 -0
  636. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
  637. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  638. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -1
  639. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  640. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
  641. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
  642. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
  643. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
  644. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
  645. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
  646. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
  647. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
  648. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
  649. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
  650. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
  651. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
  652. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
  653. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
  654. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
  655. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
  656. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts +1 -0
  657. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts.map +1 -1
  658. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  659. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
  660. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  661. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  662. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +93 -0
  663. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  664. package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
  665. package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
  666. package/lib/types/src/api/index.d.ts +6 -1
  667. package/lib/types/src/api/index.d.ts.map +1 -1
  668. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -1
  669. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +2 -1
  670. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -1
  671. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -1
  672. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +2 -1
  673. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -1
  674. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -1
  675. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +2 -1
  676. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -1
  677. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
  678. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +2 -1
  679. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -1
  680. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +5 -2
  681. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -1
  682. package/lib/types/src/api/secure-channel/task/types.d.ts +6 -1
  683. package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -1
  684. package/lib/types/src/api/secure-channel/utils.d.ts +0 -11
  685. package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -1
  686. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts +17 -0
  687. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts.map +1 -0
  688. package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
  689. package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
  690. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +63 -0
  691. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -0
  692. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts +2 -0
  693. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts.map +1 -0
  694. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +1 -1
  695. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
  696. package/lib/types/src/api/transport/model/Errors.d.ts +27 -3
  697. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  698. package/lib/types/src/api/transport/model/Transport.d.ts +1 -1
  699. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  700. package/lib/types/src/api/types.d.ts +6 -2
  701. package/lib/types/src/api/types.d.ts.map +1 -1
  702. package/lib/types/src/api/utils/AppName.d.ts +2 -0
  703. package/lib/types/src/api/utils/AppName.d.ts.map +1 -0
  704. package/lib/types/src/api/utils/AppName.test.d.ts +2 -0
  705. package/lib/types/src/api/utils/AppName.test.d.ts.map +1 -0
  706. package/lib/types/src/api/utils/HexaString.d.ts +4 -3
  707. package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
  708. package/lib/types/src/di.d.ts.map +1 -1
  709. package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
  710. package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
  711. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
  712. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
  713. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  714. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +1 -1
  715. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -1
  716. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +3 -1
  717. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  718. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  719. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -1
  720. package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
  721. package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.d.ts.map +1 -1
  722. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +3 -1
  723. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
  724. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -1
  725. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  726. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts +1 -1
  727. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -1
  728. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts +1 -1
  729. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
  730. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +4 -2
  731. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
  732. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
  733. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +24 -5
  734. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  735. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +51 -6
  736. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  737. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +104 -18
  738. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
  739. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +7 -0
  740. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  741. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  742. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts +1 -0
  743. package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts.map +1 -1
  744. package/lib/types/src/internal/manager-api/model/Application.d.ts +12 -12
  745. package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
  746. package/lib/types/src/internal/manager-api/model/Const.d.ts +2 -0
  747. package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
  748. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +17 -3
  749. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  750. package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
  751. package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
  752. package/lib/types/src/internal/manager-api/model/Params.d.ts +20 -6
  753. package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
  754. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +9 -3
  755. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  756. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +42 -7
  757. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  758. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +13 -0
  759. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -0
  760. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts +2 -0
  761. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts.map +1 -0
  762. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
  763. package/lib/types/src/internal/secure-channel/model/Errors.d.ts +22 -2
  764. package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -1
  765. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +2 -2
  766. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -1
  767. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +3 -3
  768. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -1
  769. package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
  770. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +9 -1
  771. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
  772. package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
  773. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +2 -0
  774. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
  775. package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -1
  776. package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
  777. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +1 -0
  778. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
  779. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  780. package/package.json +16 -17
@@ -1,2 +1,2 @@
1
- const i=t=>typeof t=="string"&&/^0x[0-9a-fA-F]*$/.test(t),e=t=>{if(t.startsWith("0x")&&(t=t.slice(2)),t.length===0)return new Uint8Array;if(t.length%2!==0&&(t="0"+t),/^[0-9a-fA-F]*$/.test(t)===!1)return null;const r=t.match(/.{1,2}/g)?.map(n=>parseInt(n,16));return!r||r.some(isNaN)?null:new Uint8Array(r)},s=t=>`0x${Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}`;export{s as bufferToHexaString,e as hexaStringToBuffer,i as isHexaString};
1
+ function e(r){return typeof r=="string"&&/^0x[0-9a-fA-F]*$/.test(r)}function f(r){if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)return new Uint8Array;if(r.length%2!==0&&(r="0"+r),/^[0-9a-fA-F]*$/.test(r)===!1)return null;const t=r.match(/.{1,2}/g)?.map(n=>parseInt(n,16));return!t||t.some(isNaN)?null:new Uint8Array(t)}function o(r,t=!0){return`${t?"0x":""}${Array.from(r,i=>i.toString(16).padStart(2,"0")).join("")}`}export{o as bufferToHexaString,f as hexaStringToBuffer,e as isHexaString};
2
2
  //# sourceMappingURL=HexaString.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/api/utils/HexaString.ts"],
4
- "sourcesContent": ["export type HexaString = `0x${string}`;\n\nexport const isHexaString = (value: unknown): value is HexaString => {\n return typeof value === \"string\" && /^0x[0-9a-fA-F]*$/.test(value);\n};\n\nexport const hexaStringToBuffer = (value: string): Uint8Array | null => {\n if (value.startsWith(\"0x\")) {\n value = value.slice(2);\n }\n if (value.length === 0) {\n return new Uint8Array();\n }\n if (value.length % 2 !== 0) {\n value = \"0\" + value;\n }\n if (/^[0-9a-fA-F]*$/.test(value) === false) {\n return null;\n }\n const bytes = value.match(/.{1,2}/g)?.map((byte) => parseInt(byte, 16));\n if (!bytes || bytes.some(isNaN)) {\n return null;\n }\n return new Uint8Array(bytes);\n};\n\nexport const bufferToHexaString = (value: Uint8Array): HexaString => {\n return `0x${Array.from(value, (byte) =>\n byte.toString(16).padStart(2, \"0\"),\n ).join(\"\")}`;\n};\n"],
5
- "mappings": "AAEO,MAAMA,EAAgBC,GACpB,OAAOA,GAAU,UAAY,mBAAmB,KAAKA,CAAK,EAGtDC,EAAsBD,GAAqC,CAItE,GAHIA,EAAM,WAAW,IAAI,IACvBA,EAAQA,EAAM,MAAM,CAAC,GAEnBA,EAAM,SAAW,EACnB,OAAO,IAAI,WAKb,GAHIA,EAAM,OAAS,IAAM,IACvBA,EAAQ,IAAMA,GAEZ,iBAAiB,KAAKA,CAAK,IAAM,GACnC,OAAO,KAET,MAAME,EAAQF,EAAM,MAAM,SAAS,GAAG,IAAKG,GAAS,SAASA,EAAM,EAAE,CAAC,EACtE,MAAI,CAACD,GAASA,EAAM,KAAK,KAAK,EACrB,KAEF,IAAI,WAAWA,CAAK,CAC7B,EAEaE,EAAsBJ,GAC1B,KAAK,MAAM,KAAKA,EAAQG,GAC7BA,EAAK,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,CACnC,EAAE,KAAK,EAAE,CAAC",
6
- "names": ["isHexaString", "value", "hexaStringToBuffer", "bytes", "byte", "bufferToHexaString"]
4
+ "sourcesContent": ["export type HexaString = `0x${string}`;\n\nexport function isHexaString(value: unknown): value is HexaString {\n return typeof value === \"string\" && /^0x[0-9a-fA-F]*$/.test(value);\n}\n\nexport function hexaStringToBuffer(value: string): Uint8Array | null {\n if (value.startsWith(\"0x\")) {\n value = value.slice(2);\n }\n if (value.length === 0) {\n return new Uint8Array();\n }\n if (value.length % 2 !== 0) {\n value = \"0\" + value;\n }\n if (/^[0-9a-fA-F]*$/.test(value) === false) {\n return null;\n }\n const bytes = value.match(/.{1,2}/g)?.map((byte) => parseInt(byte, 16));\n if (!bytes || bytes.some(isNaN)) {\n return null;\n }\n return new Uint8Array(bytes);\n}\n\nexport function bufferToHexaString(\n value: Uint8Array,\n withPrefix?: true,\n): HexaString;\nexport function bufferToHexaString(\n value: Uint8Array,\n withPrefix?: false,\n): string;\nexport function bufferToHexaString(\n value: Uint8Array,\n withPrefix: boolean = true,\n): HexaString | string {\n const prefix = withPrefix ? \"0x\" : \"\";\n return `${prefix}${Array.from(value, (byte) =>\n byte.toString(16).padStart(2, \"0\"),\n ).join(\"\")}`;\n}\n"],
5
+ "mappings": "AAEO,SAASA,EAAaC,EAAqC,CAChE,OAAO,OAAOA,GAAU,UAAY,mBAAmB,KAAKA,CAAK,CACnE,CAEO,SAASC,EAAmBD,EAAkC,CAInE,GAHIA,EAAM,WAAW,IAAI,IACvBA,EAAQA,EAAM,MAAM,CAAC,GAEnBA,EAAM,SAAW,EACnB,OAAO,IAAI,WAKb,GAHIA,EAAM,OAAS,IAAM,IACvBA,EAAQ,IAAMA,GAEZ,iBAAiB,KAAKA,CAAK,IAAM,GACnC,OAAO,KAET,MAAME,EAAQF,EAAM,MAAM,SAAS,GAAG,IAAKG,GAAS,SAASA,EAAM,EAAE,CAAC,EACtE,MAAI,CAACD,GAASA,EAAM,KAAK,KAAK,EACrB,KAEF,IAAI,WAAWA,CAAK,CAC7B,CAUO,SAASE,EACdJ,EACAK,EAAsB,GACD,CAErB,MAAO,GADQA,EAAa,KAAO,EACnB,GAAG,MAAM,KAAKL,EAAQG,GACpCA,EAAK,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,CACnC,EAAE,KAAK,EAAE,CAAC,EACZ",
6
+ "names": ["isHexaString", "value", "hexaStringToBuffer", "bytes", "byte", "bufferToHexaString", "withPrefix"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{bufferToHexaString as r,hexaStringToBuffer as u,isHexaString as n}from"./HexaString";describe("HexaString",()=>{describe("isHexaString function",()=>{it("should return true if the value is a valid hex string",()=>{const t=n("0x1234abc");expect(t).toBeTruthy()}),it("should return true if no data",()=>{const t=n("0x");expect(t).toBeTruthy()}),it("should return false if the value contain an invalid letter",()=>{const t=n("0x1234z");expect(t).toBeFalsy()}),it("should return false if the value does not start with 0x",()=>{const t=n("1234abc");expect(t).toBeFalsy()}),it("should return false for an epmty string",()=>{const t=n("");expect(t).toBeFalsy()}),it.each([123,[],{},null,void 0,!0])("should return false for invalid input %p",e=>{const t=n(e);expect(t).toBeFalsy()})}),describe("hexaStringToBuffer function",()=>{it("should convert empty input to empty buffer",()=>{const t=u("");expect(t).toStrictEqual(new Uint8Array)}),it("should fail on invalid string",()=>{const t=u("bonjour");expect(t).toStrictEqual(null)}),it("should fail on invalid string with valid numbers",()=>{const t=u("0x012n34");expect(t).toStrictEqual(null)}),it("should convert correct hexadecimal string",()=>{const t=u("1a35669f0100");expect(t).toStrictEqual(new Uint8Array([26,53,102,159,1,0]))}),it("should support 0x prefix",()=>{const t=u("0x1a35");expect(t).toStrictEqual(new Uint8Array([26,53]))}),it("should be case insensitive",()=>{const t=u("0xcCDd");expect(t).toStrictEqual(new Uint8Array([204,221]))}),it("should pad with 0",()=>{const t=u("0xa35");expect(t).toStrictEqual(new Uint8Array([10,53]))})}),describe("bufferToHexaString function",()=>{it("should convert a buffer into a hexa string",()=>{const e=Uint8Array.from([0,1,2,255,254]),t=r(e);expect(t).toStrictEqual("0x000102fffe")})})});
1
+ import{bufferToHexaString as n,hexaStringToBuffer as r,isHexaString as u}from"./HexaString";describe("HexaString",()=>{describe("isHexaString function",()=>{it("should return true if the value is a valid hex string",()=>{const t=u("0x1234abc");expect(t).toBeTruthy()}),it("should return true if no data",()=>{const t=u("0x");expect(t).toBeTruthy()}),it("should return false if the value contain an invalid letter",()=>{const t=u("0x1234z");expect(t).toBeFalsy()}),it("should return false if the value does not start with 0x",()=>{const t=u("1234abc");expect(t).toBeFalsy()}),it("should return false for an epmty string",()=>{const t=u("");expect(t).toBeFalsy()}),it.each([123,[],{},null,void 0,!0])("should return false for invalid input %p",e=>{const t=u(e);expect(t).toBeFalsy()})}),describe("hexaStringToBuffer function",()=>{it("should convert empty input to empty buffer",()=>{const t=r("");expect(t).toStrictEqual(new Uint8Array)}),it("should fail on invalid string",()=>{const t=r("bonjour");expect(t).toStrictEqual(null)}),it("should fail on invalid string with valid numbers",()=>{const t=r("0x012n34");expect(t).toStrictEqual(null)}),it("should convert correct hexadecimal string",()=>{const t=r("1a35669f0100");expect(t).toStrictEqual(new Uint8Array([26,53,102,159,1,0]))}),it("should support 0x prefix",()=>{const t=r("0x1a35");expect(t).toStrictEqual(new Uint8Array([26,53]))}),it("should be case insensitive",()=>{const t=r("0xcCDd");expect(t).toStrictEqual(new Uint8Array([204,221]))}),it("should pad with 0",()=>{const t=r("0xa35");expect(t).toStrictEqual(new Uint8Array([10,53]))})}),describe("bufferToHexaString function",()=>{it("should convert a buffer into a hexa string",()=>{const e=Uint8Array.from([0,1,2,255,254]),t=n(e);expect(t).toStrictEqual("0x000102fffe")}),it("should convert a buffer into a hexa string without prefix",()=>{const e=Uint8Array.from([0,1,2,255,254]),t=n(e,!1);expect(t).toStrictEqual("000102fffe")})})});
2
2
  //# sourceMappingURL=HexaString.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/api/utils/HexaString.test.ts"],
4
- "sourcesContent": ["import {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"./HexaString\";\n\ndescribe(\"HexaString\", () => {\n describe(\"isHexaString function\", () => {\n it(\"should return true if the value is a valid hex string\", () => {\n // GIVEN\n const value = \"0x1234abc\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeTruthy();\n });\n\n it(\"should return true if no data\", () => {\n // GIVEN\n const value = \"0x\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeTruthy();\n });\n\n it(\"should return false if the value contain an invalid letter\", () => {\n // GIVEN\n const value = \"0x1234z\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeFalsy();\n });\n\n it(\"should return false if the value does not start with 0x\", () => {\n // GIVEN\n const value = \"1234abc\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeFalsy();\n });\n\n it(\"should return false for an epmty string\", () => {\n // GIVEN\n const value = \"\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeFalsy();\n });\n\n it.each([123, [], {}, null, undefined, true])(\n \"should return false for invalid input %p\",\n (value) => {\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeFalsy();\n },\n );\n });\n\n describe(\"hexaStringToBuffer function\", () => {\n it(\"should convert empty input to empty buffer\", () => {\n // GIVEN\n const value = \"\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(new Uint8Array());\n });\n\n it(\"should fail on invalid string\", () => {\n // GIVEN\n const value = \"bonjour\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(null);\n });\n\n it(\"should fail on invalid string with valid numbers\", () => {\n // GIVEN\n const value = \"0x012n34\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(null);\n });\n\n it(\"should convert correct hexadecimal string\", () => {\n // GIVEN\n const value = \"1a35669f0100\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(\n new Uint8Array([0x1a, 0x35, 0x66, 0x9f, 0x01, 0x00]),\n );\n });\n\n it(\"should support 0x prefix\", () => {\n // GIVEN\n const value = \"0x1a35\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(new Uint8Array([0x1a, 0x35]));\n });\n\n it(\"should be case insensitive\", () => {\n // GIVEN\n const value = \"0xcCDd\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(new Uint8Array([0xcc, 0xdd]));\n });\n\n it(\"should pad with 0\", () => {\n // GIVEN\n const value = \"0xa35\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(new Uint8Array([0x0a, 0x35]));\n });\n });\n\n describe(\"bufferToHexaString function\", () => {\n it(\"should convert a buffer into a hexa string\", () => {\n // GIVEN\n const value = Uint8Array.from([0, 1, 2, 0xff, 0xfe]);\n\n // WHEN\n const result = bufferToHexaString(value);\n\n // THEN\n expect(result).toStrictEqual(\"0x000102fffe\");\n });\n });\n});\n"],
5
- "mappings": "AAAA,OACE,sBAAAA,EACA,sBAAAC,EACA,gBAAAC,MACK,eAEP,SAAS,aAAc,IAAM,CAC3B,SAAS,wBAAyB,IAAM,CACtC,GAAG,wDAAyD,IAAM,CAKhE,MAAMC,EAASD,EAHD,WAGmB,EAGjC,OAAOC,CAAM,EAAE,WAAW,CAC5B,CAAC,EAED,GAAG,gCAAiC,IAAM,CAKxC,MAAMA,EAASD,EAHD,IAGmB,EAGjC,OAAOC,CAAM,EAAE,WAAW,CAC5B,CAAC,EAED,GAAG,6DAA8D,IAAM,CAKrE,MAAMA,EAASD,EAHD,SAGmB,EAGjC,OAAOC,CAAM,EAAE,UAAU,CAC3B,CAAC,EAED,GAAG,0DAA2D,IAAM,CAKlE,MAAMA,EAASD,EAHD,SAGmB,EAGjC,OAAOC,CAAM,EAAE,UAAU,CAC3B,CAAC,EAED,GAAG,0CAA2C,IAAM,CAKlD,MAAMA,EAASD,EAHD,EAGmB,EAGjC,OAAOC,CAAM,EAAE,UAAU,CAC3B,CAAC,EAED,GAAG,KAAK,CAAC,IAAK,CAAC,EAAG,CAAC,EAAG,KAAM,OAAW,EAAI,CAAC,EAC1C,2CACCC,GAAU,CAET,MAAMD,EAASD,EAAaE,CAAK,EAGjC,OAAOD,CAAM,EAAE,UAAU,CAC3B,CACF,CACF,CAAC,EAED,SAAS,8BAA+B,IAAM,CAC5C,GAAG,6CAA8C,IAAM,CAKrD,MAAMA,EAASF,EAHD,EAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,UAAY,CAC/C,CAAC,EAED,GAAG,gCAAiC,IAAM,CAKxC,MAAMA,EAASF,EAHD,SAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,CACnC,CAAC,EAED,GAAG,mDAAoD,IAAM,CAK3D,MAAMA,EAASF,EAHD,UAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,CACnC,CAAC,EAED,GAAG,4CAA6C,IAAM,CAKpD,MAAMA,EAASF,EAHD,cAGyB,EAGvC,OAAOE,CAAM,EAAE,cACb,IAAI,WAAW,CAAC,GAAM,GAAM,IAAM,IAAM,EAAM,CAAI,CAAC,CACrD,CACF,CAAC,EAED,GAAG,2BAA4B,IAAM,CAKnC,MAAMA,EAASF,EAHD,QAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,CAC3D,CAAC,EAED,GAAG,6BAA8B,IAAM,CAKrC,MAAMA,EAASF,EAHD,QAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,WAAW,CAAC,IAAM,GAAI,CAAC,CAAC,CAC3D,CAAC,EAED,GAAG,oBAAqB,IAAM,CAK5B,MAAMA,EAASF,EAHD,OAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,CAC3D,CAAC,CACH,CAAC,EAED,SAAS,8BAA+B,IAAM,CAC5C,GAAG,6CAA8C,IAAM,CAErD,MAAMC,EAAQ,WAAW,KAAK,CAAC,EAAG,EAAG,EAAG,IAAM,GAAI,CAAC,EAG7CD,EAASH,EAAmBI,CAAK,EAGvC,OAAOD,CAAM,EAAE,cAAc,cAAc,CAC7C,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"./HexaString\";\n\ndescribe(\"HexaString\", () => {\n describe(\"isHexaString function\", () => {\n it(\"should return true if the value is a valid hex string\", () => {\n // GIVEN\n const value = \"0x1234abc\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeTruthy();\n });\n\n it(\"should return true if no data\", () => {\n // GIVEN\n const value = \"0x\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeTruthy();\n });\n\n it(\"should return false if the value contain an invalid letter\", () => {\n // GIVEN\n const value = \"0x1234z\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeFalsy();\n });\n\n it(\"should return false if the value does not start with 0x\", () => {\n // GIVEN\n const value = \"1234abc\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeFalsy();\n });\n\n it(\"should return false for an epmty string\", () => {\n // GIVEN\n const value = \"\";\n\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeFalsy();\n });\n\n it.each([123, [], {}, null, undefined, true])(\n \"should return false for invalid input %p\",\n (value) => {\n // WHEN\n const result = isHexaString(value);\n\n // THEN\n expect(result).toBeFalsy();\n },\n );\n });\n\n describe(\"hexaStringToBuffer function\", () => {\n it(\"should convert empty input to empty buffer\", () => {\n // GIVEN\n const value = \"\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(new Uint8Array());\n });\n\n it(\"should fail on invalid string\", () => {\n // GIVEN\n const value = \"bonjour\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(null);\n });\n\n it(\"should fail on invalid string with valid numbers\", () => {\n // GIVEN\n const value = \"0x012n34\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(null);\n });\n\n it(\"should convert correct hexadecimal string\", () => {\n // GIVEN\n const value = \"1a35669f0100\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(\n new Uint8Array([0x1a, 0x35, 0x66, 0x9f, 0x01, 0x00]),\n );\n });\n\n it(\"should support 0x prefix\", () => {\n // GIVEN\n const value = \"0x1a35\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(new Uint8Array([0x1a, 0x35]));\n });\n\n it(\"should be case insensitive\", () => {\n // GIVEN\n const value = \"0xcCDd\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(new Uint8Array([0xcc, 0xdd]));\n });\n\n it(\"should pad with 0\", () => {\n // GIVEN\n const value = \"0xa35\";\n\n // WHEN\n const result = hexaStringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(new Uint8Array([0x0a, 0x35]));\n });\n });\n\n describe(\"bufferToHexaString function\", () => {\n it(\"should convert a buffer into a hexa string\", () => {\n // GIVEN\n const value = Uint8Array.from([0, 1, 2, 0xff, 0xfe]);\n\n // WHEN\n const result = bufferToHexaString(value);\n\n // THEN\n expect(result).toStrictEqual(\"0x000102fffe\");\n });\n\n it(\"should convert a buffer into a hexa string without prefix\", () => {\n // GIVEN\n const value = Uint8Array.from([0, 1, 2, 0xff, 0xfe]);\n\n // WHEN\n const result = bufferToHexaString(value, false);\n\n // THEN\n expect(result).toStrictEqual(\"000102fffe\");\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OACE,sBAAAA,EACA,sBAAAC,EACA,gBAAAC,MACK,eAEP,SAAS,aAAc,IAAM,CAC3B,SAAS,wBAAyB,IAAM,CACtC,GAAG,wDAAyD,IAAM,CAKhE,MAAMC,EAASD,EAHD,WAGmB,EAGjC,OAAOC,CAAM,EAAE,WAAW,CAC5B,CAAC,EAED,GAAG,gCAAiC,IAAM,CAKxC,MAAMA,EAASD,EAHD,IAGmB,EAGjC,OAAOC,CAAM,EAAE,WAAW,CAC5B,CAAC,EAED,GAAG,6DAA8D,IAAM,CAKrE,MAAMA,EAASD,EAHD,SAGmB,EAGjC,OAAOC,CAAM,EAAE,UAAU,CAC3B,CAAC,EAED,GAAG,0DAA2D,IAAM,CAKlE,MAAMA,EAASD,EAHD,SAGmB,EAGjC,OAAOC,CAAM,EAAE,UAAU,CAC3B,CAAC,EAED,GAAG,0CAA2C,IAAM,CAKlD,MAAMA,EAASD,EAHD,EAGmB,EAGjC,OAAOC,CAAM,EAAE,UAAU,CAC3B,CAAC,EAED,GAAG,KAAK,CAAC,IAAK,CAAC,EAAG,CAAC,EAAG,KAAM,OAAW,EAAI,CAAC,EAC1C,2CACCC,GAAU,CAET,MAAMD,EAASD,EAAaE,CAAK,EAGjC,OAAOD,CAAM,EAAE,UAAU,CAC3B,CACF,CACF,CAAC,EAED,SAAS,8BAA+B,IAAM,CAC5C,GAAG,6CAA8C,IAAM,CAKrD,MAAMA,EAASF,EAHD,EAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,UAAY,CAC/C,CAAC,EAED,GAAG,gCAAiC,IAAM,CAKxC,MAAMA,EAASF,EAHD,SAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,CACnC,CAAC,EAED,GAAG,mDAAoD,IAAM,CAK3D,MAAMA,EAASF,EAHD,UAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,CACnC,CAAC,EAED,GAAG,4CAA6C,IAAM,CAKpD,MAAMA,EAASF,EAHD,cAGyB,EAGvC,OAAOE,CAAM,EAAE,cACb,IAAI,WAAW,CAAC,GAAM,GAAM,IAAM,IAAM,EAAM,CAAI,CAAC,CACrD,CACF,CAAC,EAED,GAAG,2BAA4B,IAAM,CAKnC,MAAMA,EAASF,EAHD,QAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,CAC3D,CAAC,EAED,GAAG,6BAA8B,IAAM,CAKrC,MAAMA,EAASF,EAHD,QAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,WAAW,CAAC,IAAM,GAAI,CAAC,CAAC,CAC3D,CAAC,EAED,GAAG,oBAAqB,IAAM,CAK5B,MAAMA,EAASF,EAHD,OAGyB,EAGvC,OAAOE,CAAM,EAAE,cAAc,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,CAC3D,CAAC,CACH,CAAC,EAED,SAAS,8BAA+B,IAAM,CAC5C,GAAG,6CAA8C,IAAM,CAErD,MAAMC,EAAQ,WAAW,KAAK,CAAC,EAAG,EAAG,EAAG,IAAM,GAAI,CAAC,EAG7CD,EAASH,EAAmBI,CAAK,EAGvC,OAAOD,CAAM,EAAE,cAAc,cAAc,CAC7C,CAAC,EAED,GAAG,4DAA6D,IAAM,CAEpE,MAAMC,EAAQ,WAAW,KAAK,CAAC,EAAG,EAAG,EAAG,IAAM,GAAI,CAAC,EAG7CD,EAASH,EAAmBI,EAAO,EAAK,EAG9C,OAAOD,CAAM,EAAE,cAAc,YAAY,CAC3C,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["bufferToHexaString", "hexaStringToBuffer", "isHexaString", "result", "value"]
7
7
  }
package/lib/esm/src/di.js CHANGED
@@ -1,2 +1,2 @@
1
- import{Container as i}from"inversify";import{commandModuleFactory as a}from"./api/command/di/commandModule";import{deviceActionModuleFactory as p}from"./api/device-action/di/deviceActionModule";import{configModuleFactory as c}from"./internal/config/di/configModule";import{deviceModelModuleFactory as n}from"./internal/device-model/di/deviceModelModule";import{deviceSessionModuleFactory as l}from"./internal/device-session/di/deviceSessionModule";import{discoveryModuleFactory as f}from"./internal/discovery/di/discoveryModule";import{loggerModuleFactory as d}from"./internal/logger-publisher/di/loggerModule";import{managerApiModuleFactory as y}from"./internal/manager-api/di/managerApiModule";import{DEFAULT_MANAGER_API_BASE_URL as F,DEFAULT_MOCK_SERVER_BASE_URL as M}from"./internal/manager-api/model/Const";import{secureChannelModuleFactory as s}from"./internal/secure-channel/di/secureChannelModule";import{DEFAULT_WEB_SOCKET_BASE_URL as g}from"./internal/secure-channel/model/Const";import{sendModuleFactory as A}from"./internal/send/di/sendModule";import{transportModuleFactory as _}from"./internal/transport/di/transportModule";const x=({stub:o=!1,transports:t=[],loggers:m=[],config:r={mockUrl:M,managerApiUrl:F,webSocketUrl:g}})=>{const e=new i;return e.load(c({stub:o}),n({stub:o}),_({stub:o,transports:t,config:r}),y({stub:o,config:r}),s({stub:o,config:r}),f({stub:o}),d({subscribers:m}),l({stub:o}),A({stub:o}),a({stub:o}),p({stub:o})),e};export{x as makeContainer};
1
+ import{Container as m}from"inversify";import{commandModuleFactory as a}from"./api/command/di/commandModule";import{deviceActionModuleFactory as p}from"./api/device-action/di/deviceActionModule";import{configModuleFactory as c}from"./internal/config/di/configModule";import{deviceModelModuleFactory as n}from"./internal/device-model/di/deviceModelModule";import{deviceSessionModuleFactory as l}from"./internal/device-session/di/deviceSessionModule";import{discoveryModuleFactory as f}from"./internal/discovery/di/discoveryModule";import{loggerModuleFactory as d}from"./internal/logger-publisher/di/loggerModule";import{managerApiModuleFactory as y}from"./internal/manager-api/di/managerApiModule";import{DEFAULT_FIRMWARE_DISTRIBUTION_SALT as F,DEFAULT_MANAGER_API_BASE_URL as M,DEFAULT_MOCK_SERVER_BASE_URL as A,DEFAULT_PROVIDER as _}from"./internal/manager-api/model/Const";import{secureChannelModuleFactory as E}from"./internal/secure-channel/di/secureChannelModule";import{DEFAULT_WEB_SOCKET_BASE_URL as S}from"./internal/secure-channel/model/Const";import{sendModuleFactory as s}from"./internal/send/di/sendModule";import{transportModuleFactory as g}from"./internal/transport/di/transportModule";const x=({stub:o=!1,transports:t=[],loggers:i=[],config:r={mockUrl:A,managerApiUrl:M,webSocketUrl:S,provider:_,firmwareDistributionSalt:F}})=>{const e=new m;return e.loadSync(c({stub:o}),n({stub:o}),g({stub:o,transports:t,config:r}),y({stub:o,config:r}),E({stub:o,config:r}),f({stub:o}),d({subscribers:i}),l({stub:o}),s({stub:o}),a({stub:o}),p({stub:o})),e};export{x as makeContainer};
2
2
  //# sourceMappingURL=di.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/di.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\n// Uncomment this line to enable the logger middleware\n// import { makeLoggerMiddleware } from \"inversify-logger-middleware\";\nimport { commandModuleFactory } from \"@api/command/di/commandModule\";\nimport { deviceActionModuleFactory } from \"@api/device-action/di/deviceActionModule\";\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nimport { type TransportFactory } from \"@api/transport/model/Transport\";\nimport { configModuleFactory } from \"@internal/config/di/configModule\";\nimport { deviceModelModuleFactory } from \"@internal/device-model/di/deviceModelModule\";\nimport { deviceSessionModuleFactory } from \"@internal/device-session/di/deviceSessionModule\";\nimport { discoveryModuleFactory } from \"@internal/discovery/di/discoveryModule\";\nimport { loggerModuleFactory } from \"@internal/logger-publisher/di/loggerModule\";\nimport { managerApiModuleFactory } from \"@internal/manager-api/di/managerApiModule\";\nimport {\n DEFAULT_MANAGER_API_BASE_URL,\n DEFAULT_MOCK_SERVER_BASE_URL,\n} from \"@internal/manager-api/model/Const\";\nimport { secureChannelModuleFactory } from \"@internal/secure-channel/di/secureChannelModule\";\nimport { DEFAULT_WEB_SOCKET_BASE_URL } from \"@internal/secure-channel/model/Const\";\nimport { sendModuleFactory } from \"@internal/send/di/sendModule\";\nimport { transportModuleFactory } from \"@internal/transport//di/transportModule\";\n\n// Uncomment this line to enable the logger middleware\n// const logger = makeLoggerMiddleware();\n\nexport type MakeContainerProps = {\n stub: boolean;\n transports: TransportFactory[];\n loggers: LoggerSubscriberService[];\n config: DmkConfig;\n};\n\nexport const makeContainer = ({\n stub = false,\n transports = [],\n loggers = [],\n config = {\n mockUrl: DEFAULT_MOCK_SERVER_BASE_URL,\n managerApiUrl: DEFAULT_MANAGER_API_BASE_URL,\n webSocketUrl: DEFAULT_WEB_SOCKET_BASE_URL,\n },\n}: Partial<MakeContainerProps>) => {\n const container = new Container();\n\n // Uncomment this line to enable the logger middleware\n // container.applyMiddleware(logger);\n\n container.load(\n configModuleFactory({ stub }),\n deviceModelModuleFactory({ stub }),\n transportModuleFactory({ stub, transports, config }),\n managerApiModuleFactory({ stub, config }),\n secureChannelModuleFactory({ stub, config }),\n discoveryModuleFactory({ stub }),\n loggerModuleFactory({ subscribers: loggers }),\n deviceSessionModuleFactory({ stub }),\n sendModuleFactory({ stub }),\n commandModuleFactory({ stub }),\n deviceActionModuleFactory({ stub }),\n // modules go here\n );\n\n return container;\n};\n"],
5
- "mappings": "AAAA,OAAS,aAAAA,MAAiB,YAI1B,OAAS,wBAAAC,MAA4B,gCACrC,OAAS,6BAAAC,MAAiC,2CAI1C,OAAS,uBAAAC,MAA2B,mCACpC,OAAS,4BAAAC,MAAgC,8CACzC,OAAS,8BAAAC,MAAkC,kDAC3C,OAAS,0BAAAC,MAA8B,yCACvC,OAAS,uBAAAC,MAA2B,6CACpC,OAAS,2BAAAC,MAA+B,4CACxC,OACE,gCAAAC,EACA,gCAAAC,MACK,oCACP,OAAS,8BAAAC,MAAkC,kDAC3C,OAAS,+BAAAC,MAAmC,uCAC5C,OAAS,qBAAAC,MAAyB,+BAClC,OAAS,0BAAAC,MAA8B,0CAYhC,MAAMC,EAAgB,CAAC,CAC5B,KAAAC,EAAO,GACP,WAAAC,EAAa,CAAC,EACd,QAAAC,EAAU,CAAC,EACX,OAAAC,EAAS,CACP,QAAST,EACT,cAAeD,EACf,aAAcG,CAChB,CACF,IAAmC,CACjC,MAAMQ,EAAY,IAAIpB,EAKtB,OAAAoB,EAAU,KACRjB,EAAoB,CAAE,KAAAa,CAAK,CAAC,EAC5BZ,EAAyB,CAAE,KAAAY,CAAK,CAAC,EACjCF,EAAuB,CAAE,KAAAE,EAAM,WAAAC,EAAY,OAAAE,CAAO,CAAC,EACnDX,EAAwB,CAAE,KAAAQ,EAAM,OAAAG,CAAO,CAAC,EACxCR,EAA2B,CAAE,KAAAK,EAAM,OAAAG,CAAO,CAAC,EAC3Cb,EAAuB,CAAE,KAAAU,CAAK,CAAC,EAC/BT,EAAoB,CAAE,YAAaW,CAAQ,CAAC,EAC5Cb,EAA2B,CAAE,KAAAW,CAAK,CAAC,EACnCH,EAAkB,CAAE,KAAAG,CAAK,CAAC,EAC1Bf,EAAqB,CAAE,KAAAe,CAAK,CAAC,EAC7Bd,EAA0B,CAAE,KAAAc,CAAK,CAAC,CAEpC,EAEOI,CACT",
6
- "names": ["Container", "commandModuleFactory", "deviceActionModuleFactory", "configModuleFactory", "deviceModelModuleFactory", "deviceSessionModuleFactory", "discoveryModuleFactory", "loggerModuleFactory", "managerApiModuleFactory", "DEFAULT_MANAGER_API_BASE_URL", "DEFAULT_MOCK_SERVER_BASE_URL", "secureChannelModuleFactory", "DEFAULT_WEB_SOCKET_BASE_URL", "sendModuleFactory", "transportModuleFactory", "makeContainer", "stub", "transports", "loggers", "config", "container"]
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { commandModuleFactory } from \"@api/command/di/commandModule\";\nimport { deviceActionModuleFactory } from \"@api/device-action/di/deviceActionModule\";\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nimport { type TransportFactory } from \"@api/transport/model/Transport\";\nimport { configModuleFactory } from \"@internal/config/di/configModule\";\nimport { deviceModelModuleFactory } from \"@internal/device-model/di/deviceModelModule\";\nimport { deviceSessionModuleFactory } from \"@internal/device-session/di/deviceSessionModule\";\nimport { discoveryModuleFactory } from \"@internal/discovery/di/discoveryModule\";\nimport { loggerModuleFactory } from \"@internal/logger-publisher/di/loggerModule\";\nimport { managerApiModuleFactory } from \"@internal/manager-api/di/managerApiModule\";\nimport {\n DEFAULT_FIRMWARE_DISTRIBUTION_SALT,\n DEFAULT_MANAGER_API_BASE_URL,\n DEFAULT_MOCK_SERVER_BASE_URL,\n DEFAULT_PROVIDER,\n} from \"@internal/manager-api/model/Const\";\nimport { secureChannelModuleFactory } from \"@internal/secure-channel/di/secureChannelModule\";\nimport { DEFAULT_WEB_SOCKET_BASE_URL } from \"@internal/secure-channel/model/Const\";\nimport { sendModuleFactory } from \"@internal/send/di/sendModule\";\nimport { transportModuleFactory } from \"@internal/transport//di/transportModule\";\n\nexport type MakeContainerProps = {\n stub: boolean;\n transports: TransportFactory[];\n loggers: LoggerSubscriberService[];\n config: DmkConfig;\n};\n\nexport const makeContainer = ({\n stub = false,\n transports = [],\n loggers = [],\n config = {\n mockUrl: DEFAULT_MOCK_SERVER_BASE_URL,\n managerApiUrl: DEFAULT_MANAGER_API_BASE_URL,\n webSocketUrl: DEFAULT_WEB_SOCKET_BASE_URL,\n provider: DEFAULT_PROVIDER,\n firmwareDistributionSalt: DEFAULT_FIRMWARE_DISTRIBUTION_SALT,\n },\n}: Partial<MakeContainerProps>) => {\n const container = new Container();\n\n container.loadSync(\n configModuleFactory({ stub }),\n deviceModelModuleFactory({ stub }),\n transportModuleFactory({ stub, transports, config }),\n managerApiModuleFactory({ stub, config }),\n secureChannelModuleFactory({ stub, config }),\n discoveryModuleFactory({ stub }),\n loggerModuleFactory({ subscribers: loggers }),\n deviceSessionModuleFactory({ stub }),\n sendModuleFactory({ stub }),\n commandModuleFactory({ stub }),\n deviceActionModuleFactory({ stub }),\n // modules go here\n );\n\n return container;\n};\n"],
5
+ "mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,wBAAAC,MAA4B,gCACrC,OAAS,6BAAAC,MAAiC,2CAI1C,OAAS,uBAAAC,MAA2B,mCACpC,OAAS,4BAAAC,MAAgC,8CACzC,OAAS,8BAAAC,MAAkC,kDAC3C,OAAS,0BAAAC,MAA8B,yCACvC,OAAS,uBAAAC,MAA2B,6CACpC,OAAS,2BAAAC,MAA+B,4CACxC,OACE,sCAAAC,EACA,gCAAAC,EACA,gCAAAC,EACA,oBAAAC,MACK,oCACP,OAAS,8BAAAC,MAAkC,kDAC3C,OAAS,+BAAAC,MAAmC,uCAC5C,OAAS,qBAAAC,MAAyB,+BAClC,OAAS,0BAAAC,MAA8B,0CAShC,MAAMC,EAAgB,CAAC,CAC5B,KAAAC,EAAO,GACP,WAAAC,EAAa,CAAC,EACd,QAAAC,EAAU,CAAC,EACX,OAAAC,EAAS,CACP,QAASV,EACT,cAAeD,EACf,aAAcI,EACd,SAAUF,EACV,yBAA0BH,CAC5B,CACF,IAAmC,CACjC,MAAMa,EAAY,IAAItB,EAEtB,OAAAsB,EAAU,SACRnB,EAAoB,CAAE,KAAAe,CAAK,CAAC,EAC5Bd,EAAyB,CAAE,KAAAc,CAAK,CAAC,EACjCF,EAAuB,CAAE,KAAAE,EAAM,WAAAC,EAAY,OAAAE,CAAO,CAAC,EACnDb,EAAwB,CAAE,KAAAU,EAAM,OAAAG,CAAO,CAAC,EACxCR,EAA2B,CAAE,KAAAK,EAAM,OAAAG,CAAO,CAAC,EAC3Cf,EAAuB,CAAE,KAAAY,CAAK,CAAC,EAC/BX,EAAoB,CAAE,YAAaa,CAAQ,CAAC,EAC5Cf,EAA2B,CAAE,KAAAa,CAAK,CAAC,EACnCH,EAAkB,CAAE,KAAAG,CAAK,CAAC,EAC1BjB,EAAqB,CAAE,KAAAiB,CAAK,CAAC,EAC7BhB,EAA0B,CAAE,KAAAgB,CAAK,CAAC,CAEpC,EAEOI,CACT",
6
+ "names": ["Container", "commandModuleFactory", "deviceActionModuleFactory", "configModuleFactory", "deviceModelModuleFactory", "deviceSessionModuleFactory", "discoveryModuleFactory", "loggerModuleFactory", "managerApiModuleFactory", "DEFAULT_FIRMWARE_DISTRIBUTION_SALT", "DEFAULT_MANAGER_API_BASE_URL", "DEFAULT_MOCK_SERVER_BASE_URL", "DEFAULT_PROVIDER", "secureChannelModuleFactory", "DEFAULT_WEB_SOCKET_BASE_URL", "sendModuleFactory", "transportModuleFactory", "makeContainer", "stub", "transports", "loggers", "config", "container"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ContainerModule as a}from"inversify";import{FileLocalConfigDataSource as i}from"../../config/data/LocalConfigDataSource";import{StubLocalConfigDataSource as f}from"../../config/data/LocalConfigDataSource.stub";import{RestRemoteConfigDataSource as m}from"../../config/data/RemoteConfigDataSource";import{StubRemoteConfigDataSource as c}from"../../config/data/RemoteConfigDataSource.stub";import{DefaultConfigService as n}from"../../config/service/DefaultConfigService";import{GetDmkVersionUseCase as u}from"../../config/use-case/GetDmkVersionUseCase";import{configTypes as o}from"./configTypes";const L=({stub:r})=>new a((t,p,s,e)=>{t(o.LocalConfigDataSource).to(i),t(o.RemoteConfigDataSource).to(m),t(o.GetDmkVersionUseCase).to(u),t(o.ConfigService).to(n),r&&(e(o.LocalConfigDataSource).to(f),e(o.RemoteConfigDataSource).to(c))});export{L as configModuleFactory};
1
+ import{ContainerModule as a}from"inversify";import{FileLocalConfigDataSource as i}from"../../config/data/LocalConfigDataSource";import{StubLocalConfigDataSource as f}from"../../config/data/LocalConfigDataSource.stub";import{RestRemoteConfigDataSource as m}from"../../config/data/RemoteConfigDataSource";import{StubRemoteConfigDataSource as c}from"../../config/data/RemoteConfigDataSource.stub";import{DefaultConfigService as n}from"../../config/service/DefaultConfigService";import{GetDmkVersionUseCase as u}from"../../config/use-case/GetDmkVersionUseCase";import{configTypes as o}from"./configTypes";const y=({stub:r})=>new a(({bind:t,rebindSync:e})=>{t(o.LocalConfigDataSource).to(i),t(o.RemoteConfigDataSource).to(m),t(o.GetDmkVersionUseCase).to(u),t(o.ConfigService).to(n),r&&(e(o.LocalConfigDataSource).to(f),e(o.RemoteConfigDataSource).to(c))});export{y as configModuleFactory};
2
2
  //# sourceMappingURL=configModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/config/di/configModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { FileLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource\";\nimport { StubLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource.stub\";\nimport { RestRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource\";\nimport { StubRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource.stub\";\nimport { DefaultConfigService } from \"@internal/config/service/DefaultConfigService\";\nimport { GetDmkVersionUseCase } from \"@internal/config/use-case/GetDmkVersionUseCase\";\n\nimport { configTypes } from \"./configTypes\";\n\n// This module is used to configure the dependency injection container\n// This is where we will bind our interfaces to their implementations (or mocks...)\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const configModuleFactory = ({ stub }: FactoryProps) =>\n new ContainerModule((bind, _unbind, _isBound, rebind) => {\n bind(configTypes.LocalConfigDataSource).to(FileLocalConfigDataSource);\n bind(configTypes.RemoteConfigDataSource).to(RestRemoteConfigDataSource);\n bind(configTypes.GetDmkVersionUseCase).to(GetDmkVersionUseCase);\n bind(configTypes.ConfigService).to(DefaultConfigService);\n\n if (stub) {\n // We can rebind our interfaces to their mock implementations\n rebind(configTypes.LocalConfigDataSource).to(StubLocalConfigDataSource);\n rebind(configTypes.RemoteConfigDataSource).to(StubRemoteConfigDataSource);\n }\n });\n"],
5
- "mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,6BAAAC,MAAiC,8CAC1C,OAAS,6BAAAC,MAAiC,mDAC1C,OAAS,8BAAAC,MAAkC,+CAC3C,OAAS,8BAAAC,MAAkC,oDAC3C,OAAS,wBAAAC,MAA4B,gDACrC,OAAS,wBAAAC,MAA4B,iDAErC,OAAS,eAAAC,MAAmB,gBAQrB,MAAMC,EAAsB,CAAC,CAAE,KAAAC,CAAK,IACzC,IAAIT,EAAgB,CAACU,EAAMC,EAASC,EAAUC,IAAW,CACvDH,EAAKH,EAAY,qBAAqB,EAAE,GAAGN,CAAyB,EACpES,EAAKH,EAAY,sBAAsB,EAAE,GAAGJ,CAA0B,EACtEO,EAAKH,EAAY,oBAAoB,EAAE,GAAGD,CAAoB,EAC9DI,EAAKH,EAAY,aAAa,EAAE,GAAGF,CAAoB,EAEnDI,IAEFI,EAAON,EAAY,qBAAqB,EAAE,GAAGL,CAAyB,EACtEW,EAAON,EAAY,sBAAsB,EAAE,GAAGH,CAA0B,EAE5E,CAAC",
6
- "names": ["ContainerModule", "FileLocalConfigDataSource", "StubLocalConfigDataSource", "RestRemoteConfigDataSource", "StubRemoteConfigDataSource", "DefaultConfigService", "GetDmkVersionUseCase", "configTypes", "configModuleFactory", "stub", "bind", "_unbind", "_isBound", "rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { FileLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource\";\nimport { StubLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource.stub\";\nimport { RestRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource\";\nimport { StubRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource.stub\";\nimport { DefaultConfigService } from \"@internal/config/service/DefaultConfigService\";\nimport { GetDmkVersionUseCase } from \"@internal/config/use-case/GetDmkVersionUseCase\";\n\nimport { configTypes } from \"./configTypes\";\n\n// This module is used to configure the dependency injection container\n// This is where we will bind our interfaces to their implementations (or mocks...)\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const configModuleFactory = ({ stub }: FactoryProps) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind(configTypes.LocalConfigDataSource).to(FileLocalConfigDataSource);\n bind(configTypes.RemoteConfigDataSource).to(RestRemoteConfigDataSource);\n bind(configTypes.GetDmkVersionUseCase).to(GetDmkVersionUseCase);\n bind(configTypes.ConfigService).to(DefaultConfigService);\n\n if (stub) {\n // We can rebind our interfaces to their mock implementations\n rebindSync(configTypes.LocalConfigDataSource).to(\n StubLocalConfigDataSource,\n );\n rebindSync(configTypes.RemoteConfigDataSource).to(\n StubRemoteConfigDataSource,\n );\n }\n });\n"],
5
+ "mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,6BAAAC,MAAiC,8CAC1C,OAAS,6BAAAC,MAAiC,mDAC1C,OAAS,8BAAAC,MAAkC,+CAC3C,OAAS,8BAAAC,MAAkC,oDAC3C,OAAS,wBAAAC,MAA4B,gDACrC,OAAS,wBAAAC,MAA4B,iDAErC,OAAS,eAAAC,MAAmB,gBAQrB,MAAMC,EAAsB,CAAC,CAAE,KAAAC,CAAK,IACzC,IAAIT,EAAgB,CAAC,CAAE,KAAAU,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EAAKH,EAAY,qBAAqB,EAAE,GAAGN,CAAyB,EACpES,EAAKH,EAAY,sBAAsB,EAAE,GAAGJ,CAA0B,EACtEO,EAAKH,EAAY,oBAAoB,EAAE,GAAGD,CAAoB,EAC9DI,EAAKH,EAAY,aAAa,EAAE,GAAGF,CAAoB,EAEnDI,IAEFE,EAAWJ,EAAY,qBAAqB,EAAE,GAC5CL,CACF,EACAS,EAAWJ,EAAY,sBAAsB,EAAE,GAC7CH,CACF,EAEJ,CAAC",
6
+ "names": ["ContainerModule", "FileLocalConfigDataSource", "StubLocalConfigDataSource", "RestRemoteConfigDataSource", "StubRemoteConfigDataSource", "DefaultConfigService", "GetDmkVersionUseCase", "configTypes", "configModuleFactory", "stub", "bind", "rebindSync"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Container as a}from"inversify";import{FileLocalConfigDataSource as i}from"../../config/data/LocalConfigDataSource";import{StubLocalConfigDataSource as u}from"../../config/data/LocalConfigDataSource.stub";import{RestRemoteConfigDataSource as f}from"../../config/data/RemoteConfigDataSource";import{StubRemoteConfigDataSource as l}from"../../config/data/RemoteConfigDataSource.stub";import{configModuleFactory as n}from"./configModule";import{configTypes as t}from"./configTypes";describe("configModuleFactory",()=>{describe("Default",()=>{let e,o;beforeEach(()=>{o=n({stub:!1}),e=new a,e.load(o)}),it("should return the config module",()=>{expect(o).toBeDefined()}),it("should return none mocked data sources",()=>{const c=e.get(t.LocalConfigDataSource),r=e.get(t.RemoteConfigDataSource);expect(c).toBeInstanceOf(i),expect(r).toBeInstanceOf(f)})}),describe("Mocked",()=>{let e,o;beforeEach(()=>{o=n({stub:!0}),e=new a,e.load(o)}),it("should return the config module",()=>{expect(o).toBeDefined()}),it("should return mocked data sources",()=>{const c=e.get(t.LocalConfigDataSource),r=e.get(t.RemoteConfigDataSource);expect(c).toBeInstanceOf(u),expect(r).toBeInstanceOf(l)})})});
1
+ import{Container as a}from"inversify";import{FileLocalConfigDataSource as i}from"../../config/data/LocalConfigDataSource";import{StubLocalConfigDataSource as u}from"../../config/data/LocalConfigDataSource.stub";import{RestRemoteConfigDataSource as f}from"../../config/data/RemoteConfigDataSource";import{StubRemoteConfigDataSource as l}from"../../config/data/RemoteConfigDataSource.stub";import{configModuleFactory as n}from"./configModule";import{configTypes as t}from"./configTypes";describe("configModuleFactory",()=>{describe("Default",()=>{let e,o;beforeEach(()=>{o=n({stub:!1}),e=new a,e.loadSync(o)}),it("should return the config module",()=>{expect(o).toBeDefined()}),it("should return none mocked data sources",()=>{const c=e.get(t.LocalConfigDataSource),r=e.get(t.RemoteConfigDataSource);expect(c).toBeInstanceOf(i),expect(r).toBeInstanceOf(f)})}),describe("Mocked",()=>{let e,o;beforeEach(()=>{o=n({stub:!0}),e=new a,e.loadSync(o)}),it("should return the config module",()=>{expect(o).toBeDefined()}),it("should return mocked data sources",()=>{const c=e.get(t.LocalConfigDataSource),r=e.get(t.RemoteConfigDataSource);expect(c).toBeInstanceOf(u),expect(r).toBeInstanceOf(l)})})});
2
2
  //# sourceMappingURL=configModule.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/config/di/configModule.test.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { FileLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource\";\nimport { StubLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource.stub\";\nimport { RestRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource\";\nimport { StubRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource.stub\";\n\nimport { configModuleFactory } from \"./configModule\";\nimport { configTypes } from \"./configTypes\";\n\ndescribe(\"configModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof configModuleFactory>;\n beforeEach(() => {\n mod = configModuleFactory({ stub: false });\n container = new Container();\n container.load(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none mocked data sources\", () => {\n const localDataSource = container.get(configTypes.LocalConfigDataSource);\n const remoteDataSource = container.get(\n configTypes.RemoteConfigDataSource,\n );\n expect(localDataSource).toBeInstanceOf(FileLocalConfigDataSource);\n expect(remoteDataSource).toBeInstanceOf(RestRemoteConfigDataSource);\n });\n });\n\n describe(\"Mocked\", () => {\n let container: Container;\n let mod: ReturnType<typeof configModuleFactory>;\n beforeEach(() => {\n mod = configModuleFactory({ stub: true });\n container = new Container();\n container.load(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return mocked data sources\", () => {\n const localDataSource = container.get(configTypes.LocalConfigDataSource);\n const remoteDataSource = container.get(\n configTypes.RemoteConfigDataSource,\n );\n expect(localDataSource).toBeInstanceOf(StubLocalConfigDataSource);\n expect(remoteDataSource).toBeInstanceOf(StubRemoteConfigDataSource);\n });\n });\n});\n"],
5
- "mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,6BAAAC,MAAiC,8CAC1C,OAAS,6BAAAC,MAAiC,mDAC1C,OAAS,8BAAAC,MAAkC,+CAC3C,OAAS,8BAAAC,MAAkC,oDAE3C,OAAS,uBAAAC,MAA2B,iBACpC,OAAS,eAAAC,MAAmB,gBAE5B,SAAS,sBAAuB,IAAM,CACpC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,EAAMH,EAAoB,CAAE,KAAM,EAAM,CAAC,EACzCE,EAAY,IAAIP,EAChBO,EAAU,KAAKC,CAAG,CACpB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,yCAA0C,IAAM,CACjD,MAAMC,EAAkBF,EAAU,IAAID,EAAY,qBAAqB,EACjEI,EAAmBH,EAAU,IACjCD,EAAY,sBACd,EACA,OAAOG,CAAe,EAAE,eAAeR,CAAyB,EAChE,OAAOS,CAAgB,EAAE,eAAeP,CAA0B,CACpE,CAAC,CACH,CAAC,EAED,SAAS,SAAU,IAAM,CACvB,IAAII,EACAC,EACJ,WAAW,IAAM,CACfA,EAAMH,EAAoB,CAAE,KAAM,EAAK,CAAC,EACxCE,EAAY,IAAIP,EAChBO,EAAU,KAAKC,CAAG,CACpB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,oCAAqC,IAAM,CAC5C,MAAMC,EAAkBF,EAAU,IAAID,EAAY,qBAAqB,EACjEI,EAAmBH,EAAU,IACjCD,EAAY,sBACd,EACA,OAAOG,CAAe,EAAE,eAAeP,CAAyB,EAChE,OAAOQ,CAAgB,EAAE,eAAeN,CAA0B,CACpE,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { FileLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource\";\nimport { StubLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource.stub\";\nimport { RestRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource\";\nimport { StubRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource.stub\";\n\nimport { configModuleFactory } from \"./configModule\";\nimport { configTypes } from \"./configTypes\";\n\ndescribe(\"configModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof configModuleFactory>;\n beforeEach(() => {\n mod = configModuleFactory({ stub: false });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none mocked data sources\", () => {\n const localDataSource = container.get(configTypes.LocalConfigDataSource);\n const remoteDataSource = container.get(\n configTypes.RemoteConfigDataSource,\n );\n expect(localDataSource).toBeInstanceOf(FileLocalConfigDataSource);\n expect(remoteDataSource).toBeInstanceOf(RestRemoteConfigDataSource);\n });\n });\n\n describe(\"Mocked\", () => {\n let container: Container;\n let mod: ReturnType<typeof configModuleFactory>;\n beforeEach(() => {\n mod = configModuleFactory({ stub: true });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return mocked data sources\", () => {\n const localDataSource = container.get(configTypes.LocalConfigDataSource);\n const remoteDataSource = container.get(\n configTypes.RemoteConfigDataSource,\n );\n expect(localDataSource).toBeInstanceOf(StubLocalConfigDataSource);\n expect(remoteDataSource).toBeInstanceOf(StubRemoteConfigDataSource);\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,6BAAAC,MAAiC,8CAC1C,OAAS,6BAAAC,MAAiC,mDAC1C,OAAS,8BAAAC,MAAkC,+CAC3C,OAAS,8BAAAC,MAAkC,oDAE3C,OAAS,uBAAAC,MAA2B,iBACpC,OAAS,eAAAC,MAAmB,gBAE5B,SAAS,sBAAuB,IAAM,CACpC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,EAAMH,EAAoB,CAAE,KAAM,EAAM,CAAC,EACzCE,EAAY,IAAIP,EAChBO,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,yCAA0C,IAAM,CACjD,MAAMC,EAAkBF,EAAU,IAAID,EAAY,qBAAqB,EACjEI,EAAmBH,EAAU,IACjCD,EAAY,sBACd,EACA,OAAOG,CAAe,EAAE,eAAeR,CAAyB,EAChE,OAAOS,CAAgB,EAAE,eAAeP,CAA0B,CACpE,CAAC,CACH,CAAC,EAED,SAAS,SAAU,IAAM,CACvB,IAAII,EACAC,EACJ,WAAW,IAAM,CACfA,EAAMH,EAAoB,CAAE,KAAM,EAAK,CAAC,EACxCE,EAAY,IAAIP,EAChBO,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,oCAAqC,IAAM,CAC5C,MAAMC,EAAkBF,EAAU,IAAID,EAAY,qBAAqB,EACjEI,EAAmBH,EAAU,IACjCD,EAAY,sBACd,EACA,OAAOG,CAAe,EAAE,eAAeP,CAAyB,EAChE,OAAOQ,CAAgB,EAAE,eAAeN,CAA0B,CACpE,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["Container", "FileLocalConfigDataSource", "StubLocalConfigDataSource", "RestRemoteConfigDataSource", "StubRemoteConfigDataSource", "configModuleFactory", "configTypes", "container", "mod", "localDataSource", "remoteDataSource"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ContainerModule as r}from"inversify";import{StaticDeviceModelDataSource as t}from"../../../api/device-model/data/StaticDeviceModelDataSource";import{deviceModelTypes as i}from"./deviceModelTypes";const u=({stub:o})=>new r((e,c,d,a)=>{e(i.DeviceModelDataSource).to(t)});export{u as deviceModelModuleFactory};
1
+ import{ContainerModule as t}from"inversify";import{StaticDeviceModelDataSource as r}from"../../../api/device-model/data/StaticDeviceModelDataSource";import{deviceModelTypes as c}from"./deviceModelTypes";const p=({stub:o})=>new t(({bind:e})=>{e(c.DeviceModelDataSource).to(r)});export{p as deviceModelModuleFactory};
2
2
  //# sourceMappingURL=deviceModelModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-model/di/deviceModelModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\n\nimport { deviceModelTypes } from \"./deviceModelTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const deviceModelModuleFactory = ({ stub }: FactoryProps) =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(deviceModelTypes.DeviceModelDataSource).to(\n StaticDeviceModelDataSource,\n );\n\n if (stub) {\n // We can rebind our interfaces to their mock implementations\n // rebind(...).to(....);\n }\n });\n"],
5
- "mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,+BAAAC,MAAmC,qDAE5C,OAAS,oBAAAC,MAAwB,qBAM1B,MAAMC,EAA2B,CAAC,CAAE,KAAAC,CAAK,IAC9C,IAAIJ,EAAgB,CAACK,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAKH,EAAiB,qBAAqB,EAAE,GAC3CD,CACF,CAMF,CAAC",
6
- "names": ["ContainerModule", "StaticDeviceModelDataSource", "deviceModelTypes", "deviceModelModuleFactory", "stub", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\n\nimport { deviceModelTypes } from \"./deviceModelTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const deviceModelModuleFactory = ({ stub }: FactoryProps) =>\n new ContainerModule(({ bind }) => {\n bind(deviceModelTypes.DeviceModelDataSource).to(\n StaticDeviceModelDataSource,\n );\n\n if (stub) {\n // We can rebind our interfaces to their mock implementations\n // rebind(...).to(....);\n }\n });\n"],
5
+ "mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,+BAAAC,MAAmC,qDAE5C,OAAS,oBAAAC,MAAwB,qBAM1B,MAAMC,EAA2B,CAAC,CAAE,KAAAC,CAAK,IAC9C,IAAIJ,EAAgB,CAAC,CAAE,KAAAK,CAAK,IAAM,CAChCA,EAAKH,EAAiB,qBAAqB,EAAE,GAC3CD,CACF,CAMF,CAAC",
6
+ "names": ["ContainerModule", "StaticDeviceModelDataSource", "deviceModelTypes", "deviceModelModuleFactory", "stub", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Container as d}from"inversify";import{StaticDeviceModelDataSource as r}from"../../../api/device-model/data/StaticDeviceModelDataSource";import{deviceModelModuleFactory as c}from"./deviceModelModule";import{deviceModelTypes as i}from"./deviceModelTypes";describe("deviceModelModuleFactory",()=>{let e,o;beforeEach(()=>{o=c({stub:!1}),e=new d,e.load(o)}),it("should return the device module",()=>{expect(o).toBeDefined()}),it("should return none mocked services and data sources",()=>{const t=e.get(i.DeviceModelDataSource);expect(t).toBeInstanceOf(r)})});
1
+ import{Container as c}from"inversify";import{StaticDeviceModelDataSource as d}from"../../../api/device-model/data/StaticDeviceModelDataSource";import{deviceModelModuleFactory as r}from"./deviceModelModule";import{deviceModelTypes as i}from"./deviceModelTypes";describe("deviceModelModuleFactory",()=>{let e,o;beforeEach(()=>{o=r({stub:!1}),e=new c,e.loadSync(o)}),it("should return the device module",()=>{expect(o).toBeDefined()}),it("should return none mocked services and data sources",()=>{const t=e.get(i.DeviceModelDataSource);expect(t).toBeInstanceOf(d)})});
2
2
  //# sourceMappingURL=deviceModelModule.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-model/di/deviceModelModule.test.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\n\nimport { deviceModelModuleFactory } from \"./deviceModelModule\";\nimport { deviceModelTypes } from \"./deviceModelTypes\";\n\ndescribe(\"deviceModelModuleFactory\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceModelModuleFactory>;\n beforeEach(() => {\n mod = deviceModelModuleFactory({ stub: false });\n container = new Container();\n container.load(mod);\n });\n\n it(\"should return the device module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none mocked services and data sources\", () => {\n const deviceModelDataSource = container.get(\n deviceModelTypes.DeviceModelDataSource,\n );\n expect(deviceModelDataSource).toBeInstanceOf(StaticDeviceModelDataSource);\n });\n});\n"],
5
- "mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,+BAAAC,MAAmC,qDAE5C,OAAS,4BAAAC,MAAgC,sBACzC,OAAS,oBAAAC,MAAwB,qBAEjC,SAAS,2BAA4B,IAAM,CACzC,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,EAAMH,EAAyB,CAAE,KAAM,EAAM,CAAC,EAC9CE,EAAY,IAAIJ,EAChBI,EAAU,KAAKC,CAAG,CACpB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,sDAAuD,IAAM,CAC9D,MAAMC,EAAwBF,EAAU,IACtCD,EAAiB,qBACnB,EACA,OAAOG,CAAqB,EAAE,eAAeL,CAA2B,CAC1E,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\n\nimport { deviceModelModuleFactory } from \"./deviceModelModule\";\nimport { deviceModelTypes } from \"./deviceModelTypes\";\n\ndescribe(\"deviceModelModuleFactory\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceModelModuleFactory>;\n beforeEach(() => {\n mod = deviceModelModuleFactory({ stub: false });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the device module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none mocked services and data sources\", () => {\n const deviceModelDataSource = container.get(\n deviceModelTypes.DeviceModelDataSource,\n );\n expect(deviceModelDataSource).toBeInstanceOf(StaticDeviceModelDataSource);\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,+BAAAC,MAAmC,qDAE5C,OAAS,4BAAAC,MAAgC,sBACzC,OAAS,oBAAAC,MAAwB,qBAEjC,SAAS,2BAA4B,IAAM,CACzC,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,EAAMH,EAAyB,CAAE,KAAM,EAAM,CAAC,EAC9CE,EAAY,IAAIJ,EAChBI,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,sDAAuD,IAAM,CAC9D,MAAMC,EAAwBF,EAAU,IACtCD,EAAiB,qBACnB,EACA,OAAOG,CAAqB,EAAE,eAAeL,CAA2B,CAC1E,CAAC,CACH,CAAC",
6
6
  "names": ["Container", "StaticDeviceModelDataSource", "deviceModelModuleFactory", "deviceModelTypes", "container", "mod", "deviceModelDataSource"]
7
7
  }
@@ -1,2 +1,2 @@
1
- const E=2;export{E as APDU_RESPONSE_STATUS_CODE_LENGTH};
1
+ const E=2,T=800;export{E as APDU_RESPONSE_STATUS_CODE_LENGTH,T as PINGER_TIMEOUT};
2
2
  //# sourceMappingURL=ApduResponseConst.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/data/ApduResponseConst.ts"],
4
- "sourcesContent": ["export const APDU_RESPONSE_STATUS_CODE_LENGTH = 2;\n"],
5
- "mappings": "AAAO,MAAMA,EAAmC",
6
- "names": ["APDU_RESPONSE_STATUS_CODE_LENGTH"]
4
+ "sourcesContent": ["export const APDU_RESPONSE_STATUS_CODE_LENGTH = 2;\nexport const PINGER_TIMEOUT = 800;\n"],
5
+ "mappings": "AAAO,MAAMA,EAAmC,EACnCC,EAAiB",
6
+ "names": ["APDU_RESPONSE_STATUS_CODE_LENGTH", "PINGER_TIMEOUT"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ContainerModule as a}from"inversify";import{DisableDeviceSessionRefresherUseCase as p}from"../../../api/device-session/use-case/DisableDeviceSessionRefresher";import{DefaultApduReceiverService as u}from"../../device-session/service/DefaultApduReceiverService";import{DefaultApduSenderService as v}from"../../device-session/service/DefaultApduSenderService";import{DefaultDeviceSessionService as m}from"../../device-session/service/DefaultDeviceSessionService";import{CloseSessionsUseCase as g}from"../../device-session/use-case/CloseSessionsUseCase";import{GetDeviceSessionStateUseCase as f}from"../../device-session/use-case/GetDeviceSessionStateUseCase";import{loggerTypes as c}from"../../logger-publisher/di/loggerTypes";import{StubUseCase as n}from"../../../../src/di.stub";import{deviceSessionTypes as e}from"./deviceSessionTypes";const w=({stub:S}={stub:!1})=>new a((r,l,d,i,A,y,D)=>{r(e.ApduSenderServiceFactory).toFactory(o=>{const t=o.container.get(c.LoggerPublisherServiceFactory);return s=>new v(s,t)}),r(e.ApduReceiverServiceFactory).toFactory(o=>{const t=o.container.get(c.LoggerPublisherServiceFactory);return(s={})=>new u(s,t)}),r(e.DeviceSessionService).to(m).inSingletonScope(),r(e.GetDeviceSessionStateUseCase).to(f),r(e.CloseSessionsUseCase).to(g),r(e.DisableDeviceSessionRefresherUseCase).to(p),S&&(i(e.GetDeviceSessionStateUseCase).to(n),i(e.DisableDeviceSessionRefresherUseCase).to(n))});export{w as deviceSessionModuleFactory};
1
+ import{ContainerModule as n}from"inversify";import{DisableDeviceSessionRefresherUseCase as a}from"../../../api/device-session/use-case/DisableDeviceSessionRefresher";import{DefaultApduReceiverService as u}from"../../device-session/service/DefaultApduReceiverService";import{DefaultApduSenderService as v}from"../../device-session/service/DefaultApduSenderService";import{DefaultDeviceSessionService as m}from"../../device-session/service/DefaultDeviceSessionService";import{CloseSessionsUseCase as g}from"../../device-session/use-case/CloseSessionsUseCase";import{GetDeviceSessionStateUseCase as l}from"../../device-session/use-case/GetDeviceSessionStateUseCase";import{loggerTypes as c}from"../../logger-publisher/di/loggerTypes";import{StubUseCase as S}from"../../../../src/di.stub";import{deviceSessionTypes as e}from"./deviceSessionTypes";const b=({stub:p}={stub:!1})=>new n(({bind:r,rebindSync:i})=>{r(e.ApduSenderServiceFactory).toFactory(o=>{const s=o.get(c.LoggerPublisherServiceFactory);return t=>new v(t,s)}),r(e.ApduReceiverServiceFactory).toFactory(o=>{const s=o.get(c.LoggerPublisherServiceFactory);return(t={})=>new u(t,s)}),r(e.DeviceSessionService).to(m).inSingletonScope(),r(e.GetDeviceSessionStateUseCase).to(l),r(e.CloseSessionsUseCase).to(g),r(e.DisableDeviceSessionRefresherUseCase).to(a),p&&(i(e.GetDeviceSessionStateUseCase).to(S),i(e.DisableDeviceSessionRefresherUseCase).to(S))});export{b as deviceSessionModuleFactory};
2
2
  //# sourceMappingURL=deviceSessionModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/di/deviceSessionModule.ts"],
4
- "sourcesContent": ["import { ContainerModule, type interfaces } from \"inversify\";\n\nimport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduReceiverConstructorArgs } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduSenderService } from \"@api/device-session/service/ApduSenderService\";\nimport { type ApduSenderServiceConstructorArgs } from \"@api/device-session/service/ApduSenderService\";\nimport { DisableDeviceSessionRefresherUseCase } from \"@api/device-session/use-case/DisableDeviceSessionRefresher\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DefaultApduReceiverService } from \"@internal/device-session/service/DefaultApduReceiverService\";\nimport { DefaultApduSenderService } from \"@internal/device-session/service/DefaultApduSenderService\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { CloseSessionsUseCase } from \"@internal/device-session/use-case/CloseSessionsUseCase\";\nimport { GetDeviceSessionStateUseCase } from \"@internal/device-session/use-case/GetDeviceSessionStateUseCase\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { deviceSessionTypes } from \"./deviceSessionTypes\";\n\nexport type DeviceSessionModuleArgs = Partial<{\n stub: boolean;\n}>;\n\nexport const deviceSessionModuleFactory = (\n { stub }: DeviceSessionModuleArgs = { stub: false },\n) =>\n new ContainerModule(\n (\n bind,\n _unbind,\n _isBound,\n rebind,\n _unbindAsync,\n _onActivation,\n _onDeactivation,\n ) => {\n bind<interfaces.Factory<ApduSenderService>>(\n deviceSessionTypes.ApduSenderServiceFactory,\n ).toFactory((context) => {\n const logger = context.container.get<\n (name: string) => LoggerPublisherService\n >(loggerTypes.LoggerPublisherServiceFactory);\n\n return (args: ApduSenderServiceConstructorArgs) => {\n return new DefaultApduSenderService(args, logger);\n };\n });\n\n bind<interfaces.Factory<ApduReceiverService>>(\n deviceSessionTypes.ApduReceiverServiceFactory,\n ).toFactory((context) => {\n const logger = context.container.get<\n (name: string) => LoggerPublisherService\n >(loggerTypes.LoggerPublisherServiceFactory);\n\n return (args: ApduReceiverConstructorArgs = {}) => {\n return new DefaultApduReceiverService(args, logger);\n };\n });\n\n bind(deviceSessionTypes.DeviceSessionService)\n .to(DefaultDeviceSessionService)\n .inSingletonScope();\n\n bind(deviceSessionTypes.GetDeviceSessionStateUseCase).to(\n GetDeviceSessionStateUseCase,\n );\n bind(deviceSessionTypes.CloseSessionsUseCase).to(CloseSessionsUseCase);\n bind(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n DisableDeviceSessionRefresherUseCase,\n );\n\n if (stub) {\n rebind(deviceSessionTypes.GetDeviceSessionStateUseCase).to(StubUseCase);\n rebind(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n StubUseCase,\n );\n }\n },\n );\n"],
5
- "mappings": "AAAA,OAAS,mBAAAA,MAAwC,YAMjD,OAAS,wCAAAC,MAA4C,6DAErD,OAAS,8BAAAC,MAAkC,8DAC3C,OAAS,4BAAAC,MAAgC,4DACzC,OAAS,+BAAAC,MAAmC,+DAC5C,OAAS,wBAAAC,MAA4B,yDACrC,OAAS,gCAAAC,MAAoC,iEAC7C,OAAS,eAAAC,MAAmB,4CAC5B,OAAS,eAAAC,MAAmB,oBAE5B,OAAS,sBAAAC,MAA0B,uBAM5B,MAAMC,EAA6B,CACxC,CAAE,KAAAC,CAAK,EAA6B,CAAE,KAAM,EAAM,IAElD,IAAIX,EACF,CACEY,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,IACG,CACHN,EACEH,EAAmB,wBACrB,EAAE,UAAWU,GAAY,CACvB,MAAMC,EAASD,EAAQ,UAAU,IAE/BZ,EAAY,6BAA6B,EAE3C,OAAQc,GACC,IAAIlB,EAAyBkB,EAAMD,CAAM,CAEpD,CAAC,EAEDR,EACEH,EAAmB,0BACrB,EAAE,UAAWU,GAAY,CACvB,MAAMC,EAASD,EAAQ,UAAU,IAE/BZ,EAAY,6BAA6B,EAE3C,MAAO,CAACc,EAAoC,CAAC,IACpC,IAAInB,EAA2BmB,EAAMD,CAAM,CAEtD,CAAC,EAEDR,EAAKH,EAAmB,oBAAoB,EACzC,GAAGL,CAA2B,EAC9B,iBAAiB,EAEpBQ,EAAKH,EAAmB,4BAA4B,EAAE,GACpDH,CACF,EACAM,EAAKH,EAAmB,oBAAoB,EAAE,GAAGJ,CAAoB,EACrEO,EAAKH,EAAmB,oCAAoC,EAAE,GAC5DR,CACF,EAEIU,IACFI,EAAON,EAAmB,4BAA4B,EAAE,GAAGD,CAAW,EACtEO,EAAON,EAAmB,oCAAoC,EAAE,GAC9DD,CACF,EAEJ,CACF",
6
- "names": ["ContainerModule", "DisableDeviceSessionRefresherUseCase", "DefaultApduReceiverService", "DefaultApduSenderService", "DefaultDeviceSessionService", "CloseSessionsUseCase", "GetDeviceSessionStateUseCase", "loggerTypes", "StubUseCase", "deviceSessionTypes", "deviceSessionModuleFactory", "stub", "bind", "_unbind", "_isBound", "rebind", "_unbindAsync", "_onActivation", "_onDeactivation", "context", "logger", "args"]
4
+ "sourcesContent": ["import { ContainerModule, type Factory } from \"inversify\";\n\nimport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduReceiverConstructorArgs } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduSenderService } from \"@api/device-session/service/ApduSenderService\";\nimport { type ApduSenderServiceConstructorArgs } from \"@api/device-session/service/ApduSenderService\";\nimport { DisableDeviceSessionRefresherUseCase } from \"@api/device-session/use-case/DisableDeviceSessionRefresher\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DefaultApduReceiverService } from \"@internal/device-session/service/DefaultApduReceiverService\";\nimport { DefaultApduSenderService } from \"@internal/device-session/service/DefaultApduSenderService\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { CloseSessionsUseCase } from \"@internal/device-session/use-case/CloseSessionsUseCase\";\nimport { GetDeviceSessionStateUseCase } from \"@internal/device-session/use-case/GetDeviceSessionStateUseCase\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { deviceSessionTypes } from \"./deviceSessionTypes\";\n\nexport type DeviceSessionModuleArgs = Partial<{\n stub: boolean;\n}>;\n\nexport const deviceSessionModuleFactory = (\n { stub }: DeviceSessionModuleArgs = { stub: false },\n) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind<Factory<ApduSenderService>>(\n deviceSessionTypes.ApduSenderServiceFactory,\n ).toFactory((context) => {\n const logger = context.get<(name: string) => LoggerPublisherService>(\n loggerTypes.LoggerPublisherServiceFactory,\n );\n\n return (args: ApduSenderServiceConstructorArgs) => {\n return new DefaultApduSenderService(args, logger);\n };\n });\n\n bind<Factory<ApduReceiverService>>(\n deviceSessionTypes.ApduReceiverServiceFactory,\n ).toFactory((context) => {\n const logger = context.get<(name: string) => LoggerPublisherService>(\n loggerTypes.LoggerPublisherServiceFactory,\n );\n\n return (args: ApduReceiverConstructorArgs = {}) => {\n return new DefaultApduReceiverService(args, logger);\n };\n });\n\n bind(deviceSessionTypes.DeviceSessionService)\n .to(DefaultDeviceSessionService)\n .inSingletonScope();\n\n bind(deviceSessionTypes.GetDeviceSessionStateUseCase).to(\n GetDeviceSessionStateUseCase,\n );\n bind(deviceSessionTypes.CloseSessionsUseCase).to(CloseSessionsUseCase);\n bind(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n DisableDeviceSessionRefresherUseCase,\n );\n\n if (stub) {\n rebindSync(deviceSessionTypes.GetDeviceSessionStateUseCase).to(\n StubUseCase,\n );\n rebindSync(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n StubUseCase,\n );\n }\n });\n"],
5
+ "mappings": "AAAA,OAAS,mBAAAA,MAAqC,YAM9C,OAAS,wCAAAC,MAA4C,6DAErD,OAAS,8BAAAC,MAAkC,8DAC3C,OAAS,4BAAAC,MAAgC,4DACzC,OAAS,+BAAAC,MAAmC,+DAC5C,OAAS,wBAAAC,MAA4B,yDACrC,OAAS,gCAAAC,MAAoC,iEAC7C,OAAS,eAAAC,MAAmB,4CAC5B,OAAS,eAAAC,MAAmB,oBAE5B,OAAS,sBAAAC,MAA0B,uBAM5B,MAAMC,EAA6B,CACxC,CAAE,KAAAC,CAAK,EAA6B,CAAE,KAAM,EAAM,IAElD,IAAIX,EAAgB,CAAC,CAAE,KAAAY,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EACEH,EAAmB,wBACrB,EAAE,UAAWK,GAAY,CACvB,MAAMC,EAASD,EAAQ,IACrBP,EAAY,6BACd,EAEA,OAAQS,GACC,IAAIb,EAAyBa,EAAMD,CAAM,CAEpD,CAAC,EAEDH,EACEH,EAAmB,0BACrB,EAAE,UAAWK,GAAY,CACvB,MAAMC,EAASD,EAAQ,IACrBP,EAAY,6BACd,EAEA,MAAO,CAACS,EAAoC,CAAC,IACpC,IAAId,EAA2Bc,EAAMD,CAAM,CAEtD,CAAC,EAEDH,EAAKH,EAAmB,oBAAoB,EACzC,GAAGL,CAA2B,EAC9B,iBAAiB,EAEpBQ,EAAKH,EAAmB,4BAA4B,EAAE,GACpDH,CACF,EACAM,EAAKH,EAAmB,oBAAoB,EAAE,GAAGJ,CAAoB,EACrEO,EAAKH,EAAmB,oCAAoC,EAAE,GAC5DR,CACF,EAEIU,IACFE,EAAWJ,EAAmB,4BAA4B,EAAE,GAC1DD,CACF,EACAK,EAAWJ,EAAmB,oCAAoC,EAAE,GAClED,CACF,EAEJ,CAAC",
6
+ "names": ["ContainerModule", "DisableDeviceSessionRefresherUseCase", "DefaultApduReceiverService", "DefaultApduSenderService", "DefaultDeviceSessionService", "CloseSessionsUseCase", "GetDeviceSessionStateUseCase", "loggerTypes", "StubUseCase", "deviceSessionTypes", "deviceSessionModuleFactory", "stub", "bind", "rebindSync", "context", "logger", "args"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Container as t}from"inversify";import{deviceSessionModuleFactory as i}from"./deviceSessionModule";describe("deviceSessionModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=i(),o=new t,o.load(e)}),it("should return the config module",()=>{expect(e).toBeDefined()})})});
1
+ import{Container as t}from"inversify";import{deviceSessionModuleFactory as i}from"./deviceSessionModule";describe("deviceSessionModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=i(),o=new t,o.loadSync(e)}),it("should return the config module",()=>{expect(e).toBeDefined()})})});
2
2
  //# sourceMappingURL=deviceSessionModule.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/di/deviceSessionModule.test.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { deviceSessionModuleFactory } from \"./deviceSessionModule\";\n\ndescribe(\"deviceSessionModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceSessionModuleFactory>;\n beforeEach(() => {\n mod = deviceSessionModuleFactory();\n container = new Container();\n container.load(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n });\n});\n"],
5
- "mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,8BAAAC,MAAkC,wBAE3C,SAAS,6BAA8B,IAAM,CAC3C,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,EAAMF,EAA2B,EACjCC,EAAY,IAAIF,EAChBE,EAAU,KAAKC,CAAG,CACpB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { deviceSessionModuleFactory } from \"./deviceSessionModule\";\n\ndescribe(\"deviceSessionModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceSessionModuleFactory>;\n beforeEach(() => {\n mod = deviceSessionModuleFactory();\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,8BAAAC,MAAkC,wBAE3C,SAAS,6BAA8B,IAAM,CAC3C,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,EAAMF,EAA2B,EACjCC,EAAY,IAAIF,EAChBE,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["Container", "deviceSessionModuleFactory", "container", "mod"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceModelId as a}from"../../../api/device/DeviceModel";import{GetAppAndVersionCommand as r,GetOsVersionCommand as c}from"../../../api/index";import{DEVICE_SESSION_REFRESHER_POLLING_INTERVAL as p}from"../../device-session/data/DeviceSessionRefresherConst";import{SessionEvents as i}from"../../device-session/model/DeviceSessionEventDispatcher";class l{constructor(e,t,o,n){this.connectedDevice=t;this._sessionEventDispatcher=o;this._sendCommandFunction=n,this._logger=e("device-pinger"),this._subscription=this._sessionEventDispatcher.listen().subscribe(async s=>await this.mapEventAction(s))}_sendCommandFunction;_subscription;_logger;async ping(){try{return await this.mapDevicePingAction(this.connectedDevice.deviceModel.id)}catch(e){throw this._logger.error("Error while pinging device",{data:{error:e}}),e}}mapEventAction=async e=>{switch(e.eventName){case i.REFRESH_NEEDED:return await this.ping();default:return null}};async mapDevicePingAction(e){switch(e){case a.NANO_S:{const t=(async()=>{const s=await this._sendCommandFunction(new r);return this._sendCommandFunction(new c),s})(),o=new Promise(s=>{setTimeout(()=>s(null),p*2+100)}),n=await Promise.race([t,o]);return n?this._sessionEventDispatcher.dispatch({eventName:i.COMMAND_SUCCEEDED,eventData:n}):this._sessionEventDispatcher.dispatch({eventName:i.DEVICE_STATE_UPDATE_LOCKED}),n}default:{const t=await this._sendCommandFunction(new r);return this._sessionEventDispatcher.dispatch({eventName:i.COMMAND_SUCCEEDED,eventData:t}),t}}}unsubscribe(){this._subscription.unsubscribe()}}export{l as DevicePinger};
1
+ import{DeviceModelId as c}from"../../../api/device/DeviceModel";import{GetAppAndVersionCommand as a,GetOsVersionCommand as m}from"../../../api/index";import{PINGER_TIMEOUT as o}from"../../device-session/data/ApduResponseConst";import{DEVICE_SESSION_REFRESHER_POLLING_INTERVAL as p}from"../../device-session/data/DeviceSessionRefresherConst";import{SessionEvents as i}from"../../device-session/model/DeviceSessionEventDispatcher";class D{constructor(e,t,r,n){this.connectedDevice=t;this._sessionEventDispatcher=r;this._sendCommandFunction=n,this._logger=e("device-pinger"),this._subscription=this._sessionEventDispatcher.listen().subscribe(async s=>await this.mapEventAction(s))}_sendCommandFunction;_subscription;_logger;async ping(){try{return await this.mapDevicePingAction(this.connectedDevice.deviceModel.id)}catch(e){throw this._logger.error("Error while pinging device",{data:{error:e}}),e}}mapEventAction=async e=>{switch(e.eventName){case i.REFRESH_NEEDED:return await this.ping();default:return null}};async mapDevicePingAction(e){switch(e){case c.NANO_S:{const t=async()=>{const s=await this._sendCommandFunction(new a,o);return this._sendCommandFunction(new m,o),s},r=new Promise(s=>{setTimeout(()=>s(null),p*2+100)}),n=await Promise.race([t(),r]);return n?this._sessionEventDispatcher.dispatch({eventName:i.COMMAND_SUCCEEDED,eventData:n}):this._sessionEventDispatcher.dispatch({eventName:i.DEVICE_STATE_UPDATE_LOCKED}),n}default:{const t=await this._sendCommandFunction(new a,o);return this._sessionEventDispatcher.dispatch({eventName:i.COMMAND_SUCCEEDED,eventData:t}),t}}}unsubscribe(){this._subscription.unsubscribe()}}export{D as DevicePinger};
2
2
  //# sourceMappingURL=DevicePinger.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/model/DevicePinger.ts"],
4
- "sourcesContent": ["import { type Subscription } from \"rxjs\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n GetOsVersionCommand,\n type TransportConnectedDevice,\n} from \"@api/index\";\nimport {\n type Command,\n type CommandResult,\n type LoggerPublisherService,\n} from \"@api/types\";\nimport { DEVICE_SESSION_REFRESHER_POLLING_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport {\n type DeviceSessionEventDispatcher,\n type NewEvent,\n SessionEvents,\n} from \"@internal/device-session/model/DeviceSessionEventDispatcher\";\n\ntype SendCommandFunction = <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n\nexport class DevicePinger {\n private readonly _sendCommandFunction: SendCommandFunction;\n private _subscription: Subscription;\n private _logger: LoggerPublisherService;\n\n constructor(\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n private connectedDevice: TransportConnectedDevice,\n private _sessionEventDispatcher: DeviceSessionEventDispatcher,\n sendCommandFunction: SendCommandFunction,\n ) {\n this._sendCommandFunction = sendCommandFunction;\n this._logger = loggerModuleFactory(\"device-pinger\");\n this._subscription = this._sessionEventDispatcher\n .listen()\n .subscribe(async (event) => await this.mapEventAction(event));\n }\n\n public async ping(): Promise<CommandResult<GetAppAndVersionResponse> | null> {\n try {\n const result = await this.mapDevicePingAction(\n this.connectedDevice.deviceModel.id,\n );\n return result;\n } catch (error) {\n this._logger.error(\"Error while pinging device\", {\n data: {\n error,\n },\n });\n throw error;\n }\n }\n\n private mapEventAction = async (event: NewEvent) => {\n switch (event.eventName) {\n case SessionEvents.REFRESH_NEEDED:\n return await this.ping();\n default:\n return null;\n }\n };\n\n private async mapDevicePingAction(deviceModelId: DeviceModelId) {\n switch (deviceModelId) {\n case DeviceModelId.NANO_S: {\n const chainPromise: Promise<CommandResult<GetAppAndVersionResponse>> =\n (async () => {\n const appVersionResult = await this._sendCommandFunction(\n new GetAppAndVersionCommand(),\n );\n\n this._sendCommandFunction(new GetOsVersionCommand());\n return appVersionResult;\n })();\n\n const timeoutPromise: Promise<null> = new Promise((resolve) => {\n setTimeout(\n () => resolve(null),\n DEVICE_SESSION_REFRESHER_POLLING_INTERVAL * 2 + 100,\n );\n });\n\n const resultOrTimeout: CommandResult<GetAppAndVersionResponse> | null =\n await Promise.race([chainPromise, timeoutPromise]);\n\n if (!resultOrTimeout) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.COMMAND_SUCCEEDED,\n eventData: resultOrTimeout,\n });\n }\n return resultOrTimeout;\n }\n default: {\n const result = await this._sendCommandFunction(\n new GetAppAndVersionCommand(),\n );\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.COMMAND_SUCCEEDED,\n eventData: result,\n });\n return result;\n }\n }\n }\n\n public unsubscribe(): void {\n this._subscription.unsubscribe();\n }\n}\n"],
5
- "mappings": "AAEA,OAAS,iBAAAA,MAAqB,0BAC9B,OACE,2BAAAC,EAEA,uBAAAC,MAEK,aAMP,OAAS,6CAAAC,MAAiD,4DAC1D,OAGE,iBAAAC,MACK,8DAMA,MAAMC,CAAa,CAKxB,YACEC,EACQC,EACAC,EACRC,EACA,CAHQ,qBAAAF,EACA,6BAAAC,EAGR,KAAK,qBAAuBC,EAC5B,KAAK,QAAUH,EAAoB,eAAe,EAClD,KAAK,cAAgB,KAAK,wBACvB,OAAO,EACP,UAAU,MAAOI,GAAU,MAAM,KAAK,eAAeA,CAAK,CAAC,CAChE,CAfiB,qBACT,cACA,QAeR,MAAa,MAAgE,CAC3E,GAAI,CAIF,OAHe,MAAM,KAAK,oBACxB,KAAK,gBAAgB,YAAY,EACnC,CAEF,OAASC,EAAO,CACd,WAAK,QAAQ,MAAM,6BAA8B,CAC/C,KAAM,CACJ,MAAAA,CACF,CACF,CAAC,EACKA,CACR,CACF,CAEQ,eAAiB,MAAOD,GAAoB,CAClD,OAAQA,EAAM,UAAW,CACvB,KAAKN,EAAc,eACjB,OAAO,MAAM,KAAK,KAAK,EACzB,QACE,OAAO,IACX,CACF,EAEA,MAAc,oBAAoBQ,EAA8B,CAC9D,OAAQA,EAAe,CACrB,KAAKZ,EAAc,OAAQ,CACzB,MAAMa,GACH,SAAY,CACX,MAAMC,EAAmB,MAAM,KAAK,qBAClC,IAAIb,CACN,EAEA,YAAK,qBAAqB,IAAIC,CAAqB,EAC5CY,CACT,GAAG,EAECC,EAAgC,IAAI,QAASC,GAAY,CAC7D,WACE,IAAMA,EAAQ,IAAI,EAClBb,EAA4C,EAAI,GAClD,CACF,CAAC,EAEKc,EACJ,MAAM,QAAQ,KAAK,CAACJ,EAAcE,CAAc,CAAC,EAEnD,OAAKE,EAKH,KAAK,wBAAwB,SAAS,CACpC,UAAWb,EAAc,kBACzB,UAAWa,CACb,CAAC,EAPD,KAAK,wBAAwB,SAAS,CACpC,UAAWb,EAAc,0BAC3B,CAAC,EAOIa,CACT,CACA,QAAS,CACP,MAAMC,EAAS,MAAM,KAAK,qBACxB,IAAIjB,CACN,EACA,YAAK,wBAAwB,SAAS,CACpC,UAAWG,EAAc,kBACzB,UAAWc,CACb,CAAC,EACMA,CACT,CACF,CACF,CAEO,aAAoB,CACzB,KAAK,cAAc,YAAY,CACjC,CACF",
6
- "names": ["DeviceModelId", "GetAppAndVersionCommand", "GetOsVersionCommand", "DEVICE_SESSION_REFRESHER_POLLING_INTERVAL", "SessionEvents", "DevicePinger", "loggerModuleFactory", "connectedDevice", "_sessionEventDispatcher", "sendCommandFunction", "event", "error", "deviceModelId", "chainPromise", "appVersionResult", "timeoutPromise", "resolve", "resultOrTimeout", "result"]
4
+ "sourcesContent": ["import { type Subscription } from \"rxjs\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n GetOsVersionCommand,\n type TransportConnectedDevice,\n} from \"@api/index\";\nimport {\n type Command,\n type CommandResult,\n type LoggerPublisherService,\n} from \"@api/types\";\nimport { PINGER_TIMEOUT } from \"@internal/device-session/data/ApduResponseConst\";\nimport { DEVICE_SESSION_REFRESHER_POLLING_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport {\n type DeviceSessionEventDispatcher,\n type NewEvent,\n SessionEvents,\n} from \"@internal/device-session/model/DeviceSessionEventDispatcher\";\n\ntype SendCommandFunction = <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n\nexport class DevicePinger {\n private readonly _sendCommandFunction: SendCommandFunction;\n private _subscription: Subscription;\n private _logger: LoggerPublisherService;\n\n constructor(\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n private connectedDevice: TransportConnectedDevice,\n private _sessionEventDispatcher: DeviceSessionEventDispatcher,\n sendCommandFunction: SendCommandFunction,\n ) {\n this._sendCommandFunction = sendCommandFunction;\n this._logger = loggerModuleFactory(\"device-pinger\");\n this._subscription = this._sessionEventDispatcher\n .listen()\n .subscribe(async (event) => await this.mapEventAction(event));\n }\n\n public async ping(): Promise<CommandResult<GetAppAndVersionResponse> | null> {\n try {\n const result = await this.mapDevicePingAction(\n this.connectedDevice.deviceModel.id,\n );\n return result;\n } catch (error) {\n this._logger.error(\"Error while pinging device\", {\n data: {\n error,\n },\n });\n throw error;\n }\n }\n\n private mapEventAction = async (event: NewEvent) => {\n switch (event.eventName) {\n case SessionEvents.REFRESH_NEEDED:\n return await this.ping();\n default:\n return null;\n }\n };\n\n private async mapDevicePingAction(deviceModelId: DeviceModelId) {\n switch (deviceModelId) {\n case DeviceModelId.NANO_S: {\n const chainPromise: () => Promise<\n CommandResult<GetAppAndVersionResponse>\n > = async () => {\n const appVersionResult = await this._sendCommandFunction(\n new GetAppAndVersionCommand(),\n PINGER_TIMEOUT,\n );\n\n this._sendCommandFunction(new GetOsVersionCommand(), PINGER_TIMEOUT);\n return appVersionResult;\n };\n\n const timeoutPromise: Promise<null> = new Promise((resolve) => {\n setTimeout(\n () => resolve(null),\n DEVICE_SESSION_REFRESHER_POLLING_INTERVAL * 2 + 100,\n );\n });\n\n const resultOrTimeout: CommandResult<GetAppAndVersionResponse> | null =\n await Promise.race([chainPromise(), timeoutPromise]);\n\n if (!resultOrTimeout) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.COMMAND_SUCCEEDED,\n eventData: resultOrTimeout,\n });\n }\n return resultOrTimeout;\n }\n default: {\n const result = await this._sendCommandFunction(\n new GetAppAndVersionCommand(),\n PINGER_TIMEOUT,\n );\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.COMMAND_SUCCEEDED,\n eventData: result,\n });\n return result;\n }\n }\n }\n\n public unsubscribe(): void {\n this._subscription.unsubscribe();\n }\n}\n"],
5
+ "mappings": "AAEA,OAAS,iBAAAA,MAAqB,0BAC9B,OACE,2BAAAC,EAEA,uBAAAC,MAEK,aAMP,OAAS,kBAAAC,MAAsB,kDAC/B,OAAS,6CAAAC,MAAiD,4DAC1D,OAGE,iBAAAC,MACK,8DAOA,MAAMC,CAAa,CAKxB,YACEC,EACQC,EACAC,EACRC,EACA,CAHQ,qBAAAF,EACA,6BAAAC,EAGR,KAAK,qBAAuBC,EAC5B,KAAK,QAAUH,EAAoB,eAAe,EAClD,KAAK,cAAgB,KAAK,wBACvB,OAAO,EACP,UAAU,MAAOI,GAAU,MAAM,KAAK,eAAeA,CAAK,CAAC,CAChE,CAfiB,qBACT,cACA,QAeR,MAAa,MAAgE,CAC3E,GAAI,CAIF,OAHe,MAAM,KAAK,oBACxB,KAAK,gBAAgB,YAAY,EACnC,CAEF,OAASC,EAAO,CACd,WAAK,QAAQ,MAAM,6BAA8B,CAC/C,KAAM,CACJ,MAAAA,CACF,CACF,CAAC,EACKA,CACR,CACF,CAEQ,eAAiB,MAAOD,GAAoB,CAClD,OAAQA,EAAM,UAAW,CACvB,KAAKN,EAAc,eACjB,OAAO,MAAM,KAAK,KAAK,EACzB,QACE,OAAO,IACX,CACF,EAEA,MAAc,oBAAoBQ,EAA8B,CAC9D,OAAQA,EAAe,CACrB,KAAKb,EAAc,OAAQ,CACzB,MAAMc,EAEF,SAAY,CACd,MAAMC,EAAmB,MAAM,KAAK,qBAClC,IAAId,EACJE,CACF,EAEA,YAAK,qBAAqB,IAAID,EAAuBC,CAAc,EAC5DY,CACT,EAEMC,EAAgC,IAAI,QAASC,GAAY,CAC7D,WACE,IAAMA,EAAQ,IAAI,EAClBb,EAA4C,EAAI,GAClD,CACF,CAAC,EAEKc,EACJ,MAAM,QAAQ,KAAK,CAACJ,EAAa,EAAGE,CAAc,CAAC,EAErD,OAAKE,EAKH,KAAK,wBAAwB,SAAS,CACpC,UAAWb,EAAc,kBACzB,UAAWa,CACb,CAAC,EAPD,KAAK,wBAAwB,SAAS,CACpC,UAAWb,EAAc,0BAC3B,CAAC,EAOIa,CACT,CACA,QAAS,CACP,MAAMC,EAAS,MAAM,KAAK,qBACxB,IAAIlB,EACJE,CACF,EACA,YAAK,wBAAwB,SAAS,CACpC,UAAWE,EAAc,kBACzB,UAAWc,CACb,CAAC,EACMA,CACT,CACF,CACF,CAEO,aAAoB,CACzB,KAAK,cAAc,YAAY,CACjC,CACF",
6
+ "names": ["DeviceModelId", "GetAppAndVersionCommand", "GetOsVersionCommand", "PINGER_TIMEOUT", "DEVICE_SESSION_REFRESHER_POLLING_INTERVAL", "SessionEvents", "DevicePinger", "loggerModuleFactory", "connectedDevice", "_sessionEventDispatcher", "sendCommandFunction", "event", "error", "deviceModelId", "chainPromise", "appVersionResult", "timeoutPromise", "resolve", "resultOrTimeout", "result"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{BehaviorSubject as p}from"rxjs";import{v4 as v}from"uuid";import{CommandUtils as d}from"../../../api/command/utils/CommandUtils";import{DeviceStatus as c}from"../../../api/device/DeviceStatus";import{DeviceSessionStateType as h}from"../../../api/device-session/DeviceSessionState";import{DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS as S}from"../../device-session/data/DeviceSessionRefresherConst";import{MutexService as m}from"../../device-session/service/MutexService";import{RefresherService as u}from"../../device-session/service/RefresherService";import{DevicePinger as D}from"./DevicePinger";import{DeviceSessionEventDispatcher as l,SessionEvents as r}from"./DeviceSessionEventDispatcher";import{DeviceSessionRefresher as _}from"./DeviceSessionRefresher";import{DeviceSessionStateHandler as f}from"./DeviceSessionStateHandler";class x{_id;_connectedDevice;_deviceState;_managerApiService;_secureChannelService;_logger;_refresherOptions;_pinger;_deviceSessionRefresher;_refresherService;_commandMutex=new m;_sessionEventDispatcher=new l;constructor({connectedDevice:e,id:s=v()},t,i,n,a){this._id=s,this._connectedDevice=e,this._logger=t("device-session"),this._managerApiService=i,this._secureChannelService=n,this._refresherOptions={...S,...a},this._deviceState=new p({sessionStateType:h.Connected,deviceStatus:c.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id}),this._pinger=new D(t,e,this._sessionEventDispatcher,o=>this.sendCommand(o)),this._deviceSessionRefresher=new _(t,this._refresherOptions,this._sessionEventDispatcher,this._connectedDevice),new f(t,this._sessionEventDispatcher,this._connectedDevice,this._deviceState,o=>this.setDeviceSessionState(o)),this._refresherService=new u(t,{start:()=>this._deviceSessionRefresher.restartRefresher(),stop:()=>this._deviceSessionRefresher.stopRefresher()})}async initialiseSession(){try{await this._pinger.ping()}catch(e){throw this._logger.error("Error while initialising session",{data:{error:e}}),e}finally{this._refresherOptions.isRefresherDisabled||this._deviceSessionRefresher.startRefresher()}}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}setDeviceSessionState(e){this._deviceState.next(e)}async sendApdu(e,s={isPolling:!1,triggersDisconnection:!1}){const t=await this._commandMutex.lock();try{this._sessionEventDispatcher.dispatch({eventName:r.DEVICE_STATE_UPDATE_BUSY});const i=await this._connectedDevice.sendApdu(e,s.triggersDisconnection);return i.ifRight(n=>{d.isLockedDeviceResponse(n)?this._sessionEventDispatcher.dispatch({eventName:r.DEVICE_STATE_UPDATE_LOCKED}):this._sessionEventDispatcher.dispatch({eventName:r.DEVICE_STATE_UPDATE_CONNECTED})}).ifLeft(()=>{this._sessionEventDispatcher.dispatch({eventName:r.DEVICE_STATE_UPDATE_CONNECTED})}),i}finally{t()}}async sendCommand(e){const s=e.getApdu();return(await this.sendApdu(s.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1})).caseOf({Left:i=>{throw i},Right:i=>e.parseResponse(i,this._connectedDevice.deviceModel.id)})}executeDeviceAction(e){const{observable:s,cancel:t}=e._execute({sendApdu:async i=>this.sendApdu(i),sendCommand:async i=>this.sendCommand(i),getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:i=>(this.setDeviceSessionState(i),this._deviceState.getValue()),disableRefresher:i=>this._refresherService.disableRefresher(i),getManagerApiService:()=>this._managerApiService,getSecureChannelService:()=>this._secureChannelService});return{observable:s,cancel:t}}close(){this._updateDeviceStatus(c.NOT_CONNECTED),this._deviceState.complete(),this._deviceSessionRefresher.stopRefresher()}disableRefresher(e){return this._refresherService.disableRefresher(e)}_updateDeviceStatus(e){const s=this._deviceState.getValue();this._deviceState.next({...s,deviceStatus:e})}}export{x as DeviceSession};
1
+ import{BehaviorSubject as v}from"rxjs";import{v4 as d}from"uuid";import{CommandUtils as h}from"../../../api/command/utils/CommandUtils";import{DeviceStatus as c}from"../../../api/device/DeviceStatus";import{DeviceSessionStateType as S}from"../../../api/device-session/DeviceSessionState";import{DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS as u}from"../../device-session/data/DeviceSessionRefresherConst";import{MutexService as m}from"../../device-session/service/MutexService";import{RefresherService as D}from"../../device-session/service/RefresherService";import{DevicePinger as l}from"./DevicePinger";import{DeviceSessionEventDispatcher as _,SessionEvents as n}from"./DeviceSessionEventDispatcher";import{DeviceSessionRefresher as f}from"./DeviceSessionRefresher";import{DeviceSessionStateHandler as g}from"./DeviceSessionStateHandler";class V{_id;_connectedDevice;_deviceState;_managerApiService;_secureChannelService;_logger;_refresherOptions;_pinger;_deviceSessionRefresher;_refresherService;_commandMutex=new m;_sessionEventDispatcher=new _;constructor({connectedDevice:e,id:s=d()},t,i,r,a){this._id=s,this._connectedDevice=e,this._logger=t("device-session"),this._managerApiService=i,this._secureChannelService=r,this._refresherOptions={...u,...a},this._deviceState=new v({sessionStateType:S.Connected,deviceStatus:c.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id}),this._pinger=new l(t,e,this._sessionEventDispatcher,(o,p)=>this.sendCommand(o,p)),this._deviceSessionRefresher=new f(t,this._refresherOptions,this._sessionEventDispatcher,this._connectedDevice),new g(t,this._sessionEventDispatcher,this._connectedDevice,this._deviceState,o=>this.setDeviceSessionState(o)),this._refresherService=new D(t,{start:()=>this._deviceSessionRefresher.restartRefresher(),stop:()=>this._deviceSessionRefresher.stopRefresher()})}async initialiseSession(){try{await this._pinger.ping()}catch(e){throw this._logger.error("Error while initialising session",{data:{error:e}}),e}finally{this._refresherOptions.isRefresherDisabled||this._deviceSessionRefresher.startRefresher()}}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}getDeviceSessionState(){return this._deviceState.getValue()}setDeviceSessionState(e){this._deviceState.next(e)}async sendApdu(e,s={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){const t=await this._commandMutex.lock();try{this._sessionEventDispatcher.dispatch({eventName:n.DEVICE_STATE_UPDATE_BUSY});const i=await this._connectedDevice.sendApdu(e,s.triggersDisconnection,s.abortTimeout);return i.ifRight(r=>{h.isLockedDeviceResponse(r)?this._sessionEventDispatcher.dispatch({eventName:n.DEVICE_STATE_UPDATE_LOCKED}):this._sessionEventDispatcher.dispatch({eventName:n.DEVICE_STATE_UPDATE_CONNECTED})}).ifLeft(()=>{this._sessionEventDispatcher.dispatch({eventName:n.DEVICE_STATE_UPDATE_CONNECTED})}),i}finally{t()}}async sendCommand(e,s){const t=e.getApdu();return(await this.sendApdu(t.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1,abortTimeout:s})).caseOf({Left:r=>{throw r},Right:r=>e.parseResponse(r,this._connectedDevice.deviceModel.id)})}executeDeviceAction(e){const{observable:s,cancel:t}=e._execute({sendApdu:async i=>this.sendApdu(i),sendCommand:async(i,r)=>this.sendCommand(i,r),getDeviceModel:()=>this._connectedDevice.deviceModel,getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:i=>(this.setDeviceSessionState(i),this._deviceState.getValue()),disableRefresher:i=>this._refresherService.disableRefresher(i),getManagerApiService:()=>this._managerApiService,getSecureChannelService:()=>this._secureChannelService});return{observable:s,cancel:t}}close(){this._updateDeviceStatus(c.NOT_CONNECTED),this._deviceState.complete(),this._deviceSessionRefresher.stopRefresher()}disableRefresher(e){return this._refresherService.disableRefresher(e)}_updateDeviceStatus(e){const s=this._deviceState.getValue();this._deviceState.next({...s,deviceStatus:e})}}export{V as DeviceSession};
2
2
  //# sourceMappingURL=DeviceSession.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/model/DeviceSession.ts"],
4
- "sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { BehaviorSubject, type Observable } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { MutexService } from \"@internal/device-session/service/MutexService\";\nimport { RefresherService } from \"@internal/device-session/service/RefresherService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DevicePinger } from \"./DevicePinger\";\nimport {\n DeviceSessionEventDispatcher,\n SessionEvents,\n} from \"./DeviceSessionEventDispatcher\";\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceSessionStateHandler } from \"./DeviceSessionStateHandler\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\nexport type DeviceSessionRefresherOptions = {\n isRefresherDisabled: boolean;\n pollingInterval?: number;\n};\n\ntype SendApduOptions = {\n isPolling?: boolean;\n triggersDisconnection?: boolean;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _managerApiService: ManagerApiService;\n private readonly _secureChannelService: SecureChannelService;\n private readonly _logger: LoggerPublisherService;\n private readonly _refresherOptions: DeviceSessionRefresherOptions;\n private _pinger: DevicePinger;\n private _deviceSessionRefresher: DeviceSessionRefresher;\n private readonly _refresherService: RefresherService;\n private _commandMutex = new MutexService();\n private _sessionEventDispatcher = new DeviceSessionEventDispatcher();\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n secureChannelService: SecureChannelService,\n deviceSessionRefresherOptions: DeviceSessionRefresherOptions | undefined,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._logger = loggerModuleFactory(\"device-session\");\n this._managerApiService = managerApiService;\n this._secureChannelService = secureChannelService;\n this._refresherOptions = {\n ...DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ...deviceSessionRefresherOptions,\n };\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n });\n\n this._pinger = new DevicePinger(\n loggerModuleFactory,\n connectedDevice,\n this._sessionEventDispatcher,\n (command) => this.sendCommand(command),\n );\n this._deviceSessionRefresher = new DeviceSessionRefresher(\n loggerModuleFactory,\n this._refresherOptions,\n this._sessionEventDispatcher,\n this._connectedDevice,\n );\n new DeviceSessionStateHandler(\n loggerModuleFactory,\n this._sessionEventDispatcher,\n this._connectedDevice,\n this._deviceState,\n (state) => this.setDeviceSessionState(state),\n );\n\n this._refresherService = new RefresherService(loggerModuleFactory, {\n start: () => this._deviceSessionRefresher.restartRefresher(),\n stop: () => this._deviceSessionRefresher.stopRefresher(),\n });\n }\n\n public async initialiseSession(): Promise<void> {\n try {\n await this._pinger.ping();\n } catch (error) {\n this._logger.error(\"Error while initialising session\", {\n data: { error },\n });\n throw error;\n } finally {\n if (!this._refresherOptions.isRefresherDisabled) {\n this._deviceSessionRefresher.startRefresher();\n }\n }\n }\n\n public get id(): DeviceSessionId {\n return this._id;\n }\n\n public get connectedDevice(): TransportConnectedDevice {\n return this._connectedDevice;\n }\n\n public get state(): Observable<DeviceSessionState> {\n return this._deviceState.asObservable();\n }\n\n public setDeviceSessionState(state: DeviceSessionState): void {\n this._deviceState.next(state);\n }\n\n public async sendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions = {\n isPolling: false,\n triggersDisconnection: false,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const release = await this._commandMutex.lock();\n\n try {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_BUSY,\n });\n const result = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n );\n\n result\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n }\n })\n .ifLeft(() => {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n });\n return result;\n } finally {\n release();\n }\n }\n\n public async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const apdu = command.getApdu();\n\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n });\n\n return response.caseOf({\n Left: (err) => {\n throw err;\n },\n Right: (r) =>\n command.parseResponse(r, this._connectedDevice.deviceModel.id),\n });\n }\n\n public executeDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendApdu: async (apdu: Uint8Array) => this.sendApdu(apdu),\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n ) => this.sendCommand(command),\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n disableRefresher: (blockerId: string) =>\n this._refresherService.disableRefresher(blockerId),\n getManagerApiService: () => this._managerApiService,\n getSecureChannelService: () => this._secureChannelService,\n });\n return { observable, cancel };\n }\n\n public close(): void {\n this._updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._deviceSessionRefresher.stopRefresher();\n }\n\n public disableRefresher(id: string): () => void {\n return this._refresherService.disableRefresher(id);\n }\n\n private _updateDeviceStatus(deviceStatus: DeviceStatus): void {\n const state = this._deviceState.getValue();\n this._deviceState.next({ ...state, deviceStatus });\n }\n}\n"],
5
- "mappings": "AACA,OAAS,mBAAAA,MAAwC,OACjD,OAAS,MAAMC,MAAc,OAI7B,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,gBAAAC,MAAoB,2BAO7B,OAEE,0BAAAC,MACK,yCAKP,OAAS,4CAAAC,MAAgD,4DACzD,OAAS,gBAAAC,MAAoB,gDAC7B,OAAS,oBAAAC,MAAwB,oDAIjC,OAAS,gBAAAC,MAAoB,iBAC7B,OACE,gCAAAC,EACA,iBAAAC,MACK,iCACP,OAAS,0BAAAC,MAA8B,2BACvC,OAAS,6BAAAC,MAAiC,8BAoBnC,MAAMC,CAAc,CACR,IACA,iBACA,aACA,mBACA,sBACA,QACA,kBACT,QACA,wBACS,kBACT,cAAgB,IAAIP,EACpB,wBAA0B,IAAIG,EAEtC,YACE,CAAE,gBAAAK,EAAiB,GAAAC,EAAKd,EAAO,CAAE,EACjCe,EACAC,EACAC,EACAC,EACA,CACA,KAAK,IAAMJ,EACX,KAAK,iBAAmBD,EACxB,KAAK,QAAUE,EAAoB,gBAAgB,EACnD,KAAK,mBAAqBC,EAC1B,KAAK,sBAAwBC,EAC7B,KAAK,kBAAoB,CACvB,GAAGb,EACH,GAAGc,CACL,EACA,KAAK,aAAe,IAAInB,EAAoC,CAC1D,iBAAkBI,EAAuB,UACzC,aAAcD,EAAa,UAC3B,cAAe,KAAK,iBAAiB,YAAY,EACnD,CAAC,EAED,KAAK,QAAU,IAAIK,EACjBQ,EACAF,EACA,KAAK,wBACJM,GAAY,KAAK,YAAYA,CAAO,CACvC,EACA,KAAK,wBAA0B,IAAIT,EACjCK,EACA,KAAK,kBACL,KAAK,wBACL,KAAK,gBACP,EACA,IAAIJ,EACFI,EACA,KAAK,wBACL,KAAK,iBACL,KAAK,aACJK,GAAU,KAAK,sBAAsBA,CAAK,CAC7C,EAEA,KAAK,kBAAoB,IAAId,EAAiBS,EAAqB,CACjE,MAAO,IAAM,KAAK,wBAAwB,iBAAiB,EAC3D,KAAM,IAAM,KAAK,wBAAwB,cAAc,CACzD,CAAC,CACH,CAEA,MAAa,mBAAmC,CAC9C,GAAI,CACF,MAAM,KAAK,QAAQ,KAAK,CAC1B,OAASM,EAAO,CACd,WAAK,QAAQ,MAAM,mCAAoC,CACrD,KAAM,CAAE,MAAAA,CAAM,CAChB,CAAC,EACKA,CACR,QAAE,CACK,KAAK,kBAAkB,qBAC1B,KAAK,wBAAwB,eAAe,CAEhD,CACF,CAEA,IAAW,IAAsB,CAC/B,OAAO,KAAK,GACd,CAEA,IAAW,iBAA4C,CACrD,OAAO,KAAK,gBACd,CAEA,IAAW,OAAwC,CACjD,OAAO,KAAK,aAAa,aAAa,CACxC,CAEO,sBAAsBD,EAAiC,CAC5D,KAAK,aAAa,KAAKA,CAAK,CAC9B,CAEA,MAAa,SACXE,EACAC,EAA2B,CACzB,UAAW,GACX,sBAAuB,EACzB,EACyC,CACzC,MAAMC,EAAU,MAAM,KAAK,cAAc,KAAK,EAE9C,GAAI,CACF,KAAK,wBAAwB,SAAS,CACpC,UAAWf,EAAc,wBAC3B,CAAC,EACD,MAAMgB,EAAS,MAAM,KAAK,iBAAiB,SACzCH,EACAC,EAAQ,qBACV,EAEA,OAAAE,EACG,QAASC,GAA2B,CAC/BzB,EAAa,uBAAuByB,CAAQ,EAC9C,KAAK,wBAAwB,SAAS,CACpC,UAAWjB,EAAc,0BAC3B,CAAC,EAED,KAAK,wBAAwB,SAAS,CACpC,UAAWA,EAAc,6BAC3B,CAAC,CAEL,CAAC,EACA,OAAO,IAAM,CACZ,KAAK,wBAAwB,SAAS,CACpC,UAAWA,EAAc,6BAC3B,CAAC,CACH,CAAC,EACIgB,CACT,QAAE,CACAD,EAAQ,CACV,CACF,CAEA,MAAa,YACXL,EACoD,CACpD,MAAMQ,EAAOR,EAAQ,QAAQ,EAO7B,OALiB,MAAM,KAAK,SAASQ,EAAK,WAAW,EAAG,CACtD,UAAW,GACX,sBAAuBR,EAAQ,uBAAyB,EAC1D,CAAC,GAEe,OAAO,CACrB,KAAOS,GAAQ,CACb,MAAMA,CACR,EACA,MAAQC,GACNV,EAAQ,cAAcU,EAAG,KAAK,iBAAiB,YAAY,EAAE,CACjE,CAAC,CACH,CAEO,oBAMLC,EAC6D,CAC7D,KAAM,CAAE,WAAAC,EAAY,OAAAC,CAAO,EAAIF,EAAa,SAAS,CACnD,SAAU,MAAOH,GAAqB,KAAK,SAASA,CAAI,EACxD,YAAa,MACXR,GACG,KAAK,YAAYA,CAAO,EAC7B,sBAAuB,IAAM,KAAK,aAAa,SAAS,EACxD,gCAAiC,IAAM,KAAK,MAC5C,sBAAwBC,IACtB,KAAK,sBAAsBA,CAAK,EACzB,KAAK,aAAa,SAAS,GAEpC,iBAAmBa,GACjB,KAAK,kBAAkB,iBAAiBA,CAAS,EACnD,qBAAsB,IAAM,KAAK,mBACjC,wBAAyB,IAAM,KAAK,qBACtC,CAAC,EACD,MAAO,CAAE,WAAAF,EAAY,OAAAC,CAAO,CAC9B,CAEO,OAAc,CACnB,KAAK,oBAAoB9B,EAAa,aAAa,EACnD,KAAK,aAAa,SAAS,EAC3B,KAAK,wBAAwB,cAAc,CAC7C,CAEO,iBAAiBY,EAAwB,CAC9C,OAAO,KAAK,kBAAkB,iBAAiBA,CAAE,CACnD,CAEQ,oBAAoBoB,EAAkC,CAC5D,MAAMd,EAAQ,KAAK,aAAa,SAAS,EACzC,KAAK,aAAa,KAAK,CAAE,GAAGA,EAAO,aAAAc,CAAa,CAAC,CACnD,CACF",
6
- "names": ["BehaviorSubject", "uuidv4", "CommandUtils", "DeviceStatus", "DeviceSessionStateType", "DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS", "MutexService", "RefresherService", "DevicePinger", "DeviceSessionEventDispatcher", "SessionEvents", "DeviceSessionRefresher", "DeviceSessionStateHandler", "DeviceSession", "connectedDevice", "id", "loggerModuleFactory", "managerApiService", "secureChannelService", "deviceSessionRefresherOptions", "command", "state", "error", "rawApdu", "options", "release", "result", "response", "apdu", "err", "r", "deviceAction", "observable", "cancel", "blockerId", "deviceStatus"]
4
+ "sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { BehaviorSubject, type Observable } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { MutexService } from \"@internal/device-session/service/MutexService\";\nimport { RefresherService } from \"@internal/device-session/service/RefresherService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DevicePinger } from \"./DevicePinger\";\nimport {\n DeviceSessionEventDispatcher,\n SessionEvents,\n} from \"./DeviceSessionEventDispatcher\";\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceSessionStateHandler } from \"./DeviceSessionStateHandler\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\nexport type DeviceSessionRefresherOptions = {\n isRefresherDisabled: boolean;\n pollingInterval?: number;\n};\n\ntype SendApduOptions = {\n isPolling?: boolean;\n triggersDisconnection?: boolean;\n abortTimeout?: number;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _managerApiService: ManagerApiService;\n private readonly _secureChannelService: SecureChannelService;\n private readonly _logger: LoggerPublisherService;\n private readonly _refresherOptions: DeviceSessionRefresherOptions;\n private _pinger: DevicePinger;\n private _deviceSessionRefresher: DeviceSessionRefresher;\n private readonly _refresherService: RefresherService;\n private _commandMutex = new MutexService();\n private _sessionEventDispatcher = new DeviceSessionEventDispatcher();\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n secureChannelService: SecureChannelService,\n deviceSessionRefresherOptions: DeviceSessionRefresherOptions | undefined,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._logger = loggerModuleFactory(\"device-session\");\n this._managerApiService = managerApiService;\n this._secureChannelService = secureChannelService;\n this._refresherOptions = {\n ...DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ...deviceSessionRefresherOptions,\n };\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n });\n\n this._pinger = new DevicePinger(\n loggerModuleFactory,\n connectedDevice,\n this._sessionEventDispatcher,\n (command, abortTimeout) => this.sendCommand(command, abortTimeout),\n );\n this._deviceSessionRefresher = new DeviceSessionRefresher(\n loggerModuleFactory,\n this._refresherOptions,\n this._sessionEventDispatcher,\n this._connectedDevice,\n );\n new DeviceSessionStateHandler(\n loggerModuleFactory,\n this._sessionEventDispatcher,\n this._connectedDevice,\n this._deviceState,\n (state) => this.setDeviceSessionState(state),\n );\n\n this._refresherService = new RefresherService(loggerModuleFactory, {\n start: () => this._deviceSessionRefresher.restartRefresher(),\n stop: () => this._deviceSessionRefresher.stopRefresher(),\n });\n }\n\n public async initialiseSession(): Promise<void> {\n try {\n await this._pinger.ping();\n } catch (error) {\n this._logger.error(\"Error while initialising session\", {\n data: { error },\n });\n throw error;\n } finally {\n if (!this._refresherOptions.isRefresherDisabled) {\n this._deviceSessionRefresher.startRefresher();\n }\n }\n }\n\n public get id(): DeviceSessionId {\n return this._id;\n }\n\n public get connectedDevice(): TransportConnectedDevice {\n return this._connectedDevice;\n }\n\n public get state(): Observable<DeviceSessionState> {\n return this._deviceState.asObservable();\n }\n\n public getDeviceSessionState(): DeviceSessionState {\n return this._deviceState.getValue();\n }\n\n public setDeviceSessionState(state: DeviceSessionState): void {\n this._deviceState.next(state);\n }\n\n public async sendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions = {\n isPolling: false,\n triggersDisconnection: false,\n abortTimeout: undefined,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const release = await this._commandMutex.lock();\n\n try {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_BUSY,\n });\n const result = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n options.abortTimeout,\n );\n\n result\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n }\n })\n .ifLeft(() => {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n });\n return result;\n } finally {\n release();\n }\n }\n\n public async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const apdu = command.getApdu();\n\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n abortTimeout,\n });\n\n return response.caseOf({\n Left: (err) => {\n throw err;\n },\n Right: (r) =>\n command.parseResponse(r, this._connectedDevice.deviceModel.id),\n });\n }\n\n public executeDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendApdu: async (apdu: Uint8Array) => this.sendApdu(apdu),\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n abortTimeout?: number,\n ) => this.sendCommand(command, abortTimeout),\n getDeviceModel: () => this._connectedDevice.deviceModel,\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n disableRefresher: (blockerId: string) =>\n this._refresherService.disableRefresher(blockerId),\n getManagerApiService: () => this._managerApiService,\n getSecureChannelService: () => this._secureChannelService,\n });\n return { observable, cancel };\n }\n\n public close(): void {\n this._updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._deviceSessionRefresher.stopRefresher();\n }\n\n public disableRefresher(id: string): () => void {\n return this._refresherService.disableRefresher(id);\n }\n\n private _updateDeviceStatus(deviceStatus: DeviceStatus): void {\n const state = this._deviceState.getValue();\n this._deviceState.next({ ...state, deviceStatus });\n }\n}\n"],
5
+ "mappings": "AACA,OAAS,mBAAAA,MAAwC,OACjD,OAAS,MAAMC,MAAc,OAI7B,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,gBAAAC,MAAoB,2BAO7B,OAEE,0BAAAC,MACK,yCAKP,OAAS,4CAAAC,MAAgD,4DACzD,OAAS,gBAAAC,MAAoB,gDAC7B,OAAS,oBAAAC,MAAwB,oDAIjC,OAAS,gBAAAC,MAAoB,iBAC7B,OACE,gCAAAC,EACA,iBAAAC,MACK,iCACP,OAAS,0BAAAC,MAA8B,2BACvC,OAAS,6BAAAC,MAAiC,8BAqBnC,MAAMC,CAAc,CACR,IACA,iBACA,aACA,mBACA,sBACA,QACA,kBACT,QACA,wBACS,kBACT,cAAgB,IAAIP,EACpB,wBAA0B,IAAIG,EAEtC,YACE,CAAE,gBAAAK,EAAiB,GAAAC,EAAKd,EAAO,CAAE,EACjCe,EACAC,EACAC,EACAC,EACA,CACA,KAAK,IAAMJ,EACX,KAAK,iBAAmBD,EACxB,KAAK,QAAUE,EAAoB,gBAAgB,EACnD,KAAK,mBAAqBC,EAC1B,KAAK,sBAAwBC,EAC7B,KAAK,kBAAoB,CACvB,GAAGb,EACH,GAAGc,CACL,EACA,KAAK,aAAe,IAAInB,EAAoC,CAC1D,iBAAkBI,EAAuB,UACzC,aAAcD,EAAa,UAC3B,cAAe,KAAK,iBAAiB,YAAY,EACnD,CAAC,EAED,KAAK,QAAU,IAAIK,EACjBQ,EACAF,EACA,KAAK,wBACL,CAACM,EAASC,IAAiB,KAAK,YAAYD,EAASC,CAAY,CACnE,EACA,KAAK,wBAA0B,IAAIV,EACjCK,EACA,KAAK,kBACL,KAAK,wBACL,KAAK,gBACP,EACA,IAAIJ,EACFI,EACA,KAAK,wBACL,KAAK,iBACL,KAAK,aACJM,GAAU,KAAK,sBAAsBA,CAAK,CAC7C,EAEA,KAAK,kBAAoB,IAAIf,EAAiBS,EAAqB,CACjE,MAAO,IAAM,KAAK,wBAAwB,iBAAiB,EAC3D,KAAM,IAAM,KAAK,wBAAwB,cAAc,CACzD,CAAC,CACH,CAEA,MAAa,mBAAmC,CAC9C,GAAI,CACF,MAAM,KAAK,QAAQ,KAAK,CAC1B,OAASO,EAAO,CACd,WAAK,QAAQ,MAAM,mCAAoC,CACrD,KAAM,CAAE,MAAAA,CAAM,CAChB,CAAC,EACKA,CACR,QAAE,CACK,KAAK,kBAAkB,qBAC1B,KAAK,wBAAwB,eAAe,CAEhD,CACF,CAEA,IAAW,IAAsB,CAC/B,OAAO,KAAK,GACd,CAEA,IAAW,iBAA4C,CACrD,OAAO,KAAK,gBACd,CAEA,IAAW,OAAwC,CACjD,OAAO,KAAK,aAAa,aAAa,CACxC,CAEO,uBAA4C,CACjD,OAAO,KAAK,aAAa,SAAS,CACpC,CAEO,sBAAsBD,EAAiC,CAC5D,KAAK,aAAa,KAAKA,CAAK,CAC9B,CAEA,MAAa,SACXE,EACAC,EAA2B,CACzB,UAAW,GACX,sBAAuB,GACvB,aAAc,MAChB,EACyC,CACzC,MAAMC,EAAU,MAAM,KAAK,cAAc,KAAK,EAE9C,GAAI,CACF,KAAK,wBAAwB,SAAS,CACpC,UAAWhB,EAAc,wBAC3B,CAAC,EACD,MAAMiB,EAAS,MAAM,KAAK,iBAAiB,SACzCH,EACAC,EAAQ,sBACRA,EAAQ,YACV,EAEA,OAAAE,EACG,QAASC,GAA2B,CAC/B1B,EAAa,uBAAuB0B,CAAQ,EAC9C,KAAK,wBAAwB,SAAS,CACpC,UAAWlB,EAAc,0BAC3B,CAAC,EAED,KAAK,wBAAwB,SAAS,CACpC,UAAWA,EAAc,6BAC3B,CAAC,CAEL,CAAC,EACA,OAAO,IAAM,CACZ,KAAK,wBAAwB,SAAS,CACpC,UAAWA,EAAc,6BAC3B,CAAC,CACH,CAAC,EACIiB,CACT,QAAE,CACAD,EAAQ,CACV,CACF,CAEA,MAAa,YACXN,EACAC,EACoD,CACpD,MAAMQ,EAAOT,EAAQ,QAAQ,EAQ7B,OANiB,MAAM,KAAK,SAASS,EAAK,WAAW,EAAG,CACtD,UAAW,GACX,sBAAuBT,EAAQ,uBAAyB,GACxD,aAAAC,CACF,CAAC,GAEe,OAAO,CACrB,KAAOS,GAAQ,CACb,MAAMA,CACR,EACA,MAAQ,GACNV,EAAQ,cAAc,EAAG,KAAK,iBAAiB,YAAY,EAAE,CACjE,CAAC,CACH,CAEO,oBAMLW,EAC6D,CAC7D,KAAM,CAAE,WAAAC,EAAY,OAAAC,CAAO,EAAIF,EAAa,SAAS,CACnD,SAAU,MAAOF,GAAqB,KAAK,SAASA,CAAI,EACxD,YAAa,MACXT,EACAC,IACG,KAAK,YAAYD,EAASC,CAAY,EAC3C,eAAgB,IAAM,KAAK,iBAAiB,YAC5C,sBAAuB,IAAM,KAAK,aAAa,SAAS,EACxD,gCAAiC,IAAM,KAAK,MAC5C,sBAAwBC,IACtB,KAAK,sBAAsBA,CAAK,EACzB,KAAK,aAAa,SAAS,GAEpC,iBAAmBY,GACjB,KAAK,kBAAkB,iBAAiBA,CAAS,EACnD,qBAAsB,IAAM,KAAK,mBACjC,wBAAyB,IAAM,KAAK,qBACtC,CAAC,EACD,MAAO,CAAE,WAAAF,EAAY,OAAAC,CAAO,CAC9B,CAEO,OAAc,CACnB,KAAK,oBAAoB9B,EAAa,aAAa,EACnD,KAAK,aAAa,SAAS,EAC3B,KAAK,wBAAwB,cAAc,CAC7C,CAEO,iBAAiBY,EAAwB,CAC9C,OAAO,KAAK,kBAAkB,iBAAiBA,CAAE,CACnD,CAEQ,oBAAoBoB,EAAkC,CAC5D,MAAMb,EAAQ,KAAK,aAAa,SAAS,EACzC,KAAK,aAAa,KAAK,CAAE,GAAGA,EAAO,aAAAa,CAAa,CAAC,CACnD,CACF",
6
+ "names": ["BehaviorSubject", "uuidv4", "CommandUtils", "DeviceStatus", "DeviceSessionStateType", "DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS", "MutexService", "RefresherService", "DevicePinger", "DeviceSessionEventDispatcher", "SessionEvents", "DeviceSessionRefresher", "DeviceSessionStateHandler", "DeviceSession", "connectedDevice", "id", "loggerModuleFactory", "managerApiService", "secureChannelService", "deviceSessionRefresherOptions", "command", "abortTimeout", "state", "error", "rawApdu", "options", "release", "result", "response", "apdu", "err", "deviceAction", "observable", "cancel", "blockerId", "deviceStatus"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceSessionStateType as o,DeviceStatus as t,isSuccessCommandResult as v}from"../../../api/index";import{SessionEvents as i}from"../../device-session/model/DeviceSessionEventDispatcher";class D{constructor(e,s,n,r,a){this._sessionEventDispatcher=s;this._connectedDevice=n;this._deviceState=r;this.setDeviceSessionState=a;this._subscription=this._sessionEventDispatcher.listen().subscribe(c=>this.mapEventAction(c)),this._logger=e("device-session-state-handler")}_subscription;_logger;_updateDeviceState(e){const s=this._parseDeviceStatus(e);if(s){const{sessionStateType:n,deviceStatus:r,currentApp:a}=s;this.setDeviceSessionState({sessionStateType:n,deviceStatus:r,deviceModelId:this._connectedDevice.deviceModel.id,currentApp:a,installedApps:[],isSecureConnectionAllowed:!1})}}mapEventAction=e=>{switch(e.eventName){case i.COMMAND_SUCCEEDED:return this._updateDeviceState(e.eventData);case i.DEVICE_STATE_UPDATE_BUSY:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:t.BUSY});case i.DEVICE_STATE_UPDATE_LOCKED:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:t.LOCKED});case i.DEVICE_STATE_UPDATE_CONNECTED:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:t.CONNECTED});default:return null}};_parseDeviceStatus(e){return v(e)?{sessionStateType:o.ReadyWithoutSecureChannel,deviceStatus:t.CONNECTED,currentApp:{name:e.data.name,version:e.data.version}}:(this._logger.error("Error while parsing APDU response",{data:{parsedResponse:e}}),null)}unsubscribe(){this._subscription.unsubscribe()}}export{D as DeviceSessionStateHandler};
1
+ import{DeviceSessionStateType as o,DeviceStatus as i,isSuccessCommandResult as v}from"../../../api/index";import{SessionEvents as s}from"../../device-session/model/DeviceSessionEventDispatcher";class d{constructor(e,n,a,c,r){this._sessionEventDispatcher=n;this._connectedDevice=a;this._deviceState=c;this.setDeviceSessionState=r;this._subscription=this._sessionEventDispatcher.listen().subscribe(t=>this.mapEventAction(t)),this._logger=e("device-session-state-handler")}_subscription;_logger;_updateDeviceState(e){const n=this._parseDeviceStatus(e);if(n){const{sessionStateType:a,deviceStatus:c,currentApp:r}=n,t=this._deviceState.getValue();t.sessionStateType===o.Connected?this.setDeviceSessionState({sessionStateType:a,deviceStatus:c,deviceModelId:this._connectedDevice.deviceModel.id,currentApp:r,installedApps:[],isSecureConnectionAllowed:!1}):this.setDeviceSessionState({...t,sessionStateType:a,deviceStatus:c,deviceModelId:this._connectedDevice.deviceModel.id,currentApp:r})}}mapEventAction=e=>{switch(e.eventName){case s.COMMAND_SUCCEEDED:return this._updateDeviceState(e.eventData);case s.DEVICE_STATE_UPDATE_BUSY:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:i.BUSY});case s.DEVICE_STATE_UPDATE_LOCKED:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:i.LOCKED});case s.DEVICE_STATE_UPDATE_CONNECTED:return this.setDeviceSessionState({...this._deviceState.getValue(),deviceStatus:i.CONNECTED});default:return null}};_parseDeviceStatus(e){return v(e)?{sessionStateType:o.ReadyWithoutSecureChannel,deviceStatus:i.CONNECTED,currentApp:{name:e.data.name,version:e.data.version}}:(this._logger.debug("Error while parsing APDU response",{data:{parsedResponse:e}}),null)}unsubscribe(){this._subscription.unsubscribe()}}export{d as DeviceSessionStateHandler};
2
2
  //# sourceMappingURL=DeviceSessionStateHandler.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/model/DeviceSessionStateHandler.ts"],
4
- "sourcesContent": ["import { type BehaviorSubject, type Subscription } from \"rxjs\";\n\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport {\n DeviceSessionStateType,\n DeviceStatus,\n type GetAppAndVersionResponse,\n isSuccessCommandResult,\n type TransportConnectedDevice,\n} from \"@api/index\";\nimport { type CommandResult, type LoggerPublisherService } from \"@api/types\";\nimport {\n type DeviceSessionEventDispatcher,\n type NewEvent,\n SessionEvents,\n} from \"@internal/device-session/model/DeviceSessionEventDispatcher\";\n\nexport type SetDeviceSessionStateFn = (state: DeviceSessionState) => void;\n\ntype NewDeviceStatus = {\n sessionStateType: DeviceSessionStateType;\n deviceStatus: DeviceStatus;\n currentApp: {\n name: string;\n version: string;\n };\n};\n\nexport class DeviceSessionStateHandler {\n private _subscription: Subscription;\n private readonly _logger: LoggerPublisherService;\n\n constructor(\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n private _sessionEventDispatcher: DeviceSessionEventDispatcher,\n private _connectedDevice: TransportConnectedDevice,\n private _deviceState: BehaviorSubject<DeviceSessionState>,\n private setDeviceSessionState: SetDeviceSessionStateFn,\n ) {\n this._subscription = this._sessionEventDispatcher\n .listen()\n .subscribe((event) => this.mapEventAction(event));\n this._logger = loggerModuleFactory(\"device-session-state-handler\");\n }\n\n private _updateDeviceState(\n parsedResponse: CommandResult<GetAppAndVersionResponse>,\n ): void {\n const newDeviceStatus = this._parseDeviceStatus(parsedResponse);\n\n if (newDeviceStatus) {\n const { sessionStateType, deviceStatus, currentApp } = newDeviceStatus;\n\n this.setDeviceSessionState({\n sessionStateType,\n deviceStatus,\n deviceModelId: this._connectedDevice.deviceModel.id,\n currentApp,\n installedApps: [],\n isSecureConnectionAllowed: false,\n });\n }\n }\n\n private mapEventAction = (event: NewEvent) => {\n switch (event.eventName) {\n case SessionEvents.COMMAND_SUCCEEDED:\n return this._updateDeviceState(event.eventData);\n case SessionEvents.DEVICE_STATE_UPDATE_BUSY:\n return this.setDeviceSessionState({\n ...this._deviceState.getValue(),\n deviceStatus: DeviceStatus.BUSY,\n });\n case SessionEvents.DEVICE_STATE_UPDATE_LOCKED:\n return this.setDeviceSessionState({\n ...this._deviceState.getValue(),\n deviceStatus: DeviceStatus.LOCKED,\n });\n case SessionEvents.DEVICE_STATE_UPDATE_CONNECTED:\n return this.setDeviceSessionState({\n ...this._deviceState.getValue(),\n deviceStatus: DeviceStatus.CONNECTED,\n });\n default:\n return null;\n }\n };\n\n private _parseDeviceStatus(\n parsedResponse: CommandResult<GetAppAndVersionResponse>,\n ): NewDeviceStatus | null {\n if (isSuccessCommandResult(parsedResponse)) {\n return {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: {\n name: parsedResponse.data.name,\n version: parsedResponse.data.version,\n },\n };\n } else {\n this._logger.error(\"Error while parsing APDU response\", {\n data: { parsedResponse },\n });\n return null;\n }\n }\n\n public unsubscribe(): void {\n this._subscription.unsubscribe();\n }\n}\n"],
5
- "mappings": "AAGA,OACE,0BAAAA,EACA,gBAAAC,EAEA,0BAAAC,MAEK,aAEP,OAGE,iBAAAC,MACK,8DAaA,MAAMC,CAA0B,CAIrC,YACEC,EACQC,EACAC,EACAC,EACAC,EACR,CAJQ,6BAAAH,EACA,sBAAAC,EACA,kBAAAC,EACA,2BAAAC,EAER,KAAK,cAAgB,KAAK,wBACvB,OAAO,EACP,UAAWC,GAAU,KAAK,eAAeA,CAAK,CAAC,EAClD,KAAK,QAAUL,EAAoB,8BAA8B,CACnE,CAdQ,cACS,QAeT,mBACNM,EACM,CACN,MAAMC,EAAkB,KAAK,mBAAmBD,CAAc,EAE9D,GAAIC,EAAiB,CACnB,KAAM,CAAE,iBAAAC,EAAkB,aAAAC,EAAc,WAAAC,CAAW,EAAIH,EAEvD,KAAK,sBAAsB,CACzB,iBAAAC,EACA,aAAAC,EACA,cAAe,KAAK,iBAAiB,YAAY,GACjD,WAAAC,EACA,cAAe,CAAC,EAChB,0BAA2B,EAC7B,CAAC,CACH,CACF,CAEQ,eAAkBL,GAAoB,CAC5C,OAAQA,EAAM,UAAW,CACvB,KAAKP,EAAc,kBACjB,OAAO,KAAK,mBAAmBO,EAAM,SAAS,EAChD,KAAKP,EAAc,yBACjB,OAAO,KAAK,sBAAsB,CAChC,GAAG,KAAK,aAAa,SAAS,EAC9B,aAAcF,EAAa,IAC7B,CAAC,EACH,KAAKE,EAAc,2BACjB,OAAO,KAAK,sBAAsB,CAChC,GAAG,KAAK,aAAa,SAAS,EAC9B,aAAcF,EAAa,MAC7B,CAAC,EACH,KAAKE,EAAc,8BACjB,OAAO,KAAK,sBAAsB,CAChC,GAAG,KAAK,aAAa,SAAS,EAC9B,aAAcF,EAAa,SAC7B,CAAC,EACH,QACE,OAAO,IACX,CACF,EAEQ,mBACNU,EACwB,CACxB,OAAIT,EAAuBS,CAAc,EAChC,CACL,iBAAkBX,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,WAAY,CACV,KAAMU,EAAe,KAAK,KAC1B,QAASA,EAAe,KAAK,OAC/B,CACF,GAEA,KAAK,QAAQ,MAAM,oCAAqC,CACtD,KAAM,CAAE,eAAAA,CAAe,CACzB,CAAC,EACM,KAEX,CAEO,aAAoB,CACzB,KAAK,cAAc,YAAY,CACjC,CACF",
6
- "names": ["DeviceSessionStateType", "DeviceStatus", "isSuccessCommandResult", "SessionEvents", "DeviceSessionStateHandler", "loggerModuleFactory", "_sessionEventDispatcher", "_connectedDevice", "_deviceState", "setDeviceSessionState", "event", "parsedResponse", "newDeviceStatus", "sessionStateType", "deviceStatus", "currentApp"]
4
+ "sourcesContent": ["import { type BehaviorSubject, type Subscription } from \"rxjs\";\n\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport {\n DeviceSessionStateType,\n DeviceStatus,\n type GetAppAndVersionResponse,\n isSuccessCommandResult,\n type TransportConnectedDevice,\n} from \"@api/index\";\nimport { type CommandResult, type LoggerPublisherService } from \"@api/types\";\nimport {\n type DeviceSessionEventDispatcher,\n type NewEvent,\n SessionEvents,\n} from \"@internal/device-session/model/DeviceSessionEventDispatcher\";\n\nexport type SetDeviceSessionStateFn = (state: DeviceSessionState) => void;\n\ntype NewDeviceStatus = {\n sessionStateType: DeviceSessionStateType;\n deviceStatus: DeviceStatus;\n currentApp: {\n name: string;\n version: string;\n };\n};\n\nexport class DeviceSessionStateHandler {\n private _subscription: Subscription;\n private readonly _logger: LoggerPublisherService;\n\n constructor(\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n private _sessionEventDispatcher: DeviceSessionEventDispatcher,\n private _connectedDevice: TransportConnectedDevice,\n private _deviceState: BehaviorSubject<DeviceSessionState>,\n private setDeviceSessionState: SetDeviceSessionStateFn,\n ) {\n this._subscription = this._sessionEventDispatcher\n .listen()\n .subscribe((event) => this.mapEventAction(event));\n this._logger = loggerModuleFactory(\"device-session-state-handler\");\n }\n\n private _updateDeviceState(\n parsedResponse: CommandResult<GetAppAndVersionResponse>,\n ): void {\n const newDeviceStatus = this._parseDeviceStatus(parsedResponse);\n\n if (newDeviceStatus) {\n const { sessionStateType, deviceStatus, currentApp } = newDeviceStatus;\n const state = this._deviceState.getValue();\n if (state.sessionStateType === DeviceSessionStateType.Connected) {\n // When device is connected, initialize fields to default values\n this.setDeviceSessionState({\n sessionStateType,\n deviceStatus,\n deviceModelId: this._connectedDevice.deviceModel.id,\n currentApp,\n installedApps: [],\n isSecureConnectionAllowed: false,\n });\n } else {\n // When device is ready, keep un-modified state fields\n this.setDeviceSessionState({\n ...state,\n sessionStateType,\n deviceStatus,\n deviceModelId: this._connectedDevice.deviceModel.id,\n currentApp,\n });\n }\n }\n }\n\n private mapEventAction = (event: NewEvent) => {\n switch (event.eventName) {\n case SessionEvents.COMMAND_SUCCEEDED:\n return this._updateDeviceState(event.eventData);\n case SessionEvents.DEVICE_STATE_UPDATE_BUSY:\n return this.setDeviceSessionState({\n ...this._deviceState.getValue(),\n deviceStatus: DeviceStatus.BUSY,\n });\n case SessionEvents.DEVICE_STATE_UPDATE_LOCKED:\n return this.setDeviceSessionState({\n ...this._deviceState.getValue(),\n deviceStatus: DeviceStatus.LOCKED,\n });\n case SessionEvents.DEVICE_STATE_UPDATE_CONNECTED:\n return this.setDeviceSessionState({\n ...this._deviceState.getValue(),\n deviceStatus: DeviceStatus.CONNECTED,\n });\n default:\n return null;\n }\n };\n\n private _parseDeviceStatus(\n parsedResponse: CommandResult<GetAppAndVersionResponse>,\n ): NewDeviceStatus | null {\n if (isSuccessCommandResult(parsedResponse)) {\n return {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: {\n name: parsedResponse.data.name,\n version: parsedResponse.data.version,\n },\n };\n } else {\n this._logger.debug(\"Error while parsing APDU response\", {\n data: { parsedResponse },\n });\n return null;\n }\n }\n\n public unsubscribe(): void {\n this._subscription.unsubscribe();\n }\n}\n"],
5
+ "mappings": "AAGA,OACE,0BAAAA,EACA,gBAAAC,EAEA,0BAAAC,MAEK,aAEP,OAGE,iBAAAC,MACK,8DAaA,MAAMC,CAA0B,CAIrC,YACEC,EACQC,EACAC,EACAC,EACAC,EACR,CAJQ,6BAAAH,EACA,sBAAAC,EACA,kBAAAC,EACA,2BAAAC,EAER,KAAK,cAAgB,KAAK,wBACvB,OAAO,EACP,UAAWC,GAAU,KAAK,eAAeA,CAAK,CAAC,EAClD,KAAK,QAAUL,EAAoB,8BAA8B,CACnE,CAdQ,cACS,QAeT,mBACNM,EACM,CACN,MAAMC,EAAkB,KAAK,mBAAmBD,CAAc,EAE9D,GAAIC,EAAiB,CACnB,KAAM,CAAE,iBAAAC,EAAkB,aAAAC,EAAc,WAAAC,CAAW,EAAIH,EACjDI,EAAQ,KAAK,aAAa,SAAS,EACrCA,EAAM,mBAAqBhB,EAAuB,UAEpD,KAAK,sBAAsB,CACzB,iBAAAa,EACA,aAAAC,EACA,cAAe,KAAK,iBAAiB,YAAY,GACjD,WAAAC,EACA,cAAe,CAAC,EAChB,0BAA2B,EAC7B,CAAC,EAGD,KAAK,sBAAsB,CACzB,GAAGC,EACH,iBAAAH,EACA,aAAAC,EACA,cAAe,KAAK,iBAAiB,YAAY,GACjD,WAAAC,CACF,CAAC,CAEL,CACF,CAEQ,eAAkBL,GAAoB,CAC5C,OAAQA,EAAM,UAAW,CACvB,KAAKP,EAAc,kBACjB,OAAO,KAAK,mBAAmBO,EAAM,SAAS,EAChD,KAAKP,EAAc,yBACjB,OAAO,KAAK,sBAAsB,CAChC,GAAG,KAAK,aAAa,SAAS,EAC9B,aAAcF,EAAa,IAC7B,CAAC,EACH,KAAKE,EAAc,2BACjB,OAAO,KAAK,sBAAsB,CAChC,GAAG,KAAK,aAAa,SAAS,EAC9B,aAAcF,EAAa,MAC7B,CAAC,EACH,KAAKE,EAAc,8BACjB,OAAO,KAAK,sBAAsB,CAChC,GAAG,KAAK,aAAa,SAAS,EAC9B,aAAcF,EAAa,SAC7B,CAAC,EACH,QACE,OAAO,IACX,CACF,EAEQ,mBACNU,EACwB,CACxB,OAAIT,EAAuBS,CAAc,EAChC,CACL,iBAAkBX,EAAuB,0BACzC,aAAcC,EAAa,UAC3B,WAAY,CACV,KAAMU,EAAe,KAAK,KAC1B,QAASA,EAAe,KAAK,OAC/B,CACF,GAEA,KAAK,QAAQ,MAAM,oCAAqC,CACtD,KAAM,CAAE,eAAAA,CAAe,CACzB,CAAC,EACM,KAEX,CAEO,aAAoB,CACzB,KAAK,cAAc,YAAY,CACjC,CACF",
6
+ "names": ["DeviceSessionStateType", "DeviceStatus", "isSuccessCommandResult", "SessionEvents", "DeviceSessionStateHandler", "loggerModuleFactory", "_sessionEventDispatcher", "_connectedDevice", "_deviceState", "setDeviceSessionState", "event", "parsedResponse", "newDeviceStatus", "sessionStateType", "deviceStatus", "currentApp", "state"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{BehaviorSubject as E,Subject as S}from"rxjs";import{CommandResultStatus as u,DeviceModelId as p,DeviceSessionStateType as l,DeviceStatus as o}from"../../../api/index";import{SessionEvents as s}from"../../device-session/model/DeviceSessionEventDispatcher";import{DeviceSessionStateHandler as D}from"./DeviceSessionStateHandler";describe("DeviceSessionStateHandler",()=>{let n,c,i;const v=vi.fn(()=>i);let r,d,t,a;beforeEach(()=>{n=new S,c={listen:()=>n,dispatch:vi.fn()},i={error:vi.fn()},r={deviceModel:{id:"device-model-1"}},d=new E({sessionStateType:l.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,deviceModelId:p.NANO_X,currentApp:{name:"",version:""},installedApps:[],isSecureConnectionAllowed:!1}),t=vi.fn(),a=new D(v,c,r,d,t)}),afterEach(()=>{a&&typeof a.unsubscribe=="function"&&a.unsubscribe()}),it("updates device state on COMMAND_SUCCEEDED event with a successful response",()=>{const e={data:{name:"TestApp",version:"1.0.0"},status:u.Success};n.next({eventName:s.COMMAND_SUCCEEDED,eventData:e}),expect(t).toHaveBeenCalledWith({sessionStateType:l.ReadyWithoutSecureChannel,deviceStatus:o.CONNECTED,deviceModelId:"device-model-1",currentApp:{name:"TestApp",version:"1.0.0"},installedApps:[],isSecureConnectionAllowed:!1})}),it("updates device state on DEVICE_STATE_UPDATE_BUSY event",()=>{n.next({eventName:s.DEVICE_STATE_UPDATE_BUSY}),expect(t).toHaveBeenCalled();const e=t.mock.calls[0][0];expect(e.deviceStatus).toBe(o.BUSY)}),it("updates device state on DEVICE_STATE_UPDATE_CONNECTED event",()=>{n.next({eventName:s.DEVICE_STATE_UPDATE_CONNECTED}),expect(t).toHaveBeenCalled();const e=t.mock.calls[0][0];expect(e.deviceStatus).toBe(o.CONNECTED)}),it("logs error and does not update state if command result is unsuccessful",()=>{const e={data:null,error:{_tag:"SomeOtherError"}};n.next({eventName:s.COMMAND_SUCCEEDED,eventData:e}),expect(i.error).toHaveBeenCalledWith("Error while parsing APDU response",{data:{parsedResponse:e}}),expect(t).not.toHaveBeenCalled()}),it("does not update state if command result is not a success",()=>{const e={data:null,error:{_tag:"SomeOtherError"}};n.next({eventName:s.COMMAND_SUCCEEDED,eventData:e}),expect(t).not.toHaveBeenCalled()})});
1
+ import{BehaviorSubject as p,Subject as C}from"rxjs";import{expect as e}from"vitest";import{CommandResultStatus as u,DeviceModelId as S,DeviceSessionStateType as r,DeviceStatus as a}from"../../../api/index";import{SessionEvents as i}from"../../device-session/model/DeviceSessionEventDispatcher";import{DeviceSessionStateHandler as D}from"./DeviceSessionStateHandler";describe("DeviceSessionStateHandler",()=>{let t,v,c;const E=vi.fn(()=>c);let l,d,n,o;beforeEach(()=>{t=new C,v={listen:()=>t,dispatch:vi.fn()},c={error:vi.fn(),debug:vi.fn()},l={deviceModel:{id:"device-model-1"}},d=new p({sessionStateType:r.Connected,deviceStatus:a.CONNECTED,deviceModelId:S.NANO_X}),n=vi.fn(),o=new D(E,v,l,d,n)}),afterEach(()=>{o&&typeof o.unsubscribe=="function"&&o.unsubscribe()}),it("updates device state on COMMAND_SUCCEEDED event with a successful response",()=>{const s={data:{name:"TestApp",version:"1.0.0"},status:u.Success};t.next({eventName:i.COMMAND_SUCCEEDED,eventData:s}),e(n).toHaveBeenCalledWith({sessionStateType:r.ReadyWithoutSecureChannel,deviceStatus:a.CONNECTED,deviceModelId:"device-model-1",currentApp:{name:"TestApp",version:"1.0.0"},installedApps:[],isSecureConnectionAllowed:!1})}),it("updates device state on COMMAND_SUCCEEDED event when device is ready",()=>{d.next({sessionStateType:r.ReadyWithoutSecureChannel,deviceStatus:a.CONNECTED,deviceModelId:S.NANO_X,currentApp:{name:"",version:""},installedApps:["Bitcoin","Ethereum"],isSecureConnectionAllowed:!0});const s={data:{name:"TestApp",version:"1.0.0"},status:u.Success};t.next({eventName:i.COMMAND_SUCCEEDED,eventData:s}),e(n).toHaveBeenCalledWith({sessionStateType:r.ReadyWithoutSecureChannel,deviceStatus:a.CONNECTED,deviceModelId:"device-model-1",currentApp:{name:"TestApp",version:"1.0.0"},installedApps:["Bitcoin","Ethereum"],isSecureConnectionAllowed:!0})}),it("updates device state on DEVICE_STATE_UPDATE_BUSY event",()=>{t.next({eventName:i.DEVICE_STATE_UPDATE_BUSY}),e(n).toHaveBeenCalledWith(e.objectContaining({deviceStatus:a.BUSY}))}),it("updates device state on DEVICE_STATE_UPDATE_CONNECTED event",()=>{t.next({eventName:i.DEVICE_STATE_UPDATE_CONNECTED}),e(n).toHaveBeenCalledWith(e.objectContaining({deviceStatus:a.CONNECTED}))}),it("logs error and does not update state if command result is unsuccessful",()=>{const s={data:null,error:{_tag:"SomeOtherError"}};t.next({eventName:i.COMMAND_SUCCEEDED,eventData:s}),e(c.debug).toHaveBeenCalledWith("Error while parsing APDU response",{data:{parsedResponse:s}}),e(n).not.toHaveBeenCalled()}),it("does not update state if command result is not a success",()=>{const s={data:null,error:{_tag:"SomeOtherError"}};t.next({eventName:i.COMMAND_SUCCEEDED,eventData:s}),e(n).not.toHaveBeenCalled()})});
2
2
  //# sourceMappingURL=DeviceSessionStateHandler.test.js.map