nodejs-connected-drive
Version:
NodeJS client for BMW Connected Drive
45 lines • 2.6 kB
TypeScript
import { RemoteService } from "./enums/RemoteService";
import type { Configuration } from "./@types/Configuration";
import type { DeepPartial } from "./@types/DeepPartial";
import type { GetStatusOfAllVehiclesResponse as GetStatusOfAllVehiclesResponse } from "./@types/GetStatusOfAllVehiclesResponse";
import type { GetTechnicalVehicleDetails } from "./@types/GetTechnicalVehicleDetails";
import type { GetVehicleDetails } from "./@types/GetVehicleDetails";
import type { GetVehiclesResponse } from "./@types/GetVehiclesResponse";
/**
* SDK class that expose the Connected Drive API.
*
* Note that `login()` does not need to be called explicitly.
* The SDK will lazily call `login()` to (re)authenticate when necessary.
*/
export declare class ConnectedDrive<Test extends boolean = false> {
#private;
/** The generic type parameter should be either omitted or `false` in production. */
constructor(
/** Required. The Connected Drive username */
username: string,
/** Required. The Connected Drive username */
password: string,
/** Optional. Override the default configuration. */
configuration?: DeepPartial<Configuration<Test>>);
/** Authenticate with the Connected Drive API and store the resulting access_token on 'this'. This function is also called lazily by the SDK when necessary. */
login(): Promise<void>;
/** Returns a list specifying the physical configuration of vehicles. */
getVehicles(): Promise<GetVehiclesResponse>;
/** Returns details describing the Connected Drive services supported by the vehicle. */
getVehicleDetails(vehicleVin: string): Promise<GetVehicleDetails>;
/** Returns technical details of the vehicle such as milage, fuel reserve and service messages. */
getVehicleTechnicalDetails(vehicleVin: string): Promise<GetTechnicalVehicleDetails>;
/** Returns a list of vehicles detailing their connectivity and Connected Drive service status. */
getStatusOfAllVehicles(): Promise<GetStatusOfAllVehiclesResponse>;
/**
* Execute a Connected Drive remote service. This may throw if:
* - specified vin isn't registered on the user
* - remote services aren't activated on the car
* - the car isn't online
* - the car-user relation hasn't been confirmed
* - the remote service takes too long time to complete. Default timeout 1 min.
* - if a new remote service command is sent to the car before this action has completed.
*/
executeRemoteService(vehicleVin: string, service: RemoteService): Promise<void>;
}
//# sourceMappingURL=ConnectedDrive.d.ts.map