@ledgerhq/device-management-kit 0.0.0-rn-ble-logs-20250416162013 → 0.0.0-rn-hid-sync-onboarding-behavior-20250516135345
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/lib/cjs/package.json +22 -23
- package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.test.js.map +2 -2
- package/lib/cjs/src/api/DeviceManagementKitBuilder.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKitBuilder.js.map +2 -2
- package/lib/cjs/src/api/DmkConfig.js +1 -1
- package/lib/cjs/src/api/DmkConfig.js.map +1 -1
- package/lib/cjs/src/api/command/di/commandModule.js +1 -1
- package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
- package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
- package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
- package/lib/cjs/src/api/command/os/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/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/di/deviceActionModule.js +1 -1
- package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
- package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
- package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
- package/lib/cjs/src/api/device-action/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/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/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/DeviceConnectionStateMachine.js +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
- 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/config/di/configModule.js +1 -1
- package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
- package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
- package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/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/di/deviceSessionModule.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/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 +2 -2
- 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/discovery/di/discoveryModule.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
- package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
- package/lib/cjs/src/internal/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/StopDiscoveringUseCase.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/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/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 +1 -1
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +1 -1
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
- package/lib/cjs/src/internal/secure-channel/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/di/sendModule.js +1 -1
- package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
- package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
- package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
- package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
- package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/esm/package.json +22 -23
- package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
- package/lib/esm/src/api/DeviceManagementKit.test.js.map +2 -2
- package/lib/esm/src/api/DeviceManagementKitBuilder.js +1 -1
- package/lib/esm/src/api/DeviceManagementKitBuilder.js.map +3 -3
- package/lib/esm/src/api/command/di/commandModule.js +1 -1
- package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
- package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
- package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
- package/lib/esm/src/api/command/os/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/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/di/deviceActionModule.js +1 -1
- package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
- package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
- package/lib/esm/src/api/device-action/di/deviceActionModule.test.js.map +2 -2
- package/lib/esm/src/api/device-action/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/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/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/DeviceConnectionStateMachine.js +1 -1
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
- 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/config/di/configModule.js +1 -1
- package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
- package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
- package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
- package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
- package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
- package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/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/di/deviceSessionModule.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/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 +2 -2
- 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/discovery/di/discoveryModule.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
- package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
- package/lib/esm/src/internal/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/StopDiscoveringUseCase.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.js.map +3 -3
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
- package/lib/esm/src/internal/manager-api/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/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 +1 -1
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.js.map +3 -3
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js +1 -1
- package/lib/esm/src/internal/manager-api/use-case/SetProviderUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +1 -1
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
- package/lib/esm/src/internal/secure-channel/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/di/sendModule.js +1 -1
- package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
- package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
- package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
- package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
- package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/types/src/api/DeviceManagementKit.d.ts +1 -1
- package/lib/types/src/api/DeviceManagementKitBuilder.d.ts.map +1 -1
- package/lib/types/src/api/DmkConfig.d.ts +1 -0
- package/lib/types/src/api/DmkConfig.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
- package/lib/types/src/api/command/di/commandModule.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/CommandErrors.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/di/deviceActionModule.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/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
- package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
- package/lib/types/src/api/index.d.ts +5 -1
- package/lib/types/src/api/index.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/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Errors.d.ts +7 -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 +4 -1
- package/lib/types/src/api/types.d.ts.map +1 -1
- package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
- package/lib/types/src/di.d.ts.map +1 -1
- package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/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/di/deviceSessionModule.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 +2 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.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/utils/deviceSessionUtils.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
- package/lib/types/src/internal/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/logger-publisher/di/loggerModule.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/data/AxiosManagerApiDataSource.d.ts +20 -4
- 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 +41 -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 +5 -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/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 +1 -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 -0
- package/lib/types/src/internal/manager-api/model/Params.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts +7 -1
- package/lib/types/src/internal/manager-api/service/DefaultManagerApiService.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/service/ManagerApiService.d.ts +39 -1
- 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 +3 -1
- package/lib/types/src/internal/manager-api/use-case/SetProviderUseCase.d.ts.map +1 -1
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
- package/lib/types/src/internal/secure-channel/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/di/sendModule.d.ts.map +1 -1
- package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +14 -15
@@ -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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA8B,mCAEvB,MAAMF,EAAyC,CACpDG,EAA+B,gBAAc,QAC7CC,EAAuC,CAAC,KAEvC,CACC,CAAC,gBAAc,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA8B,mCAEvB,MAAMF,EAAyC,CACpDG,EAA+B,gBAAc,QAC7CC,EAAuC,CAAC,KAEvC,CACC,CAAC,gBAAc,OAAO,EAAG,CACvB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,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,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,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,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,EACA,GAAGA,CACL,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,EACR,aAAc,EACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,EACpB,CACF,EACA,CAAC,gBAAc,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,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,GAAGA,CACL,EACA,CAAC,gBAAc,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,GAAGA,CACL,CACF,GAAGD,CAAa",
|
6
6
|
"names": ["GetOsVersionCommand_exports", "__export", "getOsVersionCommandResponseMockBuilder", "__toCommonJS", "import_DeviceModel", "deviceModelId", "props"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var a=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var y=(o,e)=>{for(var r in e)a(o,r,{get:e[r],enumerable:!0})},C=(o,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!u.call(o,s)&&s!==r&&a(o,s,{get:()=>e[s],enumerable:!(i=S(e,s))||i.enumerable});return o};var h=o=>C(a({},"__esModule",{value:!0}),o),d=(o,e,r,i)=>{for(var s=i>1?void 0:i?S(e,r):e,t=o.length-1,g;t>=0;t--)(g=o[t])&&(s=(i?g(e,r,s):g(s))||s);return i&&s&&a(e,r,s),s},m=(o,e)=>(r,i)=>e(r,i,o);var f={};y(f,{SendCommandUseCase:()=>n});module.exports=h(f);var c=require("inversify"),v=require("../../../internal/device-session/di/deviceSessionTypes"),p=require("../../../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:i}){return this._sessionService.getDeviceSessionById(e).caseOf({Right:async t=>await t.sendCommand(r,i),Left:t=>{throw this._logger.error("Error getting session",{data:{error:t}}),t}})}};n=d([(0,c.injectable)(),m(0,(0,c.inject)(v.deviceSessionTypes.DeviceSessionService)),m(1,(0,c.inject)(p.loggerTypes.LoggerPublisherServiceFactory))],n);0&&(module.exports={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": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAAmC,0DAEnCC,EAA4B,
|
6
|
-
"names": ["SendCommandUseCase_exports", "__export", "SendCommandUseCase", "__toCommonJS", "import_inversify", "import_deviceSessionTypes", "import_loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "deviceSession", "error", "__decorateClass", "__decorateParam"]
|
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": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAKnCC,EAAmC,0DAEnCC,EAA4B,qDAqBrB,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,IADN,cAAW,EAKPC,EAAA,eAAO,qBAAmB,oBAAoB,GAE9CA,EAAA,eAAO,cAAY,6BAA6B,IANxCT",
|
6
|
+
"names": ["SendCommandUseCase_exports", "__export", "SendCommandUseCase", "__toCommonJS", "import_inversify", "import_deviceSessionTypes", "import_loggerTypes", "SendCommandUseCase", "sessionService", "loggerFactory", "sessionId", "command", "abortTimeout", "deviceSession", "error", "__decorateClass", "__decorateParam"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var m=(r,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of s(e))!p.call(r,t)&&t!==n&&i(r,t,{get:()=>e[t],enumerable:!(o=a(e,t))||o.enumerable});return r};var c=r=>m(i({},"__esModule",{value:!0}),r);var d={};module.exports=c(d);
|
2
2
|
//# sourceMappingURL=DeviceAction.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../src/api/device-action/DeviceAction.ts"],
|
4
|
-
"sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { type DmkError } from \"@api/Error\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { type DeviceActionState } from \"./model/DeviceActionState\";\n\nexport type InternalApi = {\n readonly sendApdu: (\n apdu: Uint8Array,\n ) => Promise<Either<DmkError, ApduResponse>>;\n readonly sendCommand: <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n ) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly getDeviceSessionStateObservable: () => Observable<DeviceSessionState>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly disableRefresher: (blockerId: string) => () => void;\n readonly getManagerApiService: () => ManagerApiService;\n readonly getSecureChannelService: () => SecureChannelService;\n};\n\nexport type DeviceActionIntermediateValue = {\n readonly requiredUserInteraction: string;\n};\n\nexport type ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> = {\n readonly observable: Observable<\n DeviceActionState<Output, Error, IntermediateValue>\n >;\n cancel(): void;\n};\n\nexport interface DeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n> {\n readonly input: Input;\n\n _execute(\n params: InternalApi,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue>;\n}\n"],
|
4
|
+
"sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { type Observable } from \"rxjs\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { type DmkError } from \"@api/Error\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { type DeviceActionState } from \"./model/DeviceActionState\";\n\nexport type InternalApi = {\n readonly sendApdu: (\n apdu: Uint8Array,\n ) => Promise<Either<DmkError, ApduResponse>>;\n readonly sendCommand: <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n readonly getDeviceModel: () => TransportDeviceModel;\n readonly getDeviceSessionState: () => DeviceSessionState;\n readonly getDeviceSessionStateObservable: () => Observable<DeviceSessionState>;\n readonly setDeviceSessionState: (\n state: DeviceSessionState,\n ) => DeviceSessionState;\n readonly disableRefresher: (blockerId: string) => () => void;\n readonly getManagerApiService: () => ManagerApiService;\n readonly getSecureChannelService: () => SecureChannelService;\n};\n\nexport type DeviceActionIntermediateValue = {\n readonly requiredUserInteraction: string;\n};\n\nexport type ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> = {\n readonly observable: Observable<\n DeviceActionState<Output, Error, IntermediateValue>\n >;\n cancel(): void;\n};\n\nexport interface DeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n> {\n readonly input: Input;\n\n _execute(\n params: InternalApi,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue>;\n}\n"],
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
6
6
|
"names": ["DeviceAction_exports", "__toCommonJS"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var c=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var v=(n,e)=>{for(var i in e)c(n,i,{get:e[i],enumerable:!0})},S=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!r.call(n,t)&&t!==i&&c(n,t,{get:()=>e[t],enumerable:!(o=s(e,t))||o.enumerable});return n};var
|
1
|
+
"use strict";var c=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var v=(n,e)=>{for(var i in e)c(n,i,{get:e[i],enumerable:!0})},S=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!r.call(n,t)&&t!==i&&c(n,t,{get:()=>e[t],enumerable:!(o=s(e,t))||o.enumerable});return n};var M=n=>S(c({},"__esModule",{value:!0}),n);var u={};v(u,{makeDeviceActionInternalApiMock:()=>b});module.exports=M(u);const p=vi.fn(),d=vi.fn(),f=vi.fn(),k=vi.fn(),l=vi.fn(),g=vi.fn(),m=vi.fn(),D=vi.fn(),A=vi.fn();function b(){return{sendApdu:p,sendCommand:d,getDeviceModel:f,getDeviceSessionState:k,getDeviceSessionStateObservable:l,setDeviceSessionState:g,getManagerApiService:m,getSecureChannelService:D,disableRefresher:A}}0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,IAAA,eAAAC,EAAAH,GAIA,MAAMI,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,
|
6
|
-
"names": ["makeInternalApi_exports", "__export", "makeDeviceActionInternalApiMock", "__toCommonJS", "sendApduMock", "sendCommandMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "getSecureChannelServiceMock", "disableRefresherMock"]
|
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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,IAAA,eAAAC,EAAAH,GAIA,MAAMI,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,SAASV,GAAuD,CACrE,MAAO,CACL,SAAUE,EACV,YAAaC,EACb,eAAgBC,EAChB,sBAAuBC,EACvB,gCAAiCC,EACjC,sBAAuBC,EACvB,qBAAsBC,EACtB,wBAAyBC,EACzB,iBAAkBC,CACpB,CACF",
|
6
|
+
"names": ["makeInternalApi_exports", "__export", "makeDeviceActionInternalApiMock", "__toCommonJS", "sendApduMock", "sendCommandMock", "apiGetDeviceModelMock", "apiGetDeviceSessionStateMock", "apiGetDeviceSessionStateObservableMock", "setDeviceSessionStateMock", "getManagerApiServiceMock", "getSecureChannelServiceMock", "disableRefresherMock"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var M=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},v=(e,t,o,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of I(t))!D.call(e,p)&&p!==o&&c(e,p,{get:()=>t[p],enumerable:!(m=y(t,p))||m.enumerable});return e};var O=e=>v(c({},"__esModule",{value:!0}),e);var w={};M(w,{setupGetDeviceMetadataMock:()=>h,setupGetDeviceStatusMock:()=>L,setupGoToDashboardMock:()=>V,setupInstallOrUpdateAppsMock:()=>G,setupListAppsMock:()=>U,setupListInstalledAppsMock:()=>q,setupOpenAppMock:()=>S});module.exports=O(w);var n=require("purify-ts"),a=require("xstate"),i=require("../../device-action/model/UserInteractionRequired"),r=require("../../device-action/os/Errors"),s=require("../../device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),d=require("../../device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),l=require("../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),u=require("../../device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),f=require("../../device-action/os/ListApps/ListAppsDeviceAction"),A=require("../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),k=require("../../secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction");const U=(e,t=!1)=>{f.ListAppsDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockListAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.AllowListApps})})},done:{type:"final"}},output:()=>t?(0,n.Left)(new r.UnknownDAError("ListApps failed")):(0,n.Right)(e)}))}))},h=(e,t=!1)=>{s.GetDeviceMetadataDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockGetDeviceMetadataDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.None})})},done:{type:"final"}},output:()=>t?(0,n.Left)(new r.UnknownDAError("GetDeviceMetadata failed")):(0,n.Right)(e)}))}))},G=(e,t,o=!1)=>{u.InstallOrUpdateAppsDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockInstallOrUpdateAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>t})},done:{type:"final"}},output:()=>o?(0,n.Left)(new r.UnknownDAError("InstallOrUpdateApps failed")):(0,n.Right)(e)}))}))},S=(e=!1)=>{A.OpenAppDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({initial:"ready",states:{ready:{entry:(0,a.assign)({intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.ConfirmOpenApp}}),after:{0:"done"}},done:{type:"final"}},output:()=>e?(0,n.Left)(new r.UnknownDAError("OpenApp failed")):(0,n.Right)(void 0)}))}))},V=(e=!1)=>{l.GoToDashboardDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockGoToDashboardDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.None})})},done:{type:"final"}},output:()=>e?(0,n.Left)(new r.UnknownDAError("GoToDashboard failed")):(0,n.Right)(void 0)}))}))},L=(e=[{currentApp:"BOLOS",currentAppVersion:"1.0.0"}])=>{const t=vi.fn();for(const o of e)t.mockImplementationOnce(()=>"currentApp"in o?(0,n.Right)(o):(0,n.Left)(o));d.GetDeviceStatusDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockGetDeviceStatusDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.None})})},done:{type:"final"}},output:t}))}))},q=(e=[])=>{k.ListInstalledAppsDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,a.createMachine)({id:"MockListInstalledAppsDeviceAction",initial:"ready",states:{ready:{after:{0:"done"},entry:(0,a.assign)({intermediateValue:()=>({requiredUserInteraction:i.UserInteractionRequired.None})})},done:{type:"final"}},output:e.reduce((t,o)=>t.mockImplementationOnce(()=>"installedApps"in o?(0,n.Right)(o):(0,n.Left)(o)),vi.fn()).mockImplementation(()=>(0,n.Right)([]))}))}))};0&&(module.exports={setupGetDeviceMetadataMock,setupGetDeviceStatusMock,setupGoToDashboardMock,setupInstallOrUpdateAppsMock,setupListAppsMock,setupListInstalledAppsMock,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,
|
6
|
-
"names": ["setupTestMachine_exports", "__export", "setupGetDeviceStatusMock", "setupGoToDashboardMock", "setupListAppsMock", "setupListInstalledAppsMock", "__toCommonJS", "import_purify_ts", "import_xstate", "import_UserInteractionRequired", "import_Errors", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_ListAppsDeviceAction", "import_ListInstalledAppsDeviceAction", "apps", "error", "outputs", "outputFn", "output", "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": "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",
|
6
|
+
"names": ["setupTestMachine_exports", "__export", "setupGetDeviceMetadataMock", "setupGetDeviceStatusMock", "setupGoToDashboardMock", "setupInstallOrUpdateAppsMock", "setupListAppsMock", "setupListInstalledAppsMock", "setupOpenAppMock", "__toCommonJS", "import_purify_ts", "import_xstate", "import_UserInteractionRequired", "import_Errors", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_OpenAppDeviceAction", "import_ListInstalledAppsDeviceAction", "apps", "error", "metadata", "result", "intermediateValue", "outputs", "outputFn", "output", "mockFn"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var
|
1
|
+
"use strict";var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var d=(o,e)=>{for(var t in e)c(o,t,{get:e[t],enumerable:!0})},p=(o,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!m.call(o,i)&&i!==t&&c(o,i,{get:()=>e[i],enumerable:!(s=A(e,i))||s.enumerable});return o};var v=o=>p(c({},"__esModule",{value:!0}),o);var C={};d(C,{deviceActionModuleFactory:()=>f});module.exports=v(C);var n=require("inversify"),a=require("../../device-action/use-case/ExecuteDeviceActionUseCase"),u=require("../../../../src/di.stub"),r=require("./deviceActionTypes");const f=({stub:o=!1}={})=>new n.ContainerModule(({bind:e,rebindSync:t})=>{e(r.deviceActionTypes.ExecuteDeviceActionUseCase).to(a.ExecuteDeviceActionUseCase),o&&t(r.deviceActionTypes.ExecuteDeviceActionUseCase).to(u.StubUseCase)});0&&(module.exports={deviceActionModuleFactory});
|
2
2
|
//# sourceMappingURL=deviceActionModule.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/di/deviceActionModule.ts"],
|
4
|
-
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { ExecuteDeviceActionUseCase } from \"@api/device-action/use-case/ExecuteDeviceActionUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { deviceActionTypes } from \"./deviceActionTypes\";\n\ntype DeviceActionModuleArgs = Partial<{\n readonly stub: boolean;\n}>;\n\nexport const deviceActionModuleFactory = ({\n stub = false,\n}: DeviceActionModuleArgs = {}) =>\n new ContainerModule(
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA2C,kEAC3CC,EAA4B,6BAE5BC,EAAkC,+BAM3B,MAAML,EAA4B,CAAC,CACxC,KAAAM,EAAO,EACT,EAA4B,CAAC,IAC3B,IAAI,
|
6
|
-
"names": ["deviceActionModule_exports", "__export", "deviceActionModuleFactory", "__toCommonJS", "import_inversify", "import_ExecuteDeviceActionUseCase", "import_di", "import_deviceActionTypes", "stub", "bind", "
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { ExecuteDeviceActionUseCase } from \"@api/device-action/use-case/ExecuteDeviceActionUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { deviceActionTypes } from \"./deviceActionTypes\";\n\ntype DeviceActionModuleArgs = Partial<{\n readonly stub: boolean;\n}>;\n\nexport const deviceActionModuleFactory = ({\n stub = false,\n}: DeviceActionModuleArgs = {}) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind(deviceActionTypes.ExecuteDeviceActionUseCase).to(\n ExecuteDeviceActionUseCase,\n );\n if (stub) {\n rebindSync(deviceActionTypes.ExecuteDeviceActionUseCase).to(StubUseCase);\n }\n });\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA2C,kEAC3CC,EAA4B,6BAE5BC,EAAkC,+BAM3B,MAAML,EAA4B,CAAC,CACxC,KAAAM,EAAO,EACT,EAA4B,CAAC,IAC3B,IAAI,kBAAgB,CAAC,CAAE,KAAAC,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EAAK,oBAAkB,0BAA0B,EAAE,GACjD,4BACF,EACID,GACFE,EAAW,oBAAkB,0BAA0B,EAAE,GAAG,aAAW,CAE3E,CAAC",
|
6
|
+
"names": ["deviceActionModule_exports", "__export", "deviceActionModuleFactory", "__toCommonJS", "import_inversify", "import_ExecuteDeviceActionUseCase", "import_di", "import_deviceActionTypes", "stub", "bind", "rebindSync"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var c=require("inversify"),r=require("../../device-action/use-case/ExecuteDeviceActionUseCase"),s=require("../../../internal/device-session/di/deviceSessionModule"),u=require("../../../internal/logger-publisher/di/loggerModule"),d=require("../../../../src/di.stub"),i=require("./deviceActionModule"),n=require("./deviceActionTypes");describe("deviceActionModule",()=>{describe("Default",()=>{let e,t;beforeEach(()=>{t=(0,i.deviceActionModuleFactory)(),e=new c.Container,e.
|
1
|
+
"use strict";var c=require("inversify"),r=require("../../device-action/use-case/ExecuteDeviceActionUseCase"),s=require("../../../internal/device-session/di/deviceSessionModule"),u=require("../../../internal/logger-publisher/di/loggerModule"),d=require("../../../../src/di.stub"),i=require("./deviceActionModule"),n=require("./deviceActionTypes");describe("deviceActionModule",()=>{describe("Default",()=>{let e,t;beforeEach(()=>{t=(0,i.deviceActionModuleFactory)(),e=new c.Container,e.loadSync(t,(0,s.deviceSessionModuleFactory)(),(0,u.loggerModuleFactory)())}),it("should return the config module",()=>{expect(t).toBeDefined()}),it("should return non-stubbed executeDeviceAction usecase",()=>{const o=e.get(n.deviceActionTypes.ExecuteDeviceActionUseCase);expect(o).toBeInstanceOf(r.ExecuteDeviceActionUseCase)})}),describe("Stubbed",()=>{let e,t;beforeEach(()=>{t=(0,i.deviceActionModuleFactory)({stub:!0}),e=new c.Container,e.loadSync(t)}),it("should return the config module",()=>{expect(t).toBeDefined()}),it("should return stubbed executeDeviceAction usecase",()=>{const o=e.get(n.deviceActionTypes.ExecuteDeviceActionUseCase);expect(o).toBeInstanceOf(d.StubUseCase)})})});
|
2
2
|
//# sourceMappingURL=deviceActionModule.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/di/deviceActionModule.test.ts"],
|
4
|
-
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { ExecuteDeviceActionUseCase } from \"@api/device-action/use-case/ExecuteDeviceActionUseCase\";\nimport { deviceSessionModuleFactory } from \"@internal/device-session/di/deviceSessionModule\";\nimport { loggerModuleFactory } from \"@internal/logger-publisher/di/loggerModule\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { deviceActionModuleFactory } from \"./deviceActionModule\";\nimport { deviceActionTypes } from \"./deviceActionTypes\";\n\ndescribe(\"deviceActionModule\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceActionModuleFactory>;\n beforeEach(() => {\n mod = deviceActionModuleFactory();\n container = new Container();\n container.
|
5
|
-
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA2C,kEAC3CC,EAA2C,2DAC3CC,EAAoC,sDACpCC,EAA4B,6BAE5BC,EAA0C,gCAC1CC,EAAkC,+BAElC,SAAS,qBAAsB,IAAM,CACnC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,6BAA0B,EAChCD,EAAY,IAAI,YAChBA,EAAU,
|
4
|
+
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { ExecuteDeviceActionUseCase } from \"@api/device-action/use-case/ExecuteDeviceActionUseCase\";\nimport { deviceSessionModuleFactory } from \"@internal/device-session/di/deviceSessionModule\";\nimport { loggerModuleFactory } from \"@internal/logger-publisher/di/loggerModule\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { deviceActionModuleFactory } from \"./deviceActionModule\";\nimport { deviceActionTypes } from \"./deviceActionTypes\";\n\ndescribe(\"deviceActionModule\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceActionModuleFactory>;\n beforeEach(() => {\n mod = deviceActionModuleFactory();\n container = new Container();\n container.loadSync(\n mod,\n deviceSessionModuleFactory(),\n loggerModuleFactory(),\n );\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return non-stubbed executeDeviceAction usecase\", () => {\n const executeDeviceActionUseCase =\n container.get<ExecuteDeviceActionUseCase>(\n deviceActionTypes.ExecuteDeviceActionUseCase,\n );\n expect(executeDeviceActionUseCase).toBeInstanceOf(\n ExecuteDeviceActionUseCase,\n );\n });\n });\n\n describe(\"Stubbed\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceActionModuleFactory>;\n beforeEach(() => {\n mod = deviceActionModuleFactory({ stub: true });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return stubbed executeDeviceAction usecase\", () => {\n const executeDeviceActionUseCase = container.get(\n deviceActionTypes.ExecuteDeviceActionUseCase,\n );\n expect(executeDeviceActionUseCase).toBeInstanceOf(StubUseCase);\n });\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA2C,kEAC3CC,EAA2C,2DAC3CC,EAAoC,sDACpCC,EAA4B,6BAE5BC,EAA0C,gCAC1CC,EAAkC,+BAElC,SAAS,qBAAsB,IAAM,CACnC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,6BAA0B,EAChCD,EAAY,IAAI,YAChBA,EAAU,SACRC,KACA,8BAA2B,KAC3B,uBAAoB,CACtB,CACF,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,wDAAyD,IAAM,CAChE,MAAMC,EACJF,EAAU,IACR,oBAAkB,0BACpB,EACF,OAAOE,CAA0B,EAAE,eACjC,4BACF,CACF,CAAC,CACH,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,IAAIF,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,6BAA0B,CAAE,KAAM,EAAK,CAAC,EAC9CD,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,oDAAqD,IAAM,CAC5D,MAAMC,EAA6BF,EAAU,IAC3C,oBAAkB,0BACpB,EACA,OAAOE,CAA0B,EAAE,eAAe,aAAW,CAC/D,CAAC,CACH,CAAC,CACH,CAAC",
|
6
6
|
"names": ["import_inversify", "import_ExecuteDeviceActionUseCase", "import_deviceSessionModule", "import_loggerModule", "import_di", "import_deviceActionModule", "import_deviceActionTypes", "container", "mod", "executeDeviceActionUseCase"]
|
7
7
|
}
|
package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var o=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var I=(r,t)=>{for(var s in t)o(r,s,{get:t[s],enumerable:!0})},C=(r,t,s,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T(t))!m.call(r,n)&&n!==s&&o(r,n,{get:()=>t[n],enumerable:!(e=A(t,n))||e.enumerable});return r};var d=r=>C(o({},"__esModule",{value:!0}),r);var S={};I(S,{CallTaskInAppDeviceAction:()=>D});module.exports=d(S);var p=require("purify-ts"),a=require("xstate"),l=require("../../../command/model/CommandResult"),i=require("../../../device-action/model/UserInteractionRequired"),c=require("../../../device-action/os/Errors"),u=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),k=require("../../../device-action/xstate-utils/XStateDeviceAction");class D extends k.XStateDeviceAction{makeStateMachine(t){const{callTask:s}=this.extractDependencies(t);return(0,a.setup)({types:{input:{},context:{},output:{}},actors:{callTask:(0,a.fromPromise)(s),openAppStateMachine:new u.OpenAppDeviceAction({input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames}}).makeStateMachine(t)},guards:{noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"CallTaskInAppDeviceAction",initial:"
|
1
|
+
"use strict";var o=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var I=(r,t)=>{for(var s in t)o(r,s,{get:t[s],enumerable:!0})},C=(r,t,s,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T(t))!m.call(r,n)&&n!==s&&o(r,n,{get:()=>t[n],enumerable:!(e=A(t,n))||e.enumerable});return r};var d=r=>C(o({},"__esModule",{value:!0}),r);var S={};I(S,{CallTaskInAppDeviceAction:()=>D});module.exports=d(S);var p=require("purify-ts"),a=require("xstate"),l=require("../../../command/model/CommandResult"),i=require("../../../device-action/model/UserInteractionRequired"),c=require("../../../device-action/os/Errors"),u=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),k=require("../../../device-action/xstate-utils/XStateDeviceAction");class D extends k.XStateDeviceAction{makeStateMachine(t){const{callTask:s}=this.extractDependencies(t);return(0,a.setup)({types:{input:{},context:{},output:{}},actors:{callTask:(0,a.fromPromise)(s),openAppStateMachine:new u.OpenAppDeviceAction({input:{appName:this.input.appName,compatibleAppNames:this.input.compatibleAppNames}}).makeStateMachine(t)},guards:{skipOpenApp:()=>this.input.skipOpenApp,noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:(0,a.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"CallTaskInAppDeviceAction",initial:"InitialState",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.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:(0,a.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{actions:(0,a.assign)({_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:(0,a.assign)({intermediateValue:{requiredUserInteraction:this.input.requiredUserInteraction}}),exit:(0,a.assign)({intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.None}}),invoke:{id:"callTask",src:"callTask",input:e=>e.context.input.task,onDone:{target:"CallTaskResultCheck",actions:[(0,a.assign)({_internalState:({event:e,context:n})=>(0,l.isSuccessCommandResult)(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?(0,p.Right)(e._internalState.taskResponse):(0,p.Left)(e._internalState.error||new c.UnknownDAError("No error in final state"))})}extractDependencies(t){return{callTask:s=>s.input(t)}}}0&&(module.exports={CallTaskInAppDeviceAction});
|
2
2
|
//# sourceMappingURL=CallTaskInAppDeviceAction.js.map
|
package/lib/cjs/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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2C,kBAE3CC,EAGO,4CAEPC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAoC,yEAEpCC,EAGO,8DAoCA,MAAMR,UAIH,oBAMR,CACA,iBACES,EAOA,CASA,KAAM,CAAE,SAAAC,CAAS,EAAI,KAAK,oBAAoBD,CAAW,EAEzD,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,YAAU,eAAYC,CAAQ,EAC9B,oBAAqB,IAAI,sBAAoB,CAC3C,MAAO,CACL,QAAS,KAAK,MAAM,QACpB,mBAAoB,KAAK,MAAM,kBACjC,CACF,CAAC,EAAE,iBAAiBD,CAAW,CACjC,EACA,OAAQ,CACN,gBAAiB,CAAC,CAAE,QAAAE,CAAQ,IAAMA,EAAQ,eAAe,QAAU,IACrE,EACA,QAAS,CACP,wBAAsB,UAAO,CAC3B,eAAiBC,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": "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",
|
6
6
|
"names": ["CallTaskInAppDeviceAction_exports", "__export", "CallTaskInAppDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_UserInteractionRequired", "import_Errors", "import_OpenAppDeviceAction", "import_XStateDeviceAction", "internalAPI", "callTask", "context", "_", "input", "error", "event", "internalApi"]
|
7
7
|
}
|
package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var f=require("purify-ts"),C=require("xstate"),I=require("../../../apdu/utils/ApduBuilder"),u=require("../../../command/model/CommandResult"),p=require("../../../device-action/__test-utils__/makeInternalApi"),k=require("../../../device-action/__test-utils__/testDeviceActionStates"),n=require("../../../device-action/model/DeviceActionState"),e=require("../../../device-action/model/UserInteractionRequired"),v=require("../../../device-action/os/Errors"),M=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),D=require("../../../../../src"),c=require("./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 A=a=>{M.OpenAppDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,C.createMachine)({initial:"pending",states:{pending:{entry:(0,C.assign)({intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp}}),after:{0:"done"}},done:{type:"final"}},output:()=>a?(0,f.Left)(a):(0,f.Right)(void 0)}))}))};describe("CallTaskInAppDeviceAction",()=>{const a=vi.fn(),o=()=>({callTask:a}),{sendCommand:w}=(0,p.makeDeviceActionInternalApiMock)(),m={paramString:"aParameter",paramNumber:1234},y={aNumber:5678,aString:"mockedResponseString"};beforeEach(()=>{vi.resetAllMocks()}),describe("without mocking extractDependencies",()=>{it("should call sendCommand on internalApi with the correct parameters",async()=>{A(),w.mockResolvedValue((0,u.CommandResultFactory)({data:void 0}));const i=new c.CallTaskInAppDeviceAction({input:{task:async r=>await r.sendCommand(new d(m)),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}});await new Promise((r,t)=>{i._execute((0,p.makeDeviceActionInternalApiMock)()).observable.subscribe({error:()=>t(),complete:()=>r(),next:()=>{}})}),expect(w).toHaveBeenCalledWith(new d(m))})}),describe("error cases",()=>{it("should error and output the error if the open app fails",()=>new Promise((i,r)=>{A(new v.UnknownDAError("Mocked error"));const t=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.None}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp}},{status:n.DeviceActionStatus.Error,error:new v.UnknownDAError("Mocked error")}];(0,k.testDeviceActionStates)(new c.CallTaskInAppDeviceAction({input:{task:async s=>await s.sendCommand(new d(m)),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}}),t,(0,p.makeDeviceActionInternalApiMock)(),{onDone:i,onError:r})})),it("should error and output an error if the call task fails",()=>new Promise((i,r)=>{A(),a.mockResolvedValue((0,u.CommandResultFactory)({error:new D.UnknownDeviceExchangeError("Mocked error")}));const t=new c.CallTaskInAppDeviceAction({input:{task:async l=>await l.sendCommand(new d(m)),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}});vi.spyOn(t,"extractDependencies").mockImplementation(o);const s=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.None}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.VerifyAddress}},{status:n.DeviceActionStatus.Error,error:new D.UnknownDeviceExchangeError("Mocked error")}];(0,k.testDeviceActionStates)(t,s,(0,p.makeDeviceActionInternalApiMock)(),{onDone:i,onError:r})}))}),describe("success cases",()=>{it("should succeed and output the command result if the send command succeeds",()=>new Promise((i,r)=>{A(),a.mockResolvedValue((0,u.CommandResultFactory)({data:y}));const t=new c.CallTaskInAppDeviceAction({input:{task:async l=>await l.sendCommand(new d(m)),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}});vi.spyOn(t,"extractDependencies").mockImplementation(o);const s=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.None}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.VerifyAddress}},{status:n.DeviceActionStatus.Completed,output:y}];(0,k.testDeviceActionStates)(t,s,(0,p.makeDeviceActionInternalApiMock)(),{onDone:i,onError:r})})),it("should succeed while skipping OpenApp",()=>new Promise((i,r)=>{A(),a.mockResolvedValue((0,u.CommandResultFactory)({data:y}));const t=new c.CallTaskInAppDeviceAction({input:{task:async l=>await l.sendCommand(new d(m)),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!0}});vi.spyOn(t,"extractDependencies").mockImplementation(o);const s=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.VerifyAddress}},{status:n.DeviceActionStatus.Completed,output:y}];(0,k.testDeviceActionStates)(t,s,(0,p.makeDeviceActionInternalApiMock)(),{onDone:i,onError:r})}))})});class d{params;constructor(o){this.params=o}getApdu(){return new I.ApduBuilder({cla:0,ins:1,p1:2,p2:3}).add32BitUIntToData(this.params.paramNumber).addAsciiStringToData(this.params.paramString).build()}parseResponse(){return(0,u.CommandResultFactory)({data:{aNumber:1,aString:"aString"}})}}
|
2
2
|
//# sourceMappingURL=CallTaskInAppDeviceAction.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.ts"],
|
4
|
-
"sourcesContent": ["/* eslint @typescript-eslint/consistent-type-imports:0 */\nimport { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type Command } from \"@api/types\";\nimport { UnknownDeviceExchangeError } from \"@root/src\";\n\nimport { CallTaskInAppDeviceAction } from \"./CallTaskInAppDeviceAction\";\nimport {\n type CallTaskInAppDAError,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAOutput,\n} from \"./CallTaskInAppDeviceActionTypes\";\n\nvi.mock(\n \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\",\n async (importOriginal) => {\n const original =\n await importOriginal<\n typeof import(\"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\")\n >();\n return {\n ...original,\n OpenAppDeviceAction: vi.fn(() => ({\n ...original.OpenAppDeviceAction,\n makeStateMachine: vi.fn(),\n })),\n };\n },\n);\n\nconst setupOpenAppDAMock = (error?: unknown) => {\n (OpenAppDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n initial: \"pending\",\n states: {\n pending: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n }),\n after: {\n 0: \"done\",\n },\n },\n done: {\n type: \"final\",\n },\n },\n output: () => (error ? Left(error) : Right(undefined)),\n }),\n ),\n }));\n};\n\ndescribe(\"CallTaskInAppDeviceAction\", () => {\n const callMyTask = vi.fn();\n\n const extractDependenciesMock = () => ({\n callTask: callMyTask,\n });\n\n const { sendCommand: apiSendCommandMock } = makeDeviceActionInternalApiMock();\n\n const commandParams = {\n paramString: \"aParameter\",\n paramNumber: 1234,\n };\n const mockedCommandResponse = {\n aNumber: 5678,\n aString: \"mockedResponseString\",\n };\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n describe(\"without mocking extractDependencies\", () => {\n it(\"should call sendCommand on internalApi with the correct parameters\", async () => {\n setupOpenAppDAMock();\n apiSendCommandMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n });\n await new Promise<void>((resolve, reject) => {\n deviceAction\n ._execute(makeDeviceActionInternalApiMock())\n .observable.subscribe({\n error: () => reject(),\n complete: () => resolve(),\n next: () => {},\n });\n });\n\n expect(apiSendCommandMock).toHaveBeenCalledWith(\n new TestCommand(commandParams),\n );\n });\n });\n\n describe(\"error cases\", () => {\n it(\"should error and output the error if the open app fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock(new UnknownDAError(\"Mocked error\"));\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n }),\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should error and output an error if the call task fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n callMyTask.mockResolvedValue(\n CommandResultFactory({\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n\n describe(\"success cases\", () => {\n it(\"should succeed and output the command result if the send command succeeds\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n callMyTask.mockResolvedValue(\n CommandResultFactory({ data: mockedCommandResponse }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Completed,\n output: mockedCommandResponse,\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n});\n\ntype MyCommandResponse = {\n aNumber: number;\n aString: string;\n};\n\ntype MyCommandParams = {\n paramString: string;\n paramNumber: number;\n};\n\nclass TestCommand implements Command<MyCommandResponse, MyCommandParams> {\n params: MyCommandParams;\n constructor(params: MyCommandParams) {\n this.params = params;\n }\n getApdu(): Apdu {\n return new ApduBuilder({ cla: 0x00, ins: 0x01, p1: 0x02, p2: 0x03 })\n .add32BitUIntToData(this.params.paramNumber)\n .addAsciiStringToData(this.params.paramString)\n .build();\n }\n parseResponse() {\n return CommandResultFactory({ data: { aNumber: 1, aString: \"aString\" } });\n }\n}\n\ntype MyCommandCallTaskDAState = DeviceActionState<\n CallTaskInAppDAOutput<MyCommandResponse>,\n CallTaskInAppDAError<UnknownDAError>,\n CallTaskInAppDAIntermediateValue<\n UserInteractionRequired.None | UserInteractionRequired.VerifyAddress\n >\n>;\n"],
|
5
|
-
"mappings": "aACA,IAAAA,EAA4B,qBAE5BC,EAAsC,kBAGtCC,EAA4B,uCAC5BC,EAAqC,4CACrCC,EAAgD,6DAChDC,EAAuC,oEACvCC,EAGO,sDACPC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAoC,yEAEpCC,EAA2C,qBAE3CC,EAA0C,uCAO1C,GAAG,KACD,gEACA,MAAOC,GAAmB,CACxB,MAAMC,EACJ,MAAMD,EAEJ,EACJ,MAAO,CACL,GAAGC,EACH,oBAAqB,GAAG,GAAG,KAAO,CAChC,GAAGA,EAAS,oBACZ,iBAAkB,GAAG,GAAG,CAC1B,EAAE,CACJ,CACF,CACF,EAEA,MAAMC,EAAsBC,GAAoB,CAC7C,sBAA6B,mBAAmB,KAAO,CACtD,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,OAC3C,iBAAc,CACZ,QAAS,UACT,OAAQ,CACN,QAAS,CACP,SAAO,UAAO,CACZ,kBAAmB,CACjB,wBAAyB,0BAAwB,cACnD,CACF,CAAC,EACD,MAAO,CACL,EAAG,MACL,CACF,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQ,IAAOA,KAAQ,QAAKA,CAAK,KAAI,SAAM,MAAS,CACtD,CAAC,CACH,CACF,EAAE,CACJ,EAEA,SAAS,4BAA6B,IAAM,CAC1C,MAAMC,EAAa,GAAG,GAAG,EAEnBC,EAA0B,KAAO,CACrC,SAAUD,CACZ,GAEM,CAAE,YAAaE,CAAmB,KAAI,mCAAgC,EAEtEC,EAAgB,CACpB,YAAa,aACb,YAAa,IACf,EACMC,EAAwB,CAC5B,QAAS,KACT,QAAS,sBACX,EACA,WAAW,IAAM,CACf,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,sCAAuC,IAAM,CACpD,GAAG,qEAAsE,SAAY,CACnFN,EAAmB,EACnBI,EAAmB,qBACjB,wBAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,EAEA,MAAMG,EAAe,IAAI,4BAA0B,CACjD,MAAO,CACL,KAAM,MAAOC,GACX,MAAMA,EAAY,YAAY,IAAIC,EAAYJ,CAAa,CAAC,EAC9D,QAAS,QACT,wBAAyB,0BAAwB,
|
4
|
+
"sourcesContent": ["/* eslint @typescript-eslint/consistent-type-imports:0 */\nimport { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type Command } from \"@api/types\";\nimport { UnknownDeviceExchangeError } from \"@root/src\";\n\nimport { CallTaskInAppDeviceAction } from \"./CallTaskInAppDeviceAction\";\nimport {\n type CallTaskInAppDAError,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAOutput,\n} from \"./CallTaskInAppDeviceActionTypes\";\n\nvi.mock(\n \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\",\n async (importOriginal) => {\n const original =\n await importOriginal<\n typeof import(\"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\")\n >();\n return {\n ...original,\n OpenAppDeviceAction: vi.fn(() => ({\n ...original.OpenAppDeviceAction,\n makeStateMachine: vi.fn(),\n })),\n };\n },\n);\n\nconst setupOpenAppDAMock = (error?: unknown) => {\n (OpenAppDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n initial: \"pending\",\n states: {\n pending: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n }),\n after: {\n 0: \"done\",\n },\n },\n done: {\n type: \"final\",\n },\n },\n output: () => (error ? Left(error) : Right(undefined)),\n }),\n ),\n }));\n};\n\ndescribe(\"CallTaskInAppDeviceAction\", () => {\n const callMyTask = vi.fn();\n\n const extractDependenciesMock = () => ({\n callTask: callMyTask,\n });\n\n const { sendCommand: apiSendCommandMock } = makeDeviceActionInternalApiMock();\n\n const commandParams = {\n paramString: \"aParameter\",\n paramNumber: 1234,\n };\n const mockedCommandResponse = {\n aNumber: 5678,\n aString: \"mockedResponseString\",\n };\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n describe(\"without mocking extractDependencies\", () => {\n it(\"should call sendCommand on internalApi with the correct parameters\", async () => {\n setupOpenAppDAMock();\n apiSendCommandMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n });\n await new Promise<void>((resolve, reject) => {\n deviceAction\n ._execute(makeDeviceActionInternalApiMock())\n .observable.subscribe({\n error: () => reject(),\n complete: () => resolve(),\n next: () => {},\n });\n });\n\n expect(apiSendCommandMock).toHaveBeenCalledWith(\n new TestCommand(commandParams),\n );\n });\n });\n\n describe(\"error cases\", () => {\n it(\"should error and output the error if the open app fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock(new UnknownDAError(\"Mocked error\"));\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n }),\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should error and output an error if the call task fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n callMyTask.mockResolvedValue(\n CommandResultFactory({\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n\n describe(\"success cases\", () => {\n it(\"should succeed and output the command result if the send command succeeds\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n callMyTask.mockResolvedValue(\n CommandResultFactory({ data: mockedCommandResponse }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Completed,\n output: mockedCommandResponse,\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should succeed while skipping OpenApp\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n callMyTask.mockResolvedValue(\n CommandResultFactory({ data: mockedCommandResponse }),\n );\n\n const deviceAction = new CallTaskInAppDeviceAction({\n input: {\n task: async (internalApi) =>\n await internalApi.sendCommand(new TestCommand(commandParams)),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: true,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandCallTaskDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Completed,\n output: mockedCommandResponse,\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n});\n\ntype MyCommandResponse = {\n aNumber: number;\n aString: string;\n};\n\ntype MyCommandParams = {\n paramString: string;\n paramNumber: number;\n};\n\nclass TestCommand implements Command<MyCommandResponse, MyCommandParams> {\n params: MyCommandParams;\n constructor(params: MyCommandParams) {\n this.params = params;\n }\n getApdu(): Apdu {\n return new ApduBuilder({ cla: 0x00, ins: 0x01, p1: 0x02, p2: 0x03 })\n .add32BitUIntToData(this.params.paramNumber)\n .addAsciiStringToData(this.params.paramString)\n .build();\n }\n parseResponse() {\n return CommandResultFactory({ data: { aNumber: 1, aString: \"aString\" } });\n }\n}\n\ntype MyCommandCallTaskDAState = DeviceActionState<\n CallTaskInAppDAOutput<MyCommandResponse>,\n CallTaskInAppDAError<UnknownDAError>,\n CallTaskInAppDAIntermediateValue<\n UserInteractionRequired.None | UserInteractionRequired.VerifyAddress\n >\n>;\n"],
|
5
|
+
"mappings": "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",
|
6
6
|
"names": ["import_purify_ts", "import_xstate", "import_ApduBuilder", "import_CommandResult", "import_makeInternalApi", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_OpenAppDeviceAction", "import_src", "import_CallTaskInAppDeviceAction", "importOriginal", "original", "setupOpenAppDAMock", "error", "callMyTask", "extractDependenciesMock", "apiSendCommandMock", "commandParams", "mockedCommandResponse", "deviceAction", "internalApi", "TestCommand", "resolve", "reject", "expectedStates", "params"]
|
7
7
|
}
|
package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var a=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var A=(r,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of t(e))!l.call(r,p)&&p!==n&&a(r,p,{get:()=>e[p],enumerable:!(o=s(e,p))||o.enumerable});return r};var d=r=>A(a({},"__esModule",{value:!0}),r);var i={};module.exports=d(i);
|
2
2
|
//# sourceMappingURL=CallTaskInAppDeviceActionTypes.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.ts"],
|
4
|
-
"sourcesContent": ["import {\n type CommandErrorResult,\n type CommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport {\n type OpenAppDAError,\n type OpenAppDAIntermediateValue,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\n\nexport type CallTaskInAppDAOutput<TaskResponse> = TaskResponse;\n\nexport type CallTaskInAppDAInput<\n TaskResponse,\n TaskErrorCodes,\n UserInteraction,\n> = {\n readonly task: (\n internalApi: InternalApi,\n ) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n readonly appName: string;\n readonly requiredUserInteraction: UserInteraction;\n readonly compatibleAppNames?: string[];\n};\n\nexport type CallTaskInAppDAError<TaskErrorCodes = void> =\n | OpenAppDAError\n | CommandErrorResult<TaskErrorCodes>[\"error\"];\n\nexport type CallTaskInAppDAIntermediateValue<UserInteraction> =\n | { readonly requiredUserInteraction: UserInteraction }\n | OpenAppDAIntermediateValue;\n\nexport type CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes> = {\n readonly taskResponse: TaskResponse | null;\n readonly error: CallTaskInAppDAError<TaskErrorCodes> | null;\n};\n"],
|
4
|
+
"sourcesContent": ["import {\n type CommandErrorResult,\n type CommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport {\n type OpenAppDAError,\n type OpenAppDAIntermediateValue,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\n\nexport type CallTaskInAppDAOutput<TaskResponse> = TaskResponse;\n\nexport type CallTaskInAppDAInput<\n TaskResponse,\n TaskErrorCodes,\n UserInteraction,\n> = {\n readonly task: (\n internalApi: InternalApi,\n ) => Promise<CommandResult<TaskResponse, TaskErrorCodes>>;\n readonly appName: string;\n readonly skipOpenApp: boolean;\n readonly requiredUserInteraction: UserInteraction;\n readonly compatibleAppNames?: string[];\n};\n\nexport type CallTaskInAppDAError<TaskErrorCodes = void> =\n | OpenAppDAError\n | CommandErrorResult<TaskErrorCodes>[\"error\"];\n\nexport type CallTaskInAppDAIntermediateValue<UserInteraction> =\n | { readonly requiredUserInteraction: UserInteraction }\n | OpenAppDAIntermediateValue;\n\nexport type CallTaskInAppDAInternalState<TaskResponse, TaskErrorCodes> = {\n readonly taskResponse: TaskResponse | null;\n readonly error: CallTaskInAppDAError<TaskErrorCodes> | null;\n};\n"],
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
6
6
|
"names": ["CallTaskInAppDeviceActionTypes_exports", "__toCommonJS"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var i=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var
|
1
|
+
"use strict";var i=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var l=(o,r)=>{for(var e in r)i(o,e,{get:r[e],enumerable:!0})},c=(o,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of a(r))!s.call(o,n)&&n!==e&&i(o,n,{get:()=>r[n],enumerable:!(t=E(r,n))||t.enumerable});return o};var m=o=>c(i({},"__esModule",{value:!0}),o);var y={};l(y,{DeviceLockedError:()=>g,DeviceNotOnboardedError:()=>d,OutOfMemoryDAError:()=>p,UnknownDAError:()=>k,UnsupportedFirmwareDAError:()=>D});module.exports=m(y);class d{_tag="DeviceNotOnboardedError";originalError;constructor(r){this.originalError=new Error(r??"Device not onboarded.")}}class g{_tag="DeviceLockedError";originalError;constructor(r){this.originalError=new Error(r??"Device locked.")}}class D{_tag="UnsupportedFirmwareDAError";originalError;constructor(r){this.originalError=new Error(r??"Unknown error.")}}class p{_tag="OutOfMemoryDAError";originalError;constructor(r){this.originalError=new Error(r??"Unknown error.")}}class k{_tag="UnknownDAError";originalError;constructor(r){this.originalError=new Error(r??"Unknown error.")}}0&&(module.exports={DeviceLockedError,DeviceNotOnboardedError,OutOfMemoryDAError,UnknownDAError,UnsupportedFirmwareDAError});
|
2
2
|
//# sourceMappingURL=Errors.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/os/Errors.ts"],
|
4
|
-
"sourcesContent": ["import { type DmkError } from \"@api/Error\";\n\nexport class DeviceNotOnboardedError implements DmkError {\n readonly _tag = \"DeviceNotOnboardedError\";\n readonly originalError?: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Device not onboarded.\");\n }\n}\n\nexport class DeviceLockedError implements DmkError {\n readonly _tag = \"DeviceLockedError\";\n readonly originalError?: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Device locked.\");\n }\n}\n\nexport class UnknownDAError implements DmkError {\n readonly _tag = \"UnknownDAError\";\n readonly originalError?: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Unknown error.\");\n }\n}\n"],
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,4BAAAC,EAAA,mBAAAC,IAAA,eAAAC,
|
6
|
-
"names": ["Errors_exports", "__export", "DeviceLockedError", "DeviceNotOnboardedError", "UnknownDAError", "__toCommonJS", "message"]
|
4
|
+
"sourcesContent": ["import { type DmkError } from \"@api/Error\";\n\nexport class DeviceNotOnboardedError implements DmkError {\n readonly _tag = \"DeviceNotOnboardedError\";\n readonly originalError?: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Device not onboarded.\");\n }\n}\n\nexport class DeviceLockedError implements DmkError {\n readonly _tag = \"DeviceLockedError\";\n readonly originalError?: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Device locked.\");\n }\n}\n\nexport class UnsupportedFirmwareDAError implements DmkError {\n readonly _tag = \"UnsupportedFirmwareDAError\";\n readonly originalError?: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Unknown error.\");\n }\n}\n\nexport class OutOfMemoryDAError implements DmkError {\n readonly _tag = \"OutOfMemoryDAError\";\n readonly originalError?: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Unknown error.\");\n }\n}\n\nexport class UnknownDAError implements DmkError {\n readonly _tag = \"UnknownDAError\";\n readonly originalError?: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Unknown error.\");\n }\n}\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,4BAAAC,EAAA,uBAAAC,EAAA,mBAAAC,EAAA,+BAAAC,IAAA,eAAAC,EAAAP,GAEO,MAAMG,CAA4C,CAC9C,KAAO,0BACP,cAET,YAAYK,EAAkB,CAC5B,KAAK,cAAgB,IAAI,MAAMA,GAAW,uBAAuB,CACnE,CACF,CAEO,MAAMN,CAAsC,CACxC,KAAO,oBACP,cAET,YAAYM,EAAkB,CAC5B,KAAK,cAAgB,IAAI,MAAMA,GAAW,gBAAgB,CAC5D,CACF,CAEO,MAAMF,CAA+C,CACjD,KAAO,6BACP,cAET,YAAYE,EAAkB,CAC5B,KAAK,cAAgB,IAAI,MAAMA,GAAW,gBAAgB,CAC5D,CACF,CAEO,MAAMJ,CAAuC,CACzC,KAAO,qBACP,cAET,YAAYI,EAAkB,CAC5B,KAAK,cAAgB,IAAI,MAAMA,GAAW,gBAAgB,CAC5D,CACF,CAEO,MAAMH,CAAmC,CACrC,KAAO,iBACP,cAET,YAAYG,EAAkB,CAC5B,KAAK,cAAgB,IAAI,MAAMA,GAAW,gBAAgB,CAC5D,CACF",
|
6
|
+
"names": ["Errors_exports", "__export", "DeviceLockedError", "DeviceNotOnboardedError", "OutOfMemoryDAError", "UnknownDAError", "UnsupportedFirmwareDAError", "__toCommonJS", "message"]
|
7
7
|
}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
"use strict";var v=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var O=(i,a)=>{for(var s in a)v(i,s,{get:a[s],enumerable:!0})},P=(i,a,s,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of R(a))!b.call(i,o)&&o!==s&&v(i,o,{get:()=>a[o],enumerable:!(p=L(a,o))||p.enumerable});return i};var q=i=>P(v({},"__esModule",{value:!0}),i);var B={};O(B,{GetDeviceMetadataDeviceAction:()=>N});module.exports=q(B);var d=require("purify-ts"),n=require("xstate"),f=require("../../../command/model/CommandResult"),l=require("../../../device-action/model/UserInteractionRequired"),h=require("../../../device-action/os/Const"),D=require("../../../device-action/os/GoToDashboard/GoToDashboardDeviceAction"),M=require("../../../device-action/os/ListApps/ListAppsDeviceAction"),y=require("../../../device-action/task/GetApplicationsMetadataTask"),A=require("../../../device-action/task/GetFirmwareMetadataTask"),C=require("../../../device-action/xstate-utils/XStateDeviceAction"),c=require("../../../device-session/DeviceSessionState"),x=require("../../../secure-channel/device-action/ListInstalledApps/types"),V=require("../../../secure-channel/task/ConnectToSecureChannelTask"),u=require("../../../secure-channel/task/types");class N extends C.XStateDeviceAction{makeStateMachine(a){const{getDeviceMetadata:s,getFirmwareMetadata:p,getApplicationsMetadata:o,listAppsSecureChannel:S}=this.extractDependencies(a),t=this.input.unlockTimeout??h.DEFAULT_UNLOCK_TIMEOUT_MS,m=new D.GoToDashboardDeviceAction({input:{unlockTimeout:t}}).makeStateMachine(a),g=new M.ListAppsDeviceAction({input:{unlockTimeout:t}}).makeStateMachine(a);return(0,n.setup)({types:{input:{unlockTimeout:t},context:{},output:{}},actors:{goToDashboard:m,getDeviceMetadata:(0,n.fromPromise)(s),getFirmwareMetadata:(0,n.fromPromise)(p),getApplicationsMetadata:(0,n.fromPromise)(o),listApps:g,listAppsSecureChannel:(0,n.fromObservable)(S)},guards:{hasError:({context:e})=>e._internalState.error!==null,hasMetadata:({context:e})=>e._internalState.firmwareVersion!==null&&e._internalState.firmwareUpdateContext!==null&&e._internalState.customImage!==null&&e._internalState.applications!==null&&e._internalState.applicationsUpdates!==null&&e._internalState.installedLanguages!==null&&e._internalState.catalog!==null,forceUpdate:({context:e})=>!!e.input.forceUpdate,useSecureChannel:({context:e})=>!!e.input.useSecureChannel},actions:{assignErrorFromEvent:(0,n.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"GetDeviceMetadataDeviceAction",initial:"DeviceReady",context:e=>({input:{useSecureChannel:e.input.useSecureChannel,forceUpdate:e.input.forceUpdate,unlockTimeout:e.input.unlockTimeout},intermediateValue:{requiredUserInteraction:l.UserInteractionRequired.None},_internalState:{error:null,deviceVersion:null,firmware:null,firmwareVersion:null,firmwareUpdateContext:null,customImage:null,installedApps:null,applications:null,applicationsUpdates:null,installedLanguages:null,catalog:null}}),states:{DeviceReady:{always:[{target:"GoToDashboard",guard:"forceUpdate"},{target:"GetDeviceMetadataFromContext"}]},GetDeviceMetadataFromContext:{invoke:{src:"getDeviceMetadata",onDone:{target:"GetDeviceMetadataFromContextResultCheck",actions:(0,n.assign)({_internalState:e=>e.event.output===null?e.context._internalState:{...e.context._internalState,firmwareVersion:e.event.output.firmwareVersion,firmwareUpdateContext:e.event.output.firmwareUpdateContext,customImage:e.event.output.customImage,applications:e.event.output.applications,applicationsUpdates:e.event.output.applicationsUpdates,installedLanguages:e.event.output.installedLanguages,catalog:e.event.output.catalog}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetDeviceMetadataFromContextResultCheck:{always:[{target:"Success",guard:"hasMetadata"},{target:"GoToDashboard"}]},GoToDashboard:{exit:(0,n.assign)({intermediateValue:{requiredUserInteraction:l.UserInteractionRequired.None}}),invoke:{id:"dashboard",src:"goToDashboard",input:e=>({unlockTimeout:e.context.input.unlockTimeout}),onSnapshot:{actions:(0,n.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{target:"GoToDashboardCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:r=>({...e.context._internalState,error:r})})})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GoToDashboardCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetFirmwareMetadata"}]},GetFirmwareMetadata:{invoke:{src:"getFirmwareMetadata",onDone:{target:"GetFirmwareMetadataResultCheck",actions:(0,n.assign)({_internalState:e=>{if((0,f.isSuccessCommandResult)(e.event.output)){const r=a.getDeviceSessionState();return r.sessionStateType!==c.DeviceSessionStateType.Connected&&a.setDeviceSessionState({...r,firmwareVersion:e.event.output.data.firmwareVersion,firmwareUpdateContext:e.event.output.data.firmwareUpdateContext,customImage:e.event.output.data.customImage}),{...e.context._internalState,deviceVersion:e.event.output.data.deviceVersion,firmware:e.event.output.data.firmware,firmwareVersion:e.event.output.data.firmwareVersion,firmwareUpdateContext:e.event.output.data.firmwareUpdateContext,customImage:e.event.output.data.customImage}}return{...e.context._internalState,error:e.event.output.error}}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetFirmwareMetadataResultCheck:{always:[{guard:"hasError",target:"Error"},{guard:"useSecureChannel",target:"ListAppsSecureChannel"},{target:"ListApps"}]},ListAppsSecureChannel:{exit:(0,n.assign)({intermediateValue:{requiredUserInteraction:l.UserInteractionRequired.None}}),invoke:{id:"listAppsSecureChannel",src:"listAppsSecureChannel",input:e=>({firmware:e.context._internalState.firmware,firmwareVersion:e.context._internalState.firmwareVersion}),onSnapshot:{actions:(0,n.assign)({intermediateValue:e=>{switch(e.event.snapshot.context?.type){case u.SecureChannelEventType.PermissionRequested:return{requiredUserInteraction:l.UserInteractionRequired.AllowSecureConnection};case u.SecureChannelEventType.PermissionGranted:{const r=a.getDeviceSessionState();return r.sessionStateType!==c.DeviceSessionStateType.Connected&&a.setDeviceSessionState({...r,isSecureConnectionAllowed:!0}),{requiredUserInteraction:l.UserInteractionRequired.None}}default:return{...e.context.intermediateValue}}},_internalState:e=>{if(e.event.snapshot.context?.type===u.SecureChannelEventType.Result){if((0,x.installedAppResultGuard)(e.event.snapshot.context.payload))return{...e.context._internalState,installedApps:e.event.snapshot.context.payload.map(r=>({name:r.name,hash:r.hash,hashCode:r.hash_code_data}))};throw new Error(`Invalid result ${JSON.stringify(e.event.snapshot.context.payload)}`)}return{...e.context._internalState}}})},onDone:{target:"ListAppsCheck"},onError:{target:"Error",actions:"assignErrorFromEvent"}}},ListApps:{exit:(0,n.assign)({intermediateValue:{requiredUserInteraction:l.UserInteractionRequired.None}}),invoke:{id:"listApps",src:"listApps",input:e=>({unlockTimeout:e.context.input.unlockTimeout}),onSnapshot:{actions:(0,n.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{target:"ListAppsCheck",actions:(0,n.assign)({_internalState:e=>e.event.output.isLeft()?{...e.context._internalState,error:e.event.output.extract()}:{...e.context._internalState,installedApps:e.event.output.unsafeCoerce().map(r=>({name:r.appName,hash:r.appFullHash,hashCode:r.appCodeHash}))}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},ListAppsCheck:{always:[{target:"Error",guard:"hasError"},{target:"GetApplicationsMetadata"}]},GetApplicationsMetadata:{invoke:{src:"getApplicationsMetadata",input:e=>({deviceVersion:e.context._internalState.deviceVersion,firmware:e.context._internalState.firmware,firmwareVersion:e.context._internalState.firmwareVersion,installedApps:e.context._internalState.installedApps}),onDone:{target:"GetApplicationsMetadataResultCheck",actions:(0,n.assign)({_internalState:e=>{if((0,f.isSuccessCommandResult)(e.event.output)){const r=a.getDeviceSessionState();return r.sessionStateType!==c.DeviceSessionStateType.Connected&&a.setDeviceSessionState({...r,installedApps:e.event.output.data.applications,appsUpdates:e.event.output.data.applicationsUpdates,installedLanguages:e.event.output.data.installedLanguages,catalog:e.event.output.data.catalog}),{...e.context._internalState,applications:e.event.output.data.applications,applicationsUpdates:e.event.output.data.applicationsUpdates,installedLanguages:e.event.output.data.installedLanguages,catalog:e.event.output.data.catalog}}return{...e.context._internalState,error:e.event.output.error}}})},onError:{target:"Error",actions:"assignErrorFromEvent"}}},GetApplicationsMetadataResultCheck:{always:[{guard:"hasError",target:"Error"},{target:"Success"}]},Success:{type:"final"},Error:{type:"final"}},output:e=>{const{context:r}=e,{error:w,firmwareVersion:G,firmwareUpdateContext:I,customImage:F,applications:E,applicationsUpdates:U,installedLanguages:k,catalog:T}=r._internalState;return w?(0,d.Left)(w):(0,d.Right)({firmwareVersion:G,firmwareUpdateContext:I,customImage:F,applications:E,applicationsUpdates:U,installedLanguages:k,catalog:T})}})}extractDependencies(a){return{getDeviceMetadata:async()=>{const t=a.getDeviceSessionState();return t.sessionStateType===c.DeviceSessionStateType.Connected||t.firmwareVersion?.metadata===void 0||t.firmwareUpdateContext===void 0||t.customImage===void 0||t.installedApps.length===0||t.appsUpdates===void 0||t.installedLanguages===void 0||t.catalog===void 0?null:{firmwareVersion:t.firmwareVersion,firmwareUpdateContext:t.firmwareUpdateContext,customImage:t.customImage,applications:t.installedApps,applicationsUpdates:t.appsUpdates,installedLanguages:t.installedLanguages,catalog:t.catalog}},getFirmwareMetadata:async()=>new A.GetFirmwareMetadataTask(a).run(),getApplicationsMetadata:async t=>new y.GetApplicationsMetadataTask(a,{deviceVersion:t.input.deviceVersion,firmware:t.input.firmware,firmwareVersion:t.input.firmwareVersion,installedApps:t.input.installedApps}).run(),listAppsSecureChannel:t=>{const{firmware:m,firmwareVersion:g}=t.input,e=a.getSecureChannelService().listInstalledApps(g.metadata,m);return new V.ConnectToSecureChannelTask(a,{connection:e}).run()}}}}0&&(module.exports={GetDeviceMetadataDeviceAction});
|
2
|
+
//# sourceMappingURL=GetDeviceMetadataDeviceAction.js.map
|