@ledgerhq/device-management-kit 0.0.0-signer-eth-20250122093657 → 0.0.0-try-to-fix-20250429171448
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 +85 -36
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/package.json +12 -11
- 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 +3 -3
- package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
- package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
- package/lib/cjs/src/api/DmkConfig.js +1 -1
- package/lib/cjs/src/api/DmkConfig.js.map +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayParser.test.js.map +2 -2
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
- package/lib/cjs/src/api/command/os/LoadCertificateCommand.js +2 -0
- package/lib/cjs/src/api/command/os/LoadCertificateCommand.js.map +7 -0
- package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js +2 -0
- package/lib/cjs/src/api/command/os/LoadCertificateCommand.test.js.map +7 -0
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js +2 -0
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js.map +7 -0
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.js +2 -0
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.js.map +7 -0
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
- package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
- package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
- package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
- package/lib/cjs/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
- package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.js.map +3 -3
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +3 -3
- package/lib/cjs/src/api/device/SecureElementFlags.js +2 -0
- package/lib/cjs/src/api/device/SecureElementFlags.js.map +7 -0
- package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
- package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +3 -3
- package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +1 -1
- package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +2 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +2 -0
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.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/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +1 -1
- package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
- package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +1 -1
- package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.js +2 -0
- package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.js.map +7 -0
- package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +2 -0
- package/lib/cjs/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +7 -0
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +3 -3
- package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
- package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
- package/lib/cjs/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/constants.js +2 -0
- package/lib/cjs/src/api/secure-channel/constants.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +2 -0
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +2 -0
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +2 -0
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/task/types.js +2 -0
- package/lib/cjs/src/api/secure-channel/task/types.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/types.js +2 -0
- package/lib/cjs/src/api/secure-channel/types.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/utils.js +2 -0
- package/lib/cjs/src/api/secure-channel/utils.js.map +7 -0
- package/lib/cjs/src/api/secure-channel/utils.test.js +2 -0
- package/lib/cjs/src/api/secure-channel/utils.test.js.map +7 -0
- package/lib/cjs/src/api/transport/model/DeviceApduSender.js +2 -0
- package/lib/cjs/src/api/transport/model/DeviceApduSender.js.map +7 -0
- package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionFactory.stub.js.map +2 -2
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
- package/lib/cjs/src/api/transport/model/DiscoveredDevice.js +1 -1
- package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
- package/lib/cjs/src/api/transport/model/Errors.js +1 -1
- package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
- package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js +1 -1
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.stub.js.map +2 -2
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
- package/lib/cjs/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
- package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js +1 -1
- package/lib/cjs/src/api/transport/model/TransportDiscoveredDevice.js.map +1 -1
- package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js +1 -1
- package/lib/cjs/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
- package/lib/cjs/src/api/types.js +1 -1
- package/lib/cjs/src/api/types.js.map +1 -1
- package/lib/cjs/src/api/utils/Base64String.test.js +1 -1
- package/lib/cjs/src/api/utils/Base64String.test.js.map +2 -2
- package/lib/cjs/src/api/utils/HexaString.js +1 -1
- package/lib/cjs/src/api/utils/HexaString.js.map +2 -2
- package/lib/cjs/src/api/utils/HexaString.test.js +1 -1
- package/lib/cjs/src/api/utils/HexaString.test.js.map +2 -2
- package/lib/cjs/src/di.js +1 -1
- package/lib/cjs/src/di.js.map +3 -3
- package/lib/cjs/src/di.stub.js +1 -1
- package/lib/cjs/src/di.stub.js.map +2 -2
- package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js +1 -1
- package/lib/cjs/src/internal/config/data/LocalConfigDataSource.test.js.map +3 -3
- package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js +1 -1
- package/lib/cjs/src/internal/config/data/RemoteConfigDataSource.test.js.map +2 -2
- package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js +1 -1
- package/lib/cjs/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +2 -2
- package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +1 -1
- package/lib/cjs/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +2 -2
- package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js +1 -1
- package/lib/cjs/src/internal/config/service/DefaultConfigService.test.js.map +2 -2
- package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js +1 -1
- package/lib/cjs/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
- package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
- package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
- package/lib/cjs/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
- 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/DevicePinger.js +2 -0
- package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +7 -0
- package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js +2 -0
- package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
- 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/DeviceSessionEventDispatcher.js +2 -0
- package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
- package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
- package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
- package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
- package/lib/cjs/src/internal/device-session/model/Frame.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 +2 -2
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
- package/lib/cjs/src/internal/device-session/service/MutexService.js +2 -0
- package/lib/cjs/src/internal/device-session/service/MutexService.js.map +7 -0
- package/lib/cjs/src/internal/device-session/service/MutexService.test.js +2 -0
- package/lib/cjs/src/internal/device-session/service/MutexService.test.js.map +7 -0
- package/lib/cjs/src/internal/device-session/service/RefresherService.js +2 -0
- package/lib/cjs/src/internal/device-session/service/RefresherService.js.map +7 -0
- package/lib/cjs/src/internal/device-session/service/RefresherService.test.js +2 -0
- package/lib/cjs/src/internal/device-session/service/RefresherService.test.js.map +7 -0
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
- package/lib/cjs/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
- package/lib/cjs/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
- package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
- package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/di/discoveryTypes.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryTypes.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
- package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +2 -2
- 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/service/DefaultLoggerPublisherService.stub.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +2 -2
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.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.js +1 -1
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
- 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/di/managerApiTypes.js +1 -1
- package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
- 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/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 +1 -1
- package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +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/manager-api/use-case/SetProviderUseCase.js +2 -0
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +2 -0
- package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +2 -0
- package/lib/cjs/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/data/SecureChannelDataSource.js +2 -0
- package/lib/cjs/src/internal/secure-channel/data/SecureChannelDataSource.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js +2 -0
- package/lib/cjs/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +2 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +2 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelTypes.js +2 -0
- package/lib/cjs/src/internal/secure-channel/di/secureChannelTypes.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/model/Const.js +2 -0
- package/lib/cjs/src/internal/secure-channel/model/Const.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/model/Errors.js +2 -0
- package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/model/Params.js +2 -0
- package/lib/cjs/src/internal/secure-channel/model/Params.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +2 -0
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +2 -0
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +2 -0
- package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +7 -0
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js +1 -1
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.test.js.map +2 -2
- package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
- package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
- package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
- package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
- package/lib/esm/package.json +12 -11
- 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 +3 -3
- package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
- package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
- package/lib/esm/src/api/DeviceManagementKitBuilder.test.js +1 -1
- package/lib/esm/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.test.js.map +2 -2
- package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
- package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
- package/lib/esm/src/api/command/os/LoadCertificateCommand.js +2 -0
- package/lib/esm/src/api/command/os/LoadCertificateCommand.js.map +7 -0
- package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js +2 -0
- package/lib/esm/src/api/command/os/LoadCertificateCommand.test.js.map +7 -0
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.js +2 -0
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.js.map +7 -0
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.js +2 -0
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.js.map +7 -0
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
- package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
- package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
- package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js +1 -1
- package/lib/esm/src/api/command/use-case/SendCommandUseCase.test.js.map +3 -3
- package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
- package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
- package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +3 -3
- package/lib/esm/src/api/device/SecureElementFlags.js +1 -0
- package/lib/esm/src/api/device/SecureElementFlags.js.map +7 -0
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
- package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/testDeviceActionStates.js.map +3 -3
- package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +1 -1
- package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +2 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +7 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +2 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +7 -0
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
- 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.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.test.js +1 -1
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +1 -1
- package/lib/esm/src/api/device-session/DeviceSessionState.js.map +1 -1
- package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.js +2 -0
- package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.js.map +7 -0
- package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js +2 -0
- package/lib/esm/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.js.map +7 -0
- package/lib/esm/src/api/index.js +1 -1
- package/lib/esm/src/api/index.js.map +3 -3
- package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
- package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
- package/lib/esm/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.js.map +2 -2
- package/lib/esm/src/api/secure-channel/constants.js +2 -0
- package/lib/esm/src/api/secure-channel/constants.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +2 -0
- package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js +2 -0
- package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/types.js +1 -0
- package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/types.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +2 -0
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js +2 -0
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js +1 -0
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/types.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +2 -0
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js +2 -0
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js +2 -0
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +2 -0
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js +2 -0
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js +1 -0
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/types.js.map +7 -0
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +2 -0
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +7 -0
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +2 -0
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +7 -0
- package/lib/esm/src/api/secure-channel/task/types.js +2 -0
- package/lib/esm/src/api/secure-channel/task/types.js.map +7 -0
- package/lib/esm/src/api/secure-channel/types.js +1 -0
- package/lib/esm/src/api/secure-channel/types.js.map +7 -0
- package/lib/esm/src/api/secure-channel/utils.js +2 -0
- package/lib/esm/src/api/secure-channel/utils.js.map +7 -0
- package/lib/esm/src/api/secure-channel/utils.test.js +2 -0
- package/lib/esm/src/api/secure-channel/utils.test.js.map +7 -0
- package/lib/esm/src/api/transport/model/DeviceApduSender.js +1 -0
- package/lib/esm/src/api/transport/model/DeviceApduSender.js.map +7 -0
- package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js +1 -1
- package/lib/esm/src/api/transport/model/DeviceConnectionFactory.stub.js.map +2 -2
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
- package/lib/esm/src/api/transport/model/Errors.js +1 -1
- package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js +1 -1
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.stub.js.map +2 -2
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js +1 -1
- package/lib/esm/src/api/transport/model/TransportConnectedDevice.test.js.map +3 -3
- package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js +1 -1
- package/lib/esm/src/api/transport/model/__mocks__/TransportMock.js.map +2 -2
- package/lib/esm/src/api/utils/Base64String.test.js +1 -1
- package/lib/esm/src/api/utils/Base64String.test.js.map +2 -2
- package/lib/esm/src/api/utils/HexaString.js +1 -1
- package/lib/esm/src/api/utils/HexaString.js.map +2 -2
- package/lib/esm/src/api/utils/HexaString.test.js +1 -1
- package/lib/esm/src/api/utils/HexaString.test.js.map +2 -2
- package/lib/esm/src/di.js +1 -1
- package/lib/esm/src/di.js.map +3 -3
- package/lib/esm/src/di.stub.js +1 -1
- package/lib/esm/src/di.stub.js.map +2 -2
- package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js +1 -1
- package/lib/esm/src/internal/config/data/LocalConfigDataSource.test.js.map +3 -3
- package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js +1 -1
- package/lib/esm/src/internal/config/data/RemoteConfigDataSource.test.js.map +2 -2
- package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js +1 -1
- package/lib/esm/src/internal/config/data/__mocks__/LocalConfigDataSource.js.map +2 -2
- package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js +1 -1
- package/lib/esm/src/internal/config/data/__mocks__/RemoteConfigDataSource.js.map +2 -2
- package/lib/esm/src/internal/config/service/DefaultConfigService.test.js +1 -1
- package/lib/esm/src/internal/config/service/DefaultConfigService.test.js.map +2 -2
- package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js +1 -1
- package/lib/esm/src/internal/config/use-case/GetDmkVersionUseCase.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
- package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
- package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js +1 -1
- package/lib/esm/src/internal/device-session/data/DeviceSessionRefresherConst.js.map +3 -3
- 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/DevicePinger.js +2 -0
- package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +7 -0
- package/lib/esm/src/internal/device-session/model/DevicePinger.test.js +2 -0
- package/lib/esm/src/internal/device-session/model/DevicePinger.test.js.map +7 -0
- 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/DeviceSessionEventDispatcher.js +2 -0
- package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +7 -0
- package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js +2 -0
- package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.test.js.map +7 -0
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +2 -0
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +7 -0
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +2 -0
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +7 -0
- package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
- package/lib/esm/src/internal/device-session/model/Frame.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 +2 -2
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultDeviceSessionService.test.js.map +3 -3
- package/lib/esm/src/internal/device-session/service/MutexService.js +2 -0
- package/lib/esm/src/internal/device-session/service/MutexService.js.map +7 -0
- package/lib/esm/src/internal/device-session/service/MutexService.test.js +2 -0
- package/lib/esm/src/internal/device-session/service/MutexService.test.js.map +7 -0
- package/lib/esm/src/internal/device-session/service/RefresherService.js +2 -0
- package/lib/esm/src/internal/device-session/service/RefresherService.js.map +7 -0
- package/lib/esm/src/internal/device-session/service/RefresherService.test.js +2 -0
- package/lib/esm/src/internal/device-session/service/RefresherService.test.js.map +7 -0
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js +1 -1
- package/lib/esm/src/internal/device-session/use-case/GetDeviceSessionStateUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js +2 -0
- package/lib/esm/src/internal/device-session/utils/deviceSessionUtils.js.map +7 -0
- package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
- package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/di/discoveryTypes.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryTypes.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/GetConnectedDeviceUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListConnectedDevicesUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +2 -0
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +7 -0
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js +2 -0
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.js.map +7 -0
- package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListenToConnectedDeviceUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +2 -2
- 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/service/DefaultLoggerPublisherService.stub.js +1 -1
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.js.map +2 -2
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +2 -2
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
- package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
- 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.js +1 -1
- package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
- 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/di/managerApiTypes.js +1 -1
- package/lib/esm/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
- package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
- 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/Errors.js +1 -1
- package/lib/esm/src/internal/manager-api/model/Errors.js.map +3 -3
- 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/manager-api/use-case/SetProviderUseCase.js +2 -0
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js +2 -0
- package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js +2 -0
- package/lib/esm/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/data/SecureChannelDataSource.js +1 -0
- package/lib/esm/src/internal/secure-channel/data/SecureChannelDataSource.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js +2 -0
- package/lib/esm/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +2 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +2 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelTypes.js +2 -0
- package/lib/esm/src/internal/secure-channel/di/secureChannelTypes.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/model/Const.js +2 -0
- package/lib/esm/src/internal/secure-channel/model/Const.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/model/Errors.js +2 -0
- package/lib/esm/src/internal/secure-channel/model/Errors.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/model/Params.js +1 -0
- package/lib/esm/src/internal/secure-channel/model/Params.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js +2 -0
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +2 -0
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/service/SecureChannelService.js +1 -0
- package/lib/esm/src/internal/secure-channel/service/SecureChannelService.js.map +7 -0
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
- package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
- package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js +1 -1
- package/lib/esm/src/internal/transport/service/DefaultTransportService.test.js.map +2 -2
- package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
- package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
- package/lib/types/src/api/DeviceManagementKit.d.ts +26 -10
- package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
- package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
- package/lib/types/src/api/DmkConfig.d.ts +1 -0
- package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
- package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +8 -2
- package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
- package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts +25 -0
- package/lib/types/src/api/command/os/LoadCertificateCommand.d.ts.map +1 -0
- package/lib/types/src/api/command/os/LoadCertificateCommand.test.d.ts +2 -0
- package/lib/types/src/api/command/os/LoadCertificateCommand.test.d.ts.map +1 -0
- package/lib/types/src/api/command/os/SecureElementFlagsParser.d.ts +43 -0
- package/lib/types/src/api/command/os/SecureElementFlagsParser.d.ts.map +1 -0
- package/lib/types/src/api/command/os/SecureElementFlagsParser.test.d.ts +2 -0
- package/lib/types/src/api/command/os/SecureElementFlagsParser.test.d.ts.map +1 -0
- package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
- package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
- package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
- package/lib/types/src/api/command/utils/CommandUtils.d.ts +1 -0
- package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
- package/lib/types/src/api/device/SecureElementFlags.d.ts +41 -0
- package/lib/types/src/api/device/SecureElementFlags.d.ts.map +1 -0
- package/lib/types/src/api/device-action/DeviceAction.d.ts +7 -1
- package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts +2 -1
- package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +4 -0
- package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts +5 -2
- package/lib/types/src/api/device-action/__test-utils__/testDeviceActionStates.d.ts.map +1 -1
- package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +3 -2
- package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts +40 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +19 -0
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.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-session/DeviceSessionState.d.ts +4 -0
- package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
- package/lib/types/src/api/device-session/use-case/{ToggleDeviceSessionRefresher.d.ts → DisableDeviceSessionRefresher.d.ts} +6 -6
- package/lib/types/src/api/device-session/use-case/DisableDeviceSessionRefresher.d.ts.map +1 -0
- package/lib/types/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.d.ts +2 -0
- package/lib/types/src/api/device-session/use-case/DisableDeviceSessionRefresher.test.d.ts.map +1 -0
- package/lib/types/src/api/index.d.ts +7 -0
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.d.ts +1 -1
- package/lib/types/src/api/logger-subscriber/service/__mocks__/ConsoleLogger.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/constants.d.ts +2 -0
- package/lib/types/src/api/secure-channel/constants.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts +8 -0
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +48 -0
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts +8 -0
- package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +44 -0
- package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts +8 -0
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +57 -0
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts +8 -0
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +41 -0
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +23 -0
- package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.test.d.ts +2 -0
- package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.test.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/task/types.d.ts +105 -0
- package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/types.d.ts +4 -0
- package/lib/types/src/api/secure-channel/types.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/utils.d.ts +30 -0
- package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/utils.test.d.ts +2 -0
- package/lib/types/src/api/secure-channel/utils.test.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/DeviceApduSender.d.ts +17 -0
- package/lib/types/src/api/transport/model/DeviceApduSender.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
- package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionFactory.stub.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +62 -0
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +2 -0
- package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Errors.d.ts +20 -0
- package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Transport.d.ts +2 -2
- package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts +2 -0
- package/lib/types/src/api/transport/model/TransportDiscoveredDevice.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts +7 -7
- package/lib/types/src/api/transport/model/__mocks__/TransportMock.d.ts.map +1 -1
- package/lib/types/src/api/types.d.ts +6 -1
- package/lib/types/src/api/types.d.ts.map +1 -1
- package/lib/types/src/api/utils/HexaString.d.ts +1 -1
- package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
- package/lib/types/src/di.d.ts.map +1 -1
- package/lib/types/src/di.stub.d.ts +1 -1
- package/lib/types/src/di.stub.d.ts.map +1 -1
- package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts +1 -1
- package/lib/types/src/internal/config/data/__mocks__/LocalConfigDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts +3 -3
- package/lib/types/src/internal/config/data/__mocks__/RemoteConfigDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
- package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts +6 -1
- package/lib/types/src/internal/device-session/data/DeviceSessionRefresherConst.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts +1 -1
- package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +18 -0
- package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts +2 -0
- package/lib/types/src/internal/device-session/model/DevicePinger.test.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +29 -12
- 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 +3 -2
- package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts +35 -0
- package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts +2 -0
- package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.test.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts +17 -79
- package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts +20 -0
- package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts +2 -0
- package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.test.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/service/MutexService.d.ts +6 -0
- package/lib/types/src/internal/device-session/service/MutexService.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/service/MutexService.test.d.ts +2 -0
- package/lib/types/src/internal/device-session/service/MutexService.test.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/service/RefresherService.d.ts +15 -0
- package/lib/types/src/internal/device-session/service/RefresherService.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/service/RefresherService.test.d.ts +2 -0
- package/lib/types/src/internal/device-session/service/RefresherService.test.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +3 -1
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts +3 -0
- package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -0
- package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts +1 -1
- package/lib/types/src/internal/discovery/di/discoveryTypes.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts +11 -2
- package/lib/types/src/internal/discovery/use-case/ConnectUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts +24 -0
- package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -0
- package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts +2 -0
- package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.test.d.ts.map +1 -0
- package/lib/types/src/internal/discovery/use-case/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/StartDiscoveringUseCase.d.ts +1 -1
- 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 +1 -1
- package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts +5 -5
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.stub.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +12 -17
- 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 +21 -50
- package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +4 -1
- package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +6 -9
- package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts +1 -0
- package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Application.d.ts +4 -1
- package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Const.d.ts +1 -1
- package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Errors.d.ts +0 -6
- 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 +4 -0
- package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Params.d.ts +19 -68
- package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +7 -7
- 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 +32 -4
- package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +11 -0
- package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -0
- package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts +2 -0
- package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts +18 -0
- package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.d.ts +2 -0
- package/lib/types/src/internal/secure-channel/data/DefaultSecureChannelDataSource.test.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts +52 -0
- package/lib/types/src/internal/secure-channel/data/SecureChannelDataSource.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.d.ts +10 -0
- package/lib/types/src/internal/secure-channel/data/__mocks__/DefaultSecureChannelDataSource.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts +9 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.test.d.ts +2 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.test.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelTypes.d.ts +6 -0
- package/lib/types/src/internal/secure-channel/di/secureChannelTypes.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/model/Const.d.ts +2 -0
- package/lib/types/src/internal/secure-channel/model/Const.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/model/Errors.d.ts +14 -0
- package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/model/Params.d.ts +84 -0
- package/lib/types/src/internal/secure-channel/model/Params.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +21 -0
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.test.d.ts +2 -0
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.test.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +56 -0
- package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts.map +1 -0
- package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +5 -1
- package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts +2 -0
- package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
- package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -1
- package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
- package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +7 -6
- package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js +0 -2
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js.map +0 -7
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +0 -2
- package/lib/cjs/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +0 -7
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
- package/lib/cjs/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js +0 -2
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.js.map +0 -7
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js +0 -2
- package/lib/esm/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.js.map +0 -7
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js +0 -2
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.js.map +0 -7
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js +0 -2
- package/lib/esm/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.js.map +0 -7
- package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.d.ts.map +0 -1
- package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.d.ts +0 -2
- package/lib/types/src/api/device-session/use-case/ToggleDeviceSessionRefresher.test.d.ts.map +0 -1
- package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts +0 -13
- package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.d.ts.map +0 -1
- package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts +0 -2
- package/lib/types/src/internal/discovery/use-case/ListenToKnownDevicesUseCase.test.d.ts.map +0 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/command/utils/CommandUtils.test.ts"],
|
4
|
-
"sourcesContent": ["import { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { CommandUtils } from \"./CommandUtils\";\n\ndescribe(\"CommandUtils\", () => {\n describe(\"static isSuccessResponse\", () => {\n it(\"should return true if the status code is 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isValidStatusCode\", () => {\n it(\"should return true if the status code is 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90, 0x00]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(true);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(false);\n });\n });\n\n describe(\"static isLockedDeviceResponse\", () => {\n it(\"should return true if the status code is 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n });\n});\n"],
|
5
|
-
"mappings": "AAAA,OAAS,
|
6
|
-
"names": ["ApduResponse", "CommandUtils", "response", "statusCode"]
|
4
|
+
"sourcesContent": ["import { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nimport { GetAppAndVersionCommand } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { OpenAppCommand } from \"@api/command/os/OpenAppCommand\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { CommandUtils } from \"./CommandUtils\";\n\ndescribe(\"CommandUtils\", () => {\n describe(\"static isSuccessResponse\", () => {\n it(\"should return true if the status code is 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isValidStatusCode\", () => {\n it(\"should return true if the status code is 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90, 0x00]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(true);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(false);\n });\n });\n\n describe(\"static isLockedDeviceResponse\", () => {\n it(\"should return true if the status code is 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isApduThatTriggersDisconnection\", () => {\n it(\"should return true if the APDU is openApp\", () => {\n const apdu = new OpenAppCommand({ appName: \"test\" })\n .getApdu()\n .getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(true);\n });\n\n it(\"should return true if the APDU is closeApp\", () => {\n const apdu = new CloseAppCommand().getApdu().getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(true);\n });\n\n it(\"should return false if the APDU is not a known one\", () => {\n const apdu = new GetAppAndVersionCommand().getApdu().getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(false);\n });\n });\n});\n"],
|
5
|
+
"mappings": "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",
|
6
|
+
"names": ["CloseAppCommand", "GetAppAndVersionCommand", "OpenAppCommand", "ApduResponse", "CommandUtils", "response", "statusCode", "apdu"]
|
7
7
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
//# sourceMappingURL=SecureElementFlags.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
const e=
|
1
|
+
const e=vi.fn(),n=vi.fn(),t=vi.fn(),i=vi.fn(),c=vi.fn(),o=vi.fn(),s=vi.fn(),a=vi.fn();function r(){return{sendApdu:e,sendCommand:n,getDeviceSessionState:t,getDeviceSessionStateObservable:i,setDeviceSessionState:c,getManagerApiService:o,getSecureChannelService:s,disableRefresher:a}}export{r as makeDeviceActionInternalApiMock};
|
2
2
|
//# sourceMappingURL=makeInternalApi.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/__test-utils__/makeInternalApi.ts"],
|
4
|
-
"sourcesContent": ["import { type InternalApi } from \"@api/device-action/DeviceAction\";\n\nconst sendCommandMock =
|
5
|
-
"mappings": "
|
6
|
-
"names": ["sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "makeDeviceActionInternalApiMock"]
|
4
|
+
"sourcesContent": ["import { type Mocked } from \"vitest\";\n\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\n\nconst sendApduMock = vi.fn();\nconst sendCommandMock = vi.fn();\nconst apiGetDeviceSessionStateMock = vi.fn();\nconst apiGetDeviceSessionStateObservableMock = vi.fn();\nconst setDeviceSessionStateMock = vi.fn();\nconst getManagerApiServiceMock = vi.fn();\nconst getSecureChannelServiceMock = vi.fn();\nconst disableRefresherMock = vi.fn();\n\nexport function makeDeviceActionInternalApiMock(): Mocked<InternalApi> {\n return {\n sendApdu: sendApduMock,\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n getDeviceSessionStateObservable: apiGetDeviceSessionStateObservableMock,\n setDeviceSessionState: setDeviceSessionStateMock,\n getManagerApiService: getManagerApiServiceMock,\n getSecureChannelService: getSecureChannelServiceMock,\n disableRefresher: disableRefresherMock,\n };\n}\n"],
|
5
|
+
"mappings": "AAIA,MAAMA,EAAe,GAAG,GAAG,EACrBC,EAAkB,GAAG,GAAG,EACxBC,EAA+B,GAAG,GAAG,EACrCC,EAAyC,GAAG,GAAG,EAC/CC,EAA4B,GAAG,GAAG,EAClCC,EAA2B,GAAG,GAAG,EACjCC,EAA8B,GAAG,GAAG,EACpCC,EAAuB,GAAG,GAAG,EAE5B,SAASC,GAAuD,CACrE,MAAO,CACL,SAAUR,EACV,YAAaC,EACb,sBAAuBC,EACvB,gCAAiCC,EACjC,sBAAuBC,EACvB,qBAAsBC,EACtB,wBAAyBC,EACzB,iBAAkBC,CACpB,CACF",
|
6
|
+
"names": ["sendApduMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "getSecureChannelServiceMock", "disableRefresherMock", "makeDeviceActionInternalApiMock"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{Left as
|
1
|
+
import{Left as i,Right as n}from"purify-ts";import{assign as r,createMachine as a}from"xstate";import{UserInteractionRequired as p}from"../../device-action/model/UserInteractionRequired";import{UnknownDAError as c}from"../../device-action/os/Errors";import{GetDeviceStatusDeviceAction as m}from"../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as s}from"../../device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{ListAppsDeviceAction as d}from"../../device-action/os/ListApps/ListAppsDeviceAction";import{ListInstalledAppsDeviceAction as l}from"../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";const v=(e,o=!1)=>{d.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>a({id:"MockListAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:r({intermediateValue:()=>({requiredUserInteraction:p.AllowListApps})})},done:{type:"final"}},output:()=>o?i(new c("ListApps failed")):n(e)}))}))},h=(e=!1)=>{s.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>a({id:"MockGoToDashboardDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:r({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:()=>e?i(new c("GoToDashboard failed")):n(void 0)}))}))},L=(e=[{currentApp:"BOLOS",currentAppVersion:"1.0.0"}])=>{const o=vi.fn();for(const t of e)o.mockImplementationOnce(()=>"currentApp"in t?n(t):i(t));m.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>a({id:"MockGetDeviceStatusDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:r({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:o}))}))},S=(e=[])=>{l.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>a({id:"MockListInstalledAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:r({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:e.reduce((o,t)=>o.mockImplementationOnce(()=>"installedApps"in t?n(t):i(t)),vi.fn()).mockImplementation(()=>n([]))}))}))};export{L as setupGetDeviceStatusMock,h as setupGoToDashboardMock,v as setupListAppsMock,S as setupListInstalledAppsMock};
|
2
2
|
//# sourceMappingURL=setupTestMachine.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/__test-utils__/setupTestMachine.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nimport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nimport { type DmkError } from \"@api/Error\";\n\nimport { type BTC_APP } from \"./data\";\n\ntype App = typeof BTC_APP;\n\nexport const setupListAppsMock = (apps: App[], error = false) => {\n (ListAppsDeviceAction as
|
5
|
-
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,
|
6
|
-
"names": ["Left", "Right", "assign", "createMachine", "UserInteractionRequired", "UnknownDAError", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "ListAppsDeviceAction", "setupListAppsMock", "apps", "error", "setupGoToDashboardMock", "setupGetDeviceStatusMock", "outputs", "outputFn", "output"]
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nimport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nimport { type DmkError } from \"@api/Error\";\nimport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nimport { type InstalledApp } from \"@api/secure-channel/device-action/ListInstalledApps/types\";\n\nimport { type BTC_APP } from \"./data\";\n\ntype App = typeof BTC_APP;\n\nexport const setupListAppsMock = (apps: App[], error = false) => {\n (ListAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockListAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"ListApps failed\"))\n : Right(apps);\n },\n }),\n ),\n }));\n};\n\nexport const setupGoToDashboardMock = (error: boolean = false) => {\n (GoToDashboardDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGoToDashboardDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"GoToDashboard failed\"))\n : Right(undefined);\n },\n }),\n ),\n }));\n};\n\nexport const setupGetDeviceStatusMock = (\n outputs: ReadonlyArray<\n { currentApp: string; currentAppVersion: string } | DmkError\n > = [\n {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n ],\n) => {\n const outputFn = vi.fn();\n\n for (const output of outputs) {\n outputFn.mockImplementationOnce(() =>\n \"currentApp\" in output ? Right(output) : Left(output),\n );\n }\n (GetDeviceStatusDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGetDeviceStatusDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: outputFn,\n }),\n ),\n }));\n};\n\nexport const setupListInstalledAppsMock = (\n outputs: Array<{ installedApps: InstalledApp[] } | DmkError> = [],\n) => {\n (ListInstalledAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockListInstalledAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: outputs\n .reduce(\n (mockFn, output) =>\n mockFn.mockImplementationOnce(() =>\n \"installedApps\" in output ? Right(output) : Left(output),\n ),\n vi.fn(),\n )\n .mockImplementation(() => Right([])),\n }),\n ),\n }));\n};\n"],
|
5
|
+
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAE5B,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,SAEtC,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,+BAAAC,MAAmC,oEAC5C,OAAS,6BAAAC,MAAiC,gEAC1C,OAAS,wBAAAC,MAA4B,sDAErC,OAAS,iCAAAC,MAAqC,oFAOvC,MAAMC,EAAoB,CAACC,EAAaC,EAAQ,KAAU,CAC9DJ,EAA8B,mBAAmB,KAAO,CACvD,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,IAC3CL,EAAc,CACZ,GAAI,2BACJ,QAAS,QACT,OAAQ,CACN,MAAO,CACL,MAAO,CACL,EAAG,MACL,EACA,MAAOD,EAAO,CACZ,kBAAmB,KAAO,CACxB,wBAAyBE,EAAwB,aACnD,EACF,CAAC,CACH,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQ,IACCQ,EACHZ,EAAK,IAAIK,EAAe,iBAAiB,CAAC,EAC1CJ,EAAMU,CAAI,CAElB,CAAC,CACH,CACF,EAAE,CACJ,EAEaE,EAAyB,CAACD,EAAiB,KAAU,CAC/DL,EAAmC,mBAAmB,KAAO,CAC5D,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,IAC3CJ,EAAc,CACZ,GAAI,gCACJ,QAAS,QACT,OAAQ,CACN,MAAO,CACL,MAAO,CACL,EAAG,MACL,EACA,MAAOD,EAAO,CACZ,kBAAmB,KAAO,CACxB,wBAAyBE,EAAwB,IACnD,EACF,CAAC,CACH,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQ,IACCQ,EACHZ,EAAK,IAAIK,EAAe,sBAAsB,CAAC,EAC/CJ,EAAM,MAAS,CAEvB,CAAC,CACH,CACF,EAAE,CACJ,EAEaa,EAA2B,CACtCC,EAEI,CACF,CACE,WAAY,QACZ,kBAAmB,OACrB,CACF,IACG,CACH,MAAMC,EAAW,GAAG,GAAG,EAEvB,UAAWC,KAAUF,EACnBC,EAAS,uBAAuB,IAC9B,eAAgBC,EAAShB,EAAMgB,CAAM,EAAIjB,EAAKiB,CAAM,CACtD,EAEDX,EAAqC,mBAAmB,KAAO,CAC9D,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,IAC3CH,EAAc,CACZ,GAAI,kCACJ,QAAS,QACT,OAAQ,CACN,MAAO,CACL,MAAO,CACL,EAAG,MACL,EACA,MAAOD,EAAO,CACZ,kBAAmB,KAAO,CACxB,wBAAyBE,EAAwB,IACnD,EACF,CAAC,CACH,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQY,CACV,CAAC,CACH,CACF,EAAE,CACJ,EAEaE,EAA6B,CACxCH,EAA+D,CAAC,IAC7D,CACFN,EAAuC,mBAAmB,KAAO,CAChE,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,IAC3CN,EAAc,CACZ,GAAI,oCACJ,QAAS,QACT,OAAQ,CACN,MAAO,CACL,MAAO,CACL,EAAG,MACL,EACA,MAAOD,EAAO,CACZ,kBAAmB,KAAO,CACxB,wBAAyBE,EAAwB,IACnD,EACF,CAAC,CACH,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQW,EACL,OACC,CAACI,EAAQF,IACPE,EAAO,uBAAuB,IAC5B,kBAAmBF,EAAShB,EAAMgB,CAAM,EAAIjB,EAAKiB,CAAM,CACzD,EACF,GAAG,GAAG,CACR,EACC,mBAAmB,IAAMhB,EAAM,CAAC,CAAC,CAAC,CACvC,CAAC,CACH,CACF,EAAE,CACJ",
|
6
|
+
"names": ["Left", "Right", "assign", "createMachine", "UserInteractionRequired", "UnknownDAError", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "ListAppsDeviceAction", "ListInstalledAppsDeviceAction", "setupListAppsMock", "apps", "error", "setupGoToDashboardMock", "setupGetDeviceStatusMock", "outputs", "outputFn", "output", "setupListInstalledAppsMock", "mockFn"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function
|
1
|
+
function p(i,n,c,{onDone:a,onError:t}){const r=[],{observable:o,cancel:u}=i._execute(c);return o.subscribe({next:e=>{r.push(e)},error:e=>{t(e)},complete:()=>{try{expect(r).toEqual(n),a()}catch(e){t(e)}}}),{observable:o,cancel:u}}export{p as testDeviceActionStates};
|
2
2
|
//# sourceMappingURL=testDeviceActionStates.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/__test-utils__/testDeviceActionStates.ts"],
|
4
|
-
"sourcesContent": ["import {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type InternalApi,\n} from \"@api/device-action/DeviceAction\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type DmkError } from \"@api/Error\";\n\n/**\n * Test that the states emitted by a device action match the expected states.\n * @param deviceAction The device action to test.\n * @param expectedStates The expected states.\n * @param internalApi\n * @param
|
5
|
-
"mappings": "AAeO,SAASA,EAMdC,EACAC,EACAC,
|
6
|
-
"names": ["testDeviceActionStates", "deviceAction", "expectedStates", "internalApi", "
|
4
|
+
"sourcesContent": ["import {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type InternalApi,\n} from \"@api/device-action/DeviceAction\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type DmkError } from \"@api/Error\";\n\n/**\n * Test that the states emitted by a device action match the expected states.\n * @param deviceAction The device action to test.\n * @param expectedStates The expected states.\n * @param internalApi\n * @param callbacks { onDone, onError } The callbacks to call when the test is done or an error occurs.\n */\nexport function testDeviceActionStates<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n>(\n deviceAction: DeviceAction<Output, Input, Error, IntermediateValue>,\n expectedStates: Array<DeviceActionState<Output, Error, IntermediateValue>>,\n internalApi: InternalApi,\n {\n onDone,\n onError,\n }: {\n onDone: () => void;\n onError: (error: Error) => void;\n },\n) {\n const observedStates: Array<\n DeviceActionState<Output, Error, IntermediateValue>\n > = [];\n\n const { observable, cancel } = deviceAction._execute(internalApi);\n\n observable.subscribe({\n next: (state) => {\n observedStates.push(state);\n },\n error: (error) => {\n onError(error);\n },\n complete: () => {\n try {\n expect(observedStates).toEqual(expectedStates);\n onDone();\n } catch (e) {\n onError(e as Error);\n }\n },\n });\n\n return { observable, cancel };\n}\n"],
|
5
|
+
"mappings": "AAeO,SAASA,EAMdC,EACAC,EACAC,EACA,CACE,OAAAC,EACA,QAAAC,CACF,EAIA,CACA,MAAMC,EAEF,CAAC,EAEC,CAAE,WAAAC,EAAY,OAAAC,CAAO,EAAIP,EAAa,SAASE,CAAW,EAEhE,OAAAI,EAAW,UAAU,CACnB,KAAOE,GAAU,CACfH,EAAe,KAAKG,CAAK,CAC3B,EACA,MAAQC,GAAU,CAChBL,EAAQK,CAAK,CACf,EACA,SAAU,IAAM,CACd,GAAI,CACF,OAAOJ,CAAc,EAAE,QAAQJ,CAAc,EAC7CE,EAAO,CACT,OAAS,EAAG,CACVC,EAAQ,CAAU,CACpB,CACF,CACF,CAAC,EAEM,CAAE,WAAAE,EAAY,OAAAC,CAAO,CAC9B",
|
6
|
+
"names": ["testDeviceActionStates", "deviceAction", "expectedStates", "internalApi", "onDone", "onError", "observedStates", "observable", "cancel", "state", "error"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
var l=(p=>(p.None="none",p.UnlockDevice="unlock-device",p.AllowSecureConnection="allow-secure-connection",p.ConfirmOpenApp="confirm-open-app",p.SignTransaction="sign-transaction",p.SignTypedData="sign-typed-data",p.AllowListApps="allow-list-apps",p.VerifyAddress="verify-address",p.SignPersonalMessage="sign-personal-message",p))(l||{});export{l as UserInteractionRequired};
|
1
|
+
var l=(p=>(p.None="none",p.UnlockDevice="unlock-device",p.AllowSecureConnection="allow-secure-connection",p.ConfirmOpenApp="confirm-open-app",p.SignTransaction="sign-transaction",p.SignTypedData="sign-typed-data",p.AllowListApps="allow-list-apps",p.VerifyAddress="verify-address",p.SignPersonalMessage="sign-personal-message",p.Web3ChecksOptIn="web3-checks-opt-in",p))(l||{});export{l as UserInteractionRequired};
|
2
2
|
//# sourceMappingURL=UserInteractionRequired.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/model/UserInteractionRequired.ts"],
|
4
|
-
"sourcesContent": ["/**\n * The user interaction required on the device to move further in a device action.\n * This is used to inform the
|
5
|
-
"mappings": "AAIO,IAAKA,OACVA,EAAA,KAAO,OACPA,EAAA,aAAe,gBACfA,EAAA,sBAAwB,0BACxBA,EAAA,eAAiB,mBACjBA,EAAA,gBAAkB,mBAClBA,EAAA,cAAgB,kBAChBA,EAAA,cAAgB,kBAChBA,EAAA,cAAgB,iBAChBA,EAAA,oBAAsB,
|
4
|
+
"sourcesContent": ["/**\n * The user interaction required on the device to move further in a device action.\n * This is used to inform the users about the action they need to take on the device.\n */\nexport enum UserInteractionRequired {\n None = \"none\",\n UnlockDevice = \"unlock-device\",\n AllowSecureConnection = \"allow-secure-connection\",\n ConfirmOpenApp = \"confirm-open-app\",\n SignTransaction = \"sign-transaction\",\n SignTypedData = \"sign-typed-data\",\n AllowListApps = \"allow-list-apps\",\n VerifyAddress = \"verify-address\",\n SignPersonalMessage = \"sign-personal-message\",\n Web3ChecksOptIn = \"web3-checks-opt-in\",\n}\n"],
|
5
|
+
"mappings": "AAIO,IAAKA,OACVA,EAAA,KAAO,OACPA,EAAA,aAAe,gBACfA,EAAA,sBAAwB,0BACxBA,EAAA,eAAiB,mBACjBA,EAAA,gBAAkB,mBAClBA,EAAA,cAAgB,kBAChBA,EAAA,cAAgB,kBAChBA,EAAA,cAAgB,iBAChBA,EAAA,oBAAsB,wBACtBA,EAAA,gBAAkB,qBAVRA,OAAA",
|
6
6
|
"names": ["UserInteractionRequired"]
|
7
7
|
}
|
package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js
ADDED
@@ -0,0 +1,2 @@
|
|
1
|
+
import{Left as p,Right as o}from"purify-ts";import{assign as t,fromPromise as i,setup as l}from"xstate";import{isSuccessCommandResult as c}from"../../../command/model/CommandResult";import{UserInteractionRequired as s}from"../../../device-action/model/UserInteractionRequired";import{UnknownDAError as u}from"../../../device-action/os/Errors";import{OpenAppDeviceAction as k}from"../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{XStateDeviceAction as A}from"../../../device-action/xstate-utils/XStateDeviceAction";class R extends A{makeStateMachine(a){const{callTask:r}=this.extractDependencies(a);return l({types:{input:{},context:{},output:{}},actors:{callTask:i(r),openAppStateMachine:new k({input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames}}).makeStateMachine(a)},guards:{noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:t({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"CallTaskInAppDeviceAction",initial:"OpenAppDeviceAction",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:s.None},_internalState:{taskResponse:null,error:null}}),states:{OpenAppDeviceAction:{invoke:{id:"openAppStateMachine",input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames},src:"openAppStateMachine",onSnapshot:{actions:t({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{actions:t({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:n=>({...e.context._internalState,error:n})})}),target:"CheckOpenAppDeviceActionResult"}}},CheckOpenAppDeviceActionResult:{always:[{target:"CallTask",guard:"noInternalError"},"Error"]},CallTask:{entry:t({intermediateValue:{requiredUserInteraction:this.input.requiredUserInteraction}}),exit:t({intermediateValue:{requiredUserInteraction:s.None}}),invoke:{id:"callTask",src:"callTask",input:e=>e.context.input.task,onDone:{target:"CallTaskResultCheck",actions:[t({_internalState:({event:e,context:n})=>c(e.output)?{...n._internalState,taskResponse:e.output.data}:{...n._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},CallTaskResultCheck:{always:[{target:"Success",guard:"noInternalError"},"Error"]},Success:{type:"final"},Error:{type:"final"}},output:({context:e})=>e._internalState.taskResponse?o(e._internalState.taskResponse):p(e._internalState.error||new u("No error in final state"))})}extractDependencies(a){return{callTask:r=>r.input(a)}}}export{R as CallTaskInAppDeviceAction};
|
2
|
+
//# sourceMappingURL=CallTaskInAppDeviceAction.js.map
|
package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../../src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.ts"],
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport {\n type CommandResult,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\n\nimport {\n type CallTaskInAppDAError,\n type CallTaskInAppDAInput,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAInternalState,\n type CallTaskInAppDAOutput,\n} from \"./CallTaskInAppDeviceActionTypes\";\n\n/**\n * Tries to open an app on the device, and if it is successful, calls a task\n * in the app.\n * The output will be the result of the task.\n *\n * ```ts\n * input: {\n * appName: string;\n * task: (internalApi: InternalApi) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n * requiredUserInteraction: UserInteraction;\n * }\n * ```\n *\n * Example of usage:\n *\n * ```ts\n * const deviceAction = new CallTaskInAppDeviceAction({\n * input: {\n * appName: \"MyApp\",\n * task: async (internalApi: InternalApi) => internalApi.sendCommand(new MyAppSpecificCommand()),\n * requiredUserInteraction: UserInteractionRequired.None,\n * },\n * });\n * dmk.executeDeviceAction({ sessionId: \"mySessionId\", deviceAction });\n * ```\n */\nexport class CallTaskInAppDeviceAction<\n TaskResponse,\n TaskErrorCodes,\n UserInteraction extends UserInteractionRequired,\n> extends XStateDeviceAction<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n > {\n type types = StateMachineTypes<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n >;\n\n const { callTask } = this.extractDependencies(internalAPI);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n callTask: fromPromise(callTask),\n openAppStateMachine: new OpenAppDeviceAction({\n input: {\n appName: this.input.appName,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n }).makeStateMachine(internalAPI),\n },\n guards: {\n noInternalError: ({ context }) => context._internalState.error === null,\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 id: \"CallTaskInAppDeviceAction\",\n initial: \"OpenAppDeviceAction\",\n context: ({ input }) => {\n return {\n input: input,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n taskResponse: null,\n error: null,\n },\n };\n },\n states: {\n OpenAppDeviceAction: {\n invoke: {\n id: \"openAppStateMachine\",\n input: {\n appName: this.input.appName,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n src: \"openAppStateMachine\",\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n >({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n target: \"CheckOpenAppDeviceActionResult\",\n },\n },\n },\n CheckOpenAppDeviceActionResult: {\n always: [\n {\n target: \"CallTask\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n CallTask: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: this.input.requiredUserInteraction,\n },\n }),\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n }),\n invoke: {\n id: \"callTask\",\n src: \"callTask\",\n input: (_: { context: types[\"context\"] }) => _.context.input.task,\n onDone: {\n target: \"CallTaskResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n taskResponse: event.output.data,\n };\n }\n return {\n ...context._internalState,\n error: event.output.error,\n };\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n CallTaskResultCheck: {\n always: [\n {\n target: \"Success\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.taskResponse\n ? Right(context._internalState.taskResponse)\n : Left(\n context._internalState.error ||\n new UnknownDAError(\"No error in final state\"),\n ),\n });\n }\n\n extractDependencies(internalApi: InternalApi) {\n return {\n callTask: (_: {\n input: (\n internalApi: InternalApi,\n ) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n }): Promise<CommandResult<TaskResponse, TaskErrorCodes>> =>\n _.input(internalApi),\n };\n }\n}\n"],
|
5
|
+
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAC5B,OAAS,UAAAC,EAAQ,eAAAC,EAAa,SAAAC,MAAa,SAE3C,OAEE,0BAAAC,MACK,mCAEP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,uBAAAC,MAA2B,gEAEpC,OAEE,sBAAAC,MACK,qDAoCA,MAAMC,UAIHD,CAMR,CACA,iBACEE,EAOA,CASA,KAAM,CAAE,SAAAC,CAAS,EAAI,KAAK,oBAAoBD,CAAW,EAEzD,OAAOP,EAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,SAAUD,EAAYS,CAAQ,EAC9B,oBAAqB,IAAIJ,EAAoB,CAC3C,MAAO,CACL,QAAS,KAAK,MAAM,QACpB,mBAAoB,KAAK,MAAM,kBACjC,CACF,CAAC,EAAE,iBAAiBG,CAAW,CACjC,EACA,OAAQ,CACN,gBAAiB,CAAC,CAAE,QAAAE,CAAQ,IAAMA,EAAQ,eAAe,QAAU,IACrE,EACA,QAAS,CACP,qBAAsBX,EAAO,CAC3B,eAAiBY,IAAO,CACtB,GAAGA,EAAE,QAAQ,eACb,MAAOA,EAAE,MAAM,KACjB,EACF,CAAC,CACH,CACF,CAAC,EAAE,cAAc,CACf,GAAI,4BACJ,QAAS,sBACT,QAAS,CAAC,CAAE,MAAAC,CAAM,KACT,CACL,MAAOA,EACP,kBAAmB,CACjB,wBAAyBT,EAAwB,IACnD,EACA,eAAgB,CACd,aAAc,KACd,MAAO,IACT,CACF,GAEF,OAAQ,CACN,oBAAqB,CACnB,OAAQ,CACN,GAAI,sBACJ,MAAO,CACL,QAAS,KAAK,MAAM,QACpB,mBAAoB,KAAK,MAAM,kBACjC,EACA,IAAK,sBACL,WAAY,CACV,QAASJ,EAAO,CACd,kBAAoBY,GAClBA,EAAE,MAAM,SAAS,QAAQ,iBAC7B,CAAC,CACH,EACA,OAAQ,CACN,QAASZ,EAAO,CACd,eAAiBY,GACRA,EAAE,MAAM,OAAO,OAEpB,CACA,MAAO,IAAMA,EAAE,QAAQ,eACvB,KAAOE,IAAW,CAChB,GAAGF,EAAE,QAAQ,eACb,MAAAE,CACF,EACF,CAAC,CAEL,CAAC,EACD,OAAQ,gCACV,CACF,CACF,EACA,+BAAgC,CAC9B,OAAQ,CACN,CACE,OAAQ,WACR,MAAO,iBACT,EACA,OACF,CACF,EACA,SAAU,CACR,MAAOd,EAAO,CACZ,kBAAmB,CACjB,wBAAyB,KAAK,MAAM,uBACtC,CACF,CAAC,EACD,KAAMA,EAAO,CACX,kBAAmB,CACjB,wBAAyBI,EAAwB,IACnD,CACF,CAAC,EACD,OAAQ,CACN,GAAI,WACJ,IAAK,WACL,MAAQQ,GAAqCA,EAAE,QAAQ,MAAM,KAC7D,OAAQ,CACN,OAAQ,sBACR,QAAS,CACPZ,EAAO,CACL,eAAgB,CAAC,CAAE,MAAAe,EAAO,QAAAJ,CAAQ,IAC5BR,EAAuBY,EAAM,MAAM,EAC9B,CACL,GAAGJ,EAAQ,eACX,aAAcI,EAAM,OAAO,IAC7B,EAEK,CACL,GAAGJ,EAAQ,eACX,MAAOI,EAAM,OAAO,KACtB,CAEJ,CAAC,CACH,CACF,EACA,QAAS,CACP,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,oBAAqB,CACnB,OAAQ,CACN,CACE,OAAQ,UACR,MAAO,iBACT,EACA,OACF,CACF,EACA,QAAS,CACP,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAAQ,CAAC,CAAE,QAAAJ,CAAQ,IACjBA,EAAQ,eAAe,aACnBZ,EAAMY,EAAQ,eAAe,YAAY,EACzCb,EACEa,EAAQ,eAAe,OACrB,IAAIN,EAAe,yBAAyB,CAChD,CACR,CAAC,CACH,CAEA,oBAAoBW,EAA0B,CAC5C,MAAO,CACL,SAAWJ,GAKTA,EAAE,MAAMI,CAAW,CACvB,CACF,CACF",
|
6
|
+
"names": ["Left", "Right", "assign", "fromPromise", "setup", "isSuccessCommandResult", "UserInteractionRequired", "UnknownDAError", "OpenAppDeviceAction", "XStateDeviceAction", "CallTaskInAppDeviceAction", "internalAPI", "callTask", "context", "_", "input", "error", "event", "internalApi"]
|
7
|
+
}
|
package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js
ADDED
@@ -0,0 +1,2 @@
|
|
1
|
+
import{Left as D,Right as I}from"purify-ts";import{assign as w,createMachine as M}from"xstate";import{ApduBuilder as g}from"../../../apdu/utils/ApduBuilder";import{CommandResultFactory as l}from"../../../command/model/CommandResult";import{makeDeviceActionInternalApiMock as m}from"../../../device-action/__test-utils__/makeInternalApi";import{testDeviceActionStates as k}from"../../../device-action/__test-utils__/testDeviceActionStates";import{DeviceActionStatus as n}from"../../../device-action/model/DeviceActionState";import{UserInteractionRequired as e}from"../../../device-action/model/UserInteractionRequired";import{UnknownDAError as C}from"../../../device-action/os/Errors";import{OpenAppDeviceAction as S}from"../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{UnknownDeviceExchangeError as v}from"../../../../../src";import{CallTaskInAppDeviceAction as d}from"./CallTaskInAppDeviceAction";vi.mock("@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction",async t=>{const o=await t();return{...o,OpenAppDeviceAction:vi.fn(()=>({...o.OpenAppDeviceAction,makeStateMachine:vi.fn()}))}});const u=t=>{S.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>M({initial:"pending",states:{pending:{entry:w({intermediateValue:{requiredUserInteraction:e.ConfirmOpenApp}}),after:{0:"done"}},done:{type:"final"}},output:()=>t?D(t):I(void 0)}))}))};describe("CallTaskInAppDeviceAction",()=>{const t=vi.fn(),o=()=>({callTask:t}),{sendCommand:y}=m(),s={paramString:"aParameter",paramNumber:1234},f={aNumber:5678,aString:"mockedResponseString"};beforeEach(()=>{vi.resetAllMocks()}),describe("without mocking extractDependencies",()=>{it("should call sendCommand on internalApi with the correct parameters",async()=>{u(),y.mockResolvedValue(l({data:void 0}));const i=new d({input:{task:async r=>await r.sendCommand(new c(s)),appName:"MyApp",requiredUserInteraction:e.VerifyAddress}});await new Promise((r,a)=>{i._execute(m()).observable.subscribe({error:()=>a(),complete:()=>r(),next:()=>{}})}),expect(y).toHaveBeenCalledWith(new c(s))})}),describe("error cases",()=>{it("should error and output the error if the open app fails",()=>new Promise((i,r)=>{u(new C("Mocked error"));const a=[{status:n.Pending,intermediateValue:{requiredUserInteraction:e.None}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.ConfirmOpenApp}},{status:n.Error,error:new C("Mocked error")}];k(new d({input:{task:async p=>await p.sendCommand(new c(s)),appName:"MyApp",requiredUserInteraction:e.VerifyAddress}}),a,m(),{onDone:i,onError:r})})),it("should error and output an error if the call task fails",()=>new Promise((i,r)=>{u(),t.mockResolvedValue(l({error:new v("Mocked error")}));const a=new d({input:{task:async A=>await A.sendCommand(new c(s)),appName:"MyApp",requiredUserInteraction:e.VerifyAddress}});vi.spyOn(a,"extractDependencies").mockImplementation(o);const p=[{status:n.Pending,intermediateValue:{requiredUserInteraction:e.None}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.ConfirmOpenApp}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.VerifyAddress}},{status:n.Error,error:new v("Mocked error")}];k(a,p,m(),{onDone:i,onError:r})}))}),describe("success cases",()=>{it("should succeed and output the command result if the send command succeeds",()=>new Promise((i,r)=>{u(),t.mockResolvedValue(l({data:f}));const a=new d({input:{task:async A=>await A.sendCommand(new c(s)),appName:"MyApp",requiredUserInteraction:e.VerifyAddress}});vi.spyOn(a,"extractDependencies").mockImplementation(o);const p=[{status:n.Pending,intermediateValue:{requiredUserInteraction:e.None}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.ConfirmOpenApp}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.VerifyAddress}},{status:n.Completed,output:f}];k(a,p,m(),{onDone:i,onError:r})}))})});class c{params;constructor(o){this.params=o}getApdu(){return new g({cla:0,ins:1,p1:2,p2:3}).add32BitUIntToData(this.params.paramNumber).addAsciiStringToData(this.params.paramString).build()}parseResponse(){return l({data:{aNumber:1,aString:"aString"}})}}
|
2
|
+
//# sourceMappingURL=CallTaskInAppDeviceAction.test.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../../src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.ts"],
|
4
|
+
"sourcesContent": ["/* eslint @typescript-eslint/consistent-type-imports:0 */\nimport { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type Command } from \"@api/types\";\nimport { UnknownDeviceExchangeError } from \"@root/src\";\n\nimport { CallTaskInAppDeviceAction } from \"./CallTaskInAppDeviceAction\";\nimport {\n type CallTaskInAppDAError,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAOutput,\n} from \"./CallTaskInAppDeviceActionTypes\";\n\nvi.mock(\n \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\",\n async (importOriginal) => {\n const original =\n await importOriginal<\n typeof import(\"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\")\n >();\n return {\n ...original,\n OpenAppDeviceAction: vi.fn(() => ({\n ...original.OpenAppDeviceAction,\n makeStateMachine: vi.fn(),\n })),\n };\n },\n);\n\nconst setupOpenAppDAMock = (error?: unknown) => {\n (OpenAppDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n initial: \"pending\",\n states: {\n pending: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n }),\n after: {\n 0: \"done\",\n },\n },\n done: {\n type: \"final\",\n },\n },\n output: () => (error ? Left(error) : Right(undefined)),\n }),\n ),\n }));\n};\n\ndescribe(\"CallTaskInAppDeviceAction\", () => {\n const callMyTask = vi.fn();\n\n const extractDependenciesMock = () => ({\n callTask: callMyTask,\n });\n\n const { sendCommand: apiSendCommandMock } = makeDeviceActionInternalApiMock();\n\n const commandParams = {\n paramString: \"aParameter\",\n paramNumber: 1234,\n };\n const mockedCommandResponse = {\n aNumber: 5678,\n aString: \"mockedResponseString\",\n };\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n describe(\"without mocking extractDependencies\", () => {\n it(\"should call sendCommand on internalApi with the correct parameters\", async () => {\n setupOpenAppDAMock();\n apiSendCommandMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n });\n await new Promise<void>((resolve, reject) => {\n deviceAction\n ._execute(makeDeviceActionInternalApiMock())\n .observable.subscribe({\n error: () => reject(),\n complete: () => resolve(),\n next: () => {},\n });\n });\n\n expect(apiSendCommandMock).toHaveBeenCalledWith(\n new TestCommand(commandParams),\n );\n });\n });\n\n describe(\"error cases\", () => {\n it(\"should error and output the error if the open app fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock(new UnknownDAError(\"Mocked error\"));\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n }),\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should error and output an error if the call task fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n callMyTask.mockResolvedValue(\n CommandResultFactory({\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n\n describe(\"success cases\", () => {\n it(\"should succeed and output the command result if the send command succeeds\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n callMyTask.mockResolvedValue(\n CommandResultFactory({ data: mockedCommandResponse }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Completed,\n output: mockedCommandResponse,\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n});\n\ntype MyCommandResponse = {\n aNumber: number;\n aString: string;\n};\n\ntype MyCommandParams = {\n paramString: string;\n paramNumber: number;\n};\n\nclass TestCommand implements Command<MyCommandResponse, MyCommandParams> {\n params: MyCommandParams;\n constructor(params: MyCommandParams) {\n this.params = params;\n }\n getApdu(): Apdu {\n return new ApduBuilder({ cla: 0x00, ins: 0x01, p1: 0x02, p2: 0x03 })\n .add32BitUIntToData(this.params.paramNumber)\n .addAsciiStringToData(this.params.paramString)\n .build();\n }\n parseResponse() {\n return CommandResultFactory({ data: { aNumber: 1, aString: \"aString\" } });\n }\n}\n\ntype MyCommandCallTaskDAState = DeviceActionState<\n CallTaskInAppDAOutput<MyCommandResponse>,\n CallTaskInAppDAError<UnknownDAError>,\n CallTaskInAppDAIntermediateValue<\n UserInteractionRequired.None | UserInteractionRequired.VerifyAddress\n >\n>;\n"],
|
5
|
+
"mappings": "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",
|
6
|
+
"names": ["Left", "Right", "assign", "createMachine", "ApduBuilder", "CommandResultFactory", "makeDeviceActionInternalApiMock", "testDeviceActionStates", "DeviceActionStatus", "UserInteractionRequired", "UnknownDAError", "OpenAppDeviceAction", "UnknownDeviceExchangeError", "CallTaskInAppDeviceAction", "importOriginal", "original", "setupOpenAppDAMock", "error", "callMyTask", "extractDependenciesMock", "apiSendCommandMock", "commandParams", "mockedCommandResponse", "deviceAction", "internalApi", "TestCommand", "resolve", "reject", "expectedStates", "params"]
|
7
|
+
}
|
package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
//# sourceMappingURL=CallTaskInAppDeviceActionTypes.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{Left as A,Right as m}from"purify-ts";import{Observable as y}from"rxjs";import{tap as g,timeout as k}from"rxjs/operators";import{assign as
|
1
|
+
import{Left as A,Right as m}from"purify-ts";import{Observable as y}from"rxjs";import{tap as g,timeout as k}from"rxjs/operators";import{assign as n,fromObservable as b,fromPromise as f,setup as E}from"xstate";import{isSuccessCommandResult as h}from"../../../command/model/CommandResult";import{GetAppAndVersionCommand as V}from"../../../command/os/GetAppAndVersionCommand";import{DeviceStatus as D}from"../../../device/DeviceStatus";import{UserInteractionRequired as c}from"../../../device-action/model/UserInteractionRequired";import{DEFAULT_UNLOCK_TIMEOUT_MS as U}from"../../../device-action/os/Const";import{DeviceLockedError as G,DeviceNotOnboardedError as x}from"../../../device-action/os/Errors";import{XStateDeviceAction as I}from"../../../device-action/xstate-utils/XStateDeviceAction";import{DeviceSessionStateType as l}from"../../../device-session/DeviceSessionState";class K extends I{makeStateMachine(r){const{getAppAndVersion:d,getDeviceSessionState:u,setDeviceSessionState:i,waitForDeviceUnlock:p,isDeviceOnboarded:o}=this.extractDependencies(r),a=this.input.unlockTimeout??U;return E({types:{input:{unlockTimeout:a},context:{},output:{}},actors:{getAppAndVersion:f(d),waitForDeviceUnlock:b(p)},guards:{isDeviceOnboarded:()=>o(),isDeviceLocked:({context:e})=>e._internalState.locked,hasError:({context:e})=>e._internalState.error!==null},actions:{assignErrorDeviceNotOnboarded:n({_internalState:e=>({...e.context._internalState,error:new x})}),assignErrorDeviceLocked:n({_internalState:e=>({...e.context._internalState,error:new G}),intermediateValue:{requiredUserInteraction:c.UnlockDevice}}),assignErrorFromEvent:n({_internalState:e=>({...e.context._internalState,error:e.event.error})}),assignNoUserActionNeeded:n({intermediateValue:e=>({...e.context.intermediateValue,requiredUserInteraction:c.None})}),assignUserActionUnlockNeeded:n({intermediateValue:e=>({...e.context.intermediateValue,requiredUserInteraction:c.UnlockDevice})})}}).createMachine({id:"GetDeviceStatusDeviceAction",initial:"DeviceReady",context:e=>{const t=u(),{sessionStateType:s}=t;return{input:{unlockTimeout:e.input.unlockTimeout},intermediateValue:{requiredUserInteraction:c.None},_internalState:{onboarded:!1,locked:!1,currentApp:s===l.ReadyWithoutSecureChannel?t.currentApp.name:null,currentAppVersion:null,error:null}}},states:{DeviceReady:{always:{target:"OnboardingCheck"}},OnboardingCheck:{always:[{guard:{type:"isDeviceOnboarded"},target:"AppAndVersionCheck",actions:n({_internalState:e=>({...e.context._internalState,onboarded:!0})})},{target:"Error",actions:"assignErrorDeviceNotOnboarded"}]},UserActionUnlockDevice:{entry:"assignUserActionUnlockNeeded",exit:"assignNoUserActionNeeded",invoke:{id:"UserActionUnlockDevice",src:"waitForDeviceUnlock",input:e=>({unlockTimeout:a}),onDone:{target:"AppAndVersionCheck",actions:n({_internalState:e=>({...e.context._internalState,locked:!1})})},onError:{target:"Error",actions:"assignErrorDeviceLocked"}}},AppAndVersionCheck:{invoke:{src:"getAppAndVersion",onDone:{target:"ApplicationAvailableResultCheck",actions:n({_internalState:e=>{if(h(e.event.output)){const t=u();return t.sessionStateType!==l.Connected?i({...t,currentApp:e.event.output.data}):i({deviceModelId:t.deviceModelId,sessionStateType:l.ReadyWithoutSecureChannel,deviceStatus:D.CONNECTED,currentApp:e.event.output.data,installedApps:[],isSecureConnectionAllowed:!1}),{...e.context._internalState,locked:!1,currentApp:e.event.output.data.name,currentAppVersion:e.event.output.data.version}}return"errorCode"in e.event.output.error&&e.event.output.error.errorCode==="5515"?{...e.context._internalState,locked:!0}:{...e.context._internalState,error:e.event.output.error}}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},ApplicationAvailableResultCheck:{always:[{guard:"hasError",target:"Error"},{target:"UserActionUnlockDevice",guard:"isDeviceLocked"},{target:"Success"}]},Success:{type:"final"},Error:{type:"final"}},output:e=>{const{context:t}=e,{error:s,currentApp:v,currentAppVersion:S}=t._internalState;return s?A(s):m({currentApp:v,currentAppVersion:S})}})}extractDependencies(r){return{getAppAndVersion:()=>r.sendCommand(new V),waitForDeviceUnlock:({input:i})=>new y(p=>{const o=r.getDeviceSessionStateObservable().pipe(g(a=>{a.deviceStatus===D.CONNECTED&&(p.complete(),o.unsubscribe())})).subscribe();return()=>{o.unsubscribe()}}).pipe(k(i.unlockTimeout)),getDeviceSessionState:()=>r.getDeviceSessionState(),setDeviceSessionState:i=>r.setDeviceSessionState(i),isDeviceOnboarded:()=>!0}}}export{K as GetDeviceStatusDeviceAction};
|
2
2
|
//# sourceMappingURL=GetDeviceStatusDeviceAction.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { Observable } from \"rxjs\";\nimport { tap, timeout } from \"rxjs/operators\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionCommandResult,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\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 {\n DeviceLockedError,\n DeviceNotOnboardedError,\n} from \"@api/device-action/os/Errors\";\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 {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\n\nimport {\n type GetDeviceStatusDAError,\n type GetDeviceStatusDAInput,\n type GetDeviceStatusDAIntermediateValue,\n type GetDeviceStatusDAOutput,\n} from \"./types\";\n\ntype GetDeviceStatusMachineInternalState = {\n readonly onboarded: boolean;\n readonly locked: boolean;\n readonly currentApp: string | null;\n readonly currentAppVersion: string | null;\n readonly error: GetDeviceStatusDAError | null;\n};\n\nexport type MachineDependencies = {\n readonly getAppAndVersion: () => Promise<GetAppAndVersionCommandResult>;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly waitForDeviceUnlock: (args: {\n input: { unlockTimeout: number };\n }) => Observable<void>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly isDeviceOnboarded: () => boolean;\n};\n\nexport type ExtractMachineDependencies = (\n internalApi: InternalApi,\n) => MachineDependencies;\n\nexport class GetDeviceStatusDeviceAction extends XStateDeviceAction<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n > {\n type types = StateMachineTypes<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n >;\n\n const {\n getAppAndVersion,\n getDeviceSessionState,\n setDeviceSessionState,\n waitForDeviceUnlock,\n isDeviceOnboarded,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\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 getAppAndVersion: fromPromise(getAppAndVersion),\n waitForDeviceUnlock: fromObservable(waitForDeviceUnlock),\n },\n guards: {\n isDeviceOnboarded: () => isDeviceOnboarded(), // TODO: we don't have this info for now, this can be derived from the \"flags\" obtained in the getVersion command\n isDeviceUnlocked: () =>\n getDeviceSessionState().deviceStatus !== DeviceStatus.LOCKED,\n hasError: ({ context }) => context._internalState.error !== null,\n },\n actions: {\n assignErrorDeviceNotOnboarded: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new DeviceNotOnboardedError(),\n }),\n }),\n assignErrorDeviceLocked: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new DeviceLockedError(),\n }),\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n }),\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 assignNoUserActionNeeded: assign({\n intermediateValue: (_) =>\n ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }) satisfies types[\"context\"][\"intermediateValue\"],\n }),\n assignUserActionUnlockNeeded: assign({\n intermediateValue: (_) =>\n ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n }) satisfies types[\"context\"][\"intermediateValue\"],\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QHEwBcAiYBuBLAxmAMpoCGaArrFnoQIL5q4D2AdgHQ0FgBKYpEAJ4BiANoAGALqJQAB2axcTNjJAAPRAFoArAHZx7AIwAmQ7oCcugMyHzANmMAWYwBoQgxI8vsAHOJM+VuLmVj5e2gC+EW6omDjcJORUXPSMLBwA8qwARsykAE4QuKxQAMIAFmD4ANZiUqryisqsqhoImo4O7OGhPj4h5n6Obh4IunZ2RoZ+ena6nYaGUTHoKcRklNTxqc3sWbkFRSUVVbWihtJIII1K6a1aVtoGTxOOjtbv84YjiObik7ofPM7GFDP9jNofMsQLE1olNmsGLsADLMGrFMqVGp1S5yBS3FRXNqaOzadjiHx2KyORbzcRBczmH4IbTOdjaabaKmdGy6XSRaIw1bbdZJLa0MBI9LsVHo45Ys4XBr45r3dps-n0ubaGxgx6PZlWULkkLBGmDCzGYzQ2Ei+HJEVStjsACqsDA+SdrBdrAANmjqmthBA2GB2MVsMxqmG3R6vT7-TU1hJcdcVXciYgglZycYQiYqRTQoZtMynDmbM4aW8rHYzD4BSs4hL7eLuF7Xe7PWk2AmA0GPflmPl2LJfeQAGbDgC2nbjPe9fv7IpTyqaGdAbXmxnZPkMNNM820VuZ+8M7Dsb3MznpwW31sFtpbGwdEo7dFksjorAgADUPYobAnNiIasGGEZRmGT4JC+bY7NKH5fj+-75IBrDAdUCAQfg5DpCmq5XDcqqZmMjgGDY-yGJeejjFRzJ2P47DZoEJb+Hyx42sKz5ioiC7sIh35-gB6QYcIg7DqO45oFO+SztBhCtrxuwCchwlAQqWGsJGOHNPh9SEemhKbogdLsIMTjmPuNF1nYZaOBW+5OPu9l1oCjZCs2ME8Y6fGIb6BC4WwdDYKQuDjtkvq8HAFC+mgokEXi65GeoiBguYZJOPSJa6Hm1hGsyuglkxxiUjYVjXlq7nyaKCI+cpn7+Tp6TBaF4WRXwsAxXFCpiEqBlJS0JFAo4vg+BCe55e8-QFUVVglVShjlWRtZ2FEgqsMwEBwKo1WKXVG5pgNaokmRZmQg4fyLHR7ieCNpjGPyx7aNo6UNo4nGeQpsFKdKax8AIoyJQSg3Ge0L07q9F3+Istk3Qg1IjUaZ7GNS-LlU4H1wt9+3OvseSFBiGFrsDx01mZ15mHooReFaVj0fZ5Jci5zissYIKY3a2NvnxsrVITCrE8RoMdDucxWgx1jpZCELDHDgKTC9jg6mNXKLDSHPcbV3O7LG3bNH2SYioLB3EmCI1-HuVL6Cj4hU6eNjsIVD3UrWfKXVCj5cV5Wvtr5n6CShaFE-1JMkWzPgXpCjh+Faw3Mjq5jdOlJhGvo-RzRr3uvr79VjgFzQtWFpARVFnWxcHQNCylCBm+eKPjJL4jWMEdNww4O46vSFVsfyD5Nlj3na9KRAUPghCwPAIdV20QIR7e-RzOYbNK98cN7ndgR-BSzgo+YmdfYPOfSgAovkQ75MbyVtItehmSrJgcijz2uHD+pmXyQSQnyVLs2tQA */\n id: \"GetDeviceStatusDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n const sessionState = getDeviceSessionState();\n const { sessionStateType } = sessionState;\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n onboarded: false, // we don't know how to check yet\n locked: sessionState.deviceStatus === DeviceStatus.LOCKED,\n currentApp:\n sessionStateType ===\n DeviceSessionStateType.ReadyWithoutSecureChannel\n ? sessionState.currentApp.name\n : null,\n currentAppVersion: null,\n error: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"OnboardingCheck\",\n },\n },\n OnboardingCheck: {\n // TODO: we don't have this info for now\n always: [\n {\n guard: {\n type: \"isDeviceOnboarded\",\n },\n target: \"LockingCheck\",\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n onboarded: true,\n }),\n }),\n },\n {\n target: \"Error\",\n actions: \"assignErrorDeviceNotOnboarded\",\n },\n ],\n },\n LockingCheck: {\n // We check if the device is locked in the session state\n always: [\n {\n target: \"AppAndVersionCheck\",\n guard: {\n type: \"isDeviceUnlocked\",\n },\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n locked: false,\n }),\n }),\n },\n {\n target: \"UserActionUnlockDevice\",\n },\n ],\n },\n UserActionUnlockDevice: {\n // we wait for the device to be unlocked (default timeout is 15s)\n entry: \"assignUserActionUnlockNeeded\",\n exit: \"assignNoUserActionNeeded\",\n invoke: {\n id: \"UserActionUnlockDevice\",\n src: \"waitForDeviceUnlock\",\n input: (_) => ({\n unlockTimeout,\n }),\n onDone: {\n target: \"AppAndVersionCheck\",\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n locked: false,\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorDeviceLocked\",\n },\n },\n },\n AppAndVersionCheck: {\n // We check the current app and version using the getAppAndVersion command\n invoke: {\n src: \"getAppAndVersion\",\n onDone: {\n target: \"ApplicationAvailableResultCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const state: DeviceSessionState = getDeviceSessionState();\n // Narrow the type to ReadyWithoutSecureChannelState or ReadyWithSecureChannelState\n if (\n state.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...state,\n currentApp: _.event.output.data,\n });\n }\n return {\n ..._.context._internalState,\n currentApp: _.event.output.data.name,\n currentAppVersion: _.event.output.data.version,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n ApplicationAvailableResultCheck: {\n always: [\n {\n guard: \"hasError\",\n target: \"Error\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (args) => {\n // TODO: instead we should rely on the current state (\"Success\" or \"Error\")\n const { context } = args;\n const { error, currentApp, currentAppVersion } = context._internalState;\n if (error) {\n return Left(error);\n }\n return Right<GetDeviceStatusDAOutput>({\n currentApp: currentApp!,\n currentAppVersion: currentAppVersion!,\n });\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getAppAndVersion = () => {\n return internalApi.sendCommand(new GetAppAndVersionCommand());\n };\n\n const waitForDeviceUnlock = ({\n input,\n }: {\n input: { unlockTimeout: number };\n }) =>\n new Observable<void>((subscriber) => {\n const inner = internalApi\n .getDeviceSessionStateObservable()\n .pipe(\n tap((state) => {\n if (state.deviceStatus === DeviceStatus.CONNECTED) {\n subscriber.complete();\n inner.unsubscribe();\n }\n }),\n )\n .subscribe();\n\n return () => {\n inner.unsubscribe();\n };\n }).pipe(timeout(input.unlockTimeout));\n\n return {\n getAppAndVersion,\n waitForDeviceUnlock,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n isDeviceOnboarded: () => true, // TODO: we don't have this info for now\n };\n }\n}\n"],
|
5
|
-
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAC5B,OAAS,cAAAC,MAAkB,OAC3B,OAAS,OAAAC,EAAK,WAAAC,MAAe,iBAC7B,OAAS,UAAAC,EAAQ,kBAAAC,EAAgB,eAAAC,EAAa,SAAAC,MAAa,SAE3D,OAAS,0BAAAC,MAA8B,mCACvC,OACE,2BAAAC,MAEK,0CACP,OAAS,gBAAAC,MAAoB,2BAE7B,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,6BAAAC,MAAiC,8BAC1C,OACE,qBAAAC,EACA,2BAAAC,MACK,+BAEP,OAEE,sBAAAC,MACK,qDACP,OAEE,0BAAAC,MACK,yCAiCA,MAAMC,UAAoCF,CAM/C,CACA,iBACEG,EAOA,CASA,KAAM,CACJ,iBAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,oBAAAC,EACA,kBAAAC,CACF,EAAI,KAAK,oBAAoBL,CAAW,EAElCM,EAAgB,KAAK,MAAM,eAAiBZ,EAElD,OAAOL,EAAM,CACX,MAAO,CACL,MAAO,CACL,cAAAiB,CACF,EACA,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,iBAAkBlB,EAAYa,CAAgB,EAC9C,oBAAqBd,EAAeiB,CAAmB,CACzD,EACA,OAAQ,CACN,kBAAmB,IAAMC,EAAkB,EAC3C,
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { Observable } from \"rxjs\";\nimport { tap, timeout } from \"rxjs/operators\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionCommandResult,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\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 {\n DeviceLockedError,\n DeviceNotOnboardedError,\n} from \"@api/device-action/os/Errors\";\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 {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\n\nimport {\n type GetDeviceStatusDAError,\n type GetDeviceStatusDAInput,\n type GetDeviceStatusDAIntermediateValue,\n type GetDeviceStatusDAOutput,\n} from \"./types\";\n\ntype GetDeviceStatusMachineInternalState = {\n readonly onboarded: boolean;\n readonly locked: boolean;\n readonly currentApp: string | null;\n readonly currentAppVersion: string | null;\n readonly error: GetDeviceStatusDAError | null;\n};\n\nexport type MachineDependencies = {\n readonly getAppAndVersion: () => Promise<GetAppAndVersionCommandResult>;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly waitForDeviceUnlock: (args: {\n input: { unlockTimeout: number };\n }) => Observable<void>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly isDeviceOnboarded: () => boolean;\n};\n\nexport type ExtractMachineDependencies = (\n internalApi: InternalApi,\n) => MachineDependencies;\n\nexport class GetDeviceStatusDeviceAction extends XStateDeviceAction<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n > {\n type types = StateMachineTypes<\n GetDeviceStatusDAOutput,\n GetDeviceStatusDAInput,\n GetDeviceStatusDAError,\n GetDeviceStatusDAIntermediateValue,\n GetDeviceStatusMachineInternalState\n >;\n\n const {\n getAppAndVersion,\n getDeviceSessionState,\n setDeviceSessionState,\n waitForDeviceUnlock,\n isDeviceOnboarded,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\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 getAppAndVersion: fromPromise(getAppAndVersion),\n waitForDeviceUnlock: fromObservable(waitForDeviceUnlock),\n },\n guards: {\n isDeviceOnboarded: () => isDeviceOnboarded(), // TODO: we don't have this info for now, this can be derived from the \"flags\" obtained in the getVersion command\n isDeviceLocked: ({ context }) => context._internalState.locked,\n hasError: ({ context }) => context._internalState.error !== null,\n },\n actions: {\n assignErrorDeviceNotOnboarded: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new DeviceNotOnboardedError(),\n }),\n }),\n assignErrorDeviceLocked: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new DeviceLockedError(),\n }),\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n },\n }),\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 assignNoUserActionNeeded: assign({\n intermediateValue: (_) =>\n ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }) satisfies types[\"context\"][\"intermediateValue\"],\n }),\n assignUserActionUnlockNeeded: assign({\n intermediateValue: (_) =>\n ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.UnlockDevice,\n }) satisfies types[\"context\"][\"intermediateValue\"],\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QHEwBcAiYBuBLAxmAMpoCGaArrFnoQIL5q4D2AdgHQ0FgBKYpEAJ4BiANoAGALqJQAB2axcTNjJAAPRAFoArAHZx7AIwAmQ7oCcugMyHzANmMAWYwBoQgxI8vsAHOJM+VuLmVj5e2gC+EW6omDjcJORUXPSMLBwA8qwARsykAE4QuKxQAMIAFmD4ANZiUqryisqsqhoImo4O7OGhPj4h5n6Obh4IunZ2RoZ+ena6nYaGUTHoKcRklNTxqc3sWbkFRSUVVbWihtJIII1K6a1aVtoGTxOOjtbv84YjiObik7ofPM7GFDP9jNofMsQLE1olNmsGLsADLMGrFMqVGp1S5yBS3FRXNqaOzadjiHx2KyORbzcRBczmH4IbTOdjaabaKmdGy6XSRaIw1bbdZJLa0MBI9LsVHo45Ys4XBr45r3dps-n0ubaGxgx6PZlWULkkLBGmDCzGYzQ2Ei+HJEVStjsACqsDA+SdrBdrAANmjqmthBA2GB2MVsMxqmG3R6vT7-TU1hJcdcVXciYgglZycYQiYqRTQoZtMynDmbM4aW8rHYzD4BSs4hL7eLuF7Xe7PWk2AmA0GPflmPl2LJfeQAGbDgC2nbjPe9fv7IpTyqaGdAbXmxnZPkMNNM820VuZ+8M7Dsb3MznpwW31sFtpbGwdEo7dFksjorAgADUPYobAnNiIasGGEZRmGT4JC+bY7NKH5fj+-75IBrDAdUCAQfg5DpCmq5XDcqqZmMjgGDY-yGJeejjFRzJ2P47DZoEJb+Hyx42sKz5ioiC7sIh35-gB6QYcIg7DqO45oFO+SztBhCtrxuwCchwlAQqWGsJGOHNPh9SEemhKbogdLsIMTjmPuNF1nYZaOBW+5OPu9l1oCjZCs2ME8Y6fGIb6BC4WwdDYKQuDjtkvq8HAFC+mgokEXi65GeoiBguYZJOPSJa6Hm1hGsyuglkxxiUjYVjXlq7nyaKCI+cpn7+Tp6TBaF4WRXwsAxXFCpiEqBlJS0JFAo4vg+BCe55e8-QFUVVglVShjlWRtZ2FEgqsMwEBwKo1WKXVG5pgNaokmRZmQg4fyLHR7ieCNpjGPyx7aNo6UNo4nGeQpsFKdKax8AIoyJQSg3Ge0L07q9F3+Istk3Qg1IjUaZ7GNS-LlU4H1wt9+3OvseSFBiGFrsDx01mZ15mHooReFaVj0fZ5Jci5zissYIKY3a2NvnxsrVITCrE8RoMdDucxWgx1jpZCELDHDgKTC9jg6mNXKLDSHPcbV3O7LG3bNH2SYioLB3EmCI1-HuVL6Cj4hU6eNjsIVD3UrWfKXVCj5cV5Wvtr5n6CShaFE-1JMkWzPgXpCjh+Faw3Mjq5jdOlJhGvo-RzRr3uvr79VjgFzQtWFpARVFnWxcHQNCylCBm+eKPjJL4jWMEdNww4O46vSFVsfyD5Nlj3na9KRAUPghCwPAIdV20QIR7e-RzOYbNK98cN7ndgR-BSzgo+YmdfYPOfSgAovkQ75MbyVtItehmSrJgcijz2uHD+pmXyQSQnyVLs2tQA */\n id: \"GetDeviceStatusDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n const sessionState = getDeviceSessionState();\n const { sessionStateType } = sessionState;\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n onboarded: false, // we don't know how to check yet\n locked: false,\n currentApp:\n sessionStateType ===\n DeviceSessionStateType.ReadyWithoutSecureChannel\n ? sessionState.currentApp.name\n : null,\n currentAppVersion: null,\n error: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"OnboardingCheck\",\n },\n },\n OnboardingCheck: {\n // TODO: we don't have this info for now\n always: [\n {\n guard: {\n type: \"isDeviceOnboarded\",\n },\n target: \"AppAndVersionCheck\",\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n onboarded: true,\n }),\n }),\n },\n {\n target: \"Error\",\n actions: \"assignErrorDeviceNotOnboarded\",\n },\n ],\n },\n UserActionUnlockDevice: {\n // we wait for the device to be unlocked (default timeout is 15s)\n entry: \"assignUserActionUnlockNeeded\",\n exit: \"assignNoUserActionNeeded\",\n invoke: {\n id: \"UserActionUnlockDevice\",\n src: \"waitForDeviceUnlock\",\n input: (_) => ({\n unlockTimeout,\n }),\n onDone: {\n target: \"AppAndVersionCheck\",\n actions: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n locked: false,\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorDeviceLocked\",\n },\n },\n },\n AppAndVersionCheck: {\n // We check the current app and version using the getAppAndVersion command\n invoke: {\n src: \"getAppAndVersion\",\n onDone: {\n target: \"ApplicationAvailableResultCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const state: DeviceSessionState = getDeviceSessionState();\n if (\n state.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n // Update the current app\n setDeviceSessionState({\n ...state,\n currentApp: _.event.output.data,\n });\n } else {\n // The device can be set to Ready if GetAppAndVersionCommand was successful\n setDeviceSessionState({\n deviceModelId: state.deviceModelId,\n sessionStateType:\n DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n currentApp: _.event.output.data,\n installedApps: [],\n isSecureConnectionAllowed: false,\n });\n }\n return {\n ..._.context._internalState,\n locked: false,\n currentApp: _.event.output.data.name,\n currentAppVersion: _.event.output.data.version,\n };\n }\n if (\n \"errorCode\" in _.event.output.error &&\n _.event.output.error.errorCode === \"5515\"\n ) {\n return {\n ..._.context._internalState,\n locked: true,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n ApplicationAvailableResultCheck: {\n always: [\n {\n guard: \"hasError\",\n target: \"Error\",\n },\n {\n target: \"UserActionUnlockDevice\",\n guard: \"isDeviceLocked\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (args) => {\n // TODO: instead we should rely on the current state (\"Success\" or \"Error\")\n const { context } = args;\n const { error, currentApp, currentAppVersion } = context._internalState;\n if (error) {\n return Left(error);\n }\n return Right<GetDeviceStatusDAOutput>({\n currentApp: currentApp!,\n currentAppVersion: currentAppVersion!,\n });\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getAppAndVersion = () => {\n return internalApi.sendCommand(new GetAppAndVersionCommand());\n };\n\n const waitForDeviceUnlock = ({\n input,\n }: {\n input: { unlockTimeout: number };\n }) =>\n new Observable<void>((subscriber) => {\n const inner = internalApi\n .getDeviceSessionStateObservable()\n .pipe(\n tap((state) => {\n if (state.deviceStatus === DeviceStatus.CONNECTED) {\n subscriber.complete();\n inner.unsubscribe();\n }\n }),\n )\n .subscribe();\n\n return () => {\n inner.unsubscribe();\n };\n }).pipe(timeout(input.unlockTimeout));\n\n return {\n getAppAndVersion,\n waitForDeviceUnlock,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n isDeviceOnboarded: () => true, // TODO: we don't have this info for now\n };\n }\n}\n"],
|
5
|
+
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAC5B,OAAS,cAAAC,MAAkB,OAC3B,OAAS,OAAAC,EAAK,WAAAC,MAAe,iBAC7B,OAAS,UAAAC,EAAQ,kBAAAC,EAAgB,eAAAC,EAAa,SAAAC,MAAa,SAE3D,OAAS,0BAAAC,MAA8B,mCACvC,OACE,2BAAAC,MAEK,0CACP,OAAS,gBAAAC,MAAoB,2BAE7B,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,6BAAAC,MAAiC,8BAC1C,OACE,qBAAAC,EACA,2BAAAC,MACK,+BAEP,OAEE,sBAAAC,MACK,qDACP,OAEE,0BAAAC,MACK,yCAiCA,MAAMC,UAAoCF,CAM/C,CACA,iBACEG,EAOA,CASA,KAAM,CACJ,iBAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,oBAAAC,EACA,kBAAAC,CACF,EAAI,KAAK,oBAAoBL,CAAW,EAElCM,EAAgB,KAAK,MAAM,eAAiBZ,EAElD,OAAOL,EAAM,CACX,MAAO,CACL,MAAO,CACL,cAAAiB,CACF,EACA,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,iBAAkBlB,EAAYa,CAAgB,EAC9C,oBAAqBd,EAAeiB,CAAmB,CACzD,EACA,OAAQ,CACN,kBAAmB,IAAMC,EAAkB,EAC3C,eAAgB,CAAC,CAAE,QAAAE,CAAQ,IAAMA,EAAQ,eAAe,OACxD,SAAU,CAAC,CAAE,QAAAA,CAAQ,IAAMA,EAAQ,eAAe,QAAU,IAC9D,EACA,QAAS,CACP,8BAA+BrB,EAAO,CACpC,eAAiBsB,IAAO,CACtB,GAAGA,EAAE,QAAQ,eACb,MAAO,IAAIZ,CACb,EACF,CAAC,EACD,wBAAyBV,EAAO,CAC9B,eAAiBsB,IAAO,CACtB,GAAGA,EAAE,QAAQ,eACb,MAAO,IAAIb,CACb,GACA,kBAAmB,CACjB,wBAAyBF,EAAwB,YACnD,CACF,CAAC,EACD,qBAAsBP,EAAO,CAC3B,eAAiBsB,IAAO,CACtB,GAAGA,EAAE,QAAQ,eACb,MAAOA,EAAE,MAAM,KACjB,EACF,CAAC,EACD,yBAA0BtB,EAAO,CAC/B,kBAAoBsB,IACjB,CACC,GAAGA,EAAE,QAAQ,kBACb,wBAAyBf,EAAwB,IACnD,EACJ,CAAC,EACD,6BAA8BP,EAAO,CACnC,kBAAoBsB,IACjB,CACC,GAAGA,EAAE,QAAQ,kBACb,wBAAyBf,EAAwB,YACnD,EACJ,CAAC,CACH,CACF,CAAC,EAAE,cAAc,CAEf,GAAI,8BACJ,QAAS,cACT,QAAUe,GAAM,CACd,MAAMC,EAAeP,EAAsB,EACrC,CAAE,iBAAAQ,CAAiB,EAAID,EAC7B,MAAO,CACL,MAAO,CACL,cAAeD,EAAE,MAAM,aACzB,EACA,kBAAmB,CACjB,wBAAyBf,EAAwB,IACnD,EACA,eAAgB,CACd,UAAW,GACX,OAAQ,GACR,WACEiB,IACAZ,EAAuB,0BACnBW,EAAa,WAAW,KACxB,KACN,kBAAmB,KACnB,MAAO,IACT,CACF,CACF,EACA,OAAQ,CACN,YAAa,CACX,OAAQ,CACN,OAAQ,iBACV,CACF,EACA,gBAAiB,CAEf,OAAQ,CACN,CACE,MAAO,CACL,KAAM,mBACR,EACA,OAAQ,qBACR,QAASvB,EAAO,CACd,eAAiBsB,IAAO,CACtB,GAAGA,EAAE,QAAQ,eACb,UAAW,EACb,EACF,CAAC,CACH,EACA,CACE,OAAQ,QACR,QAAS,+BACX,CACF,CACF,EACA,uBAAwB,CAEtB,MAAO,+BACP,KAAM,2BACN,OAAQ,CACN,GAAI,yBACJ,IAAK,sBACL,MAAQA,IAAO,CACb,cAAAF,CACF,GACA,OAAQ,CACN,OAAQ,qBACR,QAASpB,EAAO,CACd,eAAiBsB,IAAO,CACtB,GAAGA,EAAE,QAAQ,eACb,OAAQ,EACV,EACF,CAAC,CACH,EACA,QAAS,CACP,OAAQ,QACR,QAAS,yBACX,CACF,CACF,EACA,mBAAoB,CAElB,OAAQ,CACN,IAAK,mBACL,OAAQ,CACN,OAAQ,kCACR,QAAStB,EAAO,CACd,eAAiBsB,GAAM,CACrB,GAAIlB,EAAuBkB,EAAE,MAAM,MAAM,EAAG,CAC1C,MAAMG,EAA4BT,EAAsB,EACxD,OACES,EAAM,mBACNb,EAAuB,UAGvBK,EAAsB,CACpB,GAAGQ,EACH,WAAYH,EAAE,MAAM,OAAO,IAC7B,CAAC,EAGDL,EAAsB,CACpB,cAAeQ,EAAM,cACrB,iBACEb,EAAuB,0BACzB,aAAcN,EAAa,UAC3B,WAAYgB,EAAE,MAAM,OAAO,KAC3B,cAAe,CAAC,EAChB,0BAA2B,EAC7B,CAAC,EAEI,CACL,GAAGA,EAAE,QAAQ,eACb,OAAQ,GACR,WAAYA,EAAE,MAAM,OAAO,KAAK,KAChC,kBAAmBA,EAAE,MAAM,OAAO,KAAK,OACzC,CACF,CACA,MACE,cAAeA,EAAE,MAAM,OAAO,OAC9BA,EAAE,MAAM,OAAO,MAAM,YAAc,OAE5B,CACL,GAAGA,EAAE,QAAQ,eACb,OAAQ,EACV,EAEK,CACL,GAAGA,EAAE,QAAQ,eACb,MAAOA,EAAE,MAAM,OAAO,KACxB,CACF,CACF,CAAC,CACH,EACA,QAAS,CACP,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,gCAAiC,CAC/B,OAAQ,CACN,CACE,MAAO,WACP,OAAQ,OACV,EACA,CACE,OAAQ,yBACR,MAAO,gBACT,EACA,CACE,OAAQ,SACV,CACF,CACF,EACA,QAAS,CACP,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAASI,GAAS,CAEhB,KAAM,CAAE,QAAAL,CAAQ,EAAIK,EACd,CAAE,MAAAC,EAAO,WAAAC,EAAY,kBAAAC,CAAkB,EAAIR,EAAQ,eACzD,OAAIM,EACKhC,EAAKgC,CAAK,EAEZ/B,EAA+B,CACpC,WAAYgC,EACZ,kBAAmBC,CACrB,CAAC,CACH,CACF,CAAC,CACH,CAEA,oBAAoBf,EAA+C,CA4BjE,MAAO,CACL,iBA5BuB,IAChBA,EAAY,YAAY,IAAIT,CAAyB,EA4B5D,oBAzB0B,CAAC,CAC3B,MAAAyB,CACF,IAGE,IAAIjC,EAAkBkC,GAAe,CACnC,MAAMC,EAAQlB,EACX,gCAAgC,EAChC,KACChB,EAAK2B,GAAU,CACTA,EAAM,eAAiBnB,EAAa,YACtCyB,EAAW,SAAS,EACpBC,EAAM,YAAY,EAEtB,CAAC,CACH,EACC,UAAU,EAEb,MAAO,IAAM,CACXA,EAAM,YAAY,CACpB,CACF,CAAC,EAAE,KAAKjC,EAAQ+B,EAAM,aAAa,CAAC,EAKpC,sBAAuB,IAAMhB,EAAY,sBAAsB,EAC/D,sBAAwBW,GACtBX,EAAY,sBAAsBW,CAAK,EACzC,kBAAmB,IAAM,EAC3B,CACF,CACF",
|
6
6
|
"names": ["Left", "Right", "Observable", "tap", "timeout", "assign", "fromObservable", "fromPromise", "setup", "isSuccessCommandResult", "GetAppAndVersionCommand", "DeviceStatus", "UserInteractionRequired", "DEFAULT_UNLOCK_TIMEOUT_MS", "DeviceLockedError", "DeviceNotOnboardedError", "XStateDeviceAction", "DeviceSessionStateType", "GetDeviceStatusDeviceAction", "internalApi", "getAppAndVersion", "getDeviceSessionState", "setDeviceSessionState", "waitForDeviceUnlock", "isDeviceOnboarded", "unlockTimeout", "context", "_", "sessionState", "sessionStateType", "state", "args", "error", "currentApp", "currentAppVersion", "input", "subscriber", "inner"]
|
7
7
|
}
|
package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{interval as h,Observable as
|
1
|
+
import{interval as h,Observable as C}from"rxjs";import{CommandResultFactory as d}from"../../../command/model/CommandResult";import{GLOBAL_ERRORS as y,GlobalCommandError as V}from"../../../command/utils/GlobalCommandError";import{DeviceModelId as A}from"../../../device/DeviceModel";import{DeviceStatus as i}from"../../../device/DeviceStatus";import{makeDeviceActionInternalApiMock as u}from"../../../device-action/__test-utils__/makeInternalApi";import{testDeviceActionStates as p}from"../../../device-action/__test-utils__/testDeviceActionStates";import{DeviceActionStatus as t}from"../../../device-action/model/DeviceActionState";import{UserInteractionRequired as a}from"../../../device-action/model/UserInteractionRequired";import{DeviceLockedError as g,DeviceNotOnboardedError as x,UnknownDAError as T}from"../../../device-action/os/Errors";import{DeviceSessionStateType as s}from"../../../device-session/DeviceSessionState";import{GetDeviceStatusDeviceAction as l}from"./GetDeviceStatusDeviceAction";describe("GetDeviceStatusDeviceAction",()=>{const S=vi.fn(),v=vi.fn(),O=vi.fn(),R=vi.fn(),E=vi.fn();function D(){return{getAppAndVersion:S,getDeviceSessionState:v,waitForDeviceUnlock:O,setDeviceSessionState:R,isDeviceOnboarded:E}}const{sendCommand:w,getDeviceSessionState:N,getDeviceSessionStateObservable:f}=u();beforeEach(()=>{vi.resetAllMocks(),E.mockReturnValue(!0)}),describe("without overriding `extractDependencies`",()=>{it("should run the device action with an unlocked device",()=>new Promise((r,o)=>{const e=new l({input:{unlockTimeout:500}});N.mockReturnValue({sessionStateType:s.Connected,deviceStatus:i.CONNECTED,deviceModelId:A.NANO_X}),w.mockResolvedValue(d({data:{name:"BOLOS",version:"1.0.0"}}));const n=[{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"},status:t.Completed}];p(e,n,u(),{onDone:r,onError:o})})),it("should run the device action with a locked device",()=>new Promise((r,o)=>{const e=new l({input:{unlockTimeout:500}});N.mockReturnValue({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:A.NANO_X,isSecureConnectionAllowed:!1}),f.mockImplementation(()=>new C(c=>{const m=h(50).subscribe({next:k=>{k>2?(c.next({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:A.NANO_X,isSecureConnectionAllowed:!1}),c.complete()):c.next({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:A.NANO_X,isSecureConnectionAllowed:!1})}});return()=>{m.unsubscribe()}})),w.mockResolvedValueOnce(d({error:new V({...y[5515],errorCode:"5515"})})).mockResolvedValueOnce(d({data:{name:"BOLOS",version:"1.0.0"}}));const n=[{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{intermediateValue:{requiredUserInteraction:a.UnlockDevice},status:t.Pending},{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"},status:t.Completed}];p(e,n,u(),{onDone:r,onError:o})}))}),describe("success cases",()=>{it("should return the device status if the device is unlocked",()=>new Promise((r,o)=>{v.mockReturnValue({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),S.mockResolvedValue(d({data:{name:"BOLOS",version:"1.0.0"}}));const e=new l({input:{unlockTimeout:void 0}});vi.spyOn(e,"extractDependencies").mockReturnValue(D());const n=[{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{status:t.Completed,output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"}}];p(e,n,u(),{onDone:()=>{expect(R).toHaveBeenCalledWith({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.CONNECTED,currentApp:{name:"BOLOS",version:"1.0.0"}}),r()},onError:o})})),it("should return the device status and update session if the device is not ready",()=>new Promise((r,o)=>{v.mockReturnValue({sessionStateType:s.Connected,deviceStatus:i.CONNECTED}),S.mockResolvedValue(d({data:{name:"BOLOS",version:"1.0.0"}}));const e=new l({input:{unlockTimeout:void 0}});vi.spyOn(e,"extractDependencies").mockReturnValue(D());const n=[{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{status:t.Completed,output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"}}];p(e,n,u(),{onDone:()=>{expect(R).toHaveBeenCalledWith({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.CONNECTED,currentApp:{name:"BOLOS",version:"1.0.0"},installedApps:[],isSecureConnectionAllowed:!1}),r()},onError:o})})),it("should return the device status if the device is locked and the user unlocks the device",()=>new Promise((r,o)=>{v.mockReturnValue({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),S.mockResolvedValueOnce(d({error:new V({...y[5515],errorCode:"5515"})})).mockResolvedValueOnce(d({data:{name:"BOLOS",version:"1.0.0"}})),O.mockImplementation(()=>new C(c=>{const m=h(50).subscribe({next:k=>{k>2?(c.next({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),c.complete()):c.next({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}})}});return()=>{m.unsubscribe()}}));const e=new l({input:{unlockTimeout:500}});vi.spyOn(e,"extractDependencies").mockReturnValue(D());const n=[{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{intermediateValue:{requiredUserInteraction:a.UnlockDevice},status:t.Pending},{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{status:t.Completed,output:{currentApp:"BOLOS",currentAppVersion:"1.0.0"}}];p(e,n,u(),{onDone:r,onError:o})}))}),describe("errors cases",()=>{it("should end in an error if the device is not onboarded",()=>new Promise((r,o)=>{v.mockReturnValue({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),E.mockReturnValue(!1);const e=new l({input:{unlockTimeout:500}});vi.spyOn(e,"extractDependencies").mockReturnValue(D());const n=[{error:new x,status:t.Error}];p(e,n,u(),{onDone:r,onError:o})})),it("should end in an error if the device is locked and the user does not unlock",()=>new Promise((r,o)=>{v.mockReturnValue({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),S.mockResolvedValue(d({error:new V({...y[5515],errorCode:"5515"})})),f.mockImplementation(()=>new C(c=>{const m=h(200).subscribe({next:()=>{c.next({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:A.NANO_X,isSecureConnectionAllowed:!1})}});return()=>{m.unsubscribe()}}));const e=new l({input:{unlockTimeout:500}});vi.spyOn(e,"extractDependencies").mockReturnValue(D());const n=[{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{intermediateValue:{requiredUserInteraction:a.UnlockDevice},status:t.Pending},{error:new g("Device locked."),status:t.Error}];p(e,n,u(),{onDone:r,onError:o})})),it("should end in an error if the GetAppAndVersion command fails",()=>new Promise((r,o)=>{v.mockReturnValue({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}});const e=new V({...y[5501],errorCode:"5501"});S.mockResolvedValue(d({error:e})),O.mockImplementation(()=>new C(m=>{const k=h(50).subscribe({next:b=>{b>2?(m.next({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),m.complete()):m.next({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}})}});return()=>{k.unsubscribe()}}));const n=new l({input:{unlockTimeout:500}});vi.spyOn(n,"extractDependencies").mockReturnValue(D());const c=[{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{error:e,status:t.Error}];p(n,c,u(),{onDone:r,onError:o})})),it("should end in an error if getAppAndVersion actor throws an error",()=>new Promise((r,o)=>{v.mockReturnValue({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.LOCKED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"}}),S.mockImplementation(()=>{throw new T("error")}),O.mockImplementation(()=>new C(c=>{c.complete()}));const e=new l({input:{unlockTimeout:500}});vi.spyOn(e,"extractDependencies").mockReturnValue(D());const n=[{intermediateValue:{requiredUserInteraction:a.None},status:t.Pending},{error:new T("error"),status:t.Error}];p(e,n,u(),{onDone:r,onError:o})}))}),it("should emit a stopped state if the action is cancelled",()=>new Promise((r,o)=>{N.mockReturnValue({sessionStateType:s.ReadyWithoutSecureChannel,deviceStatus:i.CONNECTED,currentApp:{name:"mockedCurrentApp",version:"1.0.0"},installedApps:[],deviceModelId:A.NANO_X,isSecureConnectionAllowed:!1}),w.mockResolvedValue(d({data:{name:"BOLOS",version:"1.0.0"}}));const e=new l({input:{unlockTimeout:500}}),n=[{status:t.Pending,intermediateValue:{requiredUserInteraction:a.None}},{status:t.Stopped}],{cancel:c}=p(e,n,u(),{onDone:r,onError:o});c()}))});
|
2
2
|
//# sourceMappingURL=GetDeviceStatusDeviceAction.test.js.map
|