UNPKG

fleeta-api-lib

Version:

A comprehensive library for fleet management applications - API, Auth, Device management

220 lines 5.6 kB
/** * BlackVue Fleeta Device List API Type Definitions * Defines interfaces and types for device management functionality */ /** * Battery information interface */ export interface BatteryInfo { ssid: string; celsius: number; battery_percent: number; createdAt: string; updatedAt: string; state: 'pending' | 'latest' | 'lateup1' | 'lateup2'; } /** * Care service information interface */ export interface CareInfo { activation_date: string; email: string; care_id: string; reg_date: string; expiration_date: string; service_date: string; service: string; service_type: string; } /** * Device detailed information interface */ export interface DeviceInfo { valid: 'valid' | 'invalid'; psn: string; model: string; active: 'on' | 'off'; dev_name: string; battery?: BatteryInfo; lb_server_name: string; lb_http_port: number; lb_rtmp_port: number; share_video: 'on' | 'off'; share_audio: 'on' | 'off'; share_dev_name: 'on' | 'off'; share_gps: 'on' | 'off'; agree_gps: 'on' | 'off'; fw_ver: string; upload_server?: string; upload_port?: number; lang: string; mode: '0' | '1'; communication_identifier: 'Wifi' | 'Cat4' | 'Cat-M1'; temperature_level: number; sensitivity_level: number; dms_type: string; dms_version: string; reg_date: string; login_date: string; iot_conn: 'on' | 'off'; reg_category: 'wifi' | 'cloud'; continentCode: string; countryCode: string; ip: string; liveview_rating: number; regInfoUpdateDT: string; countryCodeUpdateDT: string; profile_img?: string; profile_img_v2?: string; cldn: string; ap_ssid?: string; ap_pw?: string; require_time_sync: 'on' | 'off'; care_info?: CareInfo; } /** * Device list item interface (can be device-only or group+device) */ export interface DeviceListItem { groupManagementID?: string; groupName?: string; groupRegDT?: string; device: DeviceInfo; } /** * Device list request parameters interface */ export interface DeviceListParams { email: string; user_token: string; tokenType?: 'web' | 'app'; keyword?: string; startIndex?: number; endIndex?: number; } /** * Device list API response interface */ export interface DeviceListResponse { resultcode: string; message: string; response?: { deviceCount: number; deviceLimitCount: number; sharedEventMap: 'on' | 'off'; deviceListInfo: DeviceListItem[]; }; deviceCount?: number; deviceLimitCount?: number; sharedEventMap?: 'on' | 'off'; deviceListInfo?: DeviceListItem[]; groupedData?: { groups: DeviceGroupData[]; statistics: DeviceListStatistics; }; } /** * Device registration status request parameters interface */ export interface DeviceStatusParams { psn: string; } /** * Device registration status response interface */ export interface DeviceStatusResponse { resultcode: string; message: string; response: DeviceRegistrationInfo | {}; } /** * Device registration information interface * Present when device is already registered (cloud registration not available) */ export interface DeviceRegistrationInfo { _id: string; email: string; psn: string; cldn: string; dev_name: string; agree_gps: 'on' | 'off'; companyID: string; ap_ssid: string; ap_pw: string; model: string; lang: string; fw_ver: string; tokenType: 'app' | 'web'; regInfoUpdateDT: string; share_leu_bigdata: 'on' | 'off'; active: 'on' | 'off'; share_gps: 'on' | 'off'; share_video: 'on' | 'off'; share_audio: 'on' | 'off'; share_dev_name: 'on' | 'off'; lb_server_name: string; lb_http_port: string; lb_rtmp_port: string; token: string; reg_date: string; reg_category: 'wifi' | 'cloud'; order: number; profile_img: string; profile_img_v2: string; UseGpsInfo: number; } /** * Device group data from API */ export interface DeviceGroupData { groupId: string; groupName: string; groupRegDate?: string; devices: DeviceListItem[]; isExpanded: boolean; } /** * Device list statistics from API */ export interface DeviceListStatistics { total: number; online: number; offline: number; grouped: number; ungrouped: number; videoSharing: number; normalMode: number; parkingMode: number; wifiOnly: number; cloudEnabled: number; withBattery: number; } /** * Device list error codes */ export declare const DEVICE_LIST_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Unauthorized - Authentication failed"; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; }; /** * Device status error codes */ export declare const DEVICE_STATUS_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Unauthorized - Authentication failed"; readonly BC_ERR_INVALID_PARAMETER: "Invalid PSN parameter provided"; readonly BC_ERR_SERVER: "Internal server error occurred"; }; /** * Device mode display names */ export declare const DEVICE_MODE_NAMES: Record<DeviceInfo['mode'], string>; /** * Communication identifier display names */ export declare const COMMUNICATION_TYPE_NAMES: Record<DeviceInfo['communication_identifier'], string>; /** * Device status display names */ export declare const DEVICE_STATUS_NAMES: Record<DeviceInfo['active'], string>; //# sourceMappingURL=types.d.ts.map