import { WebmateAPISession } from "../webmate-api-session"; import { WebmateAuthInfo } from "../webmate-auth-info"; import { WebmateEnvironment } from "../webmate-environment"; import { WebmateAPIClient } from "../webmate-api-client"; import { DeviceId, ImageId, PackageId, ProjectId } from "../types"; import { Observable } from "rxjs"; import { DeviceRequest } from "./device-request"; import { DeviceDTO } from "./device-dto"; import { ImageType } from "../packagemgmt/image-type"; import { ImagePool } from "../packagemgmt/image-pool"; /** * Facade to webmate's Device subsystem. */ export declare class DeviceClient { private session; private apiClient; /** * Creates a DeviceClient based on a WebmateApiSession. * * @param session The WebmateApiSession the DeviceClient is supposed to be based on. */ constructor(session: WebmateAPISession); /** * Get Device info for Device Id. * * @param deviceId Id of Device for which info should be fetched. * @return device info. */ getDeviceInfo(deviceId: DeviceId): Observable; /** * Get all Device ids for a project. * * @param projectId Id of Project (as found in dashboard), for which devices should be retrieved. * @return Collection of device ids. */ getDeviceIdsForProject(projectId: ProjectId): Observable>; /** * Request a device deployment by the specified device request. * * @param projectId Id of Project (as found in dashboard), for which devices should be retrieved. * @param deviceRequest Contains the defined device properties. */ requestDeviceByRequirements(projectId: ProjectId, deviceRequest: DeviceRequest): Observable; /** * Synchronize webmate with device. (Usually not necessary) * * @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview. */ synchronizeDevice(deviceId: DeviceId): Observable; /** * Release device. The device will not be deployed afterwards. * * @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview. */ releaseDevice(deviceId: DeviceId): Observable; /** * Reset device. If the device is a mobile device, the device cleanup workflow will be started. In case of a desktop device, the * machine will be rolled back to the latest snapshop, if one exists. * * @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview. */ resetDevice(deviceId: DeviceId): Observable; /** * Redeploy device. The device will be released and redeployed with the same properties as before. * * @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview. */ redeployDevice(deviceId: DeviceId): Observable; /** * Install the app wit the given Id on a device. If instrumented is set to true, the instrumented version will be * used if available. * * @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview. * @param appId Id of app to be installed. Can be found in App management of the webmate device overview. * @param instrumented If true, the instrumented version of the app will be installed, if available. */ installAppOnDevice(deviceId: DeviceId, appId: PackageId, instrumented?: boolean): Observable; /** * Uploads am image to webmate. The image is defined by the given byte array and specified by the imageType. The * uploaded image can be referenced by the returned image id. * * @param projectId Id of Project (as found in dashboard), for which devices should be retrieved. * @param imageFilePath File path to image file. * @param imageName Desired name of the image. * @param imageType Image format type. * @return Id of the uploaded image. */ uploadImage(projectId: ProjectId, imageFilePath: string, imageName: string, imageType: ImageType): Observable; /** * Uploads an image to a device. The image is identified by the given image id. The image must have been uploaded * to webmate before * * @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview. * @param imageId Id of the image to be pushed to device. */ uploadImageToDevice(deviceId: DeviceId, imageId: ImageId): Observable; /** * Uploads an image to webmate and pushes it to a device. The image is defined by the given byte array and specified * by the imageType. The uploaded image can be referenced by the returned image id. * * @param projectId Id of Project (as found in dashboard), for which devices should be retrieved. * @param imageFilePath File path to image file. * @param imageName Desired name of the image. * @param imageType Image format type. * @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview. * @return Id of the uploaded image. */ uploadImageToDeviceWithFilePath(projectId: ProjectId, imageFilePath: string, imageName: string, imageType: ImageType, deviceId: DeviceId): Observable; /** * Configure the camera simulation to use the given selectedImageId. The simulation can be enabled or disabled. * * @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview. * @param selectedImageId Image id of an already uploaded image. The parameter sets the image that is to be used for * the camera simulation. It can also be null to reset the selected image. * @param simulate Disables or enables the camera simulation. */ setCameraSimulation(deviceId: DeviceId, selectedImageId: ImageId, simulate: boolean): Observable; /** * Configure the biometrics simulation on a device. * * @param deviceId The device id of the device. * @param simulateBiometrics True if the biometrics simulation should be enabled, false otherwise. * @param acceptAuthentication True if the device should immediately accept the simulated authentication, * false if the device should immediately reject the simulated authentication. * Note that this flag only has any effect if simulateBiometrics is true. */ setBiometricsSimulation(deviceId: DeviceId, simulateBiometrics: boolean, acceptAuthentication: boolean): Observable; /** * Uploads an image to webmate, pushes it to a device and configures the camera simulation to use the image. The * image is defined by the given byte array and specified by the imageType. The uploaded image can be referenced by * the returned image id. The camera simulation will be enabled. * * @param projectId Id of Project (as found in dashboard), for which devices should be retrieved. * @param imageFilePath File path to image file. * @param imageName Desired name of the image. * @param imageType Image format type. * @param deviceId DeviceId of device. Can be found in "Details" dialog of an item in webmate device overview. * @return Id of the uploaded image. */ uploadImageToDeviceAndSetForCameraSimulationWithFilePath(projectId: ProjectId, imageFilePath: string, imageName: string, imageType: ImageType, deviceId: DeviceId): Observable; } export declare class DeviceApiClient extends WebmateAPIClient { private getDeviceInfoRoute; private getDeviceIdsForProjectRoute; private requestDeviceByRequirementsForProjectRoute; private synchronizeDeviceRoute; private releaseDeviceRoute; private resetDeviceRoute; private redeployDeviceRoute; private installAppOnDeviceRoute; private uploadImageRoute; private uploadImageToDeviceRoute; private setCameraSimulationRoute; private setBiometricsSimulationRoute; constructor(authInfo: WebmateAuthInfo, environment: WebmateEnvironment); getDeviceInfo(deviceId: DeviceId): Observable; getDeviceIdsForProject(projectId: ProjectId): Observable>; requestDeviceByRequirements(projectId: ProjectId, deviceRequest: DeviceRequest): Observable; synchronizeDevice(deviceId: DeviceId): Observable; releaseDevice(deviceId: DeviceId): Observable; resetDevice(deviceId: DeviceId): Observable; redeployDevice(deviceId: DeviceId): Observable; installAppOnDevice(deviceId: DeviceId, appId: PackageId, instrumented: boolean): Observable; uploadImage(projectId: ProjectId, imageFilePath: string, imageName: string, imageType: ImageType): Observable; uploadImageToDevice(deviceId: DeviceId, imageId: ImageId): Observable; uploadImageToDeviceWithFilePath(projectId: ProjectId, imageFilePath: string, imageName: string, imageType: ImageType, deviceId: DeviceId): Observable; setCameraSimulation(deviceId: DeviceId, imageId: ImageId, simulate: boolean, imagePool: ImagePool): Observable; setBiometricsSimulation(deviceId: DeviceId, simulate: boolean, accept: boolean): Observable; }