@ledgerhq/device-management-kit 0.0.0-develop-20250106155719 → 0.0.0-rn-hid-20250221112139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -31
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/package.json +12 -8
- package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.js.map +2 -2
- package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.test.js.map +2 -2
- package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
- package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
- package/lib/cjs/src/api/DmkConfig.js +1 -1
- package/lib/cjs/src/api/DmkConfig.js.map +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js.map +2 -2
- package/lib/cjs/src/api/command/model/CommandResult.js.map +1 -1
- package/lib/cjs/src/api/command/os/LoadCertificateCommand.js +2 -0
- package/lib/cjs/src/api/command/os/LoadCertificateCommand.js.map +7 -0
- package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js +2 -0
- package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js.map +7 -0
- package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
- package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
- package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.js.map +3 -3
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +2 -2
- package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +2 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +2 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
- package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
- package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +1 -1
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +3 -3
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +3 -3
- package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
- package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +2 -2
- package/lib/cjs/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js.map +2 -2
- package/lib/cjs/src/api/transport/model/DeviceApduSender.js +2 -0
- package/lib/cjs/src/api/transport/model/DeviceApduSender.js.map +7 -0
- package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js.map +2 -2
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
- package/lib/cjs/src/api/transport/model/DiscoveredDevice.js +1 -1
- package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
- package/lib/cjs/src/api/transport/model/Errors.js +1 -1
- package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
- package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js +1 -1
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js.map +2 -2
- package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js +1 -1
- package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js.map +1 -1
- package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js +1 -1
- package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
- package/lib/cjs/src/api/types.js.map +1 -1
- package/lib/cjs/src/api/utils/Base64String.test.js +1 -1
- package/lib/cjs/src/api/utils/Base64String.test.js.map +2 -2
- package/lib/cjs/src/api/utils/HexaString.js +1 -1
- package/lib/cjs/src/api/utils/HexaString.js.map +2 -2
- package/lib/cjs/src/api/utils/HexaString.test.js +1 -1
- package/lib/cjs/src/api/utils/HexaString.test.js.map +2 -2
- package/lib/cjs/src/di.js +1 -1
- package/lib/cjs/src/di.js.map +3 -3
- package/lib/cjs/src/di.stub.js +1 -1
- package/lib/cjs/src/di.stub.js.map +2 -2
- package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js +1 -1
- package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js.map +3 -3
- package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js +1 -1
- package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js.map +2 -2
- package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js +1 -1
- package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +2 -2
- package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +1 -1
- package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +2 -2
- package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js +1 -1
- package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js.map +2 -2
- package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js +1 -1
- package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.test.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
- package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
- package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/di/discoveryTypes.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryTypes.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
- package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +2 -2
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +2 -2
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
- package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +2 -0
- package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +2 -0
- package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/data/SecureChannelDataSource.js +2 -0
- package/lib/cjs/src/internal/secure-channel/data/SecureChannelDataSource.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js +2 -0
- package/lib/cjs/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +2 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +2 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelTypes.js +2 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelTypes.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/model/Const.js +2 -0
- package/lib/cjs/src/internal/secure-channel/model/Const.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/model/Errors.js +2 -0
- package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/model/Params.js +2 -0
- package/lib/cjs/src/internal/secure-channel/model/Params.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +2 -0
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +2 -0
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +2 -0
- package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +7 -0
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js +1 -1
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js.map +2 -2
- package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
- package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
- package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
- package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
- package/lib/esm/package.json +12 -8
- package/lib/esm/src/api/DeviceManagementKit.js +1 -1
- package/lib/esm/src/api/DeviceManagementKit.js.map +2 -2
- package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
- package/lib/esm/src/api/DeviceManagementKit.test.js.map +2 -2
- package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
- package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
- package/lib/esm/src/api/DeviceManagementKitBuilder.test.js +1 -1
- package/lib/esm/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js.map +2 -2
- package/lib/esm/src/api/command/model/CommandResult.js.map +1 -1
- package/lib/esm/src/api/command/os/LoadCertificateCommand.js +2 -0
- package/lib/esm/src/api/command/os/LoadCertificateCommand.js.map +7 -0
- package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js +2 -0
- package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js.map +7 -0
- package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
- package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
- package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
- package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
- package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +3 -3
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +2 -2
- package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +3 -3
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +2 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +7 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +2 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +7 -0
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +1 -1
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +3 -3
- package/lib/esm/src/api/index.js +1 -1
- package/lib/esm/src/api/index.js.map +3 -3
- package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
- package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +2 -2
- package/lib/esm/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js.map +2 -2
- package/lib/esm/src/api/transport/model/DeviceApduSender.js +1 -0
- package/lib/esm/src/api/transport/model/DeviceApduSender.js.map +7 -0
- package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js +1 -1
- package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js.map +2 -2
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
- package/lib/esm/src/api/transport/model/Errors.js +1 -1
- package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js +1 -1
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js.map +2 -2
- package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js +1 -1
- package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
- package/lib/esm/src/api/utils/Base64String.test.js +1 -1
- package/lib/esm/src/api/utils/Base64String.test.js.map +2 -2
- package/lib/esm/src/api/utils/HexaString.js +1 -1
- package/lib/esm/src/api/utils/HexaString.js.map +2 -2
- package/lib/esm/src/api/utils/HexaString.test.js +1 -1
- package/lib/esm/src/api/utils/HexaString.test.js.map +2 -2
- package/lib/esm/src/di.js +1 -1
- package/lib/esm/src/di.js.map +3 -3
- package/lib/esm/src/di.stub.js +1 -1
- package/lib/esm/src/di.stub.js.map +2 -2
- package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js +1 -1
- package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js.map +3 -3
- package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js +1 -1
- package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js.map +2 -2
- package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js +1 -1
- package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +2 -2
- package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +1 -1
- package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +2 -2
- package/lib/esm/src/internal/config/service/DefaultConfigService.test.js +1 -1
- package/lib/esm/src/internal/config/service/DefaultConfigService.test.js.map +2 -2
- package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js +1 -1
- package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSession.stub.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.test.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
- package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
- package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/di/discoveryTypes.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryTypes.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
- package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +2 -2
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js +1 -1
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +2 -2
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +2 -2
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
- package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
- package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
- package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
- package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +2 -2
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
- package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +2 -0
- package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +2 -0
- package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/data/SecureChannelDataSource.js +1 -0
- package/lib/esm/src/internal/secure-channel/data/SecureChannelDataSource.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js +2 -0
- package/lib/esm/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +2 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +2 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelTypes.js +2 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelTypes.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/model/Const.js +2 -0
- package/lib/esm/src/internal/secure-channel/model/Const.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/model/Errors.js +2 -0
- package/lib/esm/src/internal/secure-channel/model/Errors.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/model/Params.js +1 -0
- package/lib/esm/src/internal/secure-channel/model/Params.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js +2 -0
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +2 -0
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/service/SecureChannelService.js +1 -0
- package/lib/esm/src/internal/secure-channel/service/SecureChannelService.js.map +7 -0
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
- package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
- package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js +1 -1
- package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js.map +2 -2
- package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
- package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
- package/lib/types/src/api/DeviceManagementKit.d.ts +1 -1
- package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
- package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
- package/lib/types/src/api/DmkConfig.d.ts +1 -0
- package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
- package/lib/types/src/api/command/model/CommandResult.d.ts +1 -2
- package/lib/types/src/api/command/model/CommandResult.d.ts.map +1 -1
- package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts +25 -0
- package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts.map +1 -0
- package/lib/types/src/api/command/os/LoadCertificateCommand.test.d.ts +2 -0
- package/lib/types/src/api/command/os/LoadCertificateCommand.test.d.ts.map +1 -0
- package/lib/types/src/api/command/utils/CommandUtils.d.ts +1 -0
- package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
- package/lib/types/src/api/device-action/DeviceAction.d.ts +6 -1
- package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts +2 -1
- package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts +5 -2
- package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts +40 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +19 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +1 -0
- package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -0
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
- package/lib/types/src/api/device-session/DeviceSessionState.d.ts +5 -0
- package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
- package/lib/types/src/api/index.d.ts +3 -0
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.d.ts +1 -1
- package/lib/types/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceApduSender.d.ts +17 -0
- package/lib/types/src/api/transport/model/DeviceApduSender.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
- package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +60 -0
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +2 -0
- package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Errors.d.ts +41 -26
- package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Transport.d.ts +1 -1
- package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts +2 -0
- package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts +7 -7
- package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts.map +1 -1
- package/lib/types/src/api/types.d.ts +3 -2
- package/lib/types/src/api/types.d.ts.map +1 -1
- package/lib/types/src/api/utils/HexaString.d.ts +1 -1
- package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
- package/lib/types/src/di.d.ts.map +1 -1
- package/lib/types/src/di.stub.d.ts +1 -1
- package/lib/types/src/di.stub.d.ts.map +1 -1
- package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts +1 -1
- package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts +3 -3
- package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +10 -5
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts +2 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +3 -1
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts +1 -1
- package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts +3 -1
- package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/{ListenToKnownDevicesUseCase.d.ts → ListenToAvailableDevicesUseCase.d.ts} +2 -2
- package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -0
- package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts +2 -0
- package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts.map +1 -0
- package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts +5 -5
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +4 -3
- package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +24 -0
- package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +3 -3
- package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Firmware.d.ts +4 -0
- package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
- package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts +18 -0
- package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.d.ts +2 -0
- package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts +52 -0
- package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.d.ts +10 -0
- package/lib/types/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts +9 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.test.d.ts +2 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.test.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelTypes.d.ts +6 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelTypes.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/model/Const.d.ts +2 -0
- package/lib/types/src/internal/secure-channel/model/Const.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/model/Errors.d.ts +8 -0
- package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/model/Params.d.ts +86 -0
- package/lib/types/src/internal/secure-channel/model/Params.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +21 -0
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.test.d.ts +2 -0
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.test.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +21 -0
- package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -0
- package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +2 -0
- package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
- package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -1
- package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
- package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +7 -6
- package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +13 -9
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
- package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts.map +0 -1
- package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts +0 -2
- package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts.map +0 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/service/DefaultApduReceiverService.test.ts"],
|
4
|
-
"sourcesContent": ["jest.mock(\"uuid\");\n\nimport { Just, Left, type Maybe, Nothing, Right } from \"purify-ts\";\n\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nimport { ReceiverApduError } from \"@internal/device-session/model/Errors\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { DefaultApduReceiverService } from \"./DefaultApduReceiverService\";\n\nconst loggerService = new DefaultLoggerPublisherService([], \"frame\");\n\nconst RESPONSE_GET_VERSION = new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x00, 0x00, 0x21, 0x33, 0x00, 0x00, 0x04, 0x05, 0x32,\n 0x2e, 0x32, 0x2e, 0x33, 0x04, 0xe6, 0x00, 0x00, 0x00, 0x04, 0x32, 0x2e, 0x33,\n 0x30, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x90,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n]);\n\nconst RESPONSE_LOCKED_DEVICE = new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x00, 0x00, 0x02, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n]);\n\nconst RESPONSE_LIST_APPS = [\n new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x00, 0x00, 0x9e, 0x01, 0x4d, 0x00, 0x13, 0xca,\n 0x50, 0xfa, 0xa1, 0x91, 0x40, 0x9a, 0x6b, 0xfa, 0x6c, 0x0f, 0xbb, 0xb2,\n 0xe7, 0xc4, 0xa9, 0xcf, 0xe5, 0x57, 0x41, 0x00, 0x5d, 0xbd, 0x84, 0xab,\n 0x9a, 0xbd, 0x66, 0xc7, 0x6c, 0x90, 0xdd, 0x08, 0x79, 0x0d, 0x08, 0x47,\n 0xb9, 0x3a, 0x8f, 0xa7, 0x6f, 0x60, 0x33, 0xae, 0xd3, 0x25, 0xd7, 0xb1,\n 0xe5, 0x7c, 0xeb, 0xd7,\n ]),\n new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x01, 0x4b, 0x2e, 0x2c, 0x9f, 0xb4, 0x46, 0x78,\n 0xde, 0x05, 0x5f, 0x9e, 0x80, 0x0a, 0x07, 0x42, 0x69, 0x74, 0x63, 0x6f,\n 0x69, 0x6e, 0x4e, 0x00, 0x15, 0xca, 0x40, 0x06, 0x03, 0x28, 0xf8, 0x8f,\n 0xc6, 0xd6, 0x42, 0x98, 0xd0, 0x49, 0x00, 0xc7, 0x04, 0x98, 0x19, 0x1b,\n 0x6c, 0xeb, 0xed, 0xd8, 0xcb, 0x84, 0x5d, 0xf5, 0x4b, 0xe3, 0xbd, 0xbb,\n 0x25, 0x7a, 0x3f, 0x6f,\n ]),\n new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x02, 0x68, 0x8f, 0x54, 0xef, 0x7f, 0xaa, 0xc4,\n 0x22, 0xaa, 0x54, 0xe7, 0xb8, 0x0a, 0xc8, 0xa3, 0x2f, 0x96, 0xe5, 0x5e,\n 0x43, 0x2d, 0xf3, 0xa3, 0x45, 0x8d, 0x8e, 0xaa, 0xf1, 0x4e, 0xd1, 0x1e,\n 0x08, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x90, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00,\n ]),\n];\n\ndescribe(\"DefaultApduReceiverService\", () => {\n let service: ApduReceiverService;\n\n beforeAll(() => {\n jest.mock(\"uuid\", () => ({\n v4: jest.fn().mockReturnValue(\"42\"),\n }));\n });\n\n describe(\"without dataSize\", () => {\n beforeEach(() => {\n service = new DefaultApduReceiverService(\n { channel: Just(new Uint8Array([0xaa, 0xaa])) },\n () => loggerService,\n );\n });\n\n it(\"should return a left error when the first frame has no dataSize\", () => {\n //given\n const frame = RESPONSE_LIST_APPS[1]!;\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(Left(new ReceiverApduError()));\n });\n });\n\n describe(\"[USB] With padding and channel\", () => {\n beforeEach(() => {\n service = new DefaultApduReceiverService(\n { channel: Just(new Uint8Array([0xaa, 0xaa])) },\n () => loggerService,\n );\n });\n\n it(\"should return a response directly when a frame is complete\", () => {\n // given\n const frame = RESPONSE_GET_VERSION;\n\n // when\n const apdu = service.handleFrame(frame);\n\n // then\n expect(apdu).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: RESPONSE_GET_VERSION.slice(7, 38),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ),\n );\n });\n\n it(\"should return a response on a third frame when the two first are not complete\", () => {\n //given\n const apdus = [...RESPONSE_LIST_APPS];\n\n //when\n let response: Maybe<ApduResponse> = Nothing;\n const responses: Maybe<ApduResponse>[] = [];\n while (response.isNothing()) {\n const apdu = apdus.shift()!;\n const either = service.handleFrame(apdu);\n\n either.map((value) => {\n response = value;\n responses.push(response);\n });\n }\n\n //then\n expect(responses).toEqual([\n Nothing,\n Nothing,\n Just(\n new ApduResponse({\n data: new Uint8Array([\n ...Array.from(RESPONSE_LIST_APPS[0]!.slice(7)),\n ...Array.from(RESPONSE_LIST_APPS[1]!.slice(5)),\n ...Array.from(RESPONSE_LIST_APPS[2]!).slice(5, 45),\n ]),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ]);\n });\n\n it(\"should return two response directly when each frame is complete\", () => {\n // given\n const firstFrame = RESPONSE_LOCKED_DEVICE;\n const secondFrame = RESPONSE_GET_VERSION;\n\n // when\n const firstResponse = service.handleFrame(firstFrame);\n const secondResponse = service.handleFrame(secondFrame);\n\n // then\n expect(firstResponse).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: new Uint8Array([]),\n statusCode: new Uint8Array([0x55, 0x15]),\n }),\n ),\n ),\n );\n expect(secondResponse).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: RESPONSE_GET_VERSION.slice(7, 38),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ),\n );\n });\n\n it(\"should return an error if the frame is without index\", () => {\n //given\n //frame with channelId, headTag, and partial Index only\n const frame = RESPONSE_LIST_APPS[0]!.slice(0, 4);\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(\n Left(new ReceiverApduError(\"Unable to parse header from apdu\")),\n );\n });\n\n it(\"should return an error if the frame is without datasize\", () => {\n //given\n //frame with channelId, headTag, and Index and partial dataSize only\n const frame = RESPONSE_LIST_APPS[0]!.slice(0, 6);\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(\n Left(new ReceiverApduError(\"Unable to parse header from apdu\")),\n );\n });\n });\n\n describe(\"[BLE] Without padding nor channel\", () => {\n beforeEach(() => {\n service = new DefaultApduReceiverService({}, () => loggerService);\n });\n\n it(\"should return a response directly when a frame is complete\", () => {\n // given\n const frame = RESPONSE_GET_VERSION.slice(2, 40);\n\n // when\n const apdu = service.handleFrame(frame);\n\n // then\n expect(apdu).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: RESPONSE_GET_VERSION.slice(7, 38),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ),\n );\n });\n\n it(\"should return a response on a third frame when the two first are not complete\", () => {\n //given\n const apdus = [\n RESPONSE_LIST_APPS[0]!.slice(2),\n RESPONSE_LIST_APPS[1]!.slice(2),\n RESPONSE_LIST_APPS[2]!.slice(2, 47),\n ];\n\n //when\n let response: Maybe<ApduResponse> = Nothing;\n const responses: Maybe<ApduResponse>[] = [];\n while (response.isNothing()) {\n const apdu = apdus.shift()!;\n const either = service.handleFrame(apdu);\n\n either.map((value) => {\n response = value;\n responses.push(response);\n });\n }\n\n //then\n expect(responses).toEqual([\n Nothing,\n Nothing,\n Just(\n new ApduResponse({\n data: new Uint8Array([\n ...Array.from(RESPONSE_LIST_APPS[0]!.slice(7)),\n ...Array.from(RESPONSE_LIST_APPS[1]!.slice(5)),\n ...Array.from(RESPONSE_LIST_APPS[2]!).slice(5, 45),\n ]),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ]);\n });\n\n it(\"should return two response directly when each frame is complete\", () => {\n // given\n const firstFrame = RESPONSE_LOCKED_DEVICE.slice(2, 9);\n const secondFrame = RESPONSE_GET_VERSION.slice(2, 40);\n\n // when\n const firstResponse = service.handleFrame(firstFrame);\n const secondResponse = service.handleFrame(secondFrame);\n\n // then\n expect(firstResponse).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: new Uint8Array([]),\n statusCode: new Uint8Array([0x55, 0x15]),\n }),\n ),\n ),\n );\n expect(secondResponse).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: RESPONSE_GET_VERSION.slice(7, 38),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ),\n );\n });\n\n it(\"should return an error if the frame is without index\", () => {\n //given\n //frame with channelId, headTag, and partial Index only\n const frame = RESPONSE_LIST_APPS[0]!.slice(2, 4);\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(\n Left(new ReceiverApduError(\"Unable to parse header from apdu\")),\n );\n });\n\n it(\"should return an error if the frame is without datasize\", () => {\n //given\n //frame with channelId, headTag, and Index and partial dataSize only\n const frame = RESPONSE_LIST_APPS[0]!.slice(2, 6);\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(\n Left(new ReceiverApduError(\"Unable to parse header from apdu\")),\n );\n });\n });\n});\n"],
|
5
|
-
"mappings": "AAEA,OAAS,QAAAA,EAAM,QAAAC,EAAkB,WAAAC,EAAS,SAAAC,MAAa,YAEvD,OAAS,gBAAAC,MAAoB,mCAE7B,OAAS,qBAAAC,MAAyB,wCAClC,OAAS,iCAAAC,MAAqC,mEAE9C,OAAS,8BAAAC,MAAkC,+BAT3C,
|
4
|
+
"sourcesContent": ["vi.mock(\"uuid\");\n\nimport { Just, Left, type Maybe, Nothing, Right } from \"purify-ts\";\n\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nimport { ReceiverApduError } from \"@internal/device-session/model/Errors\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { DefaultApduReceiverService } from \"./DefaultApduReceiverService\";\n\nconst loggerService = new DefaultLoggerPublisherService([], \"frame\");\n\nconst RESPONSE_GET_VERSION = new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x00, 0x00, 0x21, 0x33, 0x00, 0x00, 0x04, 0x05, 0x32,\n 0x2e, 0x32, 0x2e, 0x33, 0x04, 0xe6, 0x00, 0x00, 0x00, 0x04, 0x32, 0x2e, 0x33,\n 0x30, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x90,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n]);\n\nconst RESPONSE_LOCKED_DEVICE = new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x00, 0x00, 0x02, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n]);\n\nconst RESPONSE_LIST_APPS = [\n new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x00, 0x00, 0x9e, 0x01, 0x4d, 0x00, 0x13, 0xca,\n 0x50, 0xfa, 0xa1, 0x91, 0x40, 0x9a, 0x6b, 0xfa, 0x6c, 0x0f, 0xbb, 0xb2,\n 0xe7, 0xc4, 0xa9, 0xcf, 0xe5, 0x57, 0x41, 0x00, 0x5d, 0xbd, 0x84, 0xab,\n 0x9a, 0xbd, 0x66, 0xc7, 0x6c, 0x90, 0xdd, 0x08, 0x79, 0x0d, 0x08, 0x47,\n 0xb9, 0x3a, 0x8f, 0xa7, 0x6f, 0x60, 0x33, 0xae, 0xd3, 0x25, 0xd7, 0xb1,\n 0xe5, 0x7c, 0xeb, 0xd7,\n ]),\n new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x01, 0x4b, 0x2e, 0x2c, 0x9f, 0xb4, 0x46, 0x78,\n 0xde, 0x05, 0x5f, 0x9e, 0x80, 0x0a, 0x07, 0x42, 0x69, 0x74, 0x63, 0x6f,\n 0x69, 0x6e, 0x4e, 0x00, 0x15, 0xca, 0x40, 0x06, 0x03, 0x28, 0xf8, 0x8f,\n 0xc6, 0xd6, 0x42, 0x98, 0xd0, 0x49, 0x00, 0xc7, 0x04, 0x98, 0x19, 0x1b,\n 0x6c, 0xeb, 0xed, 0xd8, 0xcb, 0x84, 0x5d, 0xf5, 0x4b, 0xe3, 0xbd, 0xbb,\n 0x25, 0x7a, 0x3f, 0x6f,\n ]),\n new Uint8Array([\n 0xaa, 0xaa, 0x05, 0x00, 0x02, 0x68, 0x8f, 0x54, 0xef, 0x7f, 0xaa, 0xc4,\n 0x22, 0xaa, 0x54, 0xe7, 0xb8, 0x0a, 0xc8, 0xa3, 0x2f, 0x96, 0xe5, 0x5e,\n 0x43, 0x2d, 0xf3, 0xa3, 0x45, 0x8d, 0x8e, 0xaa, 0xf1, 0x4e, 0xd1, 0x1e,\n 0x08, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x90, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00,\n ]),\n];\n\ndescribe(\"DefaultApduReceiverService\", () => {\n let service: ApduReceiverService;\n\n beforeAll(() => {\n vi.mock(\"uuid\", () => ({\n v4: vi.fn().mockReturnValue(\"42\"),\n }));\n });\n\n describe(\"without dataSize\", () => {\n beforeEach(() => {\n service = new DefaultApduReceiverService(\n { channel: Just(new Uint8Array([0xaa, 0xaa])) },\n () => loggerService,\n );\n });\n\n it(\"should return a left error when the first frame has no dataSize\", () => {\n //given\n const frame = RESPONSE_LIST_APPS[1]!;\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(Left(new ReceiverApduError()));\n });\n });\n\n describe(\"[USB] With padding and channel\", () => {\n beforeEach(() => {\n service = new DefaultApduReceiverService(\n { channel: Just(new Uint8Array([0xaa, 0xaa])) },\n () => loggerService,\n );\n });\n\n it(\"should return a response directly when a frame is complete\", () => {\n // given\n const frame = RESPONSE_GET_VERSION;\n\n // when\n const apdu = service.handleFrame(frame);\n\n // then\n expect(apdu).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: RESPONSE_GET_VERSION.slice(7, 38),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ),\n );\n });\n\n it(\"should return a response on a third frame when the two first are not complete\", () => {\n //given\n const apdus = [...RESPONSE_LIST_APPS];\n\n //when\n let response: Maybe<ApduResponse> = Nothing;\n const responses: Maybe<ApduResponse>[] = [];\n while (response.isNothing()) {\n const apdu = apdus.shift()!;\n const either = service.handleFrame(apdu);\n\n either.map((value) => {\n response = value;\n responses.push(response);\n });\n }\n\n //then\n expect(responses).toEqual([\n Nothing,\n Nothing,\n Just(\n new ApduResponse({\n data: new Uint8Array([\n ...Array.from(RESPONSE_LIST_APPS[0]!.slice(7)),\n ...Array.from(RESPONSE_LIST_APPS[1]!.slice(5)),\n ...Array.from(RESPONSE_LIST_APPS[2]!).slice(5, 45),\n ]),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ]);\n });\n\n it(\"should return two response directly when each frame is complete\", () => {\n // given\n const firstFrame = RESPONSE_LOCKED_DEVICE;\n const secondFrame = RESPONSE_GET_VERSION;\n\n // when\n const firstResponse = service.handleFrame(firstFrame);\n const secondResponse = service.handleFrame(secondFrame);\n\n // then\n expect(firstResponse).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: new Uint8Array([]),\n statusCode: new Uint8Array([0x55, 0x15]),\n }),\n ),\n ),\n );\n expect(secondResponse).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: RESPONSE_GET_VERSION.slice(7, 38),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ),\n );\n });\n\n it(\"should return an error if the frame is without index\", () => {\n //given\n //frame with channelId, headTag, and partial Index only\n const frame = RESPONSE_LIST_APPS[0]!.slice(0, 4);\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(\n Left(new ReceiverApduError(\"Unable to parse header from apdu\")),\n );\n });\n\n it(\"should return an error if the frame is without datasize\", () => {\n //given\n //frame with channelId, headTag, and Index and partial dataSize only\n const frame = RESPONSE_LIST_APPS[0]!.slice(0, 6);\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(\n Left(new ReceiverApduError(\"Unable to parse header from apdu\")),\n );\n });\n });\n\n describe(\"[BLE] Without padding nor channel\", () => {\n beforeEach(() => {\n service = new DefaultApduReceiverService({}, () => loggerService);\n });\n\n it(\"should return a response directly when a frame is complete\", () => {\n // given\n const frame = RESPONSE_GET_VERSION.slice(2, 40);\n\n // when\n const apdu = service.handleFrame(frame);\n\n // then\n expect(apdu).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: RESPONSE_GET_VERSION.slice(7, 38),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ),\n );\n });\n\n it(\"should return a response on a third frame when the two first are not complete\", () => {\n //given\n const apdus = [\n RESPONSE_LIST_APPS[0]!.slice(2),\n RESPONSE_LIST_APPS[1]!.slice(2),\n RESPONSE_LIST_APPS[2]!.slice(2, 47),\n ];\n\n //when\n let response: Maybe<ApduResponse> = Nothing;\n const responses: Maybe<ApduResponse>[] = [];\n while (response.isNothing()) {\n const apdu = apdus.shift()!;\n const either = service.handleFrame(apdu);\n\n either.map((value) => {\n response = value;\n responses.push(response);\n });\n }\n\n //then\n expect(responses).toEqual([\n Nothing,\n Nothing,\n Just(\n new ApduResponse({\n data: new Uint8Array([\n ...Array.from(RESPONSE_LIST_APPS[0]!.slice(7)),\n ...Array.from(RESPONSE_LIST_APPS[1]!.slice(5)),\n ...Array.from(RESPONSE_LIST_APPS[2]!).slice(5, 45),\n ]),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ]);\n });\n\n it(\"should return two response directly when each frame is complete\", () => {\n // given\n const firstFrame = RESPONSE_LOCKED_DEVICE.slice(2, 9);\n const secondFrame = RESPONSE_GET_VERSION.slice(2, 40);\n\n // when\n const firstResponse = service.handleFrame(firstFrame);\n const secondResponse = service.handleFrame(secondFrame);\n\n // then\n expect(firstResponse).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: new Uint8Array([]),\n statusCode: new Uint8Array([0x55, 0x15]),\n }),\n ),\n ),\n );\n expect(secondResponse).toEqual(\n Right(\n Just(\n new ApduResponse({\n data: RESPONSE_GET_VERSION.slice(7, 38),\n statusCode: new Uint8Array([0x90, 0x00]),\n }),\n ),\n ),\n );\n });\n\n it(\"should return an error if the frame is without index\", () => {\n //given\n //frame with channelId, headTag, and partial Index only\n const frame = RESPONSE_LIST_APPS[0]!.slice(2, 4);\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(\n Left(new ReceiverApduError(\"Unable to parse header from apdu\")),\n );\n });\n\n it(\"should return an error if the frame is without datasize\", () => {\n //given\n //frame with channelId, headTag, and Index and partial dataSize only\n const frame = RESPONSE_LIST_APPS[0]!.slice(2, 6);\n\n //when\n const apdu = service.handleFrame(frame);\n\n //then\n expect(apdu).toEqual(\n Left(new ReceiverApduError(\"Unable to parse header from apdu\")),\n );\n });\n });\n});\n"],
|
5
|
+
"mappings": "AAEA,OAAS,QAAAA,EAAM,QAAAC,EAAkB,WAAAC,EAAS,SAAAC,MAAa,YAEvD,OAAS,gBAAAC,MAAoB,mCAE7B,OAAS,qBAAAC,MAAyB,wCAClC,OAAS,iCAAAC,MAAqC,mEAE9C,OAAS,8BAAAC,MAAkC,+BAT3C,GAAG,KAAK,MAAM,EAWd,MAAMC,EAAgB,IAAIF,EAA8B,CAAC,EAAG,OAAO,EAE7DG,EAAuB,IAAI,WAAW,CAC1C,IAAM,IAAM,EAAM,EAAM,EAAM,EAAM,GAAM,GAAM,EAAM,EAAM,EAAM,EAAM,GACxE,GAAM,GAAM,GAAM,GAAM,EAAM,IAAM,EAAM,EAAM,EAAM,EAAM,GAAM,GAAM,GACxE,GAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,IACxE,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EACxE,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,CACxD,CAAC,EAEKC,EAAyB,IAAI,WAAW,CAC5C,IAAM,IAAM,EAAM,EAAM,EAAM,EAAM,EAAM,GAAM,GAAM,EAAM,EAAM,EAAM,EACxE,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EACxE,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ReceiverApduError", "DefaultLoggerPublisherService", "DefaultApduReceiverService", "loggerService", "RESPONSE_GET_VERSION", "RESPONSE_LOCKED_DEVICE", "RESPONSE_LIST_APPS", "service", "frame", "apdu", "apdus", "response", "responses", "value", "firstFrame", "secondFrame", "firstResponse", "secondResponse"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{Maybe as x}from"purify-ts";import{Frame as t}from"../../device-session/model/Frame";import{FrameHeader as i}from"../../device-session/model/FrameHeader";import{DefaultLoggerPublisherService as w}from"../../logger-publisher/service/DefaultLoggerPublisherService";import{DefaultApduSenderService as d}from"./DefaultApduSenderService";
|
1
|
+
import{Maybe as x}from"purify-ts";import{Frame as t}from"../../device-session/model/Frame";import{FrameHeader as i}from"../../device-session/model/FrameHeader";import{DefaultLoggerPublisherService as w}from"../../logger-publisher/service/DefaultLoggerPublisherService";import{DefaultApduSenderService as d}from"./DefaultApduSenderService";vi.mock("uuid",()=>({v4:vi.fn().mockReturnValue("42")}));const o=new w([],"frame");describe("DefaultApduSenderService",()=>{describe("[USB] With padding and channel",()=>{it("should return 1 frame",()=>{const n=x.of(new Uint8Array([18,52])),a=new d({frameSize:64,padding:!0,channel:n},()=>o),e=new Uint8Array([224,1,0,0,0]),r=a.getFrames(e);expect(r).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,5])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])})]),expect(r.map(c=>c.getRawData())).toEqual([new Uint8Array([18,52,5,0,0,0,5,224,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])])}),it("should return 2 frames",()=>{const n=x.of(new Uint8Array([18,52])),a=new d({frameSize:64,padding:!0,channel:n},()=>o),e=new Uint8Array([224,212,0,0,64,84,111,102,117,73,115,78,117,116,114,105,116,105,111,117,115,65,110,100,66,114,105,110,103,115,74,111,121,68,101,108,105,103,104,116,72,101,97,108,116,104,105,110,101,115,115,72,97,114,109,111,110,121,73,110,69,118,101,114,121,66,105,116,101]),r=a.getFrames(e);expect(r).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,69])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,212,0,0,64,84,111,102,117,73,115,78,117,116,114,105,116,105,111,117,115,65,110,100,66,114,105,110,103,115,74,111,121,68,101,108,105,103,104,116,72,101,97,108,116,104,105,110,101,115,115,72,97,114,109,111,110])}),new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),index:new Uint8Array([0,1]),length:5,dataSize:x.zero()}),data:new Uint8Array([121,73,110,69,118,101,114,121,66,105,116,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])})]),expect(r.map(c=>c.getRawData())).toEqual([new Uint8Array([18,52,5,0,0,0,69,224,212,0,0,64,84,111,102,117,73,115,78,117,116,114,105,116,105,111,117,115,65,110,100,66,114,105,110,103,115,74,111,121,68,101,108,105,103,104,116,72,101,97,108,116,104,105,110,101,115,115,72,97,114,109,111,110]),new Uint8Array([18,52,5,0,1,121,73,110,69,118,101,114,121,66,105,116,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])])})}),describe("[BLE] Without padding nor channel",()=>{it("should return 1 frame",()=>{const n=new d({frameSize:123},()=>o),a=new Uint8Array([224,1,0,0,0]),e=n.getFrames(a);expect(e).toEqual([new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,5])),index:new Uint8Array([0,0]),length:5}),data:new Uint8Array([224,1,0,0,0])})]),expect(e.map(r=>r.getRawData())).toEqual([new Uint8Array([5,0,0,0,5,224,1,0,0,0])])}),it("should return 3 frames",()=>{const n=new d({frameSize:10},()=>o),a=new Uint8Array([1,5,79,76,79,83,0,7,46,50,46,52,45,50,0,144,0]),e=n.getFrames(a);expect(e).toEqual([new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),index:new Uint8Array([0,0]),dataSize:x.of(new Uint8Array([0,17])),length:5}),data:new Uint8Array([1,5,79,76,79])}),new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),dataSize:x.zero(),index:new Uint8Array([0,1]),length:3}),data:new Uint8Array([83,0,7,46,50,46,52])}),new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),dataSize:x.zero(),index:new Uint8Array([0,2]),length:3}),data:new Uint8Array([45,50,0,144,0])})]),expect(e.map(r=>r.getRawData())).toEqual([new Uint8Array([5,0,0,0,17,1,5,79,76,79]),new Uint8Array([5,0,1,83,0,7,46,50,46,52]),new Uint8Array([5,0,2,45,50,0,144,0])])})}),describe("Errors",()=>{it("should return a well formatted header with very big channel",()=>{const n=new d({frameSize:64,channel:x.of(new Uint8Array([1193012,214084,353364,30788,590916]))},()=>o),a=new Uint8Array([224,1,0,0,0]),e=n.getFrames(a);expect(e).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([68,68])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,5])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,1,0,0,0])})]),expect(e.map(r=>r.getRawData())).toEqual([new Uint8Array([68,68,5,0,0,0,5,224,1,0,0,0])])}),it("should return empty if packet size smaller than header size",()=>{const n=new d({frameSize:Math.random()&4,channel:x.of(new Uint8Array([18,52]))},()=>o),a=new Uint8Array([224,1,0,0,0]),e=n.getFrames(a);expect(e.length).toEqual(0)}),it("should return empty if no apdu length",()=>{const n=new d({frameSize:Math.random()&255,padding:Math.random()>.5,channel:x.of(new Uint8Array([18,52]))},()=>o),a=new Uint8Array([]),e=n.getFrames(a);expect(e.length).toEqual(0)})})});
|
2
2
|
//# sourceMappingURL=DefaultApduSenderService.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/service/DefaultApduSenderService.test.ts"],
|
4
|
-
"sourcesContent": ["jest.mock(\"uuid\", () => ({\n v4: jest.fn().mockReturnValue(\"42\"),\n}));\n\nimport { 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\nconst loggerService = new DefaultLoggerPublisherService([], \"frame\");\n\ndescribe(\"DefaultApduSenderService\", () => {\n describe(\"[USB] With padding and channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n // getVersion APDU\n const apdu = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 2 frames\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([\n // editDeviceName APDU\n 0xe0, 0xd4, 0x00, 0x00, 0x40,\n // editDeviceNameData\n 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74,\n 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67,\n 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48,\n 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61,\n 0x72, 0x6d, 0x6f, 0x6e, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79,\n 0x42, 0x69, 0x74, 0x65,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0x00, 0x45])),\n index: new Uint8Array([0x00, 0x00]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0xd4, 0x00, 0x00, 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73,\n 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41,\n 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79,\n 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c,\n 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d,\n 0x6f, 0x6e,\n ]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0x00, 0x01]),\n length: 5,\n dataSize: Maybe.zero(),\n }),\n data: new Uint8Array([\n 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79, 0x42, 0x69, 0x74,\n 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x45, 0xe0, 0xd4, 0x00, 0x00,\n 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72,\n 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72,\n 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69,\n 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e,\n 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d, 0x6f, 0x6e,\n ]),\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x01, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65,\n 0x72, 0x79, 0x42, 0x69, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n });\n\n describe(\"[BLE] Without padding nor channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 123,\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 5])),\n index: new Uint8Array([0, 0]),\n length: 5,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 3 frames\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 10,\n },\n () => loggerService,\n );\n const command = new Uint8Array([\n 0x01, 0x05, 0x4f, 0x4c, 0x4f, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n 0x2d, 0x32, 0x00, 0x90, 0x00,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0, 0]),\n dataSize: Maybe.of(new Uint8Array([0, 0x11])),\n length: 5,\n }),\n data: new Uint8Array([0x01, 0x05, 0x4f, 0x4c, 0x4f]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x01]),\n length: 3,\n }),\n data: new Uint8Array([0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x02]),\n length: 3,\n }),\n data: new Uint8Array([0x2d, 0x32, 0x00, 0x90, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x11, 0x01, 0x05, 0x4f, 0x4c, 0x4f,\n ]),\n new Uint8Array([\n 0x05, 0x00, 0x01, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n ]),\n new Uint8Array([0x05, 0x00, 0x02, 0x2d, 0x32, 0x00, 0x90, 0x00]),\n ]);\n });\n });\n\n describe(\"Errors\", () => {\n it(\"should return a well formatted header with very big channel\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n channel: Maybe.of(\n new Uint8Array([0x123434, 0x34444, 0x56454, 0x7844, 0x90444]),\n ),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x44, 0x44])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x44, 0x44, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00,\n ]),\n ]);\n });\n it(\"should return empty if packet size smaller than header size\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: Math.random() & 4,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n\n it(\"should return empty if no apdu length\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n // random frameSize < 0xff\n frameSize: Math.random() & 0xff,\n // random padding boolean\n padding: Math.random() > 0.5,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n });\n});\n"],
|
5
|
-
"mappings": "
|
4
|
+
"sourcesContent": ["import { Maybe } from \"purify-ts\";\n\nimport { Frame } from \"@internal/device-session/model/Frame\";\nimport { FrameHeader } from \"@internal/device-session/model/FrameHeader\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { DefaultApduSenderService } from \"./DefaultApduSenderService\";\n\nvi.mock(\"uuid\", () => ({\n v4: vi.fn().mockReturnValue(\"42\"),\n}));\n\nconst loggerService = new DefaultLoggerPublisherService([], \"frame\");\n\ndescribe(\"DefaultApduSenderService\", () => {\n describe(\"[USB] With padding and channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n // getVersion APDU\n const apdu = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 2 frames\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([\n // editDeviceName APDU\n 0xe0, 0xd4, 0x00, 0x00, 0x40,\n // editDeviceNameData\n 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74,\n 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67,\n 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48,\n 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61,\n 0x72, 0x6d, 0x6f, 0x6e, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79,\n 0x42, 0x69, 0x74, 0x65,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0x00, 0x45])),\n index: new Uint8Array([0x00, 0x00]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0xd4, 0x00, 0x00, 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73,\n 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41,\n 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79,\n 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c,\n 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d,\n 0x6f, 0x6e,\n ]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0x00, 0x01]),\n length: 5,\n dataSize: Maybe.zero(),\n }),\n data: new Uint8Array([\n 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79, 0x42, 0x69, 0x74,\n 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x45, 0xe0, 0xd4, 0x00, 0x00,\n 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72,\n 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72,\n 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69,\n 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e,\n 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d, 0x6f, 0x6e,\n ]),\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x01, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65,\n 0x72, 0x79, 0x42, 0x69, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n });\n\n describe(\"[BLE] Without padding nor channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 123,\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 5])),\n index: new Uint8Array([0, 0]),\n length: 5,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 3 frames\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 10,\n },\n () => loggerService,\n );\n const command = new Uint8Array([\n 0x01, 0x05, 0x4f, 0x4c, 0x4f, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n 0x2d, 0x32, 0x00, 0x90, 0x00,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0, 0]),\n dataSize: Maybe.of(new Uint8Array([0, 0x11])),\n length: 5,\n }),\n data: new Uint8Array([0x01, 0x05, 0x4f, 0x4c, 0x4f]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x01]),\n length: 3,\n }),\n data: new Uint8Array([0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x02]),\n length: 3,\n }),\n data: new Uint8Array([0x2d, 0x32, 0x00, 0x90, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x11, 0x01, 0x05, 0x4f, 0x4c, 0x4f,\n ]),\n new Uint8Array([\n 0x05, 0x00, 0x01, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n ]),\n new Uint8Array([0x05, 0x00, 0x02, 0x2d, 0x32, 0x00, 0x90, 0x00]),\n ]);\n });\n });\n\n describe(\"Errors\", () => {\n it(\"should return a well formatted header with very big channel\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n channel: Maybe.of(\n new Uint8Array([0x123434, 0x34444, 0x56454, 0x7844, 0x90444]),\n ),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x44, 0x44])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x44, 0x44, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00,\n ]),\n ]);\n });\n it(\"should return empty if packet size smaller than header size\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: Math.random() & 4,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n\n it(\"should return empty if no apdu length\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n // random frameSize < 0xff\n frameSize: Math.random() & 0xff,\n // random padding boolean\n padding: Math.random() > 0.5,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n });\n});\n"],
|
5
|
+
"mappings": "AAAA,OAAS,SAAAA,MAAa,YAEtB,OAAS,SAAAC,MAAa,uCACtB,OAAS,eAAAC,MAAmB,6CAC5B,OAAS,iCAAAC,MAAqC,mEAE9C,OAAS,4BAAAC,MAAgC,6BAEzC,GAAG,KAAK,OAAQ,KAAO,CACrB,GAAI,GAAG,GAAG,EAAE,gBAAgB,IAAI,CAClC,EAAE,EAEF,MAAMC,EAAgB,IAAIF,EAA8B,CAAC,EAAG,OAAO,EAEnE,SAAS,2BAA4B,IAAM,CACzC,SAAS,iCAAkC,IAAM,CAC/C,GAAG,wBAAyB,IAAM,CAEhC,MAAMG,EAAUN,EAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,EAC/CO,EAAoB,IAAIH,EAC5B,CACE,UAAW,GACX,QAAS,GACT,QAAAE,CACF,EACA,IAAMD,CACR,EAEMG,EAAO,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,EAGpDC,EAASF,EAAkB,UAAUC,CAAI,EAG/C,OAAOC,CAAM,EAAE,QAAQ,CACrB,IAAIR,EAAM,CACR,OAAQ,IAAIC,EAAY,CACtB,KAAM,KACN,QAASF,EAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,EAC9C,QAAS,IAAI,WAAW,CAAC,CAAI,CAAC,EAC9B,SAAUA,EAAM,GAAG,IAAI,WAAW,CAAC,EAAG,CAAI,CAAC,CAAC,EAC5C,MAAO,IAAI,WAAW,CAAC,EAAG,CAAC,CAAC,EAC5B,OAAQ,CACV,CAAC,EACD,KAAM,IAAI,WAAW,CACnB,IAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAC5D,EAAM,EAAM,EAAM,EAAM,E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AI,CAAC,EAGvDF,EAASF,EAAkB,UAAUI,CAAO,EAGlD,OAAOF,EAAO,MAAM,EAAE,QAAQ,CAAC,CACjC,CAAC,EAED,GAAG,wCAAyC,IAAM,CAEhD,MAAMF,EAAoB,IAAIH,EAC5B,CAEE,UAAW,KAAK,OAAO,EAAI,IAE3B,QAAS,KAAK,OAAO,EAAI,GACzB,QAASJ,EAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,CAChD,EACA,IAAMK,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": ["Maybe", "Frame", "FrameHeader", "DefaultLoggerPublisherService", "DefaultApduSenderService", "loggerService", "channel", "apduSenderService", "apdu", "frames", "fr", "command"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{Either as
|
1
|
+
import{Either as d,Left as p}from"purify-ts";import{Observable as m}from"rxjs";import{deviceSessionStubBuilder as S}from"../../device-session/model/DeviceSession.stub";import{DeviceSessionNotFound as D}from"../../device-session/model/Errors";import{DefaultLoggerPublisherService as f}from"../../logger-publisher/service/DefaultLoggerPublisherService";import{AxiosManagerApiDataSource as g}from"../../manager-api/data/AxiosManagerApiDataSource";import{DefaultManagerApiService as h}from"../../manager-api/service/DefaultManagerApiService";import{DefaultSecureChannelDataSource as b}from"../../secure-channel/data/DefaultSecureChannelDataSource";import{DefaultSecureChannelService as x}from"../../secure-channel/service/DefaultSecureChannelService";import{DefaultDeviceSessionService as A}from"./DefaultDeviceSessionService";vi.mock("@internal/logger-publisher/service/DefaultLoggerPublisherService");vi.mock("@internal/manager-api/data/AxiosManagerApiDataSource");let e,t,i,l,a,v,c;describe("DefaultDeviceSessionService",()=>{beforeEach(()=>{vi.restoreAllMocks(),t=new f([],"deviceSession"),e=new A(()=>t),l=new g({}),a=new h(l),v=new b({}),c=new x(v),i=S({},()=>t,a,c)}),afterEach(()=>{i.close()}),it("should have an empty sessions list",()=>{expect(e.getDeviceSessions()).toEqual([])}),it("should add a deviceSession",()=>{e.addDeviceSession(i),expect(e.getDeviceSessions()).toEqual([i])}),it("should not add a deviceSession if it already exists",()=>{e.addDeviceSession(i),e.addDeviceSession(i),expect(e.getDeviceSessions()).toEqual([i])}),it("should remove a deviceSession",()=>{e.addDeviceSession(i),e.removeDeviceSession(i.id),expect(e.getDeviceSessions()).toEqual([])}),it("should not remove a deviceSession if it does not exist",()=>{e.removeDeviceSession(i.id),expect(e.getDeviceSessions()).toEqual([])}),it("should get a deviceSession",()=>{e.addDeviceSession(i),expect(e.getDeviceSessionById(i.id)).toEqual(d.of(i))}),it("should not get a deviceSession if it does not exist",()=>{expect(e.getDeviceSessionById(i.id)).toEqual(p(new D))}),it("should get all sessions",()=>{e.addDeviceSession(i),expect(e.getDeviceSessions()).toEqual([i])}),it("should retrieve sessionObs",()=>{expect(e.sessionsObs).toBeInstanceOf(m)}),it("should emit new session",()=>new Promise((s,o)=>{const r=e.sessionsObs.subscribe({next(n){try{expect(n).toStrictEqual(i),r.unsubscribe(),s()}catch(u){o(u)}}});e.addDeviceSession(i)})),it("should emit previous added session",()=>{const s=S({id:"last-session"},()=>t,a,c),o=[];e.addDeviceSession(i),e.addDeviceSession(s);const r=e.sessionsObs.subscribe({next(n){o.push(n)}});s.close(),expect(o).toEqual([i,s]),r.unsubscribe()})});
|
2
2
|
//# sourceMappingURL=DefaultDeviceSessionService.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/service/DefaultDeviceSessionService.test.ts"],
|
4
|
-
"sourcesContent": ["import { Either, Left } from \"purify-ts\";\nimport { Observable } from \"rxjs\";\n\nimport { type DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport type { ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { DefaultDeviceSessionService } from \"./DefaultDeviceSessionService\";\n\
|
5
|
-
"mappings": "AAAA,OAAS,UAAAA,EAAQ,QAAAC,MAAY,YAC7B,OAAS,cAAAC,MAAkB,
|
6
|
-
"names": ["Either", "Left", "Observable", "deviceSessionStubBuilder", "DeviceSessionNotFound", "DefaultLoggerPublisherService", "AxiosManagerApiDataSource", "DefaultManagerApiService", "DefaultDeviceSessionService", "sessionService", "loggerService", "deviceSession", "managerApi", "
|
4
|
+
"sourcesContent": ["import { Either, Left } from \"purify-ts\";\nimport { Observable } from \"rxjs\";\n\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type DeviceSession } from \"@internal/device-session/model/DeviceSession\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport type { ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DefaultDeviceSessionService } from \"./DefaultDeviceSessionService\";\n\nvi.mock(\"@internal/logger-publisher/service/DefaultLoggerPublisherService\");\nvi.mock(\"@internal/manager-api/data/AxiosManagerApiDataSource\");\n\nlet sessionService: DefaultDeviceSessionService;\nlet loggerService: DefaultLoggerPublisherService;\nlet deviceSession: DeviceSession;\nlet managerApiDataSource: ManagerApiDataSource;\nlet managerApi: ManagerApiService;\nlet secureChannelDataSource: SecureChannelDataSource;\nlet secureChannel: SecureChannelService;\n\ndescribe(\"DefaultDeviceSessionService\", () => {\n beforeEach(() => {\n vi.restoreAllMocks();\n loggerService = new DefaultLoggerPublisherService([], \"deviceSession\");\n sessionService = new DefaultDeviceSessionService(() => loggerService);\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n\n deviceSession = deviceSessionStubBuilder(\n {},\n () => loggerService,\n managerApi,\n secureChannel,\n );\n });\n\n afterEach(() => {\n deviceSession.close();\n });\n\n it(\"should have an empty sessions list\", () => {\n expect(sessionService.getDeviceSessions()).toEqual([]);\n });\n\n it(\"should add a deviceSession\", () => {\n sessionService.addDeviceSession(deviceSession);\n expect(sessionService.getDeviceSessions()).toEqual([deviceSession]);\n });\n\n it(\"should not add a deviceSession if it already exists\", () => {\n sessionService.addDeviceSession(deviceSession);\n sessionService.addDeviceSession(deviceSession);\n expect(sessionService.getDeviceSessions()).toEqual([deviceSession]);\n });\n\n it(\"should remove a deviceSession\", () => {\n sessionService.addDeviceSession(deviceSession);\n sessionService.removeDeviceSession(deviceSession.id);\n expect(sessionService.getDeviceSessions()).toEqual([]);\n });\n\n it(\"should not remove a deviceSession if it does not exist\", () => {\n sessionService.removeDeviceSession(deviceSession.id);\n expect(sessionService.getDeviceSessions()).toEqual([]);\n });\n\n it(\"should get a deviceSession\", () => {\n sessionService.addDeviceSession(deviceSession);\n expect(sessionService.getDeviceSessionById(deviceSession.id)).toEqual(\n Either.of(deviceSession),\n );\n });\n\n it(\"should not get a deviceSession if it does not exist\", () => {\n expect(sessionService.getDeviceSessionById(deviceSession.id)).toEqual(\n Left(new DeviceSessionNotFound()),\n );\n });\n\n it(\"should get all sessions\", () => {\n sessionService.addDeviceSession(deviceSession);\n expect(sessionService.getDeviceSessions()).toEqual([deviceSession]);\n });\n\n it(\"should retrieve sessionObs\", () => {\n expect(sessionService.sessionsObs).toBeInstanceOf(\n Observable<DeviceSession>,\n );\n });\n\n it(\"should emit new session\", () =>\n new Promise<void>((resolve, reject) => {\n const subscription = sessionService.sessionsObs.subscribe({\n next(emittedDeviceSession) {\n try {\n expect(emittedDeviceSession).toStrictEqual(deviceSession);\n subscription.unsubscribe();\n resolve();\n } catch (error) {\n reject(error);\n }\n },\n });\n sessionService.addDeviceSession(deviceSession);\n }));\n\n it(\"should emit previous added session\", () => {\n const lastDeviceSession = deviceSessionStubBuilder(\n { id: \"last-session\" },\n () => loggerService,\n managerApi,\n secureChannel,\n );\n const emittedSessions: DeviceSession[] = [];\n sessionService.addDeviceSession(deviceSession);\n sessionService.addDeviceSession(lastDeviceSession);\n\n const subscription = sessionService.sessionsObs.subscribe({\n next(emittedDeviceSession) {\n emittedSessions.push(emittedDeviceSession);\n },\n });\n lastDeviceSession.close();\n expect(emittedSessions).toEqual([deviceSession, lastDeviceSession]);\n subscription.unsubscribe();\n });\n});\n"],
|
5
|
+
"mappings": "AAAA,OAAS,UAAAA,EAAQ,QAAAC,MAAY,YAC7B,OAAS,cAAAC,MAAkB,OAI3B,OAAS,4BAAAC,MAAgC,oDACzC,OAAS,yBAAAC,MAA6B,wCACtC,OAAS,iCAAAC,MAAqC,mEAC9C,OAAS,6B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AAOC,CAAe,EAAE,QAAQ,CAACX,EAAeU,CAAiB,CAAC,EAClEH,EAAa,YAAY,CAC3B,CAAC,CACH,CAAC",
|
6
|
+
"names": ["Either", "Left", "Observable", "deviceSessionStubBuilder", "DeviceSessionNotFound", "DefaultLoggerPublisherService", "AxiosManagerApiDataSource", "DefaultManagerApiService", "DefaultSecureChannelDataSource", "DefaultSecureChannelService", "DefaultDeviceSessionService", "sessionService", "loggerService", "deviceSession", "managerApiDataSource", "managerApi", "secureChannelDataSource", "secureChannel", "resolve", "reject", "subscription", "emittedDeviceSession", "error", "lastDeviceSession", "emittedSessions"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
var
|
1
|
+
var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var S=(o,e,i,s)=>{for(var r=s>1?void 0:s?m(e,i):e,t=o.length-1,n;t>=0;t--)(n=o[t])&&(r=(s?n(e,i,r):n(r))||r);return s&&r&&a(e,i,r),r},v=(o,e)=>(i,s)=>e(i,s,o);import{inject as p,injectable as D}from"inversify";import{deviceSessionTypes as d}from"../../device-session/di/deviceSessionTypes";import{transportDiTypes as f}from"../../transport/di/transportDiTypes";let c=class{_sessionService;_transportService;constructor(e,i){this._sessionService=e,this._transportService=i}execute(){const e=this._sessionService.getDeviceSessions();for(const i of e)this._transportService.closeConnection(i.connectedDevice),this._sessionService.removeDeviceSession(i.id)}};c=S([D(),v(0,p(d.DeviceSessionService)),v(1,p(f.TransportService))],c);export{c as CloseSessionsUseCase};
|
2
2
|
//# sourceMappingURL=CloseSessionsUseCase.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/use-case/CloseSessionsUseCase.ts"],
|
4
|
-
"sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\n\n@injectable()\nexport class CloseSessionsUseCase {\n private readonly _sessionService: DeviceSessionService;\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n ) {\n this._sessionService = sessionService;\n }\n\n execute() {\n const deviceSessions = this._sessionService.getDeviceSessions();\n\n for (const dSession of deviceSessions) {\n dSession.
|
5
|
-
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAEnC,OAAS,sBAAAC,MAA0B,
|
6
|
-
"names": ["inject", "injectable", "deviceSessionTypes", "CloseSessionsUseCase", "sessionService", "deviceSessions", "dSession", "__decorateClass", "injectable", "__decorateParam", "inject", "deviceSessionTypes"]
|
4
|
+
"sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { transportDiTypes } from \"@internal/transport/di/transportDiTypes\";\nimport type { TransportService } from \"@internal/transport/service/TransportService\";\n\n@injectable()\nexport class CloseSessionsUseCase {\n private readonly _sessionService: DeviceSessionService;\n private readonly _transportService: TransportService;\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n @inject(transportDiTypes.TransportService)\n transportService: TransportService,\n ) {\n this._sessionService = sessionService;\n this._transportService = transportService;\n }\n\n execute() {\n const deviceSessions = this._sessionService.getDeviceSessions();\n\n for (const dSession of deviceSessions) {\n this._transportService.closeConnection(dSession.connectedDevice);\n this._sessionService.removeDeviceSession(dSession.id);\n }\n }\n}\n"],
|
5
|
+
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAEnC,OAAS,sBAAAC,MAA0B,iDAEnC,OAAS,oBAAAC,MAAwB,0CAI1B,IAAMC,EAAN,KAA2B,CACf,gBACA,kBACjB,YAEEC,EAEAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,kBAAoBC,CAC3B,CAEA,SAAU,CACR,MAAMC,EAAiB,KAAK,gBAAgB,kBAAkB,EAE9D,UAAWC,KAAYD,EACrB,KAAK,kBAAkB,gBAAgBC,EAAS,eAAe,EAC/D,KAAK,gBAAgB,oBAAoBA,EAAS,EAAE,CAExD,CACF,EArBaJ,EAANK,EAAA,CADNC,EAAW,EAKPC,EAAA,EAAAC,EAAOC,EAAmB,oBAAoB,GAE9CF,EAAA,EAAAC,EAAOE,EAAiB,gBAAgB,IANhCV",
|
6
|
+
"names": ["inject", "injectable", "deviceSessionTypes", "transportDiTypes", "CloseSessionsUseCase", "sessionService", "transportService", "deviceSessions", "dSession", "__decorateClass", "injectable", "__decorateParam", "inject", "deviceSessionTypes", "transportDiTypes"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{deviceSessionStubBuilder as
|
1
|
+
import{deviceSessionStubBuilder as S}from"../../device-session/model/DeviceSession.stub";import{DefaultDeviceSessionService as m}from"../../device-session/service/DefaultDeviceSessionService";import{CloseSessionsUseCase as l}from"../../device-session/use-case/CloseSessionsUseCase";import{DefaultLoggerPublisherService as p}from"../../logger-publisher/service/DefaultLoggerPublisherService";import{AxiosManagerApiDataSource as u}from"../../manager-api/data/AxiosManagerApiDataSource";import{DefaultManagerApiService as f}from"../../manager-api/service/DefaultManagerApiService";import{DefaultSecureChannelDataSource as v}from"../../secure-channel/data/DefaultSecureChannelDataSource";import{DefaultSecureChannelService as D}from"../../secure-channel/service/DefaultSecureChannelService";import{DefaultTransportService as g}from"../../transport/service/__mocks__/DefaultTransportService";let o,i,a,t,n,r,c;describe("CloseSessionsUseCase",()=>{beforeEach(()=>{o=new p([],"close-sessions-use-case-test"),i=new u({}),a=new f(i),t=new v({}),n=new D(t),r=new m(()=>o),c=new g}),it("should be able to close every session",()=>{[...Array(10).keys()].map(e=>{const s=S({id:e.toString()},()=>o,a,n);return vi.spyOn(s,"close"),s}).forEach(e=>r.addDeviceSession(e)),new l(r,c).execute();for(const e of r.getDeviceSessions())expect(e.close).toHaveBeenCalled()})});
|
2
2
|
//# sourceMappingURL=CloseSessionsUseCase.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/use-case/CloseSessionsUseCase.test.ts"],
|
4
|
-
"sourcesContent": ["import { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { CloseSessionsUseCase } from \"@internal/device-session/use-case/CloseSessionsUseCase\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nlet logger: LoggerPublisherService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet managerApi: ManagerApiService;\nlet sessionService: DeviceSessionService;\n\ndescribe(\"CloseSessionsUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService(\n [],\n \"close-sessions-use-case-test\",\n );\n managerApiDataSource = new AxiosManagerApiDataSource({
|
5
|
-
"mappings": "
|
6
|
-
"names": ["deviceSessionStubBuilder", "DefaultDeviceSessionService", "CloseSessionsUseCase", "DefaultLoggerPublisherService", "AxiosManagerApiDataSource", "DefaultManagerApiService", "logger", "managerApiDataSource", "managerApi", "sessionService", "
|
4
|
+
"sourcesContent": ["import { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { CloseSessionsUseCase } from \"@internal/device-session/use-case/CloseSessionsUseCase\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\nimport { DefaultTransportService } from \"@internal/transport/service/__mocks__/DefaultTransportService\";\n\nlet logger: LoggerPublisherService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet managerApi: ManagerApiService;\nlet secureChannelDataSource: SecureChannelDataSource;\nlet secureChannel: SecureChannelService;\nlet sessionService: DeviceSessionService;\nlet transportService: DefaultTransportService;\n\n// @TODO Fix this test with vi.spyOn session close [SNAPSHOT PURPOSE]\ndescribe(\"CloseSessionsUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService(\n [],\n \"close-sessions-use-case-test\",\n );\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n sessionService = new DefaultDeviceSessionService(() => logger);\n transportService = new DefaultTransportService();\n });\n\n it(\"should be able to close every session\", () => {\n //given\n const sessions = [...Array(10).keys()].map((id) => {\n const session = deviceSessionStubBuilder(\n { id: id.toString() },\n () => logger,\n managerApi,\n secureChannel,\n );\n vi.spyOn(session, \"close\");\n return session;\n });\n sessions.forEach((session) => sessionService.addDeviceSession(session));\n const useCase = new CloseSessionsUseCase(sessionService, transportService);\n //when\n useCase.execute();\n //then\n for (const session of sessionService.getDeviceSessions()) {\n expect(session.close).toHaveBeenCalled();\n }\n });\n});\n"],
|
5
|
+
"mappings": "AAEA,OAAS,4BAAAA,MAAgC,oDACzC,OAAS,+BAAAC,MAAmC,+DAE5C,OAAS,wBAAAC,MAA4B,yDACrC,OAAS,iCAAAC,MAAqC,mEAC9C,OAAS,6BAAAC,MAAiC,uDAE1C,OAAS,4BAAAC,MAAgC,yDAEzC,OAAS,kCAAAC,MAAsC,+DAE/C,OAAS,+BAAAC,MAAmC,+DAE5C,OAAS,2BAAAC,MAA+B,gEAExC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAGJ,SAAS,uBAAwB,IAAM,CACrC,WAAW,IAAM,CACfN,EAAS,IAAIN,EACX,CAAC,EACD,8BACF,EACAO,EAAuB,IAAIN,EAA0B,CAAC,CAAc,EACpEO,EAAa,IAAIN,EAAyBK,CAAoB,EAC9DE,EAA0B,IAAIN,EAC5B,CAAC,CACH,EACAO,EAAgB,IAAIN,EAA4BK,CAAuB,EACvEE,EAAiB,IAAIb,EAA4B,IAAMQ,CAAM,EAC7DM,EAAmB,IAAIP,CACzB,CAAC,EAED,GAAG,wCAAyC,IAAM,CAE/B,CAAC,GAAG,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,IAAKQ,GAAO,CACjD,MAAMC,EAAUjB,EACd,CAAE,GAAIgB,EAAG,SAAS,CAAE,EACpB,IAAMP,EACNE,EACAE,CACF,EACA,UAAG,MAAMI,EAAS,OAAO,EAClBA,CACT,CAAC,EACQ,QAASA,GAAYH,EAAe,iBAAiBG,CAAO,CAAC,EACtD,IAAIf,EAAqBY,EAAgBC,CAAgB,EAEjE,QAAQ,EAEhB,UAAWE,KAAWH,EAAe,kBAAkB,EACrD,OAAOG,EAAQ,KAAK,EAAE,iBAAiB,CAE3C,CAAC,CACH,CAAC",
|
6
|
+
"names": ["deviceSessionStubBuilder", "DefaultDeviceSessionService", "CloseSessionsUseCase", "DefaultLoggerPublisherService", "AxiosManagerApiDataSource", "DefaultManagerApiService", "DefaultSecureChannelDataSource", "DefaultSecureChannelService", "DefaultTransportService", "logger", "managerApiDataSource", "managerApi", "secureChannelDataSource", "secureChannel", "sessionService", "transportService", "id", "session"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{deviceSessionStubBuilder as p}from"../../device-session/model/DeviceSession.stub";import{DeviceSessionNotFound as
|
1
|
+
import{deviceSessionStubBuilder as p}from"../../device-session/model/DeviceSession.stub";import{DeviceSessionNotFound as f}from"../../device-session/model/Errors";import{DefaultDeviceSessionService as l}from"../../device-session/service/DefaultDeviceSessionService";import{DefaultLoggerPublisherService as v}from"../../logger-publisher/service/DefaultLoggerPublisherService";import{AxiosManagerApiDataSource as D}from"../../manager-api/data/AxiosManagerApiDataSource";import{DefaultManagerApiService as d}from"../../manager-api/service/DefaultManagerApiService";import{DefaultSecureChannelDataSource as g}from"../../secure-channel/data/DefaultSecureChannelDataSource";import{DefaultSecureChannelService as h}from"../../secure-channel/service/DefaultSecureChannelService";import{GetDeviceSessionStateUseCase as a}from"./GetDeviceSessionStateUseCase";vi.mock("@internal/manager-api/data/AxiosManagerApiDataSource");let r,i,n,c,S,m;const t="fakeSessionId";describe("GetDeviceSessionStateUseCase",()=>{beforeEach(()=>{r=new v([],"get-connected-device-use-case-test"),n=new D({}),c=new d(n),S=new g({}),m=new h(S),i=new l(()=>r)}),it("should retrieve deviceSession device state",()=>{const e=p({id:t},()=>r,c,m);i.addDeviceSession(e);const o=new a(i,()=>r).execute({sessionId:t}),u=e.state;e.close(),expect(o).toStrictEqual(u)}),it("should throw error when deviceSession is not found",()=>new Promise(e=>{const s=new a(i,()=>r);try{s.execute({sessionId:t}).subscribe()}catch(o){expect(o).toBeInstanceOf(f),e()}}))});
|
2
2
|
//# sourceMappingURL=GetDeviceSessionStateUseCase.test.js.map
|
package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.ts"],
|
4
|
-
"sourcesContent": ["import { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { GetDeviceSessionStateUseCase } from \"./GetDeviceSessionStateUseCase\";\n\
|
5
|
-
"mappings": "
|
6
|
-
"names": ["deviceSessionStubBuilder", "DeviceSessionNotFound", "DefaultDeviceSessionService", "DefaultLoggerPublisherService", "AxiosManagerApiDataSource", "DefaultManagerApiService", "GetDeviceSessionStateUseCase", "logger", "sessionService", "managerApiDataSource", "managerApi", "fakeSessionId", "deviceSession", "res", "expected", "
|
4
|
+
"sourcesContent": ["import { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { type DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { GetDeviceSessionStateUseCase } from \"./GetDeviceSessionStateUseCase\";\n\nvi.mock(\"@internal/manager-api/data/AxiosManagerApiDataSource\");\n\nlet logger: LoggerPublisherService;\nlet sessionService: DeviceSessionService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet managerApi: ManagerApiService;\nlet secureChannelDataSource: SecureChannelDataSource;\nlet secureChannel: SecureChannelService;\n\nconst fakeSessionId = \"fakeSessionId\";\n\ndescribe(\"GetDeviceSessionStateUseCase\", () => {\n beforeEach(() => {\n logger = new DefaultLoggerPublisherService(\n [],\n \"get-connected-device-use-case-test\",\n );\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n sessionService = new DefaultDeviceSessionService(() => logger);\n });\n\n // TODO: This test does not close a subscription\n // \u00AF\\_(\u30C4)_/\u00AF I cannot find which one unfortunatly\n it(\"should retrieve deviceSession device state\", () => {\n // given\n const deviceSession = deviceSessionStubBuilder(\n { id: fakeSessionId },\n () => logger,\n managerApi,\n secureChannel,\n );\n sessionService.addDeviceSession(deviceSession);\n const useCase = new GetDeviceSessionStateUseCase(\n sessionService,\n () => logger,\n );\n\n const res = useCase.execute({ sessionId: fakeSessionId });\n const expected = deviceSession.state;\n\n deviceSession.close();\n\n // then\n expect(res).toStrictEqual(expected);\n });\n\n it(\"should throw error when deviceSession is not found\", () =>\n new Promise<void>((resolve) => {\n // given\n const useCase = new GetDeviceSessionStateUseCase(\n sessionService,\n () => logger,\n );\n\n // when\n try {\n useCase\n .execute({\n sessionId: fakeSessionId,\n })\n .subscribe();\n } catch (error) {\n // then\n expect(error).toBeInstanceOf(DeviceSessionNotFound);\n resolve();\n }\n }));\n});\n"],
|
5
|
+
"mappings": "AAEA,OAAS,4BAAAA,MAAgC,oDACzC,OAAS,yBAAAC,MAA6B,wCACtC,OAAS,+BAAAC,MAAmC,+DAE5C,OAAS,iCAAAC,MAAqC,mEAC9C,OAAS,6BAAAC,MAAiC,uDAE1C,OAAS,4BAAAC,MAAgC,yDAEzC,OAAS,kCAAAC,MAAsC,+DAE/C,OAAS,+BAAAC,MAAmC,+DAG5C,OAAS,gCAAAC,MAAoC,iCAE7C,GAAG,KAAK,sDAAsD,EAE9D,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEJ,MAAMC,EAAgB,gBAEtB,SAAS,+BAAgC,IAAM,CAC7C,WAAW,IAAM,CACfN,EAAS,IAAIN,EACX,CAAC,EACD,oCACF,EACAQ,EAAuB,IAAIP,EAA0B,CAAC,CAAc,EACpEQ,EAAa,IAAIP,EAAyBM,CAAoB,EAC9DE,EAA0B,IAAIP,EAC5B,CAAC,CACH,EACAQ,EAAgB,IAAIP,EAA4BM,CAAuB,EACvEH,EAAiB,IAAIR,EAA4B,IAAMO,CAAM,CAC/D,CAAC,EAID,GAAG,6CAA8C,IAAM,CAErD,MAAMO,EAAgBhB,EACpB,CAAE,GAAIe,CAAc,EACpB,IAAMN,EACNG,EACAE,CACF,EACAJ,EAAe,iBAAiBM,CAAa,EAM7C,MAAMC,EALU,IAAIT,EAClBE,EACA,IAAMD,CACR,EAEoB,QAAQ,CAAE,UAAWM,CAAc,CAAC,EAClDG,EAAWF,EAAc,MAE/BA,EAAc,MAAM,EAGpB,OAAOC,CAAG,EAAE,cAAcC,CAAQ,CACpC,CAAC,EAED,GAAG,qDAAsD,IACvD,IAAI,QAAeC,GAAY,CAE7B,MAAMC,EAAU,IAAIZ,EAClBE,EACA,IAAMD,CACR,EAGA,GAAI,CACFW,EACG,QAAQ,CACP,UAAWL,CACb,CAAC,EACA,UAAU,CACf,OAASM,EAAO,CAEd,OAAOA,CAAK,EAAE,eAAepB,CAAqB,EAClDkB,EAAQ,CACV,CACF,CAAC,CAAC,CACN,CAAC",
|
6
|
+
"names": ["deviceSessionStubBuilder", "DeviceSessionNotFound", "DefaultDeviceSessionService", "DefaultLoggerPublisherService", "AxiosManagerApiDataSource", "DefaultManagerApiService", "DefaultSecureChannelDataSource", "DefaultSecureChannelService", "GetDeviceSessionStateUseCase", "logger", "sessionService", "managerApiDataSource", "managerApi", "secureChannelDataSource", "secureChannel", "fakeSessionId", "deviceSession", "res", "expected", "resolve", "useCase", "error"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{ContainerModule as
|
1
|
+
import{ContainerModule as i}from"inversify";import{ConnectUseCase as a}from"../../discovery/use-case/ConnectUseCase";import{DisconnectUseCase as C}from"../../discovery/use-case/DisconnectUseCase";import{GetConnectedDeviceUseCase as n}from"../../discovery/use-case/GetConnectedDeviceUseCase";import{ListConnectedDevicesUseCase as r}from"../../discovery/use-case/ListConnectedDevicesUseCase";import{ListenToAvailableDevicesUseCase as U}from"../../discovery/use-case/ListenToAvailableDevicesUseCase";import{ListenToConnectedDeviceUseCase as v}from"../../discovery/use-case/ListenToConnectedDeviceUseCase";import{StartDiscoveringUseCase as m}from"../../discovery/use-case/StartDiscoveringUseCase";import{StopDiscoveringUseCase as D}from"../../discovery/use-case/StopDiscoveringUseCase";import{StubUseCase as t}from"../../../../src/di.stub";import{discoveryTypes as e}from"./discoveryTypes";const P=({stub:c=!1})=>new i((o,p,f,s)=>{o(e.ConnectUseCase).to(a),o(e.DisconnectUseCase).to(C),o(e.StartDiscoveringUseCase).to(m),o(e.StopDiscoveringUseCase).to(D),o(e.GetConnectedDeviceUseCase).to(n),o(e.ListenToAvailableDevicesUseCase).to(U),o(e.ListenToConnectedDeviceUseCase).to(v),o(e.ListConnectedDevicesUseCase).to(r),c&&(s(e.StartDiscoveringUseCase).to(t),s(e.StopDiscoveringUseCase).to(t),s(e.ConnectUseCase).to(t),s(e.DisconnectUseCase).to(t),s(e.GetConnectedDeviceUseCase).to(t),s(e.ListenToAvailableDevicesUseCase).to(t),s(e.ListenToConnectedDeviceUseCase).to(t),s(e.ListConnectedDevicesUseCase).to(t))});export{P as 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 {
|
5
|
-
"mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,kBAAAC,MAAsB,8CAC/B,OAAS,qBAAAC,MAAyB,iDAClC,OAAS,6BAAAC,MAAiC,yDAC1C,OAAS,+BAAAC,MAAmC,2DAC5C,OAAS,kCAAAC,MAAsC,8DAC/C,OAAS
|
6
|
-
"names": ["ContainerModule", "ConnectUseCase", "DisconnectUseCase", "GetConnectedDeviceUseCase", "ListConnectedDevicesUseCase", "
|
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": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,kBAAAC,MAAsB,8CAC/B,OAAS,qBAAAC,MAAyB,iDAClC,OAAS,6BAAAC,MAAiC,yDAC1C,OAAS,+BAAAC,MAAmC,2DAC5C,OAAS,mCAAAC,MAAuC,+DAChD,OAAS,kCAAAC,MAAsC,8DAC/C,OAAS,2BAAAC,MAA+B,uDACxC,OAAS,0BAAAC,MAA8B,sDACvC,OAAS,eAAAC,MAAmB,oBAE5B,OAAS,kBAAAC,MAAsB,mBAMxB,MAAMC,EAAyB,CAAC,CAAE,KAAAC,EAAO,EAAM,IACpD,IAAIZ,EAAgB,CAACa,EAAMC,EAASC,EAAUC,IAAW,CACvDH,EAAKH,EAAe,cAAc,EAAE,GAAGT,CAAc,EACrDY,EAAKH,EAAe,iBAAiB,EAAE,GAAGR,CAAiB,EAC3DW,EAAKH,EAAe,uBAAuB,EAAE,GAAGH,CAAuB,EACvEM,EAAKH,EAAe,sBAAsB,EAAE,GAAGF,CAAsB,EACrEK,EAAKH,EAAe,yBAAyB,EAAE,GAC7CP,CACF,EACAU,EAAKH,EAAe,+BAA+B,EAAE,GACnDL,CACF,EACAQ,EAAKH,EAAe,8BAA8B,EAAE,GAClDJ,CACF,EACAO,EAAKH,EAAe,2BAA2B,EAAE,GAC/CN,CACF,EAEIQ,IACFI,EAAON,EAAe,uBAAuB,EAAE,GAAGD,CAAW,EAC7DO,EAAON,EAAe,sBAAsB,EAAE,GAAGD,CAAW,EAC5DO,EAAON,EAAe,cAAc,EAAE,GAAGD,CAAW,EACpDO,EAAON,EAAe,iBAAiB,EAAE,GAAGD,CAAW,EACvDO,EAAON,EAAe,yBAAyB,EAAE,GAAGD,CAAW,EAC/DO,EAAON,EAAe,+BAA+B,EAAE,GAAGD,CAAW,EACrEO,EAAON,EAAe,8BAA8B,EAAE,GAAGD,CAAW,EACpEO,EAAON,EAAe,2BAA2B,EAAE,GAAGD,CAAW,EAErE,CAAC",
|
6
|
+
"names": ["ContainerModule", "ConnectUseCase", "DisconnectUseCase", "GetConnectedDeviceUseCase", "ListConnectedDevicesUseCase", "ListenToAvailableDevicesUseCase", "ListenToConnectedDeviceUseCase", "StartDiscoveringUseCase", "StopDiscoveringUseCase", "StubUseCase", "discoveryTypes", "discoveryModuleFactory", "stub", "bind", "_unbind", "_isBound", "rebind"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{Container as p}from"inversify";import{TransportMock as f}from"../../../api/transport/model/__mocks__/TransportMock";import{deviceModelModuleFactory as
|
1
|
+
import{Container as p}from"inversify";import{TransportMock as f}from"../../../api/transport/model/__mocks__/TransportMock";import{deviceModelModuleFactory as l}from"../../device-model/di/deviceModelModule";import{deviceSessionModuleFactory as d}from"../../device-session/di/deviceSessionModule";import{ConnectUseCase as C}from"../../discovery/use-case/ConnectUseCase";import{DisconnectUseCase as v}from"../../discovery/use-case/DisconnectUseCase";import{ListConnectedDevicesUseCase as u}from"../../discovery/use-case/ListConnectedDevicesUseCase";import{ListenToAvailableDevicesUseCase as g}from"../../discovery/use-case/ListenToAvailableDevicesUseCase";import{StartDiscoveringUseCase as U}from"../../discovery/use-case/StartDiscoveringUseCase";import{StopDiscoveringUseCase as y}from"../../discovery/use-case/StopDiscoveringUseCase";import{loggerModuleFactory as D}from"../../logger-publisher/di/loggerModule";import{managerApiModuleFactory as k}from"../../manager-api/di/managerApiModule";import{secureChannelModuleFactory as M}from"../../secure-channel/di/secureChannelModule";import{transportModuleFactory as b}from"../../transport/di/transportModule";import{discoveryModuleFactory as F}from"./discoveryModule";import{discoveryTypes as o}from"./discoveryTypes";describe("discoveryModuleFactory",()=>{let e,t,s;beforeEach(()=>{t=F({stub:!1}),e=new p,s=new f,e.load(t,D(),l({stub:!1}),d(),b({transports:[vi.fn().mockImplementation(()=>s)]}),k({config:{managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url"}}),M({config:{webSocketUrl:"http://fake-websocket.url"}}))}),it("should return the device module",()=>{expect(t).toBeDefined()}),it("should return none mocked use cases",()=>{const r=e.get(o.StartDiscoveringUseCase);expect(r).toBeInstanceOf(U);const n=e.get(o.StopDiscoveringUseCase);expect(n).toBeInstanceOf(y);const c=e.get(o.DisconnectUseCase);expect(c).toBeInstanceOf(v);const i=e.get(o.ConnectUseCase);expect(i).toBeInstanceOf(C);const a=e.get(o.ListenToAvailableDevicesUseCase);expect(a).toBeInstanceOf(g);const m=e.get(o.ListConnectedDevicesUseCase);expect(m).toBeInstanceOf(u)})});
|
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 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 {
|
5
|
-
"mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,iBAAAC,MAAqB,+CAE9B,OAAS,4BAAAC,MAAgC,8CACzC,OAAS,8BAAAC,MAAkC,kDAC3C,OAAS,kBAAAC,MAAsB,8CAC/B,OAAS,qBAAAC,MAAyB,iDAClC,OAAS,+BAAAC,MAAmC,2DAC5C,OAAS
|
6
|
-
"names": ["Container", "TransportMock", "deviceModelModuleFactory", "deviceSessionModuleFactory", "ConnectUseCase", "DisconnectUseCase", "ListConnectedDevicesUseCase", "
|
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,OAAS,aAAAA,MAAiB,YAE1B,OAAS,iBAAAC,MAAqB,+CAE9B,OAAS,4BAAAC,MAAgC,8CACzC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iB,EAAiBN,EAAU,IAAID,EAAe,cAAc,EAClE,OAAOO,CAAc,EAAE,eAAelB,CAAc,EAEpD,MAAMmB,EAAkCP,EAAU,IAChDD,EAAe,+BACjB,EACA,OAAOQ,CAA+B,EAAE,eACtChB,CACF,EACA,MAAMiB,EAA8BR,EAAU,IAC5CD,EAAe,2BACjB,EACA,OAAOS,CAA2B,EAAE,eAClClB,CACF,CACF,CAAC,CACH,CAAC",
|
6
|
+
"names": ["Container", "TransportMock", "deviceModelModuleFactory", "deviceSessionModuleFactory", "ConnectUseCase", "DisconnectUseCase", "ListConnectedDevicesUseCase", "ListenToAvailableDevicesUseCase", "StartDiscoveringUseCase", "StopDiscoveringUseCase", "loggerModuleFactory", "managerApiModuleFactory", "secureChannelModuleFactory", "transportModuleFactory", "discoveryModuleFactory", "discoveryTypes", "container", "mod", "transport", "startDiscoveringUseCase", "stopDiscoveringUseCase", "disconnectUseCase", "connectUseCase", "listenToAvailableDevicesUseCase", "listConnectedDevicesUseCase"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
const e={StartDiscoveringUseCase:Symbol.for("StartDiscoveringUseCase"),StopDiscoveringUseCase:Symbol.for("StopDiscoveringUseCase"),ConnectUseCase:Symbol.for("ConnectUseCase"),DisconnectUseCase:Symbol.for("DisconnectUseCase"),GetConnectedDeviceUseCase:Symbol.for("GetConnectedDeviceUseCase"),
|
1
|
+
const e={StartDiscoveringUseCase:Symbol.for("StartDiscoveringUseCase"),StopDiscoveringUseCase:Symbol.for("StopDiscoveringUseCase"),ConnectUseCase:Symbol.for("ConnectUseCase"),DisconnectUseCase:Symbol.for("DisconnectUseCase"),GetConnectedDeviceUseCase:Symbol.for("GetConnectedDeviceUseCase"),ListenToAvailableDevicesUseCase:Symbol.for("ListenToAvailableDevicesUseCase"),ListenToConnectedDeviceUseCase:Symbol.for("ListenToConnectedDeviceUseCase"),ListConnectedDevicesUseCase:Symbol.for("ListConnectedDevicesUseCase")};export{e as discoveryTypes};
|
2
2
|
//# sourceMappingURL=discoveryTypes.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/discovery/di/discoveryTypes.ts"],
|
4
|
-
"sourcesContent": ["export const discoveryTypes = {\n StartDiscoveringUseCase: Symbol.for(\"StartDiscoveringUseCase\"),\n StopDiscoveringUseCase: Symbol.for(\"StopDiscoveringUseCase\"),\n ConnectUseCase: Symbol.for(\"ConnectUseCase\"),\n DisconnectUseCase: Symbol.for(\"DisconnectUseCase\"),\n GetConnectedDeviceUseCase: Symbol.for(\"GetConnectedDeviceUseCase\"),\n
|
5
|
-
"mappings": "AAAO,MAAMA,EAAiB,CAC5B,wBAAyB,OAAO,IAAI,yBAAyB,EAC7D,uBAAwB,OAAO,IAAI,wBAAwB,EAC3D,eAAgB,OAAO,IAAI,gBAAgB,EAC3C,kBAAmB,OAAO,IAAI,mBAAmB,EACjD,0BAA2B,OAAO,IAAI,2BAA2B,EACjE,
|
4
|
+
"sourcesContent": ["export const discoveryTypes = {\n StartDiscoveringUseCase: Symbol.for(\"StartDiscoveringUseCase\"),\n StopDiscoveringUseCase: Symbol.for(\"StopDiscoveringUseCase\"),\n ConnectUseCase: Symbol.for(\"ConnectUseCase\"),\n DisconnectUseCase: Symbol.for(\"DisconnectUseCase\"),\n GetConnectedDeviceUseCase: Symbol.for(\"GetConnectedDeviceUseCase\"),\n ListenToAvailableDevicesUseCase: Symbol.for(\n \"ListenToAvailableDevicesUseCase\",\n ),\n ListenToConnectedDeviceUseCase: Symbol.for(\"ListenToConnectedDeviceUseCase\"),\n ListConnectedDevicesUseCase: Symbol.for(\"ListConnectedDevicesUseCase\"),\n};\n"],
|
5
|
+
"mappings": "AAAO,MAAMA,EAAiB,CAC5B,wBAAyB,OAAO,IAAI,yBAAyB,EAC7D,uBAAwB,OAAO,IAAI,wBAAwB,EAC3D,eAAgB,OAAO,IAAI,gBAAgB,EAC3C,kBAAmB,OAAO,IAAI,mBAAmB,EACjD,0BAA2B,OAAO,IAAI,2BAA2B,EACjE,gCAAiC,OAAO,IACtC,iCACF,EACA,+BAAgC,OAAO,IAAI,gCAAgC,EAC3E,4BAA6B,OAAO,IAAI,6BAA6B,CACvE",
|
6
6
|
"names": ["discoveryTypes"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
var S=Object.defineProperty;var
|
1
|
+
var S=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=(n,r,o,e)=>{for(var i=e>1?void 0:e?m(r,o):r,t=n.length-1,v;t>=0;t--)(v=n[t])&&(i=(e?v(r,o,i):v(i))||i);return e&&i&&S(r,o,i),i},s=(n,r)=>(o,e)=>r(o,e,n);import{inject as c,injectable as g}from"inversify";import{EitherAsync as h}from"purify-ts";import{TransportNotSupportedError as l}from"../../../api/transport/model/Errors";import{deviceSessionTypes as d}from"../../device-session/di/deviceSessionTypes";import{DeviceSession as D}from"../../device-session/model/DeviceSession";import{loggerTypes as y}from"../../logger-publisher/di/loggerTypes";import{managerApiTypes as f}from"../../manager-api/di/managerApiTypes";import{secureChannelTypes as u}from"../../secure-channel/di/secureChannelTypes";import{transportDiTypes as _}from"../../transport/di/transportDiTypes";let a=class{_transportService;_sessionService;_loggerFactory;_managerApi;_secureChannel;_logger;constructor(r,o,e,i,t){this._sessionService=o,this._transportService=r,this._loggerFactory=e,this._logger=e("ConnectUseCase"),this._managerApi=i,this._secureChannel=t}handleDeviceDisconnect(r){this._sessionService.getDeviceSessionByDeviceId(r).map(e=>{this._sessionService.removeDeviceSession(e.id)})}async execute({device:r}){const o=this._transportService.getTransport(r.transport);return h.liftEither(o.toEither(new l(new Error("Unknown transport")))).chain(async e=>e.connect({deviceId:r.id,onDisconnect:i=>this.handleDeviceDisconnect(i)})).ifLeft(e=>{this._logger.error("Error connecting to device",{data:{deviceId:r.id,error:e}})}).map(e=>{const i=new D({connectedDevice:e},this._loggerFactory,this._managerApi,this._secureChannel);return this._sessionService.addDeviceSession(i),i.id}).caseOf({Left:e=>{throw e},Right:e=>e})}};a=p([g(),s(0,c(_.TransportService)),s(1,c(d.DeviceSessionService)),s(2,c(y.LoggerPublisherServiceFactory)),s(3,c(f.ManagerApiService)),s(4,c(u.SecureChannelService))],a);export{a as ConnectUseCase};
|
2
2
|
//# sourceMappingURL=ConnectUseCase.js.map
|