@ledgerhq/device-management-kit 0.6.5 → 0.7.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 +40 -3
- package/lib/cjs/package.json +23 -23
- package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
- package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.test.js.map +3 -3
- package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
- package/lib/cjs/src/api/DmkConfig.js +1 -1
- package/lib/cjs/src/api/DmkConfig.js.map +1 -1
- package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
- package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
- package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
- package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
- package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js +2 -0
- package/lib/cjs/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
- package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
- package/lib/cjs/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
- package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js +1 -1
- package/lib/cjs/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
- package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.js.map +3 -3
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
- 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/CallTaskInAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -1
- 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 +2 -0
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +2 -0
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
- package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
- package/lib/cjs/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
- package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
- package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
- package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
- package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
- 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/model/DeviceModel.js +1 -1
- package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
- package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
- package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
- package/lib/cjs/src/api/device-session/DeviceSessionState.js +1 -1
- package/lib/cjs/src/api/device-session/DeviceSessionState.js.map +2 -2
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +3 -3
- 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/InstallApp/InstallAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +3 -3
- 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/UninstallApp/UninstallAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/transport/model/DeviceApduSender.js +2 -0
- package/lib/cjs/src/api/transport/model/DeviceApduSender.js.map +7 -0
- package/lib/cjs/src/api/transport/model/DeviceConnection.js +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnection.js.map +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
- package/lib/cjs/src/api/transport/model/DiscoveredDevice.js.map +1 -1
- package/lib/cjs/src/api/transport/model/Errors.js +1 -1
- package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
- package/lib/cjs/src/api/transport/model/Transport.js.map +1 -1
- package/lib/cjs/src/api/types.js +1 -1
- package/lib/cjs/src/api/types.js.map +1 -1
- package/lib/cjs/src/di.js +1 -1
- package/lib/cjs/src/di.js.map +2 -2
- package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js +1 -1
- package/lib/cjs/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DevicePinger.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/Frame.js +1 -1
- package/lib/cjs/src/internal/device-session/model/Frame.js.map +3 -3
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
- package/lib/cjs/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/ManagerApiDataSource.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js +1 -1
- package/lib/cjs/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/model/Application.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Application.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Const.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/model/Firmware.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Firmware.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/model/Language.js +2 -0
- package/lib/cjs/src/internal/manager-api/model/Language.js.map +7 -0
- package/lib/cjs/src/internal/manager-api/model/Params.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Params.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js +1 -1
- package/lib/cjs/src/internal/manager-api/service/ManagerApiService.js.map +1 -1
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js +1 -1
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
- package/lib/cjs/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
- package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js +1 -1
- package/lib/cjs/src/internal/secure-channel/service/SecureChannelService.js.map +1 -1
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
- package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.js +1 -1
- package/lib/cjs/src/internal/transport/service/DefaultTransportService.js.map +3 -3
- package/lib/cjs/src/internal/transport/service/TransportService.js +1 -1
- package/lib/cjs/src/internal/transport/service/TransportService.js.map +1 -1
- package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
- package/lib/cjs/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
- package/lib/esm/package.json +23 -23
- package/lib/esm/src/api/DeviceManagementKit.js +1 -1
- package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
- package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
- package/lib/esm/src/api/DeviceManagementKit.test.js.map +3 -3
- package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
- package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
- package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +2 -0
- package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +7 -0
- package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +2 -0
- package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +7 -0
- package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
- package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
- package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
- package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
- package/lib/esm/src/api/command/os/ListLanguagePackCommand.js +2 -0
- package/lib/esm/src/api/command/os/ListLanguagePackCommand.js.map +7 -0
- package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js +2 -0
- package/lib/esm/src/api/command/os/ListLanguagePackCommand.test.js.map +7 -0
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
- package/lib/esm/src/api/command/use-case/SendCommandUseCase.js +1 -1
- package/lib/esm/src/api/command/use-case/SendCommandUseCase.js.map +3 -3
- package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
- package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
- package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +3 -3
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
- 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/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.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 +2 -0
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +7 -0
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +2 -0
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +7 -0
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +2 -2
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +2 -2
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
- package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js +2 -0
- package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.js.map +7 -0
- package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js +2 -0
- package/lib/esm/src/api/device-action/task/GetApplicationsMetadataTask.test.js.map +7 -0
- package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +2 -0
- package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +7 -0
- package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js +2 -0
- package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.test.js.map +7 -0
- package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
- package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
- package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
- package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
- 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/model/DeviceModel.js +1 -1
- package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
- package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
- package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
- package/lib/esm/src/api/device-session/DeviceSessionState.js +1 -1
- package/lib/esm/src/api/device-session/DeviceSessionState.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 +3 -3
- 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/UninstallApp/UninstallAppDeviceAction.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +3 -3
- package/lib/esm/src/api/transport/model/DeviceApduSender.js +1 -0
- package/lib/esm/src/api/transport/model/DeviceApduSender.js.map +7 -0
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +2 -0
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +7 -0
- package/lib/esm/src/api/transport/model/Errors.js +1 -1
- package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
- package/lib/esm/src/di.js +1 -1
- package/lib/esm/src/di.js.map +3 -3
- package/lib/esm/src/internal/device-session/data/ApduResponseConst.js +1 -1
- package/lib/esm/src/internal/device-session/data/ApduResponseConst.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DevicePinger.js +1 -1
- package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/Frame.js +1 -1
- package/lib/esm/src/internal/device-session/model/Frame.js.map +3 -3
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js +1 -1
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.js.map +3 -3
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js +1 -1
- package/lib/esm/src/internal/device-session/use-case/CloseSessionsUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StartDiscoveringUseCase.test.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js +1 -1
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.js.map +3 -3
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js +1 -1
- package/lib/esm/src/internal/manager-api/data/AxiosManagerApiDataSource.test.js.map +3 -3
- package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js +1 -1
- package/lib/esm/src/internal/manager-api/data/ManagerApiDto.js.map +1 -1
- package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js +1 -1
- package/lib/esm/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.js.map +2 -2
- package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
- package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
- package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
- package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
- package/lib/esm/src/internal/manager-api/di/managerApiTypes.js +1 -1
- package/lib/esm/src/internal/manager-api/di/managerApiTypes.js.map +2 -2
- package/lib/esm/src/internal/manager-api/model/Application.js +1 -1
- package/lib/esm/src/internal/manager-api/model/Application.js.map +1 -1
- package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
- package/lib/esm/src/internal/manager-api/model/Const.js.map +3 -3
- package/lib/esm/src/internal/manager-api/model/Language.js +1 -0
- package/lib/esm/src/internal/manager-api/model/Language.js.map +7 -0
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js +1 -1
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.js.map +3 -3
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js +1 -1
- package/lib/esm/src/internal/manager-api/service/DefaultManagerApiService.test.js.map +3 -3
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js +2 -0
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +7 -0
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +2 -0
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +7 -0
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.js.map +3 -3
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js +1 -1
- package/lib/esm/src/internal/secure-channel/service/DefaultSecureChannelService.test.js.map +3 -3
- 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.test.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/esm/src/internal/transport/service/DefaultTransportService.js +1 -1
- package/lib/esm/src/internal/transport/service/DefaultTransportService.js.map +3 -3
- package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js +1 -1
- package/lib/esm/src/internal/transport/service/__mocks__/DefaultTransportService.js.map +2 -2
- package/lib/types/src/api/DeviceManagementKit.d.ts +11 -1
- package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
- package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
- package/lib/types/src/api/DmkConfig.d.ts +2 -0
- package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
- package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +16 -0
- package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +1 -0
- package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +2 -0
- package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +1 -0
- package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +30 -2
- package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
- package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts +24 -0
- package/lib/types/src/api/command/os/ListLanguagePackCommand.d.ts.map +1 -0
- package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts +2 -0
- package/lib/types/src/api/command/os/ListLanguagePackCommand.test.d.ts.map +1 -0
- package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
- package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts +5 -1
- package/lib/types/src/api/command/use-case/SendCommandUseCase.d.ts.map +1 -1
- package/lib/types/src/api/command/utils/CommandUtils.d.ts +1 -0
- package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
- package/lib/types/src/api/device-action/DeviceAction.d.ts +3 -1
- package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +5 -0
- package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.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 +1 -0
- 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 +58 -0
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +27 -0
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
- package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +64 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +25 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -0
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +30 -0
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts +31 -0
- package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts +2 -0
- package/lib/types/src/api/device-action/task/GetApplicationsMetadataTask.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts +18 -0
- package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts +2 -0
- package/lib/types/src/api/device-action/task/GetFirmwareMetadataTask.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
- package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
- package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
- 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 +2 -0
- package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
- package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
- package/lib/types/src/api/device-session/DeviceSessionState.d.ts +93 -0
- package/lib/types/src/api/device-session/DeviceSessionState.d.ts.map +1 -1
- package/lib/types/src/api/index.d.ts +6 -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/InstallApp/InstallAppDeviceAction.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/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceApduSender.d.ts +17 -0
- package/lib/types/src/api/transport/model/DeviceApduSender.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/DeviceConnection.d.ts +2 -1
- package/lib/types/src/api/transport/model/DeviceConnection.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +62 -0
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts +1 -1
- package/lib/types/src/api/transport/model/DiscoveredDevice.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Errors.d.ts +22 -3
- package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Transport.d.ts +1 -1
- package/lib/types/src/api/transport/model/Transport.d.ts.map +1 -1
- package/lib/types/src/api/types.d.ts +6 -2
- package/lib/types/src/api/types.d.ts.map +1 -1
- package/lib/types/src/di.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts +1 -0
- package/lib/types/src/internal/device-session/data/ApduResponseConst.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DevicePinger.d.ts +1 -1
- package/lib/types/src/internal/device-session/model/DevicePinger.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +3 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/Frame.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts +3 -1
- package/lib/types/src/internal/device-session/use-case/CloseSessionsUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts +1 -1
- package/lib/types/src/internal/discovery/use-case/ListenToAvailableDevicesUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts +1 -1
- package/lib/types/src/internal/discovery/use-case/StartDiscoveringUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts +4 -2
- package/lib/types/src/internal/discovery/use-case/StopDiscoveringUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +24 -5
- package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts +51 -6
- package/lib/types/src/internal/manager-api/data/ManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts +104 -18
- package/lib/types/src/internal/manager-api/data/ManagerApiDto.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts +7 -0
- package/lib/types/src/internal/manager-api/data/__mocks__/AxiosManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts +1 -0
- package/lib/types/src/internal/manager-api/di/managerApiTypes.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Application.d.ts +12 -12
- package/lib/types/src/internal/manager-api/model/Application.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Const.d.ts +2 -0
- package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Firmware.d.ts +17 -3
- package/lib/types/src/internal/manager-api/model/Firmware.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Language.d.ts +12 -0
- package/lib/types/src/internal/manager-api/model/Language.d.ts.map +1 -0
- package/lib/types/src/internal/manager-api/model/Params.d.ts +20 -6
- package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +9 -3
- package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +42 -7
- package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts +13 -0
- package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -0
- package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts +2 -0
- package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.test.d.ts.map +1 -0
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts +2 -2
- package/lib/types/src/internal/secure-channel/service/DefaultSecureChannelService.d.ts.map +1 -1
- package/lib/types/src/internal/secure-channel/service/SecureChannelService.d.ts +3 -3
- package/lib/types/src/internal/secure-channel/service/SecureChannelService.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/service/DefaultTransportService.d.ts +2 -0
- package/lib/types/src/internal/transport/service/DefaultTransportService.d.ts.map +1 -1
- package/lib/types/src/internal/transport/service/TransportService.d.ts +3 -1
- package/lib/types/src/internal/transport/service/TransportService.d.ts.map +1 -1
- package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts +1 -0
- package/lib/types/src/internal/transport/service/__mocks__/DefaultTransportService.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +15 -15
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/command/os/GetOsVersionCommand.test.ts"],
|
4
|
-
"sourcesContent": ["import {\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { getOsVersionCommandResponseMockBuilder } from \"./__mocks__/GetOsVersionCommand\";\nimport { GetOsVersionCommand } from \"./GetOsVersionCommand\";\n\nconst GET_OS_VERSION_APDU = Uint8Array.from([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\nconst LNX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x00, 0x00, 0x04, 0x05, 0x32, 0x2e, 0x32, 0x2e, 0x33, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x32, 0x2e, 0x33, 0x30, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x01,\n 0x00, 0x01, 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNX_RESPONSE_DATA_GOOD,\n});\n\nconst LNSP_REPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x10, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x31, 0x2e, 0x31, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x34, 0x2e, 0x30, 0x33, 0x04, 0x33, 0x2e, 0x31, 0x32, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNSP_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNSP_REPONSE_DATA_GOOD,\n});\n\nconst STAX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x20, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x33, 0x2e, 0x30, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x35, 0x2e, 0x32, 0x34, 0x04, 0x30, 0x2e, 0x34, 0x38, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst STAX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: STAX_RESPONSE_DATA_GOOD,\n});\n\ndescribe(\"GetOsVersionCommand\", () => {\n let command: GetOsVersionCommand;\n\n beforeEach(() => {\n command = new GetOsVersionCommand();\n });\n\n describe(\"getApdu\", () => {\n it(\"should return the GetOsVersion apdu\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(GET_OS_VERSION_APDU);\n });\n });\n\n describe(\"parseResponse\", () => {\n describe(\"Nano X\", () => {\n it(\"should parse the LNX response\", () => {\n const parsed = command.parseResponse(\n LNX_RESPONSE_GOOD,\n DeviceModelId.NANO_X,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_X),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Nano S Plus\", () => {\n it(\"should parse the LNSP response\", () => {\n const parsed = command.parseResponse(\n LNSP_RESPONSE_GOOD,\n DeviceModelId.NANO_SP,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_SP),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Stax\", () => {\n it(\"should parse the STAX response\", () => {\n const parsed = command.parseResponse(\n STAX_RESPONSE_GOOD,\n DeviceModelId.STAX,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.STAX),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Error handling\", () => {\n it(\"should return an error if the response is not successful\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n const result = command.parseResponse(response, DeviceModelId.NANO_S);\n\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n });\n });\n});\n"],
|
5
|
-
"mappings": "AAAA,OACE,wBAAAA,EACA,0BAAAC,MACK,mCACP,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,gBAAAC,MAAoB,mCAE7B,OAAS,0CAAAC,MAA8C,kCACvD,OAAS,uBAAAC,MAA2B,wBAEpC,MAAMC,EAAsB,WAAW,KAAK,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,EAEpEC,EAAyB,WAAW,KAAK,CAC7C,GAAM,EAAM,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,GAAM,EAAM,IAAM,EACxE,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EACxE,EAAM,EAAM,EAAM,EAAM,EAAM,IAAM,CACtC,CAAC,EACKC,EAAoB,IAAIL,EAAa,CACzC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAMI,CACR,CAAC,EAEKE,EAAyB,WAAW,KAAK,CAC7C,GAAM,GAAM,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,GAAM,EAAM,IAAM,EACxE,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EACxE,EAAM,EAAM,EAAM,IAAM,CAC1B,CAAC,EACKC,EAAqB,IAAIP,EAAa,CAC1C,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAMM,CACR,CAAC,EAEKE,EAA0B,WAAW,KAAK,CAC9C,GAAM,GAAM,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,GAAM,EAAM,IAAM,EACxE,EAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EAAM,GAAM,GAAM,GAAM,GAAM,EACxE,EAAM,EAAM,EAAM,IAAM,CAC1B,CAAC,EACKC,EAAqB,IAAIT,EAAa,CAC1C,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAMQ,CACR,CAAC,EAED,SAAS,sBAAuB,IAAM,CACpC,IAAIE,EAEJ,WAAW,IAAM,CACfA,EAAU,
|
6
|
-
"names": ["CommandResultFactory", "isSuccessCommandResult", "DeviceModelId", "ApduResponse", "getOsVersionCommandResponseMockBuilder", "GetOsVersionCommand", "GET_OS_VERSION_APDU", "LNX_RESPONSE_DATA_GOOD", "LNX_RESPONSE_GOOD", "LNSP_REPONSE_DATA_GOOD", "LNSP_RESPONSE_GOOD", "STAX_RESPONSE_DATA_GOOD", "STAX_RESPONSE_GOOD", "command", "apdu", "parsed", "expected", "response", "result"]
|
4
|
+
"sourcesContent": ["import {\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { getOsVersionCommandResponseMockBuilder } from \"./__mocks__/GetOsVersionCommand\";\nimport { GetOsVersionCommand } from \"./GetOsVersionCommand\";\n\nconst GET_OS_VERSION_APDU = Uint8Array.from([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\nconst LNX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x00, 0x00, 0x04, 0x05, 0x32, 0x2e, 0x32, 0x2e, 0x33, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x32, 0x2e, 0x33, 0x30, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x01,\n 0x00, 0x01, 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNX_RESPONSE_DATA_GOOD,\n});\n\nconst LNSP_REPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x10, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x31, 0x2e, 0x31, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x34, 0x2e, 0x30, 0x33, 0x04, 0x33, 0x2e, 0x31, 0x32, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst LNSP_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: LNSP_REPONSE_DATA_GOOD,\n});\n\nconst STAX_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x20, 0x00, 0x04, 0x05, 0x31, 0x2e, 0x33, 0x2e, 0x30, 0x04, 0xe6, 0x00,\n 0x00, 0x00, 0x04, 0x35, 0x2e, 0x32, 0x34, 0x04, 0x30, 0x2e, 0x34, 0x38, 0x01,\n 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst STAX_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: STAX_RESPONSE_DATA_GOOD,\n});\n\nconst BL_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x05, 0x01, 0x00, 0x03, 0x04, 0x31, 0x2e, 0x31, 0x36, 0x04, 0xf4, 0xd8, 0xaa,\n 0x43, 0x05, 0x32, 0x2e, 0x32, 0x2e, 0x33, 0x04, 0x33, 0x00, 0x00, 0x04, 0x90,\n 0x00,\n]);\nconst BL_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: BL_RESPONSE_DATA_GOOD,\n});\n\nconst OLD_FM_RESPONSE_DATA_GOOD = Uint8Array.from([\n 0x33, 0x00, 0x00, 0x04, 0x00, 0x04, 0xee, 0x00, 0x00, 0x00, 0x04, 0x32, 0x2e,\n 0x33, 0x30, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x90, 0x00,\n]);\nconst OLD_FM_RESPONSE_GOOD = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: OLD_FM_RESPONSE_DATA_GOOD,\n});\n\ndescribe(\"GetOsVersionCommand\", () => {\n let command: GetOsVersionCommand;\n\n beforeEach(() => {\n command = new GetOsVersionCommand();\n });\n\n describe(\"getApdu\", () => {\n it(\"should return the GetOsVersion apdu\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(GET_OS_VERSION_APDU);\n });\n });\n\n describe(\"parseResponse\", () => {\n describe(\"Nano X\", () => {\n it(\"should parse the LNX response\", () => {\n const parsed = command.parseResponse(\n LNX_RESPONSE_GOOD,\n DeviceModelId.NANO_X,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_X),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Nano S Plus\", () => {\n it(\"should parse the LNSP response\", () => {\n const parsed = command.parseResponse(\n LNSP_RESPONSE_GOOD,\n DeviceModelId.NANO_SP,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.NANO_SP),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Stax\", () => {\n it(\"should parse the STAX response\", () => {\n const parsed = command.parseResponse(\n STAX_RESPONSE_GOOD,\n DeviceModelId.STAX,\n );\n\n const expected = CommandResultFactory({\n data: getOsVersionCommandResponseMockBuilder(DeviceModelId.STAX),\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Bootloader\", () => {\n it(\"should parse the bootloader response\", () => {\n const parsed = command.parseResponse(\n BL_RESPONSE_GOOD,\n DeviceModelId.STAX,\n );\n\n const expected = CommandResultFactory({\n data: {\n isBootloader: true,\n isOsu: false,\n targetId: 83951619,\n seTargetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xf4, 0xd8, 0xaa, 0x43]),\n mcuTargetId: 83951619,\n mcuSephVersion: \"\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"\",\n langId: undefined,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: true,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: false,\n isInRecoveryMode: false,\n },\n },\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Old firmware\", () => {\n it(\"should parse the old firmware response\", () => {\n const parsed = command.parseResponse(\n OLD_FM_RESPONSE_GOOD,\n DeviceModelId.NANO_X,\n );\n\n const expected = CommandResultFactory({\n data: {\n isBootloader: false,\n isOsu: false,\n targetId: 855638020,\n seTargetId: 855638020,\n seVersion: \"0.0.0\",\n seFlags: new Uint8Array(),\n mcuTargetId: undefined,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"\",\n hwVersion: \"00\",\n langId: undefined,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: true,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n },\n });\n\n expect(parsed).toStrictEqual(expected);\n });\n });\n\n describe(\"Error handling\", () => {\n it(\"should return an error if the response is not successful\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n const result = command.parseResponse(response, DeviceModelId.NANO_S);\n\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n });\n });\n});\n"],
|
5
|
+
"mappings": "AAAA,OACE,wBAAAA,EACA,0BAAAC,MACK,mCACP,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,gBAAAC,MAAoB,mCAE7B,OAAS,0CAAAC,MAA8C,kCACvD,OAAS,uBAAAC,MAA2B,wBAEpC,MAAMC,EAAsB,WAAW,KAAK,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,EAEpEC,EAAyB,WAAW,KAAK,CAC7C,GAAM,EAAM,EAAM,EAAM,EAAM,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C1B,CAAC,EACKmB,EAASL,EAAQ,cAAcI,EAAUnB,EAAc,MAAM,EAEnE,OAAOD,EAAuBqB,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
|
6
|
+
"names": ["CommandResultFactory", "isSuccessCommandResult", "DeviceModelId", "ApduResponse", "getOsVersionCommandResponseMockBuilder", "GetOsVersionCommand", "GET_OS_VERSION_APDU", "LNX_RESPONSE_DATA_GOOD", "LNX_RESPONSE_GOOD", "LNSP_REPONSE_DATA_GOOD", "LNSP_RESPONSE_GOOD", "STAX_RESPONSE_DATA_GOOD", "STAX_RESPONSE_GOOD", "BL_RESPONSE_DATA_GOOD", "BL_RESPONSE_GOOD", "OLD_FM_RESPONSE_DATA_GOOD", "OLD_FM_RESPONSE_GOOD", "command", "apdu", "parsed", "expected", "response", "result"]
|
7
7
|
}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{ApduBuilder as p}from"../../apdu/utils/ApduBuilder";import{ApduParser as c}from"../../apdu/utils/ApduParser";import{InvalidStatusWordError as s}from"../../command/Errors";import{CommandResultFactory as o}from"../../command/model/CommandResult";import{isCommandErrorCode as L}from"../../command/utils/CommandErrors";import{CommandUtils as C}from"../../command/utils/CommandUtils";import{GlobalCommandErrorHandler as l}from"../../command/utils/GlobalCommandError";import{DeviceExchangeError as f}from"../../Error";import{bufferToHexaString as d}from"../../utils/HexaString";const i={"662d":{message:"Invalid LIST_ARG, first command must be sent with P1_LIST_LANGUAGE_PACKS_FIRST."}};class A extends f{constructor({message:r,errorCode:e}){super({message:r,errorCode:e,tag:"ListLanguagePackCommandError"})}}class _{constructor(r){this.args=r}getApdu(){const r={cla:224,ins:52,p1:this.args.firstChunk?0:1,p2:0};return new p(r).build()}parseResponse(r){const e=new c(r);if(!C.isSuccessResponse(r)){const a=e.encodeToHexaString(r.statusCode);return L(a,i)?o({error:new A({...i[a],errorCode:a})}):o({error:l.handle(r)})}if(e.extract8BitUInt()===void 0)return o({data:void 0});e.extract8BitUInt();const t=e.extractFieldLVEncoded();if(t===void 0)return o({error:new s("Failed to get language pack id")});const n=e.extractFieldLVEncoded();if(n===void 0)return o({error:new s("Failed to get language pack size")});const u=parseInt(d(t),16),g=parseInt(d(n),16);return o({data:{id:u,size:g}})}}export{_ as ListLanguagePackCommand,A as ListLanguagePackCommandError};
|
2
|
+
//# sourceMappingURL=ListLanguagePackCommand.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../src/api/command/os/ListLanguagePackCommand.ts"],
|
4
|
+
"sourcesContent": ["import { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder, type ApduBuilderArgs } from \"@api/apdu/utils/ApduBuilder\";\nimport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nimport { type Command } from \"@api/command/Command\";\nimport { InvalidStatusWordError } from \"@api/command/Errors\";\nimport {\n type CommandResult,\n CommandResultFactory,\n} from \"@api/command/model/CommandResult\";\nimport {\n type CommandErrors,\n isCommandErrorCode,\n} from \"@api/command/utils/CommandErrors\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { GlobalCommandErrorHandler } from \"@api/command/utils/GlobalCommandError\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type CommandErrorArgs, DeviceExchangeError } from \"@api/Error\";\nimport { bufferToHexaString } from \"@api/utils/HexaString\";\n\nexport type ListLanguagePackCommandArgs = {\n readonly firstChunk: boolean;\n};\n\nexport type ListLanguagePackResponse =\n | {\n readonly id: number;\n readonly size: number;\n }\n | undefined;\n\nexport type ListLanguagePackErrorCodes = \"662d\";\n\nconst LANGUAGE_PACK_ERRORS: CommandErrors<ListLanguagePackErrorCodes> = {\n \"662d\": {\n message:\n \"Invalid LIST_ARG, first command must be sent with P1_LIST_LANGUAGE_PACKS_FIRST.\",\n },\n};\n\nexport type ListLanguagePackCommandResult = CommandResult<\n ListLanguagePackResponse,\n ListLanguagePackErrorCodes\n>;\n\nexport class ListLanguagePackCommandError extends DeviceExchangeError<ListLanguagePackErrorCodes> {\n constructor({\n message,\n errorCode,\n }: CommandErrorArgs<ListLanguagePackErrorCodes>) {\n super({ message, errorCode, tag: \"ListLanguagePackCommandError\" });\n }\n}\n\nexport class ListLanguagePackCommand\n implements\n Command<\n ListLanguagePackResponse,\n ListLanguagePackCommandArgs,\n ListLanguagePackErrorCodes\n >\n{\n constructor(private args: ListLanguagePackCommandArgs) {}\n\n getApdu(): Apdu {\n const apduArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x34,\n p1: this.args.firstChunk ? 0x00 : 0x01,\n p2: 0x00,\n };\n return new ApduBuilder(apduArgs).build();\n }\n\n parseResponse(apduResponse: ApduResponse): ListLanguagePackCommandResult {\n const parser = new ApduParser(apduResponse);\n\n if (!CommandUtils.isSuccessResponse(apduResponse)) {\n const errorCode = parser.encodeToHexaString(apduResponse.statusCode);\n if (isCommandErrorCode(errorCode, LANGUAGE_PACK_ERRORS)) {\n return CommandResultFactory({\n error: new ListLanguagePackCommandError({\n ...LANGUAGE_PACK_ERRORS[errorCode],\n errorCode,\n }),\n });\n }\n return CommandResultFactory({\n error: GlobalCommandErrorHandler.handle(apduResponse),\n });\n }\n\n const tlvVersion = parser.extract8BitUInt();\n if (tlvVersion === undefined) {\n // No more language package\n return CommandResultFactory({\n data: undefined,\n });\n }\n\n parser.extract8BitUInt(); // total length\n const idBuffer = parser.extractFieldLVEncoded();\n if (idBuffer === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack id\"),\n });\n }\n\n const sizeBuffer = parser.extractFieldLVEncoded();\n if (sizeBuffer === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack size\"),\n });\n }\n\n const id = parseInt(bufferToHexaString(idBuffer), 16);\n const size = parseInt(bufferToHexaString(sizeBuffer), 16);\n return CommandResultFactory({\n data: { id, size },\n });\n }\n}\n"],
|
5
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AAqB,CAC1B,MAAO,IAAID,EAAuB,gCAAgC,CACpE,CAAC,EAGH,MAAMiB,EAAaF,EAAO,sBAAsB,EAChD,GAAIE,IAAe,OACjB,OAAOhB,EAAqB,CAC1B,MAAO,IAAID,EAAuB,kCAAkC,CACtE,CAAC,EAGH,MAAMkB,EAAK,SAASZ,EAAmBU,CAAQ,EAAG,EAAE,EAC9CG,EAAO,SAASb,EAAmBW,CAAU,EAAG,EAAE,EACxD,OAAOhB,EAAqB,CAC1B,KAAM,CAAE,GAAAiB,EAAI,KAAAC,CAAK,CACnB,CAAC,CACH,CACF",
|
6
|
+
"names": ["ApduBuilder", "ApduParser", "InvalidStatusWordError", "CommandResultFactory", "isCommandErrorCode", "CommandUtils", "GlobalCommandErrorHandler", "DeviceExchangeError", "bufferToHexaString", "LANGUAGE_PACK_ERRORS", "ListLanguagePackCommandError", "message", "errorCode", "ListLanguagePackCommand", "args", "apduArgs", "apduResponse", "parser", "idBuffer", "sizeBuffer", "id", "size"]
|
7
|
+
}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{InvalidStatusWordError as a}from"../../command/Errors";import{CommandResultFactory as r}from"../../command/model/CommandResult";import{isSuccessCommandResult as u}from"../../command/model/CommandResult";import{ListLanguagePackCommand as o}from"../../command/os/ListLanguagePackCommand";import{ApduResponse as n}from"../../device-session/ApduResponse";const i=new Uint8Array([224,52,0,0,0]),d=new Uint8Array([224,52,1,0,0]);describe("ListLanguagePackCommand",()=>{let t;beforeEach(()=>{t=new o({firstChunk:!0})}),it("should return the correct APDU",()=>{const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(i)}),it("should return the correct next chunks APDU",()=>{t=new o({firstChunk:!1});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(d)}),it("should parse result successfully",()=>{const e=new n({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15,1,1,4,0,0,80,0,5,48,46,48,46,52,0])}),s=t.parseResponse(e);expect(s).toStrictEqual(r({data:{id:1,size:20480}}))}),it("should parse empty result successfully",()=>{const e=new n({statusCode:new Uint8Array([144,0]),data:new Uint8Array([])}),s=t.parseResponse(e);expect(s).toStrictEqual(r({data:void 0}))}),it("should fail on invalid id",()=>{const e=new n({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15])}),s=t.parseResponse(e);expect(s).toStrictEqual(r({error:new a("Failed to get language pack id")}))}),it("should fail on invalid size",()=>{const e=new n({statusCode:new Uint8Array([144,0]),data:new Uint8Array([1,15,1,1])}),s=t.parseResponse(e);expect(s).toStrictEqual(r({error:new a("Failed to get language pack size")}))}),it("should fail on device error",()=>{const e=new n({statusCode:new Uint8Array([102,45]),data:new Uint8Array([])}),s=t.parseResponse(e);expect(u(s)).toBeFalsy()})});
|
2
|
+
//# sourceMappingURL=ListLanguagePackCommand.test.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../src/api/command/os/ListLanguagePackCommand.test.ts"],
|
4
|
+
"sourcesContent": ["import { InvalidStatusWordError } from \"@api/command/Errors\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport { ListLanguagePackCommand } from \"@api/command/os/ListLanguagePackCommand\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nconst LIST_LANGUAGE_PACK_APDU = new Uint8Array([0xe0, 0x34, 0x00, 0x00, 0x00]);\nconst LIST_LANGUAGE_PACK_CONTINUE_APDU = new Uint8Array([\n 0xe0, 0x34, 0x01, 0x00, 0x00,\n]);\n\ndescribe(\"ListLanguagePackCommand\", () => {\n let command: ListLanguagePackCommand;\n\n beforeEach(() => {\n command = new ListLanguagePackCommand({ firstChunk: true });\n });\n\n it(\"should return the correct APDU\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(LIST_LANGUAGE_PACK_APDU);\n });\n\n it(\"should return the correct next chunks APDU\", () => {\n command = new ListLanguagePackCommand({ firstChunk: false });\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(LIST_LANGUAGE_PACK_CONTINUE_APDU);\n });\n\n it(\"should parse result successfully\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([\n 0x01, 0x0f, 0x01, 0x01, 0x04, 0x00, 0x00, 0x50, 0x00, 0x05, 0x30, 0x2e,\n 0x30, 0x2e, 0x34, 0x00,\n ]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: {\n id: 1,\n size: 20480,\n },\n }),\n );\n });\n\n it(\"should parse empty result successfully\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: undefined,\n }),\n );\n });\n\n it(\"should fail on invalid id\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0x01, 0x0f]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack id\"),\n }),\n );\n });\n\n it(\"should fail on invalid size\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0x01, 0x0f, 0x01, 0x01]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Failed to get language pack size\"),\n }),\n );\n });\n\n it(\"should fail on device error\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x66, 0x2d]),\n data: new Uint8Array([]),\n });\n const result = command.parseResponse(response);\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n});\n"],
|
5
|
+
"mappings": "AAAA,OAAS,0BAAAA,MAA8B,sBACvC,OAAS,wBAAAC,MAA4B,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cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,cACbT,EAAqB,CACnB,KAAM,MACR,CAAC,CACH,CACF,CAAC,EAED,GAAG,4BAA6B,IAAM,CACpC,MAAMQ,EAAyB,IAAIL,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,EAAI,CAAC,CACnC,CAAC,EACKM,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,cACbT,EAAqB,CACnB,MAAO,IAAID,EAAuB,gCAAgC,CACpE,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMS,EAAyB,IAAIL,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,GAAM,EAAM,CAAI,CAAC,CAC/C,CAAC,EACKM,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,cACbT,EAAqB,CACnB,MAAO,IAAID,EAAuB,kCAAkC,CACtE,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMS,EAAyB,IAAIL,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,EAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EACKM,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOP,EAAuBQ,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC",
|
6
|
+
"names": ["InvalidStatusWordError", "CommandResultFactory", "isSuccessCommandResult", "ListLanguagePackCommand", "ApduResponse", "LIST_LANGUAGE_PACK_APDU", "LIST_LANGUAGE_PACK_CONTINUE_APDU", "command", "apdu", "response", "result"]
|
7
|
+
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{DeviceModelId as e}from"../../../device/DeviceModel";const o=(
|
1
|
+
import{DeviceModelId as e}from"../../../device/DeviceModel";const o=(r=e.NANO_SP,s={})=>({[e.NANO_SP]:{isBootloader:!1,isOsu:!1,targetId:856686596,seTargetId:856686596,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"4.03",mcuBootloaderVersion:"3.12",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...s},[e.NANO_S]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...s},[e.NANO_X]:{isBootloader:!1,isOsu:!1,targetId:855638020,seTargetId:855638020,seVersion:"2.2.3",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"2.30",mcuBootloaderVersion:"1.16",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1}},[e.STAX]:{isBootloader:!1,isOsu:!1,targetId:857735172,seTargetId:857735172,seVersion:"1.3.0",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"5.24",mcuBootloaderVersion:"0.48",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...s},[e.FLEX]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1},...s}})[r];export{o as getOsVersionCommandResponseMockBuilder};
|
2
2
|
//# sourceMappingURL=GetOsVersionCommand.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/command/os/__mocks__/GetOsVersionCommand.ts"],
|
4
|
-
"sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n targetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId:
|
5
|
-
"mappings": "AACA,OAAS,iBAAAA,MAAqB,0BAEvB,MAAMC,EAAyC,CACpDC,EAA+BF,EAAc,QAC7CG,EAAuC,CAAC,KAEvC,CACC,CAACH,EAAc,OAAO,EAAG,CACvB,SAAU,UACV,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,
|
4
|
+
"sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n isBootloader: false,\n isOsu: false,\n targetId: 856686596,\n seTargetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_S]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_X]: {\n isBootloader: false,\n isOsu: false,\n targetId: 855638020,\n seTargetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n },\n [DeviceModelId.STAX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 857735172,\n seTargetId: 857735172,\n seVersion: \"1.3.0\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"5.24\",\n mcuBootloaderVersion: \"0.48\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.FLEX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n })[deviceModelId];\n"],
|
5
|
+
"mappings": "AACA,OAAS,iBAAAA,MAAqB,0BAEvB,MAAMC,EAAyC,CACpDC,EAA+BF,EAAc,QAC7CG,EAAuC,CAAC,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AAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,EACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGG,CACL,EACA,CAACH,EAAc,IAAI,EAAG,CACpB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,EACR,aAAc,EACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGG,CACL,CACF,GAAGD,CAAa",
|
6
6
|
"names": ["DeviceModelId", "getOsVersionCommandResponseMockBuilder", "deviceModelId", "props"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
var S=Object.defineProperty;var
|
1
|
+
var S=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var g=(t,e,r,s)=>{for(var o=s>1?void 0:s?d(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=(s?c(e,r,o):c(o))||o);return s&&o&&S(e,r,o),o},a=(t,e)=>(r,s)=>e(r,s,t);import{inject as m,injectable as v}from"inversify";import{deviceSessionTypes as p}from"../../../internal/device-session/di/deviceSessionTypes";import{loggerTypes as l}from"../../../internal/logger-publisher/di/loggerTypes";let n=class{_sessionService;_logger;constructor(e,r){this._sessionService=e,this._logger=r("SendCommandUseCase")}async execute({sessionId:e,command:r,abortTimeout:s}){return this._sessionService.getDeviceSessionById(e).caseOf({Right:async i=>await i.sendCommand(r,s),Left:i=>{throw this._logger.error("Error getting session",{data:{error:i}}),i}})}};n=g([v(),a(0,m(p.DeviceSessionService)),a(1,m(l.LoggerPublisherServiceFactory))],n);export{n as SendCommandUseCase};
|
2
2
|
//# sourceMappingURL=SendCommandUseCase.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/command/use-case/SendCommandUseCase.ts"],
|
4
|
-
"sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { Command } from \"@api/command/Command\";\nimport { CommandResult } from \"@api/command/model/CommandResult\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\n\nexport type SendCommandUseCaseArgs<Response, ErrorStatusCodes, Args = void> = {\n /**\n * The device session id.\n */\n readonly sessionId: string;\n /**\n * The command to send.\n */\n readonly command: Command<Response, ErrorStatusCodes, Args>;\n};\n\n/**\n * Sends a command to a device through a device session.\n */\n@injectable()\nexport class SendCommandUseCase {\n private readonly _sessionService: DeviceSessionService;\n private readonly _logger: LoggerPublisherService;\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._sessionService = sessionService;\n this._logger = loggerFactory(\"SendCommandUseCase\");\n }\n\n /**\n * Sends a command to a device through a device session.\n *\n * @param sessionId - The device session id.\n * @param command - The command to send.\n * @returns The response from the command.\n */\n async execute<Response, Args, ErrorStatusCodes>({\n sessionId,\n command,\n }: SendCommandUseCaseArgs<Response, Args, ErrorStatusCodes>): Promise<\n CommandResult<Response, ErrorStatusCodes>\n > {\n const deviceSessionOrError =\n this._sessionService.getDeviceSessionById(sessionId);\n\n return deviceSessionOrError.caseOf({\n // Case device session found\n Right: async (deviceSession) =>\n await deviceSession.sendCommand<Response, Args, ErrorStatusCodes>(\n command,\n ),\n // Case device session not found\n Left: (error) => {\n this._logger.error(\"Error getting session\", {\n data: { error },\n });\n throw error;\n },\n });\n }\n}\n"],
|
5
|
-
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAKnC,OAAS,sBAAAC,MAA0B,iDAEnC,OAAS,eAAAC,MAAmB,
|
6
|
-
"names": ["inject", "injectable", "deviceSessionTypes", "loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "deviceSession", "error", "__decorateClass", "injectable", "__decorateParam", "inject", "deviceSessionTypes", "loggerTypes"]
|
4
|
+
"sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { Command } from \"@api/command/Command\";\nimport { CommandResult } from \"@api/command/model/CommandResult\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { deviceSessionTypes } from \"@internal/device-session/di/deviceSessionTypes\";\nimport type { DeviceSessionService } from \"@internal/device-session/service/DeviceSessionService\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\n\nexport type SendCommandUseCaseArgs<Response, ErrorStatusCodes, Args = void> = {\n /**\n * The device session id.\n */\n readonly sessionId: string;\n /**\n * The command to send.\n */\n readonly command: Command<Response, ErrorStatusCodes, Args>;\n /**\n * The timeout to abort the command.\n */\n readonly abortTimeout?: number;\n};\n\n/**\n * Sends a command to a device through a device session.\n */\n@injectable()\nexport class SendCommandUseCase {\n private readonly _sessionService: DeviceSessionService;\n private readonly _logger: LoggerPublisherService;\n constructor(\n @inject(deviceSessionTypes.DeviceSessionService)\n sessionService: DeviceSessionService,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._sessionService = sessionService;\n this._logger = loggerFactory(\"SendCommandUseCase\");\n }\n\n /**\n * Sends a command to a device through a device session.\n *\n * @param sessionId - The device session id.\n * @param command - The command to send.\n * @returns The response from the command.\n */\n async execute<Response, Args, ErrorStatusCodes>({\n sessionId,\n command,\n abortTimeout,\n }: SendCommandUseCaseArgs<Response, Args, ErrorStatusCodes>): Promise<\n CommandResult<Response, ErrorStatusCodes>\n > {\n const deviceSessionOrError =\n this._sessionService.getDeviceSessionById(sessionId);\n\n return deviceSessionOrError.caseOf({\n // Case device session found\n Right: async (deviceSession) =>\n await deviceSession.sendCommand<Response, Args, ErrorStatusCodes>(\n command,\n abortTimeout,\n ),\n // Case device session not found\n Left: (error) => {\n this._logger.error(\"Error getting session\", {\n data: { error },\n });\n throw error;\n },\n });\n }\n}\n"],
|
5
|
+
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAKnC,OAAS,sBAAAC,MAA0B,iDAEnC,OAAS,eAAAC,MAAmB,4CAqBrB,IAAMC,EAAN,KAAyB,CACb,gBACA,QACjB,YAEEC,EAEAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,QAAUC,EAAc,oBAAoB,CACnD,CASA,MAAM,QAA0C,CAC9C,UAAAC,EACA,QAAAC,EACA,aAAAC,CACF,EAEE,CAIA,OAFE,KAAK,gBAAgB,qBAAqBF,CAAS,EAEzB,OAAO,CAEjC,MAAO,MAAOG,GACZ,MAAMA,EAAc,YAClBF,EACAC,CACF,EAEF,KAAOE,GAAU,CACf,WAAK,QAAQ,MAAM,wBAAyB,CAC1C,KAAM,CAAE,MAAAA,CAAM,CAChB,CAAC,EACKA,CACR,CACF,CAAC,CACH,CACF,EA9CaP,EAANQ,EAAA,CADNC,EAAW,EAKPC,EAAA,EAAAC,EAAOC,EAAmB,oBAAoB,GAE9CF,EAAA,EAAAC,EAAOE,EAAY,6BAA6B,IANxCb",
|
6
|
+
"names": ["inject", "injectable", "deviceSessionTypes", "loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "abortTimeout", "deviceSession", "error", "__decorateClass", "injectable", "__decorateParam", "inject", "deviceSessionTypes", "loggerTypes"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
class
|
1
|
+
class t{static isValidStatusCode(e){return e.length===2}static isSuccessResponse({statusCode:e}){return t.isValidStatusCode(e)?e[0]===144&&e[1]===0:!1}static isLockedDeviceResponse({statusCode:e}){return t.isValidStatusCode(e)?e[0]===85&&e[1]===21:!1}static isApduThatTriggersDisconnection(e){const s=new Map;return s.set("openApp",new Uint8Array([224,216,0,0])),s.set("closeApp",new Uint8Array([176,167,0,0])),Array.from(s.values()).some(i=>{for(let r=0;r<4;r++)if(i[r]!==e[r])return!1;return!0})}}export{t as CommandUtils};
|
2
2
|
//# sourceMappingURL=CommandUtils.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/command/utils/CommandUtils.ts"],
|
4
|
-
"sourcesContent": ["import { type ApduResponse } from \"@api/device-session/ApduResponse\";\n\nexport class CommandUtils {\n static isValidStatusCode(statusCode: Uint8Array) {\n return statusCode.length === 2;\n }\n\n static isSuccessResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x90 && statusCode[1] === 0x00;\n }\n\n static isLockedDeviceResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x55 && statusCode[1] === 0x15;\n }\n}\n"],
|
5
|
-
"mappings": "AAEO,MAAMA,CAAa,CACxB,OAAO,kBAAkBC,EAAwB,CAC/C,OAAOA,EAAW,SAAW,CAC/B,CAEA,OAAO,kBAAkB,CAAE,WAAAA,CAAW,EAAiB,CACrD,OAAKD,EAAa,kBAAkBC,CAAU,EAIvCA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,EAH1C,EAIX,CAEA,OAAO,uBAAuB,CAAE,WAAAA,CAAW,EAAiB,CAC1D,OAAKD,EAAa,kBAAkBC,CAAU,EAIvCA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,GAH1C,EAIX,CACF",
|
6
|
-
"names": ["CommandUtils", "statusCode"]
|
4
|
+
"sourcesContent": ["import { type ApduResponse } from \"@api/device-session/ApduResponse\";\n\nexport class CommandUtils {\n static isValidStatusCode(statusCode: Uint8Array) {\n return statusCode.length === 2;\n }\n\n static isSuccessResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x90 && statusCode[1] === 0x00;\n }\n\n static isLockedDeviceResponse({ statusCode }: ApduResponse) {\n if (!CommandUtils.isValidStatusCode(statusCode)) {\n return false;\n }\n\n return statusCode[0] === 0x55 && statusCode[1] === 0x15;\n }\n\n static isApduThatTriggersDisconnection(apdu: Uint8Array) {\n /**\n * Map of known APDUs that trigger a disconnection.\n */\n const apduMap = new Map();\n apduMap.set(\"openApp\", new Uint8Array([0xe0, 0xd8, 0x00, 0x00]));\n apduMap.set(\"closeApp\", new Uint8Array([0xb0, 0xa7, 0x00, 0x00]));\n // TODO: add more APDUs that trigger a disconnection (e.g firmware flashing ?)\n\n // check if apdu first 4 UintArray is included in apduMap\n return Array.from(apduMap.values()).some((value: Uint8Array) => {\n for (let i = 0; i < 4; i++) {\n if (value[i] !== apdu[i]) {\n return false;\n }\n }\n return true;\n });\n }\n}\n"],
|
5
|
+
"mappings": "AAEO,MAAMA,CAAa,CACxB,OAAO,kBAAkBC,EAAwB,CAC/C,OAAOA,EAAW,SAAW,CAC/B,CAEA,OAAO,kBAAkB,CAAE,WAAAA,CAAW,EAAiB,CACrD,OAAKD,EAAa,kBAAkBC,CAAU,EAIvCA,EAAW,CAAC,IAAM,KAAQA,EAAW,CAAC,IAAM,EAH1C,EAIX,CAEA,OAAO,uBAAuB,CAAE,WAAAA,CAAW,EAAiB,CAC1D,OAAKD,EAAa,kBAAkBC,CAAU,EAIvCA,EAAW,CAAC,IAAM,IAAQA,EAAW,CAAC,IAAM,GAH1C,EAIX,CAEA,OAAO,gCAAgCC,EAAkB,CAIvD,MAAMC,EAAU,IAAI,IACpB,OAAAA,EAAQ,IAAI,UAAW,IAAI,WAAW,CAAC,IAAM,IAAM,EAAM,CAAI,CAAC,CAAC,EAC/DA,EAAQ,IAAI,WAAY,IAAI,WAAW,CAAC,IAAM,IAAM,EAAM,CAAI,CAAC,CAAC,EAIzD,MAAM,KAAKA,EAAQ,OAAO,CAAC,EAAE,KAAMC,GAAsB,CAC9D,QAASC,EAAI,EAAGA,EAAI,EAAGA,IACrB,GAAID,EAAMC,CAAC,IAAMH,EAAKG,CAAC,EACrB,MAAO,GAGX,MAAO,EACT,CAAC,CACH,CACF",
|
6
|
+
"names": ["CommandUtils", "statusCode", "apdu", "apduMap", "value", "i"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{ApduResponse as
|
1
|
+
import{CloseAppCommand as o}from"../../command/os/CloseAppCommand";import{GetAppAndVersionCommand as r}from"../../command/os/GetAppAndVersionCommand";import{OpenAppCommand as i}from"../../command/os/OpenAppCommand";import{ApduResponse as s}from"../../device-session/ApduResponse";import{CommandUtils as t}from"./CommandUtils";describe("CommandUtils",()=>{describe("static isSuccessResponse",()=>{it("should return true if the status code is 0x9000",()=>{const e=new s({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.isSuccessResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x9000",()=>{const e=new s({statusCode:Uint8Array.from([110,128]),data:Uint8Array.from([])});expect(t.isSuccessResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s({statusCode:Uint8Array.from([85]),data:Uint8Array.from([])});expect(t.isSuccessResponse(e)).toBe(!1)})}),describe("static isValidStatusCode",()=>{it("should return true if the status code is 2 bytes long",()=>{const e=Uint8Array.from([144,0]);expect(t.isValidStatusCode(e)).toBe(!0)}),it("should return false if the status code is not 2 bytes long",()=>{const e=Uint8Array.from([144]);expect(t.isValidStatusCode(e)).toBe(!1)})}),describe("static isLockedDeviceResponse",()=>{it("should return true if the status code is 0x5515",()=>{const e=new s({statusCode:Uint8Array.from([85,21]),data:Uint8Array.from([])});expect(t.isLockedDeviceResponse(e)).toBe(!0)}),it("should return false if the status code is not 0x5515",()=>{const e=new s({statusCode:Uint8Array.from([144,0]),data:Uint8Array.from([])});expect(t.isLockedDeviceResponse(e)).toBe(!1)}),it("should return false if the status code is not 2 bytes long",()=>{const e=new s({statusCode:Uint8Array.from([144]),data:Uint8Array.from([])});expect(t.isLockedDeviceResponse(e)).toBe(!1)})}),describe("static isApduThatTriggersDisconnection",()=>{it("should return true if the APDU is openApp",()=>{const e=new i({appName:"test"}).getApdu().getRawApdu();expect(t.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return true if the APDU is closeApp",()=>{const e=new o().getApdu().getRawApdu();expect(t.isApduThatTriggersDisconnection(e)).toBe(!0)}),it("should return false if the APDU is not a known one",()=>{const e=new r().getApdu().getRawApdu();expect(t.isApduThatTriggersDisconnection(e)).toBe(!1)})})});
|
2
2
|
//# sourceMappingURL=CommandUtils.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/command/utils/CommandUtils.test.ts"],
|
4
|
-
"sourcesContent": ["import { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { CommandUtils } from \"./CommandUtils\";\n\ndescribe(\"CommandUtils\", () => {\n describe(\"static isSuccessResponse\", () => {\n it(\"should return true if the status code is 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isValidStatusCode\", () => {\n it(\"should return true if the status code is 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90, 0x00]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(true);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(false);\n });\n });\n\n describe(\"static isLockedDeviceResponse\", () => {\n it(\"should return true if the status code is 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n });\n});\n"],
|
5
|
-
"mappings": "AAAA,OAAS,
|
6
|
-
"names": ["ApduResponse", "CommandUtils", "response", "statusCode"]
|
4
|
+
"sourcesContent": ["import { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nimport { GetAppAndVersionCommand } from \"@api/command/os/GetAppAndVersionCommand\";\nimport { OpenAppCommand } from \"@api/command/os/OpenAppCommand\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { CommandUtils } from \"./CommandUtils\";\n\ndescribe(\"CommandUtils\", () => {\n describe(\"static isSuccessResponse\", () => {\n it(\"should return true if the status code is 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x9000\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x6e, 0x80]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isSuccessResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isValidStatusCode\", () => {\n it(\"should return true if the status code is 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90, 0x00]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(true);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const statusCode = Uint8Array.from([0x90]);\n\n expect(CommandUtils.isValidStatusCode(statusCode)).toBe(false);\n });\n });\n\n describe(\"static isLockedDeviceResponse\", () => {\n it(\"should return true if the status code is 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(true);\n });\n\n it(\"should return false if the status code is not 0x5515\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n\n it(\"should return false if the status code is not 2 bytes long\", () => {\n const response = new ApduResponse({\n statusCode: Uint8Array.from([0x90]),\n data: Uint8Array.from([]),\n });\n\n expect(CommandUtils.isLockedDeviceResponse(response)).toBe(false);\n });\n });\n\n describe(\"static isApduThatTriggersDisconnection\", () => {\n it(\"should return true if the APDU is openApp\", () => {\n const apdu = new OpenAppCommand({ appName: \"test\" })\n .getApdu()\n .getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(true);\n });\n\n it(\"should return true if the APDU is closeApp\", () => {\n const apdu = new CloseAppCommand().getApdu().getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(true);\n });\n\n it(\"should return false if the APDU is not a known one\", () => {\n const apdu = new GetAppAndVersionCommand().getApdu().getRawApdu();\n\n expect(CommandUtils.isApduThatTriggersDisconnection(apdu)).toBe(false);\n });\n });\n});\n"],
|
5
|
+
"mappings": "AAAA,OAAS,mBAAAA,MAAuB,kCAChC,OAAS,2BAAAC,MAA+B,0CACxC,OAAS,kBAAAC,MAAsB,iCAC/B,OAAS,gBAAAC,MAAoB,mCAE7B,OAAS,gBAAAC,MAAoB,iBAE7B,SAAS,eAAgB,IAAM,CAC7B,SAAS,2BAA4B,IAAM,CACzC,GAAG,kDAAmD,IAAM,CAC1D,MAAMC,EAAW,IAAIF,EAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAOC,EAAa,kBAAkBC,CAAQ,CAAC,EAAE,KAAK,EAAI,CAC5D,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMA,EAAW,IAAIF,EAAa,CAChC,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,EACxC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAOC,EAAa,kBAAkBC,CAAQ,CAAC,EAAE,KAAK,EAAK,CAC7D,CAAC,EAED,GAAG,6DAA8D,IAAM,CACrE,MAAMA,EAAW,IAAIF,EAAa,CAChC,WAAY,WAAW,KAAK,CAAC,EAAI,CAAC,EAClC,KAAM,WAAW,KAAK,CAAC,CAAC,CAC1B,CAAC,EAED,OAAOC,EAAa,kBAAkBC,CAAQ,CAAC,EAAE,KAAK,EAAK,CAC7D,CAAC,CACH,CAAC,EAED,SAAS,2BAA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,CAAC,EAED,GAAG,6CAA8C,IAAM,CACrD,MAAMA,EAAO,IAAIP,EAAgB,EAAE,QAAQ,EAAE,WAAW,EAExD,OAAOI,EAAa,gCAAgCG,CAAI,CAAC,EAAE,KAAK,EAAI,CACtE,CAAC,EAED,GAAG,qDAAsD,IAAM,CAC7D,MAAMA,EAAO,IAAIN,EAAwB,EAAE,QAAQ,EAAE,WAAW,EAEhE,OAAOG,EAAa,gCAAgCG,CAAI,CAAC,EAAE,KAAK,EAAK,CACvE,CAAC,CACH,CAAC,CACH,CAAC",
|
6
|
+
"names": ["CloseAppCommand", "GetAppAndVersionCommand", "OpenAppCommand", "ApduResponse", "CommandUtils", "response", "statusCode", "apdu"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
const e=vi.fn(),n=vi.fn(),t=vi.fn(),i=vi.fn(),c=vi.fn(),o=vi.fn(),s=vi.fn(),a=vi.fn();function
|
1
|
+
const e=vi.fn(),n=vi.fn(),t=vi.fn(),i=vi.fn(),c=vi.fn(),o=vi.fn(),s=vi.fn(),a=vi.fn(),r=vi.fn();function v(){return{sendApdu:e,sendCommand:n,getDeviceModel:t,getDeviceSessionState:i,getDeviceSessionStateObservable:c,setDeviceSessionState:o,getManagerApiService:s,getSecureChannelService:a,disableRefresher:r}}export{v as makeDeviceActionInternalApiMock};
|
2
2
|
//# sourceMappingURL=makeInternalApi.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/__test-utils__/makeInternalApi.ts"],
|
4
|
-
"sourcesContent": ["import { type Mocked } from \"vitest\";\n\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\n\nconst sendApduMock = vi.fn();\nconst sendCommandMock = vi.fn();\nconst apiGetDeviceSessionStateMock = vi.fn();\nconst apiGetDeviceSessionStateObservableMock = vi.fn();\nconst setDeviceSessionStateMock = vi.fn();\nconst getManagerApiServiceMock = vi.fn();\nconst getSecureChannelServiceMock = vi.fn();\nconst disableRefresherMock = vi.fn();\n\nexport function makeDeviceActionInternalApiMock(): Mocked<InternalApi> {\n return {\n sendApdu: sendApduMock,\n sendCommand: sendCommandMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n getDeviceSessionStateObservable: apiGetDeviceSessionStateObservableMock,\n setDeviceSessionState: setDeviceSessionStateMock,\n getManagerApiService: getManagerApiServiceMock,\n getSecureChannelService: getSecureChannelServiceMock,\n disableRefresher: disableRefresherMock,\n };\n}\n"],
|
5
|
-
"mappings": "AAIA,MAAMA,EAAe,GAAG,GAAG,EACrBC,EAAkB,GAAG,GAAG,EACxBC,EAA+B,GAAG,GAAG,EACrCC,EAAyC,GAAG,GAAG,EAC/CC,EAA4B,GAAG,GAAG,EAClCC,EAA2B,GAAG,GAAG,EACjCC,EAA8B,GAAG,GAAG,EACpCC,EAAuB,GAAG,GAAG,EAE5B,SAASC,GAAuD,CACrE,MAAO,CACL,
|
6
|
-
"names": ["sendApduMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "getSecureChannelServiceMock", "disableRefresherMock", "makeDeviceActionInternalApiMock"]
|
4
|
+
"sourcesContent": ["import { type Mocked } from \"vitest\";\n\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\n\nconst sendApduMock = vi.fn();\nconst sendCommandMock = vi.fn();\nconst apiGetDeviceModelMock = vi.fn();\nconst apiGetDeviceSessionStateMock = vi.fn();\nconst apiGetDeviceSessionStateObservableMock = vi.fn();\nconst setDeviceSessionStateMock = vi.fn();\nconst getManagerApiServiceMock = vi.fn();\nconst getSecureChannelServiceMock = vi.fn();\nconst disableRefresherMock = vi.fn();\n\nexport function makeDeviceActionInternalApiMock(): Mocked<InternalApi> {\n return {\n sendApdu: sendApduMock,\n sendCommand: sendCommandMock,\n getDeviceModel: apiGetDeviceModelMock,\n getDeviceSessionState: apiGetDeviceSessionStateMock,\n getDeviceSessionStateObservable: apiGetDeviceSessionStateObservableMock,\n setDeviceSessionState: setDeviceSessionStateMock,\n getManagerApiService: getManagerApiServiceMock,\n getSecureChannelService: getSecureChannelServiceMock,\n disableRefresher: disableRefresherMock,\n };\n}\n"],
|
5
|
+
"mappings": "AAIA,MAAMA,EAAe,GAAG,GAAG,EACrBC,EAAkB,GAAG,GAAG,EACxBC,EAAwB,GAAG,GAAG,EAC9BC,EAA+B,GAAG,GAAG,EACrCC,EAAyC,GAAG,GAAG,EAC/CC,EAA4B,GAAG,GAAG,EAClCC,EAA2B,GAAG,GAAG,EACjCC,EAA8B,GAAG,GAAG,EACpCC,EAAuB,GAAG,GAAG,EAE5B,SAASC,GAAuD,CACrE,MAAO,CACL,SAAUT,EACV,YAAaC,EACb,eAAgBC,EAChB,sBAAuBC,EACvB,gCAAiCC,EACjC,sBAAuBC,EACvB,qBAAsBC,EACtB,wBAAyBC,EACzB,iBAAkBC,CACpB,CACF",
|
6
|
+
"names": ["sendApduMock", "sendCommandMock", "apiGetDeviceModelMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "getSecureChannelServiceMock", "disableRefresherMock", "makeDeviceActionInternalApiMock"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{Left as
|
1
|
+
import{Left as o,Right as a}from"purify-ts";import{assign as i,createMachine as r}from"xstate";import{UserInteractionRequired as p}from"../../device-action/model/UserInteractionRequired";import{UnknownDAError as c}from"../../device-action/os/Errors";import{GetDeviceMetadataDeviceAction as m}from"../../device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction";import{GetDeviceStatusDeviceAction as s}from"../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as d}from"../../device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{InstallOrUpdateAppsDeviceAction as l}from"../../device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction";import{ListAppsDeviceAction as u}from"../../device-action/os/ListApps/ListAppsDeviceAction";import{OpenAppDeviceAction as f}from"../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{ListInstalledAppsDeviceAction as A}from"../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";const V=(e,t=!1)=>{u.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockListAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.AllowListApps})})},done:{type:"final"}},output:()=>t?o(new c("ListApps failed")):a(e)}))}))},L=(e,t=!1)=>{m.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockGetDeviceMetadataDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:()=>t?o(new c("GetDeviceMetadata failed")):a(e)}))}))},q=(e,t,n=!1)=>{l.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockInstallOrUpdateAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>t})},done:{type:"final"}},output:()=>n?o(new c("InstallOrUpdateApps failed")):a(e)}))}))},w=(e=!1)=>{f.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({initial:"ready",states:{ready:{entry:i({intermediateValue:{requiredUserInteraction:p.ConfirmOpenApp}}),after:{0:"done"}},done:{type:"final"}},output:()=>e?o(new c("OpenApp failed")):a(void 0)}))}))},x=(e=!1)=>{d.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockGoToDashboardDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:()=>e?o(new c("GoToDashboard failed")):a(void 0)}))}))},b=(e=[{currentApp:"BOLOS",currentAppVersion:"1.0.0"}])=>{const t=vi.fn();for(const n of e)t.mockImplementationOnce(()=>"currentApp"in n?a(n):o(n));s.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockGetDeviceStatusDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:t}))}))},T=(e=[])=>{A.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>r({id:"MockListInstalledAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:i({intermediateValue:()=>({requiredUserInteraction:p.None})})},done:{type:"final"}},output:e.reduce((t,n)=>t.mockImplementationOnce(()=>"installedApps"in n?a(n):o(n)),vi.fn()).mockImplementation(()=>a([]))}))}))};export{L as setupGetDeviceMetadataMock,b as setupGetDeviceStatusMock,x as setupGoToDashboardMock,q as setupInstallOrUpdateAppsMock,V as setupListAppsMock,T as setupListInstalledAppsMock,w as setupOpenAppMock};
|
2
2
|
//# sourceMappingURL=setupTestMachine.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/__test-utils__/setupTestMachine.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nimport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nimport { type DmkError } from \"@api/Error\";\nimport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nimport { type InstalledApp } from \"@api/secure-channel/device-action/ListInstalledApps/types\";\n\nimport { type BTC_APP } from \"./data\";\n\ntype App = typeof BTC_APP;\n\nexport const setupListAppsMock = (apps: App[], error = false) => {\n (ListAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockListAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"ListApps failed\"))\n : Right(apps);\n },\n }),\n ),\n }));\n};\n\nexport const setupGoToDashboardMock = (error: boolean = false) => {\n (GoToDashboardDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGoToDashboardDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"GoToDashboard failed\"))\n : Right(undefined);\n },\n }),\n ),\n }));\n};\n\nexport const setupGetDeviceStatusMock = (\n outputs: ReadonlyArray<\n { currentApp: string; currentAppVersion: string } | DmkError\n > = [\n {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n ],\n) => {\n const outputFn = vi.fn();\n\n for (const output of outputs) {\n outputFn.mockImplementationOnce(() =>\n \"currentApp\" in output ? Right(output) : Left(output),\n );\n }\n (GetDeviceStatusDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGetDeviceStatusDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: outputFn,\n }),\n ),\n }));\n};\n\nexport const setupListInstalledAppsMock = (\n outputs: Array<{ installedApps: InstalledApp[] } | DmkError> = [],\n) => {\n (ListInstalledAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockListInstalledAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: outputs\n .reduce(\n (mockFn, output) =>\n mockFn.mockImplementationOnce(() =>\n \"installedApps\" in output ? Right(output) : Left(output),\n ),\n vi.fn(),\n )\n .mockImplementation(() => Right([])),\n }),\n ),\n }));\n};\n"],
|
5
|
-
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAE5B,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,SAEtC,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,+BAAAC,MAAmC,oEAC5C,OAAS,6BAAAC,MAAiC,gEAC1C,OAAS,wBAAAC,MAA4B,
|
6
|
-
"names": ["Left", "Right", "assign", "createMachine", "UserInteractionRequired", "UnknownDAError", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "ListAppsDeviceAction", "ListInstalledAppsDeviceAction", "setupListAppsMock", "apps", "error", "setupGoToDashboardMock", "setupGetDeviceStatusMock", "outputs", "outputFn", "output", "setupListInstalledAppsMock", "mockFn"]
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nimport { type GetDeviceMetadataDAOutput } from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nimport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nimport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nimport {\n type InstallOrUpdateAppsDAIntermediateValue,\n type InstallOrUpdateAppsDAOutput,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type DmkError } from \"@api/Error\";\nimport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nimport { type InstalledApp } from \"@api/secure-channel/device-action/ListInstalledApps/types\";\n\nimport { type BTC_APP } from \"./data\";\n\ntype App = typeof BTC_APP;\n\nexport const setupListAppsMock = (apps: App[], error = false) => {\n (ListAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockListAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.AllowListApps,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"ListApps failed\"))\n : Right(apps);\n },\n }),\n ),\n }));\n};\n\nexport const setupGetDeviceMetadataMock = (\n metadata: GetDeviceMetadataDAOutput,\n error = false,\n) => {\n (GetDeviceMetadataDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGetDeviceMetadataDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"GetDeviceMetadata failed\"))\n : Right(metadata);\n },\n }),\n ),\n }));\n};\n\nexport const setupInstallOrUpdateAppsMock = (\n result: InstallOrUpdateAppsDAOutput,\n intermediateValue: InstallOrUpdateAppsDAIntermediateValue,\n error = false,\n) => {\n (InstallOrUpdateAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockInstallOrUpdateAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => intermediateValue,\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"InstallOrUpdateApps failed\"))\n : Right(result);\n },\n }),\n ),\n }));\n};\n\nexport const setupOpenAppMock = (error: boolean = false) => {\n (OpenAppDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n initial: \"ready\",\n states: {\n ready: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n }),\n after: {\n 0: \"done\",\n },\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"OpenApp failed\"))\n : Right(undefined);\n },\n }),\n ),\n }));\n};\n\nexport const setupGoToDashboardMock = (error: boolean = false) => {\n (GoToDashboardDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGoToDashboardDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: () => {\n return error\n ? Left(new UnknownDAError(\"GoToDashboard failed\"))\n : Right(undefined);\n },\n }),\n ),\n }));\n};\n\nexport const setupGetDeviceStatusMock = (\n outputs: ReadonlyArray<\n { currentApp: string; currentAppVersion: string } | DmkError\n > = [\n {\n currentApp: \"BOLOS\",\n currentAppVersion: \"1.0.0\",\n },\n ],\n) => {\n const outputFn = vi.fn();\n\n for (const output of outputs) {\n outputFn.mockImplementationOnce(() =>\n \"currentApp\" in output ? Right(output) : Left(output),\n );\n }\n (GetDeviceStatusDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockGetDeviceStatusDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: outputFn,\n }),\n ),\n }));\n};\n\nexport const setupListInstalledAppsMock = (\n outputs: Array<{ installedApps: InstalledApp[] } | DmkError> = [],\n) => {\n (ListInstalledAppsDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n id: \"MockListInstalledAppsDeviceAction\",\n initial: \"ready\",\n states: {\n ready: {\n after: {\n 0: \"done\",\n },\n entry: assign({\n intermediateValue: () => ({\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n },\n done: {\n type: \"final\",\n },\n },\n output: outputs\n .reduce(\n (mockFn, output) =>\n mockFn.mockImplementationOnce(() =>\n \"installedApps\" in output ? Right(output) : Left(output),\n ),\n vi.fn(),\n )\n .mockImplementation(() => Right([])),\n }),\n ),\n }));\n};\n"],
|
5
|
+
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAE5B,OAAS,UAAAC,E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F,IACG,CACH,MAAMC,EAAW,GAAG,GAAG,EAEvB,UAAWC,KAAUF,EACnBC,EAAS,uBAAuB,IAC9B,eAAgBC,EAASzB,EAAMyB,CAAM,EAAI1B,EAAK0B,CAAM,CACtD,EAEDnB,EAAqC,mBAAmB,KAAO,CAC9D,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,IAC3CJ,EAAc,CACZ,GAAI,kCACJ,QAAS,QACT,OAAQ,CACN,MAAO,CACL,MAAO,CACL,EAAG,MACL,EACA,MAAOD,EAAO,CACZ,kBAAmB,KAAO,CACxB,wBAAyBE,EAAwB,IACnD,EACF,CAAC,CACH,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQqB,CACV,CAAC,CACH,CACF,EAAE,CACJ,EAEaE,EAA6B,CACxCH,EAA+D,CAAC,IAC7D,CACFZ,EAAuC,mBAAmB,KAAO,CAChE,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,IAC3CT,EAAc,CACZ,GAAI,oCACJ,QAAS,QACT,OAAQ,CACN,MAAO,CACL,MAAO,CACL,EAAG,MACL,EACA,MAAOD,EAAO,CACZ,kBAAmB,KAAO,CACxB,wBAAyBE,EAAwB,IACnD,EACF,CAAC,CACH,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQoB,EACL,OACC,CAACI,EAAQF,IACPE,EAAO,uBAAuB,IAC5B,kBAAmBF,EAASzB,EAAMyB,CAAM,EAAI1B,EAAK0B,CAAM,CACzD,EACF,GAAG,GAAG,CACR,EACC,mBAAmB,IAAMzB,EAAM,CAAC,CAAC,CAAC,CACvC,CAAC,CACH,CACF,EAAE,CACJ",
|
6
|
+
"names": ["Left", "Right", "assign", "createMachine", "UserInteractionRequired", "UnknownDAError", "GetDeviceMetadataDeviceAction", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "InstallOrUpdateAppsDeviceAction", "ListAppsDeviceAction", "OpenAppDeviceAction", "ListInstalledAppsDeviceAction", "setupListAppsMock", "apps", "error", "setupGetDeviceMetadataMock", "metadata", "setupInstallOrUpdateAppsMock", "result", "intermediateValue", "setupOpenAppMock", "setupGoToDashboardMock", "setupGetDeviceStatusMock", "outputs", "outputFn", "output", "setupListInstalledAppsMock", "mockFn"]
|
7
7
|
}
|
package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{Left as p,Right as o}from"purify-ts";import{assign as t,fromPromise as i,setup as l}from"xstate";import{isSuccessCommandResult as c}from"../../../command/model/CommandResult";import{UserInteractionRequired as s}from"../../../device-action/model/UserInteractionRequired";import{UnknownDAError as u}from"../../../device-action/os/Errors";import{OpenAppDeviceAction as k}from"../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{XStateDeviceAction as A}from"../../../device-action/xstate-utils/XStateDeviceAction";class R extends A{makeStateMachine(a){const{callTask:r}=this.extractDependencies(a);return l({types:{input:{},context:{},output:{}},actors:{callTask:i(r),openAppStateMachine:new k({input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames}}).makeStateMachine(a)},guards:{noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:t({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"CallTaskInAppDeviceAction",initial:"
|
1
|
+
import{Left as p,Right as o}from"purify-ts";import{assign as t,fromPromise as i,setup as l}from"xstate";import{isSuccessCommandResult as c}from"../../../command/model/CommandResult";import{UserInteractionRequired as s}from"../../../device-action/model/UserInteractionRequired";import{UnknownDAError as u}from"../../../device-action/os/Errors";import{OpenAppDeviceAction as k}from"../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{XStateDeviceAction as A}from"../../../device-action/xstate-utils/XStateDeviceAction";class R extends A{makeStateMachine(a){const{callTask:r}=this.extractDependencies(a);return l({types:{input:{},context:{},output:{}},actors:{callTask:i(r),openAppStateMachine:new k({input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames}}).makeStateMachine(a)},guards:{skipOpenApp:()=>this.input.skipOpenApp,noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:t({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"CallTaskInAppDeviceAction",initial:"InitialState",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:s.None},_internalState:{taskResponse:null,error:null}}),states:{InitialState:{always:[{target:"CallTask",guard:"skipOpenApp"},"OpenAppDeviceAction"]},OpenAppDeviceAction:{invoke:{id:"openAppStateMachine",input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames},src:"openAppStateMachine",onSnapshot:{actions:t({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{actions:t({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:n=>({...e.context._internalState,error:n})})}),target:"CheckOpenAppDeviceActionResult"}}},CheckOpenAppDeviceActionResult:{always:[{target:"CallTask",guard:"noInternalError"},"Error"]},CallTask:{entry:t({intermediateValue:{requiredUserInteraction:this.input.requiredUserInteraction}}),exit:t({intermediateValue:{requiredUserInteraction:s.None}}),invoke:{id:"callTask",src:"callTask",input:e=>e.context.input.task,onDone:{target:"CallTaskResultCheck",actions:[t({_internalState:({event:e,context:n})=>c(e.output)?{...n._internalState,taskResponse:e.output.data}:{...n._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},CallTaskResultCheck:{always:[{target:"Success",guard:"noInternalError"},"Error"]},Success:{type:"final"},Error:{type:"final"}},output:({context:e})=>e._internalState.taskResponse?o(e._internalState.taskResponse):p(e._internalState.error||new u("No error in final state"))})}extractDependencies(a){return{callTask:r=>r.input(a)}}}export{R as CallTaskInAppDeviceAction};
|
2
2
|
//# sourceMappingURL=CallTaskInAppDeviceAction.js.map
|
package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport {\n type CommandResult,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\n\nimport {\n type CallTaskInAppDAError,\n type CallTaskInAppDAInput,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAInternalState,\n type CallTaskInAppDAOutput,\n} from \"./CallTaskInAppDeviceActionTypes\";\n\n/**\n * Tries to open an app on the device, and if it is successful, calls a task\n * in the app.\n * The output will be the result of the task.\n *\n * ```ts\n * input: {\n * appName: string;\n * task: (internalApi: InternalApi) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n * requiredUserInteraction: UserInteraction;\n * }\n * ```\n *\n * Example of usage:\n *\n * ```ts\n * const deviceAction = new CallTaskInAppDeviceAction({\n * input: {\n * appName: \"MyApp\",\n * task: async (internalApi: InternalApi) => internalApi.sendCommand(new MyAppSpecificCommand()),\n * requiredUserInteraction: UserInteractionRequired.None,\n * },\n * });\n * dmk.executeDeviceAction({ sessionId: \"mySessionId\", deviceAction });\n * ```\n */\nexport class CallTaskInAppDeviceAction<\n TaskResponse,\n TaskErrorCodes,\n UserInteraction extends UserInteractionRequired,\n> extends XStateDeviceAction<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n > {\n type types = StateMachineTypes<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n >;\n\n const { callTask } = this.extractDependencies(internalAPI);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n callTask: fromPromise(callTask),\n openAppStateMachine: new OpenAppDeviceAction({\n input: {\n appName: this.input.appName,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n }).makeStateMachine(internalAPI),\n },\n guards: {\n noInternalError: ({ context }) => context._internalState.error === null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n id: \"CallTaskInAppDeviceAction\",\n initial: \"
|
5
|
-
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAC5B,OAAS,UAAAC,EAAQ,eAAAC,EAAa,SAAAC,MAAa,SAE3C,OAEE,0BAAAC,MACK,mCAEP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,uBAAAC,MAA2B,gEAEpC,OAEE,sBAAAC,MACK,qDAoCA,MAAMC,UAIHD,CAMR,CACA,iBACEE,EAOA,CASA,KAAM,CAAE,SAAAC,CAAS,EAAI,KAAK,oBAAoBD,CAAW,EAEzD,OAAOP,EAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,SAAUD,EAAYS,CAAQ,EAC9B,oBAAqB,IAAIJ,EAAoB,CAC3C,MAAO,CACL,QAAS,KAAK,MAAM,QACpB,mBAAoB,KAAK,MAAM,kBACjC,CACF,CAAC,EAAE,iBAAiBG,CAAW,CACjC,EACA,OAAQ,CACN,gBAAiB,CAAC,CAAE,QAAAE,CAAQ,IAAMA,EAAQ,eAAe,QAAU,IACrE,EACA,QAAS,CACP,qBAAsBX,EAAO,CAC3B,eAAiBY,IAAO,CACtB,GAAGA,EAAE,QAAQ,eACb,MAAOA,EAAE,MAAM,KACjB,EACF,CAAC,CACH,CACF,CAAC,EAAE,cAAc,CACf,GAAI,4BACJ,QAAS,
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport {\n type CommandResult,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\n\nimport {\n type CallTaskInAppDAError,\n type CallTaskInAppDAInput,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAInternalState,\n type CallTaskInAppDAOutput,\n} from \"./CallTaskInAppDeviceActionTypes\";\n\n/**\n * Tries to open an app on the device, and if it is successful, calls a task\n * in the app.\n * The output will be the result of the task.\n *\n * ```ts\n * input: {\n * appName: string;\n * task: (internalApi: InternalApi) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n * requiredUserInteraction: UserInteraction;\n * }\n * ```\n *\n * Example of usage:\n *\n * ```ts\n * const deviceAction = new CallTaskInAppDeviceAction({\n * input: {\n * appName: \"MyApp\",\n * task: async (internalApi: InternalApi) => internalApi.sendCommand(new MyAppSpecificCommand()),\n * requiredUserInteraction: UserInteractionRequired.None,\n * },\n * });\n * dmk.executeDeviceAction({ sessionId: \"mySessionId\", deviceAction });\n * ```\n */\nexport class CallTaskInAppDeviceAction<\n TaskResponse,\n TaskErrorCodes,\n UserInteraction extends UserInteractionRequired,\n> extends XStateDeviceAction<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n > {\n type types = StateMachineTypes<\n CallTaskInAppDAOutput<TaskResponse>,\n CallTaskInAppDAInput<TaskResponse, TaskErrorCodes, UserInteraction>,\n CallTaskInAppDAError<TaskErrorCodes>,\n CallTaskInAppDAIntermediateValue<UserInteraction>,\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n >;\n\n const { callTask } = this.extractDependencies(internalAPI);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n callTask: fromPromise(callTask),\n openAppStateMachine: new OpenAppDeviceAction({\n input: {\n appName: this.input.appName,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n }).makeStateMachine(internalAPI),\n },\n guards: {\n skipOpenApp: () => this.input.skipOpenApp,\n noInternalError: ({ context }) => context._internalState.error === null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n id: \"CallTaskInAppDeviceAction\",\n initial: \"InitialState\",\n context: ({ input }) => {\n return {\n input: input,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n taskResponse: null,\n error: null,\n },\n };\n },\n states: {\n InitialState: {\n always: [\n {\n target: \"CallTask\",\n guard: \"skipOpenApp\",\n },\n \"OpenAppDeviceAction\",\n ],\n },\n OpenAppDeviceAction: {\n invoke: {\n id: \"openAppStateMachine\",\n input: {\n appName: this.input.appName,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n src: \"openAppStateMachine\",\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<\n CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes>\n >({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n target: \"CheckOpenAppDeviceActionResult\",\n },\n },\n },\n CheckOpenAppDeviceActionResult: {\n always: [\n {\n target: \"CallTask\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n CallTask: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: this.input.requiredUserInteraction,\n },\n }),\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n }),\n invoke: {\n id: \"callTask\",\n src: \"callTask\",\n input: (_: { context: types[\"context\"] }) => _.context.input.task,\n onDone: {\n target: \"CallTaskResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n taskResponse: event.output.data,\n };\n }\n return {\n ...context._internalState,\n error: event.output.error,\n };\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n CallTaskResultCheck: {\n always: [\n {\n target: \"Success\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.taskResponse\n ? Right(context._internalState.taskResponse)\n : Left(\n context._internalState.error ||\n new UnknownDAError(\"No error in final state\"),\n ),\n });\n }\n\n extractDependencies(internalApi: InternalApi) {\n return {\n callTask: (_: {\n input: (\n internalApi: InternalApi,\n ) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n }): Promise<CommandResult<TaskResponse, TaskErrorCodes>> =>\n _.input(internalApi),\n };\n }\n}\n"],
|
5
|
+
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAC5B,OAAS,UAAAC,EAAQ,eAAAC,EAAa,SAAAC,MAAa,SAE3C,OAEE,0BAAAC,MACK,mCAEP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,uBAAAC,MAA2B,gEAEpC,OAEE,sBAAAC,MACK,qDAoCA,MAAMC,UAIHD,CAMR,CACA,iBACEE,EAOA,CASA,KAAM,CAAE,SAAAC,CAAS,EAAI,KAAK,oBAAoBD,CAAW,EAEzD,OAAOP,EAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,SAAUD,EAAYS,CAAQ,EAC9B,oBAAqB,IAAIJ,EAAoB,CAC3C,MAAO,CACL,QAAS,KAAK,MAAM,QACpB,mBAAoB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CAAC,EACD,OAAQ,CACN,GAAI,WACJ,IAAK,WACL,MAAQQ,GAAqCA,EAAE,QAAQ,MAAM,KAC7D,OAAQ,CACN,OAAQ,sBACR,QAAS,CACPZ,EAAO,CACL,eAAgB,CAAC,CAAE,MAAAe,EAAO,QAAAJ,CAAQ,IAC5BR,EAAuBY,EAAM,MAAM,EAC9B,CACL,GAAGJ,EAAQ,eACX,aAAcI,EAAM,OAAO,IAC7B,EAEK,CACL,GAAGJ,EAAQ,eACX,MAAOI,EAAM,OAAO,KACtB,CAEJ,CAAC,CACH,CACF,EACA,QAAS,CACP,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,oBAAqB,CACnB,OAAQ,CACN,CACE,OAAQ,UACR,MAAO,iBACT,EACA,OACF,CACF,EACA,QAAS,CACP,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAAQ,CAAC,CAAE,QAAAJ,CAAQ,IACjBA,EAAQ,eAAe,aACnBZ,EAAMY,EAAQ,eAAe,YAAY,EACzCb,EACEa,EAAQ,eAAe,OACrB,IAAIN,EAAe,yBAAyB,CAChD,CACR,CAAC,CACH,CAEA,oBAAoBW,EAA0B,CAC5C,MAAO,CACL,SAAWJ,GAKTA,EAAE,MAAMI,CAAW,CACvB,CACF,CACF",
|
6
6
|
"names": ["Left", "Right", "assign", "fromPromise", "setup", "isSuccessCommandResult", "UserInteractionRequired", "UnknownDAError", "OpenAppDeviceAction", "XStateDeviceAction", "CallTaskInAppDeviceAction", "internalAPI", "callTask", "context", "_", "input", "error", "event", "internalApi"]
|
7
7
|
}
|
package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{Left as D,Right as
|
1
|
+
import{Left as D,Right as w}from"purify-ts";import{assign as I,createMachine as M}from"xstate";import{ApduBuilder as g}from"../../../apdu/utils/ApduBuilder";import{CommandResultFactory as A}from"../../../command/model/CommandResult";import{makeDeviceActionInternalApiMock as m}from"../../../device-action/__test-utils__/makeInternalApi";import{testDeviceActionStates as y}from"../../../device-action/__test-utils__/testDeviceActionStates";import{DeviceActionStatus as n}from"../../../device-action/model/DeviceActionState";import{UserInteractionRequired as e}from"../../../device-action/model/UserInteractionRequired";import{UnknownDAError as C}from"../../../device-action/os/Errors";import{OpenAppDeviceAction as S}from"../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{UnknownDeviceExchangeError as v}from"../../../../../src";import{CallTaskInAppDeviceAction as u}from"./CallTaskInAppDeviceAction";vi.mock("@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction",async a=>{const o=await a();return{...o,OpenAppDeviceAction:vi.fn(()=>({...o.OpenAppDeviceAction,makeStateMachine:vi.fn()}))}});const l=a=>{S.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>M({initial:"pending",states:{pending:{entry:I({intermediateValue:{requiredUserInteraction:e.ConfirmOpenApp}}),after:{0:"done"}},done:{type:"final"}},output:()=>a?D(a):w(void 0)}))}))};describe("CallTaskInAppDeviceAction",()=>{const a=vi.fn(),o=()=>({callTask:a}),{sendCommand:f}=m(),p={paramString:"aParameter",paramNumber:1234},k={aNumber:5678,aString:"mockedResponseString"};beforeEach(()=>{vi.resetAllMocks()}),describe("without mocking extractDependencies",()=>{it("should call sendCommand on internalApi with the correct parameters",async()=>{l(),f.mockResolvedValue(A({data:void 0}));const i=new u({input:{task:async r=>await r.sendCommand(new d(p)),appName:"MyApp",requiredUserInteraction:e.VerifyAddress,skipOpenApp:!1}});await new Promise((r,t)=>{i._execute(m()).observable.subscribe({error:()=>t(),complete:()=>r(),next:()=>{}})}),expect(f).toHaveBeenCalledWith(new d(p))})}),describe("error cases",()=>{it("should error and output the error if the open app fails",()=>new Promise((i,r)=>{l(new C("Mocked error"));const t=[{status:n.Pending,intermediateValue:{requiredUserInteraction:e.None}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.ConfirmOpenApp}},{status:n.Error,error:new C("Mocked error")}];y(new u({input:{task:async s=>await s.sendCommand(new d(p)),appName:"MyApp",requiredUserInteraction:e.VerifyAddress,skipOpenApp:!1}}),t,m(),{onDone:i,onError:r})})),it("should error and output an error if the call task fails",()=>new Promise((i,r)=>{l(),a.mockResolvedValue(A({error:new v("Mocked error")}));const t=new u({input:{task:async c=>await c.sendCommand(new d(p)),appName:"MyApp",requiredUserInteraction:e.VerifyAddress,skipOpenApp:!1}});vi.spyOn(t,"extractDependencies").mockImplementation(o);const s=[{status:n.Pending,intermediateValue:{requiredUserInteraction:e.None}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.ConfirmOpenApp}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.VerifyAddress}},{status:n.Error,error:new v("Mocked error")}];y(t,s,m(),{onDone:i,onError:r})}))}),describe("success cases",()=>{it("should succeed and output the command result if the send command succeeds",()=>new Promise((i,r)=>{l(),a.mockResolvedValue(A({data:k}));const t=new u({input:{task:async c=>await c.sendCommand(new d(p)),appName:"MyApp",requiredUserInteraction:e.VerifyAddress,skipOpenApp:!1}});vi.spyOn(t,"extractDependencies").mockImplementation(o);const s=[{status:n.Pending,intermediateValue:{requiredUserInteraction:e.None}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.ConfirmOpenApp}},{status:n.Pending,intermediateValue:{requiredUserInteraction:e.VerifyAddress}},{status:n.Completed,output:k}];y(t,s,m(),{onDone:i,onError:r})})),it("should succeed while skipping OpenApp",()=>new Promise((i,r)=>{l(),a.mockResolvedValue(A({data:k}));const t=new u({input:{task:async c=>await c.sendCommand(new d(p)),appName:"MyApp",requiredUserInteraction:e.VerifyAddress,skipOpenApp:!0}});vi.spyOn(t,"extractDependencies").mockImplementation(o);const s=[{status:n.Pending,intermediateValue:{requiredUserInteraction:e.VerifyAddress}},{status:n.Completed,output:k}];y(t,s,m(),{onDone:i,onError:r})}))})});class d{params;constructor(o){this.params=o}getApdu(){return new g({cla:0,ins:1,p1:2,p2:3}).add32BitUIntToData(this.params.paramNumber).addAsciiStringToData(this.params.paramString).build()}parseResponse(){return A({data:{aNumber:1,aString:"aString"}})}}
|
2
2
|
//# sourceMappingURL=CallTaskInAppDeviceAction.test.js.map
|