@ledgerhq/device-management-kit 0.0.0-rnble-transport-20250404160243 → 0.0.0-rnble-scan-permission-issue-20250929081059

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 (733) hide show
  1. package/README.md +9 -6
  2. package/lib/cjs/package.json +22 -23
  3. package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
  4. package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
  5. package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
  6. package/lib/cjs/src/api/DeviceManagementKit.test.js.map +3 -3
  7. package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
  8. package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
  9. package/lib/cjs/src/api/DmkConfig.js +1 -1
  10. package/lib/cjs/src/api/DmkConfig.js.map +1 -1
  11. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  12. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  13. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  14. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  15. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js +1 -1
  16. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  17. package/lib/cjs/src/api/command/di/commandModule.js +1 -1
  18. package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
  19. package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
  20. package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
  21. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  22. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  23. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  24. package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  25. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
  26. package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  27. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  28. package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  29. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
  30. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  31. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  32. package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  33. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  34. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  35. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
  36. package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  37. package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
  38. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +2 -2
  39. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
  40. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +2 -2
  41. package/lib/cjs/src/api/command/utils/GlobalCommandError.js +1 -1
  42. package/lib/cjs/src/api/command/utils/GlobalCommandError.js.map +2 -2
  43. package/lib/cjs/src/api/device/DeviceModel.js +1 -1
  44. package/lib/cjs/src/api/device/DeviceModel.js.map +2 -2
  45. package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
  46. package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
  47. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  48. package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  49. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  50. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  51. package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
  52. package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
  53. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
  54. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  55. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +1 -1
  56. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  57. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  58. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  59. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  60. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  61. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -1
  62. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
  63. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  64. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  65. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  66. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  67. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  68. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  69. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +2 -0
  70. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  71. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  72. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
  73. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  74. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  75. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  76. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  77. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
  78. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
  79. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  80. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  81. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  82. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  83. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
  84. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  85. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  86. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  87. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  88. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  89. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  90. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +2 -2
  91. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
  92. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +1 -1
  93. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  94. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  95. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  96. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  97. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
  98. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  99. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  100. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  101. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  102. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  103. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
  104. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  105. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  106. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  107. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  108. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  109. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  110. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  111. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  112. package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  113. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  114. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  115. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  116. package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  117. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  118. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  119. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  120. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  121. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  122. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +2 -2
  123. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  124. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  125. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  126. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  127. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  128. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
  129. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
  130. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  131. package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
  132. package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
  133. package/lib/cjs/src/api/index.js +1 -1
  134. package/lib/cjs/src/api/index.js.map +3 -3
  135. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  136. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  137. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +1 -1
  138. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  139. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  140. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +1 -1
  141. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +1 -1
  142. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  143. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  144. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  145. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  146. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  147. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  148. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +1 -1
  149. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +1 -1
  150. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  151. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  152. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  153. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  154. package/lib/cjs/src/api/secure-channel/task/types.js +1 -1
  155. package/lib/cjs/src/api/secure-channel/task/types.js.map +2 -2
  156. package/lib/cjs/src/api/secure-channel/utils.js +1 -1
  157. package/lib/cjs/src/api/secure-channel/utils.js.map +3 -3
  158. package/lib/cjs/src/api/secure-channel/utils.test.js +1 -1
  159. package/lib/cjs/src/api/secure-channel/utils.test.js.map +3 -3
  160. package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
  161. package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
  162. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
  163. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
  164. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  165. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  166. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  167. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  168. package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
  169. package/lib/cjs/src/api/types.js +1 -1
  170. package/lib/cjs/src/api/types.js.map +1 -1
  171. package/lib/cjs/src/api/utils/AppName.js +2 -0
  172. package/lib/cjs/src/api/utils/AppName.js.map +7 -0
  173. package/lib/cjs/src/api/utils/AppName.test.js +2 -0
  174. package/lib/cjs/src/api/utils/AppName.test.js.map +7 -0
  175. package/lib/cjs/src/api/utils/HexaString.js +1 -1
  176. package/lib/cjs/src/api/utils/HexaString.js.map +3 -3
  177. package/lib/cjs/src/api/utils/HexaString.test.js +1 -1
  178. package/lib/cjs/src/api/utils/HexaString.test.js.map +2 -2
  179. package/lib/cjs/src/di.js +1 -1
  180. package/lib/cjs/src/di.js.map +2 -2
  181. package/lib/cjs/src/internal/config/di/configModule.js +1 -1
  182. package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
  183. package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
  184. package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
  185. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
  186. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  187. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  188. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  189. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
  190. package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  191. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
  192. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  193. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  194. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  195. package/lib/cjs/src/internal/device-session/model/DevicePinger.js +1 -1
  196. package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +3 -3
  197. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  198. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  199. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  200. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  201. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  202. package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
  203. package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
  204. package/lib/cjs/src/internal/device-session/model/Frame.js.map +3 -3
  205. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  206. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  207. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  208. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  209. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  210. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  211. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  212. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  213. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  214. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  215. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  216. package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  217. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  218. package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  219. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  220. package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  221. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  222. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  223. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  224. package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  225. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
  226. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  227. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  228. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  229. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  230. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  231. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  232. package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  233. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
  234. package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
  235. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  236. package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  237. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  238. package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  239. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  240. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  241. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  242. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  243. package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
  244. package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
  245. package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
  246. package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
  247. package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
  248. package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
  249. package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
  250. package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
  251. package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
  252. package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
  253. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  254. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  255. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  256. package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  257. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
  258. package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
  259. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +1 -1
  260. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +3 -3
  261. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +1 -1
  262. package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +3 -3
  263. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  264. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  265. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  266. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  267. package/lib/cjs/src/internal/secure-channel/model/Errors.js +1 -1
  268. package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +3 -3
  269. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
  270. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  271. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  272. package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  273. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +1 -1
  274. package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +1 -1
  275. package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
  276. package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
  277. package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
  278. package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
  279. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
  280. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  281. package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
  282. package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
  283. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  284. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  285. package/lib/esm/package.json +22 -23
  286. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  287. package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
  288. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  289. package/lib/esm/src/api/DeviceManagementKit.test.js.map +3 -3
  290. package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
  291. package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
  292. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  293. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  294. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  295. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  296. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +1 -1
  297. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  298. package/lib/esm/src/api/command/di/commandModule.js +1 -1
  299. package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
  300. package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
  301. package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
  302. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
  303. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
  304. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
  305. package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
  306. package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
  307. package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
  308. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
  309. package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
  310. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
  311. package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
  312. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
  313. package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
  314. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  315. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  316. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
  317. package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
  318. package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
  319. package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
  320. package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
  321. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +2 -2
  322. package/lib/esm/src/api/command/utils/GlobalCommandError.js +1 -1
  323. package/lib/esm/src/api/command/utils/GlobalCommandError.js.map +2 -2
  324. package/lib/esm/src/api/device/DeviceModel.js +1 -1
  325. package/lib/esm/src/api/device/DeviceModel.js.map +2 -2
  326. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
  327. package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  328. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  329. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  330. package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
  331. package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
  332. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
  333. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  334. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +1 -1
  335. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  336. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  337. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  338. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  339. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
  340. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  341. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  342. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +2 -0
  343. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
  344. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
  345. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
  346. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  347. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
  348. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  349. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
  350. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  351. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  352. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  353. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  354. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
  355. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
  356. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
  357. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
  358. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  359. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
  360. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  361. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
  362. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  363. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  364. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  365. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  366. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
  367. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
  368. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
  369. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
  370. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  371. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
  372. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  373. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  374. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  375. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
  376. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
  377. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
  378. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
  379. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
  380. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
  381. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
  382. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
  383. package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
  384. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
  385. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
  386. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
  387. package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
  388. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
  389. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
  390. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
  391. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
  392. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  393. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +2 -2
  394. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  395. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  396. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  397. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  398. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  399. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  400. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  401. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  402. package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
  403. package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
  404. package/lib/esm/src/api/index.js +1 -1
  405. package/lib/esm/src/api/index.js.map +3 -3
  406. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  407. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  408. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  409. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
  410. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  411. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  412. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  413. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  414. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  415. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
  416. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  417. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  418. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  419. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  420. package/lib/esm/src/api/secure-channel/task/types.js +1 -1
  421. package/lib/esm/src/api/secure-channel/task/types.js.map +2 -2
  422. package/lib/esm/src/api/secure-channel/utils.js +1 -1
  423. package/lib/esm/src/api/secure-channel/utils.js.map +3 -3
  424. package/lib/esm/src/api/secure-channel/utils.test.js +1 -1
  425. package/lib/esm/src/api/secure-channel/utils.test.js.map +3 -3
  426. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
  427. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
  428. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  429. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  430. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  431. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  432. package/lib/esm/src/api/utils/AppName.js +2 -0
  433. package/lib/esm/src/api/utils/AppName.js.map +7 -0
  434. package/lib/esm/src/api/utils/AppName.test.js +2 -0
  435. package/lib/esm/src/api/utils/AppName.test.js.map +7 -0
  436. package/lib/esm/src/api/utils/HexaString.js +1 -1
  437. package/lib/esm/src/api/utils/HexaString.js.map +3 -3
  438. package/lib/esm/src/api/utils/HexaString.test.js +1 -1
  439. package/lib/esm/src/api/utils/HexaString.test.js.map +2 -2
  440. package/lib/esm/src/di.js +1 -1
  441. package/lib/esm/src/di.js.map +3 -3
  442. package/lib/esm/src/internal/config/di/configModule.js +1 -1
  443. package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
  444. package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
  445. package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
  446. package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
  447. package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  448. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  449. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  450. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
  451. package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
  452. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
  453. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  454. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  455. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  456. package/lib/esm/src/internal/device-session/model/DevicePinger.js +1 -1
  457. package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +3 -3
  458. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  459. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  460. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
  461. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
  462. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
  463. package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
  464. package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
  465. package/lib/esm/src/internal/device-session/model/Frame.js.map +3 -3
  466. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  467. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  468. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  469. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  470. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  471. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  472. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  473. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  474. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  475. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  476. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
  477. package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
  478. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
  479. package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
  480. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
  481. package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
  482. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
  483. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
  484. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
  485. package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
  486. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
  487. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  488. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  489. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  490. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
  491. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
  492. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
  493. package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
  494. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
  495. package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
  496. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
  497. package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
  498. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  499. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  500. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  501. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  502. package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
  503. package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
  504. package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
  505. package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
  506. package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
  507. package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
  508. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
  509. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
  510. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
  511. package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
  512. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +1 -1
  513. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +3 -3
  514. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +1 -1
  515. package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +3 -3
  516. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  517. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  518. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  519. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  520. package/lib/esm/src/internal/secure-channel/model/Errors.js +1 -1
  521. package/lib/esm/src/internal/secure-channel/model/Errors.js.map +3 -3
  522. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
  523. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
  524. package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
  525. package/lib/esm/src/internal/send/di/sendModule.js +1 -1
  526. package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
  527. package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
  528. package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
  529. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
  530. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  531. package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
  532. package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
  533. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  534. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  535. package/lib/types/src/api/DeviceManagementKit.d.ts +5 -1
  536. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  537. package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
  538. package/lib/types/src/api/DmkConfig.d.ts +1 -0
  539. package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
  540. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  541. package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
  542. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +66 -0
  543. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
  544. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +1 -0
  545. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts.map +1 -1
  546. package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
  547. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
  548. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
  549. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
  550. package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
  551. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +30 -2
  552. package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
  553. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
  554. package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
  555. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
  556. package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
  557. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  558. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
  559. package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
  560. package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
  561. package/lib/types/src/api/command/utils/CommandUtils.d.ts +3 -0
  562. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  563. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts +1 -1
  564. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts.map +1 -1
  565. package/lib/types/src/api/device/DeviceModel.d.ts +2 -1
  566. package/lib/types/src/api/device/DeviceModel.d.ts.map +1 -1
  567. package/lib/types/src/api/device-action/DeviceAction.d.ts +3 -1
  568. package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
  569. package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  570. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +5 -0
  571. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  572. package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
  573. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +1 -0
  574. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts.map +1 -1
  575. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
  576. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +1 -1
  577. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  578. package/lib/types/src/api/device-action/os/Errors.d.ts +20 -0
  579. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  580. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts +58 -0
  581. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
  582. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
  583. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
  584. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +28 -0
  585. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
  586. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts +1 -1
  587. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  588. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
  589. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
  590. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  591. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
  592. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
  593. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
  594. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
  595. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +65 -0
  596. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
  597. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
  598. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +0 -1
  599. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
  600. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
  601. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
  602. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
  603. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
  604. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +24 -0
  605. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
  606. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  607. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -1
  608. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  609. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
  610. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
  611. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
  612. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
  613. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
  614. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
  615. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
  616. package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
  617. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
  618. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
  619. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
  620. package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
  621. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
  622. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
  623. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
  624. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
  625. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts +1 -0
  626. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts.map +1 -1
  627. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  628. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
  629. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  630. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  631. package/lib/types/src/api/device-session/DeviceSessionState.d.ts +93 -0
  632. package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
  633. package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
  634. package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
  635. package/lib/types/src/api/index.d.ts +5 -1
  636. package/lib/types/src/api/index.d.ts.map +1 -1
  637. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -1
  638. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +2 -1
  639. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -1
  640. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -1
  641. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +2 -1
  642. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -1
  643. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -1
  644. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +2 -1
  645. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -1
  646. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
  647. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +2 -1
  648. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -1
  649. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +5 -2
  650. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -1
  651. package/lib/types/src/api/secure-channel/task/types.d.ts +6 -1
  652. package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -1
  653. package/lib/types/src/api/secure-channel/utils.d.ts +0 -11
  654. package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -1
  655. package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
  656. package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
  657. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +8 -7
  658. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -1
  659. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts +2 -0
  660. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts.map +1 -0
  661. package/lib/types/src/api/transport/model/Errors.d.ts +7 -3
  662. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  663. package/lib/types/src/api/transport/model/Transport.d.ts +1 -1
  664. package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
  665. package/lib/types/src/api/types.d.ts +5 -2
  666. package/lib/types/src/api/types.d.ts.map +1 -1
  667. package/lib/types/src/api/utils/AppName.d.ts +2 -0
  668. package/lib/types/src/api/utils/AppName.d.ts.map +1 -0
  669. package/lib/types/src/api/utils/AppName.test.d.ts +2 -0
  670. package/lib/types/src/api/utils/AppName.test.d.ts.map +1 -0
  671. package/lib/types/src/api/utils/HexaString.d.ts +4 -3
  672. package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
  673. package/lib/types/src/di.d.ts.map +1 -1
  674. package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
  675. package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
  676. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
  677. package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
  678. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  679. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +1 -1
  680. package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -1
  681. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +2 -1
  682. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  683. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  684. package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -1
  685. package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
  686. package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.d.ts.map +1 -1
  687. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -1
  688. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  689. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts +1 -1
  690. package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -1
  691. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts +1 -1
  692. package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
  693. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +4 -2
  694. package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
  695. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
  696. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +20 -4
  697. package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
  698. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +41 -6
  699. package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
  700. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +104 -18
  701. package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
  702. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +5 -0
  703. package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
  704. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  705. package/lib/types/src/internal/manager-api/model/Application.d.ts +12 -12
  706. package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
  707. package/lib/types/src/internal/manager-api/model/Const.d.ts +1 -0
  708. package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
  709. package/lib/types/src/internal/manager-api/model/Firmware.d.ts +17 -3
  710. package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
  711. package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
  712. package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
  713. package/lib/types/src/internal/manager-api/model/Params.d.ts +20 -0
  714. package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
  715. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +7 -1
  716. package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
  717. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +39 -1
  718. package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
  719. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +3 -1
  720. package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -1
  721. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
  722. package/lib/types/src/internal/secure-channel/model/Errors.d.ts +22 -2
  723. package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -1
  724. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +2 -2
  725. package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -1
  726. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +3 -3
  727. package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -1
  728. package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
  729. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +5 -1
  730. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
  731. package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
  732. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  733. package/package.json +16 -17
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/service/DefaultApduSenderService.test.ts"],
4
- "sourcesContent": ["import { Maybe } from \"purify-ts\";\n\nimport { Frame } from \"@internal/device-session/model/Frame\";\nimport { FrameHeader } from \"@internal/device-session/model/FrameHeader\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { DefaultApduSenderService } from \"./DefaultApduSenderService\";\n\nvi.mock(\"uuid\", () => ({\n v4: vi.fn().mockReturnValue(\"42\"),\n}));\n\nconst loggerService = new DefaultLoggerPublisherService([], \"frame\");\n\ndescribe(\"DefaultApduSenderService\", () => {\n describe(\"[USB] With padding and channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n // getVersion APDU\n const apdu = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 2 frames\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([\n // editDeviceName APDU\n 0xe0, 0xd4, 0x00, 0x00, 0x40,\n // editDeviceNameData\n 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74,\n 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67,\n 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48,\n 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61,\n 0x72, 0x6d, 0x6f, 0x6e, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79,\n 0x42, 0x69, 0x74, 0x65,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0x00, 0x45])),\n index: new Uint8Array([0x00, 0x00]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0xd4, 0x00, 0x00, 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73,\n 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41,\n 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79,\n 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c,\n 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d,\n 0x6f, 0x6e,\n ]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0x00, 0x01]),\n length: 5,\n dataSize: Maybe.zero(),\n }),\n data: new Uint8Array([\n 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79, 0x42, 0x69, 0x74,\n 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x45, 0xe0, 0xd4, 0x00, 0x00,\n 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72,\n 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72,\n 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69,\n 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e,\n 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d, 0x6f, 0x6e,\n ]),\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x01, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65,\n 0x72, 0x79, 0x42, 0x69, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n });\n\n describe(\"[BLE] Without padding nor channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 123,\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 5])),\n index: new Uint8Array([0, 0]),\n length: 5,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 3 frames\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 10,\n },\n () => loggerService,\n );\n const command = new Uint8Array([\n 0x01, 0x05, 0x4f, 0x4c, 0x4f, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n 0x2d, 0x32, 0x00, 0x90, 0x00,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0, 0]),\n dataSize: Maybe.of(new Uint8Array([0, 0x11])),\n length: 5,\n }),\n data: new Uint8Array([0x01, 0x05, 0x4f, 0x4c, 0x4f]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x01]),\n length: 3,\n }),\n data: new Uint8Array([0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x02]),\n length: 3,\n }),\n data: new Uint8Array([0x2d, 0x32, 0x00, 0x90, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x11, 0x01, 0x05, 0x4f, 0x4c, 0x4f,\n ]),\n new Uint8Array([\n 0x05, 0x00, 0x01, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n ]),\n new Uint8Array([0x05, 0x00, 0x02, 0x2d, 0x32, 0x00, 0x90, 0x00]),\n ]);\n });\n });\n\n describe(\"Errors\", () => {\n it(\"should return a well formatted header with very big channel\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n channel: Maybe.of(\n new Uint8Array([0x123434, 0x34444, 0x56454, 0x7844, 0x90444]),\n ),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x44, 0x44])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x44, 0x44, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00,\n ]),\n ]);\n });\n it(\"should return empty if packet size smaller than header size\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: Math.random() & 4,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n\n it(\"should return empty if no apdu length\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n // random frameSize < 0xff\n frameSize: Math.random() & 0xff,\n // random padding boolean\n padding: Math.random() > 0.5,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAsB,qBAEtBC,EAAsB,gDACtBC,EAA4B,sDAC5BC,EAA8C,4EAE9CC,EAAyC,sCAEzC,GAAG,KAAK,OAAQ,KAAO,CACrB,GAAI,GAAG,GAAG,EAAE,gBAAgB,IAAI,CAClC,EAAE,EAEF,MAAMC,EAAgB,IAAI,gCAA8B,CAAC,EAAG,OAAO,EAEnE,SAAS,2BAA4B,IAAM,CACzC,SAAS,iCAAkC,IAAM,CAC/C,GAAG,wBAAyB,IAAM,CAEhC,MAAMC,EAAU,QAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,EAC/CC,EAAoB,IAAI,2BAC5B,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5C,MAAO,IAAI,WAAW,CAAC,EAAG,CAAC,CAAC,EAC5B,OAAQ,CACV,CAAC,EACD,KAAM,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,CACrD,CAAC,CACH,CAAC,EACD,OAAOA,EAAO,IAAKC,GAAOA,EAAG,WAAW,CAAC,CAAC,EAAE,QAAQ,CAClD,IAAI,WAAW,CACb,GAAM,GAAM,EAAM,EAAM,EAAM,EAAM,EAAM,IAAM,EAAM,EAAM,EAC5D,CACF,CAAC,CACH,CAAC,CACH,CAAC,EACD,GAAG,8DAA+D,IAAM,CAEtE,MAAMH,EAAoB,IAAI,2BAC5B,CACE,UAAW,KAAK,OAAO,EAAI,EAC3B,QAAS,QAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,CAChD,EACA,IAAMF,CACR,EACMM,EAAU,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,EAGvDF,EAASF,EAAkB,UAAUI,CAAO,EAGlD,OAAOF,EAAO,MAAM,EAAE,QAAQ,CAAC,CACjC,CAAC,EAED,GAAG,wCAAyC,IAAM,CAEhD,MAAMF,EAAoB,IAAI,2BAC5B,CAEE,UAAW,KAAK,OAAO,EAAI,IAE3B,QAAS,KAAK,OAAO,EAAI,GACzB,QAAS,QAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,CAChD,EACA,IAAMF,CACR,EACMM,EAAU,IAAI,WAAW,CAAC,CAAC,EAG3BF,EAASF,EAAkB,UAAUI,CAAO,EAGlD,OAAOF,EAAO,MAAM,EAAE,QAAQ,CAAC,CACjC,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Maybe } from \"purify-ts\";\n\nimport { Frame } from \"@internal/device-session/model/Frame\";\nimport { FrameHeader } from \"@internal/device-session/model/FrameHeader\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { DefaultApduSenderService } from \"./DefaultApduSenderService\";\n\nvi.mock(\"uuid\", () => ({\n v4: vi.fn().mockReturnValue(\"42\"),\n}));\n\nconst loggerService = new DefaultLoggerPublisherService([], \"frame\");\n\ndescribe(\"DefaultApduSenderService\", () => {\n describe(\"[USB] With padding and channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n // getVersion APDU\n const apdu = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 2 frames\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([\n // editDeviceName APDU\n 0xe0, 0xd4, 0x00, 0x00, 0x40,\n // editDeviceNameData\n 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74,\n 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67,\n 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48,\n 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61,\n 0x72, 0x6d, 0x6f, 0x6e, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79,\n 0x42, 0x69, 0x74, 0x65,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0x00, 0x45])),\n index: new Uint8Array([0x00, 0x00]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0xd4, 0x00, 0x00, 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73,\n 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41,\n 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79,\n 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c,\n 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d,\n 0x6f, 0x6e,\n ]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0x00, 0x01]),\n length: 5,\n dataSize: Maybe.zero(),\n }),\n data: new Uint8Array([\n 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79, 0x42, 0x69, 0x74,\n 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n ]),\n }),\n ]);\n\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x45, 0xe0, 0xd4, 0x00, 0x00,\n 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72,\n 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72,\n 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69,\n 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e,\n 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d, 0x6f, 0x6e,\n ]),\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x01, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65,\n 0x72, 0x79, 0x42, 0x69, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return exactly 0 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n expect(frames).toEqual([]);\n });\n\n it(\"should return exactly 1 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([\n 0xe0, 0x06, 0x00, 0x13, 0x34, 0x47, 0x32, 0x49, 0x67, 0x73, 0x51, 0x68,\n 0x68, 0x58, 0x53, 0x69, 0x4d, 0x71, 0x38, 0x6b, 0x55, 0x50, 0x79, 0x4e,\n 0x6e, 0x46, 0x63, 0x63, 0x31, 0x45, 0x69, 0x41, 0x67, 0x77, 0x35, 0x4e,\n 0x78, 0x6d, 0x2d, 0x68, 0x69, 0x6f, 0x79, 0x56, 0x67, 0x6a, 0x39, 0x77,\n 0x48, 0x56, 0x65, 0x4d, 0x04, 0x09, 0x92, 0xc0, 0xfe,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0x00, 0x39])),\n index: new Uint8Array([0x00, 0x00]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0x06, 0x00, 0x13, 0x34, 0x47, 0x32, 0x49, 0x67, 0x73, 0x51,\n 0x68, 0x68, 0x58, 0x53, 0x69, 0x4d, 0x71, 0x38, 0x6b, 0x55, 0x50,\n 0x79, 0x4e, 0x6e, 0x46, 0x63, 0x63, 0x31, 0x45, 0x69, 0x41, 0x67,\n 0x77, 0x35, 0x4e, 0x78, 0x6d, 0x2d, 0x68, 0x69, 0x6f, 0x79, 0x56,\n 0x67, 0x6a, 0x39, 0x77, 0x48, 0x56, 0x65, 0x4d, 0x04, 0x09, 0x92,\n 0xc0, 0xfe,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x39, 0xe0, 0x06, 0x00, 0x13,\n 0x34, 0x47, 0x32, 0x49, 0x67, 0x73, 0x51, 0x68, 0x68, 0x58, 0x53,\n 0x69, 0x4d, 0x71, 0x38, 0x6b, 0x55, 0x50, 0x79, 0x4e, 0x6e, 0x46,\n 0x63, 0x63, 0x31, 0x45, 0x69, 0x41, 0x67, 0x77, 0x35, 0x4e, 0x78,\n 0x6d, 0x2d, 0x68, 0x69, 0x6f, 0x79, 0x56, 0x67, 0x6a, 0x39, 0x77,\n 0x48, 0x56, 0x65, 0x4d, 0x04, 0x09, 0x92, 0xc0, 0xfe,\n ]),\n ]);\n });\n });\n\n describe(\"[BLE] Without padding nor channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 123,\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 5])),\n index: new Uint8Array([0, 0]),\n length: 5,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 3 frames\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 10,\n },\n () => loggerService,\n );\n const command = new Uint8Array([\n 0x01, 0x05, 0x4f, 0x4c, 0x4f, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n 0x2d, 0x32, 0x00, 0x90, 0x00,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0, 0]),\n dataSize: Maybe.of(new Uint8Array([0, 0x11])),\n length: 5,\n }),\n data: new Uint8Array([0x01, 0x05, 0x4f, 0x4c, 0x4f]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x01]),\n length: 3,\n }),\n data: new Uint8Array([0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x02]),\n length: 3,\n }),\n data: new Uint8Array([0x2d, 0x32, 0x00, 0x90, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x11, 0x01, 0x05, 0x4f, 0x4c, 0x4f,\n ]),\n new Uint8Array([\n 0x05, 0x00, 0x01, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n ]),\n new Uint8Array([0x05, 0x00, 0x02, 0x2d, 0x32, 0x00, 0x90, 0x00]),\n ]);\n });\n });\n\n describe(\"Errors\", () => {\n it(\"should return a well formatted header with very big channel\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n channel: Maybe.of(\n new Uint8Array([0x123434, 0x34444, 0x56454, 0x7844, 0x90444]),\n ),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x44, 0x44])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x44, 0x44, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00,\n ]),\n ]);\n });\n it(\"should return empty if packet size smaller than header size\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: Math.random() & 4,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n\n it(\"should return empty if no apdu length\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n // random frameSize < 0xff\n frameSize: Math.random() & 0xff,\n // random padding boolean\n padding: Math.random() > 0.5,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAsB,qBAEtBC,EAAsB,gDACtBC,EAA4B,sDAC5BC,EAA8C,4EAE9CC,EAAyC,sCAEzC,GAAG,KAAK,OAAQ,KAAO,CACrB,GAAI,GAAG,GAAG,EAAE,gBAAgB,IAAI,CAClC,EAAE,EAEF,MAAMC,EAAgB,IAAI,gCAA8B,CAAC,EAAG,OAAO,EAEnE,SAAS,2BAA4B,IAAM,CACzC,SAAS,iCAAkC,IAAM,CAC/C,GAAG,wBAAyB,IAAM,CAEhC,MAAMC,EAAU,QAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,EAC/CC,EAAoB,IAAI,2BAC5B,CACE,UAAW,GACX,QAAS,GACT,QAAAD,CACF,EACA,IAAMD,CACR,EAEMG,EAAO,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,EAGpDC,EAASF,EAAkB,UAAUC,CAAI,EAG/C,OAAOC,CAAM,EAAE,QAAQ,CACrB,IAAI,QAAM,CACR,OAAQ,IAAI,cAAY,CACtB,KAAM,KACN,QAAS,QAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,EAC9C,QAAS,IAAI,WAAW,CAAC,CAAI,CAAC,EAC9B,SAAU,QAAM,GAAG,IAAI,WAAW,CAAC,EAAG,CAAI,CAAC,CAAC,EAC5C,MAAO,IAAI,WAAW,CAAC,EAAG,CAAC,CAAC,EAC5B,OAAQ,CACV,CAAC,EACD,K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,OAAO,EAAI,GACzB,QAAS,QAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,CAChD,EACA,IAAMF,CACR,EACMM,EAAU,IAAI,WAAW,CAAC,CAAC,EAG3BF,EAASF,EAAkB,UAAUI,CAAO,EAGlD,OAAOF,EAAO,MAAM,EAAE,QAAQ,CAAC,CACjC,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["import_purify_ts", "import_Frame", "import_FrameHeader", "import_DefaultLoggerPublisherService", "import_DefaultApduSenderService", "loggerService", "channel", "apduSenderService", "apdu", "frames", "fr", "command"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var C=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var i in e)C(t,i,{get:e[i],enumerable:!0})},g=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of y(e))!S.call(t,s)&&s!==i&&C(t,s,{get:()=>e[s],enumerable:!(a=L(e,s))||a.enumerable});return t};var u=t=>g(C({},"__esModule",{value:!0}),t);var F={};T(F,{discoveryModuleFactory:()=>A});module.exports=u(F);var n=require("inversify"),r=require("../../discovery/use-case/ConnectUseCase"),U=require("../../discovery/use-case/DisconnectUseCase"),v=require("../../discovery/use-case/GetConnectedDeviceUseCase"),m=require("../../discovery/use-case/ListConnectedDevicesUseCase"),D=require("../../discovery/use-case/ListenToAvailableDevicesUseCase"),p=require("../../discovery/use-case/ListenToConnectedDeviceUseCase"),f=require("../../discovery/use-case/StartDiscoveringUseCase"),l=require("../../discovery/use-case/StopDiscoveringUseCase"),c=require("../../../../src/di.stub"),o=require("./discoveryTypes");const A=({stub:t=!1})=>new n.ContainerModule((e,i,a,s)=>{e(o.discoveryTypes.ConnectUseCase).to(r.ConnectUseCase),e(o.discoveryTypes.DisconnectUseCase).to(U.DisconnectUseCase),e(o.discoveryTypes.StartDiscoveringUseCase).to(f.StartDiscoveringUseCase),e(o.discoveryTypes.StopDiscoveringUseCase).to(l.StopDiscoveringUseCase),e(o.discoveryTypes.GetConnectedDeviceUseCase).to(v.GetConnectedDeviceUseCase),e(o.discoveryTypes.ListenToAvailableDevicesUseCase).to(D.ListenToAvailableDevicesUseCase),e(o.discoveryTypes.ListenToConnectedDeviceUseCase).to(p.ListenToConnectedDeviceUseCase),e(o.discoveryTypes.ListConnectedDevicesUseCase).to(m.ListConnectedDevicesUseCase),t&&(s(o.discoveryTypes.StartDiscoveringUseCase).to(c.StubUseCase),s(o.discoveryTypes.StopDiscoveringUseCase).to(c.StubUseCase),s(o.discoveryTypes.ConnectUseCase).to(c.StubUseCase),s(o.discoveryTypes.DisconnectUseCase).to(c.StubUseCase),s(o.discoveryTypes.GetConnectedDeviceUseCase).to(c.StubUseCase),s(o.discoveryTypes.ListenToAvailableDevicesUseCase).to(c.StubUseCase),s(o.discoveryTypes.ListenToConnectedDeviceUseCase).to(c.StubUseCase),s(o.discoveryTypes.ListConnectedDevicesUseCase).to(c.StubUseCase))});0&&(module.exports={discoveryModuleFactory});
1
+ "use strict";var C=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var s in e)C(t,s,{get:e[s],enumerable:!0})},A=(t,e,s,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of T(e))!g.call(t,i)&&i!==s&&C(t,i,{get:()=>e[i],enumerable:!(c=L(e,i))||c.enumerable});return t};var F=t=>A(C({},"__esModule",{value:!0}),t);var M={};u(M,{discoveryModuleFactory:()=>G});module.exports=F(M);var r=require("inversify"),n=require("../../discovery/use-case/ConnectUseCase"),U=require("../../discovery/use-case/DisconnectUseCase"),v=require("../../discovery/use-case/GetConnectedDeviceUseCase"),m=require("../../discovery/use-case/ListConnectedDevicesUseCase"),D=require("../../discovery/use-case/ListenToAvailableDevicesUseCase"),p=require("../../discovery/use-case/ListenToConnectedDeviceUseCase"),f=require("../../discovery/use-case/StartDiscoveringUseCase"),l=require("../../discovery/use-case/StopDiscoveringUseCase"),a=require("../../../../src/di.stub"),o=require("./discoveryTypes");const G=({stub:t=!1})=>new r.ContainerModule(({bind:e,rebindSync:s})=>{e(o.discoveryTypes.ConnectUseCase).to(n.ConnectUseCase),e(o.discoveryTypes.DisconnectUseCase).to(U.DisconnectUseCase),e(o.discoveryTypes.StartDiscoveringUseCase).to(f.StartDiscoveringUseCase),e(o.discoveryTypes.StopDiscoveringUseCase).to(l.StopDiscoveringUseCase),e(o.discoveryTypes.GetConnectedDeviceUseCase).to(v.GetConnectedDeviceUseCase),e(o.discoveryTypes.ListenToAvailableDevicesUseCase).to(D.ListenToAvailableDevicesUseCase),e(o.discoveryTypes.ListenToConnectedDeviceUseCase).to(p.ListenToConnectedDeviceUseCase),e(o.discoveryTypes.ListConnectedDevicesUseCase).to(m.ListConnectedDevicesUseCase),t&&(s(o.discoveryTypes.ConnectUseCase).to(a.StubUseCase),s(o.discoveryTypes.DisconnectUseCase).to(a.StubUseCase),s(o.discoveryTypes.StartDiscoveringUseCase).to(a.StubUseCase),s(o.discoveryTypes.StopDiscoveringUseCase).to(a.StubUseCase),s(o.discoveryTypes.GetConnectedDeviceUseCase).to(a.StubUseCase),s(o.discoveryTypes.ListenToAvailableDevicesUseCase).to(a.StubUseCase),s(o.discoveryTypes.ListenToConnectedDeviceUseCase).to(a.StubUseCase),s(o.discoveryTypes.ListConnectedDevicesUseCase).to(a.StubUseCase))});0&&(module.exports={discoveryModuleFactory});
2
2
  //# sourceMappingURL=discoveryModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/discovery/di/discoveryModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { ConnectUseCase } from \"@internal/discovery/use-case/ConnectUseCase\";\nimport { DisconnectUseCase } from \"@internal/discovery/use-case/DisconnectUseCase\";\nimport { GetConnectedDeviceUseCase } from \"@internal/discovery/use-case/GetConnectedDeviceUseCase\";\nimport { ListConnectedDevicesUseCase } from \"@internal/discovery/use-case/ListConnectedDevicesUseCase\";\nimport { ListenToAvailableDevicesUseCase } from \"@internal/discovery/use-case/ListenToAvailableDevicesUseCase\";\nimport { ListenToConnectedDeviceUseCase } from \"@internal/discovery/use-case/ListenToConnectedDeviceUseCase\";\nimport { StartDiscoveringUseCase } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nimport { StopDiscoveringUseCase } from \"@internal/discovery/use-case/StopDiscoveringUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { discoveryTypes } from \"./discoveryTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const discoveryModuleFactory = ({ stub = false }: FactoryProps) =>\n new ContainerModule((bind, _unbind, _isBound, rebind) => {\n bind(discoveryTypes.ConnectUseCase).to(ConnectUseCase);\n bind(discoveryTypes.DisconnectUseCase).to(DisconnectUseCase);\n bind(discoveryTypes.StartDiscoveringUseCase).to(StartDiscoveringUseCase);\n bind(discoveryTypes.StopDiscoveringUseCase).to(StopDiscoveringUseCase);\n bind(discoveryTypes.GetConnectedDeviceUseCase).to(\n GetConnectedDeviceUseCase,\n );\n bind(discoveryTypes.ListenToAvailableDevicesUseCase).to(\n ListenToAvailableDevicesUseCase,\n );\n bind(discoveryTypes.ListenToConnectedDeviceUseCase).to(\n ListenToConnectedDeviceUseCase,\n );\n bind(discoveryTypes.ListConnectedDevicesUseCase).to(\n ListConnectedDevicesUseCase,\n );\n\n if (stub) {\n rebind(discoveryTypes.StartDiscoveringUseCase).to(StubUseCase);\n rebind(discoveryTypes.StopDiscoveringUseCase).to(StubUseCase);\n rebind(discoveryTypes.ConnectUseCase).to(StubUseCase);\n rebind(discoveryTypes.DisconnectUseCase).to(StubUseCase);\n rebind(discoveryTypes.GetConnectedDeviceUseCase).to(StubUseCase);\n rebind(discoveryTypes.ListenToAvailableDevicesUseCase).to(StubUseCase);\n rebind(discove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EAErE,CAAC",
6
- "names": ["discoveryModule_exports", "__export", "discoveryModuleFactory", "__toCommonJS", "import_inversify", "import_ConnectUseCase", "import_DisconnectUseCase", "import_GetConnectedDeviceUseCase", "import_ListConnectedDevicesUseCase", "import_ListenToAvailableDevicesUseCase", "import_ListenToConnectedDeviceUseCase", "import_StartDiscoveringUseCase", "import_StopDiscoveringUseCase", "import_di", "import_discoveryTypes", "stub", "bind", "_unbind", "_isBound", "rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { ConnectUseCase } from \"@internal/discovery/use-case/ConnectUseCase\";\nimport { DisconnectUseCase } from \"@internal/discovery/use-case/DisconnectUseCase\";\nimport { GetConnectedDeviceUseCase } from \"@internal/discovery/use-case/GetConnectedDeviceUseCase\";\nimport { ListConnectedDevicesUseCase } from \"@internal/discovery/use-case/ListConnectedDevicesUseCase\";\nimport { ListenToAvailableDevicesUseCase } from \"@internal/discovery/use-case/ListenToAvailableDevicesUseCase\";\nimport { ListenToConnectedDeviceUseCase } from \"@internal/discovery/use-case/ListenToConnectedDeviceUseCase\";\nimport { StartDiscoveringUseCase } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nimport { StopDiscoveringUseCase } from \"@internal/discovery/use-case/StopDiscoveringUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { discoveryTypes } from \"./discoveryTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const discoveryModuleFactory = ({ stub = false }: FactoryProps) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind(discoveryTypes.ConnectUseCase).to(ConnectUseCase);\n bind(discoveryTypes.DisconnectUseCase).to(DisconnectUseCase);\n bind(discoveryTypes.StartDiscoveringUseCase).to(StartDiscoveringUseCase);\n bind(discoveryTypes.StopDiscoveringUseCase).to(StopDiscoveringUseCase);\n bind(discoveryTypes.GetConnectedDeviceUseCase).to(\n GetConnectedDeviceUseCase,\n );\n bind(discoveryTypes.ListenToAvailableDevicesUseCase).to(\n ListenToAvailableDevicesUseCase,\n );\n bind(discoveryTypes.ListenToConnectedDeviceUseCase).to(\n ListenToConnectedDeviceUseCase,\n );\n bind(discoveryTypes.ListConnectedDevicesUseCase).to(\n ListConnectedDevicesUseCase,\n );\n\n if (stub) {\n rebindSync(discoveryTypes.ConnectUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.DisconnectUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.StartDiscoveringUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.StopDiscoveringUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.GetConnectedDeviceUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.ListenToAvailableDevicesUseCase).to(\n StubUseCase,\n );\n rebindSync(discoveryTypes.ListenToConnectedDeviceUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.ListConnectedDevicesUseCase).to(StubUseCase);\n }\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA+B,uDAC/BC,EAAkC,0DAClCC,EAA0C,kEAC1CC,EAA4C,oEAC5CC,EAAgD,wEAChDC,EAA+C,uEAC/CC,EAAwC,gEACxCC,EAAuC,+DACvCC,EAA4B,6BAE5BC,EAA+B,4BAMxB,MAAMZ,EAAyB,CAAC,CAAE,KAAAa,EAAO,EAAM,IACpD,IAAI,kBAAgB,CAAC,CAAE,KAAAC,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EAAK,iBAAe,cAAc,EAAE,GAAG,gBAAc,EACrDA,EAAK,iBAAe,iBAAiB,EAAE,GAAG,mBAAiB,EAC3DA,EAAK,iBAAe,uBAAuB,EAAE,GAAG,yBAAuB,EACvEA,EAAK,iBAAe,sBAAsB,EAAE,GAAG,wBAAsB,EACrEA,EAAK,iBAAe,yBAAyB,EAAE,GAC7C,2BACF,EACAA,EAAK,iBAAe,+BAA+B,EAAE,GACnD,iCACF,EACAA,EAAK,iBAAe,8BAA8B,EAAE,GAClD,gCACF,EACAA,EAAK,iBAAe,2BAA2B,EAAE,GAC/C,6BACF,EAEID,IACFE,EAAW,iBAAe,cAAc,EAAE,GAAG,aAAW,EACxDA,EAAW,iBAAe,iBAAiB,EAAE,GAAG,aAAW,EAC3DA,EAAW,iBAAe,uBAAuB,EAAE,GAAG,aAAW,EACjEA,EAAW,iBAAe,sBAAsB,EAAE,GAAG,aAAW,EAChEA,EAAW,iBAAe,yBAAyB,EAAE,GAAG,aAAW,EACnEA,EAAW,iBAAe,+BAA+B,EAAE,GACzD,aACF,EACAA,EAAW,iBAAe,8BAA8B,EAAE,GAAG,aAAW,EACxEA,EAAW,iBAAe,2BAA2B,EAAE,GAAG,aAAW,EAEzE,CAAC",
6
+ "names": ["discoveryModule_exports", "__export", "discoveryModuleFactory", "__toCommonJS", "import_inversify", "import_ConnectUseCase", "import_DisconnectUseCase", "import_GetConnectedDeviceUseCase", "import_ListConnectedDevicesUseCase", "import_ListenToAvailableDevicesUseCase", "import_ListenToConnectedDeviceUseCase", "import_StartDiscoveringUseCase", "import_StopDiscoveringUseCase", "import_di", "import_discoveryTypes", "stub", "bind", "rebindSync"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var r=require("inversify"),n=require("../../../api/transport/model/__mocks__/TransportMock"),c=require("../../device-model/di/deviceModelModule"),i=require("../../device-session/di/deviceSessionModule"),a=require("../../discovery/use-case/ConnectUseCase"),m=require("../../discovery/use-case/DisconnectUseCase"),p=require("../../discovery/use-case/ListConnectedDevicesUseCase"),f=require("../../discovery/use-case/ListenToAvailableDevicesUseCase"),l=require("../../discovery/use-case/StartDiscoveringUseCase"),d=require("../../discovery/use-case/StopDiscoveringUseCase"),C=require("../../logger-publisher/di/loggerModule"),v=require("../../manager-api/di/managerApiModule"),u=require("../../secure-channel/di/secureChannelModule"),g=require("../../transport/di/transportModule"),U=require("./discoveryModule"),o=require("./discoveryTypes");describe("discoveryModuleFactory",()=>{let e,t,s;beforeEach(()=>{t=(0,U.discoveryModuleFactory)({stub:!1}),e=new r.Container,s=new n.TransportMock,e.load(t,(0,C.loggerModuleFactory)(),(0,c.deviceModelModuleFactory)({stub:!1}),(0,i.deviceSessionModuleFactory)(),(0,g.transportModuleFactory)({transports:[vi.fn().mockImplementation(()=>s)]}),(0,v.managerApiModuleFactory)({config:{managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url"}}),(0,u.secureChannelModuleFactory)({config:{webSocketUrl:"http://fake-websocket.url"}}))}),it("should return the device module",()=>{expect(t).toBeDefined()}),it("should return none mocked use cases",()=>{const y=e.get(o.discoveryTypes.StartDiscoveringUseCase);expect(y).toBeInstanceOf(l.StartDiscoveringUseCase);const D=e.get(o.discoveryTypes.StopDiscoveringUseCase);expect(D).toBeInstanceOf(d.StopDiscoveringUseCase);const k=e.get(o.discoveryTypes.DisconnectUseCase);expect(k).toBeInstanceOf(m.DisconnectUseCase);const M=e.get(o.discoveryTypes.ConnectUseCase);expect(M).toBeInstanceOf(a.ConnectUseCase);const b=e.get(o.discoveryTypes.ListenToAvailableDevicesUseCase);expect(b).toBeInstanceOf(f.ListenToAvailableDevicesUseCase);const F=e.get(o.discoveryTypes.ListConnectedDevicesUseCase);expect(F).toBeInstanceOf(p.ListConnectedDevicesUseCase)})});
1
+ "use strict";var r=require("inversify"),n=require("../../../api/transport/model/__mocks__/TransportMock"),c=require("../../device-model/di/deviceModelModule"),i=require("../../device-session/di/deviceSessionModule"),a=require("../../discovery/use-case/ConnectUseCase"),m=require("../../discovery/use-case/DisconnectUseCase"),p=require("../../discovery/use-case/ListConnectedDevicesUseCase"),f=require("../../discovery/use-case/ListenToAvailableDevicesUseCase"),l=require("../../discovery/use-case/StartDiscoveringUseCase"),d=require("../../discovery/use-case/StopDiscoveringUseCase"),C=require("../../logger-publisher/di/loggerModule"),v=require("../../manager-api/di/managerApiModule"),u=require("../../secure-channel/di/secureChannelModule"),g=require("../../transport/di/transportModule"),U=require("./discoveryModule"),o=require("./discoveryTypes");describe("discoveryModuleFactory",()=>{let e,t,s;beforeEach(()=>{t=(0,U.discoveryModuleFactory)({stub:!1}),e=new r.Container,s=new n.TransportMock,e.loadSync(t,(0,C.loggerModuleFactory)(),(0,c.deviceModelModuleFactory)({stub:!1}),(0,i.deviceSessionModuleFactory)(),(0,g.transportModuleFactory)({transports:[vi.fn().mockImplementation(()=>s)]}),(0,v.managerApiModuleFactory)({config:{managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url"}}),(0,u.secureChannelModuleFactory)({config:{webSocketUrl:"http://fake-websocket.url"}}))}),it("should return the device module",()=>{expect(t).toBeDefined()}),it("should return none mocked use cases",()=>{const y=e.get(o.discoveryTypes.StartDiscoveringUseCase);expect(y).toBeInstanceOf(l.StartDiscoveringUseCase);const D=e.get(o.discoveryTypes.StopDiscoveringUseCase);expect(D).toBeInstanceOf(d.StopDiscoveringUseCase);const k=e.get(o.discoveryTypes.DisconnectUseCase);expect(k).toBeInstanceOf(m.DisconnectUseCase);const M=e.get(o.discoveryTypes.ConnectUseCase);expect(M).toBeInstanceOf(a.ConnectUseCase);const b=e.get(o.discoveryTypes.ListenToAvailableDevicesUseCase);expect(b).toBeInstanceOf(f.ListenToAvailableDevicesUseCase);const F=e.get(o.discoveryTypes.ListConnectedDevicesUseCase);expect(F).toBeInstanceOf(p.ListConnectedDevicesUseCase)})});
2
2
  //# sourceMappingURL=discoveryModule.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/discovery/di/discoveryModule.test.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { type DmkConfig, type Transport } from \"@api/types\";\nimport { deviceModelModuleFactory } from \"@internal/device-model/di/deviceModelModule\";\nimport { deviceSessionModuleFactory } from \"@internal/device-session/di/deviceSessionModule\";\nimport { ConnectUseCase } from \"@internal/discovery/use-case/ConnectUseCase\";\nimport { DisconnectUseCase } from \"@internal/discovery/use-case/DisconnectUseCase\";\nimport { ListConnectedDevicesUseCase } from \"@internal/discovery/use-case/ListConnectedDevicesUseCase\";\nimport { ListenToAvailableDevicesUseCase } from \"@internal/discovery/use-case/ListenToAvailableDevicesUseCase\";\nimport { StartDiscoveringUseCase } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nimport { StopDiscoveringUseCase } from \"@internal/discovery/use-case/StopDiscoveringUseCase\";\nimport { loggerModuleFactory } from \"@internal/logger-publisher/di/loggerModule\";\nimport { managerApiModuleFactory } from \"@internal/manager-api/di/managerApiModule\";\nimport { secureChannelModuleFactory } from \"@internal/secure-channel/di/secureChannelModule\";\nimport { transportModuleFactory } from \"@internal/transport/di/transportModule\";\n\nimport { discoveryModuleFactory } from \"./discoveryModule\";\nimport { discoveryTypes } from \"./discoveryTypes\";\n\ndescribe(\"discoveryModuleFactory\", () => {\n let container: Container;\n let mod: ReturnType<typeof discoveryModuleFactory>;\n let transport: Transport;\n beforeEach(() => {\n mod = discoveryModuleFactory({ stub: false });\n container = new Container();\n transport = new TransportMock();\n\n container.load(\n mod,\n // The following modules are injected into discovery module\n loggerModuleFactory(),\n deviceModelModuleFactory({ stub: false }),\n deviceSessionModuleFactory(),\n transportModuleFactory({\n transports: [vi.fn().mockImplementation(() => transport)],\n }),\n managerApiModuleFactory({\n config: {\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n } as DmkConfig,\n }),\n secureChannelModuleFactory({\n config: {\n webSocketUrl: \"http://fake-websocket.url\",\n } as DmkConfig,\n }),\n );\n });\n it(\"should return the device module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none mocked use cases\", () => {\n const startDiscoveringUseCase = container.get(\n discoveryTypes.StartDiscoveringUseCase,\n );\n expect(startDiscoveringUseCase).toBeInstanceOf(StartDiscoveringUseCase);\n\n const stopDiscoveringUseCase = container.get(\n discoveryTypes.StopDiscoveringUseCase,\n );\n expect(stopDiscoveringUseCase).toBeInstanceOf(StopDiscoveringUseCase);\n\n const disconnectUseCase = container.get(discoveryTypes.DisconnectUseCase);\n expect(disconnectUseCase).toBeInstanceOf(DisconnectUseCase);\n\n const connectUseCase = container.get(discoveryTypes.ConnectUseCase);\n expect(connectUseCase).toBeInstanceOf(ConnectUseCase);\n\n const listenToAvailableDevicesUseCase = container.get(\n discoveryTypes.ListenToAvailableDevicesUseCase,\n );\n expect(listenToAvailableDevicesUseCase).toBeInstanceOf(\n ListenToAvailableDevicesUseCase,\n );\n const listConnectedDevicesUseCase = container.get(\n discoveryTypes.ListConnectedDevicesUseCase,\n );\n expect(listConnectedDevicesUseCase).toBeInstanceOf(\n ListConnectedDevicesUseCase,\n );\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA8B,wDAE9BC,EAAyC,uDACzCC,EAA2C,2DAC3CC,EAA+B,uDAC/BC,EAAkC,0DAClCC,EAA4C,oEAC5CC,EAAgD,wEAChDC,EAAwC,gEACxCC,EAAuC,+DACvCC,EAAoC,sDACpCC,EAAwC,qDACxCC,EAA2C,2DAC3CC,EAAuC,kDAEvCC,EAAuC,6BACvCC,EAA+B,4BAE/B,SAAS,yBAA0B,IAAM,CACvC,IAAIC,EACAC,EACAC,EACJ,WAAW,IAAM,CACfD,KAAM,0BAAuB,CAAE,KAAM,EAAM,CAAC,EAC5CD,EAAY,IAAI,YAChBE,EAAY,IAAI,gBAEhBF,EAAU,KACRC,KAEA,uBAAoB,KACpB,4BAAyB,CAAE,KAAM,EAAM,CAAC,KACxC,8BAA2B,KAC3B,0BAAuB,CACrB,WAAY,CAAC,GAAG,GAAG,EAAE,mBAAmB,IAAMC,CAAS,CAAC,CAC1D,CAAC,KACD,2BAAwB,CACtB,OAAQ,CACN,cAAe,kBACf,QAAS,sBACX,CACF,CAAC,KACD,8BAA2B,CACzB,OAAQ,CACN,aAAc,2BAChB,CACF,CAAC,CACH,CACF,CAAC,EACD,GAAG,kCAAmC,IAAM,CAC1C,OAAOD,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,sCAAuC,IAAM,CAC9C,MAAME,EAA0BH,EAAU,IACxC,iBAAe,uBACjB,EACA,OAAOG,CAAuB,EAAE,eAAe,yBAAuB,EAEtE,MAAMC,EAAyBJ,EAAU,IACvC,iBAAe,sBACjB,EACA,OAAOI,CAAsB,EAAE,eAAe,wBAAsB,EAEpE,MAAMC,EAAoBL,EAAU,IAAI,iBAAe,iBAAiB,EACxE,OAAOK,CAAiB,EAAE,eAAe,mBAAiB,EAE1D,MAAMC,EAAiBN,EAAU,IAAI,iBAAe,cAAc,EAClE,OAAOM,CAAc,EAAE,eAAe,gBAAc,EAEpD,MAAMC,EAAkCP,EAAU,IAChD,iBAAe,+BACjB,EACA,OAAOO,CAA+B,EAAE,eACtC,iCACF,EACA,MAAMC,EAA8BR,EAAU,IAC5C,iBAAe,2BACjB,EACA,OAAOQ,CAA2B,EAAE,eAClC,6BACF,CACF,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { type DmkConfig, type Transport } from \"@api/types\";\nimport { deviceModelModuleFactory } from \"@internal/device-model/di/deviceModelModule\";\nimport { deviceSessionModuleFactory } from \"@internal/device-session/di/deviceSessionModule\";\nimport { ConnectUseCase } from \"@internal/discovery/use-case/ConnectUseCase\";\nimport { DisconnectUseCase } from \"@internal/discovery/use-case/DisconnectUseCase\";\nimport { ListConnectedDevicesUseCase } from \"@internal/discovery/use-case/ListConnectedDevicesUseCase\";\nimport { ListenToAvailableDevicesUseCase } from \"@internal/discovery/use-case/ListenToAvailableDevicesUseCase\";\nimport { StartDiscoveringUseCase } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nimport { StopDiscoveringUseCase } from \"@internal/discovery/use-case/StopDiscoveringUseCase\";\nimport { loggerModuleFactory } from \"@internal/logger-publisher/di/loggerModule\";\nimport { managerApiModuleFactory } from \"@internal/manager-api/di/managerApiModule\";\nimport { secureChannelModuleFactory } from \"@internal/secure-channel/di/secureChannelModule\";\nimport { transportModuleFactory } from \"@internal/transport/di/transportModule\";\n\nimport { discoveryModuleFactory } from \"./discoveryModule\";\nimport { discoveryTypes } from \"./discoveryTypes\";\n\ndescribe(\"discoveryModuleFactory\", () => {\n let container: Container;\n let mod: ReturnType<typeof discoveryModuleFactory>;\n let transport: Transport;\n beforeEach(() => {\n mod = discoveryModuleFactory({ stub: false });\n container = new Container();\n transport = new TransportMock();\n\n container.loadSync(\n mod,\n // The following modules are injected into discovery module\n loggerModuleFactory(),\n deviceModelModuleFactory({ stub: false }),\n deviceSessionModuleFactory(),\n transportModuleFactory({\n transports: [vi.fn().mockImplementation(() => transport)],\n }),\n managerApiModuleFactory({\n config: {\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n } as DmkConfig,\n }),\n secureChannelModuleFactory({\n config: {\n webSocketUrl: \"http://fake-websocket.url\",\n } as DmkConfig,\n }),\n );\n });\n it(\"should return the device module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none mocked use cases\", () => {\n const startDiscoveringUseCase = container.get(\n discoveryTypes.StartDiscoveringUseCase,\n );\n expect(startDiscoveringUseCase).toBeInstanceOf(StartDiscoveringUseCase);\n\n const stopDiscoveringUseCase = container.get(\n discoveryTypes.StopDiscoveringUseCase,\n );\n expect(stopDiscoveringUseCase).toBeInstanceOf(StopDiscoveringUseCase);\n\n const disconnectUseCase = container.get(discoveryTypes.DisconnectUseCase);\n expect(disconnectUseCase).toBeInstanceOf(DisconnectUseCase);\n\n const connectUseCase = container.get(discoveryTypes.ConnectUseCase);\n expect(connectUseCase).toBeInstanceOf(ConnectUseCase);\n\n const listenToAvailableDevicesUseCase = container.get(\n discoveryTypes.ListenToAvailableDevicesUseCase,\n );\n expect(listenToAvailableDevicesUseCase).toBeInstanceOf(\n ListenToAvailableDevicesUseCase,\n );\n const listConnectedDevicesUseCase = container.get(\n discoveryTypes.ListConnectedDevicesUseCase,\n );\n expect(listConnectedDevicesUseCase).toBeInstanceOf(\n ListConnectedDevicesUseCase,\n );\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA8B,wDAE9BC,EAAyC,uDACzCC,EAA2C,2DAC3CC,EAA+B,uDAC/BC,EAAkC,0DAClCC,EAA4C,oEAC5CC,EAAgD,wEAChDC,EAAwC,gEACxCC,EAAuC,+DACvCC,EAAoC,sDACpCC,EAAwC,qDACxCC,EAA2C,2DAC3CC,EAAuC,kDAEvCC,EAAuC,6BACvCC,EAA+B,4BAE/B,SAAS,yBAA0B,IAAM,CACvC,IAAIC,EACAC,EACAC,EACJ,WAAW,IAAM,CACfD,KAAM,0BAAuB,CAAE,KAAM,EAAM,CAAC,EAC5CD,EAAY,IAAI,YAChBE,EAAY,IAAI,gBAEhBF,EAAU,SACRC,KAEA,uBAAoB,KACpB,4BAAyB,CAAE,KAAM,EAAM,CAAC,KACxC,8BAA2B,KAC3B,0BAAuB,CACrB,WAAY,CAAC,GAAG,GAAG,EAAE,mBAAmB,IAAMC,CAAS,CAAC,CAC1D,CAAC,KACD,2BAAwB,CACtB,OAAQ,CACN,cAAe,kBACf,QAAS,sBACX,CACF,CAAC,KACD,8BAA2B,CACzB,OAAQ,CACN,aAAc,2BAChB,CACF,CAAC,CACH,CACF,CAAC,EACD,GAAG,kCAAmC,IAAM,CAC1C,OAAOD,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,sCAAuC,IAAM,CAC9C,MAAME,EAA0BH,EAAU,IACxC,iBAAe,uBACjB,EACA,OAAOG,CAAuB,EAAE,eAAe,yBAAuB,EAEtE,MAAMC,EAAyBJ,EAAU,IACvC,iBAAe,sBACjB,EACA,OAAOI,CAAsB,EAAE,eAAe,wBAAsB,EAEpE,MAAMC,EAAoBL,EAAU,IAAI,iBAAe,iBAAiB,EACxE,OAAOK,CAAiB,EAAE,eAAe,mBAAiB,EAE1D,MAAMC,EAAiBN,EAAU,IAAI,iBAAe,cAAc,EAClE,OAAOM,CAAc,EAAE,eAAe,gBAAc,EAEpD,MAAMC,EAAkCP,EAAU,IAChD,iBAAe,+BACjB,EACA,OAAOO,CAA+B,EAAE,eACtC,iCACF,EACA,MAAMC,EAA8BR,EAAU,IAC5C,iBAAe,2BACjB,EACA,OAAOQ,CAA2B,EAAE,eAClC,6BACF,CACF,CAAC,CACH,CAAC",
6
6
  "names": ["import_inversify", "import_TransportMock", "import_deviceModelModule", "import_deviceSessionModule", "import_ConnectUseCase", "import_DisconnectUseCase", "import_ListConnectedDevicesUseCase", "import_ListenToAvailableDevicesUseCase", "import_StartDiscoveringUseCase", "import_StopDiscoveringUseCase", "import_loggerModule", "import_managerApiModule", "import_secureChannelModule", "import_transportModule", "import_discoveryModule", "import_discoveryTypes", "container", "mod", "transport", "startDiscoveringUseCase", "stopDiscoveringUseCase", "disconnectUseCase", "connectUseCase", "listenToAvailableDevicesUseCase", "listConnectedDevicesUseCase"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=require("purify-ts"),D=require("../../../api/transport/model/__mocks__/TransportMock"),S=require("../../../api/transport/model/Errors"),y=require("../../../api/transport/model/TransportConnectedDevice.stub"),v=require("../../device-session/data/DeviceSessionRefresherConst"),u=require("../../device-session/model/DeviceSession.stub"),C=require("../../device-session/model/Errors"),h=require("../../device-session/service/DefaultDeviceSessionService"),w=require("../../logger-publisher/service/DefaultLoggerPublisherService"),g=require("../../manager-api/data/AxiosManagerApiDataSource"),T=require("../../manager-api/service/DefaultManagerApiService"),k=require("../../secure-channel/data/DefaultSecureChannelDataSource"),A=require("../../secure-channel/service/DefaultSecureChannelService"),E=require("../../transport/service/DefaultTransportService"),a=require("./DisconnectUseCase");vi.mock("@internal/transport/service/DefaultTransportService");let e,p,s=[];const n=vi.fn().mockReturnValue(new w.DefaultLoggerPublisherService([],"DisconnectUseCaseTest"));let c,m,f,d,l;const i="sessionId";describe("DisconnectUseCase",()=>{beforeAll(()=>{p=new D.TransportMock,s=[p],e=new h.DefaultDeviceSessionService(n),c=new E.DefaultTransportService,vi.spyOn(c,"getTransport").mockReturnValue(o.Maybe.of(p))}),it("should disconnect from a device",async()=>{const r=(0,y.connectedDeviceStubBuilder)();f=new g.AxiosManagerApiDataSource({}),m=new T.DefaultManagerApiService(f),d=new k.DefaultSecureChannelDataSource({}),l=new A.DefaultSecureChannelService(d);const t=(0,u.deviceSessionStubBuilder)({id:i,connectedDevice:r},n,m,l,v.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS);vi.spyOn(e,"getDeviceSessionById").mockImplementation(()=>(0,o.Right)(t)),vi.spyOn(t,"close"),vi.spyOn(e,"removeDeviceSession"),vi.spyOn(s[0],"disconnect").mockImplementation(()=>Promise.resolve((0,o.Right)(void 0))),await new a.DisconnectUseCase(c,e,n).execute({sessionId:i}),expect(t.close).toHaveBeenCalled(),expect(e.removeDeviceSession).toHaveBeenCalledWith(i),expect(s[0].disconnect).toHaveBeenCalledWith({connectedDevice:r})}),it("should throw an error when deviceSession not found",async()=>{const r=new a.DisconnectUseCase(c,e,n);try{await r.execute({sessionId:i})}catch(t){expect(t).toStrictEqual(new C.DeviceSessionNotFound)}}),it("should throw an error if usb hid disconnection fails",async()=>{vi.spyOn(e,"getDeviceSessionById").mockImplementation(()=>(0,o.Right)((0,u.deviceSessionStubBuilder)({id:i},n,m,l,v.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS))),vi.spyOn(s[0],"disconnect").mockResolvedValue((0,o.Left)(new S.DisconnectError));const r=new a.DisconnectUseCase(c,e,n);try{await r.execute({sessionId:i})}catch(t){expect(t).toStrictEqual(new S.DisconnectError)}})});
1
+ "use strict";var o=require("purify-ts"),D=require("../../../api/transport/model/__mocks__/TransportMock"),S=require("../../../api/transport/model/Errors"),y=require("../../../api/transport/model/TransportConnectedDevice.stub"),u=require("../../device-session/data/DeviceSessionRefresherConst"),v=require("../../device-session/model/DeviceSession.stub"),C=require("../../device-session/model/Errors"),h=require("../../device-session/service/DefaultDeviceSessionService"),w=require("../../logger-publisher/service/DefaultLoggerPublisherService"),g=require("../../manager-api/data/AxiosManagerApiDataSource"),T=require("../../manager-api/service/DefaultManagerApiService"),k=require("../../secure-channel/data/DefaultSecureChannelDataSource"),A=require("../../secure-channel/service/DefaultSecureChannelService"),E=require("../../transport/service/DefaultTransportService"),a=require("./DisconnectUseCase");vi.mock("@internal/transport/service/DefaultTransportService");let e,p,s=[];const n=vi.fn().mockReturnValue(new w.DefaultLoggerPublisherService([],"DisconnectUseCaseTest"));let c,m,f,d,l;const i="sessionId";describe("DisconnectUseCase",()=>{beforeAll(()=>{p=new D.TransportMock,s=[p],e=new h.DefaultDeviceSessionService(n),c=new E.DefaultTransportService,vi.spyOn(c,"getTransport").mockReturnValue(o.Maybe.of(p))}),it("should disconnect from a device",async()=>{const r=(0,y.connectedDeviceStubBuilder)();f=new g.AxiosManagerApiDataSource({}),m=new T.DefaultManagerApiService(f),d=new k.DefaultSecureChannelDataSource({}),l=new A.DefaultSecureChannelService(d);const t=(0,v.deviceSessionStubBuilder)({id:i,connectedDevice:r},n,m,l,u.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS);vi.spyOn(e,"getDeviceSessionById").mockImplementation(()=>(0,o.Right)(t)),vi.spyOn(t,"close"),vi.spyOn(e,"removeDeviceSession"),vi.spyOn(s[0],"disconnect").mockImplementation(()=>Promise.resolve((0,o.Right)(void 0))),await new a.DisconnectUseCase(c,e,n).execute({sessionId:i}),expect(t.close).toHaveBeenCalled(),expect(e.removeDeviceSession).toHaveBeenCalledWith(i),expect(s[0].disconnect).toHaveBeenCalledWith({connectedDevice:r})}),it("should throw an error when deviceSession not found",async()=>{const r=new a.DisconnectUseCase(c,e,n);try{await r.execute({sessionId:i})}catch(t){expect(t).toStrictEqual(new C.DeviceSessionNotFound)}}),it("should throw an error if usb hid disconnection fails",async()=>{vi.spyOn(e,"getDeviceSessionById").mockImplementation(()=>(0,o.Right)((0,v.deviceSessionStubBuilder)({id:i},n,m,l,u.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS))),vi.spyOn(s[0],"disconnect").mockResolvedValue((0,o.Left)(new S.DisconnectError));const r=new a.DisconnectUseCase(c,e,n);try{await r.execute({sessionId:i})}catch(t){expect(t).toStrictEqual(new S.DisconnectError)}})});
2
2
  //# sourceMappingURL=DisconnectUseCase.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/discovery/use-case/DisconnectUseCase.test.ts"],
4
- "sourcesContent": ["import { Left, Maybe, Right } from \"purify-ts\";\n\nimport { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { DisconnectError } from \"@api/transport/model/Errors\";\nimport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nimport type { DmkConfig, Transport } from \"@api/types\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\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 { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nimport { DisconnectUseCase } from \"./DisconnectUseCase\";\n\nvi.mock(\"@internal/transport/service/DefaultTransportService\");\n\nlet sessionService: DefaultDeviceSessionService;\n// TODO test several transports\nlet transport: Transport;\nlet transports: Transport[] = [];\nconst loggerFactory = vi\n .fn()\n .mockReturnValue(\n new DefaultLoggerPublisherService([], \"DisconnectUseCaseTest\"),\n );\nlet transportService: TransportService;\nlet managerApi: ManagerApiService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet secureChannelDataSource: SecureChannelDataSource;\nlet secureChannel: SecureChannelService;\n\nconst sessionId = \"sessionId\";\n\ndescribe(\"DisconnectUseCase\", () => {\n beforeAll(() => {\n transport = new TransportMock();\n transports = [transport];\n sessionService = new DefaultDeviceSessionService(loggerFactory);\n // @ts-expect-error mock\n transportService = new DefaultTransportService();\n vi.spyOn(transportService, \"getTransport\").mockReturnValue(\n Maybe.of(transport),\n );\n });\n\n it(\"should disconnect from a device\", async () => {\n // Given\n const connectedDevice = connectedDeviceStubBuilder();\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n const deviceSession = deviceSessionStubBuilder(\n {\n id: sessionId,\n connectedDevice,\n },\n loggerFactory,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockImplementation(() =>\n Right(deviceSession),\n );\n vi.spyOn(deviceSession, \"close\");\n vi.spyOn(sessionService, \"removeDeviceSession\");\n vi.spyOn(transports[0]!, \"disconnect\").mockImplementation(() =>\n Promise.resolve(Right(void 0)),\n );\n const disconnectUseCase = new DisconnectUseCase(\n transportService,\n sessionService,\n loggerFactory,\n );\n // When\n await disconnectUseCase.execute({ sessionId });\n\n // Then\n expect(deviceSession.close).toHaveBeenCalled();\n expect(sessionService.removeDeviceSession).toHaveBeenCalledWith(sessionId);\n expect(transports[0]!.disconnect).toHaveBeenCalledWith({\n connectedDevice,\n });\n });\n\n it(\"should throw an error when deviceSession not found\", async () => {\n // Given\n const disconnectUseCase = new DisconnectUseCase(\n transportService,\n sessionService,\n loggerFactory,\n );\n\n // When\n try {\n await disconnectUseCase.execute({ sessionId });\n } catch (e) {\n // Then\n expect(e).toStrictEqual(new DeviceSessionNotFound());\n }\n });\n\n it(\"should throw an error if usb hid disconnection fails\", async () => {\n // Given\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockImplementation(() =>\n Right(\n deviceSessionStubBuilder(\n { id: sessionId },\n loggerFactory,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ),\n ),\n );\n\n vi.spyOn(transports[0]!, \"disconnect\").mockResolvedValue(\n Left(new DisconnectError()),\n );\n\n const disconnectUseCase = new DisconnectUseCase(\n transportService,\n sessionService,\n loggerFactory,\n );\n\n // When\n try {\n await disconnectUseCase.execute({ sessionId });\n } catch (e) {\n // Then\n expect(e).toStrictEqual(new DisconnectError());\n }\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAmC,qBAEnCC,EAA8B,wDAC9BC,EAAgC,uCAChCC,EAA2C,8DAE3CC,EAAyD,qEACzDC,EAAyC,6DACzCH,EAAsC,iDACtCI,EAA4C,wEAC5CC,EAA8C,4EAC9CC,EAA0C,gEAE1CC,EAAyC,kEAEzCC,EAA+C,wEAE/CC,EAA4C,wEAE5CC,EAAwC,+DAGxCC,EAAkC,+BAElC,GAAG,KAAK,qDAAqD,EAE7D,IAAIC,EAEAC,EACAC,EAA0B,CAAC,EAC/B,MAAMC,EAAgB,GACnB,GAAG,EACH,gBACC,IAAI,gCAA8B,CA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AQ,CAAE,UAAAH,CAAU,CAAC,CAC/C,OAASI,EAAG,CAEV,OAAOA,CAAC,EAAE,cAAc,IAAI,uBAAuB,CACrD,CACF,CAAC,EAED,GAAG,uDAAwD,SAAY,CAErE,GAAG,MAAMb,EAAgB,sBAAsB,EAAE,mBAAmB,OAClE,YACE,4BACE,CAAE,GAAIS,CAAU,EAChBN,EACAE,EACAG,EACA,0CACF,CACF,CACF,EAEA,GAAG,MAAMN,EAAW,CAAC,EAAI,YAAY,EAAE,qBACrC,QAAK,IAAI,iBAAiB,CAC5B,EAEA,MAAMU,EAAoB,IAAI,oBAC5BR,EACAJ,EACAG,CACF,EAGA,GAAI,CACF,MAAMS,EAAkB,QAAQ,CAAE,UAAAH,CAAU,CAAC,CAC/C,OAASI,EAAG,CAEV,OAAOA,CAAC,EAAE,cAAc,IAAI,iBAAiB,CAC/C,CACF,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Left, Maybe, Right } from \"purify-ts\";\n\nimport { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { DisconnectError } from \"@api/transport/model/Errors\";\nimport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nimport type { DmkConfig, Transport } from \"@api/types\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\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 { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nimport { DisconnectUseCase } from \"./DisconnectUseCase\";\n\nvi.mock(\"@internal/transport/service/DefaultTransportService\");\n\nlet sessionService: DefaultDeviceSessionService;\n// TODO test several transports\nlet transport: Transport;\nlet transports: Transport[] = [];\nconst loggerFactory = vi\n .fn()\n .mockReturnValue(\n new DefaultLoggerPublisherService([], \"DisconnectUseCaseTest\"),\n );\nlet transportService: TransportService;\nlet managerApi: ManagerApiService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet secureChannelDataSource: SecureChannelDataSource;\nlet secureChannel: SecureChannelService;\n\nconst sessionId = \"sessionId\";\n\ndescribe(\"DisconnectUseCase\", () => {\n beforeAll(() => {\n transport = new TransportMock();\n transports = [transport];\n sessionService = new DefaultDeviceSessionService(loggerFactory);\n // @ts-expect-error mock\n transportService = new DefaultTransportService();\n vi.spyOn(transportService, \"getTransport\").mockReturnValue(\n Maybe.of(transport),\n );\n });\n\n it(\"should disconnect from a device\", async () => {\n // Given\n const connectedDevice = connectedDeviceStubBuilder();\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n const deviceSession = deviceSessionStubBuilder(\n {\n id: sessionId,\n connectedDevice,\n },\n loggerFactory,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockImplementation(() =>\n Right(deviceSession),\n );\n vi.spyOn(deviceSession, \"close\");\n vi.spyOn(sessionService, \"removeDeviceSession\");\n vi.spyOn(transports[0]!, \"disconnect\").mockImplementation(() =>\n Promise.resolve(Right(undefined)),\n );\n const disconnectUseCase = new DisconnectUseCase(\n transportService,\n sessionService,\n loggerFactory,\n );\n // When\n await disconnectUseCase.execute({ sessionId });\n\n // Then\n expect(deviceSession.close).toHaveBeenCalled();\n expect(sessionService.removeDeviceSession).toHaveBeenCalledWith(sessionId);\n expect(transports[0]!.disconnect).toHaveBeenCalledWith({\n connectedDevice,\n });\n });\n\n it(\"should throw an error when deviceSession not found\", async () => {\n // Given\n const disconnectUseCase = new DisconnectUseCase(\n transportService,\n sessionService,\n loggerFactory,\n );\n\n // When\n try {\n await disconnectUseCase.execute({ sessionId });\n } catch (e) {\n // Then\n expect(e).toStrictEqual(new DeviceSessionNotFound());\n }\n });\n\n it(\"should throw an error if usb hid disconnection fails\", async () => {\n // Given\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockImplementation(() =>\n Right(\n deviceSessionStubBuilder(\n { id: sessionId },\n loggerFactory,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ),\n ),\n );\n\n vi.spyOn(transports[0]!, \"disconnect\").mockResolvedValue(\n Left(new DisconnectError()),\n );\n\n const disconnectUseCase = new DisconnectUseCase(\n transportService,\n sessionService,\n loggerFactory,\n );\n\n // When\n try {\n await disconnectUseCase.execute({ sessionId });\n } catch (e) {\n // Then\n expect(e).toStrictEqual(new DisconnectError());\n }\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAmC,qBAEnCC,EAA8B,wDAC9BC,EAAgC,uCAChCC,EAA2C,8DAE3CC,EAAyD,qEACzDC,EAAyC,6DACzCH,EAAsC,iDACtCI,EAA4C,wEAC5CC,EAA8C,4EAC9CC,EAA0C,gEAE1CC,EAAyC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,OAAOP,EAAW,CAAC,EAAG,UAAU,EAAE,qBAAqB,CACrD,gBAAAQ,CACF,CAAC,CACH,CAAC,EAED,GAAG,qDAAsD,SAAY,CAEnE,MAAME,EAAoB,IAAI,oBAC5BR,EACAJ,EACAG,CACF,EAGA,GAAI,CACF,MAAMS,EAAkB,QAAQ,CAAE,UAAAH,CAAU,CAAC,CAC/C,OAASI,EAAG,CAEV,OAAOA,CAAC,EAAE,cAAc,IAAI,uBAAuB,CACrD,CACF,CAAC,EAED,GAAG,uDAAwD,SAAY,CAErE,GAAG,MAAMb,EAAgB,sBAAsB,EAAE,mBAAmB,OAClE,YACE,4BACE,CAAE,GAAIS,CAAU,EAChBN,EACAE,EACAG,EACA,0CACF,CACF,CACF,EAEA,GAAG,MAAMN,EAAW,CAAC,EAAI,YAAY,EAAE,qBACrC,QAAK,IAAI,iBAAiB,CAC5B,EAEA,MAAMU,EAAoB,IAAI,oBAC5BR,EACAJ,EACAG,CACF,EAGA,GAAI,CACF,MAAMS,EAAkB,QAAQ,CAAE,UAAAH,CAAU,CAAC,CAC/C,OAASI,EAAG,CAEV,OAAOA,CAAC,EAAE,cAAc,IAAI,iBAAiB,CAC/C,CACF,CAAC,CACH,CAAC",
6
6
  "names": ["import_purify_ts", "import_TransportMock", "import_Errors", "import_TransportConnectedDevice", "import_DeviceSessionRefresherConst", "import_DeviceSession", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_DefaultTransportService", "import_DisconnectUseCase", "sessionService", "transport", "transports", "loggerFactory", "transportService", "managerApi", "managerApiDataSource", "secureChannelDataSource", "secureChannel", "sessionId", "connectedDevice", "deviceSession", "disconnectUseCase", "e"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var v=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var b=(o,r)=>{for(var t in r)v(o,t,{get:r[t],enumerable:!0})},u=(o,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of f(r))!h.call(o,e)&&e!==t&&v(o,e,{get:()=>r[e],enumerable:!(i=m(r,e))||i.enumerable});return o};var _=o=>u(v({},"__esModule",{value:!0}),o),g=(o,r,t,i)=>{for(var e=i>1?void 0:i?m(r,t):r,n=o.length-1,a;n>=0;n--)(a=o[n])&&(e=(i?a(r,t,e):a(e))||e);return i&&e&&v(r,t,e),e},l=(o,r)=>(t,i)=>r(t,i,o);var y={};b(y,{ListenToAvailableDevicesUseCase:()=>p});module.exports=_(y);var c=require("inversify"),s=require("rxjs"),D=require("../../../api/device/DeviceModel"),d=require("../../logger-publisher/di/loggerTypes"),T=require("../../transport/di/transportDiTypes");let p=class{_transports;_transportService;_logger;constructor(r,t){this._transports=r.getAllTransports(),this._transportService=r,this._logger=t("ListenToAvailableDevicesUseCase")}mapTransportDiscoveredDeviceToDiscoveredDevice(r){const t=new D.DeviceModel({id:r.id,model:r.deviceModel.id,name:r.deviceModel.productName});return{id:r.id,deviceModel:t,transport:r.transport,name:r.name||t.name,rssi:r.rssi}}execute({transport:r}){if(this._logger.info("Listening to available devices"),this._transports.length===0)return this._logger.warn("No transports available"),(0,s.from)([[]]);if(!r){this._logger.info("Discovering all available transports");const i=this._transports.map((e,n)=>e.listenToAvailableDevices().pipe((0,s.map)(a=>({index:n,arr:a}))));return(0,s.merge)(...i).pipe((0,s.scan)((e,{index:n,arr:a})=>(e[n]=a,e),{}),(0,s.map)(e=>Object.values(e).flat().map(this.mapTransportDiscoveredDeviceToDiscoveredDevice)))}return this._logger.info(`Discovering devices on transport ${r}`),this._transportService.getTransport(r).caseOf({Nothing:()=>(this._logger.error(`Transport ${r} not found`),(0,s.of)([])),Just:i=>i.listenToAvailableDevices().pipe((0,s.map)(e=>e.map(this.mapTransportDiscoveredDeviceToDiscoveredDevice)))})}};p=g([(0,c.injectable)(),l(0,(0,c.inject)(T.transportDiTypes.TransportService)),l(1,(0,c.inject)(d.loggerTypes.LoggerPublisherServiceFactory))],p);0&&(module.exports={ListenToAvailableDevicesUseCase});
1
+ "use strict";var v=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var b=(o,r)=>{for(var t in r)v(o,t,{get:r[t],enumerable:!0})},u=(o,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of f(r))!h.call(o,e)&&e!==t&&v(o,e,{get:()=>r[e],enumerable:!(i=m(r,e))||i.enumerable});return o};var _=o=>u(v({},"__esModule",{value:!0}),o),g=(o,r,t,i)=>{for(var e=i>1?void 0:i?m(r,t):r,n=o.length-1,a;n>=0;n--)(a=o[n])&&(e=(i?a(r,t,e):a(e))||e);return i&&e&&v(r,t,e),e},l=(o,r)=>(t,i)=>r(t,i,o);var y={};b(y,{ListenToAvailableDevicesUseCase:()=>p});module.exports=_(y);var c=require("inversify"),s=require("rxjs"),D=require("../../../api/device/DeviceModel"),d=require("../../logger-publisher/di/loggerTypes"),T=require("../../transport/di/transportDiTypes");let p=class{_transports;_transportService;_logger;constructor(r,t){this._transports=r.getAllTransports(),this._transportService=r,this._logger=t("ListenToAvailableDevicesUseCase")}mapTransportDiscoveredDeviceToDiscoveredDevice(r){const t=new D.DeviceModel({id:r.id,model:r.deviceModel.id,name:r.deviceModel.productName});return{id:r.id,deviceModel:t,transport:r.transport,name:r.name||t.name,rssi:r.rssi}}execute({transport:r}={}){if(this._logger.info("Listening to available devices"),this._transports.length===0)return this._logger.warn("No transports available"),(0,s.from)([[]]);if(!r){this._logger.info("Discovering all available transports");const i=this._transports.map((e,n)=>e.listenToAvailableDevices().pipe((0,s.map)(a=>({index:n,arr:a}))));return(0,s.merge)(...i).pipe((0,s.scan)((e,{index:n,arr:a})=>(e[n]=a,e),{}),(0,s.map)(e=>Object.values(e).flat().map(this.mapTransportDiscoveredDeviceToDiscoveredDevice)))}return this._logger.info(`Discovering devices on transport ${r}`),this._transportService.getTransport(r).caseOf({Nothing:()=>(this._logger.error(`Transport ${r} not found`),(0,s.of)([])),Just:i=>i.listenToAvailableDevices().pipe((0,s.map)(e=>e.map(this.mapTransportDiscoveredDeviceToDiscoveredDevice)))})}};p=g([(0,c.injectable)(),l(0,(0,c.inject)(T.transportDiTypes.TransportService)),l(1,(0,c.inject)(d.loggerTypes.LoggerPublisherServiceFactory))],p);0&&(module.exports={ListenToAvailableDevicesUseCase});
2
2
  //# sourceMappingURL=ListenToAvailableDevicesUseCase.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.ts"],
4
- "sourcesContent": ["import { inject, injectable } from \"inversify\";\nimport { from, map, merge, Observable, of, scan } from \"rxjs\";\n\nimport { DeviceModel } from \"@api/device/DeviceModel\";\nimport { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DiscoveredDevice } from \"@api/transport/model/DiscoveredDevice\";\nimport { type Transport } from \"@api/transport/model/Transport\";\nimport { type TransportDiscoveredDevice } from \"@api/transport/model/TransportDiscoveredDevice\";\nimport { type TransportIdentifier } from \"@api/transport/model/TransportIdentifier\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { transportDiTypes } from \"@internal/transport/di/transportDiTypes\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nexport type ListenToAvailableDevicesUseCaseArgs = {\n /**\n * Identifier of the transport to start discovering devices.\n * Can be undefined to discover all available transports in parallel.\n */\n transport?: TransportIdentifier;\n};\n\n/**\n * Listen to list of known discovered devices (and later BLE).\n */\n@injectable()\nexport class ListenToAvailableDevicesUseCase {\n private readonly _transports: Transport[];\n private readonly _transportService: TransportService;\n private readonly _logger: LoggerPublisherService;\n constructor(\n @inject(transportDiTypes.TransportService)\n transportService: TransportService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._transports = transportService.getAllTransports();\n this._transportService = transportService;\n this._logger = loggerFactory(\"ListenToAvailableDevicesUseCase\");\n }\n\n private mapTransportDiscoveredDeviceToDiscoveredDevice(\n discoveredDevice: TransportDiscoveredDevice,\n ): DiscoveredDevice {\n const deviceModel = new DeviceModel({\n id: discoveredDevice.id,\n model: discoveredDevice.deviceModel.id,\n name: discoveredDevice.deviceModel.productName,\n });\n return {\n id: discoveredDevice.id,\n deviceModel,\n transport: discoveredDevice.transport,\n name: discoveredDevice.name || deviceModel.name,\n rssi: discoveredDevice.rssi,\n };\n }\n\n execute({\n transport,\n }: ListenToAvailableDevicesUseCaseArgs): Observable<DiscoveredDevice[]> {\n this._logger.info(\"Listening to available devices\");\n\n if (this._transports.length === 0) {\n this._logger.warn(\"No transports available\");\n return from([[]]);\n }\n\n if (!transport) {\n this._logger.info(\"Discovering all available transports\");\n /**\n * Note: we're not using combineLatest because combineLatest will\n * - wait for all observables to emit at least once before emitting.\n * - complete as soon as one of the observables completes.\n * Some transports will just return an empty array and complete.\n * We want to keep listening to all transports until all have completed.\n */\n\n const observablesWithIndex = this._transports.map((t, index) =>\n t.listenToAvailableDevices().pipe(\n map((arr) => ({\n index,\n arr,\n })),\n ),\n );\n\n return merge(...observablesWithIndex).pipe(\n scan<\n { index: number; arr: TransportDiscoveredDevice[] },\n { [key: number]: TransportDiscoveredDevice[] }\n >((acc, { index, arr }) => {\n acc[index] = arr;\n return acc;\n }, {}),\n map((acc) =>\n Object.values(acc)\n .flat()\n .map(this.mapTransportDiscoveredDeviceToDiscoveredDevice),\n ),\n );\n }\n\n this._logger.info(`Discovering devices on transport ${transport}`);\n\n const instance = this._transportService.getTransport(transport);\n\n return instance.caseOf({\n Nothing: () => {\n this._logger.error(`Transport ${transport} not found`);\n return of([]);\n },\n Just: (t) => {\n return t\n .listenToAvailableDevices()\n .pipe(\n map((devices) =>\n devices.map(this.mapTransportDiscoveredDeviceToDiscoveredD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C5D,CACF,CACF,CAEA,YAAK,QAAQ,KAAK,oCAAoCL,CAAS,EAAE,EAEhD,KAAK,kBAAkB,aAAaA,CAAS,EAE9C,OAAO,CACrB,QAAS,KACP,KAAK,QAAQ,MAAM,aAAaA,CAAS,YAAY,KAC9C,MAAG,CAAC,CAAC,GAEd,KAAOE,GACEA,EACJ,yBAAyB,EACzB,QACC,OAAKI,GACHA,EAAQ,IAAI,KAAK,8CAA8C,CACjE,CACF,CAEN,CAAC,CACH,CACF,EAjGaX,EAANY,EAAA,IADN,cAAW,EAMPC,EAAA,eAAO,mBAAiB,gBAAgB,GAExCA,EAAA,eAAO,cAAY,6BAA6B,IAPxCb",
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\nimport { from, map, merge, Observable, of, scan } from \"rxjs\";\n\nimport { DeviceModel } from \"@api/device/DeviceModel\";\nimport { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DiscoveredDevice } from \"@api/transport/model/DiscoveredDevice\";\nimport { type Transport } from \"@api/transport/model/Transport\";\nimport { type TransportDiscoveredDevice } from \"@api/transport/model/TransportDiscoveredDevice\";\nimport { type TransportIdentifier } from \"@api/transport/model/TransportIdentifier\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { transportDiTypes } from \"@internal/transport/di/transportDiTypes\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nexport type ListenToAvailableDevicesUseCaseArgs = {\n /**\n * Identifier of the transport to start discovering devices.\n * Can be undefined to discover all available transports in parallel.\n */\n transport?: TransportIdentifier;\n};\n\n/**\n * Listen to list of known discovered devices (and later BLE).\n */\n@injectable()\nexport class ListenToAvailableDevicesUseCase {\n private readonly _transports: Transport[];\n private readonly _transportService: TransportService;\n private readonly _logger: LoggerPublisherService;\n constructor(\n @inject(transportDiTypes.TransportService)\n transportService: TransportService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._transports = transportService.getAllTransports();\n this._transportService = transportService;\n this._logger = loggerFactory(\"ListenToAvailableDevicesUseCase\");\n }\n\n private mapTransportDiscoveredDeviceToDiscoveredDevice(\n discoveredDevice: TransportDiscoveredDevice,\n ): DiscoveredDevice {\n const deviceModel = new DeviceModel({\n id: discoveredDevice.id,\n model: discoveredDevice.deviceModel.id,\n name: discoveredDevice.deviceModel.productName,\n });\n return {\n id: discoveredDevice.id,\n deviceModel,\n transport: discoveredDevice.transport,\n name: discoveredDevice.name || deviceModel.name,\n rssi: discoveredDevice.rssi,\n };\n }\n\n execute({ transport }: ListenToAvailableDevicesUseCaseArgs = {}): Observable<\n DiscoveredDevice[]\n > {\n this._logger.info(\"Listening to available devices\");\n\n if (this._transports.length === 0) {\n this._logger.warn(\"No transports available\");\n return from([[]]);\n }\n\n if (!transport) {\n this._logger.info(\"Discovering all available transports\");\n /**\n * Note: we're not using combineLatest because combineLatest will\n * - wait for all observables to emit at least once before emitting.\n * - complete as soon as one of the observables completes.\n * Some transports will just return an empty array and complete.\n * We want to keep listening to all transports until all have completed.\n */\n\n const observablesWithIndex = this._transports.map((t, index) =>\n t.listenToAvailableDevices().pipe(\n map((arr) => ({\n index,\n arr,\n })),\n ),\n );\n\n return merge(...observablesWithIndex).pipe(\n scan<\n { index: number; arr: TransportDiscoveredDevice[] },\n { [key: number]: TransportDiscoveredDevice[] }\n >((acc, { index, arr }) => {\n acc[index] = arr;\n return acc;\n }, {}),\n map((acc) =>\n Object.values(acc)\n .flat()\n .map(this.mapTransportDiscoveredDeviceToDiscoveredDevice),\n ),\n );\n }\n\n this._logger.info(`Discovering devices on transport ${transport}`);\n\n const instance = this._transportService.getTransport(transport);\n\n return instance.caseOf({\n Nothing: () => {\n this._logger.error(`Transport ${transport} not found`);\n return of([]);\n },\n Just: (t) => {\n return t\n .listenToAvailableDevices()\n .pipe(\n map((devices) =>\n devices.map(this.mapTransportDiscoveredDeviceToDiscoveredDevice),\n ),\n );\n },\n });\n }\n}\n"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CAEA,YAAK,QAAQ,KAAK,oCAAoCL,CAAS,EAAE,EAEhD,KAAK,kBAAkB,aAAaA,CAAS,EAE9C,OAAO,CACrB,QAAS,KACP,KAAK,QAAQ,MAAM,aAAaA,CAAS,YAAY,KAC9C,MAAG,CAAC,CAAC,GAEd,KAAOE,GACEA,EACJ,yBAAyB,EACzB,QACC,OAAKI,GACHA,EAAQ,IAAI,KAAK,8CAA8C,CACjE,CACF,CAEN,CAAC,CACH,CACF,EAjGaX,EAANY,EAAA,IADN,cAAW,EAMPC,EAAA,eAAO,mBAAiB,gBAAgB,GAExCA,EAAA,eAAO,cAAY,6BAA6B,IAPxCb",
6
6
  "names": ["ListenToAvailableDevicesUseCase_exports", "__export", "ListenToAvailableDevicesUseCase", "__toCommonJS", "import_inversify", "import_rxjs", "import_DeviceModel", "import_loggerTypes", "import_transportDiTypes", "ListenToAvailableDevicesUseCase", "transportService", "loggerFactory", "discoveredDevice", "deviceModel", "transport", "observablesWithIndex", "t", "index", "arr", "acc", "devices", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(o,r)=>{for(var t in r)a(o,t,{get:r[t],enumerable:!0})},S=(o,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of u(r))!g.call(o,e)&&e!==t&&a(o,e,{get:()=>r[e],enumerable:!(i=v(r,e))||i.enumerable});return o};var b=o=>S(a({},"__esModule",{value:!0}),o),d=(o,r,t,i)=>{for(var e=i>1?void 0:i?v(r,t):r,p=o.length-1,m;p>=0;p--)(m=o[p])&&(e=(i?m(r,t,e):m(e))||e);return i&&e&&a(r,t,e),e},D=(o,r)=>(t,i)=>r(t,i,o);var w={};h(w,{StartDiscoveringUseCase:()=>n});module.exports=b(w);var c=require("inversify"),s=require("rxjs"),f=require("../../../api/device/DeviceModel"),l=require("../../../api/transport/model/Errors"),T=require("../../transport/di/transportDiTypes");let n=class{constructor(r){this._transportService=r}mapDiscoveredDevice(r){const t=new f.DeviceModel({id:r.id,model:r.deviceModel.id,name:r.deviceModel.productName});return{id:r.id,deviceModel:t,transport:r.transport,name:r.name||t.name,rssi:r.rssi}}execute({transport:r}){if(!r){const i=this._transportService.getAllTransports();return(0,s.of)(...i).pipe((0,s.mergeMap)(e=>e.startDiscovering().pipe((0,s.map)(p=>this.mapDiscoveredDevice(p)))))}return this._transportService.getTransport(r).caseOf({Just:i=>i.startDiscovering().pipe((0,s.map)(e=>this.mapDiscoveredDevice(e))),Nothing:()=>{throw new l.TransportNotSupportedError(new Error("Unknown transport"))}})}};n=d([(0,c.injectable)(),D(0,(0,c.inject)(T.transportDiTypes.TransportService))],n);0&&(module.exports={StartDiscoveringUseCase});
1
+ "use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(o,r)=>{for(var t in r)a(o,t,{get:r[t],enumerable:!0})},S=(o,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of u(r))!g.call(o,e)&&e!==t&&a(o,e,{get:()=>r[e],enumerable:!(i=v(r,e))||i.enumerable});return o};var b=o=>S(a({},"__esModule",{value:!0}),o),d=(o,r,t,i)=>{for(var e=i>1?void 0:i?v(r,t):r,p=o.length-1,m;p>=0;p--)(m=o[p])&&(e=(i?m(r,t,e):m(e))||e);return i&&e&&a(r,t,e),e},D=(o,r)=>(t,i)=>r(t,i,o);var w={};h(w,{StartDiscoveringUseCase:()=>n});module.exports=b(w);var c=require("inversify"),s=require("rxjs"),f=require("../../../api/device/DeviceModel"),l=require("../../../api/transport/model/Errors"),T=require("../../transport/di/transportDiTypes");let n=class{constructor(r){this._transportService=r}mapDiscoveredDevice(r){const t=new f.DeviceModel({id:r.id,model:r.deviceModel.id,name:r.deviceModel.productName});return{id:r.id,deviceModel:t,transport:r.transport,name:r.name||t.name,rssi:r.rssi}}execute({transport:r}={}){if(!r){const i=this._transportService.getAllTransports();return(0,s.of)(...i).pipe((0,s.mergeMap)(e=>e.startDiscovering().pipe((0,s.map)(p=>this.mapDiscoveredDevice(p)))))}return this._transportService.getTransport(r).caseOf({Just:i=>i.startDiscovering().pipe((0,s.map)(e=>this.mapDiscoveredDevice(e))),Nothing:()=>{throw new l.TransportNotSupportedError(new Error("Unknown transport"))}})}};n=d([(0,c.injectable)(),D(0,(0,c.inject)(T.transportDiTypes.TransportService))],n);0&&(module.exports={StartDiscoveringUseCase});
2
2
  //# sourceMappingURL=StartDiscoveringUseCase.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/discovery/use-case/StartDiscoveringUseCase.ts"],
4
- "sourcesContent": ["import { inject, injectable } from \"inversify\";\nimport { map, mergeMap, Observable, of } from \"rxjs\";\n\nimport { DeviceModel } from \"@api/device/DeviceModel\";\nimport { DiscoveredDevice } from \"@api/transport/model/DiscoveredDevice\";\nimport { TransportNotSupportedError } from \"@api/transport/model/Errors\";\nimport { TransportDiscoveredDevice } from \"@api/transport/model/TransportDiscoveredDevice\";\nimport { TransportIdentifier } from \"@api/transport/model/TransportIdentifier\";\nimport { transportDiTypes } from \"@internal/transport/di/transportDiTypes\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nexport type StartDiscoveringUseCaseArgs = {\n /**\n * Identifier of the transport to start discovering devices.\n * Can be undefined to discover all available transports in parralel.\n */\n transport?: TransportIdentifier;\n};\n\n/**\n * Starts discovering devices connected.\n *\n * For the WebHID implementation, this use-case needs to be called as a result of an user interaction (button \"click\" event for ex).\n */\n@injectable()\nexport class StartDiscoveringUseCase {\n constructor(\n @inject(transportDiTypes.TransportService)\n private readonly _transportService: TransportService,\n ) {}\n\n private mapDiscoveredDevice(\n device: TransportDiscoveredDevice,\n ): DiscoveredDevice {\n const deviceModel = new DeviceModel({\n id: device.id,\n model: device.deviceModel.id,\n name: device.deviceModel.productName,\n });\n return {\n id: device.id,\n deviceModel,\n transport: device.transport,\n name: device.name || deviceModel.name,\n rssi: device.rssi,\n };\n }\n\n execute({\n transport,\n }: StartDiscoveringUseCaseArgs): Observable<DiscoveredDevice> {\n if (!transport) {\n const transports = this._transportService.getAllTransports();\n return of(...transports).pipe(\n mergeMap((instance) =>\n instance\n .startDiscovering()\n .pipe(map((device) => this.mapDiscoveredDevice(device))),\n ),\n );\n }\n\n const instance = this._transportService.getTransport(transport);\n\n return instance.caseOf({\n Just: (t) => {\n return t\n .startDiscovering()\n .pipe(map((device) => this.mapDiscoveredDevice(device)));\n },\n Nothing: () => {\n throw new TransportNotSupportedError(new Error(\"Unknown transport\"));\n },\n });\n }\n}\n"],
5
- "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBACnCC,EAA8C,gBAE9CC,EAA4B,mCAE5BC,EAA2C,uCAG3CC,EAAiC,mDAiB1B,IAAMC,EAAN,KAA8B,CACnC,YAEmBC,EACjB,CADiB,uBAAAA,CAChB,CAEK,oBACNC,EACkB,CAClB,MAAMC,EAAc,IAAI,cAAY,CAClC,GAAID,EAAO,GACX,MAAOA,EAAO,YAAY,GAC1B,KAAMA,EAAO,YAAY,WAC3B,CAAC,EACD,MAAO,CACL,GAAIA,EAAO,GACX,YAAAC,EACA,UAAWD,EAAO,UAClB,KAAMA,EAAO,MAAQC,EAAY,KACjC,KAAMD,EAAO,IACf,CACF,CAEA,QAAQ,CACN,UAAAE,CACF,EAA8D,CAC5D,GAAI,CAACA,EAAW,CACd,MAAMC,EAAa,KAAK,kBAAkB,iBAAiB,EAC3D,SAAO,MAAG,GAAGA,CAAU,EAAE,QACvB,YAAUC,GACRA,EACG,iBAAiB,EACjB,QAAK,OAAKJ,GAAW,KAAK,oBAAoBA,CAAM,CAAC,CAAC,CAC3D,CACF,CACF,CAIA,OAFiB,KAAK,kBAAkB,aAAaE,CAAS,EAE9C,OAAO,CACrB,KAAOG,GACEA,EACJ,iBAAiB,EACjB,QAAK,OAAKL,GAAW,KAAK,oBAAoBA,CAAM,CAAC,CAAC,EAE3D,QAAS,IAAM,CACb,MAAM,IAAI,6BAA2B,IAAI,MAAM,mBAAmB,CAAC,CACrE,CACF,CAAC,CACH,CACF,EAlDaF,EAANQ,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,mBAAiB,gBAAgB,IAFhCT",
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\nimport { map, mergeMap, Observable, of } from \"rxjs\";\n\nimport { DeviceModel } from \"@api/device/DeviceModel\";\nimport { DiscoveredDevice } from \"@api/transport/model/DiscoveredDevice\";\nimport { TransportNotSupportedError } from \"@api/transport/model/Errors\";\nimport { TransportDiscoveredDevice } from \"@api/transport/model/TransportDiscoveredDevice\";\nimport { TransportIdentifier } from \"@api/transport/model/TransportIdentifier\";\nimport { transportDiTypes } from \"@internal/transport/di/transportDiTypes\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nexport type StartDiscoveringUseCaseArgs = {\n /**\n * Identifier of the transport to start discovering devices.\n * Can be undefined to discover all available transports in parralel.\n */\n transport?: TransportIdentifier;\n};\n\n/**\n * Starts discovering devices connected.\n *\n * For the WebHID implementation, this use-case needs to be called as a result of an user interaction (button \"click\" event for ex).\n */\n@injectable()\nexport class StartDiscoveringUseCase {\n constructor(\n @inject(transportDiTypes.TransportService)\n private readonly _transportService: TransportService,\n ) {}\n\n private mapDiscoveredDevice(\n device: TransportDiscoveredDevice,\n ): DiscoveredDevice {\n const deviceModel = new DeviceModel({\n id: device.id,\n model: device.deviceModel.id,\n name: device.deviceModel.productName,\n });\n return {\n id: device.id,\n deviceModel,\n transport: device.transport,\n name: device.name || deviceModel.name,\n rssi: device.rssi,\n };\n }\n\n execute({\n transport,\n }: StartDiscoveringUseCaseArgs = {}): Observable<DiscoveredDevice> {\n if (!transport) {\n const transports = this._transportService.getAllTransports();\n return of(...transports).pipe(\n mergeMap((instance) =>\n instance\n .startDiscovering()\n .pipe(map((device) => this.mapDiscoveredDevice(device))),\n ),\n );\n }\n\n const instance = this._transportService.getTransport(transport);\n\n return instance.caseOf({\n Just: (t) => {\n return t\n .startDiscovering()\n .pipe(map((device) => this.mapDiscoveredDevice(device)));\n },\n Nothing: () => {\n throw new TransportNotSupportedError(new Error(\"Unknown transport\"));\n },\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBACnCC,EAA8C,gBAE9CC,EAA4B,mCAE5BC,EAA2C,uCAG3CC,EAAiC,mDAiB1B,IAAMC,EAAN,KAA8B,CACnC,YAEmBC,EACjB,CADiB,uBAAAA,CAChB,CAEK,oBACNC,EACkB,CAClB,MAAMC,EAAc,IAAI,cAAY,CAClC,GAAID,EAAO,GACX,MAAOA,EAAO,YAAY,GAC1B,KAAMA,EAAO,YAAY,WAC3B,CAAC,EACD,MAAO,CACL,GAAIA,EAAO,GACX,YAAAC,EACA,UAAWD,EAAO,UAClB,KAAMA,EAAO,MAAQC,EAAY,KACjC,KAAMD,EAAO,IACf,CACF,CAEA,QAAQ,CACN,UAAAE,CACF,EAAiC,CAAC,EAAiC,CACjE,GAAI,CAACA,EAAW,CACd,MAAMC,EAAa,KAAK,kBAAkB,iBAAiB,EAC3D,SAAO,MAAG,GAAGA,CAAU,EAAE,QACvB,YAAUC,GACRA,EACG,iBAAiB,EACjB,QAAK,OAAKJ,GAAW,KAAK,oBAAoBA,CAAM,CAAC,CAAC,CAC3D,CACF,CACF,CAIA,OAFiB,KAAK,kBAAkB,aAAaE,CAAS,EAE9C,OAAO,CACrB,KAAOG,GACEA,EACJ,iBAAiB,EACjB,QAAK,OAAKL,GAAW,KAAK,oBAAoBA,CAAM,CAAC,CAAC,EAE3D,QAAS,IAAM,CACb,MAAM,IAAI,6BAA2B,IAAI,MAAM,mBAAmB,CAAC,CACrE,CACF,CAAC,CACH,CACF,EAlDaF,EAANQ,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,mBAAiB,gBAAgB,IAFhCT",
6
6
  "names": ["StartDiscoveringUseCase_exports", "__export", "StartDiscoveringUseCase", "__toCommonJS", "import_inversify", "import_rxjs", "import_DeviceModel", "import_Errors", "import_transportDiTypes", "StartDiscoveringUseCase", "_transportService", "device", "deviceModel", "transport", "transports", "instance", "t", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var u=(t,r)=>{for(var e in r)i(t,e,{get:r[e],enumerable:!0})},x=(t,r,e,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of l(r))!j.call(t,o)&&o!==e&&i(t,o,{get:()=>r[o],enumerable:!(p=m(r,o))||p.enumerable});return t};var y=t=>x(i({},"__esModule",{value:!0}),t),f=(t,r,e,p)=>{for(var o=p>1?void 0:p?m(r,e):r,a=t.length-1,s;a>=0;a--)(s=t[a])&&(o=(p?s(r,e,o):s(o))||o);return p&&o&&i(r,e,o),o},v=(t,r)=>(e,p)=>r(e,p,t);var S={};u(S,{StopDiscoveringUseCase:()=>c});module.exports=y(S);var n=require("inversify"),T=require("../../transport/di/transportDiTypes");let c=class{constructor(r){this.transportService=r}execute(){for(const r of this.transportService.getAllTransports())r.stopDiscovering()}};c=f([(0,n.injectable)(),v(0,(0,n.inject)(T.transportDiTypes.TransportService))],c);0&&(module.exports={StopDiscoveringUseCase});
1
+ "use strict";var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var u=(e,r)=>{for(var t in r)p(e,t,{get:r[t],enumerable:!0})},b=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of f(r))!h.call(e,o)&&o!==t&&p(e,o,{get:()=>r[o],enumerable:!(i=l(r,o))||i.enumerable});return e};var y=e=>b(p({},"__esModule",{value:!0}),e),v=(e,r,t,i)=>{for(var o=i>1?void 0:i?l(r,t):r,c=e.length-1,a;c>=0;c--)(a=e[c])&&(o=(i?a(r,t,o):a(o))||o);return i&&o&&p(r,t,o),o},n=(e,r)=>(t,i)=>r(t,i,e);var T={};u(T,{StopDiscoveringUseCase:()=>s});module.exports=y(T);var g=require("inversify"),m=require("../../logger-publisher/di/loggerTypes"),S=require("../../transport/di/transportDiTypes");let s=class{constructor(r,t){this.transportService=r;this._logger=t("StopDiscoveringUseCase")}_logger;async execute(){this._logger.debug("Stopping discovering devices");for(const r of this.transportService.getAllTransports())await r.stopDiscovering()}};s=v([(0,g.injectable)(),n(0,(0,g.inject)(S.transportDiTypes.TransportService)),n(1,(0,g.inject)(m.loggerTypes.LoggerPublisherServiceFactory))],s);0&&(module.exports={StopDiscoveringUseCase});
2
2
  //# sourceMappingURL=StopDiscoveringUseCase.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/discovery/use-case/StopDiscoveringUseCase.ts"],
4
- "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { transportDiTypes } from \"@internal/transport/di/transportDiTypes\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\n/**\n * Stops discovering devices connected.\n */\n@injectable()\nexport class StopDiscoveringUseCase {\n constructor(\n @inject(transportDiTypes.TransportService)\n private transportService: TransportService,\n ) {}\n\n execute(): void {\n for (const transport of this.transportService.getAllTransports()) {\n transport.stopDiscovering();\n }\n }\n}\n"],
5
- "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAEnCC,EAAiC,mDAO1B,IAAMC,EAAN,KAA6B,CAClC,YAEUC,EACR,CADQ,sBAAAA,CACP,CAEH,SAAgB,CACd,UAAWC,KAAa,KAAK,iBAAiB,iBAAiB,EAC7DA,EAAU,gBAAgB,CAE9B,CACF,EAXaF,EAANG,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,mBAAiB,gBAAgB,IAFhCJ",
6
- "names": ["StopDiscoveringUseCase_exports", "__export", "StopDiscoveringUseCase", "__toCommonJS", "import_inversify", "import_transportDiTypes", "StopDiscoveringUseCase", "transportService", "transport", "__decorateClass", "__decorateParam"]
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { LoggerPublisherService } from \"@api/types\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { transportDiTypes } from \"@internal/transport/di/transportDiTypes\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\n/**\n * Stops discovering devices connected.\n */\n@injectable()\nexport class StopDiscoveringUseCase {\n private readonly _logger: LoggerPublisherService;\n constructor(\n @inject(transportDiTypes.TransportService)\n private transportService: TransportService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._logger = loggerFactory(\"StopDiscoveringUseCase\");\n }\n\n async execute(): Promise<void> {\n this._logger.debug(\"Stopping discovering devices\");\n for (const transport of this.transportService.getAllTransports()) {\n await transport.stopDiscovering();\n }\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAGnCC,EAA4B,qDAC5BC,EAAiC,mDAO1B,IAAMC,EAAN,KAA6B,CAElC,YAEUC,EAERC,EACA,CAHQ,sBAAAD,EAIR,KAAK,QAAUC,EAAc,wBAAwB,CACvD,CARiB,QAUjB,MAAM,SAAyB,CAC7B,KAAK,QAAQ,MAAM,8BAA8B,EACjD,UAAWC,KAAa,KAAK,iBAAiB,iBAAiB,EAC7D,MAAMA,EAAU,gBAAgB,CAEpC,CACF,EAjBaH,EAANI,EAAA,IADN,cAAW,EAIPC,EAAA,eAAO,mBAAiB,gBAAgB,GAExCA,EAAA,eAAO,cAAY,6BAA6B,IALxCL",
6
+ "names": ["StopDiscoveringUseCase_exports", "__export", "StopDiscoveringUseCase", "__toCommonJS", "import_inversify", "import_loggerTypes", "import_transportDiTypes", "StopDiscoveringUseCase", "transportService", "loggerFactory", "transport", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var s=require("../../../api/transport/model/__mocks__/TransportMock"),n=require("../../transport/service/DefaultTransportService"),a=require("./StopDiscoveringUseCase");vi.mock("@internal/transport/service/DefaultTransportService");let e,r,t;describe("StopDiscoveringUseCase",()=>{beforeEach(()=>{e=new s.TransportMock,r=[e],t=new n.DefaultTransportService(r)}),afterEach(()=>{vi.clearAllMocks()}),test("should call stop discovering",()=>{const o=vi.fn();vi.spyOn(e,"stopDiscovering").mockImplementation(o),vi.spyOn(t,"getAllTransports").mockReturnValue(r),new a.StopDiscoveringUseCase(t).execute(),expect(o).toHaveBeenCalled()})});
1
+ "use strict";var s=require("../../../api/transport/model/__mocks__/TransportMock"),i=require("../../transport/service/DefaultTransportService"),a=require("./StopDiscoveringUseCase");vi.mock("@internal/transport/service/DefaultTransportService");let e,r,o,t,n;describe("StopDiscoveringUseCase",()=>{beforeEach(()=>{e=new s.TransportMock,r=new s.TransportMock,o=[e,r],n={debug:vi.fn()},t=new i.DefaultTransportService(o)}),afterEach(()=>{vi.clearAllMocks()}),test("should call stop discovering",async()=>{vi.spyOn(e,"stopDiscovering").mockImplementation(vi.fn()),vi.spyOn(r,"stopDiscovering").mockImplementation(async()=>Promise.resolve(void 0)),vi.spyOn(t,"getAllTransports").mockReturnValue(o),await new a.StopDiscoveringUseCase(t,vi.fn().mockImplementation(()=>n)).execute(),expect(e.stopDiscovering).toHaveBeenCalled(),expect(r.stopDiscovering).toHaveBeenCalled()})});
2
2
  //# sourceMappingURL=StopDiscoveringUseCase.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/discovery/use-case/StopDiscoveringUseCase.test.ts"],
4
- "sourcesContent": ["import { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { type Transport } from \"@api/types\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nimport { StopDiscoveringUseCase } from \"./StopDiscoveringUseCase\";\n\nvi.mock(\"@internal/transport/service/DefaultTransportService\");\n\n// TODO test several transports\nlet transport: Transport;\nlet transports: Transport[];\nlet transportService: TransportService;\n\ndescribe(\"StopDiscoveringUseCase\", () => {\n beforeEach(() => {\n transport = new TransportMock();\n transports = [transport];\n // @ts-expect-error mock\n transportService = new DefaultTransportService(transports);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n });\n\n test(\"should call stop discovering\", () => {\n const mockedStopDiscovering = vi.fn();\n vi.spyOn(transport, \"stopDiscovering\").mockImplementation(\n mockedStopDiscovering,\n );\n\n vi.spyOn(transportService, \"getAllTransports\").mockReturnValue(transports);\n\n const usecase = new StopDiscoveringUseCase(transportService);\n\n usecase.execute();\n\n expect(mockedStopDiscovering).toHaveBeenCalled();\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAA8B,wDAE9BC,EAAwC,+DAGxCC,EAAuC,oCAEvC,GAAG,KAAK,qDAAqD,EAG7D,IAAIC,EACAC,EACAC,EAEJ,SAAS,yBAA0B,IAAM,CACvC,WAAW,IAAM,CACfF,EAAY,IAAI,gBAChBC,EAAa,CAACD,CAAS,EAEvBE,EAAmB,IAAI,0BAAwBD,CAAU,CAC3D,CAAC,EAED,UAAU,IAAM,CACd,GAAG,cAAc,CACnB,CAAC,EAED,KAAK,+BAAgC,IAAM,CACzC,MAAME,EAAwB,GAAG,GAAG,EACpC,GAAG,MAAMH,EAAW,iBAAiB,EAAE,mBACrCG,CACF,EAEA,GAAG,MAAMD,EAAkB,kBAAkB,EAAE,gBAAgBD,CAAU,EAEzD,IAAI,yBAAuBC,CAAgB,EAEnD,QAAQ,EAEhB,OAAOC,CAAqB,EAAE,iBAAiB,CACjD,CAAC,CACH,CAAC",
6
- "names": ["import_TransportMock", "import_DefaultTransportService", "import_StopDiscoveringUseCase", "transport", "transports", "transportService", "mockedStopDiscovering"]
4
+ "sourcesContent": ["import { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { type LoggerPublisherService, type Transport } from \"@api/types\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nimport { StopDiscoveringUseCase } from \"./StopDiscoveringUseCase\";\n\nvi.mock(\"@internal/transport/service/DefaultTransportService\");\n\n// TODO test several transports\nlet transport: Transport;\nlet transport2: Transport;\nlet transports: Transport[];\nlet transportService: TransportService;\nlet logger: LoggerPublisherService;\n\ndescribe(\"StopDiscoveringUseCase\", () => {\n beforeEach(() => {\n transport = new TransportMock();\n transport2 = new TransportMock();\n transports = [transport, transport2];\n logger = {\n debug: vi.fn(),\n } as unknown as LoggerPublisherService;\n // @ts-expect-error mock\n transportService = new DefaultTransportService(transports);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n });\n\n test(\"should call stop discovering\", async () => {\n vi.spyOn(transport, \"stopDiscovering\").mockImplementation(vi.fn());\n vi.spyOn(transport2, \"stopDiscovering\").mockImplementation(async () =>\n Promise.resolve(undefined),\n );\n\n vi.spyOn(transportService, \"getAllTransports\").mockReturnValue(transports);\n\n const usecase = new StopDiscoveringUseCase(\n transportService,\n vi.fn().mockImplementation(() => logger),\n );\n\n await usecase.execute();\n\n expect(transport.stopDiscovering).toHaveBeenCalled();\n expect(transport2.stopDiscovering).toHaveBeenCalled();\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA8B,wDAE9BC,EAAwC,+DAGxCC,EAAuC,oCAEvC,GAAG,KAAK,qDAAqD,EAG7D,IAAIC,EACAC,EACAC,EACAC,EACAC,EAEJ,SAAS,yBAA0B,IAAM,CACvC,WAAW,IAAM,CACfJ,EAAY,IAAI,gBAChBC,EAAa,IAAI,gBACjBC,EAAa,CAACF,EAAWC,CAAU,EACnCG,EAAS,CACP,MAAO,GAAG,GAAG,CACf,EAEAD,EAAmB,IAAI,0BAAwBD,CAAU,CAC3D,CAAC,EAED,UAAU,IAAM,CACd,GAAG,cAAc,CACnB,CAAC,EAED,KAAK,+BAAgC,SAAY,CAC/C,GAAG,MAAMF,EAAW,iBAAiB,EAAE,mBAAmB,GAAG,GAAG,CAAC,EACjE,GAAG,MAAMC,EAAY,iBAAiB,EAAE,mBAAmB,SACzD,QAAQ,QAAQ,MAAS,CAC3B,EAEA,GAAG,MAAME,EAAkB,kBAAkB,EAAE,gBAAgBD,CAAU,EAOzE,MALgB,IAAI,yBAClBC,EACA,GAAG,GAAG,EAAE,mBAAmB,IAAMC,CAAM,CACzC,EAEc,QAAQ,EAEtB,OAAOJ,EAAU,eAAe,EAAE,iBAAiB,EACnD,OAAOC,EAAW,eAAe,EAAE,iBAAiB,CACtD,CAAC,CACH,CAAC",
6
+ "names": ["import_TransportMock", "import_DefaultTransportService", "import_StopDiscoveringUseCase", "transport", "transport2", "transports", "transportService", "logger"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var y=(e,r)=>{for(var i in r)c(e,i,{get:r[i],enumerable:!0})},m=(e,r,i,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of a(r))!p.call(e,o)&&o!==i&&c(e,o,{get:()=>r[o],enumerable:!(t=u(r,o))||t.enumerable});return e};var l=e=>m(c({},"__esModule",{value:!0}),e);var v={};y(v,{loggerModuleFactory:()=>f});module.exports=l(v);var n=require("inversify"),s=require("../../logger-publisher/service/DefaultLoggerPublisherService"),g=require("./loggerTypes");const f=({subscribers:e}={subscribers:[]})=>new n.ContainerModule((r,i,t,o,S,_,d)=>{r(g.loggerTypes.LoggerPublisherServiceFactory).toFactory(F=>b=>new s.DefaultLoggerPublisherService(e,b))});0&&(module.exports={loggerModuleFactory});
1
+ "use strict";var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var m=(e,r)=>{for(var o in r)c(e,o,{get:r[o],enumerable:!0})},a=(e,r,o,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of u(r))!y.call(e,t)&&t!==o&&c(e,t,{get:()=>r[t],enumerable:!(i=b(r,t))||i.enumerable});return e};var l=e=>a(c({},"__esModule",{value:!0}),e);var S={};m(S,{loggerModuleFactory:()=>n});module.exports=l(S);var g=require("inversify"),s=require("../../logger-publisher/service/DefaultLoggerPublisherService"),p=require("./loggerTypes");const n=({subscribers:e}={subscribers:[]})=>new g.ContainerModule(({bind:r})=>{r(p.loggerTypes.LoggerPublisherServiceFactory).toFactory(o=>i=>new s.DefaultLoggerPublisherService(e,i))});0&&(module.exports={loggerModuleFactory});
2
2
  //# sourceMappingURL=loggerModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/logger-publisher/di/loggerModule.ts"],
4
- "sourcesContent": ["import { ContainerModule, type interfaces } from \"inversify\";\n\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { loggerTypes } from \"./loggerTypes\";\n\ntype FactoryProps = {\n subscribers: LoggerSubscriberService[];\n};\n\nexport const loggerModuleFactory = (\n { subscribers }: FactoryProps = { subscribers: [] },\n) =>\n new ContainerModule(\n (\n bind,\n _unbind,\n _isBound,\n _rebind,\n _unbindAsync,\n _onActivation,\n _onDeactivation,\n ) => {\n bind<interfaces.Factory<LoggerPublisherService>>(\n loggerTypes.LoggerPublisherServiceFactory,\n ).toFactory((_context) => {\n return (tag: string) =>\n new DefaultLoggerPublisherService(subscribers, tag);\n });\n },\n );\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAiD,qBAIjDC,EAA8C,4EAE9CC,EAA4B,yBAMrB,MAAMJ,EAAsB,CACjC,CAAE,YAAAK,CAAY,EAAkB,CAAE,YAAa,CAAC,CAAE,IAElD,IAAI,kBACF,CACEC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,IACG,CACHN,EACE,cAAY,6BACd,EAAE,UAAWO,GACHC,GACN,IAAI,gCAA8BT,EAAaS,CAAG,CACrD,CACH,CACF",
6
- "names": ["loggerModule_exports", "__export", "loggerModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultLoggerPublisherService", "import_loggerTypes", "subscribers", "bind", "_unbind", "_isBound", "_rebind", "_unbindAsync", "_onActivation", "_onDeactivation", "_context", "tag"]
4
+ "sourcesContent": ["import { ContainerModule, type Factory } from \"inversify\";\n\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { loggerTypes } from \"./loggerTypes\";\n\ntype FactoryProps = {\n subscribers: LoggerSubscriberService[];\n};\n\nexport const loggerModuleFactory = (\n { subscribers }: FactoryProps = { subscribers: [] },\n) =>\n new ContainerModule(({ bind }) => {\n bind<Factory<LoggerPublisherService>>(\n loggerTypes.LoggerPublisherServiceFactory,\n ).toFactory((_context) => {\n return (tag: string) =>\n new DefaultLoggerPublisherService(subscribers, tag);\n });\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8C,qBAI9CC,EAA8C,4EAE9CC,EAA4B,yBAMrB,MAAMJ,EAAsB,CACjC,CAAE,YAAAK,CAAY,EAAkB,CAAE,YAAa,CAAC,CAAE,IAElD,IAAI,kBAAgB,CAAC,CAAE,KAAAC,CAAK,IAAM,CAChCA,EACE,cAAY,6BACd,EAAE,UAAWC,GACHC,GACN,IAAI,gCAA8BH,EAAaG,CAAG,CACrD,CACH,CAAC",
6
+ "names": ["loggerModule_exports", "__export", "loggerModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultLoggerPublisherService", "import_loggerTypes", "subscribers", "bind", "_context", "tag"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var r=require("inversify"),t=require("./loggerModule");describe("loggerModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=(0,t.loggerModuleFactory)(),o=new r.Container,o.load(e)}),it("should return the config module",()=>{expect(e).toBeDefined()})})});
1
+ "use strict";var r=require("inversify"),t=require("./loggerModule");describe("loggerModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=(0,t.loggerModuleFactory)(),o=new r.Container,o.loadSync(e)}),it("should return the config module",()=>{expect(e).toBeDefined()})})});
2
2
  //# sourceMappingURL=loggerModule.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/logger-publisher/di/loggerModule.test.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { loggerModuleFactory } from \"./loggerModule\";\n\ndescribe(\"loggerModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof loggerModuleFactory>;\n beforeEach(() => {\n mod = loggerModuleFactory();\n container = new Container();\n container.load(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAAoC,0BAEpC,SAAS,sBAAuB,IAAM,CACpC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,uBAAoB,EAC1BD,EAAY,IAAI,YAChBA,EAAU,KAAKC,CAAG,CACpB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { loggerModuleFactory } from \"./loggerModule\";\n\ndescribe(\"loggerModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof loggerModuleFactory>;\n beforeEach(() => {\n mod = loggerModuleFactory();\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAAoC,0BAEpC,SAAS,sBAAuB,IAAM,CACpC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,uBAAoB,EAC1BD,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["import_inversify", "import_loggerModule", "container", "mod"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var D=Object.create;var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var E=(i,r)=>{for(var e in r)a(i,e,{get:r[e],enumerable:!0})},g=(i,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of w(r))!F.call(i,p)&&p!==e&&a(i,p,{get:()=>r[p],enumerable:!(t=h(r,p))||t.enumerable});return i};var P=(i,r,e)=>(e=i!=null?D(T(i)):{},g(r||!i||!i.__esModule?a(e,"default",{value:i,enumerable:!0}):e,i)),V=i=>g(a({},"__esModule",{value:!0}),i),u=(i,r,e,t)=>{for(var p=t>1?void 0:t?h(r,e):r,y=i.length-1,v;y>=0;y--)(v=i[y])&&(p=(t?v(r,e,p):v(p))||p);return t&&p&&a(r,e,p),p},d=(i,r)=>(e,t)=>r(e,t,i);var B={};E(B,{AxiosManagerApiDataSource:()=>A});module.exports=V(B);var o=P(require("axios")),l=require("inversify"),n=require("purify-ts"),f=require("../../manager-api/di/managerApiTypes"),s=require("../../manager-api/model/Application"),_=require("../../manager-api/model/Const"),m=require("../../manager-api/model/Errors"),c=require("./ManagerApiDto");let A=class{_managerApiBaseUrl;_provider=_.DEFAULT_PROVIDER;constructor({managerApiUrl:r,provider:e}){this._managerApiBaseUrl=r,this._provider=e}setProvider(r){this._provider===r||r<1||(this._provider=r)}getProvider(){return this._provider}getAppList(r){const{targetId:e,firmwareVersionName:t}=r;return(0,n.EitherAsync)(()=>o.default.get(`${this._managerApiBaseUrl}/v2/apps/by-target`,{params:{target_id:e,provider:this._provider,firmware_version_name:t}})).map(p=>p.data).mapLeft(p=>new m.HttpFetchApiError(p))}getDeviceVersion(r){const{targetId:e}=r;return(0,n.EitherAsync)(()=>o.default.get(`${this._managerApiBaseUrl}/get_device_version`,{params:{target_id:e,provider:this._provider}})).map(t=>t.data).mapLeft(t=>new m.HttpFetchApiError(t))}getFirmwareVersion(r){const{deviceId:e,version:t}=r;return(0,n.EitherAsync)(()=>o.default.get(`${this._managerApiBaseUrl}/get_firmware_version`,{params:{device_version:e,version_name:t,provider:this._provider}})).map(p=>p.data).mapLeft(p=>new m.HttpFetchApiError(p))}getAppsByHash(r){const{hashes:e}=r;return(0,n.EitherAsync)(()=>o.default.post(`${this._managerApiBaseUrl}/v2/apps/hash`,e)).map(t=>t.data).map(t=>this.mapApplicationDtoToApplication(t)).mapLeft(t=>new m.HttpFetchApiError(t))}mapAppTypeDtoToAppType(r){switch(r){case c.AppTypeDto.currency:return s.AppType.currency;case c.AppTypeDto.plugin:return s.AppType.plugin;case c.AppTypeDto.tool:return s.AppType.tool;case c.AppTypeDto.swap:return s.AppType.swap}}mapApplicationDtoToApplication(r){return r.map(e=>{if(e===null)return null;const{applicationType:t,...p}=e;return{...p,applicationType:this.mapAppTypeDtoToAppType(t)}})}};A=u([(0,l.injectable)(),d(0,(0,l.inject)(f.managerApiTypes.DmkConfig))],A);0&&(module.exports={AxiosManagerApiDataSource});
1
+ "use strict";var E=Object.create;var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var I=(a,e)=>{for(var r in e)c(a,r,{get:e[r],enumerable:!0})},h=(a,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of b(e))!P.call(a,t)&&t!==r&&c(a,t,{get:()=>e[t],enumerable:!(i=f(e,t))||i.enumerable});return a};var T=(a,e,r)=>(r=a!=null?E(V(a)):{},h(e||!a||!a.__esModule?c(r,"default",{value:a,enumerable:!0}):r,a)),k=a=>h(c({},"__esModule",{value:!0}),a),v=(a,e,r,i)=>{for(var t=i>1?void 0:i?f(e,r):e,o=a.length-1,m;o>=0;o--)(m=a[o])&&(t=(i?m(e,r,t):m(t))||t);return i&&t&&c(e,r,t),t},d=(a,e)=>(r,i)=>e(r,i,a);var O={};I(O,{AxiosManagerApiDataSource:()=>u});module.exports=k(O);var s=T(require("axios")),g=require("inversify"),n=require("purify-ts"),A=require("../../manager-api/di/managerApiTypes"),l=require("../../manager-api/model/Application"),_=require("../../manager-api/model/Const"),w=require("../../manager-api/model/Const"),p=require("../../manager-api/model/Errors"),y=require("./ManagerApiDto");let u=class{_managerApiBaseUrl;_provider=_.DEFAULT_PROVIDER;_firmwareDistributionSalt=w.DEFAULT_FIRMWARE_DISTRIBUTION_SALT;constructor({managerApiUrl:e,provider:r,firmwareDistributionSalt:i}){this._managerApiBaseUrl=e,this._provider=r,this._firmwareDistributionSalt=i}setProvider(e){this._provider===e||e<1||(this._provider=e)}getProvider(){return this._provider}getAppList(e){const{targetId:r,firmwareVersionName:i}=e;return(0,n.EitherAsync)(()=>s.default.get(`${this._managerApiBaseUrl}/v2/apps/by-target`,{params:{target_id:r,provider:this._provider,firmware_version_name:i}})).map(t=>t.data).chain(t=>this.mapApplicationDtoToApplication(t)).mapLeft(t=>new p.HttpFetchApiError(t))}getMcuList(){return(0,n.EitherAsync)(()=>s.default.get(`${this._managerApiBaseUrl}/mcu_versions`,{})).map(e=>e.data).chain(e=>this.mapMcuDtoToMcu(e)).mapLeft(e=>new p.HttpFetchApiError(e))}getDeviceVersion(e){const{targetId:r}=e;return(0,n.EitherAsync)(()=>s.default.get(`${this._managerApiBaseUrl}/get_device_version`,{params:{target_id:r,provider:this._provider}})).map(i=>i.data).chain(i=>this.mapDeviceVersionDto(i)).mapLeft(i=>new p.HttpFetchApiError(i))}getFirmwareVersion(e){const{deviceId:r,version:i}=e;return(0,n.EitherAsync)(()=>s.default.get(`${this._managerApiBaseUrl}/get_firmware_version`,{params:{device_version:r,version_name:i,provider:this._provider}})).map(t=>t.data).chain(t=>this.mapFinalFirmwareDto(t)).mapLeft(t=>new p.HttpFetchApiError(t))}getFirmwareVersionById(e){return(0,n.EitherAsync)(()=>s.default.get(`${this._managerApiBaseUrl}/firmware_final_versions/${e}`,{})).map(r=>r.data).chain(r=>this.mapFinalFirmwareDto(r)).mapLeft(r=>new p.HttpFetchApiError(r))}getOsuFirmwareVersion(e){const{deviceId:r,version:i}=e;return(0,n.EitherAsync)(()=>s.default.get(`${this._managerApiBaseUrl}/get_osu_version`,{params:{device_version:r,version_name:i,provider:this._provider}})).map(t=>t.data).chain(t=>this.mapOsuFirmwareDto(t)).mapLeft(t=>new p.HttpFetchApiError(t))}getLatestFirmwareVersion(e){const r="34.27.0",{currentFinalFirmwareId:i,deviceId:t}=e;return(0,n.EitherAsync)(()=>s.default.get(`${this._managerApiBaseUrl}/get_latest_firmware`,{params:{current_se_firmware_final_version:i,device_version:t,provider:this._provider,salt:this._firmwareDistributionSalt,livecommonversion:r}})).map(o=>o.data).chain(o=>this.mapLatestFirmwareDto(o)).mapLeft(o=>new p.HttpFetchApiError(o))}getAppsByHash(e){const{hashes:r}=e;return(0,n.EitherAsync)(()=>s.default.post(`${this._managerApiBaseUrl}/v2/apps/hash`,r)).map(i=>i.data).chain(i=>this.mapNullableApplicationDtoToApplication(i)).mapLeft(i=>new p.HttpFetchApiError(i))}getLanguagePackages(e){const{deviceId:r,currentFinalFirmwareId:i}=e;return(0,n.EitherAsync)(()=>s.default.get(`${this._managerApiBaseUrl}/language-packages`,{params:{device_version:r,current_se_firmware_final_version:i}})).map(t=>t.data).chain(t=>this.mapLanguagesDtoToLanguages(t)).mapLeft(t=>new p.HttpFetchApiError(t))}mapAppTypeDtoToAppType(e){if(e===null)return null;switch(e){case y.AppTypeDto.currency:return l.AppType.currency;case y.AppTypeDto.plugin:return l.AppType.plugin;case y.AppTypeDto.tool:return l.AppType.tool;case y.AppTypeDto.swap:return l.AppType.swap}}mapApplicationDtoToApplication(e){return(0,n.EitherAsync)(()=>Promise.resolve(e.map(r=>this.mapApplicationDto(r))))}mapNullableApplicationDtoToApplication(e){return(0,n.EitherAsync)(()=>Promise.resolve(e.map(r=>r===null?null:this.mapApplicationDto(r))))}mapApplicationDto(e){if(typeof e!="object"||typeof e.versionId!="number"||typeof e.versionName!="string"||e.versionDisplayName!==null&&typeof e.versionDisplayName!="string"||typeof e.version!="string"||e.currencyId!==null&&typeof e.currencyId!="string"||e.description!==null&&typeof e.description!="string"||e.applicationType!==null&&typeof e.applicationType!="string"||typeof e.dateModified!="string"||e.icon!==null&&typeof e.icon!="string"||e.authorName!==null&&typeof e.authorName!="string"||e.supportURL!==null&&typeof e.supportURL!="string"||e.contactURL!==null&&typeof e.contactURL!="string"||e.sourceURL!==null&&typeof e.sourceURL!="string"||e.compatibleWallets!==null&&typeof e.compatibleWallets!="string"||typeof e.hash!="string"||typeof e.perso!="string"||typeof e.firmware!="string"||typeof e.firmwareKey!="string"||typeof e.delete!="string"||typeof e.deleteKey!="string"||e.bytes!==null&&typeof e.bytes!="number"||e.warning!==null&&typeof e.warning!="string"||typeof e.isDevTools!="boolean"||e.category!==null&&typeof e.category!="number"||e.parent!==null&&typeof e.parent!="number"||e.parentName!==null&&typeof e.parentName!="string")throw new Error(`Incomplete application: ${JSON.stringify(e)}`);const{applicationType:r,hash:i,perso:t,firmware:o,firmwareKey:m,delete:D,deleteKey:F,...L}=e;return{...L,hash:i,perso:t,firmware:o,firmwareKey:m,delete:D,deleteKey:F,applicationType:this.mapAppTypeDtoToAppType(r)}}mapMcuDtoToMcu(e){return(0,n.EitherAsync)(()=>Promise.resolve(e.map(r=>{if(typeof r!="object"||typeof r.id!="number"||typeof r.name!="string")throw new Error(`Incomplete MCU version: ${JSON.stringify(r)}`);return{id:r.id,name:r.name}})))}mapDeviceVersionDto(e){return(0,n.EitherAsync)(()=>{if(typeof e!="object"||typeof e.id!="number")throw new Error(`Incomplete device version: ${JSON.stringify(e)}`);const r={id:e.id};return Promise.resolve(r)})}mapFinalFirmwareDto(e){return(0,n.EitherAsync)(()=>{if(typeof e!="object"||typeof e.id!="number"||typeof e.version!="string"||typeof e.perso!="string"||e.firmware!==null&&typeof e.firmware!="string"||e.firmware_key!==null&&typeof e.firmware_key!="string"||e.hash!==null&&typeof e.hash!="string"||e.bytes!==null&&typeof e.bytes!="number"||!Array.isArray(e.mcu_versions))throw new Error(`Incomplete final firmware: ${JSON.stringify(e)}`);const r={id:e.id,version:e.version,perso:e.perso,firmware:e.firmware,firmwareKey:e.firmware_key,hash:e.hash,bytes:e.bytes,mcuVersions:e.mcu_versions};return Promise.resolve(r)})}mapLatestFirmwareDto(e){return(0,n.EitherAsync)(()=>{if(e.result!=="success"||!e.se_firmware_osu_version)throw new Error(`Latest firmware could not be retrieved: ${e.result}`);const r=e.se_firmware_osu_version;return Promise.resolve(r)}).chain(r=>this.mapOsuFirmwareDto(r))}mapOsuFirmwareDto(e){return(0,n.EitherAsync)(()=>{if(typeof e!="object"||typeof e.id!="number"||typeof e.perso!="string"||typeof e.firmware!="string"||typeof e.firmware_key!="string"||e.hash!==null&&typeof e.hash!="string"||typeof e.next_se_firmware_final_version!="number")throw new Error(`Incomplete latest firmware: ${JSON.stringify(e)}`);const r={id:e.id,perso:e.perso,firmware:e.firmware,firmwareKey:e.firmware_key,hash:e.hash,nextFinalFirmware:e.next_se_firmware_final_version};return Promise.resolve(r)})}mapLanguagesDtoToLanguages(e){return(0,n.EitherAsync)(()=>Promise.resolve(e.map(r=>this.mapLanguageDto(r))))}mapLanguageDto(e){if(typeof e!="object"||typeof e.language!="string"||typeof e.languagePackageVersionId!="number"||typeof e.version!="string"||typeof e.language_package_id!="number"||typeof e.apdu_install_url!="string"||typeof e.apdu_uninstall_url!="string"||typeof e.bytes!="number"||typeof e.date_creation!="string"||typeof e.date_last_modified!="string")throw new Error(`Incomplete language version: ${JSON.stringify(e)}`);return{language:e.language,languagePackageVersionId:e.languagePackageVersionId,version:e.version,languagePackageId:e.language_package_id,apduInstallUrl:e.apdu_install_url,apduUninstallUrl:e.apdu_uninstall_url,bytes:e.bytes,dateCreation:e.date_creation,dateLastModified:e.date_last_modified}}};u=v([(0,g.injectable)(),d(0,(0,g.inject)(A.managerApiTypes.DmkConfig))],u);0&&(module.exports={AxiosManagerApiDataSource});
2
2
  //# sourceMappingURL=AxiosManagerApiDataSource.js.map