edited
parent
fcc6523c67
commit
f356b7cfde
@ -0,0 +1,301 @@
|
|||||||
|
import { ID } from "./mongo_db/DefaultTypes.ts";
|
||||||
|
export interface IGpsElement {
|
||||||
|
gpsDate: Date;
|
||||||
|
lon: number;
|
||||||
|
lat: number;
|
||||||
|
speed: number;
|
||||||
|
totalKm: number;
|
||||||
|
angle: number;
|
||||||
|
gnssAccuracy: number;
|
||||||
|
satCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ESleepModes {
|
||||||
|
Disable = 0,
|
||||||
|
GpsSleep = 1,
|
||||||
|
DeepSleep = 2,
|
||||||
|
OnlineDeepSleep = 3,
|
||||||
|
UltraSleep = 4,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EDataModes {
|
||||||
|
HomeOnStop = 0,
|
||||||
|
HomeOnMoving = 1,
|
||||||
|
RoamingOnStop = 2,
|
||||||
|
RoamingOnMoving = 3,
|
||||||
|
UnknownOnStop = 4,
|
||||||
|
UnknownOnMoving = 5,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EMovementStatus {
|
||||||
|
MovementOff = 0,
|
||||||
|
MovementOn = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ISleep {
|
||||||
|
mode: ESleepModes;
|
||||||
|
sleepDate: Date;
|
||||||
|
awakeDate: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IConnected {
|
||||||
|
state: boolean;
|
||||||
|
connectedDate: Date;
|
||||||
|
disconnectedDate: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IIgnition {
|
||||||
|
state: boolean;
|
||||||
|
onDate: Date;
|
||||||
|
offDate: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EGnssStatus {
|
||||||
|
GNSSOff = 0,
|
||||||
|
GNSSOnWithFix = 1,
|
||||||
|
GNSSOnWithoutFix = 2,
|
||||||
|
GNSSSleep = 3,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IGnss {
|
||||||
|
status: EGnssStatus;
|
||||||
|
gnssPdop: number;
|
||||||
|
gnssHdop: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EBatteryState {
|
||||||
|
Present = 0,
|
||||||
|
Unplugged = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IVoltage {
|
||||||
|
externalVolt: number;
|
||||||
|
batteryVolt: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IBattery {
|
||||||
|
state: EBatteryState;
|
||||||
|
batteryAmper: number;
|
||||||
|
batteryPercentage: number;
|
||||||
|
batteryTemp: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IInputs {
|
||||||
|
digital1: number;
|
||||||
|
digital2: number;
|
||||||
|
digital3: number;
|
||||||
|
analog1: number;
|
||||||
|
analog2: number;
|
||||||
|
analog3: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IOutputs {
|
||||||
|
digital1: number;
|
||||||
|
digital2: number;
|
||||||
|
digital3: number;
|
||||||
|
analog1: number;
|
||||||
|
analog2: number;
|
||||||
|
analog3: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IAxis {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
z: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EBluetoothStatus {
|
||||||
|
Disabled = 0,
|
||||||
|
EnabledNoDevice = 1,
|
||||||
|
DeviceConnectedBTv3 = 2,
|
||||||
|
DeviceConnectedBLEOnly = 3,
|
||||||
|
DeviceConnectedBLEAndBT = 4,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ESdStatus {
|
||||||
|
NotPresent = 0,
|
||||||
|
Present = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EVehicleState {
|
||||||
|
Moving = 0,
|
||||||
|
Idling = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ETowingState {
|
||||||
|
Steady = 0,
|
||||||
|
Towing = 1,
|
||||||
|
}
|
||||||
|
export enum ECrashDetection {
|
||||||
|
RealCrashCalibrated = 1,
|
||||||
|
LimitedCrashTraceNotCalibrated = 2,
|
||||||
|
LimitedCrashTraceCalibrated = 3,
|
||||||
|
FullCrashTraceNotCalibrated = 4,
|
||||||
|
FullCrashTraceCalibrated = 5,
|
||||||
|
RealCrashNotCalibrated = 6,
|
||||||
|
FakeCrashPothole = 7,
|
||||||
|
FakeCrashSpeedCheck = 8,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EiButtonConnection {
|
||||||
|
NotConnected = 0,
|
||||||
|
ConnectedImmobilizer = 1,
|
||||||
|
ConnectedAuthorizedDriving = 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EJammingStatus {
|
||||||
|
JammingStop = 0,
|
||||||
|
JammingStart = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EAlarmStatus {
|
||||||
|
Reserved = 0,
|
||||||
|
AlarmOccurred = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EAutoGeofence {
|
||||||
|
LeftTargetZone = 0,
|
||||||
|
EnterTargetZone = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ETripStatus {
|
||||||
|
TripStop = 0,
|
||||||
|
TripStart = 1,
|
||||||
|
BusinessStatus = 2,
|
||||||
|
PrivateStatus = 3,
|
||||||
|
CustomStatus1 = 4,
|
||||||
|
CustomStatus2 = 5,
|
||||||
|
CustomStatus3 = 6,
|
||||||
|
CustomStatus4 = 7,
|
||||||
|
CustomStatus5 = 8,
|
||||||
|
CustomStatus6 = 9,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDeviceStateElement {
|
||||||
|
connected: IConnected;
|
||||||
|
sleep: ISleep;
|
||||||
|
dataMode: EDataModes;
|
||||||
|
movement: EMovementStatus;
|
||||||
|
gnss: IGnss;
|
||||||
|
voltage: IVoltage;
|
||||||
|
input?: IInputs;
|
||||||
|
output?: IOutputs;
|
||||||
|
axis?: IAxis;
|
||||||
|
btStatus: EBluetoothStatus;
|
||||||
|
sdStatus: ESdStatus;
|
||||||
|
idling: EVehicleState;
|
||||||
|
towing: ETowingState;
|
||||||
|
battery: IBattery;
|
||||||
|
crashDetection: ECrashDetection;
|
||||||
|
immo: EiButtonConnection;
|
||||||
|
jamming: EJammingStatus;
|
||||||
|
alarm: EAlarmStatus;
|
||||||
|
trip: ETripStatus;
|
||||||
|
autoGeofence: EAutoGeofence;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ENetworkTypes {
|
||||||
|
ThreeG = 0,
|
||||||
|
Gsm = 1,
|
||||||
|
FourG = 2,
|
||||||
|
LteCatM1 = 3,
|
||||||
|
LteCatNb1 = 4,
|
||||||
|
Unknown = 99,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IGsm {
|
||||||
|
_id: ID;
|
||||||
|
gsmNo: string;
|
||||||
|
gsmCellId: string;
|
||||||
|
gsmAreaCode: string;
|
||||||
|
gsmSignal: number;
|
||||||
|
gsmOp: string;
|
||||||
|
iccid1: string;
|
||||||
|
iccid2: string;
|
||||||
|
networkType: ENetworkTypes;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDeviceElement {
|
||||||
|
_id: ID;
|
||||||
|
imei: string;
|
||||||
|
gsmElement: IGsm;
|
||||||
|
gpsElement: IGpsElement;
|
||||||
|
stateElement: IDeviceStateElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITracking {
|
||||||
|
_id: ID;
|
||||||
|
assetId: ID;
|
||||||
|
deviceId: ID;
|
||||||
|
imei: string;
|
||||||
|
port: string;
|
||||||
|
gpsElement: IGpsElement;
|
||||||
|
pingDate: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ELocationStatus {
|
||||||
|
HomeOnStop = 0,
|
||||||
|
HomeOnMoving = 1,
|
||||||
|
RoamingOnStop = 2,
|
||||||
|
RoamingOnMoving = 3,
|
||||||
|
UnknownOnStop = 4,
|
||||||
|
UnknownOnMoving = 5,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EVehicleStatus {
|
||||||
|
GpsIsIncorrect = "_device_gps_is_incorrect",
|
||||||
|
Idling = "_device_is_idling",
|
||||||
|
Moving = "_device_is_moving",
|
||||||
|
Out = "_device_is_out",
|
||||||
|
Stoping = "_device_is_stoping",
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IVehicleStateElement {
|
||||||
|
ignition: IIgnition;
|
||||||
|
state: EVehicleStatus;
|
||||||
|
locationState: ELocationStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EAssetTypes {
|
||||||
|
Baby = "_baby",
|
||||||
|
Bicycle = "_bicycle",
|
||||||
|
Bus = "_bus",
|
||||||
|
Car = "_car",
|
||||||
|
Child = "_child",
|
||||||
|
Dog = "_dog",
|
||||||
|
Forklift = "_forklift",
|
||||||
|
Human = "_human",
|
||||||
|
Motorbike = "_motorbike",
|
||||||
|
Stuff = "_stuff",
|
||||||
|
Tractor = "_tractor",
|
||||||
|
Truck = "_truck",
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EAssetValidTypes {
|
||||||
|
Passive = 0,
|
||||||
|
Active = 1,
|
||||||
|
Debt = 2,
|
||||||
|
Suspend = 3,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IVehicleElement {
|
||||||
|
assetId: ID;
|
||||||
|
driverId: ID;
|
||||||
|
owner: ID;
|
||||||
|
followers: ID[];
|
||||||
|
assetType: EAssetTypes;
|
||||||
|
name1: string;
|
||||||
|
name2: string;
|
||||||
|
name3: string;
|
||||||
|
description1: string;
|
||||||
|
description2: string;
|
||||||
|
registeredDate: Date;
|
||||||
|
updatedDate: Date;
|
||||||
|
modelYear: number;
|
||||||
|
currentKm: number;
|
||||||
|
valid: EAssetValidTypes;
|
||||||
|
showOnMap: boolean;
|
||||||
|
chassis_num: string;
|
||||||
|
brand: string;
|
||||||
|
color: string;
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
import { ObjectId } from "npm:mongodb";
|
||||||
|
export type ID = string | number | ObjectId;
|
||||||
|
export type Maybe<T> = T | null;
|
||||||
@ -1,304 +0,0 @@
|
|||||||
import { ObjectId } from "npm:mongodb";
|
|
||||||
export type ID = string | number | ObjectId;
|
|
||||||
export type Maybe<T> = T | null;
|
|
||||||
|
|
||||||
export interface IGpsElement {
|
|
||||||
gpsDate: Date;
|
|
||||||
lon: number;
|
|
||||||
lat: number;
|
|
||||||
speed: number;
|
|
||||||
totalKm: number;
|
|
||||||
angle: number;
|
|
||||||
gnssAccuracy: number;
|
|
||||||
satCount: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ESleepModes {
|
|
||||||
Disable = 0,
|
|
||||||
GpsSleep = 1,
|
|
||||||
DeepSleep = 2,
|
|
||||||
OnlineDeepSleep = 3,
|
|
||||||
UltraSleep = 4,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EDataModes {
|
|
||||||
HomeOnStop = 0,
|
|
||||||
HomeOnMoving = 1,
|
|
||||||
RoamingOnStop = 2,
|
|
||||||
RoamingOnMoving = 3,
|
|
||||||
UnknownOnStop = 4,
|
|
||||||
UnknownOnMoving = 5,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EMovementStatus {
|
|
||||||
MovementOff = 0,
|
|
||||||
MovementOn = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ISleep {
|
|
||||||
mode: ESleepModes;
|
|
||||||
sleepDate: Date;
|
|
||||||
awakeDate: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IConnected {
|
|
||||||
state: boolean;
|
|
||||||
connectedDate: Date;
|
|
||||||
disconnectedDate: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IIgnition {
|
|
||||||
state: boolean;
|
|
||||||
onDate: Date;
|
|
||||||
offDate: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EGnssStatus {
|
|
||||||
GNSSOff = 0,
|
|
||||||
GNSSOnWithFix = 1,
|
|
||||||
GNSSOnWithoutFix = 2,
|
|
||||||
GNSSSleep = 3,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IGnss {
|
|
||||||
status: EGnssStatus;
|
|
||||||
gnssPdop: number;
|
|
||||||
gnssHdop: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EBatteryState {
|
|
||||||
Present = 0,
|
|
||||||
Unplugged = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IVoltage {
|
|
||||||
externalVolt: number;
|
|
||||||
batteryVolt: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IBattery {
|
|
||||||
state: EBatteryState;
|
|
||||||
batteryAmper: number;
|
|
||||||
batteryPercentage: number;
|
|
||||||
batteryTemp: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IInputs {
|
|
||||||
digital1: number;
|
|
||||||
digital2: number;
|
|
||||||
digital3: number;
|
|
||||||
analog1: number;
|
|
||||||
analog2: number;
|
|
||||||
analog3: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IOutputs {
|
|
||||||
digital1: number;
|
|
||||||
digital2: number;
|
|
||||||
digital3: number;
|
|
||||||
analog1: number;
|
|
||||||
analog2: number;
|
|
||||||
analog3: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IAxis {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
z: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EBluetoothStatus {
|
|
||||||
Disabled = 0,
|
|
||||||
EnabledNoDevice = 1,
|
|
||||||
DeviceConnectedBTv3 = 2,
|
|
||||||
DeviceConnectedBLEOnly = 3,
|
|
||||||
DeviceConnectedBLEAndBT = 4,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ESdStatus {
|
|
||||||
NotPresent = 0,
|
|
||||||
Present = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EVehicleState {
|
|
||||||
Moving = 0,
|
|
||||||
Idling = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ETowingState {
|
|
||||||
Steady = 0,
|
|
||||||
Towing = 1,
|
|
||||||
}
|
|
||||||
export enum ECrashDetection {
|
|
||||||
RealCrashCalibrated = 1,
|
|
||||||
LimitedCrashTraceNotCalibrated = 2,
|
|
||||||
LimitedCrashTraceCalibrated = 3,
|
|
||||||
FullCrashTraceNotCalibrated = 4,
|
|
||||||
FullCrashTraceCalibrated = 5,
|
|
||||||
RealCrashNotCalibrated = 6,
|
|
||||||
FakeCrashPothole = 7,
|
|
||||||
FakeCrashSpeedCheck = 8,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EiButtonConnection {
|
|
||||||
NotConnected = 0,
|
|
||||||
ConnectedImmobilizer = 1,
|
|
||||||
ConnectedAuthorizedDriving = 2,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EJammingStatus {
|
|
||||||
JammingStop = 0,
|
|
||||||
JammingStart = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EAlarmStatus {
|
|
||||||
Reserved = 0,
|
|
||||||
AlarmOccurred = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EAutoGeofence {
|
|
||||||
LeftTargetZone = 0,
|
|
||||||
EnterTargetZone = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ETripStatus {
|
|
||||||
TripStop = 0,
|
|
||||||
TripStart = 1,
|
|
||||||
BusinessStatus = 2,
|
|
||||||
PrivateStatus = 3,
|
|
||||||
CustomStatus1 = 4,
|
|
||||||
CustomStatus2 = 5,
|
|
||||||
CustomStatus3 = 6,
|
|
||||||
CustomStatus4 = 7,
|
|
||||||
CustomStatus5 = 8,
|
|
||||||
CustomStatus6 = 9,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IDeviceStateElement {
|
|
||||||
connected: IConnected;
|
|
||||||
sleep: ISleep;
|
|
||||||
dataMode: EDataModes;
|
|
||||||
movement: EMovementStatus;
|
|
||||||
gnss: IGnss;
|
|
||||||
voltage: IVoltage;
|
|
||||||
input?: IInputs;
|
|
||||||
output?: IOutputs;
|
|
||||||
axis?: IAxis;
|
|
||||||
btStatus: EBluetoothStatus;
|
|
||||||
sdStatus: ESdStatus;
|
|
||||||
idling: EVehicleState;
|
|
||||||
towing: ETowingState;
|
|
||||||
battery: IBattery;
|
|
||||||
crashDetection: ECrashDetection;
|
|
||||||
immo: EiButtonConnection;
|
|
||||||
jamming: EJammingStatus;
|
|
||||||
alarm: EAlarmStatus;
|
|
||||||
trip: ETripStatus;
|
|
||||||
autoGeofence: EAutoGeofence;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ENetworkTypes {
|
|
||||||
ThreeG = 0,
|
|
||||||
Gsm = 1,
|
|
||||||
FourG = 2,
|
|
||||||
LteCatM1 = 3,
|
|
||||||
LteCatNb1 = 4,
|
|
||||||
Unknown = 99,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IGsm {
|
|
||||||
_id: ID;
|
|
||||||
gsmNo: string;
|
|
||||||
gsmCellId: string;
|
|
||||||
gsmAreaCode: string;
|
|
||||||
gsmSignal: number;
|
|
||||||
gsmOp: string;
|
|
||||||
iccid1: string;
|
|
||||||
iccid2: string;
|
|
||||||
networkType: ENetworkTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IDeviceElement {
|
|
||||||
_id: ID;
|
|
||||||
imei: string;
|
|
||||||
gsmElement: IGsm;
|
|
||||||
gpsElement: IGpsElement;
|
|
||||||
stateElement: IDeviceStateElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ITracking {
|
|
||||||
_id: ID;
|
|
||||||
assetId: ID;
|
|
||||||
deviceId: ID;
|
|
||||||
imei: string;
|
|
||||||
port: string;
|
|
||||||
gpsElement: IGpsElement;
|
|
||||||
pingDate: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ELocationStatus {
|
|
||||||
HomeOnStop = 0,
|
|
||||||
HomeOnMoving = 1,
|
|
||||||
RoamingOnStop = 2,
|
|
||||||
RoamingOnMoving = 3,
|
|
||||||
UnknownOnStop = 4,
|
|
||||||
UnknownOnMoving = 5,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EVehicleStatus {
|
|
||||||
GpsIsIncorrect = "_device_gps_is_incorrect",
|
|
||||||
Idling = "_device_is_idling",
|
|
||||||
Moving = "_device_is_moving",
|
|
||||||
Out = "_device_is_out",
|
|
||||||
Stoping = "_device_is_stoping",
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IVehicleStateElement {
|
|
||||||
ignition: IIgnition;
|
|
||||||
state: EVehicleStatus;
|
|
||||||
locationState: ELocationStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EAssetTypes {
|
|
||||||
Baby = "_baby",
|
|
||||||
Bicycle = "_bicycle",
|
|
||||||
Bus = "_bus",
|
|
||||||
Car = "_car",
|
|
||||||
Child = "_child",
|
|
||||||
Dog = "_dog",
|
|
||||||
Forklift = "_forklift",
|
|
||||||
Human = "_human",
|
|
||||||
Motorbike = "_motorbike",
|
|
||||||
Stuff = "_stuff",
|
|
||||||
Tractor = "_tractor",
|
|
||||||
Truck = "_truck",
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum EAssetValidTypes {
|
|
||||||
Passive = 0,
|
|
||||||
Active = 1,
|
|
||||||
Debt = 2,
|
|
||||||
Suspend = 3,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IVehicleElement {
|
|
||||||
assetId: ID;
|
|
||||||
driverId: ID;
|
|
||||||
owner: ID;
|
|
||||||
followers: ID[];
|
|
||||||
assetType: EAssetTypes;
|
|
||||||
name1: string;
|
|
||||||
name2: string;
|
|
||||||
name3: string;
|
|
||||||
description1: string;
|
|
||||||
description2: string;
|
|
||||||
registeredDate: Date;
|
|
||||||
updatedDate: Date;
|
|
||||||
modelYear: number;
|
|
||||||
currentKm: number;
|
|
||||||
valid: EAssetValidTypes;
|
|
||||||
showOnMap: boolean;
|
|
||||||
chassis_num: string;
|
|
||||||
brand: string;
|
|
||||||
color: string;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue