@ledgerhq/device-management-kit 0.0.0-develop-20250106155719 → 0.0.0-rn-hid-20250221112139

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 (557) hide show
  1. package/README.md +27 -31
  2. package/lib/cjs/index.js.map +1 -1
  3. package/lib/cjs/package.json +12 -8
  4. package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
  5. package/lib/cjs/src/api/DeviceManagementKit.js.map +2 -2
  6. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  7. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +2 -2
  8. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
  9. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
  10. package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js +1 -1
  11. package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
  12. package/lib/cjs/src/api/DmkConfig.js +1 -1
  13. package/lib/cjs/src/api/DmkConfig.js.map +1 -1
  14. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js +1 -1
  15. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js.map +2 -2
  16. package/lib/cjs/src/api/command/model/CommandResult.js.map +1 -1
  17. package/lib/cjs/src/api/command/os/LoadCertificateCommand.js +2 -0
  18. package/lib/cjs/src/api/command/os/LoadCertificateCommand.js.map +7 -0
  19. package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js +2 -0
  20. package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js.map +7 -0
  21. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  22. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  23. package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
  24. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +3 -3
  25. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
  26. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +3 -3
  27. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  28. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  29. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  30. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  31. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  32. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +2 -2
  33. package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js +1 -1
  34. package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +3 -3
  35. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +2 -0
  36. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +7 -0
  37. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +2 -0
  38. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +7 -0
  39. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +2 -0
  40. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +7 -0
  41. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  42. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
  43. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
  44. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
  45. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
  46. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
  47. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
  48. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +2 -2
  49. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
  50. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
  51. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  52. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +2 -2
  53. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  54. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  55. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
  56. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +1 -1
  57. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  58. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  59. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  60. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
  61. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
  62. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  63. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  64. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
  65. package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
  66. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
  67. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +1 -1
  68. package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +3 -3
  69. package/lib/cjs/src/api/index.js +1 -1
  70. package/lib/cjs/src/api/index.js.map +3 -3
  71. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
  72. package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
  73. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  74. package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +2 -2
  75. package/lib/cjs/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js +1 -1
  76. package/lib/cjs/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js.map +2 -2
  77. package/lib/cjs/src/api/transport/model/DeviceApduSender.js +2 -0
  78. package/lib/cjs/src/api/transport/model/DeviceApduSender.js.map +7 -0
  79. package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
  80. package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
  81. package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js +1 -1
  82. package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js.map +2 -2
  83. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  84. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  85. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js +1 -1
  86. package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
  87. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  88. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  89. package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
  90. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js +1 -1
  91. package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js.map +2 -2
  92. package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js +1 -1
  93. package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js.map +1 -1
  94. package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js +1 -1
  95. package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
  96. package/lib/cjs/src/api/types.js.map +1 -1
  97. package/lib/cjs/src/api/utils/Base64String.test.js +1 -1
  98. package/lib/cjs/src/api/utils/Base64String.test.js.map +2 -2
  99. package/lib/cjs/src/api/utils/HexaString.js +1 -1
  100. package/lib/cjs/src/api/utils/HexaString.js.map +2 -2
  101. package/lib/cjs/src/api/utils/HexaString.test.js +1 -1
  102. package/lib/cjs/src/api/utils/HexaString.test.js.map +2 -2
  103. package/lib/cjs/src/di.js +1 -1
  104. package/lib/cjs/src/di.js.map +3 -3
  105. package/lib/cjs/src/di.stub.js +1 -1
  106. package/lib/cjs/src/di.stub.js.map +2 -2
  107. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js +1 -1
  108. package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js.map +3 -3
  109. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js +1 -1
  110. package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js.map +2 -2
  111. package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js +1 -1
  112. package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +2 -2
  113. package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +1 -1
  114. package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +2 -2
  115. package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js +1 -1
  116. package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js.map +2 -2
  117. package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js +1 -1
  118. package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +2 -2
  119. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  120. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  121. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  122. package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  123. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  124. package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +2 -2
  125. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.test.js +1 -1
  126. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.test.js.map +2 -2
  127. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  128. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  129. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  130. package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  131. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  132. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  133. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  134. package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  135. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  136. package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  137. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  138. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  139. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  140. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
  141. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js +1 -1
  142. package/lib/cjs/src/internal/discovery/di/discoveryTypes.js.map +2 -2
  143. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  144. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  145. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
  146. package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
  147. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  148. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  149. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  150. package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  151. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  152. package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  153. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
  154. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
  155. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
  156. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
  157. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  158. package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  159. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  160. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  161. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  162. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +3 -3
  163. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  164. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +2 -2
  165. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js +1 -1
  166. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +2 -2
  167. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
  168. package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +2 -2
  169. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  170. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  171. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  172. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  173. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  174. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  175. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  176. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  177. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  178. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  179. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  180. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  181. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +2 -2
  182. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  183. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  184. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +2 -0
  185. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +7 -0
  186. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +2 -0
  187. package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +7 -0
  188. package/lib/cjs/src/internal/secure-channel/data/SecureChannelDataSource.js +2 -0
  189. package/lib/cjs/src/internal/secure-channel/data/SecureChannelDataSource.js.map +7 -0
  190. package/lib/cjs/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js +2 -0
  191. package/lib/cjs/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js.map +7 -0
  192. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +2 -0
  193. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +7 -0
  194. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +2 -0
  195. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +7 -0
  196. package/lib/cjs/src/internal/secure-channel/di/secureChannelTypes.js +2 -0
  197. package/lib/cjs/src/internal/secure-channel/di/secureChannelTypes.js.map +7 -0
  198. package/lib/cjs/src/internal/secure-channel/model/Const.js +2 -0
  199. package/lib/cjs/src/internal/secure-channel/model/Const.js.map +7 -0
  200. package/lib/cjs/src/internal/secure-channel/model/Errors.js +2 -0
  201. package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +7 -0
  202. package/lib/cjs/src/internal/secure-channel/model/Params.js +2 -0
  203. package/lib/cjs/src/internal/secure-channel/model/Params.js.map +7 -0
  204. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +2 -0
  205. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +7 -0
  206. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +2 -0
  207. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +7 -0
  208. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +2 -0
  209. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +7 -0
  210. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  211. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  212. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  213. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  214. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
  215. package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  216. package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js +1 -1
  217. package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js.map +2 -2
  218. package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
  219. package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
  220. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  221. package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  222. package/lib/esm/package.json +12 -8
  223. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  224. package/lib/esm/src/api/DeviceManagementKit.js.map +2 -2
  225. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  226. package/lib/esm/src/api/DeviceManagementKit.test.js.map +2 -2
  227. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  228. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  229. package/lib/esm/src/api/DeviceManagementKitBuilder.test.js +1 -1
  230. package/lib/esm/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
  231. package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js +1 -1
  232. package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js.map +2 -2
  233. package/lib/esm/src/api/command/model/CommandResult.js.map +1 -1
  234. package/lib/esm/src/api/command/os/LoadCertificateCommand.js +2 -0
  235. package/lib/esm/src/api/command/os/LoadCertificateCommand.js.map +7 -0
  236. package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js +2 -0
  237. package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js.map +7 -0
  238. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
  239. package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
  240. package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
  241. package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
  242. package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
  243. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +3 -3
  244. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  245. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  246. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  247. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +2 -2
  248. package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js +1 -1
  249. package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +3 -3
  250. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +2 -0
  251. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +7 -0
  252. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +2 -0
  253. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +7 -0
  254. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -0
  255. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +7 -0
  256. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  257. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
  258. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
  259. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
  260. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
  261. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
  262. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
  263. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +2 -2
  264. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
  265. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
  266. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  267. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +2 -2
  268. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  269. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  270. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  271. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  272. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  273. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
  274. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  275. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
  276. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  277. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +1 -1
  278. package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +3 -3
  279. package/lib/esm/src/api/index.js +1 -1
  280. package/lib/esm/src/api/index.js.map +3 -3
  281. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
  282. package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
  283. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
  284. package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +2 -2
  285. package/lib/esm/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js +1 -1
  286. package/lib/esm/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js.map +2 -2
  287. package/lib/esm/src/api/transport/model/DeviceApduSender.js +1 -0
  288. package/lib/esm/src/api/transport/model/DeviceApduSender.js.map +7 -0
  289. package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js +1 -1
  290. package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js.map +2 -2
  291. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
  292. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
  293. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  294. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  295. package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js +1 -1
  296. package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js.map +2 -2
  297. package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js +1 -1
  298. package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
  299. package/lib/esm/src/api/utils/Base64String.test.js +1 -1
  300. package/lib/esm/src/api/utils/Base64String.test.js.map +2 -2
  301. package/lib/esm/src/api/utils/HexaString.js +1 -1
  302. package/lib/esm/src/api/utils/HexaString.js.map +2 -2
  303. package/lib/esm/src/api/utils/HexaString.test.js +1 -1
  304. package/lib/esm/src/api/utils/HexaString.test.js.map +2 -2
  305. package/lib/esm/src/di.js +1 -1
  306. package/lib/esm/src/di.js.map +3 -3
  307. package/lib/esm/src/di.stub.js +1 -1
  308. package/lib/esm/src/di.stub.js.map +2 -2
  309. package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js +1 -1
  310. package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js.map +3 -3
  311. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js +1 -1
  312. package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js.map +2 -2
  313. package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js +1 -1
  314. package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +2 -2
  315. package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +1 -1
  316. package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +2 -2
  317. package/lib/esm/src/internal/config/service/DefaultConfigService.test.js +1 -1
  318. package/lib/esm/src/internal/config/service/DefaultConfigService.test.js.map +2 -2
  319. package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js +1 -1
  320. package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +2 -2
  321. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  322. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  323. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js +1 -1
  324. package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
  325. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
  326. package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +2 -2
  327. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.test.js +1 -1
  328. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.test.js.map +2 -2
  329. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  330. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  331. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
  332. package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
  333. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
  334. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
  335. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
  336. package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
  337. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
  338. package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
  339. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  340. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  341. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  342. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
  343. package/lib/esm/src/internal/discovery/di/discoveryTypes.js +1 -1
  344. package/lib/esm/src/internal/discovery/di/discoveryTypes.js.map +2 -2
  345. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
  346. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
  347. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
  348. package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
  349. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  350. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
  351. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
  352. package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
  353. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
  354. package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
  355. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
  356. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
  357. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
  358. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
  359. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
  360. package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
  361. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  362. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  363. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
  364. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +3 -3
  365. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  366. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +2 -2
  367. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js +1 -1
  368. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +2 -2
  369. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
  370. package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +2 -2
  371. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  372. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  373. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  374. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  375. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  376. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  377. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  378. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  379. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  380. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +2 -2
  381. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  382. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  383. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +2 -0
  384. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +7 -0
  385. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +2 -0
  386. package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +7 -0
  387. package/lib/esm/src/internal/secure-channel/data/SecureChannelDataSource.js +1 -0
  388. package/lib/esm/src/internal/secure-channel/data/SecureChannelDataSource.js.map +7 -0
  389. package/lib/esm/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js +2 -0
  390. package/lib/esm/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js.map +7 -0
  391. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +2 -0
  392. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +7 -0
  393. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +2 -0
  394. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +7 -0
  395. package/lib/esm/src/internal/secure-channel/di/secureChannelTypes.js +2 -0
  396. package/lib/esm/src/internal/secure-channel/di/secureChannelTypes.js.map +7 -0
  397. package/lib/esm/src/internal/secure-channel/model/Const.js +2 -0
  398. package/lib/esm/src/internal/secure-channel/model/Const.js.map +7 -0
  399. package/lib/esm/src/internal/secure-channel/model/Errors.js +2 -0
  400. package/lib/esm/src/internal/secure-channel/model/Errors.js.map +7 -0
  401. package/lib/esm/src/internal/secure-channel/model/Params.js +1 -0
  402. package/lib/esm/src/internal/secure-channel/model/Params.js.map +7 -0
  403. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js +2 -0
  404. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +7 -0
  405. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +2 -0
  406. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +7 -0
  407. package/lib/esm/src/internal/secure-channel/service/SecureChannelService.js +1 -0
  408. package/lib/esm/src/internal/secure-channel/service/SecureChannelService.js.map +7 -0
  409. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
  410. package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
  411. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  412. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  413. package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
  414. package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
  415. package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js +1 -1
  416. package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js.map +2 -2
  417. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
  418. package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
  419. package/lib/types/src/api/DeviceManagementKit.d.ts +1 -1
  420. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  421. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  422. package/lib/types/src/api/DmkConfig.d.ts +1 -0
  423. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  424. package/lib/types/src/api/command/model/CommandResult.d.ts +1 -2
  425. package/lib/types/src/api/command/model/CommandResult.d.ts.map +1 -1
  426. package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts +25 -0
  427. package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts.map +1 -0
  428. package/lib/types/src/api/command/os/LoadCertificateCommand.test.d.ts +2 -0
  429. package/lib/types/src/api/command/os/LoadCertificateCommand.test.d.ts.map +1 -0
  430. package/lib/types/src/api/command/utils/CommandUtils.d.ts +1 -0
  431. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  432. package/lib/types/src/api/device-action/DeviceAction.d.ts +6 -1
  433. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  434. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts +2 -1
  435. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  436. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  437. package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts +5 -2
  438. package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts.map +1 -1
  439. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts +40 -0
  440. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -0
  441. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.d.ts +2 -0
  442. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.d.ts.map +1 -0
  443. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +19 -0
  444. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -0
  445. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts.map +1 -1
  446. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
  447. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +1 -0
  448. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
  449. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  450. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -0
  451. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  452. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +5 -0
  453. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  454. package/lib/types/src/api/index.d.ts +3 -0
  455. package/lib/types/src/api/index.d.ts.map +1 -1
  456. package/lib/types/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.d.ts +1 -1
  457. package/lib/types/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.d.ts.map +1 -1
  458. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts +17 -0
  459. package/lib/types/src/api/transport/model/DeviceApduSender.d.ts.map +1 -0
  460. package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
  461. package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
  462. package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts +1 -1
  463. package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts.map +1 -1
  464. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +60 -0
  465. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -0
  466. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +2 -0
  467. package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
  468. package/lib/types/src/api/transport/model/Errors.d.ts +41 -26
  469. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  470. package/lib/types/src/api/transport/model/Transport.d.ts +1 -1
  471. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  472. package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts +2 -0
  473. package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts.map +1 -1
  474. package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts +7 -7
  475. package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts.map +1 -1
  476. package/lib/types/src/api/types.d.ts +3 -2
  477. package/lib/types/src/api/types.d.ts.map +1 -1
  478. package/lib/types/src/api/utils/HexaString.d.ts +1 -1
  479. package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
  480. package/lib/types/src/di.d.ts.map +1 -1
  481. package/lib/types/src/di.stub.d.ts +1 -1
  482. package/lib/types/src/di.stub.d.ts.map +1 -1
  483. package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts +1 -1
  484. package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts.map +1 -1
  485. package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts +3 -3
  486. package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts.map +1 -1
  487. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +10 -5
  488. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  489. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts +2 -1
  490. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  491. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +3 -1
  492. package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
  493. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts +1 -1
  494. package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts.map +1 -1
  495. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts +3 -1
  496. package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts.map +1 -1
  497. package/lib/types/src/internal/discovery/use-case/{ListenToKnownDevicesUseCase.d.ts → ListenToAvailableDevicesUseCase.d.ts} +2 -2
  498. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -0
  499. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts +2 -0
  500. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts.map +1 -0
  501. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
  502. package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts +5 -5
  503. package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts.map +1 -1
  504. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +4 -3
  505. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  506. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +24 -0
  507. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  508. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +3 -3
  509. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  510. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +4 -0
  511. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  512. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  513. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts +18 -0
  514. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts.map +1 -0
  515. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.d.ts +2 -0
  516. package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.d.ts.map +1 -0
  517. package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts +52 -0
  518. package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts.map +1 -0
  519. package/lib/types/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.d.ts +10 -0
  520. package/lib/types/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.d.ts.map +1 -0
  521. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts +9 -0
  522. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -0
  523. package/lib/types/src/internal/secure-channel/di/secureChannelModule.test.d.ts +2 -0
  524. package/lib/types/src/internal/secure-channel/di/secureChannelModule.test.d.ts.map +1 -0
  525. package/lib/types/src/internal/secure-channel/di/secureChannelTypes.d.ts +6 -0
  526. package/lib/types/src/internal/secure-channel/di/secureChannelTypes.d.ts.map +1 -0
  527. package/lib/types/src/internal/secure-channel/model/Const.d.ts +2 -0
  528. package/lib/types/src/internal/secure-channel/model/Const.d.ts.map +1 -0
  529. package/lib/types/src/internal/secure-channel/model/Errors.d.ts +8 -0
  530. package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -0
  531. package/lib/types/src/internal/secure-channel/model/Params.d.ts +86 -0
  532. package/lib/types/src/internal/secure-channel/model/Params.d.ts.map +1 -0
  533. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +21 -0
  534. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -0
  535. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.test.d.ts +2 -0
  536. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.test.d.ts.map +1 -0
  537. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +21 -0
  538. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -0
  539. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +2 -0
  540. package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
  541. package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -1
  542. package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
  543. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +7 -6
  544. package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
  545. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  546. package/package.json +13 -9
  547. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
  548. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
  549. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
  550. package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
  551. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
  552. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
  553. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
  554. package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
  555. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts.map +0 -1
  556. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts +0 -2
  557. package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-action/xstate-utils/XStateDeviceAction.ts"],
4
- "sourcesContent": ["import { createBrowserInspector } from \"@statelyai/inspect\";\nimport { Observable, ReplaySubject, share } from \"rxjs\";\nimport {\n createActor,\n type SnapshotFrom,\n type StateMachine,\n type StateSchema,\n} from \"xstate\";\n\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n type InternalApi,\n} from \"@api/device-action/DeviceAction\";\nimport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nimport { type DmkError } from \"@api/Error\";\n\nimport { type StateMachineTypes } from \"./StateMachineTypes\";\n\nexport type DeviceActionStateMachine<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n InternalState,\n> = StateMachine<\n StateMachineTypes<\n Output,\n Input,\n Error,\n IntermediateValue,\n InternalState\n >[\"context\"], // context\n /**\n * The following usages `any` are OK because this is just a wrapper around the\n * state machine and we are not directly going to use these types.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n any, // event\n any, // children\n any, // actor\n any, // action\n any, // guard\n any, // delay\n any, // state value\n any, // tag\n /* eslint-enable @typescript-eslint/no-explicit-any */\n StateMachineTypes<\n Output,\n Input,\n Error,\n IntermediateValue,\n InternalState\n >[\"input\"],\n StateMachineTypes<\n Output,\n Input,\n Error,\n IntermediateValue,\n InternalState\n >[\"output\"],\n /* eslint-disable @typescript-eslint/no-explicit-any */\n any,\n any,\n /* eslint-enable @typescript-eslint/no-explicit-any */\n StateSchema\n>;\n\n/**\n * A DeviceAction that uses an XState state machine to execute.\n * It maps the state machine snapshots to the DeviceActionState.\n * This class is abstract and should be extended to implement the state machine.\n */\nexport abstract class XStateDeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n InternalState,\n> implements DeviceAction<Output, Input, Error, IntermediateValue>\n{\n readonly input: Input;\n readonly inspect: boolean = false;\n\n /**\n *\n * @param input The input for the DeviceAction\n * @param inspect If true, the state machine will be inspected in the browser\n */\n constructor(args: { input: Input; inspect?: boolean }) {\n this.input = args.input;\n this.inspect = Boolean(args.inspect);\n }\n\n protected abstract makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n Output,\n Input,\n Error,\n IntermediateValue,\n InternalState\n >;\n\n _execute(\n internalApi: InternalApi,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> {\n const stateMachine = this.makeStateMachine(internalApi);\n\n const actor = createActor(stateMachine, {\n input: this.input,\n // optional inspector for debugging\n inspect: this.inspect ? createBrowserInspector().inspect : undefined,\n });\n\n /**\n * Using a ReplaySubject is important because the first snapshots might be\n * emitted before the observable is subscribed (if the machine goes through\n * those states fully synchronously).\n * This way, we ensure that the subscriber always receives the latest snapshot.\n * */\n const subject = new ReplaySubject<\n DeviceActionState<Output, Error, IntermediateValue>\n >();\n\n const handleActorSnapshot = (\n snapshot: SnapshotFrom<typeof stateMachine>,\n ) => {\n const { context, status, output, error } = snapshot;\n switch (status) {\n case \"active\":\n subject.next({\n status: DeviceActionStatus.Pending,\n intermediateValue: context.intermediateValue,\n });\n break;\n case \"done\":\n output.caseOf({\n Left: (err) => {\n subject.next({\n status: DeviceActionStatus.Error,\n error: err,\n });\n },\n Right: (result) => {\n subject.next({\n status: DeviceActionStatus.Completed,\n output: result,\n });\n },\n });\n subject.complete();\n break;\n case \"error\":\n // this is an error in the execution of the state machine, it should not happen\n subject.error(error);\n subject.complete();\n break;\n case \"stopped\":\n subject.next({\n status: DeviceActionStatus.Stopped,\n });\n subject.complete();\n break;\n default:\n this._exhaustiveMatchingGuard(status);\n }\n };\n\n const observable = new Observable<\n DeviceActionState<Output, Error, IntermediateValue>\n >((subscriber) => {\n const subjectSubscription = subject.subscribe(subscriber);\n return () => {\n actorSubscription.unsubscribe();\n subjectSubscription.unsubscribe();\n actor.stop(); // stop the actor when the observable is unsubscribed\n };\n });\n\n const actorSubscription = actor.subscribe(handleActorSnapshot);\n actor.start();\n\n return {\n observable: observable.pipe(share()), // share to garantee that once there is no more observer, the actor is stopped\n cancel: () => {\n actor.stop();\n actorSubscription.unsubscribe();\n handleActorSnapshot(actor.getSnapshot());\n },\n };\n }\n\n private _exhaustiveMatchingGuard(status: never): never {\n console.log(\"_exhaustiveMatchingGuard status\", status);\n throw new Error(`Unhandled status: ${status}`);\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuC,8BACvCC,EAAiD,gBACjDC,EAKO,kBAQPC,EAGO,sDA2DA,MAAeL,CAOtB,CACW,MACA,QAAmB,GAO5B,YAAYM,EAA2C,CACrD,KAAK,MAAQA,EAAK,MAClB,KAAK,QAAU,EAAQA,EAAK,OAC9B,CAYA,SACEC,EACiE,CACjE,MAAMC,EAAe,KAAK,iBAAiBD,CAAW,EAEhDE,KAAQ,eAAYD,EAAc,CACtC,MAAO,KAAK,MAEZ,QAAS,KAAK,WAAU,0BAAuB,EAAE,QAAU,MAC7D,CAAC,EAQKE,EAAU,IAAI,gBAIdC,EACJC,GACG,CACH,KAAM,CAAE,QAAAC,EAAS,OAAAC,EAAQ,OAAAC,EAAQ,MAAAC,CAAM,EAAIJ,EAC3C,OAAQE,EAAQ,CACd,IAAK,SACHJ,EAAQ,KAAK,CACX,OAAQ,qBAAmB,QAC3B,kBAAmBG,EAAQ,iBAC7B,CAAC,EACD,MACF,IAAK,OACHE,EAAO,OAAO,CACZ,KAAOE,GAAQ,CACbP,EAAQ,KAAK,CACX,OAAQ,qBAAmB,MAC3B,MAAOO,CACT,CAAC,CACH,EACA,MAAQC,GAAW,CACjBR,EAAQ,KAAK,CACX,OAAQ,qBAAmB,UAC3B,OAAQQ,CACV,CAAC,CACH,CACF,CAAC,EACDR,EAAQ,SAAS,EACjB,MACF,IAAK,QAEHA,EAAQ,MAAMM,CAAK,EACnBN,EAAQ,SAAS,EACjB,MACF,IAAK,UACHA,EAAQ,KAAK,CACX,OAAQ,qBAAmB,OAC7B,CAAC,EACDA,EAAQ,SAAS,EACjB,MACF,QACE,KAAK,yBAAyBI,CAAM,CACxC,CACF,EAEMK,EAAa,IAAI,aAEpBC,GAAe,CAChB,MAAMC,EAAsBX,EAAQ,UAAUU,CAAU,EACxD,MAAO,IAAM,CACXE,EAAkB,YAAY,EAC9BD,EAAoB,YAAY,EAChCZ,EAAM,KAAK,CACb,CACF,CAAC,EAEKa,EAAoBb,EAAM,UAAUE,CAAmB,EAC7D,OAAAF,EAAM,MAAM,EAEL,CACL,WAAYU,EAAW,QAAK,SAAM,CAAC,EACnC,OAAQ,IAAM,CACZV,EAAM,KAAK,EACXa,EAAkB,YAAY,EAC9BX,EAAoBF,EAAM,YAAY,CAAC,CACzC,CACF,CACF,CAEQ,yBAAyBK,EAAsB,CACrD,cAAQ,IAAI,kCAAmCA,CAAM,EAC/C,IAAI,MAAM,qBAAqBA,CAAM,EAAE,CAC/C,CACF",
6
- "names": ["XStateDeviceAction_exports", "__export", "XStateDeviceAction", "__toCommonJS", "import_inspect", "import_rxjs", "import_xstate", "import_DeviceActionState", "args", "internalApi", "stateMachine", "actor", "subject", "handleActorSnapshot", "snapshot", "context", "status", "output", "error", "err", "result", "observable", "subscriber", "subjectSubscription", "actorSubscription"]
4
+ "sourcesContent": ["// import { createBrowserInspector } from \"@statelyai/inspect\";\nimport { Observable, ReplaySubject, share } from \"rxjs\";\nimport {\n createActor,\n type SnapshotFrom,\n type StateMachine,\n type StateSchema,\n} from \"xstate\";\n\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n type InternalApi,\n} from \"@api/device-action/DeviceAction\";\nimport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nimport { type DmkError } from \"@api/Error\";\n\nimport { type StateMachineTypes } from \"./StateMachineTypes\";\n\nexport type DeviceActionStateMachine<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n InternalState,\n> = StateMachine<\n StateMachineTypes<\n Output,\n Input,\n Error,\n IntermediateValue,\n InternalState\n >[\"context\"], // context\n /**\n * The following usages `any` are OK because this is just a wrapper around the\n * state machine and we are not directly going to use these types.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n any, // event\n any, // children\n any, // actor\n any, // action\n any, // guard\n any, // delay\n any, // state value\n any, // tag\n /* eslint-enable @typescript-eslint/no-explicit-any */\n StateMachineTypes<\n Output,\n Input,\n Error,\n IntermediateValue,\n InternalState\n >[\"input\"],\n StateMachineTypes<\n Output,\n Input,\n Error,\n IntermediateValue,\n InternalState\n >[\"output\"],\n /* eslint-disable @typescript-eslint/no-explicit-any */\n any,\n any,\n /* eslint-enable @typescript-eslint/no-explicit-any */\n StateSchema\n>;\n\n/**\n * A DeviceAction that uses an XState state machine to execute.\n * It maps the state machine snapshots to the DeviceActionState.\n * This class is abstract and should be extended to implement the state machine.\n */\nexport abstract class XStateDeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n InternalState,\n> implements DeviceAction<Output, Input, Error, IntermediateValue>\n{\n readonly input: Input;\n readonly inspect: boolean = false;\n\n /**\n *\n * @param input The input for the DeviceAction\n * @param inspect If true, the state machine will be inspected in the browser\n */\n constructor(args: { input: Input; inspect?: boolean }) {\n this.input = args.input;\n this.inspect = Boolean(args.inspect);\n }\n\n protected abstract makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n Output,\n Input,\n Error,\n IntermediateValue,\n InternalState\n >;\n\n _execute(\n internalApi: InternalApi,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> {\n const stateMachine = this.makeStateMachine(internalApi);\n\n const actor = createActor(stateMachine, {\n input: this.input,\n // optional inspector for debugging\n // inspect: this.inspect ? createBrowserInspector().inspect : undefined,\n });\n\n /**\n * Using a ReplaySubject is important because the first snapshots might be\n * emitted before the observable is subscribed (if the machine goes through\n * those states fully synchronously).\n * This way, we ensure that the subscriber always receives the latest snapshot.\n * */\n const subject = new ReplaySubject<\n DeviceActionState<Output, Error, IntermediateValue>\n >();\n\n const handleActorSnapshot = (\n snapshot: SnapshotFrom<typeof stateMachine>,\n ) => {\n const { context, status, output, error } = snapshot;\n switch (status) {\n case \"active\":\n subject.next({\n status: DeviceActionStatus.Pending,\n intermediateValue: context.intermediateValue,\n });\n break;\n case \"done\":\n output.caseOf({\n Left: (err) => {\n subject.next({\n status: DeviceActionStatus.Error,\n error: err,\n });\n },\n Right: (result) => {\n subject.next({\n status: DeviceActionStatus.Completed,\n output: result,\n });\n },\n });\n subject.complete();\n break;\n case \"error\":\n // this is an error in the execution of the state machine, it should not happen\n subject.error(error);\n subject.complete();\n break;\n case \"stopped\":\n subject.next({\n status: DeviceActionStatus.Stopped,\n });\n subject.complete();\n break;\n default:\n this._exhaustiveMatchingGuard(status);\n }\n };\n\n const observable = new Observable<\n DeviceActionState<Output, Error, IntermediateValue>\n >((subscriber) => {\n const subjectSubscription = subject.subscribe(subscriber);\n return () => {\n actorSubscription.unsubscribe();\n subjectSubscription.unsubscribe();\n actor.stop(); // stop the actor when the observable is unsubscribed\n };\n });\n\n const actorSubscription = actor.subscribe(handleActorSnapshot);\n actor.start();\n\n return {\n observable: observable.pipe(share()), // share to garantee that once there is no more observer, the actor is stopped\n cancel: () => {\n actor.stop();\n actorSubscription.unsubscribe();\n handleActorSnapshot(actor.getSnapshot());\n },\n };\n }\n\n private _exhaustiveMatchingGuard(status: never): never {\n console.log(\"_exhaustiveMatchingGuard status\", status);\n throw new Error(`Unhandled status: ${status}`);\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAAiD,gBACjDC,EAKO,kBAQPC,EAGO,sDA2DA,MAAeJ,CAOtB,CACW,MACA,QAAmB,GAO5B,YAAYK,EAA2C,CACrD,KAAK,MAAQA,EAAK,MAClB,KAAK,QAAU,EAAQA,EAAK,OAC9B,CAYA,SACEC,EACiE,CACjE,MAAMC,EAAe,KAAK,i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,CAC/C,CACF",
6
+ "names": ["XStateDeviceAction_exports", "__export", "XStateDeviceAction", "__toCommonJS", "import_rxjs", "import_xstate", "import_DeviceActionState", "args", "internalApi", "stateMachine", "actor", "subject", "handleActorSnapshot", "snapshot", "context", "status", "output", "error", "err", "result", "observable", "subscriber", "subjectSubscription", "actorSubscription"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(a,e)=>{for(var r in e)o(a,r,{get:e[r],enumerable:!0})},S=(a,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of y(e))!p.call(a,n)&&n!==r&&o(a,n,{get:()=>e[n],enumerable:!(t=i(e,n))||t.enumerable});return a};var l=a=>S(o({},"__esModule",{value:!0}),a);var u={};d(u,{DeviceSessionStateType:()=>s});module.exports=l(u);var s=(t=>(t[t.Connected=0]="Connected",t[t.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",t[t.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",t))(s||{});0&&(module.exports={DeviceSessionStateType});
1
+ "use strict";var o=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(a,e)=>{for(var r in e)o(a,r,{get:e[r],enumerable:!0})},l=(a,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of y(e))!p.call(a,n)&&n!==r&&o(a,n,{get:()=>e[n],enumerable:!(t=i(e,n))||t.enumerable});return a};var S=a=>l(o({},"__esModule",{value:!0}),a);var u={};d(u,{DeviceSessionStateType:()=>s});module.exports=S(u);var s=(t=>(t[t.Connected=0]="Connected",t[t.ReadyWithoutSecureChannel=1]="ReadyWithoutSecureChannel",t[t.ReadyWithSecureChannel=2]="ReadyWithSecureChannel",t))(s||{});0&&(module.exports={DeviceSessionStateType});
2
2
  //# sourceMappingURL=DeviceSessionState.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/api/device-session/DeviceSessionState.ts"],
4
- "sourcesContent": ["import { type GetAppAndVersionResponse } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { type BatteryStatusFlags } from \"@api/command/os/GetBatteryStatusCommand\";\nimport { type DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\n\n/**\n * The battery status of a device.\n */\nexport type BatteryStatus = {\n readonly level: number;\n readonly voltage: number;\n readonly temperature: number;\n readonly current: number;\n readonly status: BatteryStatusFlags;\n};\n\n/**\n * The firmware version of a device.\n */\nexport type FirmwareVersion = {\n /**\n * Microcontroller Unit version\n */\n readonly mcu: string;\n\n /**\n * Bootloader version\n */\n readonly bootloader: string;\n\n /**\n * Operating System version\n */\n readonly os: string;\n};\n\n/**\n * The current application running on a device. Alias of GetAppAndVersionResponse.\n */\nexport type RunningApp = GetAppAndVersionResponse;\n\n/**\n * The state types of a device session.\n */\nexport enum DeviceSessionStateType {\n Connected,\n ReadyWithoutSecureChannel,\n ReadyWithSecureChannel,\n}\n\ntype DeviceSessionBaseState = {\n readonly sessionStateType: DeviceSessionStateType;\n\n /**\n * The status of the device.\n */\n readonly deviceStatus: DeviceStatus;\n\n /**\n * The name of the device.\n */\n readonly deviceName?: string;\n};\n\ntype DeviceSessionReadyState = {\n /**\n * The battery status of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly batteryStatus?: BatteryStatus;\n\n /**\n * The firmware version of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly firmwareVersion?: FirmwareVersion;\n\n /**\n * The current application running on the device.\n */\n readonly currentApp: RunningApp;\n\n /**\n * The current applications installed on the device.\n */\n readonly installedApps: Application[];\n};\n\n/**\n * The state of a connected device session.\n */\nexport type ConnectedState = DeviceSessionBaseState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.Connected;\n};\n\n/**\n * The state of a device session when it is ready without a secure channel.\n */\nexport type ReadyWithoutSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel;\n };\n\n/**\n * The state of a device session when it is ready with a secure channel.\n */\nexport type ReadyWithSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithSecureChannel;\n };\n\n/**\n * The state of a device session.\n */\nexport type DeviceSessionState =\n | ConnectedState\n | ReadyWithoutSecureChannelState\n | ReadyWithSecureChannelState;\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GA4CO,IAAKE,OACVA,IAAA,yBACAA,IAAA,yDACAA,IAAA,mDAHUA,OAAA",
4
+ "sourcesContent": ["import { type GetAppAndVersionResponse } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { type BatteryStatusFlags } from \"@api/command/os/GetBatteryStatusCommand\";\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\n\n/**\n * The battery status of a device.\n */\nexport type BatteryStatus = {\n readonly level: number;\n readonly voltage: number;\n readonly temperature: number;\n readonly current: number;\n readonly status: BatteryStatusFlags;\n};\n\n/**\n * The firmware version of a device.\n */\nexport type FirmwareVersion = {\n /**\n * Microcontroller Unit version\n */\n readonly mcu: string;\n\n /**\n * Bootloader version\n */\n readonly bootloader: string;\n\n /**\n * Operating System version\n */\n readonly os: string;\n};\n\n/**\n * The current application running on a device. Alias of GetAppAndVersionResponse.\n */\nexport type RunningApp = GetAppAndVersionResponse;\n\n/**\n * The state types of a device session.\n */\nexport enum DeviceSessionStateType {\n Connected,\n ReadyWithoutSecureChannel,\n ReadyWithSecureChannel,\n}\n\ntype DeviceSessionBaseState = {\n readonly sessionStateType: DeviceSessionStateType;\n\n /**\n * The status of the device.\n */\n readonly deviceStatus: DeviceStatus;\n\n /**\n * The model of the device.\n */\n readonly deviceModelId: DeviceModelId;\n\n /**\n * The name of the device.\n */\n readonly deviceName?: string;\n};\n\ntype DeviceSessionReadyState = {\n /**\n * The battery status of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly batteryStatus?: BatteryStatus;\n\n /**\n * The firmware version of the device.\n * TODO: This should not be optional, but it is not in the current implementation.\n */\n readonly firmwareVersion?: FirmwareVersion;\n\n /**\n * The current application running on the device.\n */\n readonly currentApp: RunningApp;\n\n /**\n * The current applications installed on the device.\n */\n readonly installedApps: Application[];\n};\n\n/**\n * The state of a connected device session.\n */\nexport type ConnectedState = DeviceSessionBaseState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.Connected;\n};\n\n/**\n * The state of a device session when it is ready without a secure channel.\n */\nexport type ReadyWithoutSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel;\n };\n\n/**\n * The state of a device session when it is ready with a secure channel.\n */\nexport type ReadyWithSecureChannelState = DeviceSessionBaseState &\n DeviceSessionReadyState & {\n /**\n * The type of the device session state.\n */\n readonly sessionStateType: DeviceSessionStateType.ReadyWithSecureChannel;\n };\n\n/**\n * The state of a device session.\n */\nexport type DeviceSessionState =\n | ConnectedState\n | ReadyWithoutSecureChannelState\n | ReadyWithSecureChannelState;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GA6CO,IAAKE,OACVA,IAAA,yBACAA,IAAA,yDACAA,IAAA,mDAHUA,OAAA",
6
6
  "names": ["DeviceSessionState_exports", "__export", "DeviceSessionStateType", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=require("../../../internal/device-session/model/DeviceSession.stub"),a=require("../../../internal/device-session/model/Errors"),l=require("../../../internal/device-session/service/DefaultDeviceSessionService"),f=require("../../../internal/logger-publisher/service/DefaultLoggerPublisherService"),S=require("../../../internal/manager-api/data/AxiosManagerApiDataSource"),p=require("../../../internal/manager-api/service/DefaultManagerApiService"),t=require("./ToggleDeviceSessionRefresher");let e,s,r,i,c;describe("ToggleDeviceSessionRefresherUseCase",()=>{beforeEach(()=>{e=new f.DefaultLoggerPublisherService([],"get-connected-device-use-case-test"),s=new l.DefaultDeviceSessionService(()=>e),c=new p.DefaultManagerApiService(new S.AxiosManagerApiDataSource({managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url"}))}),afterEach(()=>{jest.clearAllMocks()}),describe("execute",()=>{it("should toggle the device session refresher",()=>{i=(0,n.deviceSessionStubBuilder)({id:"fakeSessionId"},()=>e,c),s.addDeviceSession(i),r=new t.ToggleDeviceSessionRefresherUseCase(s,()=>e);const o=jest.spyOn(i,"toggleRefresher");r.execute({sessionId:"fakeSessionId",enabled:!1}),expect(o).toHaveBeenCalledWith(!1),i.close()}),it("should throw error when deviceSession is not found",()=>{r=new t.ToggleDeviceSessionRefresherUseCase(s,()=>e);try{r.execute({sessionId:"fakeSessionId",enabled:!1})}catch(o){expect(o).toBeInstanceOf(a.DeviceSessionNotFound)}})})});
1
+ "use strict";var a=require("../../../internal/device-session/model/DeviceSession.stub"),l=require("../../../internal/device-session/model/Errors"),f=require("../../../internal/device-session/service/DefaultDeviceSessionService"),S=require("../../../internal/logger-publisher/service/DefaultLoggerPublisherService"),m=require("../../../internal/manager-api/data/AxiosManagerApiDataSource"),v=require("../../../internal/manager-api/service/DefaultManagerApiService"),p=require("../../../internal/secure-channel/data/DefaultSecureChannelDataSource"),g=require("../../../internal/secure-channel/service/DefaultSecureChannelService"),t=require("./ToggleDeviceSessionRefresher");let e,r,i,o,n,c;describe("ToggleDeviceSessionRefresherUseCase",()=>{beforeEach(()=>{e=new S.DefaultLoggerPublisherService([],"get-connected-device-use-case-test"),r=new f.DefaultDeviceSessionService(()=>e),n=new v.DefaultManagerApiService(new m.AxiosManagerApiDataSource({})),c=new g.DefaultSecureChannelService(new p.DefaultSecureChannelDataSource({}))}),afterEach(()=>{vi.clearAllMocks()}),describe("execute",()=>{it("should toggle the device session refresher",()=>{o=(0,a.deviceSessionStubBuilder)({id:"fakeSessionId"},()=>e,n,c),r.addDeviceSession(o),i=new t.ToggleDeviceSessionRefresherUseCase(r,()=>e);const s=vi.spyOn(o,"toggleRefresher");i.execute({sessionId:"fakeSessionId",enabled:!1}),expect(s).toHaveBeenCalledWith(!1),o.close()}),it("should throw error when deviceSession is not found",()=>{i=new t.ToggleDeviceSessionRefresherUseCase(r,()=>e);try{i.execute({sessionId:"fakeSessionId",enabled:!1})}catch(s){expect(s).toBeInstanceOf(l.DeviceSessionNotFound)}})})});
2
2
  //# sourceMappingURL=ToggleDeviceSessionRefresher.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.ts"],
4
- "sourcesContent": ["import { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { ToggleDeviceSessionRefresherUseCase } from \"./ToggleDeviceSessionRefresher\";\n\nlet logger: LoggerPublisherService;\nlet sessionService: DeviceSessionService;\nlet useCase: ToggleDeviceSessionRefresherUseCase;\nlet deviceSession: DeviceSession;\nlet managerApi: ManagerApiService;\ndescribe(\"ToggleDeviceSessionRefresherUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService(\n [],\n \"get-connected-device-use-case-test\",\n );\n sessionService = new DefaultDeviceSessionService(() => logger);\n managerApi = new DefaultManagerApiService(\n new AxiosManagerApiDataSource({\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n }),\n );\n });\n\n afterEach(() => {\n jest.clearAllMocks();\n });\n\n describe(\"execute\", () => {\n it(\"should toggle the device session refresher\", () => {\n // given\n deviceSession = deviceSessionStubBuilder(\n { id: \"fakeSessionId\" },\n () => logger,\n managerApi,\n );\n sessionService.addDeviceSession(deviceSession);\n useCase = new ToggleDeviceSessionRefresherUseCase(\n sessionService,\n () => logger,\n );\n\n const spy = jest.spyOn(deviceSession, \"toggleRefresher\");\n\n // when\n useCase.execute({ sessionId: \"fakeSessionId\", enabled: false });\n\n // then\n expect(spy).toHaveBeenCalledWith(false);\n deviceSession.close();\n });\n\n it(\"should throw error when deviceSession is not found\", () => {\n // given\n useCase = new ToggleDeviceSessionRefresherUseCase(\n sessionService,\n () => logger,\n );\n\n // when\n try {\n useCase.execute({ sessionId: \"fakeSessionId\", enabled: false });\n } catch (error) {\n // then\n expect(error).toBeInstanceOf(DeviceSessionNotFound);\n }\n });\n });\n});\n"],
5
- "mappings": "aAEA,IAAAA,EAAyC,6DACzCC,EAAsC,iDACtCC,EAA4C,wEAE5CC,EAA8C,4EAC9CC,EAA0C,gEAC1CC,EAAyC,kEAGzCC,EAAoD,0CAEpD,IAAIC,EACAC,EACAC,EACAC,EACAC,EACJ,SAAS,sCAAuC,IAAM,CACpD,WAAW,IAAM,CACfJ,EAAS,IAAI,gCACX,CAAC,EACD,oCACF,EACAC,EAAiB,IAAI,8BAA4B,IAAMD,CAAM,EAC7DI,EAAa,IAAI,2BACf,IAAI,4BAA0B,CAC5B,cAAe,kBACf,QAAS,sBACX,CAAC,CACH,CACF,CAAC,EAED,UAAU,IAAM,CACd,KAAK,cAAc,CACrB,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,GAAG,6CAA8C,IAAM,CAErDD,KAAgB,4BACd,CAAE,GAAI,eAAgB,EACtB,IAAMH,EACNI,CACF,EACAH,EAAe,iBAAiBE,CAAa,EAC7CD,EAAU,IAAI,sCACZD,EACA,IAAMD,CACR,EAEA,MAAMK,EAAM,KAAK,MAAMF,EAAe,iBAAiB,EAGvDD,EAAQ,QAAQ,CAAE,UAAW,gBAAiB,QAAS,EAAM,CAAC,EAG9D,OAAOG,CAAG,EAAE,qBAAqB,EAAK,EACtCF,EAAc,MAAM,CACtB,CAAC,EAED,GAAG,qDAAsD,IAAM,CAE7DD,EAAU,IAAI,sCACZD,EACA,IAAMD,CACR,EAGA,GAAI,CACFE,EAAQ,QAAQ,CAAE,UAAW,gBAAiB,QAAS,EAAM,CAAC,CAChE,OAASI,EAAO,CAEd,OAAOA,CAAK,EAAE,eAAe,uBAAqB,CACpD,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["import_DeviceSession", "import_Errors", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_ToggleDeviceSessionRefresher", "logger", "sessionService", "useCase", "deviceSession", "managerApi", "spy", "error"]
4
+ "sourcesContent": ["import { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { ToggleDeviceSessionRefresherUseCase } from \"./ToggleDeviceSessionRefresher\";\n\nlet logger: LoggerPublisherService;\nlet sessionService: DeviceSessionService;\nlet useCase: ToggleDeviceSessionRefresherUseCase;\nlet deviceSession: DeviceSession;\nlet managerApi: ManagerApiService;\nlet secureChannel: SecureChannelService;\ndescribe(\"ToggleDeviceSessionRefresherUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService(\n [],\n \"get-connected-device-use-case-test\",\n );\n sessionService = new DefaultDeviceSessionService(() => logger);\n managerApi = new DefaultManagerApiService(\n new AxiosManagerApiDataSource({} as DmkConfig),\n );\n secureChannel = new DefaultSecureChannelService(\n new DefaultSecureChannelDataSource({} as DmkConfig),\n );\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n });\n\n describe(\"execute\", () => {\n it(\"should toggle the device session refresher\", () => {\n // given\n deviceSession = deviceSessionStubBuilder(\n { id: \"fakeSessionId\" },\n () => logger,\n managerApi,\n secureChannel,\n );\n sessionService.addDeviceSession(deviceSession);\n useCase = new ToggleDeviceSessionRefresherUseCase(\n sessionService,\n () => logger,\n );\n\n const spy = vi.spyOn(deviceSession, \"toggleRefresher\");\n\n // when\n useCase.execute({ sessionId: \"fakeSessionId\", enabled: false });\n\n // then\n expect(spy).toHaveBeenCalledWith(false);\n deviceSession.close();\n });\n\n it(\"should throw error when deviceSession is not found\", () => {\n // given\n useCase = new ToggleDeviceSessionRefresherUseCase(\n sessionService,\n () => logger,\n );\n\n // when\n try {\n useCase.execute({ sessionId: \"fakeSessionId\", enabled: false });\n } catch (error) {\n // then\n expect(error).toBeInstanceOf(DeviceSessionNotFound);\n }\n });\n });\n});\n"],
5
+ "mappings": "aAGA,IAAAA,EAAyC,6DACzCC,EAAsC,iDACtCC,EAA4C,wEAE5CC,EAA8C,4EAC9CC,EAA0C,gEAC1CC,EAAyC,kEAEzCC,EAA+C,wEAC/CC,EAA4C,wEAG5CC,EAAoD,0CAEpD,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,SAAS,sCAAuC,IAAM,CACpD,WAAW,IAAM,CACfL,EAAS,IAAI,gCACX,CAAC,EACD,oCACF,EACAC,EAAiB,IAAI,8BAA4B,IAAMD,CAAM,EAC7DI,EAAa,IAAI,2BACf,IAAI,4BAA0B,CAAC,CAAc,CAC/C,EACAC,EAAgB,IAAI,8BAClB,IAAI,iCAA+B,CAAC,CAAc,CACpD,CACF,CAAC,EAED,UAAU,IAAM,CACd,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,GAAG,6CAA8C,IAAM,CAErDF,KAAgB,4BACd,CAAE,GAAI,eAAgB,EACtB,IAAMH,EACNI,EACAC,CACF,EACAJ,EAAe,iBAAiBE,CAAa,EAC7CD,EAAU,IAAI,sCACZD,EACA,IAAMD,CACR,EAEA,MAAMM,EAAM,GAAG,MAAMH,EAAe,iBAAiB,EAGrDD,EAAQ,QAAQ,CAAE,UAAW,gBAAiB,QAAS,EAAM,CAAC,EAG9D,OAAOI,CAAG,EAAE,qBAAqB,EAAK,EACtCH,EAAc,MAAM,CACtB,CAAC,EAED,GAAG,qDAAsD,IAAM,CAE7DD,EAAU,IAAI,sCACZD,EACA,IAAMD,CACR,EAGA,GAAI,CACFE,EAAQ,QAAQ,CAAE,UAAW,gBAAiB,QAAS,EAAM,CAAC,CAChE,OAASK,EAAO,CAEd,OAAOA,CAAK,EAAE,eAAe,uBAAqB,CACpD,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_DeviceSession", "import_Errors", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_ToggleDeviceSessionRefresher", "logger", "sessionService", "useCase", "deviceSession", "managerApi", "secureChannel", "spy", "error"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var A=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var pe=(t,o)=>{for(var p in o)A(t,p,{get:o[p],enumerable:!0})},d=(t,o,p,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of oe(o))!te.call(t,s)&&s!==p&&A(t,s,{get:()=>o[s],enumerable:!(u=re(o,s))||u.enumerable});return t},r=(t,o,p)=>(d(t,o,"default"),p&&d(p,o,"default"));var me=t=>d(A({},"__esModule",{value:!0}),t);var e={};pe(e,{APDU_MAX_PAYLOAD:()=>a.APDU_MAX_PAYLOAD,Apdu:()=>D.Apdu,ApduBuilder:()=>a.ApduBuilder,ApduParser:()=>S.ApduParser,ApduResponse:()=>X.ApduResponse,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>F.BleDeviceInfos,ByteArrayBuilder:()=>v.ByteArrayBuilder,ByteArrayParser:()=>l.ByteArrayParser,CloseAppCommand:()=>C.CloseAppCommand,CommandResultFactory:()=>m.CommandResultFactory,CommandResultStatus:()=>m.CommandResultStatus,CommandUtils:()=>E.CommandUtils,ConnectedDevice:()=>Z.ConnectedDevice,ConsoleLogger:()=>J.ConsoleLogger,DeviceActionStatus:()=>M.DeviceActionStatus,DeviceManagementKit:()=>Y.DeviceManagementKit,DeviceManagementKitBuilder:()=>j.DeviceManagementKitBuilder,DeviceModel:()=>i.DeviceModel,DeviceModelId:()=>i.DeviceModelId,DeviceSessionStateType:()=>k.DeviceSessionStateType,DeviceStatus:()=>b.DeviceStatus,FramerUtils:()=>N.FramerUtils,GetAppAndVersionCommand:()=>g.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceStatusDeviceAction:()=>O.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>B.GetOsVersionCommand,GlobalCommandError:()=>x.GlobalCommandError,GlobalCommandErrorHandler:()=>x.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>U.GoToDashboardDeviceAction,InvalidStatusWordError:()=>y.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>i.LEDGER_VENDOR_ID,ListAppsCommand:()=>L.ListAppsCommand,ListAppsDeviceAction:()=>V.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>h.ListAppsWithMetadataDeviceAction,LogLevel:()=>z.LogLevel,OpenAppCommand:()=>G.OpenAppCommand,OpenAppDeviceAction:()=>P.OpenAppDeviceAction,SendCommandInAppDeviceAction:()=>_.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>W.StaticDeviceModelDataSource,TransportConnectedDevice:()=>$.TransportConnectedDevice,TransportDeviceModel:()=>K.TransportDeviceModel,UnknownDAError:()=>I.UnknownDAError,UserInteractionRequired:()=>T.UserInteractionRequired,WebLogsExporterLogger:()=>Q.WebLogsExporterLogger,XStateDeviceAction:()=>H.XStateDeviceAction,base64StringToBuffer:()=>c.base64StringToBuffer,bufferToHexaString:()=>n.bufferToHexaString,connectedDeviceStubBuilder:()=>ee.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>q.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>w.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>n.hexaStringToBuffer,isBase64String:()=>c.isBase64String,isCommandErrorCode:()=>R.isCommandErrorCode,isHexaString:()=>n.isHexaString,isSuccessCommandResult:()=>m.isSuccessCommandResult});module.exports=me(e);var D=require("./apdu/model/Apdu"),a=require("./apdu/utils/ApduBuilder"),S=require("./apdu/utils/ApduParser");r(e,require("./apdu/utils/AppBuilderError"),module.exports);var v=require("./apdu/utils/ByteArrayBuilder"),l=require("./apdu/utils/ByteArrayParser"),y=require("./command/Errors"),m=require("./command/model/CommandResult"),C=require("./command/os/CloseAppCommand"),g=require("./command/os/GetAppAndVersionCommand"),f=require("./command/os/GetBatteryStatusCommand"),B=require("./command/os/GetOsVersionCommand"),L=require("./command/os/ListAppsCommand"),G=require("./command/os/OpenAppCommand"),R=require("./command/utils/CommandErrors"),E=require("./command/utils/CommandUtils"),x=require("./command/utils/GlobalCommandError"),i=require("./device/DeviceModel"),b=require("./device/DeviceStatus"),M=require("./device-action/model/DeviceActionState"),T=require("./device-action/model/UserInteractionRequired"),I=require("./device-action/os/Errors"),O=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),U=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),V=require("./device-action/os/ListApps/ListAppsDeviceAction"),h=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),P=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),_=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),H=require("./device-action/xstate-utils/XStateDeviceAction"),W=require("./device-model/data/StaticDeviceModelDataSource"),F=require("./device-model/model/BleDeviceInfos"),K=require("./device-model/model/DeviceModel"),X=require("./device-session/ApduResponse");r(e,require("./device-session/data/FramerConst"),module.exports);var k=require("./device-session/DeviceSessionState"),q=require("./device-session/service/DefaultApduReceiverService.stub"),w=require("./device-session/service/DefaultApduSenderService.stub"),N=require("./device-session/utils/FramerUtils"),Y=require("./DeviceManagementKit"),j=require("./DeviceManagementKitBuilder");r(e,require("./Error"),module.exports);var z=require("./logger-subscriber/model/LogLevel"),J=require("./logger-subscriber/service/ConsoleLogger"),Q=require("./logger-subscriber/service/WebLogsExporterLogger"),Z=require("./transport/model/ConnectedDevice");r(e,require("./transport/model/Errors"),module.exports);var $=require("./transport/model/TransportConnectedDevice"),ee=require("./transport/model/TransportConnectedDevice.stub");r(e,require("./types"),module.exports);var c=require("./utils/Base64String"),n=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,LogLevel,OpenAppCommand,OpenAppDeviceAction,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UnknownDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
1
+ "use strict";var A=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var ie=Object.prototype.hasOwnProperty;var ne=(t,r)=>{for(var p in r)A(t,p,{get:r[p],enumerable:!0})},d=(t,r,p,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of me(r))!ie.call(t,a)&&a!==p&&A(t,a,{get:()=>r[a],enumerable:!(u=pe(r,a))||u.enumerable});return t},o=(t,r,p)=>(d(t,r,"default"),p&&d(p,r,"default"));var ae=t=>d(A({},"__esModule",{value:!0}),t);var e={};ne(e,{APDU_MAX_PAYLOAD:()=>s.APDU_MAX_PAYLOAD,Apdu:()=>D.Apdu,ApduBuilder:()=>s.ApduBuilder,ApduParser:()=>S.ApduParser,ApduResponse:()=>q.ApduResponse,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>K.BleDeviceInfos,ByteArrayBuilder:()=>v.ByteArrayBuilder,ByteArrayParser:()=>l.ByteArrayParser,CallTaskInAppDeviceAction:()=>O.CallTaskInAppDeviceAction,CloseAppCommand:()=>y.CloseAppCommand,CommandResultFactory:()=>m.CommandResultFactory,CommandResultStatus:()=>m.CommandResultStatus,CommandUtils:()=>M.CommandUtils,ConnectedDevice:()=>ee.ConnectedDevice,ConsoleLogger:()=>Z.ConsoleLogger,DeviceActionStatus:()=>T.DeviceActionStatus,DeviceConnectionStateMachine:()=>oe.DeviceConnectionStateMachine,DeviceManagementKit:()=>z.DeviceManagementKit,DeviceManagementKitBuilder:()=>J.DeviceManagementKitBuilder,DeviceModel:()=>i.DeviceModel,DeviceModelId:()=>i.DeviceModelId,DeviceSessionStateType:()=>w.DeviceSessionStateType,DeviceStatus:()=>b.DeviceStatus,FramerUtils:()=>j.FramerUtils,GetAppAndVersionCommand:()=>g.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceStatusDeviceAction:()=>U.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>B.GetOsVersionCommand,GlobalCommandError:()=>x.GlobalCommandError,GlobalCommandErrorHandler:()=>x.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>V.GoToDashboardDeviceAction,InvalidStatusWordError:()=>C.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>i.LEDGER_VENDOR_ID,ListAppsCommand:()=>L.ListAppsCommand,ListAppsDeviceAction:()=>P.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>_.ListAppsWithMetadataDeviceAction,LoadCertificateCommand:()=>G.LoadCertificateCommand,LogLevel:()=>Q.LogLevel,OpenAppCommand:()=>R.OpenAppCommand,OpenAppDeviceAction:()=>H.OpenAppDeviceAction,SendCommandInAppDeviceAction:()=>W.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>F.StaticDeviceModelDataSource,TransportConnectedDevice:()=>re.TransportConnectedDevice,TransportDeviceModel:()=>X.TransportDeviceModel,UnknownDAError:()=>h.UnknownDAError,UserInteractionRequired:()=>I.UserInteractionRequired,WebLogsExporterLogger:()=>$.WebLogsExporterLogger,XStateDeviceAction:()=>k.XStateDeviceAction,base64StringToBuffer:()=>c.base64StringToBuffer,bufferToHexaString:()=>n.bufferToHexaString,connectedDeviceStubBuilder:()=>te.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>N.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>Y.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>n.hexaStringToBuffer,isBase64String:()=>c.isBase64String,isCommandErrorCode:()=>E.isCommandErrorCode,isHexaString:()=>n.isHexaString,isSuccessCommandResult:()=>m.isSuccessCommandResult});module.exports=ae(e);var D=require("./apdu/model/Apdu"),s=require("./apdu/utils/ApduBuilder"),S=require("./apdu/utils/ApduParser");o(e,require("./apdu/utils/AppBuilderError"),module.exports);var v=require("./apdu/utils/ByteArrayBuilder"),l=require("./apdu/utils/ByteArrayParser"),C=require("./command/Errors"),m=require("./command/model/CommandResult"),y=require("./command/os/CloseAppCommand"),g=require("./command/os/GetAppAndVersionCommand"),f=require("./command/os/GetBatteryStatusCommand"),B=require("./command/os/GetOsVersionCommand"),L=require("./command/os/ListAppsCommand"),G=require("./command/os/LoadCertificateCommand"),R=require("./command/os/OpenAppCommand"),E=require("./command/utils/CommandErrors"),M=require("./command/utils/CommandUtils"),x=require("./command/utils/GlobalCommandError"),i=require("./device/DeviceModel"),b=require("./device/DeviceStatus"),T=require("./device-action/model/DeviceActionState"),I=require("./device-action/model/UserInteractionRequired"),O=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),h=require("./device-action/os/Errors"),U=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),V=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),P=require("./device-action/os/ListApps/ListAppsDeviceAction"),_=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),H=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),W=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),k=require("./device-action/xstate-utils/XStateDeviceAction"),F=require("./device-model/data/StaticDeviceModelDataSource"),K=require("./device-model/model/BleDeviceInfos"),X=require("./device-model/model/DeviceModel"),q=require("./device-session/ApduResponse");o(e,require("./device-session/data/FramerConst"),module.exports);var w=require("./device-session/DeviceSessionState"),N=require("./device-session/service/DefaultApduReceiverService.stub"),Y=require("./device-session/service/DefaultApduSenderService.stub"),j=require("./device-session/utils/FramerUtils"),z=require("./DeviceManagementKit"),J=require("./DeviceManagementKitBuilder");o(e,require("./Error"),module.exports);var Q=require("./logger-subscriber/model/LogLevel"),Z=require("./logger-subscriber/service/ConsoleLogger"),$=require("./logger-subscriber/service/WebLogsExporterLogger"),ee=require("./transport/model/ConnectedDevice"),oe=require("./transport/model/DeviceConnectionStateMachine");o(e,require("./transport/model/Errors"),module.exports);var re=require("./transport/model/TransportConnectedDevice"),te=require("./transport/model/TransportConnectedDevice.stub");o(e,require("./types"),module.exports);var c=require("./utils/Base64String"),n=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceConnectionStateMachine,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UnknownDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/index.ts"],
4
- "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { UnknownDAError } from \"@api/device-action/os/Errors\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
- "mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,u/EAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAAuC,+BACvCC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCd,EAA+B,wCAC/Be,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BZ,EAAqC,+CACrCa,EAA6B,4CAC7B3B,EAAAN,EAAc,gDAxEd,gBAyEA,IAAAkC,EAGO,kDAEPC,EAAsD,uEACtDC,EAAoD,qEACpDC,EAA4B,iDAC5BC,EAAoC,oCACpCC,EAA2C,2CAC3CjC,EAAAN,EAAc,sBAnFd,gBAoFA,IAAAwC,EAAyB,iDACzBC,EAA8B,wDAC9BC,EAAsC,gEACtCC,EAAgC,gDAChCrC,EAAAN,EAAc,uCAxFd,gBAyFA,IAAA4C,EAAyC,yDACzCA,GAA2C,8DAC3CtC,EAAAN,EAAc,sBA3Fd,gBA4FA,IAAA6C,EAAqD,mCACrDC,EAIO",
6
- "names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_TransportConnectedDevice", "import_Base64String", "import_HexaString"]
4
+ "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { UnknownDAError } from \"@api/device-action/os/Errors\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport { DeviceConnectionStateMachine } from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
+ "mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,wqFAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAAuC,+BACvCC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1ChB,EAA+B,wCAC/BiB,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/Bb,EAAqC,+CACrCc,EAA6B,4CAC7B7B,EAAAN,EAAc,gDA9Ed,gBA+EA,IAAAoC,EAGO,kDAEPC,EAAsD,uEACtDC,EAAoD,qEACpDC,EAA4B,iDAC5BC,EAAoC,oCACpCC,EAA2C,2CAC3CnC,EAAAN,EAAc,sBAzFd,gBA0FA,IAAA0C,EAAyB,iDACzBC,EAA8B,wDAC9BC,EAAsC,gEACtCC,GAAgC,gDAChCC,GAA6C,6DAC7CxC,EAAAN,EAAc,uCA/Fd,gBAgGA,IAAA+C,GAAyC,yDACzCA,GAA2C,8DAC3CzC,EAAAN,EAAc,sBAlGd,gBAmGA,IAAAgD,EAAqD,mCACrDC,EAIO",
6
+ "names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_Base64String", "import_HexaString"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("../../logger-subscriber/model/LogLevel"),g=require("./ConsoleLogger");const d=jest.spyOn(console,"warn").mockImplementation(jest.fn()),n=jest.spyOn(console,"info").mockImplementation(jest.fn()),r=jest.spyOn(console,"debug").mockImplementation(jest.fn()),a=jest.spyOn(console,"error").mockImplementation(jest.fn()),i=jest.spyOn(console,"log").mockImplementation(jest.fn());let o;const e={data:{key:"value"},timestamp:1,tag:"tag"},l="message";describe("ConsoleLogger",()=>{afterAll(()=>{jest.restoreAllMocks()}),describe("default level (LogLevel.DEBUG)",()=>{beforeEach(()=>{jest.clearAllMocks(),o=new g.ConsoleLogger}),describe("log",()=>{it("should log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Info level with a custom tag",()=>{const s="custom-tag";o.log(t.LogLevel.Info,l,{...e,tag:s}),expect(n).toHaveBeenCalledWith(`[${s}]`,l,e.data)}),it("should log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(i).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})}),describe("custom level (LogLevel.Info)",()=>{beforeEach(()=>{jest.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Info)}),describe("log",()=>{it("should log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Info level with a custom tag",()=>{const s="custom-tag";o.log(t.LogLevel.Info,l,{...e,tag:s}),expect(n).toHaveBeenCalledWith(`[${s}]`,l,e.data)}),it("should log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(i).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})}),describe("custom level (LogLevel.Warning)",()=>{beforeEach(()=>{jest.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Warning)}),describe("log",()=>{it("should not log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).not.toHaveBeenCalled()}),it("should log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(i).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})}),describe("custom level (LogLevel.Error)",()=>{beforeEach(()=>{jest.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Error)}),describe("log",()=>{it("should not log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).not.toHaveBeenCalled()}),it("should not log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).not.toHaveBeenCalled()}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(i).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})}),describe("custom level (LogLevel.Fatal)",()=>{beforeEach(()=>{jest.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Fatal)}),describe("log",()=>{it("should not log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).not.toHaveBeenCalled()}),it("should not log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).not.toHaveBeenCalled()}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})})});
1
+ "use strict";var t=require("../../logger-subscriber/model/LogLevel"),g=require("./ConsoleLogger");const d=vi.spyOn(console,"warn").mockImplementation(vi.fn()),n=vi.spyOn(console,"info").mockImplementation(vi.fn()),r=vi.spyOn(console,"debug").mockImplementation(vi.fn()),a=vi.spyOn(console,"error").mockImplementation(vi.fn()),s=vi.spyOn(console,"log").mockImplementation(vi.fn());let o;const e={data:{key:"value"},timestamp:1,tag:"tag"},l="message";describe("ConsoleLogger",()=>{afterAll(()=>{vi.restoreAllMocks()}),describe("default level (LogLevel.DEBUG)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger}),describe("log",()=>{it("should log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Info level with a custom tag",()=>{const i="custom-tag";o.log(t.LogLevel.Info,l,{...e,tag:i}),expect(n).toHaveBeenCalledWith(`[${i}]`,l,e.data)}),it("should log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(s).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})}),describe("custom level (LogLevel.Info)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Info)}),describe("log",()=>{it("should log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Info level with a custom tag",()=>{const i="custom-tag";o.log(t.LogLevel.Info,l,{...e,tag:i}),expect(n).toHaveBeenCalledWith(`[${i}]`,l,e.data)}),it("should log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(s).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})}),describe("custom level (LogLevel.Warning)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Warning)}),describe("log",()=>{it("should not log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).not.toHaveBeenCalled()}),it("should log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(s).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})}),describe("custom level (LogLevel.Error)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Error)}),describe("log",()=>{it("should not log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).not.toHaveBeenCalled()}),it("should not log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).not.toHaveBeenCalled()}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(s).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})}),describe("custom level (LogLevel.Fatal)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Fatal)}),describe("log",()=>{it("should not log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).not.toHaveBeenCalled()}),it("should not log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).not.toHaveBeenCalled()}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(`[${e.tag}]`,l,e.data)})})})});
2
2
  //# sourceMappingURL=ConsoleLogger.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/logger-subscriber/service/ConsoleLogger.test.ts"],
4
- "sourcesContent": ["import { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { type LogSubscriberOptions } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\n\nimport { ConsoleLogger } from \"./ConsoleLogger\";\n\nconst warn = jest.spyOn(console, \"warn\").mockImplementation(jest.fn());\nconst info = jest.spyOn(console, \"info\").mockImplementation(jest.fn());\nconst debug = jest.spyOn(console, \"debug\").mockImplementation(jest.fn());\nconst error = jest.spyOn(console, \"error\").mockImplementation(jest.fn());\nconst log = jest.spyOn(console, \"log\").mockImplementation(jest.fn());\n\nlet logger: ConsoleLogger;\nconst options: LogSubscriberOptions = {\n data: { key: \"value\" },\n timestamp: 1,\n tag: \"tag\",\n};\nconst message = \"message\";\n\ndescribe(\"ConsoleLogger\", () => {\n afterAll(() => {\n jest.restoreAllMocks();\n });\n\n describe(\"default level (LogLevel.DEBUG)\", () => {\n beforeEach(() => {\n jest.clearAllMocks();\n logger = new ConsoleLogger();\n });\n\n describe(\"log\", () => {\n it(\"should log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Info level with a custom tag\", () => {\n const tag = \"custom-tag\";\n logger.log(LogLevel.Info, message, { ...options, tag });\n expect(info).toHaveBeenCalledWith(`[${tag}]`, message, options.data);\n });\n\n it(\"should log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n\n describe(\"custom level (LogLevel.Info)\", () => {\n beforeEach(() => {\n jest.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Info);\n });\n\n describe(\"log\", () => {\n it(\"should log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Info level with a custom tag\", () => {\n const tag = \"custom-tag\";\n logger.log(LogLevel.Info, message, { ...options, tag });\n expect(info).toHaveBeenCalledWith(`[${tag}]`, message, options.data);\n });\n\n it(\"should log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n\n describe(\"custom level (LogLevel.Warning)\", () => {\n beforeEach(() => {\n jest.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Warning);\n });\n\n describe(\"log\", () => {\n it(\"should not log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).not.toHaveBeenCalled();\n });\n\n it(\"should log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n\n describe(\"custom level (LogLevel.Error)\", () => {\n beforeEach(() => {\n jest.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Error);\n });\n\n describe(\"log\", () => {\n it(\"should not log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).not.toHaveBeenCalled();\n });\n\n it(\"should not log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).not.toHaveBeenCalled();\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n\n describe(\"custom level (LogLevel.Fatal)\", () => {\n beforeEach(() => {\n jest.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Fatal);\n });\n\n describe(\"log\", () => {\n it(\"should not log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).not.toHaveBeenCalled();\n });\n\n it(\"should not log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).not.toHaveBeenCalled();\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAyB,iDAGzBC,EAA8B,2BAE9B,MAAMC,EAAO,KAAK,MAAM,QAAS,MAAM,EAAE,mBAAmB,KAAK,GAAG,CAAC,EAC/DC,EAAO,KAAK,MAAM,QAAS,MAAM,EAAE,mBAAmB,KAAK,GAAG,CAAC,EAC/DC,EAAQ,KAAK,MAAM,QAAS,OAAO,EAAE,mBAAmB,KAAK,GAAG,CAAC,EACjEC,EAAQ,KAAK,MAAM,QAAS,OAAO,EAAE,mBAAmB,KAAK,GAAG,CAAC,EACjEC,EAAM,KAAK,MAAM,QAAS,KAAK,EAAE,mBAAmB,KAAK,GAAG,CAAC,EAEnE,IAAIC,EACJ,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EAC1C,OAAOL,CAAI,EAAE,IAAI,iBAAiB,CACpC,CAAC,EAED,GAAG,4BAA6B,IAAM,CACpCI,EAAO,IAAI,WAAS,QAASE,EAASD,CAAO,EAC7C,OAAON,CAAI,EAAE,IAAI,iBAAiB,CACpC,CAAC,EAED,GAAG,6BAA8B,IAAM,CACrCK,EAAO,IAAI,WAAS,MAAOE,EAASD,CAAO,EAC3C,OAAOJ,CAAK,EAAE,IAAI,iBAAiB,CACrC,CAAC,EAED,GAAG,yBAA0B,IAAM,CACjCG,EAAO,IAAI,WAAS,MAAOE,EAASD,CAAO,EAC3C,OAAOH,CAAK,EAAE,qBACZ,IAAIG,EAAQ,GAAG,IACfC,EACAD,EAAQ,IACV,CACF,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { type LogSubscriberOptions } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\n\nimport { ConsoleLogger } from \"./ConsoleLogger\";\n\nconst warn = vi.spyOn(console, \"warn\").mockImplementation(vi.fn());\nconst info = vi.spyOn(console, \"info\").mockImplementation(vi.fn());\nconst debug = vi.spyOn(console, \"debug\").mockImplementation(vi.fn());\nconst error = vi.spyOn(console, \"error\").mockImplementation(vi.fn());\nconst log = vi.spyOn(console, \"log\").mockImplementation(vi.fn());\n\nlet logger: ConsoleLogger;\nconst options: LogSubscriberOptions = {\n data: { key: \"value\" },\n timestamp: 1,\n tag: \"tag\",\n};\nconst message = \"message\";\n\ndescribe(\"ConsoleLogger\", () => {\n afterAll(() => {\n vi.restoreAllMocks();\n });\n\n describe(\"default level (LogLevel.DEBUG)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger();\n });\n\n describe(\"log\", () => {\n it(\"should log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Info level with a custom tag\", () => {\n const tag = \"custom-tag\";\n logger.log(LogLevel.Info, message, { ...options, tag });\n expect(info).toHaveBeenCalledWith(`[${tag}]`, message, options.data);\n });\n\n it(\"should log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n\n describe(\"custom level (LogLevel.Info)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Info);\n });\n\n describe(\"log\", () => {\n it(\"should log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Info level with a custom tag\", () => {\n const tag = \"custom-tag\";\n logger.log(LogLevel.Info, message, { ...options, tag });\n expect(info).toHaveBeenCalledWith(`[${tag}]`, message, options.data);\n });\n\n it(\"should log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n\n describe(\"custom level (LogLevel.Warning)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Warning);\n });\n\n describe(\"log\", () => {\n it(\"should not log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).not.toHaveBeenCalled();\n });\n\n it(\"should log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n\n describe(\"custom level (LogLevel.Error)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Error);\n });\n\n describe(\"log\", () => {\n it(\"should not log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).not.toHaveBeenCalled();\n });\n\n it(\"should not log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).not.toHaveBeenCalled();\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n\n describe(\"custom level (LogLevel.Fatal)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Fatal);\n });\n\n describe(\"log\", () => {\n it(\"should not log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).not.toHaveBeenCalled();\n });\n\n it(\"should not log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).not.toHaveBeenCalled();\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(\n `[${options.tag}]`,\n message,\n options.data,\n );\n });\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAyB,iDAGzBC,EAA8B,2BAE9B,MAAMC,EAAO,GAAG,MAAM,QAAS,MAAM,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC3DC,EAAO,GAAG,MAAM,QAAS,MAAM,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC3DC,EAAQ,GAAG,MAAM,QAAS,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC7DC,EAAQ,GAAG,MAAM,QAAS,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC7DC,EAAM,GAAG,MAAM,QAAS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G,4BAA6B,IAAM,CACpCA,EAAO,IAAI,WAAS,KAAME,EAASD,CAAO,EAC1C,OAAOL,CAAI,EAAE,IAAI,iBAAiB,CACpC,CAAC,EAED,GAAG,4BAA6B,IAAM,CACpCI,EAAO,IAAI,WAAS,QAASE,EAASD,CAAO,EAC7C,OAAON,CAAI,EAAE,IAAI,iBAAiB,CACpC,CAAC,EAED,GAAG,6BAA8B,IAAM,CACrCK,EAAO,IAAI,WAAS,MAAOE,EAASD,CAAO,EAC3C,OAAOJ,CAAK,EAAE,IAAI,iBAAiB,CACrC,CAAC,EAED,GAAG,yBAA0B,IAAM,CACjCG,EAAO,IAAI,WAAS,MAAOE,EAASD,CAAO,EAC3C,OAAOH,CAAK,EAAE,qBACZ,IAAIG,EAAQ,GAAG,IACfC,EACAD,EAAQ,IACV,CACF,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["import_LogLevel", "import_ConsoleLogger", "warn", "info", "debug", "error", "log", "logger", "options", "message", "tag"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=require("../../device-model/model/DeviceModel.stub"),o=require("../../../internal/device-session/model/DeviceSession"),r=require("./WebLogsExporterLogger");describe("getJSONStringifyReplacer",()=>{it("should return a function that replaces Uint8Array correctly",()=>{const e=(0,r.getJSONStringifyReplacer)(),t=new Uint8Array([1,2,3]),c=e("key",t);expect(c).toEqual({hex:"0x010203",readableHex:"01 02 03",value:"1,2,3"})}),it("should return a function that replaces DeviceSession",()=>{const e=(0,i.deviceModelStubBuilder)(),t=(0,r.getJSONStringifyReplacer)(),c={deviceModel:(0,i.deviceModelStubBuilder)(),type:"USB",id:"mockedDeviceId",sendApdu:jest.fn(),transport:"USB"},n=new o.DeviceSession({connectedDevice:c,id:"mockedSessionId"},jest.fn(),{}),s=JSON.stringify(n,t),a=`{"id":"mockedSessionId","connectedDevice":{"deviceModel":${JSON.stringify(e)},"type":"USB","id":"mockedDeviceId"}}`;n.close(),expect(s).toEqual(a)}),it("should return a function that replaces circular references",()=>{const e={name:"Alice"};e.self=e;const t='{"name":"Alice","self":"[Circular]"}',c=JSON.stringify(e,(0,r.getJSONStringifyReplacer)());expect(c).toEqual(t)})});
1
+ "use strict";var i=require("../../device-model/model/DeviceModel.stub"),o=require("../../../internal/device-session/model/DeviceSession"),r=require("./WebLogsExporterLogger");describe("getJSONStringifyReplacer",()=>{it("should return a function that replaces Uint8Array correctly",()=>{const e=(0,r.getJSONStringifyReplacer)(),t=new Uint8Array([1,2,3]),c=e("key",t);expect(c).toEqual({hex:"0x010203",readableHex:"01 02 03",value:"1,2,3"})}),it("should return a function that replaces DeviceSession",()=>{const e=(0,i.deviceModelStubBuilder)(),t=(0,r.getJSONStringifyReplacer)(),c={deviceModel:(0,i.deviceModelStubBuilder)(),type:"USB",id:"mockedDeviceId",sendApdu:vi.fn(),transport:"USB"},n=new o.DeviceSession({connectedDevice:c,id:"mockedSessionId"},vi.fn(),{},{}),s=JSON.stringify(n,t),a=`{"id":"mockedSessionId","connectedDevice":{"deviceModel":${JSON.stringify(e)},"type":"USB","id":"mockedDeviceId"}}`;n.close(),expect(s).toEqual(a)}),it("should return a function that replaces circular references",()=>{const e={name:"Alice"};e.self=e;const t='{"name":"Alice","self":"[Circular]"}',c=JSON.stringify(e,(0,r.getJSONStringifyReplacer)());expect(c).toEqual(t)})});
2
2
  //# sourceMappingURL=WebLogsExporterLogger.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/logger-subscriber/service/WebLogsExporterLogger.test.ts"],
4
- "sourcesContent": ["import { deviceModelStubBuilder } from \"@api/device-model/model/DeviceModel.stub\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { getJSONStringifyReplacer } from \"./WebLogsExporterLogger\";\n\ndescribe(\"getJSONStringifyReplacer\", () => {\n it(\"should return a function that replaces Uint8Array correctly\", () => {\n const replacer = getJSONStringifyReplacer();\n const value = new Uint8Array([1, 2, 3]);\n const result = replacer(\"key\", value);\n expect(result).toEqual({\n hex: \"0x010203\",\n readableHex: \"01 02 03\",\n value: \"1,2,3\",\n });\n });\n\n it(\"should return a function that replaces DeviceSession\", () => {\n const stubDeviceModel = deviceModelStubBuilder();\n const replacer = getJSONStringifyReplacer();\n\n const connectedDevice: TransportConnectedDevice = {\n deviceModel: deviceModelStubBuilder(),\n type: \"USB\",\n id: \"mockedDeviceId\",\n sendApdu: jest.fn(),\n transport: \"USB\",\n };\n\n const value = new DeviceSession(\n {\n connectedDevice,\n id: \"mockedSessionId\",\n },\n jest.fn(),\n {} as ManagerApiService,\n );\n const result = JSON.stringify(value, replacer);\n const expected = `{\"id\":\"mockedSessionId\",\"connectedDevice\":{\"deviceModel\":${JSON.stringify(\n stubDeviceModel,\n )},\"type\":\"USB\",\"id\":\"mockedDeviceId\"}}`;\n value.close();\n expect(result).toEqual(expected);\n });\n\n it(\"should return a function that replaces circular references\", () => {\n interface CircularObject {\n name: string;\n self?: CircularObject;\n }\n\n const obj: CircularObject = { name: \"Alice\" };\n obj.self = obj;\n\n const expected = '{\"name\":\"Alice\",\"self\":\"[Circular]\"}';\n const result = JSON.stringify(obj, getJSONStringifyReplacer());\n expect(result).toEqual(expected);\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAuC,oDAEvCC,EAA8B,wDAG9BC,EAAyC,mCAEzC,SAAS,2BAA4B,IAAM,CACzC,GAAG,8DAA+D,IAAM,CACtE,MAAMC,KAAW,4BAAyB,EACpCC,EAAQ,IAAI,WAAW,CAAC,EAAG,EAAG,CAAC,CAAC,EAChCC,EAASF,EAAS,MAAOC,CAAK,EACpC,OAAOC,CAAM,EAAE,QAAQ,CACrB,IAAK,WACL,YAAa,WACb,MAAO,OACT,CAAC,CACH,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMC,KAAkB,0BAAuB,EACzCH,KAAW,4BAAyB,EAEpCI,EAA4C,CAChD,eAAa,0BAAuB,EACpC,KAAM,MACN,GAAI,iBACJ,SAAU,KAAK,GAAG,EAClB,UAAW,KACb,EAEMH,EAAQ,IAAI,gBAChB,CACE,gBAAAG,EACA,GAAI,iBACN,EACA,KAAK,GAAG,EACR,CAAC,CACH,EACMF,EAAS,KAAK,UAAUD,EAAOD,CAAQ,EACvCK,EAAW,4DAA4D,KAAK,UAChFF,CACF,CAAC,wCACDF,EAAM,MAAM,EACZ,OAAOC,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,EAED,GAAG,6DAA8D,IAAM,CAMrE,MAAMC,EAAsB,CAAE,KAAM,OAAQ,EAC5CA,EAAI,KAAOA,EAEX,MAAMD,EAAW,uCACXH,EAAS,KAAK,UAAUI,KAAK,4BAAyB,CAAC,EAC7D,OAAOJ,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { deviceModelStubBuilder } from \"@api/device-model/model/DeviceModel.stub\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { getJSONStringifyReplacer } from \"./WebLogsExporterLogger\";\n\ndescribe(\"getJSONStringifyReplacer\", () => {\n it(\"should return a function that replaces Uint8Array correctly\", () => {\n const replacer = getJSONStringifyReplacer();\n const value = new Uint8Array([1, 2, 3]);\n const result = replacer(\"key\", value);\n expect(result).toEqual({\n hex: \"0x010203\",\n readableHex: \"01 02 03\",\n value: \"1,2,3\",\n });\n });\n\n it(\"should return a function that replaces DeviceSession\", () => {\n const stubDeviceModel = deviceModelStubBuilder();\n const replacer = getJSONStringifyReplacer();\n\n const connectedDevice: TransportConnectedDevice = {\n deviceModel: deviceModelStubBuilder(),\n type: \"USB\",\n id: \"mockedDeviceId\",\n sendApdu: vi.fn(),\n transport: \"USB\",\n };\n\n const value = new DeviceSession(\n {\n connectedDevice,\n id: \"mockedSessionId\",\n },\n vi.fn(),\n {} as ManagerApiService,\n {} as SecureChannelService,\n );\n const result = JSON.stringify(value, replacer);\n const expected = `{\"id\":\"mockedSessionId\",\"connectedDevice\":{\"deviceModel\":${JSON.stringify(\n stubDeviceModel,\n )},\"type\":\"USB\",\"id\":\"mockedDeviceId\"}}`;\n value.close();\n expect(result).toEqual(expected);\n });\n\n it(\"should return a function that replaces circular references\", () => {\n interface CircularObject {\n name: string;\n self?: CircularObject;\n }\n\n const obj: CircularObject = { name: \"Alice\" };\n obj.self = obj;\n\n const expected = '{\"name\":\"Alice\",\"self\":\"[Circular]\"}';\n const result = JSON.stringify(obj, getJSONStringifyReplacer());\n expect(result).toEqual(expected);\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAuC,oDAEvCC,EAA8B,wDAI9BC,EAAyC,mCAEzC,SAAS,2BAA4B,IAAM,CACzC,GAAG,8DAA+D,IAAM,CACtE,MAAMC,KAAW,4BAAyB,EACpCC,EAAQ,IAAI,WAAW,CAAC,EAAG,EAAG,CAAC,CAAC,EAChCC,EAASF,EAAS,MAAOC,CAAK,EACpC,OAAOC,CAAM,EAAE,QAAQ,CACrB,IAAK,WACL,YAAa,WACb,MAAO,OACT,CAAC,CACH,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMC,KAAkB,0BAAuB,EACzCH,KAAW,4BAAyB,EAEpCI,EAA4C,CAChD,eAAa,0BAAuB,EACpC,KAAM,MACN,GAAI,iBACJ,SAAU,GAAG,GAAG,EAChB,UAAW,KACb,EAEMH,EAAQ,IAAI,gBAChB,CACE,gBAAAG,EACA,GAAI,iBACN,EACA,GAAG,GAAG,EACN,CAAC,EACD,CAAC,CACH,EACMF,EAAS,KAAK,UAAUD,EAAOD,CAAQ,EACvCK,EAAW,4DAA4D,KAAK,UAChFF,CACF,CAAC,wCACDF,EAAM,MAAM,EACZ,OAAOC,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,EAED,GAAG,6DAA8D,IAAM,CAMrE,MAAMC,EAAsB,CAAE,KAAM,OAAQ,EAC5CA,EAAI,KAAOA,EAEX,MAAMD,EAAW,uCACXH,EAAS,KAAK,UAAUI,KAAK,4BAAyB,CAAC,EAC7D,OAAOJ,CAAM,EAAE,QAAQG,CAAQ,CACjC,CAAC,CACH,CAAC",
6
6
  "names": ["import_DeviceModel", "import_DeviceSession", "import_WebLogsExporterLogger", "replacer", "value", "result", "stubDeviceModel", "connectedDevice", "expected", "obj"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var l=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(e,o)=>{for(var g in o)l(e,g,{get:o[g],enumerable:!0})},f=(e,o,g,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of t(o))!a.call(e,s)&&s!==g&&l(e,s,{get:()=>o[s],enumerable:!(n=r(o,s))||n.enumerable});return e};var j=e=>f(l({},"__esModule",{value:!0}),e);var x={};c(x,{ConsoleLogger:()=>p});module.exports=j(x);class p{log=jest.fn()}0&&(module.exports={ConsoleLogger});
1
+ "use strict";var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=(e,o)=>{for(var l in o)s(e,l,{get:o[l],enumerable:!0})},i=(e,o,l,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let g of a(o))!c.call(e,g)&&g!==l&&s(e,g,{get:()=>o[g],enumerable:!(n=r(o,g))||n.enumerable});return e};var p=e=>i(s({},"__esModule",{value:!0}),e);var v={};f(v,{ConsoleLogger:()=>t});module.exports=p(v);class t{log=vi.fn()}0&&(module.exports={ConsoleLogger});
2
2
  //# sourceMappingURL=ConsoleLogger.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/logger-subscriber/service/__mocks__/ConsoleLogger.ts"],
4
- "sourcesContent": ["export class ConsoleLogger {\n log = jest.fn();\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,CAAc,CACzB,IAAM,KAAK,GAAG,CAChB",
4
+ "sourcesContent": ["export class ConsoleLogger {\n log = vi.fn();\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,CAAc,CACzB,IAAM,GAAG,GAAG,CACd",
6
6
  "names": ["ConsoleLogger_exports", "__export", "ConsoleLogger", "__toCommonJS"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var r=(n,e,o,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of s(e))!t.call(n,d)&&d!==o&&i(n,d,{get:()=>e[d],enumerable:!(p=c(e,d))||p.enumerable});return n};var D=n=>r(i({},"__esModule",{value:!0}),n);var u={};module.exports=D(u);
2
+ //# sourceMappingURL=DeviceApduSender.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/transport/model/DeviceApduSender.ts"],
4
+ "sourcesContent": ["import { type SendApduFnType } from \"./DeviceConnection\";\n\n/**\n * DeviceConnection is a generic interface that represents a connection to a device.\n * It is used to send APDUs to the device.\n *\n * @template Dependencies the object containing all the logic necessary to\n * implement sendApdu. For instance HIDDevice or onWrite on RN BLE.\n *\n */\nexport interface DeviceApduSender<Dependencies> {\n sendApdu: SendApduFnType;\n getDependencies: () => Dependencies;\n setDependencies: (dependencies: Dependencies) => void;\n closeConnection: () => void;\n setupConnection: () => Promise<void>;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["DeviceApduSender_exports", "__toCommonJS"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var t=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var c=(r,e,i,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!m.call(r,o)&&o!==i&&t(r,o,{get:()=>e[o],enumerable:!(p=n(e,o))||p.enumerable});return r};var s=r=>c(t({},"__esModule",{value:!0}),r);var y={};module.exports=s(y);
1
+ "use strict";var t=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var s=(p,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of i(e))!m.call(p,r)&&r!==n&&t(p,r,{get:()=>e[r],enumerable:!(o=d(e,r))||o.enumerable});return p};var c=p=>s(t({},"__esModule",{value:!0}),p);var u={};module.exports=c(u);
2
2
  //# sourceMappingURL=DeviceConnection.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/transport/model/DeviceConnection.ts"],
4
- "sourcesContent": ["import { type Either } from \"purify-ts\";\n\nimport { type DeviceId } from \"@api/device/DeviceModel\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type DmkError } from \"@api/Error\";\n\nexport type DisconnectHandler = (deviceId: DeviceId) => void;\n\nexport type SendApduFnType = (\n apdu: Uint8Array,\n triggersDisconnection?: boolean,\n) => Promise<Either<DmkError, ApduResponse>>;\n\nexport interface DeviceConnection {\n sendApdu: SendApduFnType;\n}\n"],
4
+ "sourcesContent": ["import { type Either } from \"purify-ts\";\n\nimport { type DeviceId } from \"@api/device/DeviceModel\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type DmkError } from \"@api/Error\";\n\nexport type DisconnectHandler = (deviceId: DeviceId) => void;\n\nexport type SendApduResult = Either<DmkError, ApduResponse>;\n\nexport type SendApduFnType = (\n apdu: Uint8Array,\n triggersDisconnection?: boolean,\n) => Promise<SendApduResult>;\n\nexport interface DeviceConnection {\n sendApdu: SendApduFnType;\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["DeviceConnection_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var c in e)o(t,c,{get:e[c],enumerable:!0})},p=(t,e,c,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!i.call(t,n)&&n!==c&&o(t,n,{get:()=>e[n],enumerable:!(s=r(e,n))||s.enumerable});return t};var u=t=>p(o({},"__esModule",{value:!0}),t);var f={};m(f,{DeviceConnectionFactoryStub:()=>d});module.exports=u(f);class d{constructor(){}create=jest.fn().mockImplementation(()=>({sendApdu:jest.fn()}))}0&&(module.exports={DeviceConnectionFactoryStub});
1
+ "use strict";var o=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var m=(n,e)=>{for(var c in e)o(n,c,{get:e[c],enumerable:!0})},p=(n,e,c,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!s.call(n,t)&&t!==c&&o(n,t,{get:()=>e[t],enumerable:!(i=r(e,t))||i.enumerable});return n};var u=n=>p(o({},"__esModule",{value:!0}),n);var d={};m(d,{DeviceConnectionFactoryStub:()=>v});module.exports=u(d);class v{constructor(){}create=vi.fn().mockImplementation(()=>({sendApdu:vi.fn()}))}0&&(module.exports={DeviceConnectionFactoryStub});
2
2
  //# sourceMappingURL=DeviceConnectionFactory.stub.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/transport/model/DeviceConnectionFactory.stub.ts"],
4
- "sourcesContent": ["export class DeviceConnectionFactoryStub {\n constructor() {}\n\n create = jest.fn().mockImplementation(() => ({\n sendApdu: jest.fn(),\n }));\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,CAA4B,CACvC,aAAc,CAAC,CAEf,OAAS,KAAK,GAAG,EAAE,mBAAmB,KAAO,CAC3C,SAAU,KAAK,GAAG,CACpB,EAAE,CACJ",
4
+ "sourcesContent": ["export class DeviceConnectionFactoryStub {\n constructor() {}\n\n create = vi.fn().mockImplementation(() => ({\n sendApdu: vi.fn(),\n }));\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,CAA4B,CACvC,aAAc,CAAC,CAEf,OAAS,GAAG,GAAG,EAAE,mBAAmB,KAAO,CACzC,SAAU,GAAG,GAAG,CAClB,EAAE,CACJ",
6
6
  "names": ["DeviceConnectionFactory_stub_exports", "__export", "DeviceConnectionFactoryStub", "__toCommonJS"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var D=(c,n)=>{for(var o in n)u(c,o,{get:n[o],enumerable:!0})},y=(c,n,o,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of C(n))!v.call(c,s)&&s!==o&&u(c,s,{get:()=>n[s],enumerable:!(i=h(n,s))||i.enumerable});return c};var R=c=>y(u({},"__esModule",{value:!0}),c);var E={};D(E,{DeviceConnectionStateMachine:()=>T});module.exports=R(E);var t=require("purify-ts"),r=require("xstate"),l=require("../../command/utils/CommandUtils"),m=require("../../Error"),d=require("./Errors");class T{deviceId;deviceAdpuSender;machineActor;timeoutDuration;timeout=null;startReconnectionTimeout(){this.timeout=setTimeout(()=>{this.machineActor.send({type:"ReconnectionTimedOut"})},this.timeoutDuration)}constructor(n){this.deviceId=n.deviceId,this.deviceAdpuSender=n.deviceApduSender,this.timeoutDuration=n.timeoutDuration,this.machineActor=(0,r.createActor)(S({sendApduFn:(o,i)=>this.sendApduToDeviceConnection(o,i),startReconnectionTimeout:()=>this.startReconnectionTimeout(),cancelReconnectionTimeout:()=>{this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},onTerminated:n.onTerminated,closeConnection:()=>{this.deviceAdpuSender.closeConnection()}})),this.machineActor.start()}sendApduToDeviceConnection(n,o){console.log("[sendApduToDeviceConnection] called",n,o),this.deviceAdpuSender.sendApdu(n,o).then(i=>{i.caseOf({Left:s=>{console.log("[sendApduToDeviceConnection] got error response",s),this.machineActor.send({type:"ApduSendingError",error:s})},Right:s=>{console.log("[sendApduToDeviceConnection] got successful response",s),this.machineActor.send({type:"ApduResponseReceived",apduResponse:s})}})}).catch(i=>{console.log("[sendApduToDeviceConnection] caught error",i),this.machineActor.send({type:"ApduSendingError",error:new m.UnknownDeviceExchangeError(i)})})}getDependencies(){return this.deviceAdpuSender.getDependencies()}setDependencies(n){this.deviceAdpuSender.setDependencies(n)}getDeviceId(){return this.deviceId}sendApdu(n,o){return new Promise(i=>{this.machineActor.send({type:"SendApduCalled",apdu:n,triggersDisconnection:!!o,responseCallback:i})})}async setupConnection(){await this.deviceAdpuSender.setupConnection()}eventDeviceAttached(){this.machineActor.send({type:"DeviceAttached"})}eventDeviceDetached(){this.machineActor.send({type:"DeviceDetached"})}closeConnection(){this.machineActor.send({type:"CloseConnectionCalled"})}}function S({sendApduFn:c,startReconnectionTimeout:n,cancelReconnectionTimeout:o,onTerminated:i,closeConnection:s}){return(0,r.setup)({types:{},actions:{startTimer:()=>{n()},cancelTimer:()=>{o()},reconnectionTimeoutEvent:(0,r.emit)({type:"ReconnectionTimedOut"}),sendApdu:({context:e})=>{e.apduInProgress.caseOf({Just:({apdu:p})=>{c(p,!1)},Nothing:()=>{console.error("sendApdu called while no apdu in progress")}})},sendApduResponse:({context:e},p)=>{e.apduInProgress.caseOf({Just:({responseCallback:a})=>{a(p.response)},Nothing:()=>{console.error("sendApduResponse called while no apdu in progress")}})},cleanupContext:(0,r.assign)({apduInProgress:t.Nothing}),signalTermination:()=>{i()},closeConnection:async()=>{try{await s()}catch(e){console.error("Error closing connection",e)}}},guards:{isApduThatTriggersDisconnection:({context:e},p)=>e.apduInProgress.caseOf({Just:({triggersDisconnection:a,apdu:A})=>{const g=(a||l.CommandUtils.isApduThatTriggersDisconnection(A))&&l.CommandUtils.isSuccessResponse(p.apduResponse);return console.log("isApduThatTriggersDisconnection",g,A),g},Nothing:()=>!1})}}).createMachine({id:"deviceConnection",initial:"Connected",context:{apduInProgress:t.Nothing},states:{Connected:{on:{DeviceDetached:{target:"WaitingForReconnection"},SendApduCalled:{target:"SendingApdu",actions:(0,r.assign)({apduInProgress:({event:e})=>t.Maybe.of({apdu:e.apdu,triggersDisconnection:e.triggersDisconnection,responseCallback:e.responseCallback})})},CloseConnectionCalled:{target:"Terminated"}}},SendingApdu:{entry:"sendApdu",on:{ApduResponseReceived:[{guard:{type:"isApduThatTriggersDisconnection",params:({event:e})=>({apduResponse:e.apduResponse})},target:"WaitingForReconnection",actions:[{type:"sendApduResponse",params:({event:e})=>({response:(0,t.Right)(e.apduResponse)})},{type:"cleanupContext"}]},{target:"Connected",actions:[{type:"sendApduResponse",params:({event:e})=>({response:(0,t.Right)(e.apduResponse)})},{type:"cleanupContext"}]}],ApduSendingError:{target:"Connected",actions:[{type:"sendApduResponse",params:({event:e})=>({response:(0,t.Left)(e.error)})},"cleanupContext"]},DeviceDetached:{target:"WaitingForReconnection",actions:[{type:"sendApduResponse",params:{response:(0,t.Left)(new d.DeviceDisconnectedWhileSendingError)}},"cleanupContext"]},CloseConnectionCalled:{target:"Terminated",actions:[{type:"sendApduResponse",params:{response:(0,t.Left)(new d.DeviceDisconnectedWhileSendingError)}},"cleanupContext"]},SendApduCalled:{actions:({event:e})=>{console.log("EXTRA SendApduCalled while in state: SendingApdu state"),e.responseCallback((0,t.Left)(new d.AlreadySendingApduError))}}}},WaitingForReconnection:{entry:"startTimer",on:{DeviceAttached:{target:"Connected",actions:"cancelTimer"},SendApduCalled:{target:"WaitingForReconnectionWithQueuedSendApdu",actions:(0,r.assign)({apduInProgress:({event:e})=>t.Maybe.of({apdu:e.apdu,triggersDisconnection:e.triggersDisconnection,responseCallback:e.responseCallback})})},ReconnectionTimedOut:{target:"Terminated"},CloseConnectionCalled:{target:"Terminated"}}},WaitingForReconnectionWithQueuedSendApdu:{on:{DeviceAttached:{target:"SendingApdu",actions:"cancelTimer"},ReconnectionTimedOut:{target:"Terminated",actions:[{type:"sendApduResponse",params:{response:(0,t.Left)(new d.DeviceDisconnectedBeforeSendingApdu)}},{type:"cleanupContext"}]},CloseConnectionCalled:{target:"Terminated",actions:[{type:"sendApduResponse",params:{response:(0,t.Left)(new d.DeviceDisconnectedWhileSendingError)}},"cleanupContext"]},SendApduCalled:{actions:({event:e})=>{console.log("EXTRA SendApduCalled while in state:WaitingForReconnectionWithQueuedSendApdu"),e.responseCallback((0,t.Left)(new d.AlreadySendingApduError))}}}},Terminated:{entry:["signalTermination","closeConnection"],type:"final"}}})}0&&(module.exports={DeviceConnectionStateMachine});
2
+ //# sourceMappingURL=DeviceConnectionStateMachine.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/api/transport/model/DeviceConnectionStateMachine.ts"],
4
+ "sourcesContent": ["// import { createBrowserInspector } from \"@statelyai/inspect\";\nimport { type Either, Left, Maybe, Nothing, Right } from \"purify-ts\";\nimport { type Actor, assign, createActor, emit, setup } from \"xstate\";\n\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type DmkError, UnknownDeviceExchangeError } from \"@api/Error\";\nimport { type DeviceId } from \"@api/types\";\n\nimport { type DeviceApduSender } from \"./DeviceApduSender\";\nimport {\n AlreadySendingApduError,\n DeviceDisconnectedBeforeSendingApdu,\n DeviceDisconnectedWhileSendingError,\n} from \"./Errors\";\n\n// const { inspect } = createBrowserInspector();\n\ntype DeviceDetachedEvent = {\n type: \"DeviceDetached\";\n};\n\ntype DeviceAttachedEvent = {\n type: \"DeviceAttached\";\n};\n\ntype ApduResponseReceived = {\n type: \"ApduResponseReceived\";\n apduResponse: ApduResponse;\n};\n\ntype ApduSendingError = {\n type: \"ApduSendingError\";\n error: DmkError;\n};\n\ntype SendApduCalled = {\n type: \"SendApduCalled\";\n apdu: Uint8Array;\n triggersDisconnection: boolean;\n responseCallback: (response: Either<DmkError, ApduResponse>) => void;\n};\n\ntype ReconnectionTimedOut = {\n type: \"ReconnectionTimedOut\";\n};\n\ntype CloseConnectionCalled = {\n type: \"CloseConnectionCalled\";\n};\n\nexport type DeviceConnectionEvent =\n | DeviceDetachedEvent\n | DeviceAttachedEvent\n | ApduResponseReceived\n | ApduSendingError\n | SendApduCalled\n | CloseConnectionCalled\n | ReconnectionTimedOut;\n\nexport class DeviceConnectionStateMachine<Dependencies> {\n private deviceId: DeviceId;\n private deviceAdpuSender: DeviceApduSender<Dependencies>;\n\n private machineActor: Actor<ReturnType<typeof makeStateMachine>>;\n\n private timeoutDuration: number;\n private timeout: ReturnType<typeof setTimeout> | null = null;\n\n startReconnectionTimeout() {\n this.timeout = setTimeout(() => {\n this.machineActor.send({ type: \"ReconnectionTimedOut\" });\n }, this.timeoutDuration);\n }\n\n constructor(params: {\n deviceId: DeviceId;\n deviceApduSender: DeviceApduSender<Dependencies>;\n timeoutDuration: number;\n onTerminated: () => void;\n }) {\n this.deviceId = params.deviceId;\n this.deviceAdpuSender = params.deviceApduSender;\n this.timeoutDuration = params.timeoutDuration;\n this.machineActor = createActor(\n makeStateMachine({\n sendApduFn: (apdu, triggersDisconnection) =>\n this.sendApduToDeviceConnection(apdu, triggersDisconnection),\n startReconnectionTimeout: () => this.startReconnectionTimeout(),\n cancelReconnectionTimeout: () => {\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n },\n onTerminated: params.onTerminated,\n closeConnection: () => {\n this.deviceAdpuSender.closeConnection();\n },\n }),\n // {\n // // inspect,\n // },\n );\n this.machineActor.start();\n }\n\n private sendApduToDeviceConnection(\n apdu: Uint8Array,\n triggersDisconnection?: boolean,\n ) {\n console.log(\n \"[sendApduToDeviceConnection] called\",\n apdu,\n triggersDisconnection,\n );\n this.deviceAdpuSender\n .sendApdu(apdu, triggersDisconnection)\n .then((response) => {\n response.caseOf({\n Left: (error) => {\n console.log(\n \"[sendApduToDeviceConnection] got error response\",\n error,\n );\n this.machineActor.send({ type: \"ApduSendingError\", error });\n },\n Right: (apduResponse) => {\n console.log(\n \"[sendApduToDeviceConnection] got successful response\",\n apduResponse,\n );\n this.machineActor.send({\n type: \"ApduResponseReceived\",\n apduResponse,\n });\n },\n });\n })\n .catch((error) => {\n console.log(\"[sendApduToDeviceConnection] caught error\", error);\n this.machineActor.send({\n type: \"ApduSendingError\",\n error: new UnknownDeviceExchangeError(error),\n });\n });\n }\n\n /**\n * Called by the transport\n */\n\n public getDependencies(): Dependencies {\n return this.deviceAdpuSender.getDependencies();\n }\n\n public setDependencies(dependencies: Dependencies) {\n this.deviceAdpuSender.setDependencies(dependencies);\n }\n\n public getDeviceId() {\n return this.deviceId;\n }\n\n public sendApdu(\n apdu: Uint8Array,\n triggersDisconnection?: boolean,\n ): Promise<Either<DmkError, ApduResponse>> {\n return new Promise((responseCallback) => {\n this.machineActor.send({\n type: \"SendApduCalled\",\n apdu,\n triggersDisconnection: !!triggersDisconnection,\n responseCallback,\n });\n });\n }\n\n public async setupConnection() {\n await this.deviceAdpuSender.setupConnection();\n }\n\n // State Machine Events\n\n public eventDeviceAttached() {\n this.machineActor.send({ type: \"DeviceAttached\" });\n }\n\n public eventDeviceDetached() {\n this.machineActor.send({ type: \"DeviceDetached\" });\n }\n\n public closeConnection() {\n this.machineActor.send({ type: \"CloseConnectionCalled\" });\n }\n}\n\nfunction makeStateMachine({\n sendApduFn,\n startReconnectionTimeout,\n cancelReconnectionTimeout,\n onTerminated,\n closeConnection,\n}: {\n sendApduFn: (apdu: Uint8Array, triggersDisconnection: boolean) => void;\n startReconnectionTimeout: () => void;\n cancelReconnectionTimeout: () => void;\n onTerminated: () => void;\n closeConnection: () => void;\n}) {\n return setup({\n types: {} as {\n context: {\n apduInProgress: Maybe<{\n apdu: Uint8Array;\n triggersDisconnection: boolean;\n responseCallback: (response: Either<DmkError, ApduResponse>) => void;\n }>;\n };\n events: DeviceConnectionEvent;\n },\n actions: {\n // event transitions\n startTimer: () => {\n startReconnectionTimeout();\n },\n cancelTimer: () => {\n cancelReconnectionTimeout();\n },\n reconnectionTimeoutEvent: emit({ type: \"ReconnectionTimedOut\" }),\n sendApdu: ({ context }) => {\n context.apduInProgress.caseOf({\n Just: ({ apdu }) => {\n sendApduFn(apdu, false);\n },\n Nothing: () => {\n console.error(\"sendApdu called while no apdu in progress\");\n },\n });\n },\n sendApduResponse: (\n { context },\n params: { response: Either<DmkError, ApduResponse> },\n ) => {\n context.apduInProgress.caseOf({\n Just: ({ responseCallback }) => {\n responseCallback(params.response);\n },\n Nothing: () => {\n console.error(\"sendApduResponse called while no apdu in progress\");\n },\n });\n },\n cleanupContext: assign({ apduInProgress: Nothing }),\n signalTermination: () => {\n onTerminated();\n },\n closeConnection: async () => {\n try {\n await closeConnection(); // ASK: how do we handle errors ?\n } catch (e) {\n console.error(\"Error closing connection\", e);\n }\n },\n },\n guards: {\n isApduThatTriggersDisconnection: (\n { context },\n params: { apduResponse: ApduResponse },\n ) => {\n return context.apduInProgress.caseOf({\n Just: ({ triggersDisconnection, apdu }) => {\n const res =\n (triggersDisconnection ||\n CommandUtils.isApduThatTriggersDisconnection(apdu)) &&\n CommandUtils.isSuccessResponse(params.apduResponse);\n console.log(\"isApduThatTriggersDisconnection\", res,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yxD+1UBofifVQOm8YyWjKtSKs8sVlICiECAImQeAARRyMAdogX8JRoqs6IYgDQ30zUjJ8CkWQmYZbOsFLGWzUyzE5bssx8ObAsoSqlpq8r1tILadr2g6ERWksQvCiAopi5i4qbRKjH7Bo4N1dsvFjOxEIeIwUPQ9o9AGSYvG+1bfsW7yVN8+agZB3bIHByUGtk1aWti874s1FGJOHYy6gTLo3lMVN7wPBNVAtbRRg0IEC35NmS0pxTltpwL6e2xn9s0w7mY5hGuaRzrAWZIYBJpc0pd1E18tNMZLOMAwnOCAsCDwFB4CORWms3bnm1AozWSgrHYMsYyEL6FGKXcDleMMO5rXJ5XZ0gP3jZqB4evaLwXEeqwnJNKYDypWlzHePwcIVotyuFT83QldOOpqWNU30A8rEmrMjPcAJk6FP7qch432rY3dxnN1onlaZ9idy5NILuCxl+UEwrH7wiqeqmnarpjatbB3Xcibser3eckfmd3xOkrnpce0DMjHMeoAgLjeqCCsBfVCmFOESE+EqdSfnmNwLJjBPBSs0QwuV3CQWPN3AwT4LTtldoEIAA */\n id: \"deviceConnection\",\n initial: \"Connected\",\n context: {\n apduInProgress: Nothing,\n },\n states: {\n Connected: {\n on: {\n DeviceDetached: {\n target: \"WaitingForReconnection\",\n },\n SendApduCalled: {\n target: \"SendingApdu\",\n actions: assign({\n apduInProgress: ({ event }) => {\n return Maybe.of({\n apdu: event.apdu,\n triggersDisconnection: event.triggersDisconnection,\n responseCallback: event.responseCallback,\n });\n },\n }),\n },\n CloseConnectionCalled: {\n target: \"Terminated\",\n },\n },\n },\n SendingApdu: {\n entry: \"sendApdu\",\n on: {\n ApduResponseReceived: [\n {\n guard: {\n type: \"isApduThatTriggersDisconnection\",\n params: ({ event }) => ({ apduResponse: event.apduResponse }),\n },\n target: \"WaitingForReconnection\",\n actions: [\n {\n type: \"sendApduResponse\",\n // https://stately.ai/docs/actions#dynamic-action-parameters\n params: ({ event }) => {\n return {\n response: Right(event.apduResponse),\n };\n },\n },\n { type: \"cleanupContext\" },\n ],\n },\n {\n target: \"Connected\",\n actions: [\n {\n type: \"sendApduResponse\",\n // https://stately.ai/docs/actions#dynamic-action-parameters\n params: ({ event }) => {\n return {\n response: Right(event.apduResponse),\n };\n },\n },\n { type: \"cleanupContext\" },\n ],\n },\n ],\n ApduSendingError: {\n target: \"Connected\",\n actions: [\n {\n type: \"sendApduResponse\",\n // https://stately.ai/docs/actions#dynamic-action-parameters\n params: ({ event }) => {\n return {\n response: Left(event.error),\n };\n },\n },\n \"cleanupContext\",\n ],\n },\n DeviceDetached: {\n target: \"WaitingForReconnection\",\n actions: [\n {\n type: \"sendApduResponse\",\n params: {\n response: Left(new DeviceDisconnectedWhileSendingError()),\n },\n },\n \"cleanupContext\",\n ],\n },\n CloseConnectionCalled: {\n target: \"Terminated\",\n actions: [\n {\n type: \"sendApduResponse\",\n params: {\n response: Left(new DeviceDisconnectedWhileSendingError()),\n },\n },\n \"cleanupContext\",\n ],\n },\n SendApduCalled: {\n actions: ({ event }) => {\n console.log(\n \"EXTRA SendApduCalled while in state: SendingApdu state\",\n );\n event.responseCallback(Left(new AlreadySendingApduError()));\n },\n },\n },\n },\n WaitingForReconnection: {\n entry: \"startTimer\",\n on: {\n DeviceAttached: {\n target: \"Connected\",\n actions: \"cancelTimer\",\n },\n SendApduCalled: {\n target: \"WaitingForReconnectionWithQueuedSendApdu\",\n actions: assign({\n apduInProgress: ({ event }) => {\n return Maybe.of({\n apdu: event.apdu,\n triggersDisconnection: event.triggersDisconnection,\n responseCallback: event.responseCallback,\n });\n },\n }),\n },\n ReconnectionTimedOut: {\n target: \"Terminated\",\n },\n CloseConnectionCalled: {\n target: \"Terminated\",\n },\n },\n },\n WaitingForReconnectionWithQueuedSendApdu: {\n on: {\n DeviceAttached: {\n target: \"SendingApdu\",\n actions: \"cancelTimer\",\n },\n ReconnectionTimedOut: {\n target: \"Terminated\",\n actions: [\n {\n type: \"sendApduResponse\",\n params: {\n response: Left(new DeviceDisconnectedBeforeSendingApdu()),\n },\n },\n {\n type: \"cleanupContext\",\n },\n ],\n },\n CloseConnectionCalled: {\n target: \"Terminated\",\n actions: [\n {\n type: \"sendApduResponse\",\n params: {\n response: Left(new DeviceDisconnectedWhileSendingError()),\n },\n },\n \"cleanupContext\",\n ],\n },\n SendApduCalled: {\n actions: ({ event }) => {\n console.log(\n \"EXTRA SendApduCalled while in state:WaitingForReconnectionWithQueuedSendApdu\",\n );\n event.responseCallback(Left(new AlreadySendingApduError()));\n },\n },\n },\n },\n // TODO: ADD INACTIVE STATE\n Terminated: {\n entry: [\"signalTermination\", \"closeConnection\"],\n type: \"final\",\n },\n },\n });\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kCAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAAyD,qBACzDC,EAA6D,kBAE7DC,EAA6B,2CAE7BC,EAA0D,sBAI1DC,EAIO,oBA8CA,MAAMN,CAA2C,CAC9C,SACA,iBAEA,aAEA,gBACA,QAAgD,KAExD,0BAA2B,CACzB,KAAK,QAAU,WAAW,IAAM,CAC9B,KAAK,aAAa,KAAK,CAAE,KAAM,sBAAuB,CAAC,CACzD,EAAG,KAAK,eAAe,CACzB,CAEA,YAAYO,EAKT,CACD,KAAK,SAAWA,EAAO,SACvB,KAAK,iBAAmBA,EAAO,iBAC/B,KAAK,gBAAkBA,EAAO,gBAC9B,KAAK,gBAAe,eAClBC,EAAiB,CACf,WAAY,CAACC,EAAMC,IACjB,KAAK,2BAA2BD,EAAMC,CAAqB,EAC7D,yBAA0B,IAAM,KAAK,yBAAyB,EAC9D,0BAA2B,IAAM,CAC3B,KAAK,UACP,aAAa,KAAK,OAAO,EACzB,KAAK,QAAU,KAEnB,EACA,aAAcH,EAAO,aACrB,gBAAiB,IAAM,CACrB,KAAK,iBAAiB,gBAAgB,CACxC,CACF,CAAC,CAIH,EACA,KAAK,aAAa,MAAM,CAC1B,CAEQ,2BACNE,EACAC,EACA,CACA,QAAQ,IACN,sCACAD,EACAC,CAC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,yBAAyB,CAAC,CAC5D,CACF,CACF,CACF,EACA,uBAAwB,CACtB,MAAO,aACP,GAAI,CACF,eAAgB,CACd,OAAQ,YACR,QAAS,aACX,EACA,eAAgB,CACd,OAAQ,2CACR,WAAS,UAAO,CACd,eAAgB,CAAC,CAAE,MAAAA,CAAM,IAChB,QAAM,GAAG,CACd,KAAMA,EAAM,KACZ,sBAAuBA,EAAM,sBAC7B,iBAAkBA,EAAM,gBAC1B,CAAC,CAEL,CAAC,CACH,EACA,qBAAsB,CACpB,OAAQ,YACV,EACA,sBAAuB,CACrB,OAAQ,YACV,CACF,CACF,EACA,yCAA0C,CACxC,GAAI,CACF,eAAgB,CACd,OAAQ,cACR,QAAS,aACX,EACA,qBAAsB,CACpB,OAAQ,aACR,QAAS,CACP,CACE,KAAM,mBACN,OAAQ,CACN,YAAU,QAAK,IAAI,qCAAqC,CAC1D,CACF,EACA,CACE,KAAM,gBACR,CACF,CACF,EACA,sBAAuB,CACrB,OAAQ,aACR,QAAS,CACP,CACE,KAAM,mBACN,OAAQ,CACN,YAAU,QAAK,IAAI,qCAAqC,CAC1D,CACF,EACA,gBACF,CACF,EACA,eAAgB,CACd,QAAS,CAAC,CAAE,MAAAA,CAAM,IAAM,CACtB,QAAQ,IACN,8EACF,EACAA,EAAM,oBAAiB,QAAK,IAAI,yBAAyB,CAAC,CAC5D,CACF,CACF,CACF,EAEA,WAAY,CACV,MAAO,CAAC,oBAAqB,iBAAiB,EAC9C,KAAM,OACR,CACF,CACF,CAAC,CACH",
6
+ "names": ["DeviceConnectionStateMachine_exports", "__export", "DeviceConnectionStateMachine", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandUtils", "import_Error", "import_Errors", "params", "makeStateMachine", "apdu", "triggersDisconnection", "response", "error", "apduResponse", "dependencies", "responseCallback", "sendApduFn", "startReconnectionTimeout", "cancelReconnectionTimeout", "onTerminated", "closeConnection", "context", "res", "event"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var v=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of n(e))!c.call(r,o)&&o!==t&&d(r,o,{get:()=>e[o],enumerable:!(i=p(e,o))||i.enumerable});return r};var y=r=>v(d({},"__esModule",{value:!0}),r);var a={};module.exports=y(a);
1
+ "use strict";var d=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var a=(r,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of l(e))!p.call(r,o)&&o!==n&&d(r,o,{get:()=>e[o],enumerable:!(i=t(e,o))||i.enumerable});return r};var y=r=>a(d({},"__esModule",{value:!0}),r);var c={};module.exports=y(c);
2
2
  //# sourceMappingURL=DiscoveredDevice.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/transport/model/DiscoveredDevice.ts"],
4
- "sourcesContent": ["import { type DeviceId, type DeviceModel } from \"@api/device/DeviceModel\";\nimport { type TransportIdentifier } from \"@api/transport/model/TransportIdentifier\";\n\n/**\n * A discovered device.\n */\nexport type DiscoveredDevice = {\n readonly id: DeviceId;\n readonly deviceModel: DeviceModel;\n readonly transport: TransportIdentifier;\n};\n"],
4
+ "sourcesContent": ["import { type DeviceId, type DeviceModel } from \"@api/device/DeviceModel\";\nimport { type TransportIdentifier } from \"@api/transport/model/TransportIdentifier\";\n\n/**\n * A discovered device.\n */\nexport type DiscoveredDevice = {\n readonly id: DeviceId;\n readonly name: string;\n readonly deviceModel: DeviceModel;\n readonly transport: TransportIdentifier;\n readonly rssi?: number | null;\n};\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["DiscoveredDevice_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var l=(e,o)=>{for(var r in o)s(e,r,{get:o[r],enumerable:!0})},p=(e,o,r,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of a(o))!i.call(e,t)&&t!==r&&s(e,t,{get:()=>o[t],enumerable:!(d=c(o,t))||d.enumerable});return e};var u=e=>p(s({},"__esModule",{value:!0}),e);var T={};l(T,{DeviceAlreadyConnectedError:()=>E,DeviceNotInitializedError:()=>N,DeviceNotRecognizedError:()=>y,DisconnectError:()=>D,GeneralDmkError:()=>n,NoAccessibleDeviceError:()=>v,NoTransportProvidedError:()=>C,NoTransportsProvidedError:()=>A,OpeningConnectionError:()=>x,ReconnectionFailedError:()=>_,SendApduConcurrencyError:()=>w,TransportAlreadyExistsError:()=>m,TransportNotSupportedError:()=>k,UnknownDeviceError:()=>g});module.exports=u(T);class n{_tag="GeneralDmkError";originalError;constructor(o){o instanceof Error?this.originalError=o:o!==void 0&&(this.originalError=new Error(String(o)))}}class E extends n{constructor(r){super(r);this.err=r}_tag="DeviceAlreadyDiscoveredError"}class y extends n{constructor(r){super(r);this.err=r}_tag="DeviceNotRecognizedError"}class v extends n{constructor(r){super(r);this.err=r}_tag="NoAccessibleDeviceError"}class x extends n{constructor(r){super(r);this.err=r}_tag="ConnectionOpeningError"}class g extends n{constructor(r){super(r);this.err=r}_tag="UnknownDeviceError"}class k extends n{constructor(r){super(r);this.err=r}_tag="TransportNotSupportedError"}class w extends n{constructor(r){super(r);this.err=r}_tag="SendApduConcurrencyError"}class D extends n{constructor(r){super(r);this.err=r}_tag="DisconnectError"}class _ extends n{constructor(r){super(r);this.err=r}_tag="ReconnectionFailedError"}class N extends n{constructor(r){super(r);this.err=r}_tag="DeviceNotInitializedError"}class A extends n{constructor(r){super(r);this.err=r}_tag="NoTransportsProvidedError"}class m extends n{constructor(r){super(r);this.err=r}_tag="TransportAlreadyExistsError"}class C extends n{constructor(r){super(r);this.err=r}_tag="NoTransportProvidedError"}0&&(module.exports={DeviceAlreadyConnectedError,DeviceNotInitializedError,DeviceNotRecognizedError,DisconnectError,GeneralDmkError,NoAccessibleDeviceError,NoTransportProvidedError,NoTransportsProvidedError,OpeningConnectionError,ReconnectionFailedError,SendApduConcurrencyError,TransportAlreadyExistsError,TransportNotSupportedError,UnknownDeviceError});
1
+ "use strict";var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var l=(o,e)=>{for(var r in e)s(o,r,{get:e[r],enumerable:!0})},u=(o,e,r,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!i.call(o,t)&&t!==r&&s(o,t,{get:()=>e[t],enumerable:!(d=c(e,t))||d.enumerable});return o};var p=o=>u(s({},"__esModule",{value:!0}),o);var h={};l(h,{AlreadySendingApduError:()=>C,DeviceAlreadyConnectedError:()=>E,DeviceDisconnectedBeforeSendingApdu:()=>T,DeviceDisconnectedWhileSendingError:()=>m,DeviceNotInitializedError:()=>A,DeviceNotRecognizedError:()=>y,DisconnectError:()=>w,GeneralDmkError:()=>n,NoAccessibleDeviceError:()=>v,NoTransportProvidedError:()=>f,NoTransportsProvidedError:()=>N,OpeningConnectionError:()=>x,ReconnectionFailedError:()=>_,SendApduConcurrencyError:()=>k,TransportAlreadyExistsError:()=>S,TransportNotSupportedError:()=>D,UnknownDeviceError:()=>g});module.exports=p(h);class n{_tag="GeneralDmkError";originalError;constructor(e){e instanceof Error?this.originalError=e:e!==void 0&&(this.originalError=new Error(String(e)))}}class E extends n{constructor(r){super(r);this.err=r}_tag="DeviceAlreadyDiscoveredError"}class y extends n{constructor(r){super(r);this.err=r}_tag="DeviceNotRecognizedError"}class v extends n{constructor(r){super(r);this.err=r}_tag="NoAccessibleDeviceError"}class x extends n{constructor(r){super(r);this.err=r}_tag="ConnectionOpeningError"}class g extends n{constructor(r){super(r);this.err=r}_tag="UnknownDeviceError"}class D extends n{constructor(r){super(r);this.err=r}_tag="TransportNotSupportedError"}class k extends n{constructor(r){super(r);this.err=r}_tag="SendApduConcurrencyError"}class w extends n{constructor(r){super(r);this.err=r}_tag="DisconnectError"}class _ extends n{constructor(r){super(r);this.err=r}_tag="ReconnectionFailedError"}class A extends n{constructor(r){super(r);this.err=r}_tag="DeviceNotInitializedError"}class N extends n{constructor(r){super(r);this.err=r}_tag="NoTransportsProvidedError"}class S extends n{constructor(r){super(r);this.err=r}_tag="TransportAlreadyExistsError"}class m extends n{constructor(r){super(r);this.err=r}_tag="DeviceDisconnectedWhileSendingError"}class C extends n{constructor(r){super(r);this.err=r}_tag="AlreadySendingApduError"}class T extends n{constructor(r){super(r);this.err=r}_tag="DeviceDisconnectedBeforeSendingApdu"}class f extends n{constructor(r){super(r);this.err=r}_tag="NoTransportProvidedError"}0&&(module.exports={AlreadySendingApduError,DeviceAlreadyConnectedError,DeviceDisconnectedBeforeSendingApdu,DeviceDisconnectedWhileSendingError,DeviceNotInitializedError,DeviceNotRecognizedError,DisconnectError,GeneralDmkError,NoAccessibleDeviceError,NoTransportProvidedError,NoTransportsProvidedError,OpeningConnectionError,ReconnectionFailedError,SendApduConcurrencyError,TransportAlreadyExistsError,TransportNotSupportedError,UnknownDeviceError});
2
2
  //# sourceMappingURL=Errors.js.map