@ledgerhq/device-management-kit 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -31
- package/lib/cjs/package.json +13 -14
- package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
- 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/DmkConfig.js +1 -1
- package/lib/cjs/src/api/DmkConfig.js.map +1 -1
- package/lib/cjs/src/api/Error.js +1 -1
- package/lib/cjs/src/api/Error.js.map +3 -3
- package/lib/cjs/src/api/apdu/utils/ApduParser.test.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ApduParser.test.js.map +2 -2
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +2 -2
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
- package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +2 -2
- 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/GetOsVersionCommand.js +1 -1
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +2 -2
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +2 -2
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +2 -0
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +7 -0
- package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +2 -2
- 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 +2 -2
- package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.js.map +2 -2
- package/lib/cjs/src/api/device/DeviceModel.js +1 -1
- package/lib/cjs/src/api/device/DeviceModel.js.map +3 -3
- package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/data.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/data.js.map +3 -3
- 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/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/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/ListAppsWithMetadata/types.js.map +1 -1
- 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/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/use-case/ExecuteDeviceActionUseCase.js.map +2 -2
- package/lib/cjs/src/api/device-model/data/DeviceModelDataSource.js +2 -0
- package/lib/cjs/src/api/device-model/data/DeviceModelDataSource.js.map +7 -0
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +2 -0
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +7 -0
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +2 -0
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +7 -0
- package/lib/cjs/src/api/device-model/model/BleDeviceInfos.js +2 -0
- package/lib/cjs/src/api/device-model/model/BleDeviceInfos.js.map +7 -0
- package/lib/cjs/src/api/device-model/model/DeviceModel.js +2 -0
- package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +7 -0
- package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +2 -0
- package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +7 -0
- package/lib/cjs/src/api/device-model/model/DeviceModel.test.js +2 -0
- package/lib/cjs/src/api/device-model/model/DeviceModel.test.js.map +7 -0
- 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/{internal → api}/device-session/data/FramerConst.js.map +1 -1
- package/lib/cjs/src/api/device-session/service/ApduReceiverService.js +2 -0
- package/lib/cjs/src/{internal → api}/device-session/service/ApduReceiverService.js.map +2 -2
- package/lib/cjs/src/api/device-session/service/ApduSenderService.js +2 -0
- package/lib/cjs/src/api/device-session/service/ApduSenderService.js.map +7 -0
- package/lib/cjs/src/api/device-session/service/DefaultApduReceiverService.stub.js +2 -0
- package/lib/cjs/src/api/device-session/service/DefaultApduReceiverService.stub.js.map +7 -0
- package/lib/cjs/src/api/device-session/service/DefaultApduSenderService.stub.js +2 -0
- package/lib/cjs/src/api/device-session/service/DefaultApduSenderService.stub.js.map +7 -0
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js +2 -0
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js.map +7 -0
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +2 -0
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +7 -0
- package/lib/cjs/src/{internal → api}/device-session/utils/FramerUtils.js.map +1 -1
- package/lib/cjs/src/{internal → api}/device-session/utils/FramerUtils.test.js.map +1 -1
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +3 -3
- package/lib/cjs/src/{internal → api}/logger-publisher/service/LoggerPublisherService.js.map +1 -1
- 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 +3 -3
- package/lib/cjs/src/api/logger-subscriber/{__mocks__ → service/__mocks__}/ConsoleLogger.js.map +1 -1
- package/lib/cjs/src/api/transport/model/ConnectedDevice.js +1 -1
- package/lib/cjs/src/api/transport/model/ConnectedDevice.js.map +2 -2
- package/lib/cjs/src/{internal → api}/transport/model/DeviceConnection.js.map +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js +2 -0
- package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js.map +7 -0
- package/lib/cjs/src/api/transport/model/Errors.js +2 -0
- package/lib/cjs/src/api/transport/model/Errors.js.map +7 -0
- package/lib/cjs/src/api/transport/model/Transport.js +1 -1
- package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.js +2 -0
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.js.map +7 -0
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js +2 -0
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js.map +7 -0
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js +2 -0
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js.map +7 -0
- package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js +2 -0
- package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js.map +7 -0
- package/lib/cjs/src/api/transport/model/TransportIdentifier.js +1 -1
- package/lib/cjs/src/api/transport/model/TransportIdentifier.js.map +3 -3
- package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js +2 -0
- package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js.map +7 -0
- package/lib/cjs/src/api/types.js +1 -1
- package/lib/cjs/src/api/types.js.map +1 -1
- package/lib/cjs/src/di.js +1 -1
- package/lib/cjs/src/di.js.map +3 -3
- package/lib/cjs/src/internal/config/service/DefaultConfigService.js +1 -1
- package/lib/cjs/src/internal/config/service/DefaultConfigService.js.map +2 -2
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +2 -2
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.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.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js.map +2 -2
- 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/model/Errors.js.map +1 -1
- package/lib/cjs/src/internal/device-session/model/FrameHeader.js +1 -1
- package/lib/cjs/src/internal/device-session/model/FrameHeader.js.map +2 -2
- package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js.map +3 -3
- 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 +3 -3
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +3 -3
- 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 +3 -3
- package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.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 +2 -2
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +2 -0
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +7 -0
- package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.js.map +2 -2
- 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.test.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
- 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.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.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.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.js.map +2 -2
- 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 +2 -2
- package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.js.map +2 -2
- 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 +2 -2
- package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +2 -2
- 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/ListenToKnownDevicesUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.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 +3 -3
- 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.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.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 +3 -3
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +2 -2
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js.map +2 -2
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js +2 -0
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +7 -0
- 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 +1 -1
- 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/{ManagerApiType.js → Application.js} +2 -2
- package/lib/cjs/src/internal/manager-api/model/Application.js.map +7 -0
- package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/model/Device.js +2 -0
- package/lib/cjs/src/internal/manager-api/model/Device.js.map +7 -0
- package/lib/cjs/src/internal/manager-api/model/Errors.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Errors.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/model/Firmware.js +2 -0
- package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +7 -0
- package/lib/cjs/src/internal/manager-api/model/Params.js +2 -0
- package/lib/cjs/src/internal/manager-api/model/Params.js.map +7 -0
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
- 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/manager-api/service/ManagerApiService.js +1 -1
- package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +2 -2
- 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/transportDiTypes.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportDiTypes.js.map +2 -2
- package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
- package/lib/cjs/src/internal/transport/di/transportModule.test.js +2 -0
- package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +7 -0
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +2 -0
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +7 -0
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js +2 -0
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js.map +7 -0
- package/lib/cjs/src/internal/transport/service/TransportService.js +2 -0
- package/lib/cjs/src/internal/transport/service/TransportService.js.map +7 -0
- package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +2 -0
- package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +7 -0
- package/lib/esm/package.json +13 -14
- package/lib/esm/src/api/DeviceManagementKit.js +1 -1
- package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
- 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/Error.js +1 -1
- package/lib/esm/src/api/Error.js.map +3 -3
- package/lib/esm/src/api/apdu/utils/ApduParser.test.js +1 -1
- package/lib/esm/src/api/apdu/utils/ApduParser.test.js.map +2 -2
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +2 -2
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.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/GetOsVersionCommand.js +1 -1
- package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +2 -2
- package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
- package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +2 -0
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +7 -0
- package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +2 -2
- 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 +2 -2
- package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/esm/src/api/command/utils/CommandUtils.js.map +2 -2
- package/lib/esm/src/api/device/DeviceModel.js +1 -1
- package/lib/esm/src/api/device/DeviceModel.js.map +3 -3
- package/lib/esm/src/api/device-action/__test-utils__/data.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/data.js.map +2 -2
- 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/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/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/use-case/ExecuteDeviceActionUseCase.js.map +2 -2
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +2 -0
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +7 -0
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +2 -0
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +7 -0
- package/lib/esm/src/api/device-model/model/BleDeviceInfos.js +2 -0
- package/lib/esm/src/api/device-model/model/BleDeviceInfos.js.map +7 -0
- package/lib/esm/src/api/device-model/model/DeviceModel.js +2 -0
- package/lib/esm/src/api/device-model/model/DeviceModel.js.map +7 -0
- package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +2 -0
- package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +7 -0
- package/lib/esm/src/api/device-model/model/DeviceModel.test.js +2 -0
- package/lib/esm/src/api/device-model/model/DeviceModel.test.js.map +7 -0
- package/lib/esm/src/api/device-session/DeviceSessionState.js.map +2 -2
- package/lib/esm/src/{internal → api}/device-session/data/FramerConst.js.map +1 -1
- package/lib/esm/src/api/device-session/service/DefaultApduReceiverService.stub.js +2 -0
- package/lib/esm/src/api/device-session/service/DefaultApduReceiverService.stub.js.map +7 -0
- package/lib/esm/src/api/device-session/service/DefaultApduSenderService.stub.js +2 -0
- package/lib/esm/src/api/device-session/service/DefaultApduSenderService.stub.js.map +7 -0
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js +2 -0
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js.map +7 -0
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +2 -0
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +7 -0
- package/lib/esm/src/{internal → api}/device-session/utils/FramerUtils.js.map +1 -1
- package/lib/esm/src/{internal → api}/device-session/utils/FramerUtils.test.js.map +1 -1
- 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/WebLogsExporterLogger.test.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
- package/lib/esm/src/api/logger-subscriber/{__mocks__ → service/__mocks__}/ConsoleLogger.js.map +1 -1
- package/lib/esm/src/api/transport/model/ConnectedDevice.js +1 -1
- package/lib/esm/src/api/transport/model/ConnectedDevice.js.map +2 -2
- package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js +2 -0
- package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js.map +7 -0
- package/lib/esm/src/api/transport/model/Errors.js +2 -0
- package/lib/esm/src/api/transport/model/Errors.js.map +7 -0
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.js +2 -0
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.js.map +7 -0
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js +2 -0
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js.map +7 -0
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js +2 -0
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js.map +7 -0
- package/lib/esm/src/api/transport/model/TransportDiscoveredDevice.js +1 -0
- package/lib/esm/src/api/transport/model/TransportIdentifier.js +0 -1
- package/lib/esm/src/api/transport/model/TransportIdentifier.js.map +4 -4
- package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js +2 -0
- package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js.map +7 -0
- package/lib/esm/src/di.js +1 -1
- package/lib/esm/src/di.js.map +3 -3
- package/lib/esm/src/internal/config/service/DefaultConfigService.js +1 -1
- package/lib/esm/src/internal/config/service/DefaultConfigService.js.map +2 -2
- package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
- package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +2 -2
- package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
- package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionTypes.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.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js.map +2 -2
- 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/model/Errors.js.map +1 -1
- package/lib/esm/src/internal/device-session/model/FrameHeader.js +1 -1
- package/lib/esm/src/internal/device-session/model/FrameHeader.js.map +2 -2
- package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js.map +3 -3
- 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 +3 -3
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +3 -3
- 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 +3 -3
- package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.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 +2 -2
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +2 -0
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +7 -0
- package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.js.map +2 -2
- 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.test.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
- 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.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.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.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.js.map +2 -2
- 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 +2 -2
- package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.js.map +2 -2
- 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 +2 -2
- package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +2 -2
- 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/ListenToKnownDevicesUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.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 +3 -3
- 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.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.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 +3 -3
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +2 -2
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js.map +2 -2
- package/lib/esm/src/internal/logger-publisher/service/{__mocks__/DefaultLoggerService.js → DefaultLoggerPublisherService.stub.js} +2 -2
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +7 -0
- 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/model/{ManagerApiType.js → Application.js} +1 -1
- package/lib/esm/src/internal/manager-api/model/Application.js.map +7 -0
- package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
- package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
- package/lib/esm/src/internal/manager-api/model/Device.js +1 -0
- package/lib/esm/src/internal/manager-api/model/Device.js.map +7 -0
- package/lib/esm/src/internal/manager-api/model/Errors.js +1 -1
- package/lib/esm/src/internal/manager-api/model/Errors.js.map +3 -3
- package/lib/esm/src/internal/manager-api/model/Firmware.js +1 -0
- package/lib/esm/src/internal/manager-api/model/Firmware.js.map +7 -0
- package/lib/esm/src/internal/manager-api/model/Params.js +1 -0
- package/lib/esm/src/internal/manager-api/model/Params.js.map +7 -0
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
- 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/send/use-case/SendApduUseCase.js.map +2 -2
- 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/transportDiTypes.js +1 -1
- package/lib/esm/src/internal/transport/di/transportDiTypes.js.map +2 -2
- package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
- package/lib/esm/src/internal/transport/di/transportModule.test.js +2 -0
- package/lib/esm/src/internal/transport/di/transportModule.test.js.map +7 -0
- package/lib/esm/src/internal/transport/service/DefaultTransportService.js +2 -0
- package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +7 -0
- package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js +2 -0
- package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js.map +7 -0
- package/lib/esm/src/internal/transport/service/TransportService.js +1 -0
- package/lib/esm/src/internal/transport/service/TransportService.js.map +7 -0
- package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +2 -0
- package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +7 -0
- package/lib/types/src/api/DeviceManagementKit.d.ts +9 -0
- package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
- package/lib/types/src/api/DeviceManagementKitBuilder.d.ts +4 -7
- 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/Error.d.ts +5 -0
- package/lib/types/src/api/Error.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +28 -0
- package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +24 -0
- package/lib/types/src/api/apdu/utils/ByteArrayParser.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/GetOsVersionCommand.d.ts +1 -1
- package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
- package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts +4 -0
- package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -0
- package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +1 -1
- package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
- package/lib/types/src/api/device/DeviceModel.d.ts +1 -0
- package/lib/types/src/api/device/DeviceModel.d.ts.map +1 -1
- package/lib/types/src/api/device-action/DeviceAction.d.ts +1 -1
- package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/data.d.ts +1 -1
- package/lib/types/src/api/device-action/__test-utils__/data.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts +1 -1
- package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/ListAppsWithMetadata/types.d.ts +1 -1
- package/lib/types/src/api/device-action/os/ListAppsWithMetadata/types.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-action/use-case/ExecuteDeviceActionUseCase.d.ts +1 -1
- package/lib/types/src/api/device-action/use-case/ExecuteDeviceActionUseCase.d.ts.map +1 -1
- package/lib/types/src/api/device-model/data/DeviceModelDataSource.d.ts +16 -0
- package/lib/types/src/api/device-model/data/DeviceModelDataSource.d.ts.map +1 -0
- package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts +21 -0
- package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -0
- package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.test.d.ts.map +1 -0
- package/lib/types/src/api/device-model/model/BleDeviceInfos.d.ts +10 -0
- package/lib/types/src/api/device-model/model/BleDeviceInfos.d.ts.map +1 -0
- package/lib/types/src/{internal → api}/device-model/model/DeviceModel.d.ts +2 -2
- package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -0
- package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts +3 -0
- package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -0
- package/lib/types/src/api/device-model/model/DeviceModel.test.d.ts.map +1 -0
- package/lib/types/src/api/device-session/DeviceSessionState.d.ts +6 -1
- package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
- package/lib/types/src/api/device-session/data/FramerConst.d.ts.map +1 -0
- package/lib/types/src/api/device-session/service/ApduReceiverService.d.ts +11 -0
- package/lib/types/src/api/device-session/service/ApduReceiverService.d.ts.map +1 -0
- package/lib/types/src/api/device-session/service/ApduSenderService.d.ts +12 -0
- package/lib/types/src/api/device-session/service/ApduSenderService.d.ts.map +1 -0
- package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts +5 -0
- package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -0
- package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts +5 -0
- package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -0
- package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.d.ts +17 -0
- package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.d.ts.map +1 -0
- package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.d.ts +2 -0
- package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.d.ts.map +1 -0
- package/lib/types/src/api/device-session/utils/FramerUtils.d.ts.map +1 -0
- package/lib/types/src/api/device-session/utils/FramerUtils.test.d.ts.map +1 -0
- package/lib/types/src/api/index.d.ts +23 -23
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/{internal → api}/logger-publisher/service/LoggerPublisherService.d.ts +2 -2
- package/lib/types/src/api/logger-publisher/service/LoggerPublisherService.d.ts.map +1 -0
- package/lib/types/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/ConnectedDevice.d.ts +3 -3
- package/lib/types/src/api/transport/model/ConnectedDevice.d.ts.map +1 -1
- package/lib/types/src/{internal → api}/transport/model/DeviceConnection.d.ts +3 -3
- package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts +5 -0
- package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/Errors.d.ts +73 -0
- package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/Transport.d.ts +20 -7
- package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
- package/lib/types/src/{internal/transport/model/InternalConnectedDevice.d.ts → api/transport/model/TransportConnectedDevice.d.ts} +8 -8
- package/lib/types/src/api/transport/model/TransportConnectedDevice.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/TransportConnectedDevice.stub.d.ts +3 -0
- package/lib/types/src/api/transport/model/TransportConnectedDevice.stub.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/TransportConnectedDevice.test.d.ts +2 -0
- package/lib/types/src/api/transport/model/TransportConnectedDevice.test.d.ts.map +1 -0
- package/lib/types/src/{internal/transport/model/InternalDiscoveredDevice.d.ts → api/transport/model/TransportDiscoveredDevice.d.ts} +6 -6
- package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/TransportIdentifier.d.ts +0 -5
- package/lib/types/src/api/transport/model/TransportIdentifier.d.ts.map +1 -1
- package/lib/types/src/{internal/transport/usb/transport/__mocks__/WebUsbHidTransport.d.ts → api/transport/model/__mocks__/TransportMock.d.ts} +7 -7
- package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts.map +1 -0
- package/lib/types/src/api/types.d.ts +21 -3
- package/lib/types/src/api/types.d.ts.map +1 -1
- package/lib/types/src/di.d.ts +3 -5
- package/lib/types/src/di.d.ts.map +1 -1
- package/lib/types/src/internal/config/service/DefaultConfigService.d.ts +1 -1
- package/lib/types/src/internal/config/service/DefaultConfigService.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts +1 -0
- package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +7 -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 +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts +9 -2
- package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/Errors.d.ts +1 -1
- package/lib/types/src/internal/device-session/model/Errors.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.d.ts +3 -6
- package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/service/DefaultApduSenderService.d.ts +4 -9
- package/lib/types/src/internal/device-session/service/DefaultApduSenderService.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/service/DefaultDeviceSessionService.d.ts +1 -1
- package/lib/types/src/internal/device-session/service/DefaultDeviceSessionService.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.test.d.ts +2 -0
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.test.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.d.ts +1 -1
- package/lib/types/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts +4 -4
- package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/DisconnectUseCase.d.ts +4 -4
- package/lib/types/src/internal/discovery/use-case/DisconnectUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/GetConnectedDeviceUseCase.d.ts +1 -1
- package/lib/types/src/internal/discovery/use-case/GetConnectedDeviceUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/ListConnectedDevicesUseCase.d.ts +1 -1
- package/lib/types/src/internal/discovery/use-case/ListConnectedDevicesUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts +1 -1
- package/lib/types/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts +3 -3
- package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts +3 -3
- package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +3 -3
- package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.d.ts +1 -1
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.d.ts.map +1 -1
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts +11 -0
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts.map +1 -0
- package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +20 -6
- 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 +75 -3
- 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 +8 -0
- package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/{ManagerApiType.d.ts → Application.d.ts} +2 -3
- package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -0
- package/lib/types/src/internal/manager-api/model/Const.d.ts +1 -0
- package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Device.d.ts +4 -0
- package/lib/types/src/internal/manager-api/model/Device.d.ts.map +1 -0
- package/lib/types/src/internal/manager-api/model/Errors.d.ts +6 -0
- package/lib/types/src/internal/manager-api/model/Errors.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Firmware.d.ts +5 -0
- package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -0
- package/lib/types/src/internal/manager-api/model/Params.d.ts +86 -0
- package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -0
- package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +5 -1
- package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +6 -1
- package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
- package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +1 -1
- package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/transport/di/transportDiTypes.d.ts +2 -1
- package/lib/types/src/internal/transport/di/transportDiTypes.d.ts.map +1 -1
- package/lib/types/src/internal/transport/di/transportModule.d.ts +3 -5
- package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
- package/lib/types/src/internal/transport/di/transportModule.test.d.ts +2 -0
- package/lib/types/src/internal/transport/di/transportModule.test.d.ts.map +1 -0
- package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +25 -0
- package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -0
- package/lib/types/src/internal/transport/service/DefaultTransportService.test.d.ts +2 -0
- package/lib/types/src/internal/transport/service/DefaultTransportService.test.d.ts.map +1 -0
- package/lib/types/src/internal/transport/service/TransportService.d.ts +9 -0
- package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -0
- package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +19 -0
- package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +15 -16
- package/lib/cjs/src/internal/device-model/data/DeviceModelDataSource.js +0 -2
- package/lib/cjs/src/internal/device-model/data/DeviceModelDataSource.js.map +0 -7
- package/lib/cjs/src/internal/device-model/data/StaticDeviceModelDataSource.js +0 -2
- package/lib/cjs/src/internal/device-model/data/StaticDeviceModelDataSource.js.map +0 -7
- package/lib/cjs/src/internal/device-model/data/StaticDeviceModelDataSource.test.js +0 -2
- package/lib/cjs/src/internal/device-model/data/StaticDeviceModelDataSource.test.js.map +0 -7
- package/lib/cjs/src/internal/device-model/model/DeviceModel.js +0 -2
- package/lib/cjs/src/internal/device-model/model/DeviceModel.js.map +0 -7
- package/lib/cjs/src/internal/device-model/model/DeviceModel.stub.js +0 -2
- package/lib/cjs/src/internal/device-model/model/DeviceModel.stub.js.map +0 -7
- package/lib/cjs/src/internal/device-model/model/DeviceModel.test.js +0 -2
- package/lib/cjs/src/internal/device-model/model/DeviceModel.test.js.map +0 -7
- package/lib/cjs/src/internal/device-session/service/ApduReceiverService.js +0 -2
- package/lib/cjs/src/internal/device-session/service/ApduSenderService.js +0 -2
- package/lib/cjs/src/internal/device-session/service/ApduSenderService.js.map +0 -7
- package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.stub.js +0 -2
- package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.stub.js.map +0 -7
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.stub.js +0 -2
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.stub.js.map +0 -7
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseState.test.js +0 -2
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseState.test.js.map +0 -7
- package/lib/cjs/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.js +0 -2
- package/lib/cjs/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.js.map +0 -7
- package/lib/cjs/src/internal/manager-api/model/ManagerApiType.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/di/bleDiTypes.js +0 -2
- package/lib/cjs/src/internal/transport/ble/di/bleDiTypes.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/di/bleModule.js +0 -2
- package/lib/cjs/src/internal/transport/ble/di/bleModule.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/di/bleModule.test.js +0 -2
- package/lib/cjs/src/internal/transport/ble/di/bleModule.test.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/model/BleDevice.stub.js +0 -2
- package/lib/cjs/src/internal/transport/ble/model/BleDevice.stub.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/model/BleDeviceInfos.js +0 -2
- package/lib/cjs/src/internal/transport/ble/model/BleDeviceInfos.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/service/BleDeviceConnectionFactory.js +0 -2
- package/lib/cjs/src/internal/transport/ble/service/BleDeviceConnectionFactory.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.js +0 -2
- package/lib/cjs/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/transport/BleDeviceConnection.js +0 -2
- package/lib/cjs/src/internal/transport/ble/transport/BleDeviceConnection.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/transport/BleDeviceConnection.test.js +0 -2
- package/lib/cjs/src/internal/transport/ble/transport/BleDeviceConnection.test.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/transport/WebBleTransport.js +0 -2
- package/lib/cjs/src/internal/transport/ble/transport/WebBleTransport.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/transport/WebBleTransport.test.js +0 -2
- package/lib/cjs/src/internal/transport/ble/transport/WebBleTransport.test.js.map +0 -7
- package/lib/cjs/src/internal/transport/ble/transport/__mocks__/WebBleTransport.js +0 -2
- package/lib/cjs/src/internal/transport/ble/transport/__mocks__/WebBleTransport.js.map +0 -7
- package/lib/cjs/src/internal/transport/data/TransportDataSource.js +0 -2
- package/lib/cjs/src/internal/transport/data/TransportDataSource.js.map +0 -7
- package/lib/cjs/src/internal/transport/mockserver/MockserverTransport.js +0 -2
- package/lib/cjs/src/internal/transport/mockserver/MockserverTransport.js.map +0 -7
- package/lib/cjs/src/internal/transport/model/Errors.js +0 -2
- package/lib/cjs/src/internal/transport/model/Errors.js.map +0 -7
- package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.js +0 -2
- package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.js.map +0 -7
- package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.stub.js +0 -2
- package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.stub.js.map +0 -7
- package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.test.js +0 -2
- package/lib/cjs/src/internal/transport/model/InternalConnectedDevice.test.js.map +0 -7
- package/lib/cjs/src/internal/transport/model/InternalDiscoveredDevice.js +0 -2
- package/lib/cjs/src/internal/transport/model/InternalDiscoveredDevice.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/data/UsbHidConfig.js +0 -2
- package/lib/cjs/src/internal/transport/usb/data/UsbHidConfig.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/di/usbDiTypes.js +0 -2
- package/lib/cjs/src/internal/transport/usb/di/usbDiTypes.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/di/usbModule.js +0 -2
- package/lib/cjs/src/internal/transport/usb/di/usbModule.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/di/usbModule.test.js +0 -2
- package/lib/cjs/src/internal/transport/usb/di/usbModule.test.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/model/HIDDevice.stub.js +0 -2
- package/lib/cjs/src/internal/transport/usb/model/HIDDevice.stub.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.js +0 -2
- package/lib/cjs/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.js +0 -2
- package/lib/cjs/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/transport/UsbHidDeviceConnection.js +0 -2
- package/lib/cjs/src/internal/transport/usb/transport/UsbHidDeviceConnection.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.js +0 -2
- package/lib/cjs/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/transport/WebUsbHidTransport.js +0 -2
- package/lib/cjs/src/internal/transport/usb/transport/WebUsbHidTransport.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/transport/WebUsbHidTransport.test.js +0 -2
- package/lib/cjs/src/internal/transport/usb/transport/WebUsbHidTransport.test.js.map +0 -7
- package/lib/cjs/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.js +0 -2
- package/lib/cjs/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.js.map +0 -7
- package/lib/esm/src/internal/device-model/data/StaticDeviceModelDataSource.js +0 -2
- package/lib/esm/src/internal/device-model/data/StaticDeviceModelDataSource.js.map +0 -7
- package/lib/esm/src/internal/device-model/data/StaticDeviceModelDataSource.test.js +0 -2
- package/lib/esm/src/internal/device-model/data/StaticDeviceModelDataSource.test.js.map +0 -7
- package/lib/esm/src/internal/device-model/model/DeviceModel.js +0 -2
- package/lib/esm/src/internal/device-model/model/DeviceModel.js.map +0 -7
- package/lib/esm/src/internal/device-model/model/DeviceModel.stub.js +0 -2
- package/lib/esm/src/internal/device-model/model/DeviceModel.stub.js.map +0 -7
- package/lib/esm/src/internal/device-model/model/DeviceModel.test.js +0 -2
- package/lib/esm/src/internal/device-model/model/DeviceModel.test.js.map +0 -7
- package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.stub.js +0 -2
- package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.stub.js.map +0 -7
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.stub.js +0 -2
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.stub.js.map +0 -7
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseState.test.js +0 -2
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseState.test.js.map +0 -7
- package/lib/esm/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.js.map +0 -7
- package/lib/esm/src/internal/manager-api/model/ManagerApiType.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/di/bleDiTypes.js +0 -2
- package/lib/esm/src/internal/transport/ble/di/bleDiTypes.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/di/bleModule.js +0 -2
- package/lib/esm/src/internal/transport/ble/di/bleModule.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/di/bleModule.test.js +0 -2
- package/lib/esm/src/internal/transport/ble/di/bleModule.test.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/model/BleDevice.stub.js +0 -2
- package/lib/esm/src/internal/transport/ble/model/BleDevice.stub.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/model/BleDeviceInfos.js +0 -2
- package/lib/esm/src/internal/transport/ble/model/BleDeviceInfos.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/service/BleDeviceConnectionFactory.js +0 -2
- package/lib/esm/src/internal/transport/ble/service/BleDeviceConnectionFactory.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.js +0 -2
- package/lib/esm/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/transport/BleDeviceConnection.js +0 -2
- package/lib/esm/src/internal/transport/ble/transport/BleDeviceConnection.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/transport/BleDeviceConnection.test.js +0 -2
- package/lib/esm/src/internal/transport/ble/transport/BleDeviceConnection.test.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/transport/WebBleTransport.js +0 -2
- package/lib/esm/src/internal/transport/ble/transport/WebBleTransport.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/transport/WebBleTransport.test.js +0 -2
- package/lib/esm/src/internal/transport/ble/transport/WebBleTransport.test.js.map +0 -7
- package/lib/esm/src/internal/transport/ble/transport/__mocks__/WebBleTransport.js +0 -2
- package/lib/esm/src/internal/transport/ble/transport/__mocks__/WebBleTransport.js.map +0 -7
- package/lib/esm/src/internal/transport/data/TransportDataSource.js +0 -2
- package/lib/esm/src/internal/transport/data/TransportDataSource.js.map +0 -7
- package/lib/esm/src/internal/transport/mockserver/MockserverTransport.js +0 -2
- package/lib/esm/src/internal/transport/mockserver/MockserverTransport.js.map +0 -7
- package/lib/esm/src/internal/transport/model/Errors.js +0 -2
- package/lib/esm/src/internal/transport/model/Errors.js.map +0 -7
- package/lib/esm/src/internal/transport/model/InternalConnectedDevice.js +0 -2
- package/lib/esm/src/internal/transport/model/InternalConnectedDevice.js.map +0 -7
- package/lib/esm/src/internal/transport/model/InternalConnectedDevice.stub.js +0 -2
- package/lib/esm/src/internal/transport/model/InternalConnectedDevice.stub.js.map +0 -7
- package/lib/esm/src/internal/transport/model/InternalConnectedDevice.test.js +0 -2
- package/lib/esm/src/internal/transport/model/InternalConnectedDevice.test.js.map +0 -7
- package/lib/esm/src/internal/transport/model/InternalDiscoveredDevice.js +0 -1
- package/lib/esm/src/internal/transport/usb/data/UsbHidConfig.js +0 -2
- package/lib/esm/src/internal/transport/usb/data/UsbHidConfig.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/di/usbDiTypes.js +0 -2
- package/lib/esm/src/internal/transport/usb/di/usbDiTypes.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/di/usbModule.js +0 -2
- package/lib/esm/src/internal/transport/usb/di/usbModule.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/di/usbModule.test.js +0 -2
- package/lib/esm/src/internal/transport/usb/di/usbModule.test.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/model/HIDDevice.stub.js +0 -2
- package/lib/esm/src/internal/transport/usb/model/HIDDevice.stub.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.js +0 -2
- package/lib/esm/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.js +0 -2
- package/lib/esm/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/transport/UsbHidDeviceConnection.js +0 -2
- package/lib/esm/src/internal/transport/usb/transport/UsbHidDeviceConnection.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.js +0 -2
- package/lib/esm/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/transport/WebUsbHidTransport.js +0 -2
- package/lib/esm/src/internal/transport/usb/transport/WebUsbHidTransport.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/transport/WebUsbHidTransport.test.js +0 -2
- package/lib/esm/src/internal/transport/usb/transport/WebUsbHidTransport.test.js.map +0 -7
- package/lib/esm/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.js +0 -2
- package/lib/esm/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.js.map +0 -7
- package/lib/types/src/api/logger-subscriber/__mocks__/ConsoleLogger.d.ts.map +0 -1
- package/lib/types/src/internal/device-model/data/DeviceModelDataSource.d.ts +0 -16
- package/lib/types/src/internal/device-model/data/DeviceModelDataSource.d.ts.map +0 -1
- package/lib/types/src/internal/device-model/data/StaticDeviceModelDataSource.d.ts +0 -21
- package/lib/types/src/internal/device-model/data/StaticDeviceModelDataSource.d.ts.map +0 -1
- package/lib/types/src/internal/device-model/data/StaticDeviceModelDataSource.test.d.ts.map +0 -1
- package/lib/types/src/internal/device-model/model/DeviceModel.d.ts.map +0 -1
- package/lib/types/src/internal/device-model/model/DeviceModel.stub.d.ts +0 -3
- package/lib/types/src/internal/device-model/model/DeviceModel.stub.d.ts.map +0 -1
- package/lib/types/src/internal/device-model/model/DeviceModel.test.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/data/FramerConst.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/service/ApduReceiverService.d.ts +0 -7
- package/lib/types/src/internal/device-session/service/ApduReceiverService.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/service/ApduSenderService.d.ts +0 -5
- package/lib/types/src/internal/device-session/service/ApduSenderService.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.stub.d.ts +0 -5
- package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.stub.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/service/DefaultApduSenderService.stub.d.ts +0 -5
- package/lib/types/src/internal/device-session/service/DefaultApduSenderService.stub.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseState.test.d.ts +0 -2
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseState.test.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/utils/FramerUtils.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/utils/FramerUtils.test.d.ts.map +0 -1
- package/lib/types/src/internal/logger-publisher/service/LoggerPublisherService.d.ts.map +0 -1
- package/lib/types/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.d.ts +0 -11
- package/lib/types/src/internal/logger-publisher/service/__mocks__/DefaultLoggerService.d.ts.map +0 -1
- package/lib/types/src/internal/manager-api/model/ManagerApiType.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/di/bleDiTypes.d.ts +0 -4
- package/lib/types/src/internal/transport/ble/di/bleDiTypes.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/di/bleModule.d.ts +0 -3
- package/lib/types/src/internal/transport/ble/di/bleModule.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/di/bleModule.test.d.ts +0 -2
- package/lib/types/src/internal/transport/ble/di/bleModule.test.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/model/BleDevice.stub.d.ts +0 -3
- package/lib/types/src/internal/transport/ble/model/BleDevice.stub.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/model/BleDeviceInfos.d.ts +0 -10
- package/lib/types/src/internal/transport/ble/model/BleDeviceInfos.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/service/BleDeviceConnectionFactory.d.ts +0 -13
- package/lib/types/src/internal/transport/ble/service/BleDeviceConnectionFactory.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.d.ts +0 -3
- package/lib/types/src/internal/transport/ble/service/BleDeviceConnectionFactory.stub.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/transport/BleDeviceConnection.d.ts +0 -104
- package/lib/types/src/internal/transport/ble/transport/BleDeviceConnection.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/transport/BleDeviceConnection.test.d.ts +0 -2
- package/lib/types/src/internal/transport/ble/transport/BleDeviceConnection.test.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/transport/WebBleTransport.d.ts +0 -97
- package/lib/types/src/internal/transport/ble/transport/WebBleTransport.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/transport/WebBleTransport.test.d.ts +0 -2
- package/lib/types/src/internal/transport/ble/transport/WebBleTransport.test.d.ts.map +0 -1
- package/lib/types/src/internal/transport/ble/transport/__mocks__/WebBleTransport.d.ts +0 -14
- package/lib/types/src/internal/transport/ble/transport/__mocks__/WebBleTransport.d.ts.map +0 -1
- package/lib/types/src/internal/transport/data/TransportDataSource.d.ts +0 -8
- package/lib/types/src/internal/transport/data/TransportDataSource.d.ts.map +0 -1
- package/lib/types/src/internal/transport/mockserver/MockserverTransport.d.ts +0 -33
- package/lib/types/src/internal/transport/mockserver/MockserverTransport.d.ts.map +0 -1
- package/lib/types/src/internal/transport/model/DeviceConnection.d.ts.map +0 -1
- package/lib/types/src/internal/transport/model/Errors.d.ts +0 -80
- package/lib/types/src/internal/transport/model/Errors.d.ts.map +0 -1
- package/lib/types/src/internal/transport/model/InternalConnectedDevice.d.ts.map +0 -1
- package/lib/types/src/internal/transport/model/InternalConnectedDevice.stub.d.ts +0 -3
- package/lib/types/src/internal/transport/model/InternalConnectedDevice.stub.d.ts.map +0 -1
- package/lib/types/src/internal/transport/model/InternalConnectedDevice.test.d.ts +0 -2
- package/lib/types/src/internal/transport/model/InternalConnectedDevice.test.d.ts.map +0 -1
- package/lib/types/src/internal/transport/model/InternalDiscoveredDevice.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/data/UsbHidConfig.d.ts +0 -4
- package/lib/types/src/internal/transport/usb/data/UsbHidConfig.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/di/usbDiTypes.d.ts +0 -4
- package/lib/types/src/internal/transport/usb/di/usbDiTypes.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/di/usbModule.d.ts +0 -7
- package/lib/types/src/internal/transport/usb/di/usbModule.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/di/usbModule.test.d.ts +0 -2
- package/lib/types/src/internal/transport/usb/di/usbModule.test.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/model/HIDDevice.stub.d.ts +0 -2
- package/lib/types/src/internal/transport/usb/model/HIDDevice.stub.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.d.ts +0 -20
- package/lib/types/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.d.ts +0 -3
- package/lib/types/src/internal/transport/usb/service/UsbHidDeviceConnectionFactory.stub.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/transport/UsbHidDeviceConnection.d.ts +0 -54
- package/lib/types/src/internal/transport/usb/transport/UsbHidDeviceConnection.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.d.ts +0 -2
- package/lib/types/src/internal/transport/usb/transport/UsbHidDeviceConnection.test.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/transport/WebUsbHidTransport.d.ts +0 -97
- package/lib/types/src/internal/transport/usb/transport/WebUsbHidTransport.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/transport/WebUsbHidTransport.test.d.ts +0 -2
- package/lib/types/src/internal/transport/usb/transport/WebUsbHidTransport.test.d.ts.map +0 -1
- package/lib/types/src/internal/transport/usb/transport/__mocks__/WebUsbHidTransport.d.ts.map +0 -1
- /package/lib/cjs/src/{internal → api}/device-session/data/FramerConst.js +0 -0
- /package/lib/cjs/src/{internal → api}/device-session/utils/FramerUtils.js +0 -0
- /package/lib/cjs/src/{internal → api}/device-session/utils/FramerUtils.test.js +0 -0
- /package/lib/cjs/src/{internal → api}/logger-publisher/service/LoggerPublisherService.js +0 -0
- /package/lib/cjs/src/api/logger-subscriber/{__mocks__ → service/__mocks__}/ConsoleLogger.js +0 -0
- /package/lib/cjs/src/{internal → api}/transport/model/DeviceConnection.js +0 -0
- /package/lib/esm/src/{internal → api}/device-model/data/DeviceModelDataSource.js +0 -0
- /package/lib/esm/src/{internal → api}/device-model/data/DeviceModelDataSource.js.map +0 -0
- /package/lib/esm/src/{internal → api}/device-session/data/FramerConst.js +0 -0
- /package/lib/esm/src/{internal → api}/device-session/service/ApduReceiverService.js +0 -0
- /package/lib/esm/src/{internal → api}/device-session/service/ApduReceiverService.js.map +0 -0
- /package/lib/esm/src/{internal → api}/device-session/service/ApduSenderService.js +0 -0
- /package/lib/esm/src/{internal → api}/device-session/service/ApduSenderService.js.map +0 -0
- /package/lib/esm/src/{internal → api}/device-session/utils/FramerUtils.js +0 -0
- /package/lib/esm/src/{internal → api}/device-session/utils/FramerUtils.test.js +0 -0
- /package/lib/esm/src/{internal → api}/logger-publisher/service/LoggerPublisherService.js +0 -0
- /package/lib/esm/src/{internal → api}/logger-publisher/service/LoggerPublisherService.js.map +0 -0
- /package/lib/esm/src/api/logger-subscriber/{__mocks__ → service/__mocks__}/ConsoleLogger.js +0 -0
- /package/lib/esm/src/{internal → api}/transport/model/DeviceConnection.js +0 -0
- /package/lib/esm/src/{internal → api}/transport/model/DeviceConnection.js.map +0 -0
- /package/lib/esm/src/{internal/transport/model/InternalDiscoveredDevice.js.map → api/transport/model/TransportDiscoveredDevice.js.map} +0 -0
- /package/lib/types/src/{internal → api}/device-model/data/StaticDeviceModelDataSource.test.d.ts +0 -0
- /package/lib/types/src/{internal → api}/device-model/model/DeviceModel.test.d.ts +0 -0
- /package/lib/types/src/{internal → api}/device-session/data/FramerConst.d.ts +0 -0
- /package/lib/types/src/{internal → api}/device-session/utils/FramerUtils.d.ts +0 -0
- /package/lib/types/src/{internal → api}/device-session/utils/FramerUtils.test.d.ts +0 -0
- /package/lib/types/src/api/logger-subscriber/{__mocks__ → service/__mocks__}/ConsoleLogger.d.ts +0 -0
package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.ts"],
|
4
|
-
"sourcesContent": ["import { interval, Observable } from \"rxjs\";\n\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n} from \"@api/command/utils/GlobalCommandError\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport {\n DeviceLockedError,\n DeviceNotOnboardedError,\n UnknownDAError,\n} from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\n\nimport { GetDeviceStatusDeviceAction } from \"./GetDeviceStatusDeviceAction\";\nimport { type GetDeviceStatusDAState } from \"./types\";\n\ndescribe(\"GetDeviceStatusDeviceAction\", () => {\n const getAppAndVersionMock = jest.fn();\n const getDeviceSessionStateMock = jest.fn();\n const waitForDeviceUnlockMock = jest.fn();\n const setDeviceSessionState = jest.fn();\n const isDeviceOnboardedMock = jest.fn();\n\n function extractDependenciesMock() {\n return {\n getAppAndVersion: getAppAndVersionMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n waitForDeviceUnlock: waitForDeviceUnlockMock,\n setDeviceSessionState: setDeviceSessionState,\n isDeviceOnboarded: isDeviceOnboardedMock,\n };\n }\n\n const {\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n getDeviceSessionStateObservable: apiGetDeviceSessionStateObservableMock,\n } = makeDeviceActionInternalApiMock();\n beforeEach(() => {\n jest.resetAllMocks();\n isDeviceOnboardedMock.mockReturnValue(true);\n });\n\n describe(\"without overriding `extractDependencies`\", () => {\n it(\"should run the device action with an unlocked device\", (done) => {\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with a locked device\", (done) => {\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n });\n\n apiGetDeviceSessionStateObservableMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"success cases\", () => {\n it(\"should return the device status if the device is unlocked\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: undefined },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Completed,\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return the device status if the device is locked and the user unlocks the device\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Completed,\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"errors cases\", () => {\n it(\"should end in an error if the device is not onboarded\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n isDeviceOnboardedMock.mockReturnValue(false);\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n error: new DeviceNotOnboardedError(),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should end in an error if the device is locked and the user does not unlock\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n apiGetDeviceSessionStateObservableMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(200).subscribe({\n next: () => {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n });\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error: new DeviceLockedError(\"Device locked.\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should end in an error if the GetAppAndVersion command fails\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n const error = new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5501\"],\n errorCode: \"5501\",\n });\n\n getAppAndVersionMock.mockResolvedValue(CommandResultFactory({ error }));\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error,\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should end in an error if getAppAndVersion actor throws an error\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockImplementation(() => {\n throw new UnknownDAError(\"error\");\n });\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n o.complete();\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error: new UnknownDAError(\"error\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n it(\"should emit a stopped state if the action is cancelled\", (done) => {\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n status: DeviceActionStatus.Pending, // get app and version\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Stopped,\n },\n ];\n\n const { cancel } = testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n cancel();\n });\n});\n"],
|
5
|
-
"mappings": "aAAA,IAAAA,EAAqC,gBAErCC,EAAqC,4CACrCC,EAGO,iDACPC,EAA6B,oCAC7BC,EAAgD,6DAChDC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAIO,wCACPC,EAAuC,kDAEvCC,EAA4C,yCAG5C,SAAS,8BAA+B,IAAM,CAC5C,MAAMC,EAAuB,KAAK,GAAG,EAC/BC,EAA4B,KAAK,GAAG,EACpCC,EAA0B,KAAK,GAAG,EAClCC,EAAwB,KAAK,GAAG,EAChCC,EAAwB,KAAK,GAAG,EAEtC,SAASC,GAA0B,CACjC,MAAO,CACL,iBAAkBL,EAClB,sBAAuBC,EACvB,oBAAqBC,EACrB,sBAAuBC,EACvB,kBAAmBC,CACrB,CACF,CAEA,KAAM,CACJ,YAAaE,EACb,sBAAuBC,EACvB,gCAAiCC,CACnC,KAAI,mCAAgC,EACpC,WAAW,IAAM,CACf,KAAK,cAAc,EACnBJ,EAAsB,gBAAgB,EAAI,CAC5C,CAAC,EAED,SAAS,2CAA4C,IAAM,CACzD,GAAG,uDAAyDK,GAAS,CACnE,MAAMC,EAA6B,IAAI,8BAA4B,CACjE,MAAO,CAAE,cAAe,GAAI,CAC9B,CAAC,EAEDH,EAA6B,gBAAgB,CAC3C,iBAAkB,yBAAuB,UACzC,aAAc,eAAa,
|
6
|
-
"names": ["import_rxjs", "import_CommandResult", "import_GlobalCommandError", "import_DeviceStatus", "import_makeInternalApi", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_DeviceSessionState", "import_GetDeviceStatusDeviceAction", "getAppAndVersionMock", "getDeviceSessionStateMock", "waitForDeviceUnlockMock", "setDeviceSessionState", "isDeviceOnboardedMock", "extractDependenciesMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "done", "getDeviceStateDeviceAction", "expectedStates", "
|
4
|
+
"sourcesContent": ["import { interval, Observable } from \"rxjs\";\n\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n} from \"@api/command/utils/GlobalCommandError\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport {\n DeviceLockedError,\n DeviceNotOnboardedError,\n UnknownDAError,\n} from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\n\nimport { GetDeviceStatusDeviceAction } from \"./GetDeviceStatusDeviceAction\";\nimport { type GetDeviceStatusDAState } from \"./types\";\n\ndescribe(\"GetDeviceStatusDeviceAction\", () => {\n const getAppAndVersionMock = jest.fn();\n const getDeviceSessionStateMock = jest.fn();\n const waitForDeviceUnlockMock = jest.fn();\n const setDeviceSessionState = jest.fn();\n const isDeviceOnboardedMock = jest.fn();\n\n function extractDependenciesMock() {\n return {\n getAppAndVersion: getAppAndVersionMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n waitForDeviceUnlock: waitForDeviceUnlockMock,\n setDeviceSessionState: setDeviceSessionState,\n isDeviceOnboarded: isDeviceOnboardedMock,\n };\n }\n\n const {\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n getDeviceSessionStateObservable: apiGetDeviceSessionStateObservableMock,\n } = makeDeviceActionInternalApiMock();\n beforeEach(() => {\n jest.resetAllMocks();\n isDeviceOnboardedMock.mockReturnValue(true);\n });\n\n describe(\"without overriding `extractDependencies`\", () => {\n it(\"should run the device action with an unlocked device\", (done) => {\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: DeviceModelId.FLEX,\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with a locked device\", (done) => {\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n\n apiGetDeviceSessionStateObservableMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"success cases\", () => {\n it(\"should return the device status if the device is unlocked\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: undefined },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Completed,\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return the device status if the device is locked and the user unlocks the device\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Completed,\n output: {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"errors cases\", () => {\n it(\"should end in an error if the device is not onboarded\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n isDeviceOnboardedMock.mockReturnValue(false);\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n error: new DeviceNotOnboardedError(),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should end in an error if the device is locked and the user does not unlock\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n apiGetDeviceSessionStateObservableMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(200).subscribe({\n next: () => {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error: new DeviceLockedError(\"Device locked.\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should end in an error if the GetAppAndVersion command fails\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n const error = new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5501\"],\n errorCode: \"5501\",\n });\n\n getAppAndVersionMock.mockResolvedValue(CommandResultFactory({ error }));\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n const inner = interval(50).subscribe({\n next: (i) => {\n if (i > 2) {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n o.complete();\n } else {\n o.next({\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n }\n },\n });\n\n return () => {\n inner.unsubscribe();\n };\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error,\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should end in an error if getAppAndVersion actor throws an error\", (done) => {\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.LOCKED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n });\n\n getAppAndVersionMock.mockImplementation(() => {\n throw new UnknownDAError(\"error\");\n });\n\n waitForDeviceUnlockMock.mockImplementation(\n () =>\n new Observable((o) => {\n o.complete();\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(getDeviceStateDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n error: new UnknownDAError(\"error\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n it(\"should emit a stopped state if the action is cancelled\", (done) => {\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"mockedCurrentApp\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.FLEX,\n });\n\n sendCommandMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.0.0\",\n },\n }),\n );\n\n const getDeviceStateDeviceAction = new GetDeviceStatusDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n const expectedStates: Array<GetDeviceStatusDAState> = [\n {\n status: DeviceActionStatus.Pending, // get app and version\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Stopped,\n },\n ];\n\n const { cancel } = testDeviceActionStates(\n getDeviceStateDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n cancel();\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAAqC,gBAErCC,EAAqC,4CACrCC,EAGO,iDACPC,EAA8B,mCAC9BC,EAA6B,oCAC7BC,EAAgD,6DAChDC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAIO,wCACPC,EAAuC,kDAEvCC,EAA4C,yCAG5C,SAAS,8BAA+B,IAAM,CAC5C,MAAMC,EAAuB,KAAK,GAAG,EAC/BC,EAA4B,KAAK,GAAG,EACpCC,EAA0B,KAAK,GAAG,EAClCC,EAAwB,KAAK,GAAG,EAChCC,EAAwB,KAAK,GAAG,EAEtC,SAASC,GAA0B,CACjC,MAAO,CACL,iBAAkBL,EAClB,sBAAuBC,EACvB,oBAAqBC,EACrB,sBAAuBC,EACvB,kBAAmBC,CACrB,CACF,CAEA,KAAM,CACJ,YAAaE,EACb,sBAAuBC,EACvB,gCAAiCC,CACnC,KAAI,mCAAgC,EACpC,WAAW,IAAM,CACf,KAAK,cAAc,EACnBJ,EAAsB,gBAAgB,EAAI,CAC5C,CAAC,EAED,SAAS,2CAA4C,IAAM,CACzD,GAAG,uDAAyDK,GAAS,CACnE,MAAMC,EAA6B,IAAI,8BAA4B,CACjE,MAAO,CAAE,cAAe,GAAI,CAC9B,CAAC,EAEDH,EAA6B,gBAAgB,CAC3C,iBAAkB,yBAAuB,UACzC,aAAc,eAAa,UAC3B,cAAe,gBAAc,IAC/B,CAAC,EAEDD,EAAgB,qBACd,wBAAqB,CACnB,KAAM,CACJ,KAAM,QACN,QAAS,OACX,CACF,CAAC,CACH,EAEA,MAAMK,EAAgD,CACpD,CACE,kBAAmB,CACjB,wBAAyB,0BAAwB,IACnD,EACA,OAAQ,qBAAmB,OAC7B,EACA,CACE,OAAQ,CACN,WAAY,QACZ,kBAAmB,OACrB,EACA,OAAQ,qBAAmB,SAC7B,CACF,KAEA,0BACED,EACAC,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,qBAAmB,KAC7B,CACF,KAEA,0BACED,EACAC,KACA,mCAAgC,EAChCF,CACF,CACF,CAAC,CACH,CAAC,EAED,GAAG,yDAA2DA,GAAS,CACrEF,EAA6B,gBAAgB,CAC3C,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,WAAY,CAAE,KAAM,mBAAoB,QAAS,OAAQ,EACzD,cAAe,CAAC,EAChB,cAAe,gBAAc,IAC/B,CAAC,EAEDD,EAAgB,qBACd,wBAAqB,CACnB,KAAM,CACJ,KAAM,QACN,QAAS,OACX,CACF,CAAC,CACH,EAEA,MAAMI,EAA6B,IAAI,8BAA4B,CACjE,MAAO,CAAE,cAAe,GAAI,CAC9B,CAAC,EAEKC,EAAgD,CACpD,CACE,OAAQ,qBAAmB,QAC3B,kBAAmB,CACjB,wBAAyB,0BAAwB,IACnD,CACF,EACA,CACE,OAAQ,qBAAmB,OAC7B,CACF,EAEM,CAAE,OAAAK,CAAO,KAAI,0BACjBN,EACAC,KACA,mCAAgC,EAChCF,CACF,EACAO,EAAO,CACT,CAAC,CACH,CAAC",
|
6
|
+
"names": ["import_rxjs", "import_CommandResult", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_makeInternalApi", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_DeviceSessionState", "import_GetDeviceStatusDeviceAction", "getAppAndVersionMock", "getDeviceSessionStateMock", "waitForDeviceUnlockMock", "setDeviceSessionState", "isDeviceOnboardedMock", "extractDependenciesMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "done", "getDeviceStateDeviceAction", "expectedStates", "o", "inner", "i", "error", "cancel"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var i=require("../../../command/model/CommandResult"),
|
1
|
+
"use strict";var i=require("../../../command/model/CommandResult"),V=require("../../../command/utils/GlobalCommandError"),S=require("../../../device/DeviceModel"),s=require("../../../device/DeviceStatus"),a=require("../../../device-action/__test-utils__/makeInternalApi"),c=require("../../../device-action/__test-utils__/setupTestMachine"),u=require("../../../device-action/__test-utils__/testDeviceActionStates"),e=require("../../../device-action/model/DeviceActionState"),t=require("../../../device-action/model/UserInteractionRequired"),v=require("../../../device-action/os/Errors"),d=require("../../../device-session/DeviceSessionState"),k=require("../../../../../src"),p=require("./GoToDashboardDeviceAction");jest.mock("@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction");describe("GoToDashboardDeviceAction",()=>{const m=jest.fn(),D=jest.fn(),l=jest.fn(),N=jest.fn();function A(){return{closeApp:m,getAppAndVersion:D,getDeviceSessionState:l,setDeviceSessionState:N}}const{sendCommand:T,getDeviceSessionState:h}=(0,a.makeDeviceActionInternalApiMock)();beforeEach(()=>{jest.resetAllMocks()}),describe("without overriding `extractDependencies`",()=>{it("should run the device action with device already on dashboard",o=>{(0,c.setupGetDeviceStatusMock)();const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});h.mockReturnValue({sessionStateType:d.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"},installedApps:[],deviceModelId:S.DeviceModelId.NANO_X});const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)}),it("should run the device action with device not on dashboard",o=>{(0,c.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});h.mockReturnValue({sessionStateType:d.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:{name:"Bitcoin",version:"1.0.0"},installedApps:[],deviceModelId:S.DeviceModelId.NANO_X}),T.mockResolvedValueOnce((0,i.CommandResultFactory)({data:void 0})).mockResolvedValueOnce((0,i.CommandResultFactory)({data:{name:"BOLOS",version:"1.5.0"}}));const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)})}),describe("success cases",()=>{it("should success if the device is already on dashboard",o=>{(0,c.setupGetDeviceStatusMock)();const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"}}),D.mockReturnValue({app:"BOLOS",version:"1.5.0"}),jest.spyOn(n,"extractDependencies").mockReturnValue(A());const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)}),it("should success if the device is not on dashboard",o=>{(0,c.setupGetDeviceStatusMock)();const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED}),m.mockResolvedValue((0,i.CommandResultFactory)({data:void 0})),D.mockReturnValue((0,i.CommandResultFactory)({data:{name:"BOLOS",version:"1.5.0"}}));const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{output:void 0,status:e.DeviceActionStatus.Completed}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)})}),describe("error cases",()=>{it("should return an error if GetDeviceStatus return an error",o=>{(0,c.setupGetDeviceStatusMock)([new v.UnknownDAError("Unknown error")]);const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});h.mockReturnValue({sessionStateType:d.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:{name:"BOLOS",version:"1.5.0"},installedApps:[],deviceModelId:S.DeviceModelId.NANO_X});const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new v.UnknownDAError("Unknown error")}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)}),describe("not on dashboard",()=>{it("should return an error if closeApp fails",o=>{(0,c.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p.GoToDashboardDeviceAction({input:{}});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:"Bitcoin"}),m.mockReturnValue((0,i.CommandResultFactory)({error:new k.UnknownDeviceExchangeError("Close app failed")}));const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new k.UnknownDeviceExchangeError("Close app failed")}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)}),it("should return an error if getAppAndVersion fails",o=>{(0,c.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}}),r=new V.GlobalCommandError({...V.GLOBAL_ERRORS[5501],errorCode:"5501"});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:"Bitcoin"}),m.mockResolvedValue((0,i.CommandResultFactory)({data:void 0})),D.mockResolvedValue((0,i.CommandResultFactory)({error:r}));const g=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:r}];(0,u.testDeviceActionStates)(n,g,(0,a.makeDeviceActionInternalApiMock)(),o)}),it("should return an error if getAppAndVersion does not return an app name",o=>{(0,c.setupGetDeviceStatusMock)([{currentApp:"Bitcoin",currentAppVersion:"1.0.0"}]);const n=new p.GoToDashboardDeviceAction({input:{unlockTimeout:500}});jest.spyOn(n,"extractDependencies").mockReturnValue(A()),l.mockReturnValue({sessionStateType:d.DeviceSessionStateType.Connected,deviceStatus:s.DeviceStatus.CONNECTED,currentApp:"Bitcoin"}),m.mockResolvedValue((0,i.CommandResultFactory)({data:void 0})),D.mockResolvedValue((0,i.CommandResultFactory)({data:{name:null,version:"1.0.0"}}));const r=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new v.UnknownDAError("currentApp === null")}];(0,u.testDeviceActionStates)(n,r,(0,a.makeDeviceActionInternalApiMock)(),o)})})})});
|
2
2
|
//# sourceMappingURL=GoToDashboardDeviceAction.test.js.map
|
package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.ts"],
|
4
|
-
"sourcesContent": ["import { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n} from \"@api/command/utils/GlobalCommandError\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { setupGetDeviceStatusMock } from \"@api/device-action/__test-utils__/setupTestMachine\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport { UnknownDeviceExchangeError } from \"@root/src\";\n\nimport { GoToDashboardDeviceAction } from \"./GoToDashboardDeviceAction\";\nimport { type GoToDashboardDAState } from \"./types\";\n\njest.mock(\"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\");\n\ndescribe(\"GoToDashboardDeviceAction\", () => {\n const closeAppMock = jest.fn();\n const getAppAndVersionMock = jest.fn();\n const getDeviceSessionStateMock = jest.fn();\n const setDeviceSessionStateMock = jest.fn();\n\n function extractDependenciesMock() {\n return {\n closeApp: closeAppMock,\n getAppAndVersion: getAppAndVersionMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n setDeviceSessionState: setDeviceSessionStateMock,\n };\n }\n\n const {\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n } = makeDeviceActionInternalApiMock();\n\n beforeEach(() => {\n jest.resetAllMocks();\n });\n\n describe(\"without overriding `extractDependencies`\", () => {\n it(\"should run the device action with device already on dashboard\", (done) => {\n setupGetDeviceStatusMock();\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"BOLOS\", version: \"1.5.0\" },\n installedApps: [],\n });\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GetDeviceStatus events (mocked for tests)\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with device not on dashboard\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"Bitcoin\", version: \"1.0.0\" },\n installedApps: [],\n });\n\n sendCommandMock\n .mockResolvedValueOnce(CommandResultFactory({ data: undefined }))\n .mockResolvedValueOnce(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.5.0\",\n },\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"success cases\", () => {\n it(\"should success if the device is already on dashboard\", (done) => {\n setupGetDeviceStatusMock();\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"BOLOS\", version: \"1.5.0\" },\n });\n\n getAppAndVersionMock.mockReturnValue({\n app: \"BOLOS\",\n version: \"1.5.0\",\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should success if the device is not on dashboard\", (done) => {\n setupGetDeviceStatusMock();\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n });\n\n closeAppMock.mockResolvedValue(CommandResultFactory({ data: undefined }));\n getAppAndVersionMock.mockReturnValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.5.0\",\n },\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"error cases\", () => {\n it(\"should return an error if GetDeviceStatus return an error\", (done) => {\n setupGetDeviceStatusMock([new UnknownDAError(\"Unknown error\")]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"BOLOS\", version: \"1.5.0\" },\n installedApps: [],\n });\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"Unknown error\"),\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n describe(\"not on dashboard\", () => {\n it(\"should return an error if closeApp fails\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: {},\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"Bitcoin\",\n });\n\n closeAppMock.mockReturnValue(\n CommandResultFactory({\n error: new UnknownDeviceExchangeError(\"Close app failed\"),\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDeviceExchangeError(\"Close app failed\"),\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return an error if getAppAndVersion fails\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n const error = new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5501\"],\n errorCode: \"5501\",\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"Bitcoin\",\n });\n\n closeAppMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n error,\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return an error if getAppAndVersion does not return an app name\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"Bitcoin\",\n });\n\n closeAppMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: null,\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"currentApp === null\"),\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n });\n});\n"],
|
5
|
-
"mappings": "aAAA,IAAAA,EAAqC,4CACrCC,EAGO,iDACPC,EAA6B,oCAC7BC,EAAgD,6DAChDC,EAAyC,8DACzCC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAuC,kDACvCC,EAA2C,qBAE3CC,EAA0C,uCAG1C,KAAK,KAAK,mEAAmE,EAE7E,SAAS,4BAA6B,IAAM,CAC1C,MAAMC,EAAe,KAAK,GAAG,EACvBC,EAAuB,KAAK,GAAG,EAC/BC,EAA4B,KAAK,GAAG,EACpCC,EAA4B,KAAK,GAAG,EAE1C,SAASC,GAA0B,CACjC,MAAO,CACL,SAAUJ,EACV,iBAAkBC,EAClB,sBAAuBC,EACvB,sBAAuBC,CACzB,CACF,CAEA,KAAM,CACJ,YAAaE,EACb,sBAAuBC,CACzB,KAAI,mCAAgC,EAEpC,WAAW,IAAM,CACf,KAAK,cAAc,CACrB,CAAC,EAED,SAAS,2CAA4C,IAAM,CACzD,GAAG,gEAAkEC,GAAS,IAC5E,4BAAyB,EAEzB,MAAMC,EAA4B,IAAI,4BAA0B,CAC9D,MAAO,CAAE,cAAe,GAAI,CAC9B,CAAC,EAEDF,EAA6B,gBAAgB,CAC3C,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,WAAY,CAAE,KAAM,QAAS,QAAS,OAAQ,EAC9C,cAAe,CAAC,
|
6
|
-
"names": ["import_CommandResult", "import_GlobalCommandError", "import_DeviceStatus", "import_makeInternalApi", "import_setupTestMachine", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_DeviceSessionState", "import_src", "import_GoToDashboardDeviceAction", "closeAppMock", "getAppAndVersionMock", "getDeviceSessionStateMock", "setDeviceSessionStateMock", "extractDependenciesMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "done", "goToDashboardDeviceAction", "expectedStates", "error"]
|
4
|
+
"sourcesContent": ["import { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n} from \"@api/command/utils/GlobalCommandError\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { setupGetDeviceStatusMock } from \"@api/device-action/__test-utils__/setupTestMachine\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport { UnknownDeviceExchangeError } from \"@root/src\";\n\nimport { GoToDashboardDeviceAction } from \"./GoToDashboardDeviceAction\";\nimport { type GoToDashboardDAState } from \"./types\";\n\njest.mock(\"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\");\n\ndescribe(\"GoToDashboardDeviceAction\", () => {\n const closeAppMock = jest.fn();\n const getAppAndVersionMock = jest.fn();\n const getDeviceSessionStateMock = jest.fn();\n const setDeviceSessionStateMock = jest.fn();\n\n function extractDependenciesMock() {\n return {\n closeApp: closeAppMock,\n getAppAndVersion: getAppAndVersionMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n setDeviceSessionState: setDeviceSessionStateMock,\n };\n }\n\n const {\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n } = makeDeviceActionInternalApiMock();\n\n beforeEach(() => {\n jest.resetAllMocks();\n });\n\n describe(\"without overriding `extractDependencies`\", () => {\n it(\"should run the device action with device already on dashboard\", (done) => {\n setupGetDeviceStatusMock();\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"BOLOS\", version: \"1.5.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.NANO_X,\n });\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // GetDeviceStatus events (mocked for tests)\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device action with device not on dashboard\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"Bitcoin\", version: \"1.0.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.NANO_X,\n });\n\n sendCommandMock\n .mockResolvedValueOnce(CommandResultFactory({ data: undefined }))\n .mockResolvedValueOnce(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.5.0\",\n },\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"success cases\", () => {\n it(\"should success if the device is already on dashboard\", (done) => {\n setupGetDeviceStatusMock();\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"BOLOS\", version: \"1.5.0\" },\n });\n\n getAppAndVersionMock.mockReturnValue({\n app: \"BOLOS\",\n version: \"1.5.0\",\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should success if the device is not on dashboard\", (done) => {\n setupGetDeviceStatusMock();\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n });\n\n closeAppMock.mockResolvedValue(CommandResultFactory({ data: undefined }));\n getAppAndVersionMock.mockReturnValue(\n CommandResultFactory({\n data: {\n name: \"BOLOS\",\n version: \"1.5.0\",\n },\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n output: undefined,\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"error cases\", () => {\n it(\"should return an error if GetDeviceStatus return an error\", (done) => {\n setupGetDeviceStatusMock([new UnknownDAError(\"Unknown error\")]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n apiGetDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: { name: \"BOLOS\", version: \"1.5.0\" },\n installedApps: [],\n deviceModelId: DeviceModelId.NANO_X,\n });\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"Unknown error\"),\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n describe(\"not on dashboard\", () => {\n it(\"should return an error if closeApp fails\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: {},\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"Bitcoin\",\n });\n\n closeAppMock.mockReturnValue(\n CommandResultFactory({\n error: new UnknownDeviceExchangeError(\"Close app failed\"),\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDeviceExchangeError(\"Close app failed\"),\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return an error if getAppAndVersion fails\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n const error = new GlobalCommandError({\n ...GLOBAL_ERRORS[\"5501\"],\n errorCode: \"5501\",\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"Bitcoin\",\n });\n\n closeAppMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n error,\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error,\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should return an error if getAppAndVersion does not return an app name\", (done) => {\n setupGetDeviceStatusMock([\n {\n currentApp: \"Bitcoin\",\n currentAppVersion: \"1.0.0\",\n },\n ]);\n\n const goToDashboardDeviceAction = new GoToDashboardDeviceAction({\n input: { unlockTimeout: 500 },\n });\n\n jest\n .spyOn(goToDashboardDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"Bitcoin\",\n });\n\n closeAppMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n getAppAndVersionMock.mockResolvedValue(\n CommandResultFactory({\n data: {\n name: null,\n version: \"1.0.0\",\n },\n }),\n );\n\n const expectedStates: Array<GoToDashboardDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"currentApp === null\"),\n },\n ];\n\n testDeviceActionStates(\n goToDashboardDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAAqC,4CACrCC,EAGO,iDACPC,EAA8B,mCAC9BC,EAA6B,oCAC7BC,EAAgD,6DAChDC,EAAyC,8DACzCC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAuC,kDACvCC,EAA2C,qBAE3CC,EAA0C,uCAG1C,KAAK,KAAK,mEAAmE,EAE7E,SAAS,4BAA6B,IAAM,CAC1C,MAAMC,EAAe,KAAK,GAAG,EACvBC,EAAuB,KAAK,GAAG,EAC/BC,EAA4B,KAAK,GAAG,EACpCC,EAA4B,KAAK,GAAG,EAE1C,SAASC,GAA0B,CACjC,MAAO,CACL,SAAUJ,EACV,iBAAkBC,EAClB,sBAAuBC,EACvB,sBAAuBC,CACzB,CACF,CAEA,KAAM,CACJ,YAAaE,EACb,sBAAuBC,CACzB,KAAI,mCAAgC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C,CACH,CAAC,CACH,CAAC,CACH,CAAC",
|
6
|
+
"names": ["import_CommandResult", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_makeInternalApi", "import_setupTestMachine", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_DeviceSessionState", "import_src", "import_GoToDashboardDeviceAction", "closeAppMock", "getAppAndVersionMock", "getDeviceSessionStateMock", "setDeviceSessionStateMock", "extractDependenciesMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "done", "goToDashboardDeviceAction", "expectedStates", "error"]
|
7
7
|
}
|
package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var A=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var W=(n,e)=>{for(var i in e)A(n,i,{get:e[i],enumerable:!0})},E=(n,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of L(e))!g.call(n,p)&&p!==i&&A(n,p,{get:()=>e[p],enumerable:!(r=v(e,p))||r.enumerable});return n};var f=n=>E(A({},"__esModule",{value:!0}),n);var I={};W(I,{ListAppsWithMetadataDeviceAction:()=>x});module.exports=f(I);var o=require("purify-ts"),a=require("xstate"),u=require("../../../device-action/model/UserInteractionRequired"),
|
1
|
+
"use strict";var A=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var W=(n,e)=>{for(var i in e)A(n,i,{get:e[i],enumerable:!0})},E=(n,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of L(e))!g.call(n,p)&&p!==i&&A(n,p,{get:()=>e[p],enumerable:!(r=v(e,p))||r.enumerable});return n};var f=n=>E(A({},"__esModule",{value:!0}),n);var I={};W(I,{ListAppsWithMetadataDeviceAction:()=>x});module.exports=f(I);var o=require("purify-ts"),a=require("xstate"),u=require("../../../device-action/model/UserInteractionRequired"),S=require("../../../device-action/os/Const"),l=require("../../../device-action/os/ListApps/ListAppsDeviceAction"),d=require("../../../device-action/xstate-utils/XStateDeviceAction");class x extends d.XStateDeviceAction{makeStateMachine(e){const{getAppsByHash:i,saveSessionState:r,getDeviceSessionState:p}=this.extractDependencies(e),h=this.input.unlockTimeout??S.DEFAULT_UNLOCK_TIMEOUT_MS,M=new l.ListAppsDeviceAction({input:{unlockTimeout:h}}).makeStateMachine(e);return(0,a.setup)({types:{input:{unlockTimeout:h},context:{},output:{}},actors:{listApps:M,getAppsByHash:(0,a.fromPromise)(i),saveSessionState:(0,a.fromCallback)(({input:t,sendBack:s})=>{const{appsWithMetadata:y}=t,m=y.filter(c=>c!==null),D={...p(),installedApps:m};try{r(D),s({type:"done"})}catch(c){s({type:"error",error:c})}})},guards:{hasError:({context:t})=>t._internalState.error!==null,hasNoAppsInstalled:({context:t})=>t._internalState.apps.length===0},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:t.event.error})})}}).createMachine({id:"ListAppsWithMetadataDeviceAction",initial:"DeviceReady",context:t=>({input:t.input,_internalState:{error:null,apps:[],appsWithMetadata:[]},intermediateValue:{requiredUserInteraction:u.UserInteractionRequired.None}}),states:{DeviceReady:{always:{target:"ListApps"}},ListApps:{invoke:{id:"listApps",src:"listApps",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>t.event.snapshot.context.intermediateValue})},onDone:{target:"ListAppsCheck",actions:(0,a.assign)({intermediateValue:t=>({requiredUserInteraction:u.UserInteractionRequired.None}),_internalState:t=>t.event.output.caseOf({Right:s=>({...t.context._internalState,apps:s}),Left:s=>({...t.context._internalState,error:s})})})}}},ListAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success",guard:"hasNoAppsInstalled",actions:(0,a.assign)({_internalState:t=>({...t.context._internalState,appsWithMetadata:[]})})},{target:"FetchMetadata"}]},FetchMetadata:{invoke:{id:"getAppsByHash",src:"getAppsByHash",input:t=>t.context._internalState.apps,onDone:{target:"FetchMetadataCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:s=>({...t.context._internalState,appsWithMetadata:s}),Left:s=>({...t.context._internalState,error:s})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},FetchMetadataCheck:{always:[{target:"Error",guard:"hasError"},{target:"SaveSession"}]},SaveSession:{invoke:{src:"saveSessionState",input:t=>({appsWithMetadata:t.context._internalState.appsWithMetadata})},on:{done:{target:"Success"},error:{target:"Error",actions:"assignErrorFromEvent"}}},Success:{type:"final"},Error:{type:"final"}},output:t=>t.context._internalState.error?(0,o.Left)(t.context._internalState.error):(0,o.Right)(t.context._internalState.appsWithMetadata)})}extractDependencies(e){return{getAppsByHash:({input:i})=>e.getManagerApiService().getAppsByHash(i),getDeviceSessionState:()=>e.getDeviceSessionState(),saveSessionState:i=>e.setDeviceSessionState(i)}}}0&&(module.exports={ListAppsWithMetadataDeviceAction});
|
2
2
|
//# sourceMappingURL=ListAppsWithMetadataDeviceAction.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.ts"],
|
4
|
-
"sourcesContent": ["import { type EitherAsync, Left, Right } from \"purify-ts\";\nimport {\n type AnyEventObject,\n assign,\n fromCallback,\n fromPromise,\n setup,\n} from \"xstate\";\n\nimport { type ListAppsResponse } from \"@api/command/os/ListAppsCommand\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nimport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nimport { type ListAppsDAOutput } from \"@api/device-action/os/ListApps/types\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\nimport { type Application } from \"@internal/manager-api/model/ManagerApiType\";\n\nimport {\n type ListAppsWithMetadataDAError,\n type ListAppsWithMetadataDAInput,\n type ListAppsWithMetadataDAIntermediateValue,\n type ListAppsWithMetadataDAOutput,\n} from \"./types\";\n\ntype ListAppsWithMetadataMachineInternalState = {\n error: ListAppsWithMetadataDAError | null;\n apps: ListAppsResponse;\n appsWithMetadata: ListAppsWithMetadataDAOutput;\n};\n\nexport type MachineDependencies = {\n getAppsByHash: ({\n input,\n }: {\n input: ListAppsDAOutput;\n }) => EitherAsync<HttpFetchApiError, Array<Application | null>>;\n getDeviceSessionState: () => DeviceSessionState;\n saveSessionState: (state: DeviceSessionState) => DeviceSessionState;\n};\n\nexport class ListAppsWithMetadataDeviceAction extends XStateDeviceAction<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAInput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue,\n ListAppsWithMetadataMachineInternalState\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAInput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue,\n ListAppsWithMetadataMachineInternalState\n > {\n type types = StateMachineTypes<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAInput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue,\n ListAppsWithMetadataMachineInternalState\n >;\n\n const { getAppsByHash, saveSessionState, getDeviceSessionState } =\n this.extractDependencies(internalAPI);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const listAppsMachine = new ListAppsDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalAPI);\n\n return setup({\n types: {\n input: {\n unlockTimeout,\n } as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n listApps: listAppsMachine,\n getAppsByHash: fromPromise(getAppsByHash),\n saveSessionState: fromCallback(\n ({\n input,\n sendBack,\n }: {\n sendBack: (event: AnyEventObject) => void;\n input: {\n appsWithMetadata: Array<Application | null>;\n };\n }) => {\n const { appsWithMetadata } = input;\n\n const filterted = appsWithMetadata.filter((app) => app !== null);\n\n const sessionState = getDeviceSessionState();\n const updatedState = {\n ...sessionState,\n installedApps: filterted,\n };\n try {\n saveSessionState(updatedState);\n sendBack({ type: \"done\" });\n } catch (error) {\n sendBack({ type: \"error\", error });\n }\n },\n ),\n },\n guards: {\n hasError: ({ context }: { context: types[\"context\"] }) => {\n return context._internalState.error !== null;\n },\n hasNoAppsInstalled: ({ context }: { context: types[\"context\"] }) =>\n context._internalState.apps.length === 0,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QBkCWsAuBBADj2A6qhgBYCyYGAhhFdQCJgBuqAxmFqxqgPYB2AOkYt2AJTA0AngGIA2gAYAuolA4esYrz4qQAD0QBGAJzyBADgBsAdgNWAzPIAs8+TceOANCEmILAJjMBKwsHOyMjAzN7SIBfGK80TFx8IlIKaloGZjYOLi0BROw8WGkIfjABVD4mHgBrCoAbdCL8BWUkEDUNbn4dfQQAVgCBIz9IgacQ6z8-Lx8Ef1N5OwsBlbs7dyNHCziE5uTCYnJKGjoqYRzOHsFCw+kwACdHnkeBHAa6ADNXgFsBJpJYptHRdTS9Dr9IaBUbjSYrKwzOaIMwGAQTFx2MxmOx+AYDKxGAZ7EB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\n id: \"ListAppsWithMetadataDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: _.input,\n _internalState: {\n error: null,\n apps: [],\n appsWithMetadata: [],\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"ListApps\",\n },\n },\n ListApps: {\n invoke: {\n id: \"listApps\",\n src: \"listApps\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n target: \"ListAppsCheck\",\n actions: assign({\n intermediateValue: (_) => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n _internalState: (_) => {\n return _.event.output.caseOf({\n Right: (apps) => ({\n ..._.context._internalState,\n apps,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n },\n },\n },\n ListAppsCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n guard: \"hasNoAppsInstalled\",\n actions: assign({\n _internalState: (_) => {\n return {\n ..._.context._internalState,\n appsWithMetadata: [],\n };\n },\n }),\n },\n {\n target: \"FetchMetadata\",\n },\n ],\n },\n FetchMetadata: {\n invoke: {\n id: \"getAppsByHash\",\n src: \"getAppsByHash\",\n input: (_) => _.context._internalState.apps,\n onDone: {\n target: \"FetchMetadataCheck\",\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf({\n Right: (appsWithMetadata) => ({\n ..._.context._internalState,\n appsWithMetadata,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n FetchMetadataCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"SaveSession\",\n },\n ],\n },\n SaveSession: {\n invoke: {\n src: \"saveSessionState\",\n input: (_) => ({\n appsWithMetadata: _.context._internalState.appsWithMetadata,\n }),\n },\n on: {\n done: {\n target: \"Success\",\n },\n error: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (_) => {\n if (_.context._internalState.error) {\n return Left(_.context._internalState.error);\n }\n\n return Right(_.context._internalState.appsWithMetadata);\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n return {\n getAppsByHash: ({ input }) => internalApi.getMetadataForAppHashes(input),\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n saveSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8C,qBAC9CC,EAMO,kBAIPC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAAqC,+DAGrCC,EAGO,8DA4BA,MAAMP,UAAyC,oBAMpD,CACA,iBACEQ,EAOA,CASA,KAAM,CAAE,cAAAC,EAAe,iBAAAC,EAAkB,sBAAAC,CAAsB,EAC7D,KAAK,oBAAoBH,CAAW,EAEhCI,EAAgB,KAAK,MAAM,eAAiB,4BAE5CC,EAAkB,IAAI,uBAAqB,CAC/C,MAAO,CACL,cAAAD,CACF,CACF,CAAC,EAAE,iBAAiBJ,CAAW,EAE/B,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CACL,cAAAI,CACF,EACA,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,SAAUC,EACV,iBAAe,eAAYJ,CAAa,EACxC,oBAAkB,gBAChB,CAAC,CACC,MAAAK,EACA,SAAAC,CACF,IAKM,CACJ,KAAM,CAAE,iBAAAC,CAAiB,EAAIF,EAEvBG,EAAYD,EAAiB,OAAQE,GAAQA,IAAQ,IAAI,EAGzDC,E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,EACA,cAAe,CACb,OAAQ,CACN,CACE,OAAQ,QACR,MAAO,UACT,EACA,CACE,OAAQ,UACR,MAAO,qBACP,WAAS,UAAO,CACd,eAAiBE,IACR,CACL,GAAGA,EAAE,QAAQ,eACb,iBAAkB,CAAC,CACrB,EAEJ,CAAC,CACH,EACA,CACE,OAAQ,eACV,CACF,CACF,EACA,cAAe,CACb,OAAQ,CACN,GAAI,gBACJ,IAAK,gBACL,MAAQA,GAAMA,EAAE,QAAQ,eAAe,KACvC,OAAQ,CACN,OAAQ,qBACR,WAAS,UAAO,CACd,eAAiBA,GACRA,EAAE,MAAM,OAAO,OAAO,CAC3B,MAAQN,IAAsB,CAC5B,GAAGM,EAAE,QAAQ,eACb,iBAAAN,CACF,GACA,KAAOI,IAAW,CAChB,GAAGE,EAAE,QAAQ,eACb,MAAAF,CACF,EACF,CAAC,CAEL,CAAC,CACH,EACA,QAAS,CACP,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,mBAAoB,CAClB,OAAQ,CACN,CACE,OAAQ,QACR,MAAO,UACT,EACA,CACE,OAAQ,aACV,CACF,CACF,EACA,YAAa,CACX,OAAQ,CACN,IAAK,mBACL,MAAQE,IAAO,CACb,iBAAkBA,EAAE,QAAQ,eAAe,gBAC7C,EACF,EACA,GAAI,CACF,KAAM,CACJ,OAAQ,SACV,EACA,MAAO,CACL,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,QAAS,CACP,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAASA,GACHA,EAAE,QAAQ,eAAe,SACpB,QAAKA,EAAE,QAAQ,eAAe,KAAK,KAGrC,SAAMA,EAAE,QAAQ,eAAe,gBAAgB,CAE1D,CAAC,CACH,CAEA,oBAAoBE,EAA+C,CACjE,MAAO,CACL,cAAe,CAAC,CAAE,MAAAV,CAAM,
|
4
|
+
"sourcesContent": ["import { type EitherAsync, Left, Right } from \"purify-ts\";\nimport {\n type AnyEventObject,\n assign,\n fromCallback,\n fromPromise,\n setup,\n} from \"xstate\";\n\nimport { type ListAppsResponse } from \"@api/command/os/ListAppsCommand\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nimport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nimport { type ListAppsDAOutput } from \"@api/device-action/os/ListApps/types\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\n\nimport {\n type ListAppsWithMetadataDAError,\n type ListAppsWithMetadataDAInput,\n type ListAppsWithMetadataDAIntermediateValue,\n type ListAppsWithMetadataDAOutput,\n} from \"./types\";\n\ntype ListAppsWithMetadataMachineInternalState = {\n error: ListAppsWithMetadataDAError | null;\n apps: ListAppsResponse;\n appsWithMetadata: ListAppsWithMetadataDAOutput;\n};\n\nexport type MachineDependencies = {\n getAppsByHash: ({\n input,\n }: {\n input: ListAppsDAOutput;\n }) => EitherAsync<HttpFetchApiError, Array<Application | null>>;\n getDeviceSessionState: () => DeviceSessionState;\n saveSessionState: (state: DeviceSessionState) => DeviceSessionState;\n};\n\nexport class ListAppsWithMetadataDeviceAction extends XStateDeviceAction<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAInput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue,\n ListAppsWithMetadataMachineInternalState\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAInput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue,\n ListAppsWithMetadataMachineInternalState\n > {\n type types = StateMachineTypes<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAInput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue,\n ListAppsWithMetadataMachineInternalState\n >;\n\n const { getAppsByHash, saveSessionState, getDeviceSessionState } =\n this.extractDependencies(internalAPI);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const listAppsMachine = new ListAppsDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalAPI);\n\n return setup({\n types: {\n input: {\n unlockTimeout,\n } as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n listApps: listAppsMachine,\n getAppsByHash: fromPromise(getAppsByHash),\n saveSessionState: fromCallback(\n ({\n input,\n sendBack,\n }: {\n sendBack: (event: AnyEventObject) => void;\n input: {\n appsWithMetadata: Array<Application | null>;\n };\n }) => {\n const { appsWithMetadata } = input;\n\n const filterted = appsWithMetadata.filter((app) => app !== null);\n\n const sessionState = getDeviceSessionState();\n const updatedState = {\n ...sessionState,\n installedApps: filterted,\n };\n try {\n saveSessionState(updatedState);\n sendBack({ type: \"done\" });\n } catch (error) {\n sendBack({ type: \"error\", error });\n }\n },\n ),\n },\n guards: {\n hasError: ({ context }: { context: types[\"context\"] }) => {\n return context._internalState.error !== null;\n },\n hasNoAppsInstalled: ({ context }: { context: types[\"context\"] }) =>\n context._internalState.apps.length === 0,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QBkCWsAuBBADj2A6qhgBYCyYGAhhFdQCJgBuqAxmFqxqgPYB2AOkYt2AJTA0AngGIA2gAYAuolA4esYrz4qQAD0QBGAJzyB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gMBV8eMYHkqu3U0pIts5OoaHioY093QCEwMNFJV5Gg-NInRHGKoqnNSzR4mqcG8mBFkgiqEhmnVJKhdVndQTlncKxXCsfF829H6HFsEJvSFbD9hrS7rzJ9aBAyly3OG3zadK-nzAGUUzKsQlxQxqaQnq2xt1XNnnBMuxBfFsH8nsgBXVh2GyqXUzxCqBEB7YxlXGLIisV0cy5sLlcR53RUD1aTZugBRV9Hmj+dY+XBPV0XRnU9qyxzGiiqNwmOxgnamIgA */\n id: \"ListAppsWithMetadataDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: _.input,\n _internalState: {\n error: null,\n apps: [],\n appsWithMetadata: [],\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"ListApps\",\n },\n },\n ListApps: {\n invoke: {\n id: \"listApps\",\n src: \"listApps\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n target: \"ListAppsCheck\",\n actions: assign({\n intermediateValue: (_) => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n _internalState: (_) => {\n return _.event.output.caseOf({\n Right: (apps) => ({\n ..._.context._internalState,\n apps,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n },\n },\n },\n ListAppsCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n guard: \"hasNoAppsInstalled\",\n actions: assign({\n _internalState: (_) => {\n return {\n ..._.context._internalState,\n appsWithMetadata: [],\n };\n },\n }),\n },\n {\n target: \"FetchMetadata\",\n },\n ],\n },\n FetchMetadata: {\n invoke: {\n id: \"getAppsByHash\",\n src: \"getAppsByHash\",\n input: (_) => _.context._internalState.apps,\n onDone: {\n target: \"FetchMetadataCheck\",\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf({\n Right: (appsWithMetadata) => ({\n ..._.context._internalState,\n appsWithMetadata,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n FetchMetadataCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"SaveSession\",\n },\n ],\n },\n SaveSession: {\n invoke: {\n src: \"saveSessionState\",\n input: (_) => ({\n appsWithMetadata: _.context._internalState.appsWithMetadata,\n }),\n },\n on: {\n done: {\n target: \"Success\",\n },\n error: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (_) => {\n if (_.context._internalState.error) {\n return Left(_.context._internalState.error);\n }\n\n return Right(_.context._internalState.appsWithMetadata);\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n return {\n getAppsByHash: ({ input }) =>\n internalApi.getManagerApiService().getAppsByHash(input),\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n saveSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8C,qBAC9CC,EAMO,kBAIPC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAAqC,+DAGrCC,EAGO,8DA4BA,MAAMP,UAAyC,oBAMpD,CACA,iBACEQ,EAOA,CASA,KAAM,CAAE,cAAAC,EAAe,iBAAAC,EAAkB,sBAAAC,CAAsB,EAC7D,KAAK,oBAAoBH,CAAW,EAEhCI,EAAgB,KAAK,MAAM,eAAiB,4BAE5CC,EAAkB,IAAI,uBAAqB,CAC/C,MAAO,CACL,cAAAD,CACF,CACF,CAAC,EAAE,iBAAiBJ,CAAW,E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AAM,OACR,CACF,EACA,OAASA,GACHA,EAAE,QAAQ,eAAe,SACpB,QAAKA,EAAE,QAAQ,eAAe,KAAK,KAGrC,SAAMA,EAAE,QAAQ,eAAe,gBAAgB,CAE1D,CAAC,CACH,CAEA,oBAAoBE,EAA+C,CACjE,MAAO,CACL,cAAe,CAAC,CAAE,MAAAV,CAAM,IACtBU,EAAY,qBAAqB,EAAE,cAAcV,CAAK,EACxD,sBAAuB,IAAMU,EAAY,sBAAsB,EAC/D,iBAAmBC,GACjBD,EAAY,sBAAsBC,CAAK,CAC3C,CACF,CACF",
|
6
6
|
"names": ["ListAppsWithMetadataDeviceAction_exports", "__export", "ListAppsWithMetadataDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_UserInteractionRequired", "import_Const", "import_ListAppsDeviceAction", "import_XStateDeviceAction", "internalAPI", "getAppsByHash", "saveSessionState", "getDeviceSessionState", "unlockTimeout", "listAppsMachine", "input", "sendBack", "appsWithMetadata", "filterted", "app", "updatedState", "error", "context", "_", "apps", "internalApi", "state"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var u=require("purify-ts"),S=require("../../../device/DeviceStatus"),i=require("../../../device-action/__test-utils__/data"),r=require("../../../device-action/__test-utils__/makeInternalApi"),o=require("../../../device-action/__test-utils__/setupTestMachine"),p=require("../../../device-action/__test-utils__/testDeviceActionStates"),e=require("../../../device-action/model/DeviceActionState"),t=require("../../../device-action/model/UserInteractionRequired"),A=require("../../../device-action/os/Errors"),g=require("../../../device-session/DeviceSessionState"),v=require("../../../../internal/manager-api/model/Errors"),c=require("./ListAppsWithMetadataDeviceAction");jest.mock("@api/device-action/os/ListApps/ListAppsDeviceAction");describe("ListAppsWithMetadataDeviceAction",()=>{const{getManagerApiService:d}=(0,r.makeDeviceActionInternalApiMock)(),l=jest.fn(),m=jest.fn(),h=jest.fn();function M(){return{getAppsByHash:h,getDeviceSessionState:m,saveSessionState:l}}beforeEach(()=>{jest.resetAllMocks()}),describe("success case",()=>{it("should run the device actions with no apps installed",n=>{(0,o.setupListAppsMock)([]);const s=new c.ListAppsWithMetadataDeviceAction({input:{}});d.mockReturnValue({getAppsByHash:jest.fn().mockResolvedValue((0,u.Right)([]))});const a=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.AllowListApps},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Completed,output:[]}];(0,p.testDeviceActionStates)(s,a,(0,r.makeDeviceActionInternalApiMock)(),n)}),it("should run the device actions with 1 app installed",n=>{(0,o.setupListAppsMock)([i.BTC_APP]);const s=new c.ListAppsWithMetadataDeviceAction({input:{}});d.mockReturnValue({getAppsByHash:jest.fn().mockResolvedValue((0,u.Right)([i.BTC_APP_METADATA]))});const a=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.AllowListApps},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Completed,output:[i.BTC_APP_METADATA]}];(0,p.testDeviceActionStates)(s,a,(0,r.makeDeviceActionInternalApiMock)(),n)}),it("should run the device actions with 2 apps installed",n=>{(0,o.setupListAppsMock)([i.BTC_APP,i.ETH_APP]);const s=new c.ListAppsWithMetadataDeviceAction({input:{}});d.mockReturnValue({getAppsByHash:jest.fn().mockResolvedValue((0,u.Right)([i.BTC_APP_METADATA,i.ETH_APP_METADATA]))});const a=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.AllowListApps},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Completed,output:[i.BTC_APP_METADATA,i.ETH_APP_METADATA]}];(0,p.testDeviceActionStates)(s,a,(0,r.makeDeviceActionInternalApiMock)(),n)}),it("should run the device actions with 1 app installed and a custom lock screen",n=>{(0,o.setupListAppsMock)([i.BTC_APP,i.CUSTOM_LOCK_SCREEN_APP]);const s=new c.ListAppsWithMetadataDeviceAction({input:{}});d.mockReturnValue({getAppsByHash:jest.fn().mockResolvedValue((0,u.Right)([i.BTC_APP_METADATA,i.CUSTOM_LOCK_SCREEN_APP_METADATA]))});const a=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.AllowListApps},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Completed,output:[i.BTC_APP_METADATA,i.CUSTOM_LOCK_SCREEN_APP_METADATA]}];(0,p.testDeviceActionStates)(s,a,(0,r.makeDeviceActionInternalApiMock)(),n)})}),describe("error case",()=>{it("should error when ListApps fails",n=>{(0,o.setupListAppsMock)([],!0);const s=new c.ListAppsWithMetadataDeviceAction({input:{}}),a=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.AllowListApps},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new A.UnknownDAError("ListApps failed")}];(0,p.testDeviceActionStates)(s,a,(0,r.makeDeviceActionInternalApiMock)(),n)}),it("should error when getAppsByHash rejects",n=>{(0,o.setupListAppsMock)([i.BTC_APP]);const s=new c.ListAppsWithMetadataDeviceAction({input:{}});d.mockReturnValue({getAppsByHash:jest.fn().mockRejectedValue(new A.UnknownDAError("getAppsByHash failed"))});const a=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.AllowListApps},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new A.UnknownDAError("getAppsByHash failed")}];(0,p.testDeviceActionStates)(s,a,(0,r.makeDeviceActionInternalApiMock)(),n)}),it("should error when getAppsByHash fails but error is known",n=>{(0,o.setupListAppsMock)([i.BTC_APP]);const s=new c.ListAppsWithMetadataDeviceAction({input:{}}),a=new v.HttpFetchApiError(new Error("Failed to fetch data"));d.mockReturnValue({getAppsByHash:jest.fn().mockResolvedValue((0,u.Left)(a))});const w=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.AllowListApps},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:a}];(0,p.testDeviceActionStates)(s,w,(0,r.makeDeviceActionInternalApiMock)(),n)}),it("should error when SaveSession fails",n=>{(0,o.setupListAppsMock)([i.BTC_APP]);const s=new c.ListAppsWithMetadataDeviceAction({input:{}});h.mockImplementation(async()=>Promise.resolve((0,u.Right)([i.BTC_APP_METADATA]))),jest.spyOn(s,"extractDependencies").mockReturnValue(M()),m.mockReturnValue({sessionStateType:g.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:S.DeviceStatus.CONNECTED,currentApp:"BOLOS",installedApps:[]}),l.mockImplementation(()=>{throw new A.UnknownDAError("SaveSession failed")});const a=[{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.AllowListApps},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{intermediateValue:{requiredUserInteraction:t.UserInteractionRequired.None},status:e.DeviceActionStatus.Pending},{status:e.DeviceActionStatus.Error,error:new A.UnknownDAError("SaveSession failed")}];(0,p.testDeviceActionStates)(s,a,(0,r.makeDeviceActionInternalApiMock)(),n)})})});
|
2
2
|
//# sourceMappingURL=ListAppsWithMetadataDeviceAction.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n BTC_APP,\n BTC_APP_METADATA,\n CUSTOM_LOCK_SCREEN_APP,\n CUSTOM_LOCK_SCREEN_APP_METADATA,\n ETH_APP,\n ETH_APP_METADATA,\n} from \"@api/device-action/__test-utils__/data\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { setupListAppsMock } from \"@api/device-action/__test-utils__/setupTestMachine\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport { HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\n\nimport { ListAppsWithMetadataDeviceAction } from \"./ListAppsWithMetadataDeviceAction\";\nimport { type ListAppsWithMetadataDAState } from \"./types\";\n\njest.mock(\"@api/device-action/os/ListApps/ListAppsDeviceAction\");\n\ndescribe(\"ListAppsWithMetadataDeviceAction\", () => {\n const {\n getMetadataForAppHashes: getMetadataForAppHashesMock,\n // getDeviceSessionState: apiGetDeviceSessionStateMock,\n // setDeviceSessionState: apiSetDeviceSessionStateMock,\n } = makeDeviceActionInternalApiMock();\n\n const saveSessionStateMock = jest.fn();\n const getDeviceSessionStateMock = jest.fn();\n const getAppsByHashMock = jest.fn();\n\n function extractDependenciesMock() {\n return {\n getAppsByHash: getAppsByHashMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n saveSessionState: saveSessionStateMock,\n };\n }\n\n beforeEach(() => {\n jest.resetAllMocks();\n });\n\n describe(\"success case\", () => {\n it(\"should run the device actions with no apps installed\", (done) => {\n setupListAppsMock([]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockResolvedValue(Right([]));\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n status: DeviceActionStatus.Completed,\n output: [],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device actions with 1 app installed\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockResolvedValue(Right([BTC_APP_METADATA]));\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Completed,\n output: [BTC_APP_METADATA],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device actions with 2 apps installed\", (done) => {\n setupListAppsMock([BTC_APP, ETH_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockResolvedValue(\n Right([BTC_APP_METADATA, ETH_APP_METADATA]),\n );\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Completed,\n output: [BTC_APP_METADATA, ETH_APP_METADATA],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device actions with 1 app installed and a custom lock screen\", (done) => {\n setupListAppsMock([BTC_APP, CUSTOM_LOCK_SCREEN_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockResolvedValue(\n Right([BTC_APP_METADATA, CUSTOM_LOCK_SCREEN_APP_METADATA]),\n );\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Completed,\n output: [BTC_APP_METADATA, CUSTOM_LOCK_SCREEN_APP_METADATA],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"error case\", () => {\n it(\"should error when ListApps fails\", (done) => {\n setupListAppsMock([], true);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"ListApps failed\"),\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should error when getAppsByHash rejects\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getMetadataForAppHashesMock.mockRejectedValue(\n new UnknownDAError(\"getAppsByHash failed\"),\n );\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"getAppsByHash failed\"),\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should error when getAppsByHash fails but error is known\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n const error = new HttpFetchApiError(new Error(\"Failed to fetch data\"));\n\n getMetadataForAppHashesMock.mockResolvedValue(Left(error));\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n status: DeviceActionStatus.Error,\n error,\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should error when SaveSession fails\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getAppsByHashMock.mockImplementation(async () =>\n Promise.resolve(Right([BTC_APP_METADATA])),\n );\n\n jest\n .spyOn(listAppsWithMetadataDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"BOLOS\",\n installedApps: [],\n });\n\n saveSessionStateMock.mockImplementation(() => {\n throw new UnknownDAError(\"SaveSession failed\");\n });\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"SaveSession failed\"),\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n});\n"],
|
5
|
-
"mappings": "aAAA,IAAAA,EAA4B,qBAE5BC,EAA6B,oCAC7BC,EAOO,kDACPC,EAAgD,6DAChDC,EAAkC,8DAClCC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAuC,kDACvCD,EAAkC,
|
6
|
-
"names": ["import_purify_ts", "import_DeviceStatus", "import_data", "import_makeInternalApi", "import_setupTestMachine", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_DeviceSessionState", "import_ListAppsWithMetadataDeviceAction", "
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n BTC_APP,\n BTC_APP_METADATA,\n CUSTOM_LOCK_SCREEN_APP,\n CUSTOM_LOCK_SCREEN_APP_METADATA,\n ETH_APP,\n ETH_APP_METADATA,\n} from \"@api/device-action/__test-utils__/data\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { setupListAppsMock } from \"@api/device-action/__test-utils__/setupTestMachine\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport { HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { ListAppsWithMetadataDeviceAction } from \"./ListAppsWithMetadataDeviceAction\";\nimport { type ListAppsWithMetadataDAState } from \"./types\";\n\njest.mock(\"@api/device-action/os/ListApps/ListAppsDeviceAction\");\n\ndescribe(\"ListAppsWithMetadataDeviceAction\", () => {\n const { getManagerApiService: getManagerApiServiceMock } =\n makeDeviceActionInternalApiMock();\n\n const saveSessionStateMock = jest.fn();\n const getDeviceSessionStateMock = jest.fn();\n const getAppsByHashMock = jest.fn();\n\n function extractDependenciesMock() {\n return {\n getAppsByHash: getAppsByHashMock,\n getDeviceSessionState: getDeviceSessionStateMock,\n saveSessionState: saveSessionStateMock,\n };\n }\n\n beforeEach(() => {\n jest.resetAllMocks();\n });\n\n describe(\"success case\", () => {\n it(\"should run the device actions with no apps installed\", (done) => {\n setupListAppsMock([]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getManagerApiServiceMock.mockReturnValue({\n getAppsByHash: jest.fn().mockResolvedValue(Right([])),\n } as unknown as ManagerApiService);\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n status: DeviceActionStatus.Completed,\n output: [],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device actions with 1 app installed\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getManagerApiServiceMock.mockReturnValue({\n getAppsByHash: jest.fn().mockResolvedValue(Right([BTC_APP_METADATA])),\n } as unknown as ManagerApiService);\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Completed,\n output: [BTC_APP_METADATA],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device actions with 2 apps installed\", (done) => {\n setupListAppsMock([BTC_APP, ETH_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getManagerApiServiceMock.mockReturnValue({\n getAppsByHash: jest\n .fn()\n .mockResolvedValue(Right([BTC_APP_METADATA, ETH_APP_METADATA])),\n } as unknown as ManagerApiService);\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Completed,\n output: [BTC_APP_METADATA, ETH_APP_METADATA],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should run the device actions with 1 app installed and a custom lock screen\", (done) => {\n setupListAppsMock([BTC_APP, CUSTOM_LOCK_SCREEN_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getManagerApiServiceMock.mockReturnValue({\n getAppsByHash: jest\n .fn()\n .mockResolvedValue(\n Right([BTC_APP_METADATA, CUSTOM_LOCK_SCREEN_APP_METADATA]),\n ),\n } as unknown as ManagerApiService);\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Completed,\n output: [BTC_APP_METADATA, CUSTOM_LOCK_SCREEN_APP_METADATA],\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n\n describe(\"error case\", () => {\n it(\"should error when ListApps fails\", (done) => {\n setupListAppsMock([], true);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"ListApps failed\"),\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should error when getAppsByHash rejects\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getManagerApiServiceMock.mockReturnValue({\n getAppsByHash: jest\n .fn()\n .mockRejectedValue(new UnknownDAError(\"getAppsByHash failed\")),\n } as unknown as ManagerApiService);\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"getAppsByHash failed\"),\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should error when getAppsByHash fails but error is known\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n const error = new HttpFetchApiError(new Error(\"Failed to fetch data\"));\n\n getManagerApiServiceMock.mockReturnValue({\n getAppsByHash: jest.fn().mockResolvedValue(Left(error)),\n } as unknown as ManagerApiService);\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n status: DeviceActionStatus.Error,\n error,\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n\n it(\"should error when SaveSession fails\", (done) => {\n setupListAppsMock([BTC_APP]);\n const listAppsWithMetadataDeviceAction =\n new ListAppsWithMetadataDeviceAction({\n input: {},\n });\n\n getAppsByHashMock.mockImplementation(async () =>\n Promise.resolve(Right([BTC_APP_METADATA])),\n );\n\n jest\n .spyOn(listAppsWithMetadataDeviceAction, \"extractDependencies\")\n .mockReturnValue(extractDependenciesMock());\n\n getDeviceSessionStateMock.mockReturnValue({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: \"BOLOS\",\n installedApps: [],\n });\n\n saveSessionStateMock.mockImplementation(() => {\n throw new UnknownDAError(\"SaveSession failed\");\n });\n\n const expectedStates: Array<ListAppsWithMetadataDAState> = [\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // Ready\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n },\n status: DeviceActionStatus.Pending, // ListAppsDeviceAction\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // FetchMetadata\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n status: DeviceActionStatus.Pending, // SaveSession\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"SaveSession failed\"),\n },\n ];\n\n testDeviceActionStates(\n listAppsWithMetadataDeviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n done,\n );\n });\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAA4B,qBAE5BC,EAA6B,oCAC7BC,EAOO,kDACPC,EAAgD,6DAChDC,EAAkC,8DAClCC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAuC,kDACvCD,EAAkC,8CAGlCE,EAAiD,8CAGjD,KAAK,KAAK,qDAAqD,EAE/D,SAAS,mCAAoC,IAAM,CACjD,KAAM,CAAE,qBAAsBC,CAAyB,KACrD,mCAAgC,EAE5BC,EAAuB,KAAK,GAAG,EAC/BC,EAA4B,KAAK,GAAG,EACpCC,EAAoB,KAAK,GAAG,EAElC,SAASC,GAA0B,CACjC,MAAO,CACL,cAAeD,EACf,sBAAuBD,EACvB,iBAAkBD,CACpB,CACF,CAEA,WAAW,IAAM,CACf,KAAK,cAAc,CACrB,CAAC,EAED,SAAS,eAAgB,IAAM,CAC7B,GAAG,uDAAyDI,GAAS,IACnE,qBAAkB,CAAC,CAAC,EACpB,MAAMC,EACJ,IAAI,m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OAAQ,qBAAmB,MAC3B,MAAO,IAAI,iBAAe,oBAAoB,CAChD,CACF,KAEA,0BACED,EACAC,KACA,mCAAgC,EAChCF,CACF,CACF,CAAC,CACH,CAAC,CACH,CAAC",
|
6
|
+
"names": ["import_purify_ts", "import_DeviceStatus", "import_data", "import_makeInternalApi", "import_setupTestMachine", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_DeviceSessionState", "import_ListAppsWithMetadataDeviceAction", "getManagerApiServiceMock", "saveSessionStateMock", "getDeviceSessionStateMock", "getAppsByHashMock", "extractDependenciesMock", "done", "listAppsWithMetadataDeviceAction", "expectedStates", "error"]
|
7
7
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/ListAppsWithMetadata/types.ts"],
|
4
|
-
"sourcesContent": ["import { type CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport { type ListAppsErrorCodes } from \"@api/command/os/ListAppsCommand\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { type UnknownDAError } from \"@api/device-action/os/Errors\";\nimport {\n type ListAppsDAError,\n type ListAppsDAInput,\n type ListAppsDAIntermediateValue,\n} from \"@api/device-action/os/ListApps/types\";\nimport { type
|
4
|
+
"sourcesContent": ["import { type CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport { type ListAppsErrorCodes } from \"@api/command/os/ListAppsCommand\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { type UnknownDAError } from \"@api/device-action/os/Errors\";\nimport {\n type ListAppsDAError,\n type ListAppsDAInput,\n type ListAppsDAIntermediateValue,\n} from \"@api/device-action/os/ListApps/types\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\n\nexport type ListAppsWithMetadataDAOutput = Array<Application | null>;\nexport type ListAppsWithMetadataDAInput = ListAppsDAInput;\n\nexport type ListAppsWithMetadataDAError =\n | ListAppsDAError\n | UnknownDAError\n | HttpFetchApiError\n | CommandErrorResult<ListAppsErrorCodes>[\"error\"];\n\nexport type ListAppsWithMetadataDARequiredInteraction =\n UserInteractionRequired.None;\n\nexport type ListAppsWithMetadataDAIntermediateValue =\n | ListAppsDAIntermediateValue\n | {\n requiredUserInteraction: ListAppsWithMetadataDARequiredInteraction;\n };\n\nexport type ListAppsWithMetadataDAState = DeviceActionState<\n ListAppsWithMetadataDAOutput,\n ListAppsWithMetadataDAError,\n ListAppsWithMetadataDAIntermediateValue\n>;\n"],
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
6
6
|
"names": ["types_exports", "__toCommonJS"]
|
7
7
|
}
|