@ledgerhq/device-management-kit 0.7.0 → 0.9.0

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 (415) hide show
  1. package/README.md +3 -3
  2. package/lib/cjs/package.json +1 -2
  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/apdu/utils/ByteArrayBuilder.js +1 -1
  8. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  9. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  10. package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  11. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js +1 -1
  12. package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  13. package/lib/cjs/src/api/command/di/commandModule.js +1 -1
  14. package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
  15. package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
  16. package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
  17. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  18. package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  19. package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
  20. package/lib/cjs/src/api/command/utils/CommandUtils.js.map +2 -2
  21. package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
  22. package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +2 -2
  23. package/lib/cjs/src/api/command/utils/GlobalCommandError.js +1 -1
  24. package/lib/cjs/src/api/command/utils/GlobalCommandError.js.map +2 -2
  25. package/lib/cjs/src/api/device/DeviceModel.js +1 -1
  26. package/lib/cjs/src/api/device/DeviceModel.js.map +2 -2
  27. package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
  28. package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
  29. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
  30. package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  31. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +1 -1
  32. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  33. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  34. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  35. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
  36. package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
  37. package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
  38. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
  39. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +2 -2
  40. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +1 -1
  41. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  42. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  43. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  44. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  45. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  46. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  47. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
  48. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +2 -2
  49. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -1
  50. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +1 -1
  51. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  52. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  53. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  54. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +2 -2
  55. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
  56. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +1 -1
  57. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
  58. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +2 -2
  59. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +1 -1
  60. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  61. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  62. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
  63. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
  64. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +1 -1
  65. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +2 -2
  66. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +1 -1
  67. package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +2 -2
  68. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  69. package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +2 -2
  70. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  71. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  72. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  73. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  74. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  75. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
  76. package/lib/cjs/src/api/index.js +1 -1
  77. package/lib/cjs/src/api/index.js.map +2 -2
  78. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  79. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  80. package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +1 -1
  81. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  82. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +2 -2
  83. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +1 -1
  84. package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +1 -1
  85. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  86. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  87. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  88. package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  89. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  90. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +2 -2
  91. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +1 -1
  92. package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +1 -1
  93. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  94. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  95. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  96. package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  97. package/lib/cjs/src/api/secure-channel/task/types.js +1 -1
  98. package/lib/cjs/src/api/secure-channel/task/types.js.map +2 -2
  99. package/lib/cjs/src/api/secure-channel/utils.js +1 -1
  100. package/lib/cjs/src/api/secure-channel/utils.js.map +3 -3
  101. package/lib/cjs/src/api/secure-channel/utils.test.js +1 -1
  102. package/lib/cjs/src/api/secure-channel/utils.test.js.map +3 -3
  103. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
  104. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
  105. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  106. package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  107. package/lib/cjs/src/api/transport/model/Errors.js +1 -1
  108. package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
  109. package/lib/cjs/src/api/utils/AppName.js +2 -0
  110. package/lib/cjs/src/api/utils/AppName.js.map +7 -0
  111. package/lib/cjs/src/api/utils/AppName.test.js +2 -0
  112. package/lib/cjs/src/api/utils/AppName.test.js.map +7 -0
  113. package/lib/cjs/src/api/utils/HexaString.js +1 -1
  114. package/lib/cjs/src/api/utils/HexaString.js.map +3 -3
  115. package/lib/cjs/src/api/utils/HexaString.test.js +1 -1
  116. package/lib/cjs/src/api/utils/HexaString.test.js.map +2 -2
  117. package/lib/cjs/src/di.js +1 -1
  118. package/lib/cjs/src/di.js.map +2 -2
  119. package/lib/cjs/src/internal/config/di/configModule.js +1 -1
  120. package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
  121. package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
  122. package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
  123. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
  124. package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  125. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  126. package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  127. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
  128. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  129. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  130. package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  131. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  132. package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  133. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  134. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  135. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  136. package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  137. package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
  138. package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
  139. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
  140. package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  141. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
  142. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  143. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  144. package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  145. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
  146. package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  147. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  148. package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  149. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  150. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  151. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  152. package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  153. package/lib/cjs/src/internal/secure-channel/model/Errors.js +1 -1
  154. package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +3 -3
  155. package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
  156. package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
  157. package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
  158. package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
  159. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
  160. package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  161. package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
  162. package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
  163. package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
  164. package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
  165. package/lib/esm/package.json +1 -2
  166. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  167. package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
  168. package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
  169. package/lib/esm/src/api/DeviceManagementKit.test.js.map +3 -3
  170. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
  171. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
  172. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
  173. package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
  174. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +1 -1
  175. package/lib/esm/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
  176. package/lib/esm/src/api/command/di/commandModule.js +1 -1
  177. package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
  178. package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
  179. package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
  180. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
  181. package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
  182. package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
  183. package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
  184. package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
  185. package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +2 -2
  186. package/lib/esm/src/api/command/utils/GlobalCommandError.js +1 -1
  187. package/lib/esm/src/api/command/utils/GlobalCommandError.js.map +2 -2
  188. package/lib/esm/src/api/device/DeviceModel.js +1 -1
  189. package/lib/esm/src/api/device/DeviceModel.js.map +2 -2
  190. package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
  191. package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
  192. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
  193. package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
  194. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +1 -1
  195. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  196. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  197. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
  198. package/lib/esm/src/api/device-action/os/Errors.js +1 -1
  199. package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
  200. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
  201. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +2 -2
  202. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  203. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
  204. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  205. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
  206. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  207. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  208. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
  209. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +2 -2
  210. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  211. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  212. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  213. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  214. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
  215. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +2 -2
  216. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  217. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
  218. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +1 -1
  219. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +3 -3
  220. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +1 -1
  221. package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +3 -3
  222. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
  223. package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +2 -2
  224. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  225. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
  226. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  227. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
  228. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  229. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
  230. package/lib/esm/src/api/index.js +1 -1
  231. package/lib/esm/src/api/index.js.map +3 -3
  232. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
  233. package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
  234. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
  235. package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +2 -2
  236. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
  237. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
  238. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
  239. package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
  240. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
  241. package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +2 -2
  242. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
  243. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
  244. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
  245. package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
  246. package/lib/esm/src/api/secure-channel/task/types.js +1 -1
  247. package/lib/esm/src/api/secure-channel/task/types.js.map +2 -2
  248. package/lib/esm/src/api/secure-channel/utils.js +1 -1
  249. package/lib/esm/src/api/secure-channel/utils.js.map +3 -3
  250. package/lib/esm/src/api/secure-channel/utils.test.js +1 -1
  251. package/lib/esm/src/api/secure-channel/utils.test.js.map +3 -3
  252. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
  253. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
  254. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
  255. package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
  256. package/lib/esm/src/api/transport/model/Errors.js +1 -1
  257. package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
  258. package/lib/esm/src/api/utils/AppName.js +2 -0
  259. package/lib/esm/src/api/utils/AppName.js.map +7 -0
  260. package/lib/esm/src/api/utils/AppName.test.js +2 -0
  261. package/lib/esm/src/api/utils/AppName.test.js.map +7 -0
  262. package/lib/esm/src/api/utils/HexaString.js +1 -1
  263. package/lib/esm/src/api/utils/HexaString.js.map +3 -3
  264. package/lib/esm/src/api/utils/HexaString.test.js +1 -1
  265. package/lib/esm/src/api/utils/HexaString.test.js.map +2 -2
  266. package/lib/esm/src/di.js +1 -1
  267. package/lib/esm/src/di.js.map +2 -2
  268. package/lib/esm/src/internal/config/di/configModule.js +1 -1
  269. package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
  270. package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
  271. package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
  272. package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
  273. package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
  274. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
  275. package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
  276. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
  277. package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
  278. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
  279. package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
  280. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
  281. package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js.map +2 -2
  282. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
  283. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
  284. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
  285. package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
  286. package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
  287. package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
  288. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
  289. package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
  290. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
  291. package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
  292. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
  293. package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
  294. package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
  295. package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
  296. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
  297. package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
  298. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +1 -1
  299. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
  300. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
  301. package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
  302. package/lib/esm/src/internal/secure-channel/model/Errors.js +1 -1
  303. package/lib/esm/src/internal/secure-channel/model/Errors.js.map +3 -3
  304. package/lib/esm/src/internal/send/di/sendModule.js +1 -1
  305. package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
  306. package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
  307. package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
  308. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
  309. package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
  310. package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
  311. package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
  312. package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
  313. package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
  314. package/lib/types/src/api/DeviceManagementKit.d.ts +4 -0
  315. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  316. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  317. package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
  318. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +66 -0
  319. package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
  320. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +1 -0
  321. package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts.map +1 -1
  322. package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
  323. package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
  324. package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
  325. package/lib/types/src/api/command/utils/CommandUtils.d.ts +3 -0
  326. package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
  327. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts +1 -1
  328. package/lib/types/src/api/command/utils/GlobalCommandError.d.ts.map +1 -1
  329. package/lib/types/src/api/device/DeviceModel.d.ts +2 -1
  330. package/lib/types/src/api/device/DeviceModel.d.ts.map +1 -1
  331. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  332. package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
  333. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +1 -0
  334. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts.map +1 -1
  335. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
  336. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +0 -1
  337. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  338. package/lib/types/src/api/device-action/os/Errors.d.ts +10 -0
  339. package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
  340. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -1
  341. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +2 -1
  342. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -1
  343. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  344. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
  345. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -1
  346. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +3 -2
  347. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -1
  348. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
  349. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +0 -1
  350. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
  351. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -1
  352. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +0 -1
  353. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -1
  354. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  355. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +0 -1
  356. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  357. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +2 -2
  358. package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -1
  359. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts +1 -0
  360. package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts.map +1 -1
  361. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  362. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  363. package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
  364. package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
  365. package/lib/types/src/api/index.d.ts +1 -1
  366. package/lib/types/src/api/index.d.ts.map +1 -1
  367. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -1
  368. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +2 -1
  369. package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -1
  370. package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -1
  371. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +2 -1
  372. package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -1
  373. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -1
  374. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +2 -1
  375. package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -1
  376. package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
  377. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +2 -1
  378. package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -1
  379. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +5 -2
  380. package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -1
  381. package/lib/types/src/api/secure-channel/task/types.d.ts +6 -1
  382. package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -1
  383. package/lib/types/src/api/secure-channel/utils.d.ts +0 -11
  384. package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -1
  385. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +8 -7
  386. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -1
  387. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts +2 -0
  388. package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts.map +1 -0
  389. package/lib/types/src/api/transport/model/Errors.d.ts +5 -0
  390. package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
  391. package/lib/types/src/api/utils/AppName.d.ts +2 -0
  392. package/lib/types/src/api/utils/AppName.d.ts.map +1 -0
  393. package/lib/types/src/api/utils/AppName.test.d.ts +2 -0
  394. package/lib/types/src/api/utils/AppName.test.d.ts.map +1 -0
  395. package/lib/types/src/api/utils/HexaString.d.ts +4 -3
  396. package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
  397. package/lib/types/src/di.d.ts.map +1 -1
  398. package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
  399. package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
  400. package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
  401. package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
  402. package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.d.ts.map +1 -1
  403. package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -1
  404. package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
  405. package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
  406. package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
  407. package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
  408. package/lib/types/src/internal/secure-channel/model/Errors.d.ts +22 -2
  409. package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -1
  410. package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
  411. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +5 -1
  412. package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
  413. package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
  414. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  415. package/package.json +5 -6
@@ -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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AAI,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,UAA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AAM,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",
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(discoveryTypes.ListenToConnectedDeviceUseCase).to(StubUseCase);\n rebind(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,CAACC,EAAMC,EAASC,EAAUC,IAAW,CACvDH,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,IACFI,EAAO,iBAAe,uBAAuB,EAAE,GAAG,aAAW,EAC7DA,EAAO,iBAAe,sBAAsB,EAAE,GAAG,aAAW,EAC5DA,EAAO,iBAAe,cAAc,EAAE,GAAG,aAAW,EACpDA,EAAO,iBAAe,iBAAiB,EAAE,GAAG,aAAW,EACvDA,EAAO,iBAAe,yBAAyB,EAAE,GAAG,aAAW,EAC/DA,EAAO,iBAAe,+BAA+B,EAAE,GAAG,aAAW,EACrEA,EAAO,iBAAe,8BAA8B,EAAE,GAAG,aAAW,EACpEA,EAAO,iBAAe,2BAA2B,EAAE,GAAG,aAAW,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 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 m=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var C=(e,o)=>{for(var r in o)m(e,r,{get:o[r],enumerable:!0})},M=(e,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of u(o))!A.call(e,a)&&a!==r&&m(e,a,{get:()=>o[a],enumerable:!(n=f(o,a))||n.enumerable});return e};var l=e=>M(m({},"__esModule",{value:!0}),e);var v={};C(v,{managerApiModuleFactory:()=>D});module.exports=l(v);var s=require("inversify"),g=require("../../manager-api/data/AxiosManagerApiDataSource"),S=require("../../manager-api/service/DefaultManagerApiService"),c=require("../../manager-api/use-case/SetProviderUseCase"),i=require("../../../../src/di.stub"),t=require("./managerApiTypes");const D=({stub:e,config:o})=>new s.ContainerModule((r,n,a,p)=>{r(t.managerApiTypes.DmkConfig).toConstantValue(o),r(t.managerApiTypes.ManagerApiDataSource).to(g.AxiosManagerApiDataSource).inSingletonScope(),r(t.managerApiTypes.ManagerApiService).to(S.DefaultManagerApiService).inSingletonScope(),r(t.managerApiTypes.SetProviderUseCase).to(c.SetProviderUseCase),e&&(p(t.managerApiTypes.ManagerApiDataSource).to(i.StubUseCase),p(t.managerApiTypes.ManagerApiService).to(i.StubUseCase),p(t.managerApiTypes.SetProviderUseCase).to(i.StubUseCase))});0&&(module.exports={managerApiModuleFactory});
1
+ "use strict";var m=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var A=(e,o)=>{for(var r in o)m(e,r,{get:o[r],enumerable:!0})},C=(e,o,r,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of c(o))!u.call(e,i)&&i!==r&&m(e,i,{get:()=>o[i],enumerable:!(a=S(o,i))||a.enumerable});return e};var M=e=>C(m({},"__esModule",{value:!0}),e);var D={};A(D,{managerApiModuleFactory:()=>l});module.exports=M(D);var n=require("inversify"),s=require("../../manager-api/data/AxiosManagerApiDataSource"),g=require("../../manager-api/service/DefaultManagerApiService"),f=require("../../manager-api/use-case/SetProviderUseCase"),p=require("../../../../src/di.stub"),t=require("./managerApiTypes");const l=({stub:e,config:o})=>new n.ContainerModule(({bind:r,rebindSync:a})=>{r(t.managerApiTypes.DmkConfig).toConstantValue(o),r(t.managerApiTypes.ManagerApiDataSource).to(s.AxiosManagerApiDataSource).inSingletonScope(),r(t.managerApiTypes.ManagerApiService).to(g.DefaultManagerApiService).inSingletonScope(),r(t.managerApiTypes.SetProviderUseCase).to(f.SetProviderUseCase),e&&(a(t.managerApiTypes.ManagerApiDataSource).to(p.StubUseCase),a(t.managerApiTypes.ManagerApiService).to(p.StubUseCase),a(t.managerApiTypes.SetProviderUseCase).to(p.StubUseCase))});0&&(module.exports={managerApiModuleFactory});
2
2
  //# sourceMappingURL=managerApiModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/manager-api/di/managerApiModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { SetProviderUseCase } from \"@internal/manager-api/use-case/SetProviderUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { managerApiTypes } from \"./managerApiTypes\";\n\ntype FactoryProps = {\n stub?: boolean;\n config: DmkConfig;\n};\n\nexport const managerApiModuleFactory = ({ stub, config }: FactoryProps) =>\n new ContainerModule((bind, _unbind, _isBound, rebind) => {\n bind(managerApiTypes.DmkConfig).toConstantValue(config);\n\n bind(managerApiTypes.ManagerApiDataSource)\n .to(AxiosManagerApiDataSource)\n .inSingletonScope();\n bind(managerApiTypes.ManagerApiService)\n .to(DefaultManagerApiService)\n .inSingletonScope();\n bind(managerApiTypes.SetProviderUseCase).to(SetProviderUseCase);\n\n if (stub) {\n rebind(managerApiTypes.ManagerApiDataSource).to(StubUseCase);\n rebind(managerApiTypes.ManagerApiService).to(StubUseCase);\n rebind(managerApiTypes.SetProviderUseCase).to(StubUseCase);\n }\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAGhCC,EAA0C,gEAC1CC,EAAyC,kEACzCC,EAAmC,6DACnCC,EAA4B,6BAE5BC,EAAgC,6BAOzB,MAAMP,EAA0B,CAAC,CAAE,KAAAQ,EAAM,OAAAC,CAAO,IACrD,IAAI,kBAAgB,CAACC,EAAMC,EAASC,EAAUC,IAAW,CACvDH,EAAK,kBAAgB,SAAS,EAAE,gBAAgBD,CAAM,EAEtDC,EAAK,kBAAgB,oBAAoB,EACtC,GAAG,2BAAyB,EAC5B,iBAAiB,EACpBA,EAAK,kBAAgB,iBAAiB,EACnC,GAAG,0BAAwB,EAC3B,iBAAiB,EACpBA,EAAK,kBAAgB,kBAAkB,EAAE,GAAG,oBAAkB,EAE1DF,IACFK,EAAO,kBAAgB,oBAAoB,EAAE,GAAG,aAAW,EAC3DA,EAAO,kBAAgB,iBAAiB,EAAE,GAAG,aAAW,EACxDA,EAAO,kBAAgB,kBAAkB,EAAE,GAAG,aAAW,EAE7D,CAAC",
6
- "names": ["managerApiModule_exports", "__export", "managerApiModuleFactory", "__toCommonJS", "import_inversify", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_SetProviderUseCase", "import_di", "import_managerApiTypes", "stub", "config", "bind", "_unbind", "_isBound", "rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { SetProviderUseCase } from \"@internal/manager-api/use-case/SetProviderUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { managerApiTypes } from \"./managerApiTypes\";\n\ntype FactoryProps = {\n stub?: boolean;\n config: DmkConfig;\n};\n\nexport const managerApiModuleFactory = ({ stub, config }: FactoryProps) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind(managerApiTypes.DmkConfig).toConstantValue(config);\n\n bind(managerApiTypes.ManagerApiDataSource)\n .to(AxiosManagerApiDataSource)\n .inSingletonScope();\n bind(managerApiTypes.ManagerApiService)\n .to(DefaultManagerApiService)\n .inSingletonScope();\n bind(managerApiTypes.SetProviderUseCase).to(SetProviderUseCase);\n\n if (stub) {\n rebindSync(managerApiTypes.ManagerApiDataSource).to(StubUseCase);\n rebindSync(managerApiTypes.ManagerApiService).to(StubUseCase);\n rebindSync(managerApiTypes.SetProviderUseCase).to(StubUseCase);\n }\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAGhCC,EAA0C,gEAC1CC,EAAyC,kEACzCC,EAAmC,6DACnCC,EAA4B,6BAE5BC,EAAgC,6BAOzB,MAAMP,EAA0B,CAAC,CAAE,KAAAQ,EAAM,OAAAC,CAAO,IACrD,IAAI,kBAAgB,CAAC,CAAE,KAAAC,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EAAK,kBAAgB,SAAS,EAAE,gBAAgBD,CAAM,EAEtDC,EAAK,kBAAgB,oBAAoB,EACtC,GAAG,2BAAyB,EAC5B,iBAAiB,EACpBA,EAAK,kBAAgB,iBAAiB,EACnC,GAAG,0BAAwB,EAC3B,iBAAiB,EACpBA,EAAK,kBAAgB,kBAAkB,EAAE,GAAG,oBAAkB,EAE1DF,IACFG,EAAW,kBAAgB,oBAAoB,EAAE,GAAG,aAAW,EAC/DA,EAAW,kBAAgB,iBAAiB,EAAE,GAAG,aAAW,EAC5DA,EAAW,kBAAgB,kBAAkB,EAAE,GAAG,aAAW,EAEjE,CAAC",
6
+ "names": ["managerApiModule_exports", "__export", "managerApiModuleFactory", "__toCommonJS", "import_inversify", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_SetProviderUseCase", "import_di", "import_managerApiTypes", "stub", "config", "bind", "rebindSync"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=require("inversify"),u=require("../../manager-api/data/AxiosManagerApiDataSource"),l=require("../../manager-api/service/DefaultManagerApiService"),i=require("../../../../src/di.stub"),p=require("./managerApiModule"),r=require("./managerApiTypes");describe("managerApiModuleFactory",()=>{describe("Default",()=>{let e,t;beforeEach(()=>{t=(0,p.managerApiModuleFactory)({stub:!1,config:{managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url",webSocketUrl:"http://fake-websocket.url"}}),e=new c.Container,e.load(t)}),it("should return the config module",()=>{expect(t).toBeDefined()}),it("should return none stubbed use cases",()=>{const o=e.get(r.managerApiTypes.ManagerApiDataSource);expect(o).toBeInstanceOf(u.AxiosManagerApiDataSource);const a=e.get(r.managerApiTypes.ManagerApiService);expect(a).toBeInstanceOf(l.DefaultManagerApiService);const n=e.get(r.managerApiTypes.DmkConfig);expect(n).toEqual({managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url",webSocketUrl:"http://fake-websocket.url"})})}),describe("Stubbed",()=>{let e,t;beforeEach(()=>{t=(0,p.managerApiModuleFactory)({stub:!0,config:{managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url",webSocketUrl:"http://fake-websocket.url"}}),e=new c.Container,e.load(t)}),it("should return the config module",()=>{expect(t).toBeDefined()}),it("should return stubbed use cases",()=>{const o=e.get(r.managerApiTypes.ManagerApiDataSource);expect(o).toBeInstanceOf(i.StubUseCase);const a=e.get(r.managerApiTypes.ManagerApiService);expect(a).toBeInstanceOf(i.StubUseCase);const n=e.get(r.managerApiTypes.DmkConfig);expect(n).toEqual({managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url",webSocketUrl:"http://fake-websocket.url"})})})});
1
+ "use strict";var c=require("inversify"),u=require("../../manager-api/data/AxiosManagerApiDataSource"),l=require("../../manager-api/service/DefaultManagerApiService"),i=require("../../../../src/di.stub"),p=require("./managerApiModule"),r=require("./managerApiTypes");describe("managerApiModuleFactory",()=>{describe("Default",()=>{let e,t;beforeEach(()=>{t=(0,p.managerApiModuleFactory)({stub:!1,config:{managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url",webSocketUrl:"http://fake-websocket.url"}}),e=new c.Container,e.loadSync(t)}),it("should return the config module",()=>{expect(t).toBeDefined()}),it("should return none stubbed use cases",()=>{const o=e.get(r.managerApiTypes.ManagerApiDataSource);expect(o).toBeInstanceOf(u.AxiosManagerApiDataSource);const a=e.get(r.managerApiTypes.ManagerApiService);expect(a).toBeInstanceOf(l.DefaultManagerApiService);const n=e.get(r.managerApiTypes.DmkConfig);expect(n).toEqual({managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url",webSocketUrl:"http://fake-websocket.url"})})}),describe("Stubbed",()=>{let e,t;beforeEach(()=>{t=(0,p.managerApiModuleFactory)({stub:!0,config:{managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url",webSocketUrl:"http://fake-websocket.url"}}),e=new c.Container,e.loadSync(t)}),it("should return the config module",()=>{expect(t).toBeDefined()}),it("should return stubbed use cases",()=>{const o=e.get(r.managerApiTypes.ManagerApiDataSource);expect(o).toBeInstanceOf(i.StubUseCase);const a=e.get(r.managerApiTypes.ManagerApiService);expect(a).toBeInstanceOf(i.StubUseCase);const n=e.get(r.managerApiTypes.DmkConfig);expect(n).toEqual({managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url",webSocketUrl:"http://fake-websocket.url"})})})});
2
2
  //# sourceMappingURL=managerApiModule.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/manager-api/di/managerApiModule.test.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { managerApiModuleFactory } from \"./managerApiModule\";\nimport { managerApiTypes } from \"./managerApiTypes\";\n\ndescribe(\"managerApiModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof managerApiModuleFactory>;\n beforeEach(() => {\n mod = managerApiModuleFactory({\n stub: false,\n config: {\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n webSocketUrl: \"http://fake-websocket.url\",\n } as DmkConfig,\n });\n container = new Container();\n container.load(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none stubbed use cases\", () => {\n const managerApiDataSource = container.get(\n managerApiTypes.ManagerApiDataSource,\n );\n expect(managerApiDataSource).toBeInstanceOf(AxiosManagerApiDataSource);\n\n const managerApiService = container.get(\n managerApiTypes.ManagerApiService,\n );\n expect(managerApiService).toBeInstanceOf(DefaultManagerApiService);\n\n const config = container.get(managerApiTypes.DmkConfig);\n expect(config).toEqual({\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n webSocketUrl: \"http://fake-websocket.url\",\n });\n });\n });\n\n describe(\"Stubbed\", () => {\n let container: Container;\n let mod: ReturnType<typeof managerApiModuleFactory>;\n beforeEach(() => {\n mod = managerApiModuleFactory({\n stub: true,\n config: {\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n webSocketUrl: \"http://fake-websocket.url\",\n } as DmkConfig,\n });\n container = new Container();\n container.load(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return stubbed use cases\", () => {\n const managerApiDataSource = container.get(\n managerApiTypes.ManagerApiDataSource,\n );\n expect(managerApiDataSource).toBeInstanceOf(StubUseCase);\n\n const managerApiService = container.get(\n managerApiTypes.ManagerApiService,\n );\n expect(managerApiService).toBeInstanceOf(StubUseCase);\n\n const config = container.get(managerApiTypes.DmkConfig);\n expect(config).toEqual({\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n webSocketUrl: \"http://fake-websocket.url\",\n });\n });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAA0B,qBAG1BC,EAA0C,gEAC1CC,EAAyC,kEACzCC,EAA4B,6BAE5BC,EAAwC,8BACxCC,EAAgC,6BAEhC,SAAS,0BAA2B,IAAM,CACxC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,2BAAwB,CAC5B,KAAM,GACN,OAAQ,CACN,cAAe,kBACf,QAAS,uBACT,aAAc,2BAChB,CACF,CAAC,EACDD,EAAY,IAAI,YAChBA,EAAU,KAAKC,CAAG,CACpB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,uCAAwC,IAAM,CAC/C,MAAMC,EAAuBF,EAAU,IACrC,kBAAgB,oBAClB,EACA,OAAOE,CAAoB,EAAE,eAAe,2BAAyB,EAErE,MAAMC,EAAoBH,EAAU,IAClC,kBAAgB,iBAClB,EACA,OAAOG,CAAiB,EAAE,eAAe,0BAAwB,EAEjE,MAAMC,EAASJ,EAAU,IAAI,kBAAgB,SAAS,EACtD,OAAOI,CAAM,EAAE,QAAQ,CACrB,cAAe,kBACf,QAAS,uBACT,aAAc,2BAChB,CAAC,CACH,CAAC,CACH,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,IAAIJ,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,2BAAwB,CAC5B,KAAM,GACN,OAAQ,CACN,cAAe,kBACf,QAAS,uBACT,aAAc,2BAChB,CACF,CAAC,EACDD,EAAY,IAAI,YAChBA,EAAU,KAAKC,CAAG,CACpB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,MAAMC,EAAuBF,EAAU,IACrC,kBAAgB,oBAClB,EACA,OAAOE,CAAoB,EAAE,eAAe,aAAW,EAEvD,MAAMC,EAAoBH,EAAU,IAClC,kBAAgB,iBAClB,EACA,OAAOG,CAAiB,EAAE,eAAe,aAAW,EAEpD,MAAMC,EAASJ,EAAU,IAAI,kBAAgB,SAAS,EACtD,OAAOI,CAAM,EAAE,QAAQ,CACrB,cAAe,kBACf,QAAS,uBACT,aAAc,2BAChB,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { managerApiModuleFactory } from \"./managerApiModule\";\nimport { managerApiTypes } from \"./managerApiTypes\";\n\ndescribe(\"managerApiModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof managerApiModuleFactory>;\n beforeEach(() => {\n mod = managerApiModuleFactory({\n stub: false,\n config: {\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n webSocketUrl: \"http://fake-websocket.url\",\n } as DmkConfig,\n });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none stubbed use cases\", () => {\n const managerApiDataSource = container.get(\n managerApiTypes.ManagerApiDataSource,\n );\n expect(managerApiDataSource).toBeInstanceOf(AxiosManagerApiDataSource);\n\n const managerApiService = container.get(\n managerApiTypes.ManagerApiService,\n );\n expect(managerApiService).toBeInstanceOf(DefaultManagerApiService);\n\n const config = container.get(managerApiTypes.DmkConfig);\n expect(config).toEqual({\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n webSocketUrl: \"http://fake-websocket.url\",\n });\n });\n });\n\n describe(\"Stubbed\", () => {\n let container: Container;\n let mod: ReturnType<typeof managerApiModuleFactory>;\n beforeEach(() => {\n mod = managerApiModuleFactory({\n stub: true,\n config: {\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n webSocketUrl: \"http://fake-websocket.url\",\n } as DmkConfig,\n });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return stubbed use cases\", () => {\n const managerApiDataSource = container.get(\n managerApiTypes.ManagerApiDataSource,\n );\n expect(managerApiDataSource).toBeInstanceOf(StubUseCase);\n\n const managerApiService = container.get(\n managerApiTypes.ManagerApiService,\n );\n expect(managerApiService).toBeInstanceOf(StubUseCase);\n\n const config = container.get(managerApiTypes.DmkConfig);\n expect(config).toEqual({\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n webSocketUrl: \"http://fake-websocket.url\",\n });\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA0B,qBAG1BC,EAA0C,gEAC1CC,EAAyC,kEACzCC,EAA4B,6BAE5BC,EAAwC,8BACxCC,EAAgC,6BAEhC,SAAS,0BAA2B,IAAM,CACxC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,2BAAwB,CAC5B,KAAM,GACN,OAAQ,CACN,cAAe,kBACf,QAAS,uBACT,aAAc,2BAChB,CACF,CAAC,EACDD,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,uCAAwC,IAAM,CAC/C,MAAMC,EAAuBF,EAAU,IACrC,kBAAgB,oBAClB,EACA,OAAOE,CAAoB,EAAE,eAAe,2BAAyB,EAErE,MAAMC,EAAoBH,EAAU,IAClC,kBAAgB,iBAClB,EACA,OAAOG,CAAiB,EAAE,eAAe,0BAAwB,EAEjE,MAAMC,EAASJ,EAAU,IAAI,kBAAgB,SAAS,EACtD,OAAOI,CAAM,EAAE,QAAQ,CACrB,cAAe,kBACf,QAAS,uBACT,aAAc,2BAChB,CAAC,CACH,CAAC,CACH,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,IAAIJ,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,2BAAwB,CAC5B,KAAM,GACN,OAAQ,CACN,cAAe,kBACf,QAAS,uBACT,aAAc,2BAChB,CACF,CAAC,EACDD,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,MAAMC,EAAuBF,EAAU,IACrC,kBAAgB,oBAClB,EACA,OAAOE,CAAoB,EAAE,eAAe,aAAW,EAEvD,MAAMC,EAAoBH,EAAU,IAClC,kBAAgB,iBAClB,EACA,OAAOG,CAAiB,EAAE,eAAe,aAAW,EAEpD,MAAMC,EAASJ,EAAU,IAAI,kBAAgB,SAAS,EACtD,OAAOI,CAAM,EAAE,QAAQ,CACrB,cAAe,kBACf,QAAS,uBACT,aAAc,2BAChB,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
6
  "names": ["import_inversify", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_di", "import_managerApiModule", "import_managerApiTypes", "container", "mod", "managerApiDataSource", "managerApiService", "config"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var C=(o,e)=>{for(var r in e)u(o,r,{get:e[r],enumerable:!0})},s=(o,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of l(e))!p.call(o,n)&&n!==r&&u(o,n,{get:()=>e[n],enumerable:!(a=f(e,n))||a.enumerable});return o};var S=o=>s(u({},"__esModule",{value:!0}),o);var h={};C(h,{secureChannelModuleFactory:()=>D});module.exports=S(h);var c=require("inversify"),i=require("../../secure-channel/data/DefaultSecureChannelDataSource"),m=require("../../secure-channel/service/DefaultSecureChannelService"),t=require("./secureChannelTypes");const D=({stub:o,config:e})=>new c.ContainerModule((r,a,n,y)=>{r(t.secureChannelTypes.DmkConfig).toConstantValue(e),r(t.secureChannelTypes.SecureChannelDataSource).to(i.DefaultSecureChannelDataSource),r(t.secureChannelTypes.SecureChannelService).to(m.DefaultSecureChannelService)});0&&(module.exports={secureChannelModuleFactory});
1
+ "use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var C=(o,e)=>{for(var r in e)a(o,r,{get:e[r],enumerable:!0})},s=(o,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of i(e))!p.call(o,t)&&t!==r&&a(o,t,{get:()=>e[t],enumerable:!(c=l(e,t))||c.enumerable});return o};var S=o=>s(a({},"__esModule",{value:!0}),o);var h={};C(h,{secureChannelModuleFactory:()=>D});module.exports=S(h);var u=require("inversify"),m=require("../../secure-channel/data/DefaultSecureChannelDataSource"),f=require("../../secure-channel/service/DefaultSecureChannelService"),n=require("./secureChannelTypes");const D=({stub:o,config:e})=>new u.ContainerModule(({bind:r})=>{r(n.secureChannelTypes.DmkConfig).toConstantValue(e),r(n.secureChannelTypes.SecureChannelDataSource).to(m.DefaultSecureChannelDataSource),r(n.secureChannelTypes.SecureChannelService).to(f.DefaultSecureChannelService)});0&&(module.exports={secureChannelModuleFactory});
2
2
  //# sourceMappingURL=secureChannelModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/secure-channel/di/secureChannelModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\n\nimport { secureChannelTypes } from \"./secureChannelTypes\";\n\ntype FactoryProps = {\n stub?: boolean;\n config: DmkConfig;\n};\n\nexport const secureChannelModuleFactory = ({ stub, config }: FactoryProps) =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(secureChannelTypes.DmkConfig).toConstantValue(config);\n\n bind(secureChannelTypes.SecureChannelDataSource).to(\n DefaultSecureChannelDataSource,\n );\n bind(secureChannelTypes.SecureChannelService).to(\n DefaultSecureChannelService,\n );\n\n if (stub) {\n /* empty */\n }\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAGhCC,EAA+C,wEAC/CC,EAA4C,wEAE5CC,EAAmC,gCAO5B,MAAML,EAA6B,CAAC,CAAE,KAAAM,EAAM,OAAAC,CAAO,IACxD,IAAI,kBAAgB,CAACC,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,qBAAmB,SAAS,EAAE,gBAAgBD,CAAM,EAEzDC,EAAK,qBAAmB,uBAAuB,EAAE,GAC/C,gCACF,EACAA,EAAK,qBAAmB,oBAAoB,EAAE,GAC5C,6BACF,CAKF,CAAC",
6
- "names": ["secureChannelModule_exports", "__export", "secureChannelModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_secureChannelTypes", "stub", "config", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\n\nimport { secureChannelTypes } from \"./secureChannelTypes\";\n\ntype FactoryProps = {\n stub?: boolean;\n config: DmkConfig;\n};\n\nexport const secureChannelModuleFactory = ({ stub, config }: FactoryProps) =>\n new ContainerModule(({ bind }) => {\n bind(secureChannelTypes.DmkConfig).toConstantValue(config);\n\n bind(secureChannelTypes.SecureChannelDataSource).to(\n DefaultSecureChannelDataSource,\n );\n bind(secureChannelTypes.SecureChannelService).to(\n DefaultSecureChannelService,\n );\n\n if (stub) {\n /* empty */\n }\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAGhCC,EAA+C,wEAC/CC,EAA4C,wEAE5CC,EAAmC,gCAO5B,MAAML,EAA6B,CAAC,CAAE,KAAAM,EAAM,OAAAC,CAAO,IACxD,IAAI,kBAAgB,CAAC,CAAE,KAAAC,CAAK,IAAM,CAChCA,EAAK,qBAAmB,SAAS,EAAE,gBAAgBD,CAAM,EAEzDC,EAAK,qBAAmB,uBAAuB,EAAE,GAC/C,gCACF,EACAA,EAAK,qBAAmB,oBAAoB,EAAE,GAC5C,6BACF,CAKF,CAAC",
6
+ "names": ["secureChannelModule_exports", "__export", "secureChannelModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_secureChannelTypes", "stub", "config", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=require("inversify"),r=require("../../secure-channel/data/DefaultSecureChannelDataSource"),c=require("../../secure-channel/service/DefaultSecureChannelService"),a=require("./secureChannelModule"),t=require("./secureChannelTypes");describe("secureChannelModuleFactory default use case",()=>{const u={webSocketUrl:"http://fake-websocket.url"};let e,o;beforeEach(()=>{o=(0,a.secureChannelModuleFactory)({stub:!1,config:u}),e=new n.Container,e.load(o)}),it("the secure channel module should be defined",()=>{expect(o).toBeDefined()}),it("should return default use cases instead of stub",()=>{const l=e.get(t.secureChannelTypes.DmkConfig);expect(l).toEqual({webSocketUrl:"http://fake-websocket.url"});const s=e.get(t.secureChannelTypes.SecureChannelDataSource);expect(s).toBeInstanceOf(r.DefaultSecureChannelDataSource);const f=e.get(t.secureChannelTypes.SecureChannelService);expect(f).toBeInstanceOf(c.DefaultSecureChannelService)})});
1
+ "use strict";var n=require("inversify"),c=require("../../secure-channel/data/DefaultSecureChannelDataSource"),r=require("../../secure-channel/service/DefaultSecureChannelService"),a=require("./secureChannelModule"),t=require("./secureChannelTypes");describe("secureChannelModuleFactory default use case",()=>{const u={webSocketUrl:"http://fake-websocket.url"};let e,o;beforeEach(()=>{o=(0,a.secureChannelModuleFactory)({stub:!1,config:u}),e=new n.Container,e.loadSync(o)}),it("the secure channel module should be defined",()=>{expect(o).toBeDefined()}),it("should return default use cases instead of stub",()=>{const l=e.get(t.secureChannelTypes.DmkConfig);expect(l).toEqual({webSocketUrl:"http://fake-websocket.url"});const s=e.get(t.secureChannelTypes.SecureChannelDataSource);expect(s).toBeInstanceOf(c.DefaultSecureChannelDataSource);const f=e.get(t.secureChannelTypes.SecureChannelService);expect(f).toBeInstanceOf(r.DefaultSecureChannelService)})});
2
2
  //# sourceMappingURL=secureChannelModule.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/secure-channel/di/secureChannelModule.test.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/index\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\n\nimport { secureChannelModuleFactory } from \"./secureChannelModule\";\nimport { secureChannelTypes } from \"./secureChannelTypes\";\n\ndescribe(\"secureChannelModuleFactory default use case\", () => {\n const mockDmkConfig = {\n webSocketUrl: \"http://fake-websocket.url\",\n } as DmkConfig;\n\n let container: Container;\n let mod: ReturnType<typeof secureChannelModuleFactory>;\n\n beforeEach(() => {\n mod = secureChannelModuleFactory({\n stub: false,\n config: mockDmkConfig,\n });\n container = new Container();\n container.load(mod);\n });\n\n it(\"the secure channel module should be defined\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return default use cases instead of stub\", () => {\n const config = container.get(secureChannelTypes.DmkConfig);\n expect(config).toEqual({\n webSocketUrl: \"http://fake-websocket.url\",\n });\n\n const secureChannelDataSource = container.get(\n secureChannelTypes.SecureChannelDataSource,\n );\n expect(secureChannelDataSource).toBeInstanceOf(\n DefaultSecureChannelDataSource,\n );\n\n const secureChannelService = container.get(\n secureChannelTypes.SecureChannelService,\n );\n expect(secureChannelService).toBeInstanceOf(DefaultSecureChannelService);\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAA0B,qBAG1BC,EAA+C,wEAC/CC,EAA4C,wEAE5CC,EAA2C,iCAC3CC,EAAmC,gCAEnC,SAAS,8CAA+C,IAAM,CAC5D,MAAMC,EAAgB,CACpB,aAAc,2BAChB,EAEA,IAAIC,EACAC,EAEJ,WAAW,IAAM,CACfA,KAAM,8BAA2B,CAC/B,KAAM,GACN,OAAQF,CACV,CAAC,EACDC,EAAY,IAAI,YAChBA,EAAU,KAAKC,CAAG,CACpB,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,kDAAmD,IAAM,CAC1D,MAAMC,EAASF,EAAU,IAAI,qBAAmB,SAAS,EACzD,OAAOE,CAAM,EAAE,QAAQ,CACrB,aAAc,2BAChB,CAAC,EAED,MAAMC,EAA0BH,EAAU,IACxC,qBAAmB,uBACrB,EACA,OAAOG,CAAuB,EAAE,eAC9B,gCACF,EAEA,MAAMC,EAAuBJ,EAAU,IACrC,qBAAmB,oBACrB,EACA,OAAOI,CAAoB,EAAE,eAAe,6BAA2B,CACzE,CAAC,CACH,CAAC",
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/index\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\n\nimport { secureChannelModuleFactory } from \"./secureChannelModule\";\nimport { secureChannelTypes } from \"./secureChannelTypes\";\n\ndescribe(\"secureChannelModuleFactory default use case\", () => {\n const mockDmkConfig = {\n webSocketUrl: \"http://fake-websocket.url\",\n } as DmkConfig;\n\n let container: Container;\n let mod: ReturnType<typeof secureChannelModuleFactory>;\n\n beforeEach(() => {\n mod = secureChannelModuleFactory({\n stub: false,\n config: mockDmkConfig,\n });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"the secure channel module should be defined\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return default use cases instead of stub\", () => {\n const config = container.get(secureChannelTypes.DmkConfig);\n expect(config).toEqual({\n webSocketUrl: \"http://fake-websocket.url\",\n });\n\n const secureChannelDataSource = container.get(\n secureChannelTypes.SecureChannelDataSource,\n );\n expect(secureChannelDataSource).toBeInstanceOf(\n DefaultSecureChannelDataSource,\n );\n\n const secureChannelService = container.get(\n secureChannelTypes.SecureChannelService,\n );\n expect(secureChannelService).toBeInstanceOf(DefaultSecureChannelService);\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA0B,qBAG1BC,EAA+C,wEAC/CC,EAA4C,wEAE5CC,EAA2C,iCAC3CC,EAAmC,gCAEnC,SAAS,8CAA+C,IAAM,CAC5D,MAAMC,EAAgB,CACpB,aAAc,2BAChB,EAEA,IAAIC,EACAC,EAEJ,WAAW,IAAM,CACfA,KAAM,8BAA2B,CAC/B,KAAM,GACN,OAAQF,CACV,CAAC,EACDC,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,kDAAmD,IAAM,CAC1D,MAAMC,EAASF,EAAU,IAAI,qBAAmB,SAAS,EACzD,OAAOE,CAAM,EAAE,QAAQ,CACrB,aAAc,2BAChB,CAAC,EAED,MAAMC,EAA0BH,EAAU,IACxC,qBAAmB,uBACrB,EACA,OAAOG,CAAuB,EAAE,eAC9B,gCACF,EAEA,MAAMC,EAAuBJ,EAAU,IACrC,qBAAmB,oBACrB,EACA,OAAOI,CAAoB,EAAE,eAAe,6BAA2B,CACzE,CAAC,CACH,CAAC",
6
6
  "names": ["import_inversify", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_secureChannelModule", "import_secureChannelTypes", "mockDmkConfig", "container", "mod", "config", "secureChannelDataSource", "secureChannelService"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var E=(o,r)=>{for(var e in r)t(o,e,{get:r[e],enumerable:!0})},s=(o,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of l(r))!a.call(o,n)&&n!==e&&t(o,n,{get:()=>r[n],enumerable:!(i=c(r,n))||i.enumerable});return o};var u=o=>s(t({},"__esModule",{value:!0}),o);var p={};E(p,{SecureChannelError:()=>m,WebSocketConnectionError:()=>k});module.exports=u(p);class k{constructor(r){this.error=r;this.originalError=r}_tag="WebSocketConnectionError";originalError}class m{constructor(r){this.error=r;this.originalError=r}_tag="SecureChannelError";originalError}0&&(module.exports={SecureChannelError,WebSocketConnectionError});
1
+ "use strict";var l=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var p=(n,r)=>{for(var t in r)l(n,t,{get:r[t],enumerable:!0})},d=(n,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of i(r))!E.call(n,s)&&s!==t&&l(n,s,{get:()=>r[s],enumerable:!(a=u(r,s))||a.enumerable});return n};var D=n=>d(l({},"__esModule",{value:!0}),n);var m={};p(m,{SecureChannelError:()=>A,SecureChannelErrorType:()=>c,WebSocketConnectionError:()=>y});module.exports=D(m);var o=require("../../../api/device-action/os/Errors"),c=(e=>(e[e.AppAlreadyInstalled=0]="AppAlreadyInstalled",e[e.DeviceLocked=1]="DeviceLocked",e[e.OutOfMemory=2]="OutOfMemory",e[e.RefusedByUser=3]="RefusedByUser",e[e.Unknown=4]="Unknown",e))(c||{});class y{constructor(r){this.error=r;this.originalError=r}_tag="WebSocketConnectionError";originalError}class A{constructor(r,t=4){this.error=r;this.errorType=t;this.originalError=r}_tag="SecureChannelError";originalError;mapDAErrors(){switch(this.errorType){case 1:return new o.DeviceLockedError;case 3:return new o.RefusedByUserDAError;default:return this}}mapInstallDAErrors(){switch(this.errorType){case 1:return new o.DeviceLockedError;case 3:return new o.RefusedByUserDAError;case 0:return new o.AppAlreadyInstalledDAError;case 2:return new o.OutOfMemoryDAError;default:return this}}}0&&(module.exports={SecureChannelError,SecureChannelErrorType,WebSocketConnectionError});
2
2
  //# sourceMappingURL=Errors.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/secure-channel/model/Errors.ts"],
4
- "sourcesContent": ["import { type DmkError } from \"@api/Error\";\n\nexport class WebSocketConnectionError implements DmkError {\n _tag = \"WebSocketConnectionError\";\n originalError?: unknown;\n\n constructor(public readonly error: unknown) {\n this.originalError = error;\n }\n}\n\nexport class SecureChannelError implements DmkError {\n _tag = \"SecureChannelError\";\n originalError?: unknown;\n\n constructor(public readonly error: unknown) {\n this.originalError = error;\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,EAAA,6BAAAC,IAAA,eAAAC,EAAAJ,GAEO,MAAMG,CAA6C,CAIxD,YAA4BE,EAAgB,CAAhB,WAAAA,EAC1B,KAAK,cAAgBA,CACvB,CALA,KAAO,2BACP,aAKF,CAEO,MAAMH,CAAuC,CAIlD,YAA4BG,EAAgB,CAAhB,WAAAA,EAC1B,KAAK,cAAgBA,CACvB,CALA,KAAO,qBACP,aAKF",
6
- "names": ["Errors_exports", "__export", "SecureChannelError", "WebSocketConnectionError", "__toCommonJS", "error"]
4
+ "sourcesContent": ["import {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n} from \"@api/device-action/os/Errors\";\nimport type { DmkError } from \"@api/Error\";\n\nexport enum SecureChannelErrorType {\n AppAlreadyInstalled,\n DeviceLocked,\n OutOfMemory,\n RefusedByUser,\n Unknown,\n}\n\n/**\n * Errors that can possibly occur during a secure channel operation\n */\nexport type SecureChannelDAErrors =\n | SecureChannelError\n | DeviceLockedError\n | RefusedByUserDAError;\n\n/**\n * Errors that can possibly occur during a secure channel install operation\n * such as installApp or installFirmware\n */\nexport type SecureChannelInstallDAErrors =\n | SecureChannelError\n | AppAlreadyInstalledDAError\n | OutOfMemoryDAError\n | DeviceLockedError\n | RefusedByUserDAError;\n\nexport class WebSocketConnectionError implements DmkError {\n _tag = \"WebSocketConnectionError\";\n originalError?: unknown;\n\n constructor(public readonly error: unknown) {\n this.originalError = error;\n }\n}\n\nexport class SecureChannelError implements DmkError {\n _tag = \"SecureChannelError\";\n originalError?: unknown;\n\n constructor(\n public readonly error: unknown,\n public readonly errorType: SecureChannelErrorType = SecureChannelErrorType.Unknown,\n ) {\n this.originalError = error;\n }\n\n mapDAErrors(): SecureChannelDAErrors {\n switch (this.errorType) {\n case SecureChannelErrorType.DeviceLocked:\n return new DeviceLockedError();\n case SecureChannelErrorType.RefusedByUser:\n return new RefusedByUserDAError();\n default:\n return this;\n }\n }\n\n mapInstallDAErrors(): SecureChannelInstallDAErrors {\n switch (this.errorType) {\n case SecureChannelErrorType.DeviceLocked:\n return new DeviceLockedError();\n case SecureChannelErrorType.RefusedByUser:\n return new RefusedByUserDAError();\n case SecureChannelErrorType.AppAlreadyInstalled:\n return new AppAlreadyInstalledDAError();\n case SecureChannelErrorType.OutOfMemory:\n return new OutOfMemoryDAError();\n default:\n return this;\n }\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,EAAA,2BAAAC,EAAA,6BAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAKO,wCAGKH,OACVA,IAAA,6CACAA,IAAA,+BACAA,IAAA,6BACAA,IAAA,iCACAA,IAAA,qBALUA,OAAA,IA2BL,MAAMC,CAA6C,CAIxD,YAA4BG,EAAgB,CAAhB,WAAAA,EAC1B,KAAK,cAAgBA,CACvB,CALA,KAAO,2BACP,aAKF,CAEO,MAAML,CAAuC,CAIlD,YACkBK,EACAC,EAAoC,EACpD,CAFgB,WAAAD,EACA,eAAAC,EAEhB,KAAK,cAAgBD,CACvB,CARA,KAAO,qBACP,cASA,aAAqC,CACnC,OAAQ,KAAK,UAAW,CACtB,IAAK,GACH,OAAO,IAAI,oBACb,IAAK,GACH,OAAO,IAAI,uBACb,QACE,OAAO,IACX,CACF,CAEA,oBAAmD,CACjD,OAAQ,KAAK,UAAW,CACtB,IAAK,GACH,OAAO,IAAI,oBACb,IAAK,GACH,OAAO,IAAI,uBACb,IAAK,GACH,OAAO,IAAI,6BACb,IAAK,GACH,OAAO,IAAI,qBACb,QACE,OAAO,IACX,CACF,CACF",
6
+ "names": ["Errors_exports", "__export", "SecureChannelError", "SecureChannelErrorType", "WebSocketConnectionError", "__toCommonJS", "import_Errors", "error", "errorType"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var r=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=(e,o)=>{for(var t in o)r(e,t,{get:o[t],enumerable:!0})},y=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of m(o))!c.call(e,n)&&n!==t&&r(e,n,{get:()=>o[n],enumerable:!(s=u(o,n))||s.enumerable});return e};var b=e=>y(r({},"__esModule",{value:!0}),e);var C={};f(C,{sendModuleFactory:()=>A});module.exports=b(C);var d=require("inversify"),i=require("../../send/use-case/SendApduUseCase"),p=require("../../../../src/di.stub"),a=require("./sendTypes");const A=({stub:e=!1})=>new d.ContainerModule((o,t,s,n,_,l,S)=>{o(a.sendTypes.SendApduUseCase).to(i.SendApduUseCase),e&&n(a.sendTypes.SendApduUseCase).to(p.StubUseCase)});0&&(module.exports={sendModuleFactory});
1
+ "use strict";var t=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var y=(o,e)=>{for(var s in e)t(o,s,{get:e[s],enumerable:!0})},C=(o,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of f(e))!i.call(o,r)&&r!==s&&t(o,r,{get:()=>e[r],enumerable:!(a=u(e,r))||a.enumerable});return o};var c=o=>C(t({},"__esModule",{value:!0}),o);var S={};y(S,{sendModuleFactory:()=>l});module.exports=c(S);var d=require("inversify"),n=require("../../send/use-case/SendApduUseCase"),m=require("../../../../src/di.stub"),p=require("./sendTypes");const l=({stub:o=!1})=>new d.ContainerModule(({bind:e,rebindSync:s})=>{e(p.sendTypes.SendApduUseCase).to(n.SendApduUseCase),o&&s(p.sendTypes.SendApduUseCase).to(m.StubUseCase)});0&&(module.exports={sendModuleFactory});
2
2
  //# sourceMappingURL=sendModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/send/di/sendModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { SendApduUseCase } from \"@internal/send/use-case/SendApduUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { sendTypes } from \"./sendTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const sendModuleFactory = ({ stub = false }: FactoryProps) =>\n new ContainerModule(\n (\n bind,\n _unbind,\n _isBound,\n rebind,\n _unbindAsync,\n _onActivation,\n _onDeactivation,\n ) => {\n bind(sendTypes.SendApduUseCase).to(SendApduUseCase);\n if (stub) {\n rebind(sendTypes.SendApduUseCase).to(StubUseCase);\n }\n },\n );\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAgC,mDAChCC,EAA4B,6BAE5BC,EAA0B,uBAMnB,MAAML,EAAoB,CAAC,CAAE,KAAAM,EAAO,EAAM,IAC/C,IAAI,kBACF,CACEC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,IACG,CACHN,EAAK,YAAU,eAAe,EAAE,GAAG,iBAAe,EAC9CD,GACFI,EAAO,YAAU,eAAe,EAAE,GAAG,aAAW,CAEpD,CACF",
6
- "names": ["sendModule_exports", "__export", "sendModuleFactory", "__toCommonJS", "import_inversify", "import_SendApduUseCase", "import_di", "import_sendTypes", "stub", "bind", "_unbind", "_isBound", "rebind", "_unbindAsync", "_onActivation", "_onDeactivation"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { SendApduUseCase } from \"@internal/send/use-case/SendApduUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { sendTypes } from \"./sendTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const sendModuleFactory = ({ stub = false }: FactoryProps) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind(sendTypes.SendApduUseCase).to(SendApduUseCase);\n if (stub) {\n rebindSync(sendTypes.SendApduUseCase).to(StubUseCase);\n }\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAgC,mDAChCC,EAA4B,6BAE5BC,EAA0B,uBAMnB,MAAML,EAAoB,CAAC,CAAE,KAAAM,EAAO,EAAM,IAC/C,IAAI,kBAAgB,CAAC,CAAE,KAAAC,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EAAK,YAAU,eAAe,EAAE,GAAG,iBAAe,EAC9CD,GACFE,EAAW,YAAU,eAAe,EAAE,GAAG,aAAW,CAExD,CAAC",
6
+ "names": ["sendModule_exports", "__export", "sendModuleFactory", "__toCommonJS", "import_inversify", "import_SendApduUseCase", "import_di", "import_sendTypes", "stub", "bind", "rebindSync"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("inversify"),r=require("./sendModule");describe("sendModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=(0,r.sendModuleFactory)({stub:!1}),o=new t.Container,o.load(e)}),it("should return the config module",()=>{expect(e).toBeDefined()})})});
1
+ "use strict";var t=require("inversify"),r=require("./sendModule");describe("sendModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=(0,r.sendModuleFactory)({stub:!1}),o=new t.Container,o.loadSync(e)}),it("should return the config module",()=>{expect(e).toBeDefined()})})});
2
2
  //# sourceMappingURL=sendModule.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/send/di/sendModule.test.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { sendModuleFactory } from \"./sendModule\";\n\ndescribe(\"sendModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof sendModuleFactory>;\n beforeEach(() => {\n mod = sendModuleFactory({ stub: false });\n container = new Container();\n container.load(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAAkC,wBAElC,SAAS,oBAAqB,IAAM,CAClC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,qBAAkB,CAAE,KAAM,EAAM,CAAC,EACvCD,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 { sendModuleFactory } from \"./sendModule\";\n\ndescribe(\"sendModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof sendModuleFactory>;\n beforeEach(() => {\n mod = sendModuleFactory({ stub: false });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAAkC,wBAElC,SAAS,oBAAqB,IAAM,CAClC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,qBAAkB,CAAE,KAAM,EAAM,CAAC,EACvCD,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_sendModule", "container", "mod"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var S=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var y=(s,e)=>{for(var r in e)S(s,r,{get:e[r],enumerable:!0})},f=(s,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of h(e))!u.call(s,i)&&i!==r&&S(s,i,{get:()=>e[i],enumerable:!(o=a(e,i))||o.enumerable});return s};var D=s=>f(S({},"__esModule",{value:!0}),s),d=(s,e,r,o)=>{for(var i=o>1?void 0:o?a(e,r):e,t=s.length-1,g;t>=0;t--)(g=s[t])&&(i=(o?g(e,r,i):g(i))||i);return o&&i&&S(e,r,i),i},p=(s,e)=>(r,o)=>e(r,o,s);var b={};y(b,{SendApduUseCase:()=>n});module.exports=D(b);var c=require("inversify"),m=require("../../device-session/di/deviceSessionTypes"),l=require("../../logger-publisher/di/loggerTypes");let n=class{_sessionService;_logger;constructor(e,r){this._sessionService=e,this._logger=r("SendApduUseCase")}async execute({sessionId:e,apdu:r,abortTimeout:o}){return this._sessionService.getDeviceSessionById(e).caseOf({Right:async t=>(await t.sendApdu(r,{abortTimeout:o})).caseOf({Right:v=>v,Left:v=>{throw this._logger.error("Error sending APDU",{data:{sessionId:e,apdu:r,error:v}}),v}}),Left:t=>{throw this._logger.error("Error getting deviceSession",{data:{error:t}}),t}})}};n=d([(0,c.injectable)(),p(0,(0,c.inject)(m.deviceSessionTypes.DeviceSessionService)),p(1,(0,c.inject)(l.loggerTypes.LoggerPublisherServiceFactory))],n);0&&(module.exports={SendApduUseCase});
1
+ "use strict";var S=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var y=(s,e)=>{for(var r in e)S(s,r,{get:e[r],enumerable:!0})},f=(s,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of h(e))!u.call(s,i)&&i!==r&&S(s,i,{get:()=>e[i],enumerable:!(o=a(e,i))||o.enumerable});return s};var D=s=>f(S({},"__esModule",{value:!0}),s),d=(s,e,r,o)=>{for(var i=o>1?void 0:o?a(e,r):e,g=s.length-1,t;g>=0;g--)(t=s[g])&&(i=(o?t(e,r,i):t(i))||i);return o&&i&&S(e,r,i),i},p=(s,e)=>(r,o)=>e(r,o,s);var b={};y(b,{SendApduUseCase:()=>n});module.exports=D(b);var c=require("inversify"),m=require("../../device-session/di/deviceSessionTypes"),l=require("../../logger-publisher/di/loggerTypes");let n=class{_sessionService;_logger;constructor(e,r){this._sessionService=e,this._logger=r("SendApduUseCase")}async execute({sessionId:e,apdu:r,abortTimeout:o,triggersDisconnection:i}){return this._sessionService.getDeviceSessionById(e).caseOf({Right:async t=>(await t.sendApdu(r,{abortTimeout:o,triggersDisconnection:i})).caseOf({Right:v=>v,Left:v=>{throw this._logger.error("Error sending APDU",{data:{sessionId:e,apdu:r,error:v}}),v}}),Left:t=>{throw this._logger.error("Error getting deviceSession",{data:{error:t}}),t}})}};n=d([(0,c.injectable)(),p(0,(0,c.inject)(m.deviceSessionTypes.DeviceSessionService)),p(1,(0,c.inject)(l.loggerTypes.LoggerPublisherServiceFactory))],n);0&&(module.exports={SendApduUseCase});
2
2
  //# sourceMappingURL=SendApduUseCase.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/send/use-case/SendApduUseCase.ts"],
4
- "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DeviceSessionId } from \"@api/types\";\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\n\n/**\n * The arguments for the SendApduUseCase.\n */\nexport type SendApduUseCaseArgs = {\n /**\n * Device session identifier from `DeviceManagementKit.connect`.\n */\n sessionId: DeviceSessionId;\n /**\n * Raw APDU to send to the device.\n */\n apdu: Uint8Array;\n /**\n * The time, in milliseconds, to wait before aborting an operation.\n */\n abortTimeout?: number;\n};\n\n/**\n * Sends an APDU to a connected device.\n */\n@injectable()\nexport class SendApduUseCase {\n private readonly _sessionService: DeviceSessionService;\n private readonly _logger: LoggerPublisherService;\n\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._sessionService = sessionService;\n this._logger = loggerFactory(\"SendApduUseCase\");\n }\n\n async execute({\n sessionId,\n apdu,\n abortTimeout,\n }: SendApduUseCaseArgs): Promise<ApduResponse> {\n const deviceSessionOrError =\n this._sessionService.getDeviceSessionById(sessionId);\n\n return deviceSessionOrError.caseOf({\n // Case device session found\n Right: async (deviceSession) => {\n const response = await deviceSession.sendApdu(apdu, { abortTimeout });\n return response.caseOf({\n // Case APDU sent and response received successfully\n Right: (data) => data,\n // Case error sending or receiving APDU\n Left: (error) => {\n this._logger.error(\"Error sending APDU\", {\n data: { sessionId, apdu, error },\n });\n throw error;\n },\n });\n },\n // Case device session not found\n Left: (error) => {\n this._logger.error(\"Error getting deviceSession\", {\n data: { error },\n });\n throw error;\n },\n });\n }\n}\n"],
5
- "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAAmC,0DAEnCC,EAA4B,qDAwBrB,IAAMC,EAAN,KAAsB,CACV,gBACA,QAEjB,YAEEC,EAEAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,QAAUC,EAAc,iBAAiB,CAChD,CAEA,MAAM,QAAQ,CACZ,UAAAC,EACA,KAAAC,EACA,aAAAC,CACF,EAA+C,CAI7C,OAFE,KAAK,gBAAgB,qBAAqBF,CAAS,EAEzB,OAAO,CAEjC,MAAO,MAAOG,IACK,MAAMA,EAAc,SAASF,EAAM,CAAE,aAAAC,CAAa,CAAC,GACpD,OAAO,CAErB,MAAQE,GAASA,EAEjB,KAAOC,GAAU,CACf,WAAK,QAAQ,MAAM,qBAAsB,CACvC,KAAM,CAAE,UAAAL,EAAW,KAAAC,EAAM,MAAAI,CAAM,CACjC,CAAC,EACKA,CACR,CACF,CAAC,EAGH,KAAOA,GAAU,CACf,WAAK,QAAQ,MAAM,8BAA+B,CAChD,KAAM,CAAE,MAAAA,CAAM,CAChB,CAAC,EACKA,CACR,CACF,CAAC,CACH,CACF,EA/CaR,EAANS,EAAA,IADN,cAAW,EAMPC,EAAA,eAAO,qBAAmB,oBAAoB,GAE9CA,EAAA,eAAO,cAAY,6BAA6B,IAPxCV",
6
- "names": ["SendApduUseCase_exports", "__export", "SendApduUseCase", "__toCommonJS", "import_inversify", "import_deviceSessionTypes", "import_loggerTypes", "SendApduUseCase", "sessionService", "loggerFactory", "sessionId", "apdu", "abortTimeout", "deviceSession", "data", "error", "__decorateClass", "__decorateParam"]
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DeviceSessionId } from \"@api/types\";\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\n\n/**\n * The arguments for the SendApduUseCase.\n */\nexport type SendApduUseCaseArgs = {\n /**\n * Device session identifier from `DeviceManagementKit.connect`.\n */\n sessionId: DeviceSessionId;\n /**\n * Raw APDU to send to the device.\n */\n apdu: Uint8Array;\n /**\n * The time, in milliseconds, to wait before aborting an operation.\n */\n abortTimeout?: number;\n /**\n * Indicates if a device disconnection should be expected after sending the APDU.\n */\n triggersDisconnection?: boolean;\n};\n\n/**\n * Sends an APDU to a connected device.\n */\n@injectable()\nexport class SendApduUseCase {\n private readonly _sessionService: DeviceSessionService;\n private readonly _logger: LoggerPublisherService;\n\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._sessionService = sessionService;\n this._logger = loggerFactory(\"SendApduUseCase\");\n }\n\n async execute({\n sessionId,\n apdu,\n abortTimeout,\n triggersDisconnection,\n }: SendApduUseCaseArgs): Promise<ApduResponse> {\n const deviceSessionOrError =\n this._sessionService.getDeviceSessionById(sessionId);\n\n return deviceSessionOrError.caseOf({\n // Case device session found\n Right: async (deviceSession) => {\n const response = await deviceSession.sendApdu(apdu, {\n abortTimeout,\n triggersDisconnection,\n });\n return response.caseOf({\n // Case APDU sent and response received successfully\n Right: (data) => data,\n // Case error sending or receiving APDU\n Left: (error) => {\n this._logger.error(\"Error sending APDU\", {\n data: { sessionId, apdu, error },\n });\n throw error;\n },\n });\n },\n // Case device session not found\n Left: (error) => {\n this._logger.error(\"Error getting deviceSession\", {\n data: { error },\n });\n throw error;\n },\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAAmC,0DAEnCC,EAA4B,qDA4BrB,IAAMC,EAAN,KAAsB,CACV,gBACA,QAEjB,YAEEC,EAEAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,QAAUC,EAAc,iBAAiB,CAChD,CAEA,MAAM,QAAQ,CACZ,UAAAC,EACA,KAAAC,EACA,aAAAC,EACA,sBAAAC,CACF,EAA+C,CAI7C,OAFE,KAAK,gBAAgB,qBAAqBH,CAAS,EAEzB,OAAO,CAEjC,MAAO,MAAOI,IACK,MAAMA,EAAc,SAASH,EAAM,CAClD,aAAAC,EACA,sBAAAC,CACF,CAAC,GACe,OAAO,CAErB,MAAQE,GAASA,EAEjB,KAAOC,GAAU,CACf,WAAK,QAAQ,MAAM,qBAAsB,CACvC,KAAM,CAAE,UAAAN,EAAW,KAAAC,EAAM,MAAAK,CAAM,CACjC,CAAC,EACKA,CACR,CACF,CAAC,EAGH,KAAOA,GAAU,CACf,WAAK,QAAQ,MAAM,8BAA+B,CAChD,KAAM,CAAE,MAAAA,CAAM,CAChB,CAAC,EACKA,CACR,CACF,CAAC,CACH,CACF,EAnDaT,EAANU,EAAA,IADN,cAAW,EAMPC,EAAA,eAAO,qBAAmB,oBAAoB,GAE9CA,EAAA,eAAO,cAAY,6BAA6B,IAPxCX",
6
+ "names": ["SendApduUseCase_exports", "__export", "SendApduUseCase", "__toCommonJS", "import_inversify", "import_deviceSessionTypes", "import_loggerTypes", "SendApduUseCase", "sessionService", "loggerFactory", "sessionId", "apdu", "abortTimeout", "triggersDisconnection", "deviceSession", "data", "error", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var e=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(r,o)=>{for(var t in o)e(r,t,{get:o[t],enumerable:!0})},u=(r,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of f(o))!c.call(r,a)&&a!==t&&e(r,a,{get:()=>o[a],enumerable:!(n=m(o,a))||n.enumerable});return r};var y=r=>u(e({},"__esModule",{value:!0}),r);var T={};l(T,{transportModuleFactory:()=>C});module.exports=y(T);var s=require("inversify"),i=require("../../transport/service/DefaultTransportService"),p=require("./transportDiTypes");const C=({stub:r=!1,transports:o=[],config:t}={})=>new s.ContainerModule((n,a,g,D)=>{n(p.transportDiTypes.TransportsInput).toConstantValue(o),n(p.transportDiTypes.TransportService).to(i.DefaultTransportService).inSingletonScope(),n(p.transportDiTypes.DmkConfig).toConstantValue(t)});0&&(module.exports={transportModuleFactory});
1
+ "use strict";var e=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,o)=>{for(var r in o)e(t,r,{get:o[r],enumerable:!0})},y=(t,o,r,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of f(o))!c.call(t,n)&&n!==r&&e(t,n,{get:()=>o[n],enumerable:!(a=m(o,n))||a.enumerable});return t};var u=t=>y(e({},"__esModule",{value:!0}),t);var T={};l(T,{transportModuleFactory:()=>C});module.exports=u(T);var s=require("inversify"),i=require("../../transport/service/DefaultTransportService"),p=require("./transportDiTypes");const C=({stub:t=!1,transports:o=[],config:r}={})=>new s.ContainerModule(({bind:a})=>{a(p.transportDiTypes.TransportsInput).toConstantValue(o),a(p.transportDiTypes.TransportService).to(i.DefaultTransportService).inSingletonScope(),a(p.transportDiTypes.DmkConfig).toConstantValue(r)});0&&(module.exports={transportModuleFactory});
2
2
  //# sourceMappingURL=transportModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/transport/di/transportModule.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type TransportFactory } from \"@api/transport/model/Transport\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\n\nimport { transportDiTypes } from \"./transportDiTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n transports: TransportFactory[];\n config: DmkConfig;\n};\n\nexport const transportModuleFactory = ({\n stub = false,\n transports = [],\n config,\n}: Partial<FactoryProps> = {}) =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(transportDiTypes.TransportsInput).toConstantValue(transports);\n bind(transportDiTypes.TransportService)\n .to(DefaultTransportService)\n .inSingletonScope();\n\n bind(transportDiTypes.DmkConfig).toConstantValue(config);\n\n if (stub) {\n // TODO: Implement stub\n }\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAIhCC,EAAwC,+DAExCC,EAAiC,8BAQ1B,MAAMJ,EAAyB,CAAC,CACrC,KAAAK,EAAO,GACP,WAAAC,EAAa,CAAC,EACd,OAAAC,CACF,EAA2B,CAAC,IAC1B,IAAI,kBAAgB,CAACC,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,mBAAiB,eAAe,EAAE,gBAAgBF,CAAU,EACjEE,EAAK,mBAAiB,gBAAgB,EACnC,GAAG,yBAAuB,EAC1B,iBAAiB,EAEpBA,EAAK,mBAAiB,SAAS,EAAE,gBAAgBD,CAAM,CAKzD,CAAC",
6
- "names": ["transportModule_exports", "__export", "transportModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultTransportService", "import_transportDiTypes", "stub", "transports", "config", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type TransportFactory } from \"@api/transport/model/Transport\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\n\nimport { transportDiTypes } from \"./transportDiTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n transports: TransportFactory[];\n config: DmkConfig;\n};\n\nexport const transportModuleFactory = ({\n stub = false,\n transports = [],\n config,\n}: Partial<FactoryProps> = {}) =>\n new ContainerModule(({ bind }) => {\n bind(transportDiTypes.TransportsInput).toConstantValue(transports);\n bind(transportDiTypes.TransportService)\n .to(DefaultTransportService)\n .inSingletonScope();\n\n bind(transportDiTypes.DmkConfig).toConstantValue(config);\n\n if (stub) {\n // TODO: Implement stub\n }\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAIhCC,EAAwC,+DAExCC,EAAiC,8BAQ1B,MAAMJ,EAAyB,CAAC,CACrC,KAAAK,EAAO,GACP,WAAAC,EAAa,CAAC,EACd,OAAAC,CACF,EAA2B,CAAC,IAC1B,IAAI,kBAAgB,CAAC,CAAE,KAAAC,CAAK,IAAM,CAChCA,EAAK,mBAAiB,eAAe,EAAE,gBAAgBF,CAAU,EACjEE,EAAK,mBAAiB,gBAAgB,EACnC,GAAG,yBAAuB,EAC1B,iBAAiB,EAEpBA,EAAK,mBAAiB,SAAS,EAAE,gBAAgBD,CAAM,CAKzD,CAAC",
6
+ "names": ["transportModule_exports", "__export", "transportModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultTransportService", "import_transportDiTypes", "stub", "transports", "config", "bind"]
7
7
  }