@ledgerhq/device-management-kit 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/cjs/package.json +1 -2
- 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/apdu/utils/ByteArrayBuilder.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
- package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
- package/lib/cjs/src/api/command/di/commandModule.js +1 -1
- package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
- package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
- package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
- 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/utils/CommandUtils.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.js.map +2 -2
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +2 -2
- package/lib/cjs/src/api/command/utils/GlobalCommandError.js +1 -1
- package/lib/cjs/src/api/command/utils/GlobalCommandError.js.map +2 -2
- package/lib/cjs/src/api/device/DeviceModel.js +1 -1
- package/lib/cjs/src/api/device/DeviceModel.js.map +2 -2
- package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
- package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
- package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
- package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
- 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 +1 -1
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
- package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
- package/lib/cjs/src/api/device-action/os/Errors.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +1 -1
- 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 +2 -2
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +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 +2 -2
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +1 -1
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +2 -2
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +1 -1
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +2 -2
- 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 +2 -2
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
- package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
- package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +1 -1
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
- package/lib/cjs/src/api/secure-channel/task/types.js +1 -1
- package/lib/cjs/src/api/secure-channel/task/types.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/utils.js +1 -1
- package/lib/cjs/src/api/secure-channel/utils.js.map +3 -3
- package/lib/cjs/src/api/secure-channel/utils.test.js +1 -1
- package/lib/cjs/src/api/secure-channel/utils.test.js.map +3 -3
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
- 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/utils/AppName.js +2 -0
- package/lib/cjs/src/api/utils/AppName.js.map +7 -0
- package/lib/cjs/src/api/utils/AppName.test.js +2 -0
- package/lib/cjs/src/api/utils/AppName.test.js.map +7 -0
- package/lib/cjs/src/api/utils/HexaString.js +1 -1
- package/lib/cjs/src/api/utils/HexaString.js.map +3 -3
- 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 +2 -2
- package/lib/cjs/src/internal/config/di/configModule.js +1 -1
- package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
- package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
- package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduReceiverService.js.map +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/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 +2 -2
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.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/secure-channel/di/secureChannelModule.js +1 -1
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
- package/lib/cjs/src/internal/secure-channel/model/Errors.js +1 -1
- package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +3 -3
- package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
- package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
- package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
- package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
- 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/transport/di/transportModule.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
- package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/esm/package.json +1 -2
- 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/apdu/utils/ByteArrayBuilder.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
- package/lib/esm/src/api/command/di/commandModule.js +1 -1
- package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
- package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
- package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
- 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/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 +2 -2
- package/lib/esm/src/api/command/utils/GlobalCommandError.js +1 -1
- package/lib/esm/src/api/command/utils/GlobalCommandError.js.map +2 -2
- package/lib/esm/src/api/device/DeviceModel.js +1 -1
- package/lib/esm/src/api/device/DeviceModel.js.map +2 -2
- package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
- package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
- package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
- package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
- 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 +1 -1
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/Errors.js +1 -1
- package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +2 -2
- 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 +2 -2
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +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/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +1 -1
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +3 -3
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +1 -1
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.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 +2 -2
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
- package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
- package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
- package/lib/esm/src/api/index.js +1 -1
- package/lib/esm/src/api/index.js.map +3 -3
- package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +2 -2
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +2 -2
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
- package/lib/esm/src/api/secure-channel/task/types.js +1 -1
- package/lib/esm/src/api/secure-channel/task/types.js.map +2 -2
- package/lib/esm/src/api/secure-channel/utils.js +1 -1
- package/lib/esm/src/api/secure-channel/utils.js.map +3 -3
- package/lib/esm/src/api/secure-channel/utils.test.js +1 -1
- package/lib/esm/src/api/secure-channel/utils.test.js.map +3 -3
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js +2 -0
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.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/utils/AppName.js +2 -0
- package/lib/esm/src/api/utils/AppName.js.map +7 -0
- package/lib/esm/src/api/utils/AppName.test.js +2 -0
- package/lib/esm/src/api/utils/AppName.test.js.map +7 -0
- package/lib/esm/src/api/utils/HexaString.js +1 -1
- package/lib/esm/src/api/utils/HexaString.js.map +3 -3
- 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 +2 -2
- package/lib/esm/src/internal/config/di/configModule.js +1 -1
- package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
- package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
- package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
- package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
- package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
- package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduReceiverService.js.map +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/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 +2 -2
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.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/secure-channel/di/secureChannelModule.js +1 -1
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
- package/lib/esm/src/internal/secure-channel/model/Errors.js +1 -1
- package/lib/esm/src/internal/secure-channel/model/Errors.js.map +3 -3
- package/lib/esm/src/internal/send/di/sendModule.js +1 -1
- package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
- package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
- package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
- 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/transport/di/transportModule.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
- package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/types/src/api/DeviceManagementKit.d.ts +4 -0
- package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +66 -0
- package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +1 -0
- package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts.map +1 -1
- package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
- package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
- package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
- package/lib/types/src/api/command/utils/CommandUtils.d.ts +3 -0
- package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
- package/lib/types/src/api/command/utils/GlobalCommandError.d.ts +1 -1
- package/lib/types/src/api/command/utils/GlobalCommandError.d.ts.map +1 -1
- package/lib/types/src/api/device/DeviceModel.d.ts +2 -1
- package/lib/types/src/api/device/DeviceModel.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
- package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
- package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +1 -0
- 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.map +1 -1
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +0 -1
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/Errors.d.ts +10 -0
- package/lib/types/src/api/device-action/os/Errors.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +2 -1
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +3 -2
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +0 -1
- package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +0 -1
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +0 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +2 -2
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -1
- package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts +1 -0
- package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
- package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
- package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
- package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
- package/lib/types/src/api/index.d.ts +1 -1
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +2 -1
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +2 -1
- package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +2 -1
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +2 -1
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +5 -2
- package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/task/types.d.ts +6 -1
- package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/utils.d.ts +0 -11
- package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +8 -7
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts +2 -0
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/Errors.d.ts +5 -0
- package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
- package/lib/types/src/api/utils/AppName.d.ts +2 -0
- package/lib/types/src/api/utils/AppName.d.ts.map +1 -0
- package/lib/types/src/api/utils/AppName.test.d.ts +2 -0
- package/lib/types/src/api/utils/AppName.test.d.ts.map +1 -0
- package/lib/types/src/api/utils/HexaString.d.ts +4 -3
- 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/internal/config/di/configModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/service/DefaultApduReceiverService.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
- package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
- package/lib/types/src/internal/secure-channel/model/Errors.d.ts +22 -2
- package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -1
- package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
- 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/di/transportModule.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +5 -6
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-model/data/StaticDeviceModelDataSource.test.ts"],
|
4
|
-
"sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\n\nimport { StaticDeviceModelDataSource } from \"./StaticDeviceModelDataSource\";\n\ndescribe(\"StaticDeviceModelDataSource\", () => {\n describe(\"getAllDeviceModels\", () => {\n it(\"should return all device models\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n const deviceModels = dataSource.getAllDeviceModels();\n\n
|
5
|
-
"mappings": "aAAA,IAAAA,EAA8B,mCAC9BC,EAA+B,kDAE/BC,EAA4C,yCAE5C,SAAS,8BAA+B,IAAM,CAC5C,SAAS,qBAAsB,IAAM,CACnC,GAAG,kCAAmC,IAAM,CAE1C,MAAMC,EADa,IAAI,8BAA4B,EACnB,mBAAmB,
|
4
|
+
"sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\n\nimport { StaticDeviceModelDataSource } from \"./StaticDeviceModelDataSource\";\n\ndescribe(\"StaticDeviceModelDataSource\", () => {\n describe(\"getAllDeviceModels\", () => {\n it(\"should return all device models\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n const deviceModels = dataSource.getAllDeviceModels();\n\n expect(deviceModels.length).toEqual(6);\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.APEX }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.STAX }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.FLEX }),\n );\n });\n });\n\n describe(\"getDeviceModel\", () => {\n it(\"should return the associated device model\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n\n const deviceModel1 = dataSource.getDeviceModel({\n id: DeviceModelId.NANO_S,\n });\n expect(deviceModel1).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n\n const deviceModel2 = dataSource.getDeviceModel({\n id: DeviceModelId.NANO_SP,\n });\n expect(deviceModel2).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n\n const deviceModel3 = dataSource.getDeviceModel({\n id: DeviceModelId.NANO_X,\n });\n expect(deviceModel3).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n\n const deviceModel4 = dataSource.getDeviceModel({\n id: DeviceModelId.STAX,\n });\n expect(deviceModel4).toEqual(\n expect.objectContaining({ id: DeviceModelId.STAX }),\n );\n\n const deviceModel5 = dataSource.getDeviceModel({\n id: DeviceModelId.FLEX,\n });\n expect(deviceModel5).toEqual(\n expect.objectContaining({ id: DeviceModelId.FLEX }),\n );\n });\n });\n\n describe(\"filterDeviceModels\", () => {\n it(\"should return the device models that match the given single parameter\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n\n const deviceModels1 = dataSource.filterDeviceModels({ usbOnly: true });\n expect(deviceModels1.length).toEqual(2);\n expect(deviceModels1).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n expect(deviceModels1).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n\n const deviceModels2 = dataSource.filterDeviceModels({\n usbProductId: 0x10,\n });\n expect(deviceModels2.length).toEqual(1);\n expect(deviceModels2[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n\n const deviceModels3 = dataSource.filterDeviceModels({\n usbProductId: 0x40,\n });\n expect(deviceModels3.length).toEqual(1);\n expect(deviceModels3[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n\n const deviceModels4 = dataSource.filterDeviceModels({\n usbProductId: 0x50,\n });\n expect(deviceModels4.length).toEqual(1);\n expect(deviceModels4[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n\n const deviceModels5 = dataSource.filterDeviceModels({\n usbProductId: 0x60,\n });\n expect(deviceModels5.length).toEqual(1);\n expect(deviceModels5[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.STAX }),\n );\n\n const deviceModels6 = dataSource.filterDeviceModels({\n usbProductId: 0x00,\n });\n expect(deviceModels6.length).toEqual(0);\n });\n\n it(\"should return the device models that match the given multiple parameters\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n\n const deviceModels1 = dataSource.filterDeviceModels({\n usbOnly: false,\n usbProductId: 0x40,\n });\n expect(deviceModels1.length).toEqual(1);\n expect(deviceModels1[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n\n const deviceModels2 = dataSource.filterDeviceModels({\n usbOnly: true,\n usbProductId: 0x50,\n });\n expect(deviceModels2.length).toEqual(1);\n expect(deviceModels2[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n\n // Nano S is usbOnly\n const deviceModels3 = dataSource.filterDeviceModels({\n usbOnly: false,\n usbProductId: 0x10,\n });\n expect(deviceModels3.length).toEqual(0);\n });\n });\n describe(\"getBluetoothServicesInfos\", () => {\n it(\"should return the ble service infos record\", () => {\n // given\n const dataSource = new StaticDeviceModelDataSource();\n // when\n const bleServiceInfos = dataSource.getBluetoothServicesInfos();\n // then\n expect(bleServiceInfos).toStrictEqual({\n \"13d63400-2c97-0004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.NANO_X }),\n \"13d63400-2c97-0004-0000-4c6564676572\",\n \"13d63400-2c97-0004-0002-4c6564676572\",\n \"13d63400-2c97-0004-0003-4c6564676572\",\n \"13d63400-2c97-0004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-6004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.STAX }),\n \"13d63400-2c97-6004-0000-4c6564676572\",\n \"13d63400-2c97-6004-0002-4c6564676572\",\n \"13d63400-2c97-6004-0003-4c6564676572\",\n \"13d63400-2c97-6004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-3004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.FLEX }),\n \"13d63400-2c97-3004-0000-4c6564676572\",\n \"13d63400-2c97-3004-0002-4c6564676572\",\n \"13d63400-2c97-3004-0003-4c6564676572\",\n \"13d63400-2c97-3004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-8004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.APEX }),\n \"13d63400-2c97-8004-0000-4c6564676572\",\n \"13d63400-2c97-8004-0002-4c6564676572\",\n \"13d63400-2c97-8004-0003-4c6564676572\",\n \"13d63400-2c97-8004-0001-4c6564676572\",\n ),\n });\n });\n });\n describe(\"getBluetoothServices\", () => {\n it(\"should return the bluetooth services\", () => {\n // given\n const dataSource = new StaticDeviceModelDataSource();\n // when\n const bleServices = dataSource.getBluetoothServices();\n // then\n expect(bleServices).toStrictEqual([\n \"13d63400-2c97-0004-0000-4c6564676572\",\n \"13d63400-2c97-6004-0000-4c6564676572\",\n \"13d63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AI,iBAC1CZ,EAAW,eAAe,CAAE,GAAI,gBAAc,MAAO,CAAC,EACtD,uCACA,uCACA,uCACA,sCACF,EACA,uCAAwC,IAAI,iBAC1CA,EAAW,eAAe,CAAE,GAAI,gBAAc,IAAK,CAAC,EACpD,uCACA,uCACA,uCACA,sCACF,EACA,uCAAwC,IAAI,iBAC1CA,EAAW,eAAe,CAAE,GAAI,gBAAc,IAAK,CAAC,EACpD,uCACA,uCACA,uCACA,sCACF,EACA,uCAAwC,IAAI,iBAC1CA,EAAW,eAAe,CAAE,GAAI,gBAAc,IAAK,CAAC,EACpD,uCACA,uCACA,uCACA,sCACF,CACF,CAAC,CACH,CAAC,CACH,CAAC,EACD,SAAS,uBAAwB,IAAM,CACrC,GAAG,uCAAwC,IAAM,CAI/C,MAAMa,EAFa,IAAI,8BAA4B,EAEpB,qBAAqB,EAEpD,OAAOA,CAAW,EAAE,cAAc,CAChC,uCACA,uCACA,uCACA,sCACF,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
|
6
6
|
"names": ["import_DeviceModel", "import_BleDeviceInfos", "import_StaticDeviceModelDataSource", "deviceModels", "dataSource", "deviceModel1", "deviceModel2", "deviceModel3", "deviceModel4", "deviceModel5", "deviceModels1", "deviceModels2", "deviceModels3", "deviceModels4", "deviceModels5", "deviceModels6", "bleServiceInfos", "bleServices"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var b=Object.create;var
|
1
|
+
"use strict";var b=Object.create;var s=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty;var S=(t,e)=>{for(var i in e)s(t,i,{get:e[i],enumerable:!0})},c=(t,e,i,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of m(e))!a.call(t,o)&&o!==i&&s(t,o,{get:()=>e[o],enumerable:!(d=n(e,o))||d.enumerable});return t};var h=(t,e,i)=>(i=t!=null?b(l(t)):{},c(e||!t||!t.__esModule?s(i,"default",{value:t,enumerable:!0}):i,t)),g=t=>c(s({},"__esModule",{value:!0}),t);var I={};S(I,{TransportDeviceModel:()=>U});module.exports=g(I);var u=h(require("semver")),r=require("../../device/DeviceModel");class U{id;productName;usbProductId;bootloaderUsbProductId;usbOnly;memorySize;blockSize;masks;bluetoothSpec;constructor(e){this.id=e.id,this.productName=e.productName,this.usbProductId=e.usbProductId,this.bootloaderUsbProductId=e.bootloaderUsbProductId,this.usbOnly=e.usbOnly,this.memorySize=e.memorySize,this.blockSize=e.blockSize,this.masks=e.masks,this.bluetoothSpec=e.bluetoothSpec}getBlockSize(e){switch(this.id){case r.DeviceModelId.NANO_S:return u.default.lt(u.default.coerce(e)??"","2.0.0")?4*1024:2*1024;case r.DeviceModelId.NANO_X:return 4*1024;case r.DeviceModelId.NANO_SP:case r.DeviceModelId.STAX:case r.DeviceModelId.FLEX:case r.DeviceModelId.APEX:return 32}}}0&&(module.exports={TransportDeviceModel});
|
2
2
|
//# sourceMappingURL=DeviceModel.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-model/model/DeviceModel.ts"],
|
4
|
-
"sourcesContent": ["import semver from \"semver\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\n/**\n * The info of a device model\n */\nexport class TransportDeviceModel {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n\n constructor(props: {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n }) {\n this.id = props.id;\n this.productName = props.productName;\n this.usbProductId = props.usbProductId;\n this.bootloaderUsbProductId = props.bootloaderUsbProductId;\n this.usbOnly = props.usbOnly;\n this.memorySize = props.memorySize;\n this.blockSize = props.blockSize;\n this.masks = props.masks;\n this.bluetoothSpec = props.bluetoothSpec;\n }\n\n getBlockSize(firmwareVersion: string): number {\n switch (this.id) {\n case DeviceModelId.NANO_S:\n return semver.lt(semver.coerce(firmwareVersion) ?? \"\", \"2.0.0\")\n ? 4 * 1024\n : 2 * 1024;\n case DeviceModelId.NANO_X:\n return 4 * 1024;\n case DeviceModelId.NANO_SP:\n case DeviceModelId.STAX:\n case DeviceModelId.FLEX:\n return 32;\n }\n }\n}\n"],
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmB,qBAEnBC,EAA8B,mCAKvB,MAAMH,CAAqB,CAChC,GACA,YACA,aACA,uBACA,QACA,WACA,UACA,MACA,cAOA,YAAYI,EAgBT,CACD,KAAK,GAAKA,EAAM,GAChB,KAAK,YAAcA,EAAM,YACzB,KAAK,aAAeA,EAAM,aAC1B,KAAK,uBAAyBA,EAAM,uBACpC,KAAK,QAAUA,EAAM,QACrB,KAAK,WAAaA,EAAM,WACxB,KAAK,UAAYA,EAAM,UACvB,KAAK,MAAQA,EAAM,MACnB,KAAK,cAAgBA,EAAM,aAC7B,CAEA,aAAaC,EAAiC,CAC5C,OAAQ,KAAK,GAAI,CACf,KAAK,gBAAc,OACjB,OAAO,EAAAC,QAAO,GAAG,EAAAA,QAAO,OAAOD,CAAe,GAAK,GAAI,OAAO,EAC1D,EAAI,KACJ,EAAI,KACV,KAAK,gBAAc,OACjB,MAAO,GAAI,KACb,KAAK,gBAAc,QACnB,KAAK,gBAAc,KACnB,KAAK,gBAAc,KACjB,MAAO,GACX,CACF,CACF",
|
4
|
+
"sourcesContent": ["import semver from \"semver\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\n/**\n * The info of a device model\n */\nexport class TransportDeviceModel {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n\n constructor(props: {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n }) {\n this.id = props.id;\n this.productName = props.productName;\n this.usbProductId = props.usbProductId;\n this.bootloaderUsbProductId = props.bootloaderUsbProductId;\n this.usbOnly = props.usbOnly;\n this.memorySize = props.memorySize;\n this.blockSize = props.blockSize;\n this.masks = props.masks;\n this.bluetoothSpec = props.bluetoothSpec;\n }\n\n getBlockSize(firmwareVersion: string): number {\n switch (this.id) {\n case DeviceModelId.NANO_S:\n return semver.lt(semver.coerce(firmwareVersion) ?? \"\", \"2.0.0\")\n ? 4 * 1024\n : 2 * 1024;\n case DeviceModelId.NANO_X:\n return 4 * 1024;\n case DeviceModelId.NANO_SP:\n case DeviceModelId.STAX:\n case DeviceModelId.FLEX:\n case DeviceModelId.APEX:\n return 32;\n }\n }\n}\n"],
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmB,qBAEnBC,EAA8B,mCAKvB,MAAMH,CAAqB,CAChC,GACA,YACA,aACA,uBACA,QACA,WACA,UACA,MACA,cAOA,YAAYI,EAgBT,CACD,KAAK,GAAKA,EAAM,GAChB,KAAK,YAAcA,EAAM,YACzB,KAAK,aAAeA,EAAM,aAC1B,KAAK,uBAAyBA,EAAM,uBACpC,KAAK,QAAUA,EAAM,QACrB,KAAK,WAAaA,EAAM,WACxB,KAAK,UAAYA,EAAM,UACvB,KAAK,MAAQA,EAAM,MACnB,KAAK,cAAgBA,EAAM,aAC7B,CAEA,aAAaC,EAAiC,CAC5C,OAAQ,KAAK,GAAI,CACf,KAAK,gBAAc,OACjB,OAAO,EAAAC,QAAO,GAAG,EAAAA,QAAO,OAAOD,CAAe,GAAK,GAAI,OAAO,EAC1D,EAAI,KACJ,EAAI,KACV,KAAK,gBAAc,OACjB,MAAO,GAAI,KACb,KAAK,gBAAc,QACnB,KAAK,gBAAc,KACnB,KAAK,gBAAc,KACnB,KAAK,gBAAc,KACjB,MAAO,GACX,CACF,CACF",
|
6
6
|
"names": ["DeviceModel_exports", "__export", "TransportDeviceModel", "__toCommonJS", "import_semver", "import_DeviceModel", "props", "firmwareVersion", "semver"]
|
7
7
|
}
|
package/lib/cjs/src/api/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var D=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var
|
1
|
+
"use strict";var D=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var de=Object.prototype.hasOwnProperty;var De=(p,o)=>{for(var i in o)D(p,i,{get:o[i],enumerable:!0})},d=(p,o,i,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of Ae(o))!de.call(p,s)&&s!==i&&D(p,s,{get:()=>o[s],enumerable:!(l=xe(o,s))||l.enumerable});return p},r=(p,o,i)=>(d(p,o,"default"),i&&d(i,o,"default"));var le=p=>d(D({},"__esModule",{value:!0}),p);var e={};De(e,{APDU_MAX_PAYLOAD:()=>c.APDU_MAX_PAYLOAD,Apdu:()=>u.Apdu,ApduBuilder:()=>c.ApduBuilder,ApduParser:()=>v.ApduParser,ApduResponse:()=>Y.ApduResponse,AppAlreadyInstalledDAError:()=>t.AppAlreadyInstalledDAError,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>q.BleDeviceInfos,ByteArrayBuilder:()=>S.ByteArrayBuilder,ByteArrayParser:()=>C.ByteArrayParser,CallTaskInAppDeviceAction:()=>T.CallTaskInAppDeviceAction,CloseAppCommand:()=>L.CloseAppCommand,CommandResultFactory:()=>n.CommandResultFactory,CommandResultStatus:()=>n.CommandResultStatus,CommandUtils:()=>I.CommandUtils,ConnectedDevice:()=>ae.ConnectedDevice,ConsoleLogger:()=>ne.ConsoleLogger,DeviceActionStatus:()=>b.DeviceActionStatus,DeviceConnectionStateMachine:()=>se.DeviceConnectionStateMachine,DeviceLockedError:()=>t.DeviceLockedError,DeviceManagementKit:()=>te.DeviceManagementKit,DeviceManagementKitBuilder:()=>pe.DeviceManagementKitBuilder,DeviceModel:()=>m.DeviceModel,DeviceModelId:()=>m.DeviceModelId,DeviceSessionStateType:()=>j.DeviceSessionStateType,DeviceStatus:()=>O.DeviceStatus,FramerUtils:()=>oe.FramerUtils,GenuineCheckDeviceAction:()=>z.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>g.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>U.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>P.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>B.GetOsVersionCommand,GlobalCommandError:()=>x.GlobalCommandError,GlobalCommandErrorHandler:()=>x.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>V.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>J.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>k.InstallOrUpdateAppsDeviceAction,InvalidStatusWordError:()=>y.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>m.LEDGER_VENDOR_ID,ListAppsCommand:()=>E.ListAppsCommand,ListAppsDeviceAction:()=>W.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>_.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>Q.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>G.LoadCertificateCommand,LogLevel:()=>ie.LogLevel,OpenAppCommand:()=>M.OpenAppCommand,OpenAppDeviceAction:()=>F.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>H.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>t.OutOfMemoryDAError,RefusedByUserDAError:()=>t.RefusedByUserDAError,SecureChannelError:()=>$.SecureChannelError,SendCommandInAppDeviceAction:()=>w.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>X.StaticDeviceModelDataSource,TransportConnectedDevice:()=>ce.TransportConnectedDevice,TransportDeviceModel:()=>N.TransportDeviceModel,UninstallAppDeviceAction:()=>Z.UninstallAppDeviceAction,UnknownDAError:()=>t.UnknownDAError,UnsupportedFirmwareDAError:()=>t.UnsupportedFirmwareDAError,UserInteractionRequired:()=>h.UserInteractionRequired,WebLogsExporterLogger:()=>me.WebLogsExporterLogger,XStateDeviceAction:()=>K.XStateDeviceAction,base64StringToBuffer:()=>A.base64StringToBuffer,bufferToHexaString:()=>a.bufferToHexaString,connectedDeviceStubBuilder:()=>fe.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>ee.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>re.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>a.hexaStringToBuffer,isBase64String:()=>A.isBase64String,isCommandErrorCode:()=>R.isCommandErrorCode,isHexaString:()=>a.isHexaString,isSuccessCommandResult:()=>n.isSuccessCommandResult});module.exports=le(e);var u=require("./apdu/model/Apdu"),c=require("./apdu/utils/ApduBuilder"),v=require("./apdu/utils/ApduParser");r(e,require("./apdu/utils/AppBuilderError"),module.exports);var S=require("./apdu/utils/ByteArrayBuilder"),C=require("./apdu/utils/ByteArrayParser"),y=require("./command/Errors"),n=require("./command/model/CommandResult"),L=require("./command/os/CloseAppCommand"),g=require("./command/os/GetAppAndVersionCommand"),f=require("./command/os/GetBatteryStatusCommand"),B=require("./command/os/GetOsVersionCommand"),E=require("./command/os/ListAppsCommand"),G=require("./command/os/LoadCertificateCommand"),M=require("./command/os/OpenAppCommand"),R=require("./command/utils/CommandErrors"),I=require("./command/utils/CommandUtils"),x=require("./command/utils/GlobalCommandError"),m=require("./device/DeviceModel"),O=require("./device/DeviceStatus"),b=require("./device-action/model/DeviceActionState"),h=require("./device-action/model/UserInteractionRequired"),T=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),t=require("./device-action/os/Errors"),U=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),P=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),V=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),k=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),W=require("./device-action/os/ListApps/ListAppsDeviceAction"),_=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),F=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),H=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),w=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),K=require("./device-action/xstate-utils/XStateDeviceAction"),X=require("./device-model/data/StaticDeviceModelDataSource"),q=require("./device-model/model/BleDeviceInfos"),N=require("./device-model/model/DeviceModel"),Y=require("./device-session/ApduResponse");r(e,require("./device-session/data/FramerConst"),module.exports);var j=require("./device-session/DeviceSessionState"),z=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),J=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),Q=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),Z=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),$=require("../internal/secure-channel/model/Errors"),ee=require("./device-session/service/DefaultApduReceiverService.stub"),re=require("./device-session/service/DefaultApduSenderService.stub"),oe=require("./device-session/utils/FramerUtils"),te=require("./DeviceManagementKit"),pe=require("./DeviceManagementKitBuilder");r(e,require("./Error"),module.exports);var ie=require("./logger-subscriber/model/LogLevel"),ne=require("./logger-subscriber/service/ConsoleLogger"),me=require("./logger-subscriber/service/WebLogsExporterLogger"),ae=require("./transport/model/ConnectedDevice"),se=require("./transport/model/DeviceConnectionStateMachine");r(e,require("./transport/model/Errors"),module.exports);var ce=require("./transport/model/TransportConnectedDevice"),fe=require("./transport/model/TransportConnectedDevice.stub");r(e,require("./types"),module.exports);var A=require("./utils/Base64String"),a=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,AppAlreadyInstalledDAError,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,RefusedByUserDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../src/api/index.ts"],
|
4
|
-
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport {\n DeviceLockedError,\n OutOfMemoryDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
5
|
-
"mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,
|
4
|
+
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
5
|
+
"mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,s5GAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAAuC,+BACvCC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1ChB,EAOO,wCACPiB,EAA8C,iFAC9CC,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAgD,qFAChDC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAAoD,6FACpDC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BhB,EAAqC,+CACrCiB,EAA6B,4CAC7BhC,EAAAN,EAAc,gDAxFd,gBAyFA,IAAAuC,EAGO,kDACPC,EAAyC,mFACzCC,EAAuC,+EACvCC,EAA8C,6FAC9CC,EAAyC,mFACzClC,EAAmC,iDAEnCmC,GAAsD,uEACtDC,GAAoD,qEACpDC,GAA4B,iDAC5BC,GAAoC,oCACpCC,GAA2C,2CAC3C1C,EAAAN,EAAc,sBAxGd,gBAyGA,IAAAiD,GAAyB,iDACzBC,GAA8B,wDAC9BC,GAAsC,gEACtCC,GAAgC,gDAChCC,GAGO,6DACP/C,EAAAN,EAAc,uCAjHd,gBAkHA,IAAAsD,GAAyC,yDACzCA,GAA2C,8DAC3ChD,EAAAN,EAAc,sBApHd,gBAqHA,IAAAuD,EAAqD,mCACrDC,EAIO",
|
6
6
|
"names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_Base64String", "import_HexaString"]
|
7
7
|
}
|
package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var g=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var O=(o,t)=>{for(var s in t)g(o,s,{get:t[s],enumerable:!0})},
|
1
|
+
"use strict";var g=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var O=(o,t)=>{for(var s in t)g(o,s,{get:t[s],enumerable:!0})},A=(o,t,s,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of x(t))!w.call(o,a)&&a!==s&&g(o,a,{get:()=>t[a],enumerable:!(u=I(t,a))||u.enumerable});return o};var F=o=>A(g({},"__esModule",{value:!0}),o);var M={};O(M,{GenuineCheckDeviceAction:()=>T});module.exports=F(M);var m=require("purify-ts"),n=require("xstate"),d=require("../../../command/model/CommandResult"),D=require("../../../command/os/GetOsVersionCommand"),l=require("../../../device-action/model/UserInteractionRequired"),V=require("../../../device-action/os/Const"),k=require("../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),C=require("../../../device-action/xstate-utils/XStateDeviceAction"),G=require("../../../device-session/DeviceSessionState"),f=require("../../../secure-channel/task/ConnectToSecureChannelTask"),h=require("../../../secure-channel/task/types"),E=require("../../../secure-channel/utils");class T extends C.XStateDeviceAction{makeStateMachine(t){const{getOsVersion:s,getDeviceVersion:u,getFirmwareVersion:a,genuineCheck:v,getDeviceSessionState:i,setDeviceSessionState:c}=this.extractDependencies(t),p=this.input.unlockTimeout??V.DEFAULT_UNLOCK_TIMEOUT_MS,S=new k.GoToDashboardDeviceAction({input:{unlockTimeout:p}}).makeStateMachine(t);return(0,n.setup)({types:{input:{},context:{},output:{}},actors:{goToDashboard:S,getOsVersion:(0,n.fromPromise)(s),getDeviceVersion:(0,n.fromPromise)(u),getFirmwareVersion:(0,n.fromPromise)(a),genuineCheck:(0,n.fromObservable)(v)},guards:{hasError:e=>e.context._internalState.error!==null},actions:{assignErrorFromEvent:(0,n.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"GenuineCheckDeviceAction",initial:"DeviceReady",context:e=>({input:{unlockTimeout:e.input.unlockTimeout},intermediateValue:{requiredUserInteraction:l.UserInteractionRequired.None},_internalState:{error:null,result:{isGenuine:!1},getOsVersionResponse:null,deviceVersion:null,firmwareVersion:null}}),states:{DeviceReady:{always:{target:"GoToDashboard"}},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:e=>({unlockTimeout:e.context.input.unlockTimeout}),onSnapshot:{actions:(0,n.assign)({intermediateValue:e=>({...e.context.intermediateValue,requiredUserInteraction:e.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetOsVersion"}]},GetOsVersion:{invoke:{id:"getOsVersion",src:"getOsVersion",input:e=>{},onDone:{target:"GetOsVersionCheck",actions:(0,n.assign)({_internalState:e=>{if((0,d.isSuccessCommandResult)(e.event.output)){const r=i(),y=e.event.output.data.secureElementFlags.isSecureConnectionAllowed;return r.sessionStateType!==G.DeviceSessionStateType.Connected&&c({...r,isSecureConnectionAllowed:y}),{...e.context._internalState,getOsVersionResponse:e.event.output.data}}return{...e.context._internalState,error:e.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetDeviceVersion"}]},GetDeviceVersion:{invoke:{id:"getDeviceVersion",src:"getDeviceVersion",input:e=>({deviceInfo:e.context._internalState.getOsVersionResponse}),onDone:{target:"GetDeviceVersionCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:r=>({...e.context._internalState,deviceVersion:r}),Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetDeviceVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetFirmwareVersion"}]},GetFirmwareVersion:{invoke:{id:"getFirmwareVersion",src:"getFirmwareVersion",input:e=>({deviceInfo:e.context._internalState.getOsVersionResponse,deviceVersion:e.context._internalState.deviceVersion}),onDone:{target:"GetFirmwareVersionCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:r=>({...e.context._internalState,firmwareVersion:r}),Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetFirmwareVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GenuineCheck"}]},GenuineCheck:{invoke:{id:"genuineCheck",src:"genuineCheck",input:e=>({deviceInfo:e.context._internalState.getOsVersionResponse,finalFirmware:e.context._internalState.firmwareVersion}),onSnapshot:{actions:(0,n.assign)({intermediateValue:e=>{switch(e.event.snapshot.context?.type){case h.SecureChannelEventType.PermissionRequested:return{requiredUserInteraction:l.UserInteractionRequired.AllowSecureConnection};case h.SecureChannelEventType.PermissionGranted:return{requiredUserInteraction:l.UserInteractionRequired.None};default:return{...e.context.intermediateValue}}},_internalState:e=>e.event.snapshot.context?.type===h.SecureChannelEventType.Error?{...e.context._internalState,error:e.event.snapshot.context.error.mapDAErrors()}:e.event.snapshot.context?.type===h.SecureChannelEventType.Result?{...e.context._internalState,result:{isGenuine:(0,E.isDeviceGenuine)(e.event.snapshot.context.payload)}}:e.context._internalState})},onDone:{target:"GenuineCheckCheck"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GenuineCheckCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success"}]},Success:{type:"final"},Error:{type:"final"}},output:e=>e.context._internalState.error?(0,m.Left)(e.context._internalState.error):(0,m.Right)(e.context._internalState.result)})}extractDependencies(t){return{getOsVersion:()=>t.sendCommand(new D.GetOsVersionCommand),getDeviceVersion:({input:i})=>{const{deviceInfo:c}=i;return t.getManagerApiService().getDeviceVersion(c)},getFirmwareVersion:({input:i})=>{const{deviceInfo:c,deviceVersion:p}=i;return t.getManagerApiService().getFirmwareVersion(c,p)},genuineCheck:({input:i})=>{const{deviceInfo:c,finalFirmware:p}=i,S=t.getSecureChannelService().genuineCheck(c,p);return new f.ConnectToSecureChannelTask(t,{connection:S}).run()},getDeviceSessionState:()=>t.getDeviceSessionState(),setDeviceSessionState:i=>t.setDeviceSessionState(i)}}}0&&(module.exports={GenuineCheckDeviceAction});
|
2
2
|
//# sourceMappingURL=GenuineCheckDeviceAction.js.map
|
package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\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 { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\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\";\nimport {\n type GenuineCheckDAError,\n type GenuineCheckDAInput,\n type GenuineCheckDAIntermediateValue,\n type GenuineCheckDAOutput,\n type GenuineCheckStateMachineInternalState,\n type MachineDependencies,\n} from \"@api/secure-channel/device-action/GenuineCheck/types\";\nimport { ConnectToSecureChannelTask } from \"@api/secure-channel/task/ConnectToSecureChannelTask\";\nimport { SecureChannelEventType } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport { isDeviceGenuine } from \"@api/secure-channel/utils\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\n\nexport class GenuineCheckDeviceAction extends XStateDeviceAction<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n> {\n override makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n > {\n type types = StateMachineTypes<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n >;\n\n const {\n getOsVersion,\n getDeviceVersion,\n getFirmwareVersion,\n genuineCheck,\n getDeviceSessionState,\n setDeviceSessionState,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const goToDashboardMachine = new GoToDashboardDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(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 goToDashboard: goToDashboardMachine,\n getOsVersion: fromPromise(getOsVersion),\n getDeviceVersion: fromPromise(getDeviceVersion),\n getFirmwareVersion: fromPromise(getFirmwareVersion),\n genuineCheck: fromObservable(genuineCheck),\n },\n guards: {\n hasError: (_) => _.context._internalState.error !== null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"],\n }),\n }),\n },\n }).createMachine({\n /** @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zEWZ1xPm6Q8QiJSSwdkcDUMQohAA */\n id: \"GenuineCheckDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n error: null,\n result: { isGenuine: false },\n getOsVersionResponse: null,\n deviceVersion: null,\n firmwareVersion: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"GoToDashboard\",\n },\n },\n GoToDashboard: {\n invoke: {\n id: \"goToDashboard\",\n src: \"goToDashboard\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"GoToDashboardCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GoToDashboardCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetOsVersion\",\n },\n ],\n },\n GetOsVersion: {\n invoke: {\n id: \"getOsVersion\",\n src: \"getOsVersion\",\n input: (_) => undefined,\n onDone: {\n target: \"GetOsVersionCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const currentState: DeviceSessionState =\n getDeviceSessionState();\n const isSecureConnectionAllowed =\n _.event.output.data.secureElementFlags\n .isSecureConnectionAllowed;\n if (\n currentState.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...currentState,\n isSecureConnectionAllowed,\n });\n }\n return {\n ..._.context._internalState,\n getOsVersionResponse: _.event.output.data,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n },\n },\n GetOsVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetDeviceVersion\",\n },\n ],\n },\n GetDeviceVersion: {\n invoke: {\n id: \"getDeviceVersion\",\n src: \"getDeviceVersion\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n }),\n onDone: {\n target: \"GetDeviceVersionCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: (deviceVersion) => ({\n ..._.context._internalState,\n deviceVersion,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetDeviceVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n { target: \"GetFirmwareVersion\" },\n ],\n },\n GetFirmwareVersion: {\n invoke: {\n id: \"getFirmwareVersion\",\n src: \"getFirmwareVersion\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n deviceVersion: _.context._internalState.deviceVersion!,\n }),\n onDone: {\n target: \"GetFirmwareVersionCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: (firmwareVersion) => ({\n ..._.context._internalState,\n firmwareVersion,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetFirmwareVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n { target: \"GenuineCheck\" },\n ],\n },\n GenuineCheck: {\n invoke: {\n id: \"genuineCheck\",\n src: \"genuineCheck\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n finalFirmware: _.context._internalState.firmwareVersion!,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => {\n switch (_.event.snapshot.context?.type) {\n case SecureChannelEventType.PermissionRequested: {\n return {\n requiredUserInteraction:\n UserInteractionRequired.AllowSecureConnection,\n };\n }\n case SecureChannelEventType.PermissionGranted: {\n return {\n requiredUserInteraction: UserInteractionRequired.None,\n };\n }\n default:\n return {\n ..._.context.intermediateValue,\n };\n }\n },\n _internalState: (_) => {\n if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Result\n ) {\n return {\n ..._.context._internalState,\n result: {\n isGenuine: isDeviceGenuine(\n _.event.snapshot.context.payload,\n ),\n },\n };\n }\n return _.context._internalState;\n },\n }),\n },\n onDone: {\n target: \"GenuineCheckCheck\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GenuineCheckCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (_) => {\n if (_.context._internalState.error) {\n return Left(_.context._internalState.error);\n } else {\n return Right(_.context._internalState.result);\n }\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getOsVersion = () =>\n internalApi.sendCommand(new GetOsVersionCommand());\n\n const getDeviceVersion = ({\n input,\n }: Input<{ deviceInfo: GetOsVersionResponse }>) => {\n const { deviceInfo } = input;\n return internalApi.getManagerApiService().getDeviceVersion(deviceInfo);\n };\n\n const getFirmwareVersion = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n deviceVersion: DeviceVersion;\n }>) => {\n const { deviceInfo, deviceVersion } = input;\n return internalApi\n .getManagerApiService()\n .getFirmwareVersion(deviceInfo, deviceVersion);\n };\n\n const genuineCheck = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n finalFirmware: FinalFirmware;\n }>) => {\n const { deviceInfo, finalFirmware } = input;\n const eitherConnection = internalApi\n .getSecureChannelService()\n .genuineCheck(deviceInfo, finalFirmware);\n return new ConnectToSecureChannelTask(internalApi, {\n connection: eitherConnection,\n }).run();\n };\n\n return {\n getOsVersion,\n getDeviceVersion,\n getFirmwareVersion,\n genuineCheck,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2D,kBAE3DC,EAAuC,4CACvCC,EAGO,+CAEPC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAA0C,yEAE1CC,EAGO,8DACPC,EAGO,kDASPC,EAA2C,+DAC3CC,EAAuC,0CAEvCC,EAAgC,qCAIzB,MAAMb,UAAiC,oBAM5C,CACS,iBACPc,EAOA,CASA,KAAM,CACJ,aAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,aAAAC,EACA,sBAAAC,EACA,sBAAAC,CACF,EAAI,KAAK,oBAAoBN,CAAW,EAElCO,EAAgB,KAAK,MAAM,eAAiB,4BAE5CC,EAAuB,IAAI,4BAA0B,CACzD,MAAO,CACL,cAAAD,CACF,CACF,CAAC,EAAE,iBAAiBP,CAAW,EAE/B,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,cAAeQ,EACf,gBAAc,eAAYP,CAAY,EACtC,oBAAkB,eAAYC,CAAgB,EAC9C,sBAAoB,eAAYC,CAAkB,EAClD,gBAAc,kBAAeC,CAAY,CAC3C,EACA,OAAQ,CACN,SAAWK,GAAMA,EAAE,QAAQ,eAAe,QAAU,IACtD,EACA,QAAS,CACP,wBAAsB,UAAO,CAC3B,eAAiBA,IAAO,CACtB,GAAGA,EAAE,QAAQ,eACb,MAAOA,EAAE,MAAM,KACjB,EACF,CAAC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BAAqB,EAAE,iBAAiBgB,CAAU,CACvE,EAgCE,mBA9ByB,CAAC,CAC1B,MAAAD,CACF,IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,cAAAH,CAAc,EAAIE,EACtC,OAAOf,EACJ,qBAAqB,EACrB,mBAAmBgB,EAAYH,CAAa,CACjD,EAqBE,aAnBmB,CAAC,CACpB,MAAAE,CACF,IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,cAAAC,CAAc,EAAIF,EAChCG,EAAmBlB,EACtB,wBAAwB,EACxB,aAAagB,EAAYC,CAAa,EACzC,OAAO,IAAI,6BAA2BjB,EAAa,CACjD,WAAYkB,CACd,CAAC,EAAE,IAAI,CACT,EAOE,sBAAuB,IAAMlB,EAAY,sBAAsB,EAC/D,sBAAwBmB,GACtBnB,EAAY,sBAAsBmB,CAAK,CAC3C,CACF,CACF",
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\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 { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\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\";\nimport {\n type GenuineCheckDAError,\n type GenuineCheckDAInput,\n type GenuineCheckDAIntermediateValue,\n type GenuineCheckDAOutput,\n type GenuineCheckStateMachineInternalState,\n type MachineDependencies,\n} from \"@api/secure-channel/device-action/GenuineCheck/types\";\nimport { ConnectToSecureChannelTask } from \"@api/secure-channel/task/ConnectToSecureChannelTask\";\nimport { SecureChannelEventType } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport { isDeviceGenuine } from \"@api/secure-channel/utils\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\n\nexport class GenuineCheckDeviceAction extends XStateDeviceAction<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n> {\n override makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n > {\n type types = StateMachineTypes<\n GenuineCheckDAOutput,\n GenuineCheckDAInput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue,\n GenuineCheckStateMachineInternalState\n >;\n\n const {\n getOsVersion,\n getDeviceVersion,\n getFirmwareVersion,\n genuineCheck,\n getDeviceSessionState,\n setDeviceSessionState,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const goToDashboardMachine = new GoToDashboardDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(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 goToDashboard: goToDashboardMachine,\n getOsVersion: fromPromise(getOsVersion),\n getDeviceVersion: fromPromise(getDeviceVersion),\n getFirmwareVersion: fromPromise(getFirmwareVersion),\n genuineCheck: fromObservable(genuineCheck),\n },\n guards: {\n hasError: (_) => _.context._internalState.error !== null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"],\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QHEwDsCuBLNYDCAFmAMYDWAImAG5bFgCCxALlgPZoB0lNdASmAEMIATwDEAbQAMAXUSgADq1hYW7OSAAeiAIwB2AGwAWDvskBOAKwAmC9YvbJADkMAaEMMQBmT2ZPazuo6SFp6SDpKG+gC+UW6omDj4RGTctAzMbJzIrAAqrOQCsAQARqwCAE4QohDsYBw4VKykdVC5+YUlZZVSskggisqqaOpaCFaGntocEwaOFkYR2oa6bh4IZsEcuta6Nmbajp76tjFx6Ni4hCQU1GmMQxzZeQVFpRVVYOXlrOUc8gA2AiYADMfgBbDitZ4dN7dGTqAYqTIjRDjSbTTyzeaGRbLVaIOa6LY7PYHI4nWIgeIXJLXVJ0e6ZR5tF6dd5XMgSeF9RFDFFjQ5WExhXQbYKGRxWKwrdyoo4cbT+UUOQz+UyeU5U86JDk3HjpB5PdqvLoQXUSbS9BRKJFqPqjKyC4V6MUWCVSmVrfySBVKsxSyxmAKSaKU6k65J6u4ZdiPMBMADysAAap9lOxqrV6mhGs1IfGk6nyum0D0ETa+favJFPNNDBtHAcQ8cQ-j1qEOJ43d5JMFG8dDJrw5dI-SDUzUImU2nMuayzyK8iq2NDELtoFVWZ9JilmY2-X9BxnNvbLYjBMzEPtSO6bcGTGsgXp8XZ5GLVb+ou7aAHaviRu1R3es220Kx-A4EMbEmVcg0kaUrwSG8UjvcdY0nMcixLTNcGzXMWnjDCZ3YedrUGJcf0QAxjElRZMWcSx5hAqxzA4Cw5i3XtRWcKUEJpXUx0ZNCCJQzDMlET5vl+AEgVBcoIRgJhCJfYjuVI21hmXKij2Y1U6PrM8230bQLE7Gs3X9MxVwpM5ENpZD9UEx9FJEoi0DnVTPzI79NB0MChSOXZRS7SQjn0Nt11Y3Z-U48xpQsXiI1vByHzjZz9VE9g50tcsvI0iiEFA0DO30QKzGC0KmJ8LYrH2OYLH2QwLF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yjFjEsD0+Yug9AzFhp4ECBghQ4qMuclsl9dmwM4AAUQeuUQ5+VvA1S2JKbOzEWZ1xPm6Q8QiJSSwdkcDUMQohAA */\n id: \"GenuineCheckDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: {\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n error: null,\n result: { isGenuine: false },\n getOsVersionResponse: null,\n deviceVersion: null,\n firmwareVersion: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: {\n target: \"GoToDashboard\",\n },\n },\n GoToDashboard: {\n invoke: {\n id: \"goToDashboard\",\n src: \"goToDashboard\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"GoToDashboardCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GoToDashboardCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetOsVersion\",\n },\n ],\n },\n GetOsVersion: {\n invoke: {\n id: \"getOsVersion\",\n src: \"getOsVersion\",\n input: (_) => undefined,\n onDone: {\n target: \"GetOsVersionCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const currentState: DeviceSessionState =\n getDeviceSessionState();\n const isSecureConnectionAllowed =\n _.event.output.data.secureElementFlags\n .isSecureConnectionAllowed;\n if (\n currentState.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...currentState,\n isSecureConnectionAllowed,\n });\n }\n return {\n ..._.context._internalState,\n getOsVersionResponse: _.event.output.data,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n },\n },\n GetOsVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetDeviceVersion\",\n },\n ],\n },\n GetDeviceVersion: {\n invoke: {\n id: \"getDeviceVersion\",\n src: \"getDeviceVersion\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n }),\n onDone: {\n target: \"GetDeviceVersionCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: (deviceVersion) => ({\n ..._.context._internalState,\n deviceVersion,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetDeviceVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n { target: \"GetFirmwareVersion\" },\n ],\n },\n GetFirmwareVersion: {\n invoke: {\n id: \"getFirmwareVersion\",\n src: \"getFirmwareVersion\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n deviceVersion: _.context._internalState.deviceVersion!,\n }),\n onDone: {\n target: \"GetFirmwareVersionCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<GenuineCheckStateMachineInternalState>({\n Right: (firmwareVersion) => ({\n ..._.context._internalState,\n firmwareVersion,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetFirmwareVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n { target: \"GenuineCheck\" },\n ],\n },\n GenuineCheck: {\n invoke: {\n id: \"genuineCheck\",\n src: \"genuineCheck\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n finalFirmware: _.context._internalState.firmwareVersion!,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => {\n switch (_.event.snapshot.context?.type) {\n case SecureChannelEventType.PermissionRequested: {\n return {\n requiredUserInteraction:\n UserInteractionRequired.AllowSecureConnection,\n };\n }\n case SecureChannelEventType.PermissionGranted: {\n return {\n requiredUserInteraction: UserInteractionRequired.None,\n };\n }\n default:\n return {\n ..._.context.intermediateValue,\n };\n }\n },\n _internalState: (_) => {\n if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Error\n ) {\n return {\n ..._.context._internalState,\n error: _.event.snapshot.context.error.mapDAErrors(),\n };\n } else if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Result\n ) {\n return {\n ..._.context._internalState,\n result: {\n isGenuine: isDeviceGenuine(\n _.event.snapshot.context.payload,\n ),\n },\n };\n }\n return _.context._internalState;\n },\n }),\n },\n onDone: {\n target: \"GenuineCheckCheck\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GenuineCheckCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (_) => {\n if (_.context._internalState.error) {\n return Left(_.context._internalState.error);\n } else {\n return Right(_.context._internalState.result);\n }\n },\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getOsVersion = () =>\n internalApi.sendCommand(new GetOsVersionCommand());\n\n const getDeviceVersion = ({\n input,\n }: Input<{ deviceInfo: GetOsVersionResponse }>) => {\n const { deviceInfo } = input;\n return internalApi.getManagerApiService().getDeviceVersion(deviceInfo);\n };\n\n const getFirmwareVersion = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n deviceVersion: DeviceVersion;\n }>) => {\n const { deviceInfo, deviceVersion } = input;\n return internalApi\n .getManagerApiService()\n .getFirmwareVersion(deviceInfo, deviceVersion);\n };\n\n const genuineCheck = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n finalFirmware: FinalFirmware;\n }>) => {\n const { deviceInfo, finalFirmware } = input;\n const eitherConnection = internalApi\n .getSecureChannelService()\n .genuineCheck(deviceInfo, finalFirmware);\n return new ConnectToSecureChannelTask(internalApi, {\n connection: eitherConnection,\n }).run();\n };\n\n return {\n getOsVersion,\n getDeviceVersion,\n getFirmwareVersion,\n genuineCheck,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state: DeviceSessionState) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2D,kBAE3DC,EAAuC,4CACvCC,EAGO,+CAEPC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAA0C,yEAE1CC,EAGO,8DACPC,EAGO,kDASPC,EAA2C,+DAC3CC,EAAuC,0CAEvCC,EAAgC,qCAIzB,MAAMb,UAAiC,oBAM5C,CACS,iBACPc,EAOA,CASA,KAAM,CACJ,aAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,aAAAC,EACA,sBAAAC,EACA,sBAAAC,CACF,EAAI,KAAK,oBAAoBN,CAAW,EAElCO,EAAgB,KAAK,MAAM,eAAiB,4BAE5CC,EAAuB,IAAI,4BAA0B,CACzD,MAAO,CACL,cAAAD,CACF,CACF,CAAC,EAAE,iBAAiBP,CAAW,EAE/B,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,cAAeQ,EACf,gBAAc,eAAYP,CAAY,EACtC,oBAAkB,eAAYC,CAAgB,EAC9C,sBAAoB,eAAYC,CAAkB,EAClD,gBAAc,kBAAeC,CAAY,CAC3C,EACA,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ACHA,EAAE,QAAQ,eAAe,SACpB,QAAKA,EAAE,QAAQ,eAAe,KAAK,KAEnC,SAAMA,EAAE,QAAQ,eAAe,MAAM,CAGlD,CAAC,CACH,CAEA,oBAAoBT,EAA+C,CAsCjE,MAAO,CACL,aAtCmB,IACnBA,EAAY,YAAY,IAAI,qBAAqB,EAsCjD,iBApCuB,CAAC,CACxB,MAAAe,CACF,IAAmD,CACjD,KAAM,CAAE,WAAAC,CAAW,EAAID,EACvB,OAAOf,EAAY,qBAAqB,EAAE,iBAAiBgB,CAAU,CACvE,EAgCE,mBA9ByB,CAAC,CAC1B,MAAAD,CACF,IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,cAAAH,CAAc,EAAIE,EACtC,OAAOf,EACJ,qBAAqB,EACrB,mBAAmBgB,EAAYH,CAAa,CACjD,EAqBE,aAnBmB,CAAC,CACpB,MAAAE,CACF,IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,cAAAC,CAAc,EAAIF,EAChCG,EAAmBlB,EACtB,wBAAwB,EACxB,aAAagB,EAAYC,CAAa,EACzC,OAAO,IAAI,6BAA2BjB,EAAa,CACjD,WAAYkB,CACd,CAAC,EAAE,IAAI,CACT,EAOE,sBAAuB,IAAMlB,EAAY,sBAAsB,EAC/D,sBAAwBmB,GACtBnB,EAAY,sBAAsBmB,CAAK,CAC3C,CACF,CACF",
|
6
6
|
"names": ["GenuineCheckDeviceAction_exports", "__export", "GenuineCheckDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_GetOsVersionCommand", "import_UserInteractionRequired", "import_Const", "import_GoToDashboardDeviceAction", "import_XStateDeviceAction", "import_DeviceSessionState", "import_ConnectToSecureChannelTask", "import_types", "import_utils", "internalApi", "getOsVersion", "getDeviceVersion", "getFirmwareVersion", "genuineCheck", "getDeviceSessionState", "setDeviceSessionState", "unlockTimeout", "goToDashboardMachine", "_", "error", "currentState", "isSecureConnectionAllowed", "deviceVersion", "firmwareVersion", "input", "deviceInfo", "finalFirmware", "eitherConnection", "state"]
|
7
7
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/secure-channel/device-action/GenuineCheck/types.ts"],
|
4
|
-
"sourcesContent": ["import { type EitherAsync } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport {\n type GetOsVersionCommandResult,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { type UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { type SecureChannelEvent } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport {\n type CommandErrorResult,\n type DeviceSessionState,\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n} from \"@api/types\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\n\nexport type GenuineCheckDAOutput = { isGenuine: boolean };\n\nexport type GenuineCheckDAInput = GoToDashboardDAInput;\n\nexport type GenuineCheckDAError =\n | CommandErrorResult[\"error\"]\n | GoToDashboardDAError\n | HttpFetchApiError\n | UnknownDAError;\n\nexport type GenuineCheckDARequiredInteraction =\n | UserInteractionRequired.None\n | UserInteractionRequired.UnlockDevice\n | UserInteractionRequired.AllowSecureConnection;\n\nexport type GenuineCheckDAIntermediateValue = {\n requiredUserInteraction: GenuineCheckDARequiredInteraction;\n};\n\nexport type GenuineCheckDAState = DeviceActionState<\n GenuineCheckDAOutput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue\n>;\n\nexport type GenuineCheckStateMachineInternalState = {\n error: GenuineCheckDAError | null;\n result: { isGenuine: boolean };\n getOsVersionResponse: GetOsVersionResponse | null;\n deviceVersion: DeviceVersion | null;\n firmwareVersion: FinalFirmware | null;\n};\n\nexport type MachineDependencies = {\n getOsVersion: () => Promise<GetOsVersionCommandResult>;\n getDeviceVersion: (\n args: Input<{ deviceInfo: GetOsVersionResponse }>,\n ) => EitherAsync<HttpFetchApiError, DeviceVersion>;\n getFirmwareVersion: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n deviceVersion: DeviceVersion;\n }>,\n ) => EitherAsync<HttpFetchApiError, FinalFirmware>;\n genuineCheck: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n finalFirmware: FinalFirmware;\n }>,\n ) => Observable<SecureChannelEvent>;\n getDeviceSessionState: () => DeviceSessionState;\n setDeviceSessionState: (state: DeviceSessionState) => DeviceSessionState;\n};\n"],
|
4
|
+
"sourcesContent": ["import { type EitherAsync } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport {\n type GetOsVersionCommandResult,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { type UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { type SecureChannelEvent } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport {\n type CommandErrorResult,\n type DeviceSessionState,\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n} from \"@api/types\";\nimport { type DeviceVersion } from \"@internal/manager-api/model/Device\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\nimport { type FinalFirmware } from \"@internal/manager-api/model/Firmware\";\nimport type { SecureChannelDAErrors } from \"@internal/secure-channel/model/Errors\";\n\nexport type GenuineCheckDAOutput = { isGenuine: boolean };\n\nexport type GenuineCheckDAInput = GoToDashboardDAInput;\n\nexport type GenuineCheckDAError =\n | CommandErrorResult[\"error\"]\n | GoToDashboardDAError\n | HttpFetchApiError\n | SecureChannelDAErrors\n | UnknownDAError;\n\nexport type GenuineCheckDARequiredInteraction =\n | UserInteractionRequired.None\n | UserInteractionRequired.UnlockDevice\n | UserInteractionRequired.AllowSecureConnection;\n\nexport type GenuineCheckDAIntermediateValue = {\n requiredUserInteraction: GenuineCheckDARequiredInteraction;\n};\n\nexport type GenuineCheckDAState = DeviceActionState<\n GenuineCheckDAOutput,\n GenuineCheckDAError,\n GenuineCheckDAIntermediateValue\n>;\n\nexport type GenuineCheckStateMachineInternalState = {\n error: GenuineCheckDAError | null;\n result: { isGenuine: boolean };\n getOsVersionResponse: GetOsVersionResponse | null;\n deviceVersion: DeviceVersion | null;\n firmwareVersion: FinalFirmware | null;\n};\n\nexport type MachineDependencies = {\n getOsVersion: () => Promise<GetOsVersionCommandResult>;\n getDeviceVersion: (\n args: Input<{ deviceInfo: GetOsVersionResponse }>,\n ) => EitherAsync<HttpFetchApiError, DeviceVersion>;\n getFirmwareVersion: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n deviceVersion: DeviceVersion;\n }>,\n ) => EitherAsync<HttpFetchApiError, FinalFirmware>;\n genuineCheck: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n finalFirmware: FinalFirmware;\n }>,\n ) => Observable<SecureChannelEvent>;\n getDeviceSessionState: () => DeviceSessionState;\n setDeviceSessionState: (state: DeviceSessionState) => DeviceSessionState;\n};\n"],
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
6
6
|
"names": ["types_exports", "__toCommonJS"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var S=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var M=(r,n)=>{for(var i in n)S(r,i,{get:n[i],enumerable:!0})},C=(r,n,i,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of O(n))!k.call(r,o)&&o!==i&&S(r,o,{get:()=>n[o],enumerable:!(l=L(n,o))||l.enumerable});return r};var N=r=>C(S({},"__esModule",{value:!0}),r);var R={};M(R,{InstallAppDeviceAction:()=>G});module.exports=N(R);var d=require("purify-ts"),a=require("xstate"),
|
1
|
+
"use strict";var S=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var M=(r,n)=>{for(var i in n)S(r,i,{get:n[i],enumerable:!0})},C=(r,n,i,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of O(n))!k.call(r,o)&&o!==i&&S(r,o,{get:()=>n[o],enumerable:!(l=L(n,o))||l.enumerable});return r};var N=r=>C(S({},"__esModule",{value:!0}),r);var R={};M(R,{InstallAppDeviceAction:()=>G});module.exports=N(R);var d=require("purify-ts"),a=require("xstate"),h=require("../../../command/model/CommandResult"),D=require("../../../command/os/GetOsVersionCommand"),v=require("../../../device-action/model/UserInteractionRequired"),f=require("../../../device-action/os/Const"),m=require("../../../device-action/os/Errors"),x=require("../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),y=require("../../../device-action/xstate-utils/XStateDeviceAction"),I=require("../../../device-session/DeviceSessionState"),E=require("../../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),V=require("../../../secure-channel/task/ConnectToSecureChannelTask"),g=require("../../../secure-channel/task/types");class G extends y.XStateDeviceAction{makeStateMachine(n){const{getOsVersion:i,getAppList:l,installApp:o,getDeviceSessionState:s,setDeviceSessionState:p}=this.extractDependencies(n),u=this.input.unlockTimeout??f.DEFAULT_UNLOCK_TIMEOUT_MS,A=new E.ListInstalledAppsDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n),T=new x.GoToDashboardDeviceAction({input:{unlockTimeout:u}}).makeStateMachine(n);return(0,a.setup)({types:{input:{},context:{},output:{}},actors:{listInstalledApps:A,goToDashboard:T,getOsVersion:(0,a.fromPromise)(i),getAppList:(0,a.fromPromise)(l),installApp:(0,a.fromObservable)(o)},guards:{hasError:t=>t.context._internalState.error!==null,appInstalled:t=>t.context._internalState.installedApps.some(e=>e.name===t.context.input.appName),appNotFound:t=>t.context._internalState.appList.findIndex(({versionName:e})=>e===t.context.input.appName)===-1,depAppNotInstalled:t=>{const e=t.context._internalState.appList.find(({versionName:c})=>c===t.context.input.appName);return e?.parentName?t.context._internalState.installedApps.findIndex(({name:c})=>c===e.parentName)===-1:!1}},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:t.event.error})}),assignAppNotFound:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new m.UnknownDAError("App to install not found in manager API")})}),assignDepAppNotInstalled:(0,a.assign)({_internalState:t=>({...t.context._internalState,error:new m.UnknownDAError("Dep app is not installed on the device")})}),cleanupDeviceState:()=>{const t=s();t.sessionStateType!==I.DeviceSessionStateType.Connected&&p({...t,installedApps:[],appsUpdates:void 0})}}}).createMachine({id:"InstallAppDeviceAction",initial:"DeviceReady",context:t=>({input:{unlockTimeout:t.input.unlockTimeout,appName:t.input.appName},intermediateValue:{requiredUserInteraction:v.UserInteractionRequired.None,progress:0},_internalState:{error:null,installedApps:[],getOsVersionResponse:null,appList:[]}}),states:{DeviceReady:{always:{target:"ListInstalledApps"}},ListInstalledApps:{value:"ListInstalledApps",invoke:{id:"listInstalledApps",src:"listInstalledApps",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"ListInstalledAppsCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:({installedApps:e})=>({...t.context._internalState,installedApps:e}),Left:e=>({...t.context._internalState,error:e})})})}}},ListInstalledAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"Success",guard:"appInstalled"},{target:"GoToDashboard"}]},GoToDashboard:{invoke:{id:"goToDashboard",src:"goToDashboard",input:t=>({unlockTimeout:t.context.input.unlockTimeout}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>({...t.context.intermediateValue,requiredUserInteraction:t.event.snapshot.context.intermediateValue.requiredUserInteraction})})},onDone:{target:"GoToDashboardCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:()=>t.context._internalState,Left:e=>({...t.context._internalState,error:e})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetOsVersion"}]},GetOsVersion:{invoke:{id:"getOsVersion",src:"getOsVersion",input:t=>{},onDone:{target:"GetOsVersionCheck",actions:(0,a.assign)({_internalState:t=>{if((0,h.isSuccessCommandResult)(t.event.output)){const e=s(),c=t.event.output.data.secureElementFlags.isSecureConnectionAllowed;return e.sessionStateType!==I.DeviceSessionStateType.Connected&&p({...e,isSecureConnectionAllowed:c}),{...t.context._internalState,getOsVersionResponse:t.event.output.data}}return{...t.context._internalState,error:t.event.output.error}}})}}},GetOsVersionCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetAppList"}]},GetAppList:{invoke:{id:"getAppList",src:"getAppList",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse}),onDone:{target:"GetAppListCheck",actions:(0,a.assign)({_internalState:t=>t.event.output.caseOf({Right:e=>({...t.context._internalState,appList:e}),Left:e=>({...t.context._internalState,error:e})})})}}},GetAppListCheck:{always:[{target:"Error",guard:"hasError"},{target:"Error",guard:"appNotFound",actions:"assignAppNotFound"},{target:"Error",guard:"depAppNotInstalled",actions:"assignDepAppNotInstalled"},{target:"InstallApp"}]},InstallApp:{invoke:{id:"installApp",src:"installApp",input:t=>({deviceInfo:t.context._internalState.getOsVersionResponse,app:t.context._internalState.appList.find(({versionName:e})=>e===t.context.input.appName)}),onSnapshot:{actions:(0,a.assign)({intermediateValue:t=>t.event.snapshot.context?.type===g.SecureChannelEventType.Progress?{...t.context.intermediateValue,progress:t.event.snapshot.context.payload.progress}:{...t.context.intermediateValue},_internalState:t=>t.event.snapshot.context?.type===g.SecureChannelEventType.Error?{...t.context._internalState,error:t.event.snapshot.context.error.mapInstallDAErrors()}:t.context._internalState})},onDone:{target:"ListInstalledApps",actions:"cleanupDeviceState"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},Success:{type:"final",description:"App installed successfully"},Error:{type:"final"}},output:({context:t})=>t._internalState.error?(0,d.Left)(t._internalState.error):(0,d.Right)(void 0)})}extractDependencies(n){return{getOsVersion:()=>n.sendCommand(new D.GetOsVersionCommand),getAppList:({input:s})=>{const{deviceInfo:p}=s;return n.getManagerApiService().getAppList(p)},installApp:({input:s})=>{const{deviceInfo:p,app:u}=s,A=n.getSecureChannelService().installApp(p,u);return new V.ConnectToSecureChannelTask(n,{connection:A}).run()},getDeviceSessionState:()=>n.getDeviceSessionState(),setDeviceSessionState:s=>n.setDeviceSessionState(s)}}}0&&(module.exports={InstallAppDeviceAction});
|
2
2
|
//# sourceMappingURL=InstallAppDeviceAction.js.map
|
package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\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 { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\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\";\nimport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nimport { ConnectToSecureChannelTask } from \"@api/secure-channel/task/ConnectToSecureChannelTask\";\nimport { SecureChannelEventType } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\n\nimport {\n type InstallAppDAError,\n type InstallAppDAInput,\n type InstallAppDAIntermediateValue,\n type InstallAppDAOutput,\n type InstallAppStateMachineInternalState,\n type MachineDependencies,\n} from \"./types\";\n\nexport class InstallAppDeviceAction extends XStateDeviceAction<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n> {\n override makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n > {\n type types = StateMachineTypes<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n >;\n\n const {\n getOsVersion,\n getAppList,\n installApp,\n getDeviceSessionState,\n setDeviceSessionState,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const listInstalledAppsMachine = new ListInstalledAppsDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalApi);\n\n const goToDashboardMachine = new GoToDashboardDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(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 listInstalledApps: listInstalledAppsMachine,\n goToDashboard: goToDashboardMachine,\n getOsVersion: fromPromise(getOsVersion),\n getAppList: fromPromise(getAppList),\n installApp: fromObservable(installApp),\n },\n guards: {\n hasError: (_) => _.context._internalState.error !== null,\n appInstalled: (_) =>\n _.context._internalState.installedApps.some(\n (app) => app.name === _.context.input.appName,\n ),\n appNotFound: (_) =>\n _.context._internalState.appList.findIndex(\n ({ versionName }) => versionName === _.context.input.appName,\n ) === -1,\n depAppNotInstalled: (_) => {\n const appToInstall = _.context._internalState.appList.find(\n ({ versionName }) => versionName === _.context.input.appName,\n );\n if (appToInstall?.parentName) {\n return (\n _.context._internalState.installedApps.findIndex(\n ({ name }) => name === appToInstall.parentName,\n ) === -1\n );\n }\n return false;\n },\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"],\n }),\n }),\n assignAppNotFound: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\n \"App to install not found in manager API\",\n ),\n }),\n }),\n assignDepAppNotInstalled: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\"Dep app is not installed on the device\"),\n }),\n }),\n cleanupDeviceState: () => {\n // After app successful installation, cleanup the device session state\n // to force fetching the new device state when required\n const state = getDeviceSessionState();\n if (state.sessionStateType !== DeviceSessionStateType.Connected) {\n setDeviceSessionState({\n ...state,\n installedApps: [],\n appsUpdates: undefined,\n });\n }\n },\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QEkB2sAuBDANjgggA6EAiYAbgJYDGY+1GlA9qgHRlW0BKYWEAngGIA2gAYAuolCEmsSoxZSQAD0QBGAJyjWADgDsAFg0A2HSb2iArMbUBmADQh+iAExrjrS6KuWNtte7Glga2AL6hjmiYuATEHDR0DMxsADKUmFHYeJBEhLCCECxgrJSo5EwA1sU46RiZMTnEsGKSSCAycgqoSqoIBgaWrC6i-i6Wjs4It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TYtu2TpdqUesG0L8opgTKqTGmr4-iykK22VeaoEwEBwEoGtFtR2MjklAC0OWqpn0LLgsAwrIYaZ2Mru4c8cRY8Hwkw2RnX1rEmbiDMyaYAnt7jXeXC3UYKdQFji8DxTjSWiEmFipd4Ufahys32yrqec3VWJD2e6efb04+qu+re-qy-52-metL6a4F9ieG9G64Srg6YGaWHYN2iDd87qpHsbLKs6wDD3iN94eCC-ZTx8yvsLXoN0XB33fHYf4hMOQnR2jdf4egQQvnTMsP+jskYowEhZCShtwHqDcPhIKlgdD9BGJ5KwqkXA7WLt4FYbgrCLDKgvCuasDxRXwagdeI8G63kZNSdBgUUzTChObL4j8nILm-oTK6SwsGnyeqjWoYDurph2mMQqj4hruGOjhNwYI4ELHVAuYiSi9ycxRi9TAfD66b1cJNbQpivCeXjERSRCBUGzGUjCTKj8oSKUsZXdWFFiDqNHNvMOiltDTxtnPEJnC2AAGUACu1BaCwGHg46+30zDaGsF-EElhSkjCTCCME6wobOSMLdY+bNlECgAKK1nrJEpKmVfpFJWCUspDgcLBBpnTDCZhliLn0uEIAA */\n id: \"InstallAppDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => ({\n input: {\n unlockTimeout: _.input.unlockTimeout,\n appName: _.input.appName,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n progress: 0,\n },\n _internalState: {\n error: null,\n installedApps: [],\n getOsVersionResponse: null,\n appList: [],\n },\n }),\n states: {\n DeviceReady: {\n always: {\n target: \"ListInstalledApps\",\n },\n },\n ListInstalledApps: {\n value: \"ListInstalledApps\",\n invoke: {\n id: \"listInstalledApps\",\n src: \"listInstalledApps\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"ListInstalledAppsCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: ({ installedApps }) => ({\n ..._.context._internalState,\n installedApps,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n },\n },\n ListInstalledAppsCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n guard: \"appInstalled\",\n },\n {\n target: \"GoToDashboard\",\n },\n ],\n },\n GoToDashboard: {\n invoke: {\n id: \"goToDashboard\",\n src: \"goToDashboard\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"GoToDashboardCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GoToDashboardCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetOsVersion\",\n },\n ],\n },\n GetOsVersion: {\n invoke: {\n id: \"getOsVersion\",\n src: \"getOsVersion\",\n input: (_) => undefined,\n onDone: {\n target: \"GetOsVersionCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const currentState: DeviceSessionState =\n getDeviceSessionState();\n const isSecureConnectionAllowed =\n _.event.output.data.secureElementFlags\n .isSecureConnectionAllowed;\n if (\n currentState.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...currentState,\n isSecureConnectionAllowed,\n });\n }\n return {\n ..._.context._internalState,\n getOsVersionResponse: _.event.output.data,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n },\n },\n GetOsVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetAppList\",\n },\n ],\n },\n GetAppList: {\n invoke: {\n id: \"getAppList\",\n src: \"getAppList\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n }),\n onDone: {\n target: \"GetAppListCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: (appList) => ({\n ..._.context._internalState,\n appList,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n },\n },\n GetAppListCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Error\",\n guard: \"appNotFound\",\n actions: \"assignAppNotFound\",\n },\n {\n target: \"Error\",\n guard: \"depAppNotInstalled\",\n actions: \"assignDepAppNotInstalled\",\n },\n {\n target: \"InstallApp\",\n },\n ],\n },\n InstallApp: {\n invoke: {\n id: \"installApp\",\n src: \"installApp\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n app: _.context._internalState.appList.find(\n ({ versionName }) => versionName === _.context.input.appName,\n )!,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => {\n if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Progress\n ) {\n return {\n ..._.context.intermediateValue,\n progress: _.event.snapshot.context.payload.progress,\n };\n }\n return { ..._.context.intermediateValue };\n },\n }),\n },\n onDone: {\n target: \"ListInstalledApps\",\n actions: \"cleanupDeviceState\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n Success: {\n type: \"final\",\n description: \"App installed successfully\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.error\n ? Left(context._internalState.error)\n : Right(undefined),\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getOsVersion = () =>\n internalApi.sendCommand(new GetOsVersionCommand());\n\n const getAppList = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n }>) => {\n const { deviceInfo } = input;\n return internalApi.getManagerApiService().getAppList(deviceInfo);\n };\n\n const installApp = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n app: Application;\n }>) => {\n const { deviceInfo, app } = input;\n const eitherConnection = internalApi\n .getSecureChannelService()\n .installApp(deviceInfo, app);\n return new ConnectToSecureChannelTask(internalApi, {\n connection: eitherConnection,\n }).run();\n };\n\n return {\n getOsVersion,\n getAppList,\n installApp,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2D,kBAE3DC,EAAuC,4CACvCC,EAGO,+CAEPC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAA+B,wCAC/BC,EAA0C,yEAE1CC,EAGO,8DACPC,EAGO,kDACPC,EAA8C,6FAC9CC,EAA2C,+DAC3CC,EAAuC,0CAahC,MAAMd,UAA+B,oBAM1C,CACS,iBACPe,EAOA,CASA,KAAM,CACJ,aAAAC,EACA,WAAAC,EACA,WAAAC,EACA,sBAAAC,EACA,sBAAAC,CACF,EAAI,KAAK,oBAAoBL,CAAW,EAElCM,EAAgB,KAAK,MAAM,eAAiB,4BAE5CC,EAA2B,IAAI,gCAA8B,CACjE,MAAO,CACL,cAAAD,CACF,CACF,CAAC,EAAE,iBAAiBN,CAAW,EAEzBQ,EAAuB,IAAI,4BAA0B,CACzD,MAAO,CACL,cAAAF,CACF,CACF,CAAC,EAAE,iBAAiBN,CAAW,EAE/B,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,kBAAmB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CACN,CACE,OAAQ,QACR,MAAO,UACT,EACA,CACE,OAAQ,QACR,MAAO,cACP,QAAS,mBACX,EACA,CACE,OAAQ,QACR,MAAO,qBACP,QAAS,0BACX,EACA,CACE,OAAQ,YACV,CACF,CACF,EACA,WAAY,CACV,OAAQ,CACN,GAAI,aACJ,IAAK,aACL,MAAQP,IAAO,CACb,WAAYA,EAAE,QAAQ,eAAe,qBACrC,IAAKA,EAAE,QAAQ,eAAe,QAAQ,KACpC,CAAC,CAAE,YAAAE,CAAY,IAAMA,IAAgBF,EAAE,QAAQ,MAAM,OACvD,CACF,GACA,WAAY,CACV,WAAS,UAAO,CACd,kBAAoBA,GAEhBA,EAAE,MAAM,SAAS,SAAS,OAC1B,yBAAuB,SAEhB,CACL,GAAGA,EAAE,QAAQ,kBACb,SAAUA,EAAE,MAAM,SAAS,QAAQ,QAAQ,QAC7C,EAEK,CAAE,GAAGA,EAAE,QAAQ,iBAAkB,
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromObservable, fromPromise, setup } from \"xstate\";\n\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\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 { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\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\";\nimport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nimport { ConnectToSecureChannelTask } from \"@api/secure-channel/task/ConnectToSecureChannelTask\";\nimport { SecureChannelEventType } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\n\nimport {\n type InstallAppDAError,\n type InstallAppDAInput,\n type InstallAppDAIntermediateValue,\n type InstallAppDAOutput,\n type InstallAppStateMachineInternalState,\n type MachineDependencies,\n} from \"./types\";\n\nexport class InstallAppDeviceAction extends XStateDeviceAction<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n> {\n override makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n > {\n type types = StateMachineTypes<\n InstallAppDAOutput,\n InstallAppDAInput,\n InstallAppDAError,\n InstallAppDAIntermediateValue,\n InstallAppStateMachineInternalState\n >;\n\n const {\n getOsVersion,\n getAppList,\n installApp,\n getDeviceSessionState,\n setDeviceSessionState,\n } = this.extractDependencies(internalApi);\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const listInstalledAppsMachine = new ListInstalledAppsDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(internalApi);\n\n const goToDashboardMachine = new GoToDashboardDeviceAction({\n input: {\n unlockTimeout,\n },\n }).makeStateMachine(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 listInstalledApps: listInstalledAppsMachine,\n goToDashboard: goToDashboardMachine,\n getOsVersion: fromPromise(getOsVersion),\n getAppList: fromPromise(getAppList),\n installApp: fromObservable(installApp),\n },\n guards: {\n hasError: (_) => _.context._internalState.error !== null,\n appInstalled: (_) =>\n _.context._internalState.installedApps.some(\n (app) => app.name === _.context.input.appName,\n ),\n appNotFound: (_) =>\n _.context._internalState.appList.findIndex(\n ({ versionName }) => versionName === _.context.input.appName,\n ) === -1,\n depAppNotInstalled: (_) => {\n const appToInstall = _.context._internalState.appList.find(\n ({ versionName }) => versionName === _.context.input.appName,\n );\n if (appToInstall?.parentName) {\n return (\n _.context._internalState.installedApps.findIndex(\n ({ name }) => name === appToInstall.parentName,\n ) === -1\n );\n }\n return false;\n },\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"],\n }),\n }),\n assignAppNotFound: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\n \"App to install not found in manager API\",\n ),\n }),\n }),\n assignDepAppNotInstalled: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: new UnknownDAError(\"Dep app is not installed on the device\"),\n }),\n }),\n cleanupDeviceState: () => {\n // After app successful installation, cleanup the device session state\n // to force fetching the new device state when required\n const state = getDeviceSessionState();\n if (state.sessionStateType !== DeviceSessionStateType.Connected) {\n setDeviceSessionState({\n ...state,\n installedApps: [],\n appsUpdates: undefined,\n });\n }\n },\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QEkB2sAuBDANjgggA6EAiYAbgJYDGY+1GlA9qgHRlW0BKYWEAngGIA2gAYAuolCEmsSoxZSQAD0QBGAJyjWADgDsAFg0A2HSb2iArMbUBmADQh+iAExrjrS6KuWNtte7Glga2AL6hjmiYuATEHDR0DMxsADKUmFHYeJBEhLCCECxgrJSo5EwA1sU46RiZMTnEsGKSSCAycgqoSqoIBgaWrC6i-i6Wjs4ItqJqnt62BsYuGmoGLguW4ZHoWbGkFAn0XaxpGTsNELmwAMIAFmDUFSISSh3yyT2Ituu6vrZ64yciB0djmogGAxcLmMMwMWxA9TwuXitCOyROtUROEaeTuDyewjUrWksneijavW+tl+fgBE2BelmXn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Ufahys32yrqec3VWJD2e6efb04+qu+re-qy-52-metL6a4F9ieG9G64Srg6YGaWHYN2iDd87qpHsbLKs6wDD3iN94eCC-ZTx8yvsLXoN0XB33fHYf4hMOQnR2jdf4egQQvnTMsP+jskYowEhZCShtwHqDcPhIKlgdD9BGJ5KwqkXA7WLt4FYbgrCLDKgvCuasDxRXwagdeI8G63kZNSdBgUUzTChObL4j8nILm-oTK6SwsGnyeqjWoYDurph2mMQqj4hruGOjhNwYI4ELHVAuYiSi9ycxRi9TAfD66b1cJNbQpivCeXjERSRCBUGzGUjCTKj8oSKUsZXdWFFiDqNHNvMOiltDTxtnPEJnC2AAGUACu1BaCwGHg46+30zDaGsF-EElhSkjCTCCME6wobOSMLdY+bNlECgAKK1nrJEpKmVfpFJWCUspDgcLBBpnTDCZhliLn0uEIAA */\n id: \"InstallAppDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => ({\n input: {\n unlockTimeout: _.input.unlockTimeout,\n appName: _.input.appName,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n progress: 0,\n },\n _internalState: {\n error: null,\n installedApps: [],\n getOsVersionResponse: null,\n appList: [],\n },\n }),\n states: {\n DeviceReady: {\n always: {\n target: \"ListInstalledApps\",\n },\n },\n ListInstalledApps: {\n value: \"ListInstalledApps\",\n invoke: {\n id: \"listInstalledApps\",\n src: \"listInstalledApps\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"ListInstalledAppsCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: ({ installedApps }) => ({\n ..._.context._internalState,\n installedApps,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n },\n },\n ListInstalledAppsCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Success\",\n guard: \"appInstalled\",\n },\n {\n target: \"GoToDashboard\",\n },\n ],\n },\n GoToDashboard: {\n invoke: {\n id: \"goToDashboard\",\n src: \"goToDashboard\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"GoToDashboardCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GoToDashboardCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetOsVersion\",\n },\n ],\n },\n GetOsVersion: {\n invoke: {\n id: \"getOsVersion\",\n src: \"getOsVersion\",\n input: (_) => undefined,\n onDone: {\n target: \"GetOsVersionCheck\",\n actions: assign({\n _internalState: (_) => {\n if (isSuccessCommandResult(_.event.output)) {\n const currentState: DeviceSessionState =\n getDeviceSessionState();\n const isSecureConnectionAllowed =\n _.event.output.data.secureElementFlags\n .isSecureConnectionAllowed;\n if (\n currentState.sessionStateType !==\n DeviceSessionStateType.Connected\n ) {\n setDeviceSessionState({\n ...currentState,\n isSecureConnectionAllowed,\n });\n }\n return {\n ..._.context._internalState,\n getOsVersionResponse: _.event.output.data,\n };\n }\n return {\n ..._.context._internalState,\n error: _.event.output.error,\n };\n },\n }),\n },\n },\n },\n GetOsVersionCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"GetAppList\",\n },\n ],\n },\n GetAppList: {\n invoke: {\n id: \"getAppList\",\n src: \"getAppList\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n }),\n onDone: {\n target: \"GetAppListCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<InstallAppStateMachineInternalState>({\n Right: (appList) => ({\n ..._.context._internalState,\n appList,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n }),\n }),\n },\n },\n },\n GetAppListCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"Error\",\n guard: \"appNotFound\",\n actions: \"assignAppNotFound\",\n },\n {\n target: \"Error\",\n guard: \"depAppNotInstalled\",\n actions: \"assignDepAppNotInstalled\",\n },\n {\n target: \"InstallApp\",\n },\n ],\n },\n InstallApp: {\n invoke: {\n id: \"installApp\",\n src: \"installApp\",\n input: (_) => ({\n deviceInfo: _.context._internalState.getOsVersionResponse!,\n app: _.context._internalState.appList.find(\n ({ versionName }) => versionName === _.context.input.appName,\n )!,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => {\n if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Progress\n ) {\n return {\n ..._.context.intermediateValue,\n progress: _.event.snapshot.context.payload.progress,\n };\n }\n return { ..._.context.intermediateValue };\n },\n _internalState: (_) => {\n if (\n _.event.snapshot.context?.type ===\n SecureChannelEventType.Error\n ) {\n return {\n ..._.context._internalState,\n error:\n _.event.snapshot.context.error.mapInstallDAErrors(),\n };\n }\n return _.context._internalState;\n },\n }),\n },\n onDone: {\n target: \"ListInstalledApps\",\n actions: \"cleanupDeviceState\",\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n Success: {\n type: \"final\",\n description: \"App installed successfully\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.error\n ? Left(context._internalState.error)\n : Right(undefined),\n });\n }\n\n extractDependencies(internalApi: InternalApi): MachineDependencies {\n const getOsVersion = () =>\n internalApi.sendCommand(new GetOsVersionCommand());\n\n const getAppList = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n }>) => {\n const { deviceInfo } = input;\n return internalApi.getManagerApiService().getAppList(deviceInfo);\n };\n\n const installApp = ({\n input,\n }: Input<{\n deviceInfo: GetOsVersionResponse;\n app: Application;\n }>) => {\n const { deviceInfo, app } = input;\n const eitherConnection = internalApi\n .getSecureChannelService()\n .installApp(deviceInfo, app);\n return new ConnectToSecureChannelTask(internalApi, {\n connection: eitherConnection,\n }).run();\n };\n\n return {\n getOsVersion,\n getAppList,\n installApp,\n getDeviceSessionState: () => internalApi.getDeviceSessionState(),\n setDeviceSessionState: (state) =>\n internalApi.setDeviceSessionState(state),\n };\n }\n}\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2D,kBAE3DC,EAAuC,4CACvCC,EAGO,+CAEPC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAA+B,wCAC/BC,EAA0C,yEAE1CC,EAGO,8DACPC,EAGO,kDACPC,EAA8C,6FAC9CC,EAA2C,+DAC3CC,EAAuC,0CAahC,MAAMd,UAA+B,oBAM1C,CACS,iBACPe,EAOA,CASA,KAAM,CACJ,aAAAC,EACA,WAAAC,EACA,WAAAC,EACA,sBAAAC,EACA,sBAAAC,CACF,EAAI,KAAK,oBAAoBL,CAAW,EAElCM,EAAgB,KAAK,MAAM,eAAiB,4BAE5CC,EAA2B,IAAI,gCAA8B,CACjE,MAAO,CACL,cAAAD,CACF,CACF,CAAC,EAAE,iBAAiBN,CAAW,EAEzBQ,EAAuB,IAAI,4BAA0B,CACzD,MAAO,CACL,cAAAF,CACF,CACF,CAAC,EAAE,iBAAiBN,CAAW,EAE/B,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,kBAAmBO,EACnB,cAAeC,E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,qBAAqB,EAAE,WAAWsB,CAAU,CACjE,EAoBE,WAlBiB,CAAC,CAClB,MAAAD,CACF,IAGO,CACL,KAAM,CAAE,WAAAC,EAAY,IAAAZ,CAAI,EAAIW,EACtBE,EAAmBvB,EACtB,wBAAwB,EACxB,WAAWsB,EAAYZ,CAAG,EAC7B,OAAO,IAAI,6BAA2BV,EAAa,CACjD,WAAYuB,CACd,CAAC,EAAE,IAAI,CACT,EAME,sBAAuB,IAAMvB,EAAY,sBAAsB,EAC/D,sBAAwBc,GACtBd,EAAY,sBAAsBc,CAAK,CAC3C,CACF,CACF",
|
6
6
|
"names": ["InstallAppDeviceAction_exports", "__export", "InstallAppDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_GetOsVersionCommand", "import_UserInteractionRequired", "import_Const", "import_Errors", "import_GoToDashboardDeviceAction", "import_XStateDeviceAction", "import_DeviceSessionState", "import_ListInstalledAppsDeviceAction", "import_ConnectToSecureChannelTask", "import_types", "internalApi", "getOsVersion", "getAppList", "installApp", "getDeviceSessionState", "setDeviceSessionState", "unlockTimeout", "listInstalledAppsMachine", "goToDashboardMachine", "_", "app", "versionName", "appToInstall", "name", "state", "installedApps", "error", "currentState", "isSecureConnectionAllowed", "appList", "context", "input", "deviceInfo", "eitherConnection"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(t,e,o,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of i(e))!a.call(t,r)&&r!==o&&n(t,r,{get:()=>e[r],enumerable:!(p=s(e,r))||p.enumerable});return t};var A=t=>l(n({},"__esModule",{value:!0}),t);var m={};module.exports=A(m);
|
2
2
|
//# sourceMappingURL=types.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/secure-channel/device-action/InstallApp/types.ts"],
|
4
|
-
"sourcesContent": ["import { type EitherAsync } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport { type CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport {\n type GetOsVersionCommandResult,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { type UnknownDAError } from \"@api/device-action/os/Errors\";\nimport {\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n} from \"@api/device-action/os/GoToDashboard/types\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport {\n type InstalledApp,\n type ListInstalledAppsDAInput,\n type ListInstalledAppsDAIntermediateValue,\n} from \"@api/secure-channel/device-action/ListInstalledApps/types\";\nimport { type SecureChannelEvent } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\n\nexport type InstallAppDAOutput = void;\n\nexport type InstallAppDAInput = GoToDashboardDAInput &\n ListInstalledAppsDAInput & { appName: string };\n\nexport type InstallAppDAError =\n | CommandErrorResult[\"error\"]\n | GoToDashboardDAError\n | HttpFetchApiError\n | UnknownDAError;\n\nexport type InstallAppDARequiredInteraction =\n | UserInteractionRequired.None\n | UserInteractionRequired.UnlockDevice\n | UserInteractionRequired.AllowSecureConnection;\n\nexport type InstallAppDAIntermediateValue =\n ListInstalledAppsDAIntermediateValue & {\n requiredUserInteraction: InstallAppDARequiredInteraction;\n progress: number;\n };\n\nexport type InstallAppDAState = DeviceActionState<\n InstallAppDAOutput,\n InstallAppDAError,\n InstallAppDAIntermediateValue\n>;\n\nexport type InstallAppStateMachineInternalState = {\n error: InstallAppDAError | null;\n installedApps: Array<InstalledApp>;\n getOsVersionResponse: GetOsVersionResponse | null;\n appList: Array<Application>;\n};\n\nexport type MachineDependencies = {\n getOsVersion: () => Promise<GetOsVersionCommandResult>;\n getAppList: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n }>,\n ) => EitherAsync<HttpFetchApiError, Array<Application>>;\n installApp: (\n args: Input<{ deviceInfo: GetOsVersionResponse; app: Application }>,\n ) => Observable<SecureChannelEvent>;\n getDeviceSessionState: () => DeviceSessionState;\n setDeviceSessionState: (state: DeviceSessionState) => DeviceSessionState;\n};\n"],
|
4
|
+
"sourcesContent": ["import { type EitherAsync } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport { type CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport {\n type GetOsVersionCommandResult,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nimport { type DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport { type UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { type UnknownDAError } from \"@api/device-action/os/Errors\";\nimport {\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n} from \"@api/device-action/os/GoToDashboard/types\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport {\n type InstalledApp,\n type ListInstalledAppsDAInput,\n type ListInstalledAppsDAIntermediateValue,\n} from \"@api/secure-channel/device-action/ListInstalledApps/types\";\nimport { type SecureChannelEvent } from \"@api/secure-channel/task/types\";\nimport { type Input } from \"@api/secure-channel/types\";\nimport { type Application } from \"@internal/manager-api/model/Application\";\nimport { type HttpFetchApiError } from \"@internal/manager-api/model/Errors\";\nimport type { SecureChannelInstallDAErrors } from \"@internal/secure-channel/model/Errors\";\n\nexport type InstallAppDAOutput = void;\n\nexport type InstallAppDAInput = GoToDashboardDAInput &\n ListInstalledAppsDAInput & { appName: string };\n\nexport type InstallAppDAError =\n | CommandErrorResult[\"error\"]\n | GoToDashboardDAError\n | HttpFetchApiError\n | SecureChannelInstallDAErrors\n | UnknownDAError;\n\nexport type InstallAppDARequiredInteraction =\n | UserInteractionRequired.None\n | UserInteractionRequired.UnlockDevice\n | UserInteractionRequired.AllowSecureConnection;\n\nexport type InstallAppDAIntermediateValue =\n ListInstalledAppsDAIntermediateValue & {\n requiredUserInteraction: InstallAppDARequiredInteraction;\n progress: number;\n };\n\nexport type InstallAppDAState = DeviceActionState<\n InstallAppDAOutput,\n InstallAppDAError,\n InstallAppDAIntermediateValue\n>;\n\nexport type InstallAppStateMachineInternalState = {\n error: InstallAppDAError | null;\n installedApps: Array<InstalledApp>;\n getOsVersionResponse: GetOsVersionResponse | null;\n appList: Array<Application>;\n};\n\nexport type MachineDependencies = {\n getOsVersion: () => Promise<GetOsVersionCommandResult>;\n getAppList: (\n args: Input<{\n deviceInfo: GetOsVersionResponse;\n }>,\n ) => EitherAsync<HttpFetchApiError, Array<Application>>;\n installApp: (\n args: Input<{ deviceInfo: GetOsVersionResponse; app: Application }>,\n ) => Observable<SecureChannelEvent>;\n getDeviceSessionState: () => DeviceSessionState;\n setDeviceSessionState: (state: DeviceSessionState) => DeviceSessionState;\n};\n"],
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
6
6
|
"names": ["types_exports", "__toCommonJS"]
|
7
7
|
}
|